Skip to content

Commit 2b144e5

Browse files
authored
Merge pull request #293 from auth0/dev
Update and migrate migrations ip list
2 parents 9aa74d9 + b2c76c2 commit 2b144e5

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

WP_Auth0.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
/**
33
* Plugin Name: PLUGIN_NAME
44
* Description: PLUGIN_DESCRIPTION
5-
* Version: 3.2.16
5+
* Version: 3.2.17
66
* Author: Auth0
77
* Author URI: https://auth0.com
88
*/
99
define( 'WPA0_PLUGIN_FILE', __FILE__ );
1010
define( 'WPA0_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
1111
define( 'WPA0_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
1212
define( 'WPA0_LANG', 'wp-auth0' );
13-
define( 'AUTH0_DB_VERSION', 12 );
14-
define( 'WPA0_VERSION', '3.2.16' );
13+
define( 'AUTH0_DB_VERSION', 13 );
14+
define( 'WPA0_VERSION', '3.2.17' );
1515

1616
/**
1717
* Main plugin class

lib/WP_Auth0_DBManager.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,24 @@ public function install_db() {
114114

115115
if ( $this->current_db_version < 12 ) {
116116

117-
if ( strpos( $cdn_url, '10.' ) === false ) {
118-
$options->set('use_lock_10', false);
119-
} else {
120-
$options->set('use_lock_10', true);
121-
}
117+
if ( strpos( $cdn_url, '10.' ) === false ) {
118+
$options->set('use_lock_10', false);
119+
} else {
120+
$options->set('use_lock_10', true);
121+
}
122122

123-
}
123+
}
124+
125+
if ( $this->current_db_version < 13 ) {
126+
$ips = $options->get('migration_ips');
127+
$oldips = '138.91.154.99,54.221.228.15,54.183.64.135,54.67.77.38,54.67.15.170,54.183.204.205,54.173.21.107,54.85.173.28';
128+
129+
$ipCheck = new WP_Auth0_Ip_Check($options);
130+
131+
if ( $ips === $oldips ) {
132+
$options->set('migration_ips', $ipCheck->get_ip_by_region('us'));
133+
}
134+
}
124135

125136
$this->current_db_version = AUTH0_DB_VERSION;
126137
update_option( 'auth0_db_version', AUTH0_DB_VERSION );

lib/WP_Auth0_Ip_Check.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public function get_ips_by_domain( $domain ) {
2626
return null;
2727
}
2828

29+
public function get_ip_by_region($region) {
30+
return $this->valid_webtask_ips[$region];
31+
}
32+
2933
protected function get_request_ip() {
3034
$valid_proxy_ip = $this->a0_options->get( 'valid_proxy_ip' );
3135

0 commit comments

Comments
 (0)