Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deprecations for ip_range setting #618

Merged
merged 1 commit into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lib/WP_Auth0_Ip_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,14 @@ private function in_range( $ip, array $range ) {
return $ip >= $from && $ip <= $to;
}

// phpcs:disable
/*
* DEPRECATED
*/

/**
* TODO: Deprecate, not used. Also remove related setting.
* @deprecated - 3.9.0, unused
*
* @codeCoverageIgnore
* @codeCoverageIgnore - Deprecated
*/
public function init() {
if ( ! WP_Auth0_Options::Instance()->get( 'ip_range_check' ) || is_admin() ) {
Expand All @@ -221,9 +223,9 @@ public function init() {
}

/**
* TODO: Deprecate, not used.
* @deprecated - 3.9.0, unused
*
* @codeCoverageIgnore
* @codeCoverageIgnore - Deprecated
*/
public function check_activate( $val, $key ) {
if ( 'active' !== $key ) {
Expand All @@ -234,9 +236,9 @@ public function check_activate( $val, $key ) {
}

/**
* TODO: Deprecate, not used.
* @deprecated - 3.9.0, unused
*
* @codeCoverageIgnore
* @codeCoverageIgnore - Deprecated
*/
private function validate_ip() {
$ranges = $this->get_ranges();
Expand All @@ -253,9 +255,9 @@ private function validate_ip() {
}

/**
* TODO: Deprecate, not used. Also remove related setting.
* @deprecated - 3.9.0, unused
*
* @codeCoverageIgnore
* @codeCoverageIgnore - Deprecated
*/
private function get_ranges() {
$data = WP_Auth0_Options::Instance()->get( 'ip_ranges' );
Expand All @@ -282,6 +284,4 @@ private function get_ranges() {

return $ranges;
}

// phpcs:enable
}
76 changes: 38 additions & 38 deletions lib/admin/WP_Auth0_Admin_Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,44 +425,6 @@ public function render_auth0_implicit_workflow( $args = array() ) {
);
}

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved down, added @deprecation notice

* Render form field and description for the `ip_range_check` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* TODO: Deprecate, not used
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*
* @codeCoverageIgnore - Deprecated
*/
public function render_ip_range_check( $args = array() ) {
$this->render_switch( $args['label_for'], $args['opt_name'], 'wpa0_ip_ranges' );
}

/**
* Render form field and description for the `ip_ranges` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* TODO: Deprecate, not used
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*
* @codeCoverageIgnore - Deprecated
*/
public function render_ip_ranges( $args = array() ) {
$this->render_textarea_field( $args['label_for'], $args['opt_name'] );
$this->render_field_description(
__( 'Only one range per line! Range format should be as follows (spaces ignored): ', 'wp-auth0' ) .
__( '<br><code>xx.xx.xx.xx - yy.yy.yy.yy</code>', 'wp-auth0' )
);
}

/**
* Render form field and description for the `valid_proxy_ip` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
Expand Down Expand Up @@ -702,6 +664,44 @@ private function get_domain( $url ) {
* DEPRECATED
*/

/**
* Render form field and description for the `ip_range_check` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* @deprecated - 3.9.0, unused
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*
* @codeCoverageIgnore - Deprecated
*/
public function render_ip_range_check( $args = array() ) {
$this->render_switch( $args['label_for'], $args['opt_name'], 'wpa0_ip_ranges' );
}

/**
* Render form field and description for the `ip_ranges` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
*
* @deprecated - 3.9.0, unused
*
* @param array $args - callback args passed in from add_settings_field().
*
* @see WP_Auth0_Admin_Generic::init_option_section()
* @see add_settings_field()
*
* @codeCoverageIgnore - Deprecated
*/
public function render_ip_ranges( $args = array() ) {
$this->render_textarea_field( $args['label_for'], $args['opt_name'] );
$this->render_field_description(
__( 'Only one range per line! Range format should be as follows (spaces ignored): ', 'wp-auth0' ) .
__( '<br><code>xx.xx.xx.xx - yy.yy.yy.yy</code>', 'wp-auth0' )
);
}

/**
* Render form field and description for the `social_twitter_key` option.
* IMPORTANT: Internal callback use only, do not call this function directly!
Expand Down