IP Geo Block - Version 3.0.16

Version Description

  • Fix issue: Fix the issue that some functions did not work properly when "Validation timing" was set as "mu-plugins" (ip-geo-block-mu.php) under some conditions before WP 4.0.
  • New feature: Add "Sites list" page at Network admin page to look through the status of the sites if this plugin is network activated on multisite.
  • Improvement: Support Swift Performance Lite cache plugin with "Disk Cashe with PHP" caching mode.
  • Improvement: Apply simulation mode to not only the front-end but also to the back-end.
  • Improvement: Optimize SQL issuing to reduce some queries.
  • See 3.0.16 release note for some details.
Download this release

Release Info

Developer tokkonopapa
Plugin Icon 128x128 IP Geo Block
Version 3.0.16
Comparing to
See all releases

Code changes from version 3.0.15 to 3.0.16

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
Tags: security, firewall, brute force, vulnerability, login, wp-admin, admin, ajax, xmlrpc, comment, pingback, trackback, spam, IP address, geo, geolocation, buddypress, bbPress
5
Requires at least: 3.7
6
Tested up to: 4.9.8
7
- Stable tag: 3.0.15
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
10
@@ -104,7 +104,7 @@ All contributions will always be welcome. Or visit my [development blog](https:/
104
Please refer to [the document](https://www.ipgeoblock.com/codex/ "Codex | IP Geo Block")
105
or following descriptions for your best setup.
106
107
- = Validation rule settings =
108
109
* **Matching rule**
110
Choose either `White list` (recommended) or `Black list` to specify the countries from which you want to pass or block.
@@ -242,11 +242,11 @@ or following descriptions for your best setup.
242
243
= Does the site using this plugin comply with GDPR? =
244
245
- Using this plugin itself should not be the problem, because from version 3.0.11 IP addresses in logs and cache of this plugin are encrypted by default in preparation for personal data breach. It also not only provides a way to manually erase them but also has the functionality to remove them when those are exceeded a certain amount/time. The option "Privacy friendly" helps you to restrict sending the ip address to the 3rd parties such as geolocation APIs and whois service equipped in this plugin. However, these functions are part of the requirements that GDPR requires and do not guarantee that the site is compliant with GDPR. Refer to [3.0.11 release note](https://www.ipgeoblock.com/changelog/release-3.0.11.html) for details.
246
247
= Does this plugin support multisite? =
248
249
- It works on multisite, but there's no network setting at this moment.
250
251
= Does this plugin works well with caching? =
252
@@ -254,11 +254,11 @@ The short answer is **YES**, especially for the purpose of security e.g. blockin
254
255
The long answer is as follows:
256
257
- For the back-end protection, both blocking malicious access and blocking by country works fine, if you disable caching on the back-end. As for the front-end, there are 2 scenarios.
258
259
- The first one is the case that there's no cached page against a request to the specific page. In this scenario, this plugin responds a specific HTTP status code (including redirection) and defines the symbol `DONOTCACHEPAGE` when the request comes from blacklisted countries (or IPs). When the request comes from the whitelisted countries (or IPs), this plugin passes it to the caching plugin in order to generate a new cache.
260
261
- The second scenario is the case that there's a cached page. In this case, the response depends on the caching method you are employing. Currently, the following plugins and configurations can be supported if you want to [restrict content by geo-blocking](https://en.wikipedia.org/wiki/Geo-blocking "Geo-blocking - Wikipedia"):
262
263
- [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/ "WP Super Cache — WordPress Plugins")
264
Select "**Use PHP to serve cache files**" and enable "**Late init**".
@@ -269,6 +269,9 @@ The second scenario is the case that there's a cached page. In this case, the re
269
- [Vendi Cache](https://wordpress.org/plugins/vendi-cache/ "Vendi Cache — WordPress Plugins")
270
This plugin was formerly built in Wordfence. Select "**basic caching**" for Vendi Cache and **"mu-plugin" (ip-geo-block-mu.php)** for IP Geo Block.
271
272
Other plugins adopting `mod_rewrite` (e.g. WP Fastest Cache) or `advanced-cache.php` [drop-in](https://make.wordpress.org/core/2016/08/13/global-overloading-in-advanced-cache-php/ "Global overloading in advanced-cache.php – Make WordPress Core") (e.g. Comet Cache) or other caching method at server side might serve a normal page.
273
274
Thus your site would have less risk against the exploiting via vulnerable plugins and themes.
@@ -370,7 +373,7 @@ Please refer to "[How can I fix permission troubles?](https://www.ipgeoblock.com
370
== Screenshots ==
371
372
1. **IP Geo Plugin** - Settings tab
373
- 2. **IP Geo Plugin** - Validation rule settings
374
3. **IP Geo Plugin** - Back-end target settings
375
4. **IP Geo Plugin** - Front-end target settings
376
5. **IP Geo Plugin** - Geolocation API settings
@@ -382,15 +385,23 @@ Please refer to "[How can I fix permission troubles?](https://www.ipgeoblock.com
382
383
== Changelog ==
384
385
= 3.0.15 =
386
* **Fix issue:** Fix the issue that "Can not find Geolocation API libraries" error would always appear when once Geolite2, Maxmind and IP2Location were unselected.
387
* **Fix issue:** Fix the issue that https in ipstack.com is available only for premiums users.
388
* **New feature:** Introduce a new filter hook [`ip-geo-block-logs-preset`](https://www.ipgeoblock.com/codex/ip-geo-block-logs-preset.html "ip-geo-block-logs[-preset] | IP Geo Block") that adds an UI of "Preset filters" at "Search in logs".
389
* **Improvement:** Prevent to make a cached page by WP Fastest Cache on blocking when "Validation timing" is "init" action hook.
390
- * **Improvement:** Make the priofity of "UA string and qualification" is higher than that of "Block badly-behaved bots and crawlers" on public facing pages.
391
* **Improvement:** Update google charts based on the [release note](https://developers.google.com/chart/interactive/docs/release_notes "Google Charts Release Notes  |  Charts | Google Developers").
392
* **Improvement:** Always show "Google Maps API key" text box in "Plugin settings" section. If it is saved as empty, Google Maps API will no longer be used and a simple map will appear on "Search" tab.
393
- * **Improvement:** Follow the change the RIPE whois format related to AS number.
394
* **Improvement:** Add UI to select the number of entries per page on IP address tables.
395
* **Improvement:** Multiple entries on IP address tables can be selected across the pages for bulk action.
396
* **Improvement:** Multiple Geolocation APIs can be selected on "Search" tab.
@@ -432,7 +443,7 @@ Please refer to "[How can I fix permission troubles?](https://www.ipgeoblock.com
432
= 3.0.11 =
433
* **Improvement:** To comply with GDPR, IP address in logs/cache will be always encrypted. The option of "**Anonymize IP address**" was renamed to "**Privacy friendly**" in "**Privacy and record settings**". It will not only anonymize an IP address but also will restrict on sending to the 3rd parties such as geolocation APIs and whois service.
434
* **Improvement:** Update geolocation APIs and add a new one.
435
- * **Improvement:** Change the JavaScript compressor from Google Closure Compiler to UglifyJS 2 to prevent "Uncaught TypeError: Cannot read property toLowerCase of undefined" in a certain environment.
436
* **Fix:** Fix the issue that blocking occurred immediately instead of displaying the login page again when login failed, even the number of times did not exceed the limit.
437
* See [3.0.11 release note](https://www.ipgeoblock.com/changelog/release-3.0.11.html) for some details.
438
@@ -448,9 +459,9 @@ Please refer to "[How can I fix permission troubles?](https://www.ipgeoblock.com
448
* **Fix:** Validation timing was not proper when redirection happened in admin context. (#36)
449
450
= 3.0.10.1 =
451
- This release is intented to fix the issue reported at forum [here](https://wordpress.org/support/topic/error-on-updating-version-3-0-10/ "Error on updating Versión 3.0.10") and [here](https://wordpress.org/support/topic/error-report-on-latest-update/ "error report on latest update").
452
453
- If you still find the error "/plugins/ip-geo-block/classes/class-ip-geo-block-logs.php (837) Unknown column last in field list’", please deactivate plugin once and activate again. You will see the same error message again, but the things should be fixed.
454
455
= 3.0.10 =
456
* **New feature:** Add "Block badly-behaved bots and crawlers" in "Front-end target settings" section that validates the frequency of request.
@@ -706,7 +717,7 @@ This is a maintenance release addressing some issues.
706
= 2.2.4.1 =
707
Sorry for frequent updating.
708
709
- * **Bug fix:** Fixed the issue of `Warning: strpos(): Empty needle in...` that was reported in [@](https://wordpress.org/support/topic/version-224-produces-warning-message "WordPress › Support » Version 2.2.4 Produces Warning Message") and [@](https://wordpress.org/support/topic/error-after-update-to-newest-version "WordPress Support » Error after Update to newest version").
710
711
= 2.2.4 =
712
* **Bug fix:** Fixed the issue that some links on network admin of multisite were blocked when WP-ZEP for `admin area` or `admin ajax/post` was enabled.
4
Tags: security, firewall, brute force, vulnerability, login, wp-admin, admin, ajax, xmlrpc, comment, pingback, trackback, spam, IP address, geo, geolocation, buddypress, bbPress
5
Requires at least: 3.7
6
Tested up to: 4.9.8
7
+ Stable tag: 3.0.16
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
10
104
Please refer to [the document](https://www.ipgeoblock.com/codex/ "Codex | IP Geo Block")
105
or following descriptions for your best setup.
106
107
+ = Validation rules and behavior =
108
109
* **Matching rule**
110
Choose either `White list` (recommended) or `Black list` to specify the countries from which you want to pass or block.
242
243
= Does the site using this plugin comply with GDPR? =
244
245
+ Since version 3.0.11, this plugin has been designed based on the principle "Privacy by design" in GDPR so that you can compliantly run it to GDPR. In preparation for personal data breach, IP addresses in this plugin are encrypted by default and also can be anonymized. It also provides some functions not only to manually erase them but also to automatically remove them when those are exceeded a certain amount/time. Refer to [3.0.11 release note](https://www.ipgeoblock.com/changelog/release-3.0.11.html) for more details.
246
247
= Does this plugin support multisite? =
248
249
+ Yes. You can synchronize the settings with all the sites on the network when you activate on network and enable "**Network wide settings**" in "**Plugin settings**" section.
250
251
= Does this plugin works well with caching? =
252
254
255
The long answer is as follows:
256
257
+ For the back-end protection, both blocking malicious access and blocking by country work fine, if you disable caching on the back-end. As for the front-end, there are 2 scenarios.
258
259
+ The first one is the case that there's no cached page against a request to the specific page. In this scenario, this plugin responds a specific HTTP status code (including redirection) when the request comes from blacklisted countries (or IPs) and exit telling the caching plugin not to make a cached page. When the request comes from the whitelisted countries (or IPs), this plugin passes it to the caching plugin in order to generate a new cache.
260
261
+ The second scenario is the case that there's a cached page. In this case, the response depends on the caching method you are employing. Currently, the following plugins can be supported with specific configurations if you want to [restrict contents by geolocation](https://en.wikipedia.org/wiki/Geo-blocking "Geo-blocking - Wikipedia"):
262
263
- [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/ "WP Super Cache — WordPress Plugins")
264
Select "**Use PHP to serve cache files**" and enable "**Late init**".
269
- [Vendi Cache](https://wordpress.org/plugins/vendi-cache/ "Vendi Cache — WordPress Plugins")
270
This plugin was formerly built in Wordfence. Select "**basic caching**" for Vendi Cache and **"mu-plugin" (ip-geo-block-mu.php)** for IP Geo Block.
271
272
+ - [Swift Performance Lite](https://wordpress.org/plugins/swift-performance-lite/ "Swift Performance Lite | WordPress.org")
273
+ Select "Disk Cashe with PHP" caching mode.
274
+
275
Other plugins adopting `mod_rewrite` (e.g. WP Fastest Cache) or `advanced-cache.php` [drop-in](https://make.wordpress.org/core/2016/08/13/global-overloading-in-advanced-cache-php/ "Global overloading in advanced-cache.php – Make WordPress Core") (e.g. Comet Cache) or other caching method at server side might serve a normal page.
276
277
Thus your site would have less risk against the exploiting via vulnerable plugins and themes.
373
== Screenshots ==
374
375
1. **IP Geo Plugin** - Settings tab
376
+ 2. **IP Geo Plugin** - Validation rules and behavior
377
3. **IP Geo Plugin** - Back-end target settings
378
4. **IP Geo Plugin** - Front-end target settings
379
5. **IP Geo Plugin** - Geolocation API settings
385
386
== Changelog ==
387
388
+ = 3.0.16 =
389
+ * **Fix issue:** Fix the issue that some functions did not work properly when "Validation timing" was set as `"mu-plugins" (ip-geo-block-mu.php)` under some conditions before WP 4.0.
390
+ * **New feature:** Add "**Sites list**" page at Network admin page to look through the status of the sites if this plugin is network activated on multisite.
391
+ * **Improvement:** Support [Swift Performance Lite](https://wordpress.org/plugins/swift-performance-lite/ "Swift Performance Lite | WordPress.org") cache plugin with "Disk Cashe with PHP" caching mode.
392
+ * **Improvement:** Apply simulation mode to not only the front-end but also to the back-end.
393
+ * **Improvement:** Optimize SQL issuing to reduce some queries.
394
+ * See [3.0.16 release note](https://www.ipgeoblock.com/changelog/release-3.0.16.html) for some details.
395
+
396
= 3.0.15 =
397
* **Fix issue:** Fix the issue that "Can not find Geolocation API libraries" error would always appear when once Geolite2, Maxmind and IP2Location were unselected.
398
* **Fix issue:** Fix the issue that https in ipstack.com is available only for premiums users.
399
* **New feature:** Introduce a new filter hook [`ip-geo-block-logs-preset`](https://www.ipgeoblock.com/codex/ip-geo-block-logs-preset.html "ip-geo-block-logs[-preset] | IP Geo Block") that adds an UI of "Preset filters" at "Search in logs".
400
* **Improvement:** Prevent to make a cached page by WP Fastest Cache on blocking when "Validation timing" is "init" action hook.
401
+ * **Improvement:** Make the priority of "UA string and qualification" is higher than that of "Block badly-behaved bots and crawlers" on public facing pages.
402
* **Improvement:** Update google charts based on the [release note](https://developers.google.com/chart/interactive/docs/release_notes "Google Charts Release Notes  |  Charts | Google Developers").
403
* **Improvement:** Always show "Google Maps API key" text box in "Plugin settings" section. If it is saved as empty, Google Maps API will no longer be used and a simple map will appear on "Search" tab.
404
+ * **Improvement:** Follow the change of RIPE whois format related to AS number.
405
* **Improvement:** Add UI to select the number of entries per page on IP address tables.
406
* **Improvement:** Multiple entries on IP address tables can be selected across the pages for bulk action.
407
* **Improvement:** Multiple Geolocation APIs can be selected on "Search" tab.
443
= 3.0.11 =
444
* **Improvement:** To comply with GDPR, IP address in logs/cache will be always encrypted. The option of "**Anonymize IP address**" was renamed to "**Privacy friendly**" in "**Privacy and record settings**". It will not only anonymize an IP address but also will restrict on sending to the 3rd parties such as geolocation APIs and whois service.
445
* **Improvement:** Update geolocation APIs and add a new one.
446
+ * **Improvement:** Change the JavaScript compressor from Google Closure Compiler to UglifyJS 2 to prevent "Uncaught TypeError: Cannot read property 'toLowerCase' of undefined" in a certain environment.
447
* **Fix:** Fix the issue that blocking occurred immediately instead of displaying the login page again when login failed, even the number of times did not exceed the limit.
448
* See [3.0.11 release note](https://www.ipgeoblock.com/changelog/release-3.0.11.html) for some details.
449
459
* **Fix:** Validation timing was not proper when redirection happened in admin context. (#36)
460
461
= 3.0.10.1 =
462
+ This release is intented to fix the issue reported at forum [here](https://wordpress.org/support/topic/error-on-updating-version-3-0-10/ "Error on updating Version 3.0.10") and [here](https://wordpress.org/support/topic/error-report-on-latest-update/ "error report on latest update").
463
464
+ If you still find the error "/plugins/ip-geo-block/classes/class-ip-geo-block-logs.php (837) Unknown column 'last' in 'field list'", please deactivate plugin once and activate again. You will see the same error message again, but the things should be fixed.
465
466
= 3.0.10 =
467
* **New feature:** Add "Block badly-behaved bots and crawlers" in "Front-end target settings" section that validates the frequency of request.
717
= 2.2.4.1 =
718
Sorry for frequent updating.
719
720
+ * **Bug fix:** Fixed the issue of `Warning: strpos(): Empty needle in...` that was reported in [@](https://wordpress.org/support/topic/version-224-produces-warning-message "WordPress › Support » Version 2.2.4 Produces Warning Message") and [@](https://wordpress.org/support/topic/error-after-update-to-newest-version "WordPress › Support » Error after Update to newest version").
721
722
= 2.2.4 =
723
* **Bug fix:** Fixed the issue that some links on network admin of multisite were blocked when WP-ZEP for `admin area` or `admin ajax/post` was enabled.
admin/class-ip-geo-block-admin.php CHANGED
@@ -8,7 +8,7 @@
8
* @link https://www.ipgeoblock.com/
9
* @copyright 2013-2018 tokkonopapa
10
*/
11
- define( 'IP_GEO_BLOCK_NETWORK', FALSE );
12
13
class IP_Geo_Block_Admin {
14
@@ -24,7 +24,7 @@ class IP_Geo_Block_Admin {
24
*
25
*/
26
private static $instance = NULL;
27
- private $is_network_admin = NULL;
28
private $admin_tab = 0;
29
30
/**
@@ -43,7 +43,7 @@ class IP_Geo_Block_Admin {
43
// add_action( 'admin_init', array( $this, 'add_privacy_policy' ) );
44
45
// Setup a nonce to validate authentication.
46
- add_filter( 'wp_redirect', array( $this, 'add_redirect_nonce' ), 10, 2 );
47
}
48
49
/**
@@ -64,21 +64,19 @@ class IP_Geo_Block_Admin {
64
file_exists( $file = IP_Geo_Block_Util::unslashit( $settings['api_dir'] ) . '/drop-in-admin.php' ) and include( $file );
65
66
// Add the options page and menu item.
67
- add_action( 'admin_menu', array( $this, 'setup_admin_page' ) );
68
- add_action( 'admin_post_ip_geo_block', array( $this, 'admin_ajax_callback' ) );
69
- add_action( 'wp_ajax_ip_geo_block', array( $this, 'admin_ajax_callback' ) );
70
add_filter( 'wp_prepare_revision_for_js', array( $this, 'add_revision_nonce' ), 10, 3 );
71
72
if ( IP_Geo_Block_Util::is_user_logged_in() )
73
add_filter( IP_Geo_Block::PLUGIN_NAME . '-bypass-admins', array( $this, 'verify_request' ), 10, 2 );
74
75
- if ( is_multisite() ) {
76
$this->is_network_admin = current_user_can( 'manage_network_options' );
77
- add_action( 'network_admin_menu', array( $this, 'setup_admin_page' ) );
78
- if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) { // @since 3.0.0
79
- add_action( 'wpmu_new_blog', array( $this, 'create_blog' ), 10, 6 ); // on creating a new blog @since MU
80
- add_action( 'delete_blog', array( $this, 'delete_blog' ), 10, 2 ); // on deleting an old blog @since 3.0.0
81
- }
82
}
83
84
// loads a plugin’s translated strings.
@@ -98,6 +96,14 @@ class IP_Geo_Block_Admin {
98
}
99
}
100
101
/**
102
* Add webview class into the body.
103
*
@@ -134,7 +140,7 @@ class IP_Geo_Block_Admin {
134
*/
135
public function add_revision_nonce( $revisions_data, $revision, $post ) {
136
$revisions_data['restoreUrl'] = add_query_arg(
137
- $nonce = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce',
138
IP_Geo_Block_Util::create_nonce( $nonce ),
139
$revisions_data['restoreUrl']
140
);
@@ -176,7 +182,7 @@ class IP_Geo_Block_Admin {
176
177
// Copy option from main blog.
178
if ( $this->is_network_admin && $settings['network_wide'] )
179
- update_option( IP_Geo_Block::OPTION_NAME, $settings );
180
181
// Restore the main blog.
182
restore_current_blog();
@@ -225,7 +231,7 @@ class IP_Geo_Block_Admin {
225
if ( 4 === $this->admin_tab )
226
break;
227
228
- case 5: /* Site list */
229
// js for google charts
230
wp_register_script(
231
$addon = IP_Geo_Block::PLUGIN_NAME . '-google-chart',
@@ -389,10 +395,10 @@ class IP_Geo_Block_Admin {
389
echo '<strong>IP Geo Block:</strong> ', IP_Geo_Block_Util::kses( $msg );
390
echo '</p></div>', "\n";
391
}
392
- }
393
394
- // delete all admin noties
395
- delete_transient( $key );
396
}
397
398
/**
@@ -415,8 +421,8 @@ class IP_Geo_Block_Admin {
415
* Get the admin url that depends on network multisite.
416
*
417
*/
418
- public function dashboard_url( $network = NULL ) {
419
- return ( is_null( $network ) ? $this->is_network_admin : $network ) ? network_admin_url( 'admin.php' /*'settings.php'*/ ) : admin_url( 'options-general.php' );
420
}
421
422
/**
@@ -425,7 +431,6 @@ class IP_Geo_Block_Admin {
425
*/
426
private function add_plugin_admin_menu( $settings ) {
427
// Control tab number
428
- // `admin_menu` or `network_admin_menu` @since: 2.5
429
if ( $admin_menu = ( 'admin_menu' === current_filter() ) ) {
430
if ( $this->is_network_admin && $settings['network_wide'] )
431
$this->admin_tab = min( 4, max( 1, $this->admin_tab ) );
@@ -485,7 +490,7 @@ class IP_Geo_Block_Admin {
485
add_submenu_page(
486
IP_Geo_Block::PLUGIN_NAME,
487
__( 'IP Geo Block', 'ip-geo-block' ),
488
- __( 'Site List', 'ip-geo-block' ),
489
'manage_network_options',
490
IP_Geo_Block::PLUGIN_NAME . '&amp;tab=5',
491
array( $this, 'display_plugin_admin_page' )
@@ -510,7 +515,7 @@ class IP_Geo_Block_Admin {
510
*/
511
private function diagnose_admin_screen( $settings ) {
512
$updating = get_transient( IP_Geo_Block::CRON_NAME );
513
- $adminurl = $this->dashboard_url( $this->is_network_admin && $settings['network_wide'] );
514
515
// Check version and compatibility
516
if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
@@ -547,13 +552,13 @@ class IP_Geo_Block_Admin {
547
if ( -1 === (int)$settings['matching_rule'] ) {
548
if ( FALSE !== $updating ) {
549
self::add_admin_notice( 'notice-warning', sprintf(
550
- __( 'Now downloading geolocation databases in background. After a little while, please check your country code and &#8220;<strong>Matching rule</strong>&#8221; at <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
551
esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) )
552
) );
553
}
554
else {
555
self::add_admin_notice( 'error', sprintf(
556
- __( 'The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please confirm it at <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
557
esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) )
558
) );
559
}
@@ -591,11 +596,11 @@ class IP_Geo_Block_Admin {
591
) . ' ' .
592
( 'ZZ' !== $validate['code'] ?
593
sprintf(
594
- __( 'Please check your &#8220;%sValidation rule settings%s&#8221;.', 'ip-geo-block' ),
595
'<strong><a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 0, 'sec' => 0 ), $adminurl ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-0' ) . '">', '</a></strong>'
596
) :
597
sprintf(
598
- __( 'Please confirm your local geolocation databases at &#8220;%sLocal database settings%s&#8221; section and remove your IP address in cache at &#8220;%sStatistics in cache%s&#8221; section.', 'ip-geo-block' ),
599
'<strong><a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 0, 'sec' => 5 ), $adminurl ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-5' ) . '">', '</a></strong>',
600
'<strong><a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 1, 'sec' => 2 ), $adminurl ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-2' ) . '">', '</a></strong>'
601
)
@@ -604,15 +609,7 @@ class IP_Geo_Block_Admin {
604
break;
605
}
606
}
607
- if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
608
- // Check database tables
609
- if ( $settings['cache_hold'] || $settings['validation']['reclogs'] ) {
610
- if ( ( $warn = IP_Geo_Block_Logs::diag_tables() ) &&
611
- ( TRUE !== IP_Geo_Block_Logs::create_tables() ) ) {
612
- self::add_admin_notice( 'notice-warning', $warn );
613
- }
614
- }
615
- endif;
616
// Check consistency of emergency login link
617
if ( isset( $settings['login_link'] ) && $settings['login_link']['link'] && ! IP_Geo_Block_Util::verify_link( $settings['login_link']['link'], $settings['login_link']['hash'] ) ) {
618
self::add_admin_notice( 'error',
@@ -658,7 +655,7 @@ endif;
658
}
659
660
// Register scripts for admin.
661
- add_action( 'admin_enqueue_scripts', 'IP_Geo_Block::enqueue_nonce', 0 );
662
663
// Show admin notices at the place where it should be. @since 2.5.0
664
add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
@@ -738,7 +735,7 @@ endif;
738
4 => __( 'Logs', 'ip-geo-block' ),
739
2 => __( 'Search', 'ip-geo-block' ),
740
3 => __( 'Attribution', 'ip-geo-block' ),
741
- 5 => __( 'Site List', 'ip-geo-block' ),
742
);
743
744
$settings = IP_Geo_Block::get_option();
@@ -748,21 +745,21 @@ endif;
748
// Target page that depends on the network multisite or not.
749
if ( 'options-general.php' === $GLOBALS['pagenow'] ) {
750
$action = 'options.php';
751
- unset( $tabs[5] ); // Site List
752
if ( IP_GEO_BLOCK_NETWORK && $this->is_network_admin ) {
753
if ( $settings['network_wide'] ) {
754
unset( $tabs[0] ); // Settings
755
}
756
$title .= ' <span class="ip-geo-block-menu-link">';
757
- $title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Network wide', 'ip-geo-block' ) . '</a> ]';
758
$title .= '</span>';
759
}
760
}
761
762
// '/wp-admin/network/admin.php'
763
else {
764
- // `edit.php` is an action handler for Multisite administration panels.
765
- // `edit.php` ==> do action `network_admin_edit_IP_GEO_BLOCK` ==> `validate_network_settings()`
766
$action = 'edit.php?action=' . IP_Geo_Block::PLUGIN_NAME;
767
if ( $this->is_network_admin ) {
768
if ( ! $settings['network_wide'] ) {
@@ -770,7 +767,7 @@ endif;
770
}
771
unset( $tabs[1], $tabs[4], $tabs[2], $tabs[3] ); // Statistics, Logs, Search, Attribution
772
$title .= ' <span class="ip-geo-block-menu-link">';
773
- $title .= '[ ' . __( 'Network wide', 'ip-geo-block' ) . ' ]';
774
$title .= '</span>';
775
}
776
}
@@ -788,7 +785,7 @@ endif;
788
<input id="ip-geo-block-live-update" type="checkbox"<?php checked( isset( $cookie[4][1] ) && 'o' === $cookie[4][1] ); disabled( $settings['validation']['reclogs'] && extension_loaded( 'pdo_sqlite' ), FALSE ); ?> /><label for="ip-geo-block-live-update">
789
<dfn title="<?php _e( 'Independent of &#8220;Privacy and record settings&#8221;, you can see all the requests validated by this plugin in almost real time.', 'ip-geo-block' ); ?>"><?php _e( 'Live update', 'ip-geo-block' ); ?></dfn>
790
</label>
791
- <?php } elseif (5 === $tab ) { /* Site List tab */ ?>
792
<input id="ip-geo-block-open-new" type="checkbox"<?php checked( isset( $cookie[5][1] ) && 'o' === $cookie[5][1] );?> /><label for="ip-geo-block-open-new">
793
<dfn title="<?php _e( 'Open a new window on clicking the link in the chart.', 'ip-geo-block' ); ?>"><?php _e( 'Open a new window', 'ip-geo-block' ); ?></dfn>
794
</label>
@@ -892,13 +889,13 @@ endif;
892
foreach ( $args['list'] as $key => $val ) { ?>
893
<li>
894
<input type="checkbox" id="<?php echo $id, $sub_id, '_', $key; ?>" name="<?php echo $name, $sub_name, '[', $key, ']'; ?>" value="<?php echo $key; ?>"<?php
895
- checked( is_array( $args['value'] ) ? ! empty( $args['value'][ $key ] ) : ( $key & $args['value'] ? TRUE : FALSE ) ); ?> />
896
- <label for="<?php echo $id, $sub_id, '_', $key; ?>"><?php
897
if ( isset( $args['desc'][ $key ] ) )
898
echo '<dfn title="', $args['desc'][ $key ], '">', $val, '</dfn>';
899
else
900
- echo $val; ?>
901
- </label>
902
</li>
903
<?php
904
}
@@ -908,12 +905,12 @@ endif;
908
case 'checkbox': ?>
909
<input type="checkbox" id="<?php echo $id, $sub_id; ?>" name="<?php echo $name, $sub_name; ?>" value="1"<?php
910
checked( esc_attr( $args['value'] ) );
911
- disabled( ! empty( $args['disabled'] ), TRUE ); ?> />
912
- <label for="<?php echo $id, $sub_id; ?>"><?php
913
if ( isset( $args['text'] ) ) echo esc_attr( $args['text'] );
914
else if ( isset( $args['html'] ) ) echo $args['html'];
915
- else _e( 'Enable', 'ip-geo-block' ); ?>
916
- </label>
917
<?php
918
break;
919
@@ -1130,7 +1127,7 @@ endif;
1130
// Initialize not on the form (mainly unchecked checkbox)
1131
public function preprocess_options( $output, $default ) {
1132
// initialize checkboxes not in the form (added after 2.0.0, just in case)
1133
- foreach ( array( 'providers', 'save_statistics', 'cache_hold', 'anonymize', 'restrict_api', 'network_wide', 'clean_uninstall' ) as $key ) {
1134
$output[ $key ] = is_array( $default[ $key ] ) ? array() : 0;
1135
}
1136
@@ -1153,7 +1150,7 @@ endif;
1153
}
1154
1155
// keep disabled checkboxes not in the form
1156
- foreach ( array( 'target_pages', 'target_posts', 'target_cates', 'target_tags', 'simulate', 'dnslkup', 'behavior' ) as $key ) {
1157
$output['public'][ $key ] = is_array( $default['public'][ $key ] ) ? array() : FALSE;
1158
}
1159
@@ -1339,7 +1336,7 @@ endif;
1339
$settings = IP_Geo_Block::get_option();
1340
if ( ( $ajax and $settings['validation']['ajax' ] & 2 ) ||
1341
( ! $ajax and $settings['validation']['admin'] & 2 ) ) {
1342
- $action = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce';
1343
$nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( $action ), $action );
1344
}
1345
@@ -1428,9 +1425,9 @@ endif;
1428
1429
foreach ( $blog_ids as $id ) {
1430
switch_to_blog( $id );
1431
- $map = IP_Geo_Block::get_option();
1432
$settings['api_key']['GoogleMap'] = $map['api_key']['GoogleMap'];
1433
- $ret &= update_option( IP_Geo_Block::OPTION_NAME, $settings );
1434
restore_current_blog();
1435
}
1436
@@ -1519,7 +1516,7 @@ endif;
1519
case 'gmap-error': // Reset Google Maps API key
1520
if ( $settings['api_key']['GoogleMap'] === 'default' ) {
1521
$settings['api_key']['GoogleMap'] = NULL;
1522
- update_option( IP_Geo_Block::OPTION_NAME, $settings );
1523
$res = array(
1524
'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
1525
'tab' => 'tab=2'
@@ -1528,11 +1525,11 @@ endif;
1528
break;
1529
1530
case 'generate-link': // Generate new link
1531
- $res = array( 'link' => IP_Geo_Block_Util::generate_link() );
1532
break;
1533
1534
case 'delete-link': // Delete existing link
1535
- IP_Geo_Block_Util::delete_link();
1536
break;
1537
1538
case 'show-info': // Show system and debug information
@@ -1588,7 +1585,7 @@ endif;
1588
if ( $this->is_network_admin && $settings['network_wide'] )
1589
$this->update_multisite_settings( $settings );
1590
else
1591
- update_option( IP_Geo_Block::OPTION_NAME, $settings );
1592
1593
$res = array( 'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME );
1594
break;
@@ -1627,10 +1624,9 @@ endif;
1627
$res = IP_Geo_Block_Admin_Ajax::find_exceptions( $cmd );
1628
break;
1629
1630
- case 'init-table':
1631
- // Need to define `IP_GEO_BLOCK_DEBUG` to true
1632
- IP_Geo_Block_Logs::delete_tables();
1633
- IP_Geo_Block_Logs::create_tables();
1634
$res = array( 'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME );
1635
break;
1636
}
8
* @link https://www.ipgeoblock.com/
9
* @copyright 2013-2018 tokkonopapa
10
*/
11
+ define( 'IP_GEO_BLOCK_NETWORK', TRUE );
12
13
class IP_Geo_Block_Admin {
14
24
*
25
*/
26
private static $instance = NULL;
27
+ private $is_network_admin = FALSE;
28
private $admin_tab = 0;
29
30
/**
43
// add_action( 'admin_init', array( $this, 'add_privacy_policy' ) );
44
45
// Setup a nonce to validate authentication.
46
+ add_filter( 'wp_redirect', array( $this, 'add_redirect_nonce' ), 10, 2 ); // @since 2.1.0
47
}
48
49
/**
64
file_exists( $file = IP_Geo_Block_Util::unslashit( $settings['api_dir'] ) . '/drop-in-admin.php' ) and include( $file );
65
66
// Add the options page and menu item.
67
+ add_action( 'admin_menu', array( $this, 'setup_admin_page' ) ); // @since: 2.5.0
68
+ add_action( 'admin_post_ip_geo_block', array( $this, 'admin_ajax_callback' ) ); // @since: 2.6.0
69
+ add_action( 'wp_ajax_ip_geo_block', array( $this, 'admin_ajax_callback' ) ); // @since: 2.1.0
70
add_filter( 'wp_prepare_revision_for_js', array( $this, 'add_revision_nonce' ), 10, 3 );
71
72
if ( IP_Geo_Block_Util::is_user_logged_in() )
73
add_filter( IP_Geo_Block::PLUGIN_NAME . '-bypass-admins', array( $this, 'verify_request' ), 10, 2 );
74
75
+ if ( is_multisite() && is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) { // @since: 3.0.0
76
$this->is_network_admin = current_user_can( 'manage_network_options' );
77
+ add_action( 'network_admin_menu', array( $this, 'setup_admin_page' ) ); // @since: 2.5
78
+ add_action( 'wpmu_new_blog', array( $this, 'create_blog' ), 10, 6 ); // on creating a new blog @since MU
79
+ add_action( 'delete_blog', array( $this, 'delete_blog' ), 10, 2 ); // on deleting an old blog @since 3.0.0
80
}
81
82
// loads a plugin’s translated strings.
96
}
97
}
98
99
+ /**
100
+ * Whether this plugin activated by network or not.
101
+ *
102
+ */
103
+ public function is_network_admin() {
104
+ return $this->is_network_admin;
105
+ }
106
+
107
/**
108
* Add webview class into the body.
109
*
140
*/
141
public function add_revision_nonce( $revisions_data, $revision, $post ) {
142
$revisions_data['restoreUrl'] = add_query_arg(
143
+ $nonce = IP_Geo_Block::get_auth_key(),
144
IP_Geo_Block_Util::create_nonce( $nonce ),
145
$revisions_data['restoreUrl']
146
);
182
183
// Copy option from main blog.
184
if ( $this->is_network_admin && $settings['network_wide'] )
185
+ IP_Geo_Block::update_option( $settings, FALSE );
186
187
// Restore the main blog.
188
restore_current_blog();
231
if ( 4 === $this->admin_tab )
232
break;
233
234
+ case 5: /* Sites list */
235
// js for google charts
236
wp_register_script(
237
$addon = IP_Geo_Block::PLUGIN_NAME . '-google-chart',
395
echo '<strong>IP Geo Block:</strong> ', IP_Geo_Block_Util::kses( $msg );
396
echo '</p></div>', "\n";
397
}
398
399
+ // delete all admin noties
400
+ delete_transient( $key );
401
+ }
402
}
403
404
/**
421
* Get the admin url that depends on network multisite.
422
*
423
*/
424
+ public function dashboard_url( $network_wide = FALSE ) {
425
+ return ( $network_wide ? $this->is_network_admin : $network_wide ) ? network_admin_url( 'admin.php' /*'settings.php'*/ ) : admin_url( 'options-general.php' );
426
}
427
428
/**
431
*/
432
private function add_plugin_admin_menu( $settings ) {
433
// Control tab number
434
if ( $admin_menu = ( 'admin_menu' === current_filter() ) ) {
435
if ( $this->is_network_admin && $settings['network_wide'] )
436
$this->admin_tab = min( 4, max( 1, $this->admin_tab ) );
490
add_submenu_page(
491
IP_Geo_Block::PLUGIN_NAME,
492
__( 'IP Geo Block', 'ip-geo-block' ),
493
+ __( 'Sites list', 'ip-geo-block' ),
494
'manage_network_options',
495
IP_Geo_Block::PLUGIN_NAME . '&amp;tab=5',
496
array( $this, 'display_plugin_admin_page' )
515
*/
516
private function diagnose_admin_screen( $settings ) {
517
$updating = get_transient( IP_Geo_Block::CRON_NAME );
518
+ $adminurl = $this->dashboard_url( $settings['network_wide'] );
519
520
// Check version and compatibility
521
if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
552
if ( -1 === (int)$settings['matching_rule'] ) {
553
if ( FALSE !== $updating ) {
554
self::add_admin_notice( 'notice-warning', sprintf(
555
+ __( 'Now downloading geolocation databases in background. After a little while, please check your country code and &#8220;<strong>Matching rule</strong>&#8221; at <a href="%s">Validation rules and behavior</a>.', 'ip-geo-block' ),
556
esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) )
557
) );
558
}
559
else {
560
self::add_admin_notice( 'error', sprintf(
561
+ __( 'The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please confirm it at <a href="%s">Validation rules and behavior</a>.', 'ip-geo-block' ),
562
esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) )
563
) );
564
}
596
) . ' ' .
597
( 'ZZ' !== $validate['code'] ?
598
sprintf(
599
+ __( 'Please check your &#8220;%sValidation rules and behavior%s&#8221;.', 'ip-geo-block' ),
600
'<strong><a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 0, 'sec' => 0 ), $adminurl ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-0' ) . '">', '</a></strong>'
601
) :
602
sprintf(
603
+ __( 'Please confirm your local geolocation database files exist at &#8220;%sLocal database settings%s&#8221; section, or remove your IP address in cache at &#8220;%sStatistics in cache%s&#8221; section.', 'ip-geo-block' ),
604
'<strong><a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 0, 'sec' => 5 ), $adminurl ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-5' ) . '">', '</a></strong>',
605
'<strong><a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 1, 'sec' => 2 ), $adminurl ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-2' ) . '">', '</a></strong>'
606
)
609
break;
610
}
611
}
612
+
613
// Check consistency of emergency login link
614
if ( isset( $settings['login_link'] ) && $settings['login_link']['link'] && ! IP_Geo_Block_Util::verify_link( $settings['login_link']['link'], $settings['login_link']['hash'] ) ) {
615
self::add_admin_notice( 'error',
655
}
656
657
// Register scripts for admin.
658
+ add_action( 'admin_enqueue_scripts', array( 'IP_Geo_Block', 'enqueue_nonce' ), 0 );
659
660
// Show admin notices at the place where it should be. @since 2.5.0
661
add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
735
4 => __( 'Logs', 'ip-geo-block' ),
736
2 => __( 'Search', 'ip-geo-block' ),
737
3 => __( 'Attribution', 'ip-geo-block' ),
738
+ 5 => __( 'Sites list', 'ip-geo-block' ),
739
);
740
741
$settings = IP_Geo_Block::get_option();
745
// Target page that depends on the network multisite or not.
746
if ( 'options-general.php' === $GLOBALS['pagenow'] ) {
747
$action = 'options.php';
748
+ unset( $tabs[5] ); // Sites list
749
if ( IP_GEO_BLOCK_NETWORK && $this->is_network_admin ) {
750
if ( $settings['network_wide'] ) {
751
unset( $tabs[0] ); // Settings
752
}
753
$title .= ' <span class="ip-geo-block-menu-link">';
754
+ $title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Network', 'ip-geo-block' ) . '</a> ]';
755
$title .= '</span>';
756
}
757
}
758
759
// '/wp-admin/network/admin.php'
760
else {
761
+ // `edit.php` is an action handler for Multisite administration dashboard.
762
+ // `edit.php` ==> do action `network_admin_edit_ip-geo-block` ==> `validate_network_settings()`
763
$action = 'edit.php?action=' . IP_Geo_Block::PLUGIN_NAME;
764
if ( $this->is_network_admin ) {
765
if ( ! $settings['network_wide'] ) {
767
}
768
unset( $tabs[1], $tabs[4], $tabs[2], $tabs[3] ); // Statistics, Logs, Search, Attribution
769
$title .= ' <span class="ip-geo-block-menu-link">';
770
+ $title .= '[ ' . __( 'Network', 'ip-geo-block' ) . ' ]';
771
$title .= '</span>';
772
}
773
}
785
<input id="ip-geo-block-live-update" type="checkbox"<?php checked( isset( $cookie[4][1] ) && 'o' === $cookie[4][1] ); disabled( $settings['validation']['reclogs'] && extension_loaded( 'pdo_sqlite' ), FALSE ); ?> /><label for="ip-geo-block-live-update">
786
<dfn title="<?php _e( 'Independent of &#8220;Privacy and record settings&#8221;, you can see all the requests validated by this plugin in almost real time.', 'ip-geo-block' ); ?>"><?php _e( 'Live update', 'ip-geo-block' ); ?></dfn>
787
</label>
788
+ <?php } elseif (5 === $tab ) { /* Sites list tab */ ?>
789
<input id="ip-geo-block-open-new" type="checkbox"<?php checked( isset( $cookie[5][1] ) && 'o' === $cookie[5][1] );?> /><label for="ip-geo-block-open-new">
790
<dfn title="<?php _e( 'Open a new window on clicking the link in the chart.', 'ip-geo-block' ); ?>"><?php _e( 'Open a new window', 'ip-geo-block' ); ?></dfn>
791
</label>
889
foreach ( $args['list'] as $key => $val ) { ?>
890
<li>
891
<input type="checkbox" id="<?php echo $id, $sub_id, '_', $key; ?>" name="<?php echo $name, $sub_name, '[', $key, ']'; ?>" value="<?php echo $key; ?>"<?php
892
+ checked( is_array( $args['value'] ) ? ! empty( $args['value'][ $key ] ) : ( $key & $args['value'] ? TRUE : FALSE ) ); ?> /><label for="<?php
893
+ echo $id, $sub_id, '_', $key; ?>"><?php
894
if ( isset( $args['desc'][ $key ] ) )
895
echo '<dfn title="', $args['desc'][ $key ], '">', $val, '</dfn>';
896
else
897
+ echo $val;
898
+ ?></label>
899
</li>
900
<?php
901
}
905
case 'checkbox': ?>
906
<input type="checkbox" id="<?php echo $id, $sub_id; ?>" name="<?php echo $name, $sub_name; ?>" value="1"<?php
907
checked( esc_attr( $args['value'] ) );
908
+ disabled( ! empty( $args['disabled'] ), TRUE ); ?> /><label for="<?php
909
+ echo $id, $sub_id; ?>"><?php
910
if ( isset( $args['text'] ) ) echo esc_attr( $args['text'] );
911
else if ( isset( $args['html'] ) ) echo $args['html'];
912
+ else _e( 'Enable', 'ip-geo-block' );
913
+ ?></label>
914
<?php
915
break;
916
1127
// Initialize not on the form (mainly unchecked checkbox)
1128
public function preprocess_options( $output, $default ) {
1129
// initialize checkboxes not in the form (added after 2.0.0, just in case)
1130
+ foreach ( array( 'providers', 'save_statistics', 'cache_hold', 'anonymize', 'restrict_api', 'network_wide', 'clean_uninstall', 'simulate' ) as $key ) {
1131
$output[ $key ] = is_array( $default[ $key ] ) ? array() : 0;
1132
}
1133
1150
}
1151
1152
// keep disabled checkboxes not in the form
1153
+ foreach ( array( 'target_pages', 'target_posts', 'target_cates', 'target_tags', 'dnslkup', 'behavior' ) as $key ) {
1154
$output['public'][ $key ] = is_array( $default['public'][ $key ] ) ? array() : FALSE;
1155
}
1156
1336
$settings = IP_Geo_Block::get_option();
1337
if ( ( $ajax and $settings['validation']['ajax' ] & 2 ) ||
1338
( ! $ajax and $settings['validation']['admin'] & 2 ) ) {
1339
+ $action = IP_Geo_Block::get_auth_key();
1340
$nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( $action ), $action );
1341
}
1342
1425
1426
foreach ( $blog_ids as $id ) {
1427
switch_to_blog( $id );
1428
+ $map = IP_Geo_Block::get_option( FALSE );
1429
$settings['api_key']['GoogleMap'] = $map['api_key']['GoogleMap'];
1430
+ $ret &= IP_Geo_Block::update_option( $settings, FALSE );
1431
restore_current_blog();
1432
}
1433
1516
case 'gmap-error': // Reset Google Maps API key
1517
if ( $settings['api_key']['GoogleMap'] === 'default' ) {
1518
$settings['api_key']['GoogleMap'] = NULL;
1519
+ IP_Geo_Block::update_option( $settings );
1520
$res = array(
1521
'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
1522
'tab' => 'tab=2'
1525
break;
1526
1527
case 'generate-link': // Generate new link
1528
+ $res = array( 'link' => IP_Geo_Block_Util::generate_link( $this ) );
1529
break;
1530
1531
case 'delete-link': // Delete existing link
1532
+ IP_Geo_Block_Util::delete_link( $this );
1533
break;
1534
1535
case 'show-info': // Show system and debug information
1585
if ( $this->is_network_admin && $settings['network_wide'] )
1586
$this->update_multisite_settings( $settings );
1587
else
1588
+ IP_Geo_Block::update_option( $settings );
1589
1590
$res = array( 'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME );
1591
break;
1624
$res = IP_Geo_Block_Admin_Ajax::find_exceptions( $cmd );
1625
break;
1626
1627
+ case 'diag-tables':
1628
+ // Check database tables
1629
+ IP_Geo_Block_Logs::diag_tables() or IP_Geo_Block_Logs::create_tables();
1630
$res = array( 'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME );
1631
break;
1632
}
admin/css/admin-icons.css CHANGED
@@ -94,6 +94,7 @@
94
content: "\e900";
95
}
96
97
#toplevel_page_ip-geo-block .dashicons-admin-generic:before {
98
font-family: 'icomoon';
99
content: "\e62f";
94
content: "\e900";
95
}
96
97
+ /* Dashicons is the official icon font of the WordPress admin as of 3.8+. */
98
#toplevel_page_ip-geo-block .dashicons-admin-generic:before {
99
font-family: 'icomoon';
100
content: "\e62f";
admin/css/admin.css CHANGED
@@ -144,6 +144,13 @@ fieldset.ip-geo-block-field textarea.regular-text {
144
font-size: 95%;
145
}
146
147
/* Plugins/Themes area, Geolocation API settings */
148
input[id*="ip_geo_block_settings_rewrite_"] + label {
149
margin-left: 0.25em;
144
font-size: 95%;
145
}
146
147
+ /* Checkbox / Radio */
148
+ p.ip-geo-block-navi-link input[type="checkbox"],
149
+ fieldset.ip-geo-block-field input[type="checkbox"],
150
+ fieldset.ip-geo-block-field input[type="radio"] {
151
+ margin-right: 0.4em;
152
+ }
153
+
154
/* Plugins/Themes area, Geolocation API settings */
155
input[id*="ip_geo_block_settings_rewrite_"] + label {
156
margin-left: 0.25em;
admin/css/admin.min.css CHANGED
@@ -3,4 +3,4 @@
3
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
- dfn{cursor:help;border-bottom:1px dotted #888}fieldset,legend{padding:0;margin:0;border:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}fieldset{min-width:0}legend{display:block;line-height:inherit;width:100%}label{display:inline-block;max-width:100%}.panel{border-color:#888;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);background:#f5f5f5}.panel-heading{float:left!important;background:#fff}.panel-default>.panel-heading{border-color:inherit}.panel-body{width:100%;padding:0 1em;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.panel-body:after,.panel-body:before{content:" ";display:table}.panel-body:after{clear:both}.ip-geo-block-navi-link{text-align:left}.ip-geo-block-help-link{float:right;font-size:90%;font-weight:400}.ip-geo-block-help-link a{box-shadow:none}fieldset label{vertical-align:text-middle}fieldset input[type=checkbox]{margin:1px 2px 0}fieldset.ip-geo-block-field{margin:1em 0}fieldset.ip-geo-block-field h2,fieldset.ip-geo-block-field h3{padding:0;margin:0;font-size:14px!important}fieldset.ip-geo-block-field h4{margin:.75em 0 .5em 0}fieldset.ip-geo-block-field legend.panel-heading{padding:10px}fieldset.ip-geo-block-field .ip-geo-block-dropdown,fieldset.ip-geo-block-field .ip-geo-block-dropup{cursor:pointer;position:relative;padding-left:1em}fieldset.ip-geo-block-field .ip-geo-block-dropdown:before,fieldset.ip-geo-block-field .ip-geo-block-dropup:before{content:'';height:0;width:0;border:.4em solid transparent;position:absolute}fieldset.ip-geo-block-field .ip-geo-block-dropup:before{border-left:.4em solid #555;left:2px;top:18%}fieldset.ip-geo-block-field .ip-geo-block-dropdown:before{border-top:.4em solid #555;left:-2px;top:38%}fieldset.ip-geo-block-field .form-table .ip-geo-block-dropdown,fieldset.ip-geo-block-field .form-table .ip-geo-block-dropup{margin-top:.75em}fieldset.ip-geo-block-field ul.ip-geo-block-dropup:before{top:.25em}fieldset.ip-geo-block-field ul.ip-geo-block-dropdown:before{top:.5em}fieldset.ip-geo-block-field table.form-table{margin:0 0 .5em;width:100%}textarea.regular-text{width:25em}fieldset.ip-geo-block-field input.regular-text,fieldset.ip-geo-block-field textarea.regular-text{font-size:95%}input[id*=ip_geo_block_settings_rewrite_]+label{margin-left:.25em}input[id*=ip_geo_block_settings_providers]+label{min-width:7em}.ip-geo-block-settings-folding{margin:.5em 0}.ip-geo-block-settings-folding ul{margin-bottom:0}.ip-geo-block-settings-folding li{margin:.5em 0}.folding-disable{pointer-events:none;opacity:.5}.folding-inactive{opacity:.5;font-style:oblique!important}.ip-geo-block-float li{display:inline-block;width:18em;margin-top:0}.ip-geo-block-checked{list-style-type:disc}.ip-geo-block-ip-addr{display:inline-block;padding-top:5px}.ip-geo-block-hide{display:none}.ip-geo-block-sup{margin-left:.2em;display:inline-block}.ip-geo-block-note{margin-top:1em;list-style:disc inside}.ip-geo-block-note li{text-indent:-1em;padding-left:1em}.ip-geo-block-border{border-top:inherit}.ip-geo-block-notice{color:#dd3d36}.ip-geo-block-title{width:100px;display:inline-block}.ip-geo-block-result{color:#2786c2;display:inline-block}.ip-geo-block-primary{color:#fff!important;background:#00838f!important;border-color:#00707a!important;text-shadow:none}.ip-geo-block-primary:hover{background-color:#00919e!important;border-color:#00525a!important}ul#ip-geo-block-logs-preset{margin:.25em 0}ul#ip-geo-block-logs-preset li{float:left;margin-right:1em}#ip-geo-block-live-loading,.ip-geo-block-loading{height:16px;width:16px;background-size:16px 16px;background-position:center center;background-repeat:no-repeat;margin-left:1em;margin-top:.2em;display:inline-block;vertical-align:top}.ip-geo-block-loading{background-image:url(data:image/gif;base64,R0lGODlhEAAQAPYCAKqqqsbGxlZWVsrKyvr6+ubm5tDQ0K6urmZmZmJiYuzs7IaGhvT09JycnLq6us7Ozurq6o6OjtbW1tra2vDw8CgoKCYmJvz8/NLS0kJCQlJSUqysrPLy8vb29pqamra2tm5ubujo6Kampvj4+IiIiMjIyEhISNzc3OLi4rKysj4+PlBQULi4uJKSkmRkZODg4KKiou7u7iQkJB4eHlpaWhISErCwsHh4eMDAwDIyMi4uLqSkpIKCgr6+vt7e3n5+fggICJCQkAwMDEpKSmBgYHZ2dhgYGBYWFnx8fF5eXk5OTiIiIjAwMIyMjISEhDQ0NJaWltTU1AQEBBwcHGpqaoqKiuTk5CoqKlhYWAoKCtjY2Hp6ehAQEJ6ensLCwkxMTJSUlCwsLAYGBnR0dDg4OFxcXLy8vKCgoA4ODsTExMzMzDw8PERERDY2NqioqHJycrS0tGhoaBQUFEZGRjo6OkBAQICAgHBwcFRUVCAgIGxsbP///wAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgACACwAAAAAEAAQAEAHjIACgoOEhYJsbTGGghcPGIJRbFNNhgQKCheDDkllDQYMHSc4MAcvhTB0aFliggQjmYNEFQ6LAh0+VoIwbFW1GGamhCgfUE5NbgMKtQYLc0a1gjsyR3E2IYwMFASDYDJvtRRWFIJ1TMq1ElqCICpetQoBEoInVCsAhhI2XhyEPUgIIG7waALlwAloCAMBACH5BAkKAAIALAEAAQAOAA4AAAeDgAKCEmBYYRVKJAaCjAcrVzIzRjVoTw2MKRk5Ww4KECkuWTWCE0Rrl4yCTow7bAupsBcCW19psKkjBEQaFLeMHBwINBy+ggoxVQkPxSMFMXBUMMUQPhRWVUU9tyFRLwQCA048cCcjIyFaJQYxjA8NEVBnAClmahCwEANwbjYBJwyMAgEAIfkECQoABQAsAQABAA4ADgAAB4OABYInO29DbC5QUYKMZiBfbCptTBUmIow4LgJBaTExZkVLFTAFKD8JB4yMQUZrBixUXaqqVFwkUG8Ys4wpQiZOWwy7ghBiRk08HcOqblUTy4wlLWbLBCMFCgBdurMjFMoFE24ADxAXFwwKITEEjD5mH2YBDxI+IdeqHCcGAxgv7IwCAQAh+QQJCgAAACwBAAEADgAOAAAHhYAAglYfTVQJSCITgowDVSAISQJKJgkpjA8LWyIGHBQBJCoZBwAQDU44jIxdTxoSAxEfqqpbFWApUCezjA5LWCJdI7uCClNXGyLCwxBHFl4HBcMAKVxfEx8Y0glZCxwlOCjDUkwPACElAygMghftAB6MClpRJygQFB0EuyMKBQUKDPQxCgQAIfkECQoAAAAsAQABAA4ADgAAB4SAAIIKahstTQ0OVoKMJzYeLVU8W29OXowvBztePh0dUTtxVD0AHDgHEoyMKWVvPj4sBqqqLUoiGDgQs4wBJmNqARe7gjEqXxgPwsMxbWw+UQzDAGY6LjEnusNjFmAEBVbRs00zc1EAHRAKHYw2CHIyO4wEHAwjgmJCZDC7F8psC7IEBQIAIfkECQoARwAsAQABAA4ADgAAB4OAR4IMPgMfNg4PCoKMEA84LCkAMB47GIwxBiUTEAQjKD0REQ9HBD4YIYyMATwtBRQnqaqMG0UOEC8ds4wYIEEQBbuMHC4gMYvCRxw0CAwcF8kBGj8EHdDCJCYiRxfXsw0qCROqRDYQECw3ORkpqjpAQjVGMxYrB7MPC0MyFQItEowCAQAh+QQJCgACACwBAAEADgAOAAAHgIACghcUVhIYEigMgowjEC8nUQ8BOGkojAQxITEdAhcxEh9wPoIMFCOMjBMAKTEXHaipjGldDxcEsqkvUAe5sh1NLb6pHTxNbGK9vlE3DU5ZLsNnIA4GbTVVuQcJdpdnS0Z3LAoxXhF4LjiMMBl5FjptKiZ6ZrJRLUkqbCAwJ4yBACH5BAUKAAEALAEAAQAOAA4AAAd/gAGCARcjHDExHASDjAQdHAoFLy8Ugw2MgiMKWhIKAQ9MYpiCEA8YHQtZCaOCJ14vX2g2rAEKZgMyNRC0BCksFUa7rCMANgIzH7QvZw4tMmO0DlAPUV9hHqNeVTC7G2tkTmkUHA8iSFUGgzZlGSYaNC4gTWqYEzA3SQhVH1aDgQA7)}#ip-geo-block-map{height:400px;margin:1em auto}#ip-geo-block-apis div.nav-tab-wrapper{padding-top:0;margin-bottom:1em}#ip-geo-block-geoinfo{white-space:normal;word-wrap:break-word;word-break:break-all}#ip-geo-block-geoinfo ul{margin-top:0;margin-left:1em}.gm-style-iw{width:18em;height:auto!important;height:100%;min-height:100%:}.gm-style-iw ul{margin:.1em}.gm-style-iw li{margin:.2em}svg a{cursor:pointer}svg a:hover>text{fill:#0096dd}svg a>text{fill:#0073aa;text-decoration:underline}table.ip-geo-block-statistics-table{float:right}table.ip-geo-block-statistics-table td,table.ip-geo-block-statistics-table th{width:12em;margin:0;padding:.2em;text-align:right;line-height:1.5em;word-wrap:break-word}table.ip-geo-block-statistics-table tr:nth-child(even){background-color:#eee}table.ip-geo-block-table{margin:1em 0;white-space:normal;word-wrap:break-word;word-break:break-all}table.ip-geo-block-table td:first-child{min-width:4.3em}@media screen and (max-width:782px){#ip-geo-block-whois .panel-body{padding:0 .5em}}#ip-geo-block-scan-code{vertical-align:middle}#ip-geo-block-code-list{display:none;margin-bottom:0}#ip-geo-block-chart-countries{height:200px}#ip-geo-block-chart-daily{height:240px}#ip_geo_block_settings_validation_mimetype+label{padding-top:.25em}#ip_geo_block_settings_validation_mimetype+label+ul{margin-top:.7em}#ip_geo_block_settings_create_user{margin-bottom:.5em}#ip-geo-block-back-to-top a,#ip-geo-block-toggle-sections{box-shadow:none}#ip-geo-block-wp-info textarea{margin-top:.5em;overflow:auto;width:100%;word-wrap:normal;word-break:normal;white-space:pre}#ip-geo-block-back-to-top{margin:0;text-align:right}#ip-geo-block-live-update,#ip-geo-block-open-new{margin-left:1em}.ip-geo-block-menu-link{font-size:13px!important}dfn~.ip-geo-block-icon{margin-left:.4em}.ip-geo-block-icon{position:relative;cursor:pointer;outline:0;box-shadow:none;text-decoration:none;background-color:transparent}.ip-geo-block-icon:active{top:1px}.ip-geo-block-icon span{height:16px;width:16px;margin:0;border:none;display:inline-block;vertical-align:middle;background-size:16px 16px;background-position:center center;background-repeat:no-repeat}.ip-geo-block-icon-cycle span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAh1BMVEUAda2otLp+rsSHprWHr8IBd7EpfKRGhaNajqeUqrRymKuKoq5yo7prlKgAcqoVe6w8gqQmgq5Tj6wIdqsVdKIshrEMea1Uhp+Anqw0hawDdq4gfKhljqE7hqoLdKYbgbM4jLQygKUGeK8CdawQd6gVeKcad6NKkrSerrZAj7UAc6sAc6rc3NySrVGQAAAALXRSTlP//////////////////////////////////////////////////////////wCl7wv9AAACOklEQVR4Ae2W15rzKgxF9xTZzhTX9B7S/gN6/9ebYqzzGZsw/S7LV3FZgCSIwD/kQ8FVcBU8xatZUczy8luC/ABNOn0DSHEsvyZ4PgLatNCYR3efFxyhTQ8g+qQgJxgv2JefERzJXATRh4LHOUwAHD4S7OGEztRJaN86hAUxtaNWDUf/bRdDBbQMWVDAO8jn89WUhag1MeyCAh6hHofyrliLgZKggDMYgzF3eVAwFq0uCZq5KY0TezjIHDDzC0qqmkwe2ctGDOQVLMkgu+F3/rGXwb4xIPcJ6P3JgkM8wFjmfcFAWfeKQywaAz33BJVuHsUcAt09gVbuLDThAJkdR687ggLmf4gDJLIGV7BydtB8yn3u+fbtuj/LS7G9wZAd1AKK+yxJ1x+aBmibTtgCcEHGHsh0wdbOgNLek4L7lI5BigY8nWuZUQ3qGEXes9JzOKGJztPaGtLslu3lIXJirdxCWkASHGDTMqg7V1DKPplygDG61YJukLHjEErGSXqCSos6xNSOgzP3BDmsQBcchNwkoV8oiNnPA78zIefUgCdJeGIfE7LmFWXsFTCFdzTJ/RlfEMRiSGnFXXbkC7AIeqcKDu4ynseozeouKJiSEYBDwkJyIC1nRUjgblkNWp/e/1vXc2gjoAoLksYgjrrFMi0oDgjEEIDij1scBXMJSH6DAj6RNl7o8MkuLak8Co15/Pk+MRmT0xilQJV/sdWNKg2kTaeroudvNNsDjmejYjSL+e6v2/2r4Cp4BXNajr0H7hRfAAAAAElFTkSuQmCC)}.ip-geo-block-icon-lock span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3Ny3y9Zzq8dRmb7M1dlXnsIFdK0AcawAcqwphrYAcKvZ29wAb6oJd680jrqlw9MBcqxmo8MUfbJLl75eoMI7kbzX2ttqp8VSmL1YnL8NeK+Tu89DlL1ImMEOebBNmL4OkqMoAAAAAXRSTlMAQObYZgAAAPlJREFUeAG9kAWyhTAQBIPOsCzufv9TPnf4Ll0CSbpmxXwNy3Yc23rz2fV8kPA99433AIQIiGDTCD0lojiOQPXCDSFJIbF16CMWItkQMkF+inZzSLYhFKLl+a9UKTZaqJTZJYtarZuo40chrv9CqJTN+behVi+Cm7RdDgRld6AMgLxrE/dxBz0BEjwBEmD/uIsWPAOAF9A+CE56ufSryr8oqfOYcBbQJ8YkES7COkFOYzTypqCDOTDo2wljaEw4vp1APYyWKd8WMBozylvCpcvmXeHQ5fCegHia4s1FgZcIVeVFeFx1M4MvYG4eBHdYWufC+addBtf8E3vdjBNhWnVQqAAAAABJRU5ErkJggg==)}.ip-geo-block-icon-unlock span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NyzydRzq8dRmb7I09hYnsEFdK0AcawAcqzP1toqhrYAcKvZ29wAb6oMeK8zjbqrxtQBcazBz9Zko8MVfbLF0thMmL07kbtpp8WjwtJSmL1YnL+Tu89DlL1JmMEPebBFV++UAAAAAXRSTlMAQObYZgAAAONJREFUeAG9kAWChDAMAIMmJaTFXf7/ynXflvMbnE5j8DU8Pwh8D1yEUYxEGEchWFEJEjEflESBhTQSQm2MRpIotQhZTmgKgMIg5ZlFKBmrGg7UFXJpEQKW8qIKN7YeikJdBJI2BTtXwfyx0L3XoPphvBEliNU49OoxqEa6g4cTST/OYshvi3hV8+FxSNfluG3jqxG8C6h7gF6jU+AODnTsFGSCA5O4I8wpQDq7I5CUAKWQW+AZYOYtoQPoGDeECWDaioBmWQxeBduoWURso+5WpBdw7R4ENTVDcGE435tJwT+xB+vMEnZRNB0YAAAAAElFTkSuQmCC)}.ip-geo-block-icon-find span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NzS19rD0NWHtMpGk7kYfbAGda0Req+WtcTT1temwM4AcasAcqwAc6wAcKydvMt1pr8Ab6pqpcLX2doggrKoxdNYm7yzw8u/y9HO1tkKdq4th7Td3t6DrcLL0taxyNPGe/YhAAAAAXRSTlMAQObYZgAAARVJREFUeAGtkkeiwyAMRP2xDfxoRjElvd3/lOkNUlZ5u0GPruan/Bnz96Xadr21rvP/7+ujXsAjom78rj4ApCoERIipqfGB1H7wPmYhw1DXjZI6nOel1oJhVAmdUP0tTEDkVC4AYvqIbaDOCqFV6vwRF0tIeYoo6J/X7ICuPAJl9ZynwiIfB5DXxZlRChulbh8xZci0EHZK3TziJFDL504rEOZ+iR5cVj82DoS7XtSshLJpKqaB0Dg3ZjcsQWKaKiF1gVQlITwh/bw2pgKeEeURhE29yKSzUFF03p1V7Wqj2Y7GfrY9X/NirJsPxKsxfBLSSs5GmH8yjAWPSNd8Yoez4f4/G1nIsksqFtGK1i9e39o0P+EAqaoRLlQ+r94AAAAASUVORK5CYII=)}.ip-geo-block-icon-alert span,span.ip-geo-block-icon-alert{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAkFBMVEXc3Nzc2trWl5DHRDTFOyvOgXfc1tXCLBrEMiHEMyLNcmfaxMLDMSDDLx7bu7jRiYHDLhzDMB/LX1PaxsTDLh3YtrHMY1bWmpPJVknSjYXUkYnZuLTMZVnENCPWlI3QhXzENiXXrqrDLRzXsa3Oal7Pe3Hc2NjVn5nNbmPayMbbwb7ay8rUj4fc09Lbw8Db0dDBbRUDAAAAAXRSTlMAQObYZgAAAPVJREFUeAG9ktXWwyAQBonC12brFvff5f2frr4nBredK2DnTFS8Gst2XM8XZmypIGeWcT4PFABaGIXlClfWG1NiC4Ubu705oKRcY32wTAHl2MdTYEqEK8hIiHgHSnSJeaogMyEWO4BijZCvwII2MS9UJ2BXTh+hQidoEttboBOwq3WBnkCNpQlA2iyAhol2hRu71n97p4fw0Z9/ugoPHCfFA+o/iLfCkyBglRJdICBas7uuey+R56fF14wNanj+/QjwY3aX23cBFn6EiHmHNT/ICYxystv/wJy4UHWGlN2cuPB72tFqAq3dP/Hk3zs0E5LZVryGC/hqGNnUa0SVAAAAAElFTkSuQmCC);vertical-align:bottom}table.form-table th .ip-geo-block-cycle span{vertical-align:text-bottom}.ip-geo-block-list{margin-top:0;margin-bottom:.7em}@media screen and (min-width:782px){ul.ip-geo-block-list .code{width:15em}}.ip-geo-block-list-exceptions label{display:inline-block}.ip-geo-block-list-exceptions dfn{border:none}.ip-geo-block-list-exceptions span.dashicons{font-size:14px}.ip-geo-block-list-exceptions a.ip-geo-block-icon{margin-left:.3em;outline:0;box-shadow:none;text-decoration:none;background-color:transparent}.form-table td p.ip-geo-block-desc,.form-table td p.ip-geo-block-find-desc{color:#666;font-size:13px!important;margin:4px 0 .5em .5em}.ip-geo-block-find-desc{display:none}.ip-geo-block-admin-post{color:#c43322;margin-left:.25em}.ip-geo-block-warn{color:#c43322;font-weight:700}input#ip_geo_block_settings_behavior_time,input#ip_geo_block_settings_behavior_view{width:3.5em}.ip-geo-block-top-list{display:inline-table;list-style-position:outside;margin:0 2em .5em 1.75em}.ip-geo-block-top-list h4{margin:1em 0}.ip-geo-block-top-list li code{background:0 0}.ip-geo-block-network{margin-bottom:1em}.ip-geo-block-container{margin:0 auto;padding:0 1em;position:relative;width:100%}.ip-geo-block-row{display:flex;flex-direction:column;align-items:flex-start;align-items:stretch;padding:0;width:100%}.ip-geo-block-row .ip-geo-block-column{display:block;flex:1 1 auto;align-self:flex-start;margin-left:0;max-width:100%;width:100%}.ip-geo-block-row .ip-geo-block-column.column-20{flex:0 0 20%;max-width:20%}.ip-geo-block-row .ip-geo-block-column.column-25{flex:0 0 25%;max-width:25%}.ip-geo-block-row .ip-geo-block-column.column-33{flex:0 0 33.3333%;max-width:33.3333%}.ip-geo-block-row .ip-geo-block-column.column-50{flex:0 0 50%;max-width:50%}@media (min-width:40rem){.ip-geo-block-row{flex-direction:row;margin-left:-2em;width:calc(100% + 2em)}.ip-geo-block-row .ip-geo-block-column{margin-bottom:inherit;padding:0 1em}}table.ip-geo-block-dataTable{clear:none!important}table.ip-geo-block-dataTable td,table.ip-geo-block-dataTable th{text-align:right}table.ip-geo-block-dataTable td:nth-child(n+2),table.ip-geo-block-dataTable th:nth-child(n+2){padding-left:0!important}table.ip-geo-block-dataTable th{white-space:nowrap}table.ip-geo-block-dataTable>thead>tr{line-height:1.8em}table.ip-geo-block-dataTable>tbody>tr{cursor:pointer}table.ip-geo-block-dataTable.no-footer,table.ip-geo-block-dataTable>thead>tr>td,table.ip-geo-block-dataTable>thead>tr>th{border-bottom:1px solid #ddd}table.ip-geo-block-dataTable thead td,table.ip-geo-block-dataTable thead th{padding:10px 16px}#ip-geo-block-statistics-cache td:nth-child(3),#ip-geo-block-validation-logs td:nth-child(4){min-width:1.6em}div[class*=ip-geo-block] .dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #ddd}table.ip-geo-block-dataTable.nowrap td,table.ip-geo-block-dataTable>tbody>tr>td span{white-space:normal!important;word-wrap:break-word!important;word-break:break-all!important}table.ip-geo-block-dataTable>tbody>tr>td span{display:inline-block}.ip-geo-block-settings-folding input[type=checkbox]{margin-right:.5em}table.ip-geo-block-dataTable input[type=checkbox]{max-height:16px;max-width:16px;margin:0}table.ip-geo-block-dataTable>tbody>tr>td:first-child,table.ip-geo-block-dataTable>thead>tr>th:first-child{padding:8px 4px 8px 1.4em;text-align:left}table.collapsed>tbody>tr>td.dataTables_empty:first-child::before,table.ip-geo-block-dataTable>tbody>tr>td.dataTables_empty{border:none;text-align:center}table.ip-geo-block-dataTable thead>tr>th:first-child.sorting_asc{background-image:none!important}table.ip-geo-block-dataTable.display tbody tr.even>.sorting_1,table.ip-geo-block-dataTable.display tbody tr.odd>.sorting_1,table.ip-geo-block-dataTable.display tbody tr:hover>.sorting_1{background-color:inherit!important}table.ip-geo-block-dataTable.collapsed>tbody>tr>td:first-child{padding:8px 4px 8px 8px!important}table.collapsed>tbody>tr.parent>td:first-child::before,table.collapsed>tbody>tr>td:first-child::before{content:'';height:0;width:0;display:inline-block;border-radius:0;border:5px solid transparent;box-shadow:none;position:relative;background-color:transparent}table.collapsed>tbody>tr>td:first-child::before{border-left:5px solid #555;top:1px;left:-2px}table.collapsed>tbody>tr.parent>td:first-child::before{border-top:5px solid #555;top:4px;left:-4px}table.collapsed>tbody>tr.child>td:first-child::before{border:none}table.collapsed>tbody>tr.child>td.child>ul li{border:none;padding:0;margin:0;line-height:1.8em}table.collapsed>tbody>tr.child>td.child>ul li span.dtr-data,table.collapsed>tbody>tr.child>td.child>ul li span.dtr-title{font-size:13px!important;display:block;white-space:normal;word-wrap:break-word;word-break:break-all}table.collapsed>tbody>tr.child>td.child>ul li span.dtr-data{margin-left:1.25em;margin-right:.3em}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length{padding-top:.15em;margin:.5em 0 0 .3em;position:relative;display:inline-block}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length:after{content:'';width:6px;height:6px;border:0;border-bottom:solid 2px #999;border-right:solid 2px #999;-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);position:absolute;top:50%;right:10px;margin-top:-4px}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length select{padding-top:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:13px!important;line-height:1.4em;width:100%;height:2.05em!important;background:0 0;position:relative;z-index:1;padding:.125em 1.5em .125em .25em;border:1px solid #ddd;border-radius:4px;box-shadow:none}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length select::-ms-expand{display:none}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate{float:none;text-align:center;margin-bottom:1em;margin-top:0!important}@media screen and (min-width:640px){div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length{margin:.5em 0 0 .6em}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate{position:relative;left:-2.25em}}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate span.ellipsis{min-width:2em;background:inherit;border-color:#ddd;border-radius:0;border-image:none;border-style:solid;border-width:1px 1px 1px 0;box-shadow:none;margin:.5em 0 0 0;padding:.25em 0;display:inline-block;text-decoration:none}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:active>a.paginate_button:first-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:first-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate>a.paginate_button:first-child{border-left-width:1px;border-bottom-left-radius:4px;border-top-left-radius:4px}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:active>a.paginate_button:last-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:last-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate>a.paginate_button:last-child{border-bottom-right-radius:4px;border-top-right-radius:4px}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button{color:#0073aa!important}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button:hover{color:#0096dd!important;background-color:#fff}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate span.ellipsis{cursor:default;color:#999!important;background-color:transparent}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover{cursor:default;color:#444!important;background-color:#fff!important}#ip-geo-block-1 #ip-geo-block-section-2 .panel-body,#ip-geo-block-4 #ip-geo-block-section-0 .panel-body{padding:0}#ip-geo-block-1 #ip-geo-block-section-2 table.form-table,#ip-geo-block-4 #ip-geo-block-section-0 table.form-table{margin-left:1em;max-width:95%}#ip-geo-block-select-duration,#ip-geo-block-select-layout,#ip-geo-block-select-target{margin:0}#ip-geo-block-select-duration li,#ip-geo-block-select-layout li,#ip-geo-block-select-target li{float:left;margin-right:1.5em}#ip-geo-block-select-duration li label,#ip-geo-block-select-target li label{cursor:pointer}#ip_geo_block_settings_search_filter{width:16em;padding-top:3px}table.ip-geo-block-dataTable.display tbody tr.ip-geo-block-passed{background-color:#edf6ff!important}table.ip-geo-block-dataTable.display tbody tr.ip-geo-block-blocked{background-color:#ffefef!important}.ip-geo-block-new-passed{animation:ip-geo-block-flash-passed 1s ease-out 0s 1 normal both running}.ip-geo-block-new-blocked{animation:ip-geo-block-flash-blocked 1s ease-out 0s 1 normal both running}@keyframes ip-geo-block-flash-passed{0%{background-color:gold}100%{background-color:#edf6ff}}@keyframes ip-geo-block-flash-blocked{0%{background-color:gold}100%{background-color:#ffefef}}mark{padding:0;background:gold}// Gold #ip-geo-block-live-log{margin:0}#ip-geo-block-live-log li{float:left;margin-right:3em}#ip-geo-block-live-log li:last-child{margin-right:0}#ip-geo-block-live-log li input[type=radio]{visibility:hidden;position:absolute}#ip-geo-block-live-log li input[type=radio]+label{display:inline-block;margin:-2px;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);border-bottom-color:#b3b3b3;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}#ip-geo-block-live-log li input[type=radio]:checked+label{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);background-color:#e0e0e0}.ip-geo-block-live-timer{height:1em;width:1em;margin:0;position:relative;top:0;left:0}.ip-geo-block-live-timer:before{content:"";display:block;height:1em;width:1em;background:#0073aa;border-radius:50%;position:absolute;top:0;left:0}.ip-geo-block-live-timer:after{display:none}.ip-geo-block-live-timer>div{position:absolute;width:1em;height:1em;clip:rect(0,1em,1em,.5em)}.ip-geo-block-live-timer>div:before{content:" ";position:absolute;width:1em;height:1em;border-radius:.5em;clip:rect(0,.5em,1em,0);background-color:#f1f1f1;transform:rotate(0)}.ip-geo-block-live-timer>div:first-child:before{animation:30s spin-timer linear forwards}.ip-geo-block-live-timer>div:last-child{transform:rotate(180deg)}.ip-geo-block-live-timer>div:last-child:before{transform:rotate(0);animation:30s spin-timer linear 30s forwards}@keyframes spin-timer{0%{transform:rotate(0)}100%{transform:rotate(180deg)}}.ip-geo-block-subitem{margin-left:1.7em}.ip-geo-block-subitem:before{content:"\00bb";position:absolute;left:2em}.ip-geo-block-subitem dfn{vertical-align:middle}.ip-geo-block-subitem-parent td,.ip-geo-block-subitem-parent th{padding-top:0}:placeholder-shown{color:#888}::-webkit-input-placeholder{color:#888}:-moz-placeholder{color:#888;opacity:1}::-moz-placeholder{color:#888;opacity:1}:-ms-input-placeholder{color:#888}
3
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
+ dfn{cursor:help;border-bottom:1px dotted #888}fieldset,legend{padding:0;margin:0;border:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}fieldset{min-width:0}legend{display:block;line-height:inherit;width:100%}label{display:inline-block;max-width:100%}.panel{border-color:#888;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);background:#f5f5f5}.panel-heading{float:left!important;background:#fff}.panel-default>.panel-heading{border-color:inherit}.panel-body{width:100%;padding:0 1em;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.panel-body:after,.panel-body:before{content:" ";display:table}.panel-body:after{clear:both}.ip-geo-block-navi-link{text-align:left}.ip-geo-block-help-link{float:right;font-size:90%;font-weight:400}.ip-geo-block-help-link a{box-shadow:none}fieldset label{vertical-align:text-middle}fieldset input[type=checkbox]{margin:1px 2px 0}fieldset.ip-geo-block-field{margin:1em 0}fieldset.ip-geo-block-field h2,fieldset.ip-geo-block-field h3{padding:0;margin:0;font-size:14px!important}fieldset.ip-geo-block-field h4{margin:.75em 0 .5em 0}fieldset.ip-geo-block-field legend.panel-heading{padding:10px}fieldset.ip-geo-block-field .ip-geo-block-dropdown,fieldset.ip-geo-block-field .ip-geo-block-dropup{cursor:pointer;position:relative;padding-left:1em}fieldset.ip-geo-block-field .ip-geo-block-dropdown:before,fieldset.ip-geo-block-field .ip-geo-block-dropup:before{content:'';height:0;width:0;border:.4em solid transparent;position:absolute}fieldset.ip-geo-block-field .ip-geo-block-dropup:before{border-left:.4em solid #555;left:2px;top:18%}fieldset.ip-geo-block-field .ip-geo-block-dropdown:before{border-top:.4em solid #555;left:-2px;top:38%}fieldset.ip-geo-block-field .form-table .ip-geo-block-dropdown,fieldset.ip-geo-block-field .form-table .ip-geo-block-dropup{margin-top:.75em}fieldset.ip-geo-block-field ul.ip-geo-block-dropup:before{top:.25em}fieldset.ip-geo-block-field ul.ip-geo-block-dropdown:before{top:.5em}fieldset.ip-geo-block-field table.form-table{margin:0 0 .5em;width:100%}textarea.regular-text{width:25em}fieldset.ip-geo-block-field input.regular-text,fieldset.ip-geo-block-field textarea.regular-text{font-size:95%}fieldset.ip-geo-block-field input[type=checkbox],fieldset.ip-geo-block-field input[type=radio],p.ip-geo-block-navi-link input[type=checkbox]{margin-right:.4em}input[id*=ip_geo_block_settings_rewrite_]+label{margin-left:.25em}input[id*=ip_geo_block_settings_providers]+label{min-width:7em}.ip-geo-block-settings-folding{margin:.5em 0}.ip-geo-block-settings-folding ul{margin-bottom:0}.ip-geo-block-settings-folding li{margin:.5em 0}.folding-disable{pointer-events:none;opacity:.5}.folding-inactive{opacity:.5;font-style:oblique!important}.ip-geo-block-float li{display:inline-block;width:18em;margin-top:0}.ip-geo-block-checked{list-style-type:disc}.ip-geo-block-ip-addr{display:inline-block;padding-top:5px}.ip-geo-block-hide{display:none}.ip-geo-block-sup{margin-left:.2em;display:inline-block}.ip-geo-block-note{margin-top:1em;list-style:disc inside}.ip-geo-block-note li{text-indent:-1em;padding-left:1em}.ip-geo-block-border{border-top:inherit}.ip-geo-block-notice{color:#dd3d36}.ip-geo-block-title{width:100px;display:inline-block}.ip-geo-block-result{color:#2786c2;display:inline-block}.ip-geo-block-primary{color:#fff!important;background:#00838f!important;border-color:#00707a!important;text-shadow:none}.ip-geo-block-primary:hover{background-color:#00919e!important;border-color:#00525a!important}ul#ip-geo-block-logs-preset{margin:.25em 0}ul#ip-geo-block-logs-preset li{float:left;margin-right:1em}#ip-geo-block-live-loading,.ip-geo-block-loading{height:16px;width:16px;background-size:16px 16px;background-position:center center;background-repeat:no-repeat;margin-left:1em;margin-top:.2em;display:inline-block;vertical-align:top}.ip-geo-block-loading{background-image:url(data:image/gif;base64,R0lGODlhEAAQAPYCAKqqqsbGxlZWVsrKyvr6+ubm5tDQ0K6urmZmZmJiYuzs7IaGhvT09JycnLq6us7Ozurq6o6OjtbW1tra2vDw8CgoKCYmJvz8/NLS0kJCQlJSUqysrPLy8vb29pqamra2tm5ubujo6Kampvj4+IiIiMjIyEhISNzc3OLi4rKysj4+PlBQULi4uJKSkmRkZODg4KKiou7u7iQkJB4eHlpaWhISErCwsHh4eMDAwDIyMi4uLqSkpIKCgr6+vt7e3n5+fggICJCQkAwMDEpKSmBgYHZ2dhgYGBYWFnx8fF5eXk5OTiIiIjAwMIyMjISEhDQ0NJaWltTU1AQEBBwcHGpqaoqKiuTk5CoqKlhYWAoKCtjY2Hp6ehAQEJ6ensLCwkxMTJSUlCwsLAYGBnR0dDg4OFxcXLy8vKCgoA4ODsTExMzMzDw8PERERDY2NqioqHJycrS0tGhoaBQUFEZGRjo6OkBAQICAgHBwcFRUVCAgIGxsbP///wAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgACACwAAAAAEAAQAEAHjIACgoOEhYJsbTGGghcPGIJRbFNNhgQKCheDDkllDQYMHSc4MAcvhTB0aFliggQjmYNEFQ6LAh0+VoIwbFW1GGamhCgfUE5NbgMKtQYLc0a1gjsyR3E2IYwMFASDYDJvtRRWFIJ1TMq1ElqCICpetQoBEoInVCsAhhI2XhyEPUgIIG7waALlwAloCAMBACH5BAkKAAIALAEAAQAOAA4AAAeDgAKCEmBYYRVKJAaCjAcrVzIzRjVoTw2MKRk5Ww4KECkuWTWCE0Rrl4yCTow7bAupsBcCW19psKkjBEQaFLeMHBwINBy+ggoxVQkPxSMFMXBUMMUQPhRWVUU9tyFRLwQCA048cCcjIyFaJQYxjA8NEVBnAClmahCwEANwbjYBJwyMAgEAIfkECQoABQAsAQABAA4ADgAAB4OABYInO29DbC5QUYKMZiBfbCptTBUmIow4LgJBaTExZkVLFTAFKD8JB4yMQUZrBixUXaqqVFwkUG8Ys4wpQiZOWwy7ghBiRk08HcOqblUTy4wlLWbLBCMFCgBdurMjFMoFE24ADxAXFwwKITEEjD5mH2YBDxI+IdeqHCcGAxgv7IwCAQAh+QQJCgAAACwBAAEADgAOAAAHhYAAglYfTVQJSCITgowDVSAISQJKJgkpjA8LWyIGHBQBJCoZBwAQDU44jIxdTxoSAxEfqqpbFWApUCezjA5LWCJdI7uCClNXGyLCwxBHFl4HBcMAKVxfEx8Y0glZCxwlOCjDUkwPACElAygMghftAB6MClpRJygQFB0EuyMKBQUKDPQxCgQAIfkECQoAAAAsAQABAA4ADgAAB4SAAIIKahstTQ0OVoKMJzYeLVU8W29OXowvBztePh0dUTtxVD0AHDgHEoyMKWVvPj4sBqqqLUoiGDgQs4wBJmNqARe7gjEqXxgPwsMxbWw+UQzDAGY6LjEnusNjFmAEBVbRs00zc1EAHRAKHYw2CHIyO4wEHAwjgmJCZDC7F8psC7IEBQIAIfkECQoARwAsAQABAA4ADgAAB4OAR4IMPgMfNg4PCoKMEA84LCkAMB47GIwxBiUTEAQjKD0REQ9HBD4YIYyMATwtBRQnqaqMG0UOEC8ds4wYIEEQBbuMHC4gMYvCRxw0CAwcF8kBGj8EHdDCJCYiRxfXsw0qCROqRDYQECw3ORkpqjpAQjVGMxYrB7MPC0MyFQItEowCAQAh+QQJCgACACwBAAEADgAOAAAHgIACghcUVhIYEigMgowjEC8nUQ8BOGkojAQxITEdAhcxEh9wPoIMFCOMjBMAKTEXHaipjGldDxcEsqkvUAe5sh1NLb6pHTxNbGK9vlE3DU5ZLsNnIA4GbTVVuQcJdpdnS0Z3LAoxXhF4LjiMMBl5FjptKiZ6ZrJRLUkqbCAwJ4yBACH5BAUKAAEALAEAAQAOAA4AAAd/gAGCARcjHDExHASDjAQdHAoFLy8Ugw2MgiMKWhIKAQ9MYpiCEA8YHQtZCaOCJ14vX2g2rAEKZgMyNRC0BCksFUa7rCMANgIzH7QvZw4tMmO0DlAPUV9hHqNeVTC7G2tkTmkUHA8iSFUGgzZlGSYaNC4gTWqYEzA3SQhVH1aDgQA7)}#ip-geo-block-map{height:400px;margin:1em auto}#ip-geo-block-apis div.nav-tab-wrapper{padding-top:0;margin-bottom:1em}#ip-geo-block-geoinfo{white-space:normal;word-wrap:break-word;word-break:break-all}#ip-geo-block-geoinfo ul{margin-top:0;margin-left:1em}.gm-style-iw{width:18em;height:auto!important;height:100%;min-height:100%:}.gm-style-iw ul{margin:.1em}.gm-style-iw li{margin:.2em}svg a{cursor:pointer}svg a:hover>text{fill:#0096dd}svg a>text{fill:#0073aa;text-decoration:underline}table.ip-geo-block-statistics-table{float:right}table.ip-geo-block-statistics-table td,table.ip-geo-block-statistics-table th{width:12em;margin:0;padding:.2em;text-align:right;line-height:1.5em;word-wrap:break-word}table.ip-geo-block-statistics-table tr:nth-child(even){background-color:#eee}table.ip-geo-block-table{margin:1em 0;white-space:normal;word-wrap:break-word;word-break:break-all}table.ip-geo-block-table td:first-child{min-width:4.3em}@media screen and (max-width:782px){#ip-geo-block-whois .panel-body{padding:0 .5em}}#ip-geo-block-scan-code{vertical-align:middle}#ip-geo-block-code-list{display:none;margin-bottom:0}#ip-geo-block-chart-countries{height:200px}#ip-geo-block-chart-daily{height:240px}#ip_geo_block_settings_validation_mimetype+label{padding-top:.25em}#ip_geo_block_settings_validation_mimetype+label+ul{margin-top:.7em}#ip_geo_block_settings_create_user{margin-bottom:.5em}#ip-geo-block-back-to-top a,#ip-geo-block-toggle-sections{box-shadow:none}#ip-geo-block-wp-info textarea{margin-top:.5em;overflow:auto;width:100%;word-wrap:normal;word-break:normal;white-space:pre}#ip-geo-block-back-to-top{margin:0;text-align:right}#ip-geo-block-live-update,#ip-geo-block-open-new{margin-left:1em}.ip-geo-block-menu-link{font-size:13px!important}dfn~.ip-geo-block-icon{margin-left:.4em}.ip-geo-block-icon{position:relative;cursor:pointer;outline:0;box-shadow:none;text-decoration:none;background-color:transparent}.ip-geo-block-icon:active{top:1px}.ip-geo-block-icon span{height:16px;width:16px;margin:0;border:none;display:inline-block;vertical-align:middle;background-size:16px 16px;background-position:center center;background-repeat:no-repeat}.ip-geo-block-icon-cycle span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAh1BMVEUAda2otLp+rsSHprWHr8IBd7EpfKRGhaNajqeUqrRymKuKoq5yo7prlKgAcqoVe6w8gqQmgq5Tj6wIdqsVdKIshrEMea1Uhp+Anqw0hawDdq4gfKhljqE7hqoLdKYbgbM4jLQygKUGeK8CdawQd6gVeKcad6NKkrSerrZAj7UAc6sAc6rc3NySrVGQAAAALXRSTlP//////////////////////////////////////////////////////////wCl7wv9AAACOklEQVR4Ae2W15rzKgxF9xTZzhTX9B7S/gN6/9ebYqzzGZsw/S7LV3FZgCSIwD/kQ8FVcBU8xatZUczy8luC/ABNOn0DSHEsvyZ4PgLatNCYR3efFxyhTQ8g+qQgJxgv2JefERzJXATRh4LHOUwAHD4S7OGEztRJaN86hAUxtaNWDUf/bRdDBbQMWVDAO8jn89WUhag1MeyCAh6hHofyrliLgZKggDMYgzF3eVAwFq0uCZq5KY0TezjIHDDzC0qqmkwe2ctGDOQVLMkgu+F3/rGXwb4xIPcJ6P3JgkM8wFjmfcFAWfeKQywaAz33BJVuHsUcAt09gVbuLDThAJkdR687ggLmf4gDJLIGV7BydtB8yn3u+fbtuj/LS7G9wZAd1AKK+yxJ1x+aBmibTtgCcEHGHsh0wdbOgNLek4L7lI5BigY8nWuZUQ3qGEXes9JzOKGJztPaGtLslu3lIXJirdxCWkASHGDTMqg7V1DKPplygDG61YJukLHjEErGSXqCSos6xNSOgzP3BDmsQBcchNwkoV8oiNnPA78zIefUgCdJeGIfE7LmFWXsFTCFdzTJ/RlfEMRiSGnFXXbkC7AIeqcKDu4ynseozeouKJiSEYBDwkJyIC1nRUjgblkNWp/e/1vXc2gjoAoLksYgjrrFMi0oDgjEEIDij1scBXMJSH6DAj6RNl7o8MkuLak8Co15/Pk+MRmT0xilQJV/sdWNKg2kTaeroudvNNsDjmejYjSL+e6v2/2r4Cp4BXNajr0H7hRfAAAAAElFTkSuQmCC)}.ip-geo-block-icon-lock span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3Ny3y9Zzq8dRmb7M1dlXnsIFdK0AcawAcqwphrYAcKvZ29wAb6oJd680jrqlw9MBcqxmo8MUfbJLl75eoMI7kbzX2ttqp8VSmL1YnL8NeK+Tu89DlL1ImMEOebBNmL4OkqMoAAAAAXRSTlMAQObYZgAAAPlJREFUeAG9kAWyhTAQBIPOsCzufv9TPnf4Ll0CSbpmxXwNy3Yc23rz2fV8kPA99433AIQIiGDTCD0lojiOQPXCDSFJIbF16CMWItkQMkF+inZzSLYhFKLl+a9UKTZaqJTZJYtarZuo40chrv9CqJTN+behVi+Cm7RdDgRld6AMgLxrE/dxBz0BEjwBEmD/uIsWPAOAF9A+CE56ufSryr8oqfOYcBbQJ8YkES7COkFOYzTypqCDOTDo2wljaEw4vp1APYyWKd8WMBozylvCpcvmXeHQ5fCegHia4s1FgZcIVeVFeFx1M4MvYG4eBHdYWufC+addBtf8E3vdjBNhWnVQqAAAAABJRU5ErkJggg==)}.ip-geo-block-icon-unlock span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NyzydRzq8dRmb7I09hYnsEFdK0AcawAcqzP1toqhrYAcKvZ29wAb6oMeK8zjbqrxtQBcazBz9Zko8MVfbLF0thMmL07kbtpp8WjwtJSmL1YnL+Tu89DlL1JmMEPebBFV++UAAAAAXRSTlMAQObYZgAAAONJREFUeAG9kAWChDAMAIMmJaTFXf7/ynXflvMbnE5j8DU8Pwh8D1yEUYxEGEchWFEJEjEflESBhTQSQm2MRpIotQhZTmgKgMIg5ZlFKBmrGg7UFXJpEQKW8qIKN7YeikJdBJI2BTtXwfyx0L3XoPphvBEliNU49OoxqEa6g4cTST/OYshvi3hV8+FxSNfluG3jqxG8C6h7gF6jU+AODnTsFGSCA5O4I8wpQDq7I5CUAKWQW+AZYOYtoQPoGDeECWDaioBmWQxeBduoWURso+5WpBdw7R4ENTVDcGE435tJwT+xB+vMEnZRNB0YAAAAAElFTkSuQmCC)}.ip-geo-block-icon-find span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NzS19rD0NWHtMpGk7kYfbAGda0Req+WtcTT1temwM4AcasAcqwAc6wAcKydvMt1pr8Ab6pqpcLX2doggrKoxdNYm7yzw8u/y9HO1tkKdq4th7Td3t6DrcLL0taxyNPGe/YhAAAAAXRSTlMAQObYZgAAARVJREFUeAGtkkeiwyAMRP2xDfxoRjElvd3/lOkNUlZ5u0GPruan/Bnz96Xadr21rvP/7+ujXsAjom78rj4ApCoERIipqfGB1H7wPmYhw1DXjZI6nOel1oJhVAmdUP0tTEDkVC4AYvqIbaDOCqFV6vwRF0tIeYoo6J/X7ICuPAJl9ZynwiIfB5DXxZlRChulbh8xZci0EHZK3TziJFDL504rEOZ+iR5cVj82DoS7XtSshLJpKqaB0Dg3ZjcsQWKaKiF1gVQlITwh/bw2pgKeEeURhE29yKSzUFF03p1V7Wqj2Y7GfrY9X/NirJsPxKsxfBLSSs5GmH8yjAWPSNd8Yoez4f4/G1nIsksqFtGK1i9e39o0P+EAqaoRLlQ+r94AAAAASUVORK5CYII=)}.ip-geo-block-icon-alert span,span.ip-geo-block-icon-alert{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAkFBMVEXc3Nzc2trWl5DHRDTFOyvOgXfc1tXCLBrEMiHEMyLNcmfaxMLDMSDDLx7bu7jRiYHDLhzDMB/LX1PaxsTDLh3YtrHMY1bWmpPJVknSjYXUkYnZuLTMZVnENCPWlI3QhXzENiXXrqrDLRzXsa3Oal7Pe3Hc2NjVn5nNbmPayMbbwb7ay8rUj4fc09Lbw8Db0dDBbRUDAAAAAXRSTlMAQObYZgAAAPVJREFUeAG9ktXWwyAQBonC12brFvff5f2frr4nBredK2DnTFS8Gst2XM8XZmypIGeWcT4PFABaGIXlClfWG1NiC4Ubu705oKRcY32wTAHl2MdTYEqEK8hIiHgHSnSJeaogMyEWO4BijZCvwII2MS9UJ2BXTh+hQidoEttboBOwq3WBnkCNpQlA2iyAhol2hRu71n97p4fw0Z9/ugoPHCfFA+o/iLfCkyBglRJdICBas7uuey+R56fF14wNanj+/QjwY3aX23cBFn6EiHmHNT/ICYxystv/wJy4UHWGlN2cuPB72tFqAq3dP/Hk3zs0E5LZVryGC/hqGNnUa0SVAAAAAElFTkSuQmCC);vertical-align:bottom}table.form-table th .ip-geo-block-cycle span{vertical-align:text-bottom}.ip-geo-block-list{margin-top:0;margin-bottom:.7em}@media screen and (min-width:782px){ul.ip-geo-block-list .code{width:15em}}.ip-geo-block-list-exceptions label{display:inline-block}.ip-geo-block-list-exceptions dfn{border:none}.ip-geo-block-list-exceptions span.dashicons{font-size:14px}.ip-geo-block-list-exceptions a.ip-geo-block-icon{margin-left:.3em;outline:0;box-shadow:none;text-decoration:none;background-color:transparent}.form-table td p.ip-geo-block-desc,.form-table td p.ip-geo-block-find-desc{color:#666;font-size:13px!important;margin:4px 0 .5em .5em}.ip-geo-block-find-desc{display:none}.ip-geo-block-admin-post{color:#c43322;margin-left:.25em}.ip-geo-block-warn{color:#c43322;font-weight:700}input#ip_geo_block_settings_behavior_time,input#ip_geo_block_settings_behavior_view{width:3.5em}.ip-geo-block-top-list{display:inline-table;list-style-position:outside;margin:0 2em .5em 1.75em}.ip-geo-block-top-list h4{margin:1em 0}.ip-geo-block-top-list li code{background:0 0}.ip-geo-block-network{margin-bottom:1em}.ip-geo-block-container{margin:0 auto;padding:0 1em;position:relative;width:100%}.ip-geo-block-row{display:flex;flex-direction:column;align-items:flex-start;align-items:stretch;padding:0;width:100%}.ip-geo-block-row .ip-geo-block-column{display:block;flex:1 1 auto;align-self:flex-start;margin-left:0;max-width:100%;width:100%}.ip-geo-block-row .ip-geo-block-column.column-20{flex:0 0 20%;max-width:20%}.ip-geo-block-row .ip-geo-block-column.column-25{flex:0 0 25%;max-width:25%}.ip-geo-block-row .ip-geo-block-column.column-33{flex:0 0 33.3333%;max-width:33.3333%}.ip-geo-block-row .ip-geo-block-column.column-50{flex:0 0 50%;max-width:50%}@media (min-width:40rem){.ip-geo-block-row{flex-direction:row;margin-left:-2em;width:calc(100% + 2em)}.ip-geo-block-row .ip-geo-block-column{margin-bottom:inherit;padding:0 1em}}table.ip-geo-block-dataTable{clear:none!important}table.ip-geo-block-dataTable td,table.ip-geo-block-dataTable th{text-align:right}table.ip-geo-block-dataTable td:nth-child(n+2),table.ip-geo-block-dataTable th:nth-child(n+2){padding-left:0!important}table.ip-geo-block-dataTable th{white-space:nowrap}table.ip-geo-block-dataTable>thead>tr{line-height:1.8em}table.ip-geo-block-dataTable>tbody>tr{cursor:pointer}table.ip-geo-block-dataTable.no-footer,table.ip-geo-block-dataTable>thead>tr>td,table.ip-geo-block-dataTable>thead>tr>th{border-bottom:1px solid #ddd}table.ip-geo-block-dataTable thead td,table.ip-geo-block-dataTable thead th{padding:10px 16px}#ip-geo-block-statistics-cache td:nth-child(3),#ip-geo-block-validation-logs td:nth-child(4){min-width:1.6em}div[class*=ip-geo-block] .dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #ddd}table.ip-geo-block-dataTable.nowrap td,table.ip-geo-block-dataTable>tbody>tr>td span{white-space:normal!important;word-wrap:break-word!important;word-break:break-all!important}table.ip-geo-block-dataTable>tbody>tr>td span{display:inline-block}.ip-geo-block-settings-folding input[type=checkbox]{margin-right:.5em}table.ip-geo-block-dataTable input[type=checkbox]{max-height:16px;max-width:16px;margin:0}table.ip-geo-block-dataTable>tbody>tr>td:first-child,table.ip-geo-block-dataTable>thead>tr>th:first-child{padding:8px 4px 8px 1.4em;text-align:left}table.collapsed>tbody>tr>td.dataTables_empty:first-child::before,table.ip-geo-block-dataTable>tbody>tr>td.dataTables_empty{border:none;text-align:center}table.ip-geo-block-dataTable thead>tr>th:first-child.sorting_asc{background-image:none!important}table.ip-geo-block-dataTable.display tbody tr.even>.sorting_1,table.ip-geo-block-dataTable.display tbody tr.odd>.sorting_1,table.ip-geo-block-dataTable.display tbody tr:hover>.sorting_1{background-color:inherit!important}table.ip-geo-block-dataTable.collapsed>tbody>tr>td:first-child{padding:8px 4px 8px 8px!important}table.collapsed>tbody>tr.parent>td:first-child::before,table.collapsed>tbody>tr>td:first-child::before{content:'';height:0;width:0;display:inline-block;border-radius:0;border:5px solid transparent;box-shadow:none;position:relative;background-color:transparent}table.collapsed>tbody>tr>td:first-child::before{border-left:5px solid #555;top:1px;left:-2px}table.collapsed>tbody>tr.parent>td:first-child::before{border-top:5px solid #555;top:4px;left:-4px}table.collapsed>tbody>tr.child>td:first-child::before{border:none}table.collapsed>tbody>tr.child>td.child>ul li{border:none;padding:0;margin:0;line-height:1.8em}table.collapsed>tbody>tr.child>td.child>ul li span.dtr-data,table.collapsed>tbody>tr.child>td.child>ul li span.dtr-title{font-size:13px!important;display:block;white-space:normal;word-wrap:break-word;word-break:break-all}table.collapsed>tbody>tr.child>td.child>ul li span.dtr-data{margin-left:1.25em;margin-right:.3em}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length{padding-top:.15em;margin:.5em 0 0 .3em;position:relative;display:inline-block}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length:after{content:'';width:6px;height:6px;border:0;border-bottom:solid 2px #999;border-right:solid 2px #999;-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);position:absolute;top:50%;right:10px;margin-top:-4px}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length select{padding-top:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:13px!important;line-height:1.4em;width:100%;height:2.05em!important;background:0 0;position:relative;z-index:1;padding:.125em 1.5em .125em .25em;border:1px solid #ddd;border-radius:4px;box-shadow:none}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length select::-ms-expand{display:none}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate{float:none;text-align:center;margin-bottom:1em;margin-top:0!important}@media screen and (min-width:640px){div[class*=ip-geo-block] .dataTables_wrapper .dataTables_length{margin:.5em 0 0 .6em}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate{position:relative;left:-2.25em}}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate span.ellipsis{min-width:2em;background:inherit;border-color:#ddd;border-radius:0;border-image:none;border-style:solid;border-width:1px 1px 1px 0;box-shadow:none;margin:.5em 0 0 0;padding:.25em 0;display:inline-block;text-decoration:none}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:active>a.paginate_button:first-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:first-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate>a.paginate_button:first-child{border-left-width:1px;border-bottom-left-radius:4px;border-top-left-radius:4px}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:active>a.paginate_button:last-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:last-child,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate>a.paginate_button:last-child{border-bottom-right-radius:4px;border-top-right-radius:4px}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button{color:#0073aa!important}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button:hover{color:#0096dd!important;background-color:#fff}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate span.ellipsis{cursor:default;color:#999!important;background-color:transparent}div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,div[class*=ip-geo-block] .dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover{cursor:default;color:#444!important;background-color:#fff!important}#ip-geo-block-1 #ip-geo-block-section-2 .panel-body,#ip-geo-block-4 #ip-geo-block-section-0 .panel-body{padding:0}#ip-geo-block-1 #ip-geo-block-section-2 table.form-table,#ip-geo-block-4 #ip-geo-block-section-0 table.form-table{margin-left:1em;max-width:95%}#ip-geo-block-select-duration,#ip-geo-block-select-layout,#ip-geo-block-select-target{margin:0}#ip-geo-block-select-duration li,#ip-geo-block-select-layout li,#ip-geo-block-select-target li{float:left;margin-right:1.5em}#ip-geo-block-select-duration li label,#ip-geo-block-select-target li label{cursor:pointer}#ip_geo_block_settings_search_filter{width:16em;padding-top:3px}table.ip-geo-block-dataTable.display tbody tr.ip-geo-block-passed{background-color:#edf6ff!important}table.ip-geo-block-dataTable.display tbody tr.ip-geo-block-blocked{background-color:#ffefef!important}.ip-geo-block-new-passed{animation:ip-geo-block-flash-passed 1s ease-out 0s 1 normal both running}.ip-geo-block-new-blocked{animation:ip-geo-block-flash-blocked 1s ease-out 0s 1 normal both running}@keyframes ip-geo-block-flash-passed{0%{background-color:gold}100%{background-color:#edf6ff}}@keyframes ip-geo-block-flash-blocked{0%{background-color:gold}100%{background-color:#ffefef}}mark{padding:0;background:gold}// Gold #ip-geo-block-live-log{margin:0}#ip-geo-block-live-log li{float:left;margin-right:3em}#ip-geo-block-live-log li:last-child{margin-right:0}#ip-geo-block-live-log li input[type=radio]{visibility:hidden;position:absolute}#ip-geo-block-live-log li input[type=radio]+label{display:inline-block;margin:-2px;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #ccc;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);border-bottom-color:#b3b3b3;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}#ip-geo-block-live-log li input[type=radio]:checked+label{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);background-color:#e0e0e0}.ip-geo-block-live-timer{height:1em;width:1em;margin:0;position:relative;top:0;left:0}.ip-geo-block-live-timer:before{content:"";display:block;height:1em;width:1em;background:#0073aa;border-radius:50%;position:absolute;top:0;left:0}.ip-geo-block-live-timer:after{display:none}.ip-geo-block-live-timer>div{position:absolute;width:1em;height:1em;clip:rect(0,1em,1em,.5em)}.ip-geo-block-live-timer>div:before{content:" ";position:absolute;width:1em;height:1em;border-radius:.5em;clip:rect(0,.5em,1em,0);background-color:#f1f1f1;transform:rotate(0)}.ip-geo-block-live-timer>div:first-child:before{animation:30s spin-timer linear forwards}.ip-geo-block-live-timer>div:last-child{transform:rotate(180deg)}.ip-geo-block-live-timer>div:last-child:before{transform:rotate(0);animation:30s spin-timer linear 30s forwards}@keyframes spin-timer{0%{transform:rotate(0)}100%{transform:rotate(180deg)}}.ip-geo-block-subitem{margin-left:1.7em}.ip-geo-block-subitem:before{content:"\00bb";position:absolute;left:2em}.ip-geo-block-subitem dfn{vertical-align:middle}.ip-geo-block-subitem-parent td,.ip-geo-block-subitem-parent th{padding-top:0}:placeholder-shown{color:#888}::-webkit-input-placeholder{color:#888}:-moz-placeholder{color:#888;opacity:1}::-moz-placeholder{color:#888;opacity:1}:-ms-input-placeholder{color:#888}
admin/includes/class-admin-ajax.php CHANGED
@@ -191,7 +191,7 @@ class IP_Geo_Block_Admin_Ajax {
191
*/
192
public static function catch_live_log() {
193
$user = IP_Geo_Block_Util::get_current_user_id();
194
- $auth = get_transient( IP_Geo_Block::PLUGIN_NAME . '-live-log' );
195
196
if ( $auth === FALSE || $user === (int)$auth ) {
197
set_transient( IP_Geo_Block::PLUGIN_NAME . '-live-log', $user, IP_Geo_Block_Admin::TIMEOUT_LIVE_UPDATE );
@@ -343,11 +343,11 @@ endif;
343
);
344
345
$time = array(
346
- YEAR_IN_SECONDS, // All
347
- HOUR_IN_SECONDS, // Latest 1 hour
348
- DAY_IN_SECONDS, // Latest 24 hours
349
- WEEK_IN_SECONDS, // Latest 1 week
350
- MONTH_IN_SECONDS, // Latest 1 month
351
);
352
353
$i = 0;
@@ -523,6 +523,7 @@ endif; // TEST_RESTORE_NETWORK
523
'[extra_ips][black_list]',
524
'[anonymize]',
525
'[restrict_api]', // 3.0.13
526
'[signature]',
527
'[login_fails]',
528
'[response_code]',
@@ -572,7 +573,6 @@ endif; // TEST_RESTORE_NETWORK
572
'[public][target_cates][$]', // 3.0.0
573
'[public][target_tags][$]', // 3.0.0
574
'[public][ua_list]', // 3.0.0
575
- '[public][simulate]', // 3.0.0
576
'[public][dnslkup]', // 3.0.3
577
'[public][response_code]', // 3.0.3
578
'[public][response_msg]', // 3.0.3
@@ -826,37 +826,41 @@ endif; // TEST_RESTORE_NETWORK
826
$dsp = @ini_set( 'display_errors', 0 );
827
$log = @ini_set( 'error_log', '/' . 'dev' . '/' . 'null' );
828
$err = @error_reporting( 0 );
829
- global $wpdb;
830
- $ver = $wpdb->get_var( 'SELECT @@GLOBAL.version' );
831
- $bem = $wpdb->get_var( 'SELECT @@GLOBAL.block_encryption_mode' ); // `aes-128-ecb` @since MySQL 5.6.17
832
@ini_set( 'output_buffering', $buf );
833
@ini_set( 'display_errors', $dsp );
834
@ini_set( 'error_log', $log );
835
@error_reporting( $err );
836
837
- // Server, PHP, WordPress
838
- $res = array(
839
- 'Server:' => $_SERVER['SERVER_SOFTWARE'],
840
- 'MySQL:' => $ver . ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG && $bem ? ' (' . $bem . ')' : '' ),
841
- 'PHP:' => PHP_VERSION,
842
- 'PHP SAPI:' => php_sapi_name(),
843
- 'WordPress:' => $GLOBALS['wp_version'],
844
- 'Multisite:' => is_multisite() ? 'yes' : 'no',
845
- 'File system:' => $fs->get_method(),
846
- 'Temp folder:' => get_temp_dir(),
847
- 'Umask:' => sprintf( '%o', umask() ^ 511 /*0777*/ ),
848
- 'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
849
- 'ZipArchive:' => class_exists( 'ZipArchive', FALSE ) ? 'yes' : 'no',
850
- 'PECL phar:' => class_exists( 'PharData', FALSE ) ? 'yes' : 'no',
851
- 'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
852
- 'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no', // @since PHP 4.0.6
853
- 'OpenSSL:' => defined( 'OPENSSL_RAW_DATA' ) ? 'yes' : 'no', // @since PHP 5.3.3
854
- 'SQLite(PDO):' => extension_loaded( 'pdo_sqlite' ) ? 'yes' : 'no',
855
- 'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
856
- 'User agent:' => $_SERVER['HTTP_USER_AGENT'],
857
- );
858
859
- $res = array_map( 'esc_html', $res );
860
861
// Child and parent themes
862
$activated = wp_get_theme(); // @since 3.4.0
@@ -887,7 +891,7 @@ endif; // TEST_RESTORE_NETWORK
887
if ( IP_Geo_Block::is_blocked( $val['result'] ) ) {
888
// hide port and nonce
889
$method = preg_replace( '/\[\d+\]/', '', $val['method'] );
890
- $method = preg_replace( '/(' . IP_Geo_Block::PLUGIN_NAME . '-auth-nonce)(?:=|%3D)([\w]+)/', '$1=...', $method );
891
892
// add post data
893
$query = array();
191
*/
192
public static function catch_live_log() {
193
$user = IP_Geo_Block_Util::get_current_user_id();
194
+ $auth = IP_Geo_Block::get_live_log();
195
196
if ( $auth === FALSE || $user === (int)$auth ) {
197
set_transient( IP_Geo_Block::PLUGIN_NAME . '-live-log', $user, IP_Geo_Block_Admin::TIMEOUT_LIVE_UPDATE );
343
);
344
345
$time = array(
346
+ YEAR_IN_SECONDS, // All
347
+ HOUR_IN_SECONDS, // Latest 1 hour
348
+ DAY_IN_SECONDS, // Latest 24 hours
349
+ WEEK_IN_SECONDS, // Latest 1 week
350
+ 30 * DAY_IN_SECONDS // Latest 1 month (MONTH_IN_SECONDS is since WP 4.4+)
351
);
352
353
$i = 0;
523
'[extra_ips][black_list]',
524
'[anonymize]',
525
'[restrict_api]', // 3.0.13
526
+ '[simulate]', // 3.0.14
527
'[signature]',
528
'[login_fails]',
529
'[response_code]',
573
'[public][target_cates][$]', // 3.0.0
574
'[public][target_tags][$]', // 3.0.0
575
'[public][ua_list]', // 3.0.0
576
'[public][dnslkup]', // 3.0.3
577
'[public][response_code]', // 3.0.3
578
'[public][response_msg]', // 3.0.3
826
$dsp = @ini_set( 'display_errors', 0 );
827
$log = @ini_set( 'error_log', '/' . 'dev' . '/' . 'null' );
828
$err = @error_reporting( 0 );
829
+ $ver = $GLOBALS['wpdb']->get_var( 'SELECT @@GLOBAL.version' );
830
+ $bem = $GLOBALS['wpdb']->get_var( 'SELECT @@GLOBAL.block_encryption_mode' ); // `aes-128-ecb` @since MySQL 5.6.17
831
@ini_set( 'output_buffering', $buf );
832
@ini_set( 'display_errors', $dsp );
833
@ini_set( 'error_log', $log );
834
@error_reporting( $err );
835
836
+ // Proces owner
837
+ // https://secure.php.net/manual/function.get-current-user.php#57624
838
+ // https://secure.php.net/manual/function.posix-getpwuid.php#82387
839
+ $usr = function_exists( 'posix_getpwuid' ) ? posix_getpwuid( posix_geteuid() ) : array( 'name' => getenv( 'USERNAME' ) );
840
841
+ // Server, PHP, WordPress
842
+ $res = array_map( 'esc_html', array(
843
+ 'Server:' => $_SERVER['SERVER_SOFTWARE'],
844
+ 'MySQL:' => $ver . ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG && $bem ? ' (' . $bem . ')' : '' ),
845
+ 'PHP:' => PHP_VERSION,
846
+ 'PHP SAPI:' => php_sapi_name(),
847
+ 'WordPress:' => $GLOBALS['wp_version'],
848
+ 'Multisite:' => is_multisite() ? 'yes' : 'no',
849
+ 'File system:' => $fs->get_method(),
850
+ 'Temp folder:' => get_temp_dir(),
851
+ 'Process owner:' => $usr['name'],
852
+ 'File owner:' => get_current_user(), // Gets the name of the owner of the current PHP script
853
+ 'Umask:' => sprintf( '%o', umask() ^ 511 /* 0777 */ ),
854
+ 'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
855
+ 'ZipArchive:' => class_exists( 'ZipArchive', FALSE ) ? 'yes' : 'no',
856
+ 'PECL phar:' => class_exists( 'PharData', FALSE ) ? 'yes' : 'no',
857
+ 'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
858
+ 'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no', // @since PHP 4.0.6
859
+ 'OpenSSL:' => defined( 'OPENSSL_RAW_DATA' ) ? 'yes' : 'no', // @since PHP 5.3.3
860
+ 'SQLite(PDO):' => extension_loaded( 'pdo_sqlite' ) ? 'yes' : 'no',
861
+ 'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
862
+ 'User agent:' => $_SERVER['HTTP_USER_AGENT'],
863
+ ) );
864
865
// Child and parent themes
866
$activated = wp_get_theme(); // @since 3.4.0
891
if ( IP_Geo_Block::is_blocked( $val['result'] ) ) {
892
// hide port and nonce
893
$method = preg_replace( '/\[\d+\]/', '', $val['method'] );
894
+ $method = preg_replace( '/(' . IP_Geo_Block::get_auth_key() . ')(?:=|%3D)([\w]+)/', '$1=...', $method );
895
896
// add post data
897
$query = array();
admin/includes/class-admin-rewrite.php CHANGED
@@ -396,7 +396,7 @@ class IP_Geo_Block_Admin_Rewrite {
396
*
397
*/
398
private function show_message( $msg ) {
399
- if ( class_exists( 'IP_Geo_Block_Admin' ) )
400
IP_Geo_Block_Admin::add_admin_notice( 'error', $msg );
401
}
402
396
*
397
*/
398
private function show_message( $msg ) {
399
+ if ( class_exists( 'IP_Geo_Block_Admin', FALSE ) )
400
IP_Geo_Block_Admin::add_admin_notice( 'error', $msg );
401
}
402
admin/includes/tab-accesslog.php CHANGED
@@ -183,13 +183,18 @@ endif; // $options['validation']['reclogs']
183
* Function that fills the section with the desired content.
184
*
185
*/
186
public static function validation_logs() {
187
echo '<table id="', IP_Geo_Block::PLUGIN_NAME, '-validation-logs" class="', IP_Geo_Block::PLUGIN_NAME, '-dataTable display" cellspacing="0" width="100%">', "\n", '<thead></thead><tbody></tbody></table>', "\n";
188
}
189
190
public static function warn_accesslog() {
191
- $context = IP_Geo_Block_Admin::get_instance();
192
- $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), $context->dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
193
echo '<p style="padding:0 1em">', sprintf( __( '[ %sRecord &#8220;Validation logs&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
194
echo '<p style="padding:0 1em">', __( 'Please set the proper condition to record and analyze the validation logs.', 'ip-geo-block' ), '</p>', "\n";
195
}
183
* Function that fills the section with the desired content.
184
*
185
*/
186
+ private static function dashboard_url() {
187
+ $options = IP_Geo_Block::get_option();
188
+ $context = IP_Geo_Block_Admin::get_instance();
189
+ return $context->dashboard_url( $options['network_wide'] );
190
+ }
191
+
192
public static function validation_logs() {
193
echo '<table id="', IP_Geo_Block::PLUGIN_NAME, '-validation-logs" class="', IP_Geo_Block::PLUGIN_NAME, '-dataTable display" cellspacing="0" width="100%">', "\n", '<thead></thead><tbody></tbody></table>', "\n";
194
}
195
196
public static function warn_accesslog() {
197
+ $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), self::dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
198
echo '<p style="padding:0 1em">', sprintf( __( '[ %sRecord &#8220;Validation logs&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
199
echo '<p style="padding:0 1em">', __( 'Please set the proper condition to record and analyze the validation logs.', 'ip-geo-block' ), '</p>', "\n";
200
}
admin/includes/tab-settings.php CHANGED
@@ -47,11 +47,11 @@ class IP_Geo_Block_Admin_Tab {
47
* @since 2.7.0
48
*/
49
/*----------------------------------------*
50
- * Validation rule settings
51
*----------------------------------------*/
52
add_settings_section(
53
$section = $plugin_slug . '-validation-rule',
54
- array( __( 'Validation rule settings', 'ip-geo-block' ), '<a href="https://www.ipgeoblock.com/codex/validation-rule-settings.html" title="Validation rule settings | IP Geo Block">' . $common[4] . '</a>' ),
55
NULL,
56
$option_slug
57
);
@@ -192,6 +192,24 @@ endif;
192
)
193
);
194
195
// White list of extra IP addresses prior to country code (CIDR, ASN)
196
add_settings_field(
197
$option_name.'_extra_ips_white_list',
@@ -234,24 +252,6 @@ endif;
234
)
235
);
236
237
- // $_SERVER keys to retrieve extra IP addresses
238
- add_settings_field(
239
- $option_name.'_validation_proxy',
240
- __( '<dfn title="If your server is placed behind the proxy server or the load balancing server, you need to put the appropriate key such as &#8220;HTTP_X_FORWARDED_FOR&#8221;, &#8220;HTTP_X_REAL_IP&#8221; or something like that to retrieve the client IP address.">$_SERVER keys to retrieve extra IP addresses</dfn>', 'ip-geo-block' ),
241
- array( $context, 'callback_field' ),
242
- $option_slug,
243
- $section,
244
- array(
245
- 'type' => 'text',
246
- 'option' => $option_name,
247
- 'field' => 'validation',
248
- 'sub-field' => 'proxy',
249
- 'value' => $options['validation']['proxy'],
250
- 'placeholder' => IP_Geo_Block_Util::get_proxy_var(),
251
- 'after' => $common[0],
252
- )
253
- );
254
-
255
// Bad signatures
256
add_settings_field(
257
$option_name.'_signature',
@@ -397,6 +397,21 @@ endif;
397
)
398
);
399
400
/*----------------------------------------*
401
* Back-end target settings
402
*----------------------------------------*/
@@ -408,7 +423,7 @@ endif;
408
);
409
410
// same as in tab-accesslog.php
411
- $dfn = __( '<dfn title="Validate request to %s.">%s</dfn>', 'ip-geo-block' );
412
$target = array(
413
'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
414
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
@@ -797,7 +812,7 @@ endif;
797
'field' => 'public',
798
'sub-field' => 'matching_rule',
799
'value' => $options['public']['matching_rule'],
800
- 'list' => array( -1 => __( 'Follow &#8220;Validation rule settings&#8221;', 'ip-geo-block' ) ) + $rule,
801
)
802
);
803
@@ -1052,22 +1067,6 @@ endif;
1052
)
1053
);
1054
1055
- // Simulation mode
1056
- add_settings_field(
1057
- $option_name.'_public_simulate',
1058
- '<dfn title="' . __( 'It enables to simulate validation without deployment. The results can be found as &#8220;public&#8221; in Logs.', 'ip-geo-block' ) . '">' . __( 'Simulation mode', 'ip-geo-block' ) . '</dfn>',
1059
- array( $context, 'callback_field' ),
1060
- $option_slug,
1061
- $section,
1062
- array(
1063
- 'type' => 'checkbox',
1064
- 'option' => $option_name,
1065
- 'field' => 'public',
1066
- 'sub-field' => 'simulate',
1067
- 'value' => $options['public']['simulate'],
1068
- )
1069
- );
1070
-
1071
/*----------------------------------------*
1072
* Privacy and record settings
1073
*----------------------------------------*/
@@ -1108,39 +1107,6 @@ endif;
1108
)
1109
);
1110
1111
- // Record Statistics of validation
1112
- add_settings_field(
1113
- $option_name.'_save_statistics',
1114
- __( '<dfn title="This option enables to record the number blocked countries and the number of blocked requests per day.">Record &#8220;Statistics of validation&#8221;</dfn>', 'ip-geo-block' ),
1115
- array( $context, 'callback_field' ),
1116
- $option_slug,
1117
- $section,
1118
- array(
1119
- 'type' => 'checkbox',
1120
- 'option' => $option_name,
1121
- 'field' => 'save_statistics',
1122
- 'value' => $options['save_statistics'],
1123
- )
1124
- );
1125
-
1126
- if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1127
- add_settings_field(
1128
- $option_name.'_validation_recdays',
1129
- '<div class="ip-geo-block-subitem">' . __( 'Maximum period for &#8220;Statistics&#8221; [days]', 'ip-geo-block' ) . '</div>',
1130
- array( $context, 'callback_field' ),
1131
- $option_slug,
1132
- $section,
1133
- array(
1134
- 'type' => 'text',
1135
- 'option' => $option_name,
1136
- 'field' => 'validation',
1137
- 'sub-field' => 'recdays',
1138
- 'value' => $options['validation']['recdays'],
1139
- 'class' => 'ip-geo-block-subitem-parent',
1140
- )
1141
- );
1142
- endif;
1143
-
1144
// Record IP address cache
1145
add_settings_field(
1146
$option_name.'_cache_hold',
@@ -1302,7 +1268,7 @@ endif;
1302
// Interval [sec] to cleanup expired entries of IP address
1303
add_settings_field(
1304
$option_name.'_cache_time_gc',
1305
- __( '<dfn title="This option enables to schedule the WP-Cron event to remove the expired entries in &#8220;IP address cache&#8221; and &#8220;Logs&#8221;.">Interval [sec] to cleanup expired entries of IP address</dfn>', 'ip-geo-block' ),
1306
array( $context, 'callback_field' ),
1307
$option_slug,
1308
$section,
@@ -1315,6 +1281,39 @@ endif;
1315
)
1316
);
1317
1318
// Remove all settings and records at uninstallation
1319
add_settings_field(
1320
$option_name.'_clean_uninstall',
@@ -1347,8 +1346,9 @@ endif;
1347
// Disable 3rd parties API
1348
if ( ! empty( $options['restrict_api'] ) ) {
1349
foreach ( array_keys( $provider ) as $key ) {
1350
- if ( ! in_array( $key, $providers, TRUE ) )
1351
$provider[ $key ] = is_string( $provider[ $key ] ) ? '-1' : -1;
1352
}
1353
}
1354
@@ -1470,9 +1470,9 @@ endif;
1470
NULL,
1471
$option_slug
1472
);
1473
- if ( IP_GEO_BLOCK_NETWORK ):
1474
// @see https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/
1475
- if ( is_main_site() && is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
1476
add_action( 'network_admin_edit_' . IP_Geo_Block::PLUGIN_NAME, array( $context, 'validate_network_settings' ) );
1477
1478
// Network wide configuration
@@ -1487,7 +1487,7 @@ if ( IP_GEO_BLOCK_NETWORK ):
1487
'option' => $option_name,
1488
'field' => 'network_wide',
1489
'value' => $options['network_wide'],
1490
- 'disabled' => ! current_user_can( 'manage_network_options' ),
1491
)
1492
);
1493
}
@@ -1512,7 +1512,7 @@ endif;
1512
// Google Maps API key
1513
add_settings_field(
1514
$option_name.'_api_key',
1515
- __( '<dfn title="Valid key for Google Maps JavaScript API. A free tier has limit even if it\'s &#8220;default&#8221;. Maps Embed API without key can be available in case of empty.">Google Maps API key</dfn>', 'ip-geo-block' ),
1516
array( $context, 'callback_field' ),
1517
$option_slug,
1518
$section,
@@ -1560,16 +1560,16 @@ endif;
1560
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1561
// DB tables for this plugin
1562
add_settings_field(
1563
- $option_name.'_init_table',
1564
- __( 'DB tables for this plugin', 'ip-geo-block' ),
1565
array( $context, 'callback_field' ),
1566
$option_slug,
1567
$section,
1568
array(
1569
'type' => 'button',
1570
'option' => $option_name,
1571
- 'field' => 'init_table',
1572
- 'value' => __( 'Initialize now', 'ip-geo-block' ),
1573
'after' => '<div id="ip-geo-block-init-table"></div>',
1574
)
1575
);
@@ -1618,6 +1618,10 @@ endif;
1618
}
1619
1620
public static function note_public() {
1621
}
1622
1623
public static function note_privacy() {
47
* @since 2.7.0
48
*/
49
/*----------------------------------------*
50
+ * Validation rules and behavior
51
*----------------------------------------*/
52
add_settings_section(
53
$section = $plugin_slug . '-validation-rule',
54
+ array( __( 'Validation rules and behavior', 'ip-geo-block' ), '<a href="https://www.ipgeoblock.com/codex/validation-rule-settings.html" title="Validation rules and behavior | IP Geo Block">' . $common[4] . '</a>' ),
55
NULL,
56
$option_slug
57
);
192
)
193
);
194
195
+ // $_SERVER keys to retrieve extra IP addresses
196
+ add_settings_field(
197
+ $option_name.'_validation_proxy',
198
+ __( '<dfn title="If your server is placed behind the proxy server or the load balancing server, you need to put the appropriate key such as &#8220;HTTP_X_FORWARDED_FOR&#8221;, &#8220;HTTP_X_REAL_IP&#8221; or something like that to retrieve the client IP address.">$_SERVER keys to retrieve extra IP addresses</dfn>', 'ip-geo-block' ),
199
+ array( $context, 'callback_field' ),
200
+ $option_slug,
201
+ $section,
202
+ array(
203
+ 'type' => 'text',
204
+ 'option' => $option_name,
205
+ 'field' => 'validation',
206
+ 'sub-field' => 'proxy',
207
+ 'value' => $options['validation']['proxy'],
208
+ 'placeholder' => IP_Geo_Block_Util::get_proxy_var(),
209
+ 'after' => $common[0],
210
+ )
211
+ );
212
+
213
// White list of extra IP addresses prior to country code (CIDR, ASN)
214
add_settings_field(
215
$option_name.'_extra_ips_white_list',
252
)
253
);
254
255
// Bad signatures
256
add_settings_field(
257
$option_name.'_signature',
397
)
398
);
399
400
+ // Simulation mode
401
+ add_settings_field(
402
+ $option_name.'_simulate',
403
+ '<dfn title="' . __( 'It enables to simulate the validation rules without actual blocking in order to check the behavior of this plugin. The results can be found on &#8220;Logs&#8221; tab.', 'ip-geo-block' ) . '">' . __( 'Simulation mode', 'ip-geo-block' ) . '</dfn>',
404
+ array( $context, 'callback_field' ),
405
+ $option_slug,
406
+ $section,
407
+ array(
408
+ 'type' => 'checkbox',
409
+ 'option' => $option_name,
410
+ 'field' => 'simulate',
411
+ 'value' => isset( $options['simulate'] ) ? $options['simulate'] : FALSE,
412
+ )
413
+ );
414
+
415
/*----------------------------------------*
416
* Back-end target settings
417
*----------------------------------------*/
423
);
424
425
// same as in tab-accesslog.php
426
+ $dfn = __( '<dfn title="It enables to validate requests to %s.">%s</dfn>', 'ip-geo-block' );
427
$target = array(
428
'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
429
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
812
'field' => 'public',
813
'sub-field' => 'matching_rule',
814
'value' => $options['public']['matching_rule'],
815
+ 'list' => array( -1 => __( 'Follow &#8220;Validation rules and behavior&#8221;', 'ip-geo-block' ) ) + $rule,
816
)
817
);
818
1067
)
1068
);
1069
1070
/*----------------------------------------*
1071
* Privacy and record settings
1072
*----------------------------------------*/
1107
)
1108
);
1109
1110
// Record IP address cache
1111
add_settings_field(
1112
$option_name.'_cache_hold',
1268
// Interval [sec] to cleanup expired entries of IP address
1269
add_settings_field(
1270
$option_name.'_cache_time_gc',
1271
+ __( '<dfn title="This option enables to schedule the WP-Cron event to remove the expired entries from &#8220;IP address cache&#8221; and &#8220;Validation logs&#8221;.">Interval [sec] to cleanup expired entries of IP address</dfn>', 'ip-geo-block' ),
1272
array( $context, 'callback_field' ),
1273
$option_slug,
1274
$section,
1281
)
1282
);
1283
1284
+ // Record Statistics of validation
1285
+ add_settings_field(
1286
+ $option_name.'_save_statistics',
1287
+ __( '<dfn title="This option enables to record the number blocked countries and the number of blocked requests per day.">Record &#8220;Statistics of validation&#8221;</dfn>', 'ip-geo-block' ),
1288
+ array( $context, 'callback_field' ),
1289
+ $option_slug,
1290
+ $section,
1291
+ array(
1292
+ 'type' => 'checkbox',
1293
+ 'option' => $option_name,
1294
+ 'field' => 'save_statistics',
1295
+ 'value' => $options['save_statistics'],
1296
+ )
1297
+ );
1298
+
1299
+ if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1300
+ add_settings_field(
1301
+ $option_name.'_validation_recdays',
1302
+ '<div class="ip-geo-block-subitem">' . __( 'Maximum period for &#8220;Statistics&#8221; [days]', 'ip-geo-block' ) . '</div>',
1303
+ array( $context, 'callback_field' ),
1304
+ $option_slug,
1305
+ $section,
1306
+ array(
1307
+ 'type' => 'text',
1308
+ 'option' => $option_name,
1309
+ 'field' => 'validation',
1310
+ 'sub-field' => 'recdays',
1311
+ 'value' => $options['validation']['recdays'],
1312
+ 'class' => 'ip-geo-block-subitem-parent',
1313
+ )
1314
+ );
1315
+ endif;
1316
+
1317
// Remove all settings and records at uninstallation
1318
add_settings_field(
1319
$option_name.'_clean_uninstall',
1346
// Disable 3rd parties API
1347
if ( ! empty( $options['restrict_api'] ) ) {
1348
foreach ( array_keys( $provider ) as $key ) {
1349
+ if ( ! in_array( $key, $providers, TRUE ) ) {
1350
$provider[ $key ] = is_string( $provider[ $key ] ) ? '-1' : -1;
1351
+ }
1352
}
1353
}
1354
1470
NULL,
1471
$option_slug
1472
);
1473
+ if ( IP_GEO_BLOCK_NETWORK && FALSE ):
1474
// @see https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/
1475
+ if ( $context->is_network_admin() ) {
1476
add_action( 'network_admin_edit_' . IP_Geo_Block::PLUGIN_NAME, array( $context, 'validate_network_settings' ) );
1477
1478
// Network wide configuration
1487
'option' => $option_name,
1488
'field' => 'network_wide',
1489
'value' => $options['network_wide'],
1490
+ 'disabled' => ! is_main_site(),
1491
)
1492
);
1493
}
1512
// Google Maps API key
1513
add_settings_field(
1514
$option_name.'_api_key',
1515
+ __( '<dfn title="Valid key for Google Maps JavaScript API. Maps Embed API in iframe can be available without key in case it\'s empty.">Google Maps API key</dfn>', 'ip-geo-block' ),
1516
array( $context, 'callback_field' ),
1517
$option_slug,
1518
$section,
1560
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1561
// DB tables for this plugin
1562
add_settings_field(
1563
+ $option_name.'_diag_tables',
1564
+ __( 'Diagnose all DB tables', 'ip-geo-block' ),
1565
array( $context, 'callback_field' ),
1566
$option_slug,
1567
$section,
1568
array(
1569
'type' => 'button',
1570
'option' => $option_name,
1571
+ 'field' => 'diag_tables',
1572
+ 'value' => __( 'Diagnose now', 'ip-geo-block' ),
1573
'after' => '<div id="ip-geo-block-init-table"></div>',
1574
)
1575
);
1618
}
1619
1620
public static function note_public() {
1621
+ echo
1622
+ '<ul class="ip-geo-block-note">', "\n",
1623
+ '<li>', sprintf( __( 'Please refer to "%sLiving with cache plugin%s" for compatibility with cache plugins.', 'ip-geo-block' ), '<a href="https://www.ipgeoblock.com/codex/living-with-caching-plugin.html" title="Living with caching plugin | IP Geo Block">', '</a>' ), '</li>', "\n",
1624
+ '</ul>', "\n";
1625
}
1626
1627
public static function note_privacy() {
admin/includes/tab-statistics.php CHANGED
@@ -3,7 +3,6 @@ class IP_Geo_Block_Admin_Tab {
3
4
public static function tab_setup( $context, $tab ) {
5
$options = IP_Geo_Block::get_option();
6
- $statistics = IP_Geo_Block_Logs::restore_stat( TRUE );
7
$plugin_slug = IP_Geo_Block::PLUGIN_NAME;
8
9
register_setting(
@@ -25,6 +24,7 @@ class IP_Geo_Block_Admin_Tab {
25
);
26
27
if ( $options['save_statistics'] ) :
28
29
// Number of blocked access
30
add_settings_field(
@@ -309,39 +309,32 @@ endif;
309
$key = $log['method'] . ' ' . $log['data'];
310
311
// <methodName>...</methodName>
312
- if ( preg_match( '#<methodName>(.*?)</methodName>#', $key, $matches ) ) {
313
$log['slug'] = '/xmlrpc.php ' . $matches[1];
314
- }
315
316
// /wp-content/(plugins|themes)/...
317
- elseif ( preg_match( '#(/wp-content/(?:plugins|themes)/.*?/)#', $key, $matches ) ) {
318
$log['slug'] = $matches[1];
319
- }
320
321
// /wp-admin/admin*.php?action=...
322
- elseif ( preg_match( '#(/wp-admin/admin.*?\.php).*((?:page|action)=[-\w]+)#', $key, $matches ) ) {
323
$log['slug'] = $matches[1] . ' ' . $matches[2];
324
- }
325
326
// /wp-admin/*.php
327
- elseif ( preg_match( '#(/wp-admin/(?!admin).*?\.php)#', $key, $matches ) ) {
328
$log['slug'] = $matches[1];
329
- }
330
331
// file uploading *.(zip|tar|rar|gz|php|...)
332
- elseif ( preg_match( '#(\[name\]\s*?=>\s*?[^\s]+)#', $key, $matches ) ) {
333
$log['slug'] = $matches[1];
334
- }
335
336
// other *.php file with or without query string
337
- elseif ( preg_match( '#(/[^/]*\.php)[^/\w]#', $key, $matches ) && FALSE === strpos( $key, '/wp-admin/' ) ) {
338
$log['slug'] = $matches[1];
339
- }
340
341
foreach ( array_keys( $keys ) as $key ) {
342
- if ( ! empty( $log[ $key ] ) ) {
343
$count[ $key ][] = $log[ $key ];
344
- }
345
}
346
}
347
@@ -400,23 +393,26 @@ endif;
400
* Function that fills the section with the desired content.
401
*
402
*/
403
- public static function warn_statistics() {
404
$context = IP_Geo_Block_Admin::get_instance();
405
- $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), $context->dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
406
echo '<p>', sprintf( __( '[ %sRecord &#8220;Statistics of validation&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
407
echo '<p>', __( 'Please set the proper condition to record and analyze the validation statistics.', 'ip-geo-block' ), '</p>', "\n";
408
}
409
410
public static function warn_validation() {
411
- $context = IP_Geo_Block_Admin::get_instance();
412
- $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), $context->dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
413
echo '<p>', sprintf( __( '[ %sRecord &#8220;Validation logs&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
414
echo '<p>', __( 'Please set the proper condition to record and analyze the validation logs.', 'ip-geo-block' ), '</p>', "\n";
415
}
416
417
public static function warn_ipadr_cache() {
418
- $context = IP_Geo_Block_Admin::get_instance();
419
- $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), $context->dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
420
echo '<p style="padding:0 1em">', sprintf( __( '[ %sRecord &#8220;IP address cache&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
421
echo '<p style="padding:0 1em">', __( 'Please set the proper condition to record IP address in cache.', 'ip-geo-block' ), '</p>', "\n";
422
}
3
4
public static function tab_setup( $context, $tab ) {
5
$options = IP_Geo_Block::get_option();
6
$plugin_slug = IP_Geo_Block::PLUGIN_NAME;
7
8
register_setting(
24
);
25
26
if ( $options['save_statistics'] ) :
27
+ $statistics = IP_Geo_Block_Logs::restore_stat();
28
29
// Number of blocked access
30
add_settings_field(
309
$key = $log['method'] . ' ' . $log['data'];
310
311
// <methodName>...</methodName>
312
+ if ( preg_match( '#<methodName>(.*?)</methodName>#', $key, $matches ) )
313
$log['slug'] = '/xmlrpc.php ' . $matches[1];
314
315
// /wp-content/(plugins|themes)/...
316
+ elseif ( preg_match( '#(/wp-content/(?:plugins|themes)/.*?/)#', $key, $matches ) )
317
$log['slug'] = $matches[1];
318
319
// /wp-admin/admin*.php?action=...
320
+ elseif ( preg_match( '#(/wp-admin/admin.*?\.php).*((?:page|action)=[-\w]+)#', $key, $matches ) )
321
$log['slug'] = $matches[1] . ' ' . $matches[2];
322
323
// /wp-admin/*.php
324
+ elseif ( preg_match( '#(/wp-admin/(?!admin).*?\.php)#', $key, $matches ) )
325
$log['slug'] = $matches[1];
326
327
// file uploading *.(zip|tar|rar|gz|php|...)
328
+ elseif ( preg_match( '#(\[name\]\s*?=>\s*?[^\s]+)#', $key, $matches ) )
329
$log['slug'] = $matches[1];
330
331
// other *.php file with or without query string
332
+ elseif ( preg_match( '#(/[^/]*\.php)[^/\w]#', $key, $matches ) && FALSE === strpos( $key, '/wp-admin/' ) )
333
$log['slug'] = $matches[1];
334
335
foreach ( array_keys( $keys ) as $key ) {
336
+ if ( ! empty( $log[ $key ] ) )
337
$count[ $key ][] = $log[ $key ];
338
}
339
}
340
393
* Function that fills the section with the desired content.
394
*
395
*/
396
+ private static function dashboard_url() {
397
+ $options = IP_Geo_Block::get_option();
398
$context = IP_Geo_Block_Admin::get_instance();
399
+ return $context->dashboard_url( $options['network_wide'] );
400
+ }
401
+
402
+ public static function warn_statistics() {
403
+ $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), self::dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
404
echo '<p>', sprintf( __( '[ %sRecord &#8220;Statistics of validation&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
405
echo '<p>', __( 'Please set the proper condition to record and analyze the validation statistics.', 'ip-geo-block' ), '</p>', "\n";
406
}
407
408
public static function warn_validation() {
409
+ $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), self::dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
410
echo '<p>', sprintf( __( '[ %sRecord &#8220;Validation logs&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
411
echo '<p>', __( 'Please set the proper condition to record and analyze the validation logs.', 'ip-geo-block' ), '</p>', "\n";
412
}
413
414
public static function warn_ipadr_cache() {
415
+ $url = esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => '0', 'sec' => 3 ), self::dashboard_url() ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-3' );
416
echo '<p style="padding:0 1em">', sprintf( __( '[ %sRecord &#8220;IP address cache&#8221;%s ] is disabled.', 'ip-geo-block' ), '<a href="' . $url . '">', '</a>' ), '</p>', "\n";
417
echo '<p style="padding:0 1em">', __( 'Please set the proper condition to record IP address in cache.', 'ip-geo-block' ), '</p>', "\n";
418
}
admin/js/admin.js CHANGED
@@ -5,7 +5,7 @@
5
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
6
* This software is released under the MIT License.
7
*/
8
- (function ($, window, document) {
9
// External variables
10
var skip_error = false,
11
timer_stack = [],
@@ -22,7 +22,7 @@
22
'%': 'ip_geo_block_',
23
'!': 'ip_geo_block_settings_'
24
};
25
- return 'undefined' !== typeof id ? keys[selector] + id : keys.$ + selector;
26
}
27
28
function escapeHTML(str) {
@@ -37,10 +37,6 @@
37
}).replace(/&amp;(#\d{2,4}|\w{4,7});/g, "&$1;"); // revert html character entity
38
}
39
40
- function is_blocked( result ) {
41
- return -1 === result.indexOf('pass');
42
- }
43
-
44
function stripTag(str) {
45
return str ? escapeHTML(str.toString().replace(/(<([^>]+)>)/ig, '')) : '';
46
}
@@ -49,7 +45,7 @@
49
var w = $(window).width();
50
if (w !== window_width) {
51
window_width = w;
52
- if ('undefined' === typeof timer_stack[name]) {
53
timer_stack[name] = {id: false, callback: callback};
54
}
55
$(window).off('resize').on('resize', function (/*event*/) {
@@ -86,7 +82,7 @@
86
87
function redirect(page, tab) {
88
if (-1 !== window.location.href.indexOf(page)) {
89
- window.location = stripTag(page) + (tab ? '&' + stripTag(tab) : '') + '&ip-geo-block-auth-nonce=' + ip_geo_block_auth.nonce;
90
}
91
}
92
@@ -265,6 +261,10 @@
265
}
266
}
267
268
/**
269
* jQuery deserialize plugin based on https://gist.github.com/nissuk/835256
270
*
@@ -279,8 +279,8 @@
279
for (key in json) {
280
if(json.hasOwnProperty(key)) {
281
try {
282
- name = decodeURIComponent(key); // URIError: malformed URI sequence
283
- value = decodeURIComponent(json[key]);
284
285
if (!data.hasOwnProperty(name)) { // !(name in data)
286
data[name] = [];
@@ -377,7 +377,7 @@
377
viewPie: [],
378
drawPie: function (id) {
379
var i, data;
380
- if ('undefined' === typeof chart.dataPie[id]) {
381
i = chart.dataPie[id] = new window.google.visualization.DataTable();
382
i.addColumn('string', 'Country');
383
i.addColumn('number', 'Requests');
@@ -385,14 +385,14 @@
385
chart.dataPie[id].addRows(data);
386
}
387
388
- if ('undefined' === typeof chart.viewPie[id]) {
389
chart.viewPie[id] = new window.google.visualization.PieChart(
390
document.getElementById(id)
391
);
392
}
393
394
- if ('undefined' !== typeof chart.dataPie[id] &&
395
- 'undefined' !== typeof chart.viewPie[id] &&
396
0 < (i = $('#' + id).width())) {
397
chart.viewPie[id].draw(chart.dataPie[id], {
398
backgroundColor: { fill: 'transparent' },
@@ -412,7 +412,7 @@
412
viewLine: [],
413
drawLine: function (id, datetype) {
414
var i, n, data;
415
- if ('undefined' === typeof chart.dataLine[id]) {
416
i = chart.dataLine[id] = new window.google.visualization.DataTable();
417
i.addColumn(datetype, 'Date' );
418
i.addColumn('number', 'comment');
@@ -428,14 +428,14 @@
428
chart.dataLine[id].addRows(data);
429
}
430
431
- if ('undefined' === typeof chart.viewLine[id]) {
432
chart.viewLine[id] = new window.google.visualization.LineChart(
433
document.getElementById(id)
434
);
435
}
436
437
- if ('undefined' !== typeof chart.dataLine[id] &&
438
- 'undefined' !== typeof chart.viewLine[id] &&
439
0 < (i = $('#' + id).width())) {
440
chart.viewLine[id].draw(chart.dataLine[id], {
441
legend: { position: 'bottom' },
@@ -456,9 +456,9 @@
456
dataStacked: [],
457
viewStacked: [],
458
drawStacked: function (id) {
459
- var i, w, data, range, $id = $('#' + id);
460
461
- if ('undefined' === typeof chart.dataStacked[id]) {
462
data = $.parseJSON($id.attr('data-' + id));
463
if (data) {
464
data.unshift(['site', 'comment', 'xmlrpc', 'login', 'admin', 'poblic', { role: 'link' } ]);
@@ -466,7 +466,7 @@
466
}
467
}
468
469
- if ('undefined' === typeof chart.viewStacked[id]) {
470
chart.viewStacked[id] = new window.google.visualization.BarChart(
471
document.getElementById(id)
472
);
@@ -506,8 +506,8 @@
506
}
507
508
if (0 < (w = $id.width()) &&
509
- 'undefined' !== typeof chart.dataStacked[id] &&
510
- 'undefined' !== typeof chart.viewStacked[id]) {
511
512
i = ID('range');
513
range = $.parseJSON($('.' + i).attr('data-' + i));
@@ -555,7 +555,7 @@
555
data = array_chunk(data, row);
556
557
$(ID('.', 'network')).each(function (index, obj) {
558
- if ('undefined' !== typeof data[index]) {
559
id = $(obj).attr('id');
560
dt = chart.dataStacked[id];
561
n = Math.min(row, data[index].length);
@@ -609,7 +609,7 @@
609
610
// Load / Save cookie using wpCookies in wp-includes/js/utils.js
611
function loadCookie(tabNo) {
612
- var i, cookie = ('undefined' !== typeof wpCookies && wpCookies.getHash('ip-geo-block')) || [];
613
614
for (i in cookie) {
615
if(cookie.hasOwnProperty(i)) {
@@ -617,7 +617,7 @@
617
}
618
}
619
620
- if ('undefined' === typeof cookie[tabNo]) {
621
cookie[tabNo] = [];
622
}
623
@@ -630,7 +630,7 @@
630
631
$.each(cookie, function(i, obj) {
632
c[i] = '';
633
- if ('undefined' !== typeof obj) {
634
n = obj.length;
635
if (n) {
636
c[i] = (obj[0] || 'o').toString();
@@ -642,7 +642,7 @@
642
});
643
644
// setHash( name, value, expires, path, domain, secure )
645
- if ('undefined' !== typeof wpCookies) {
646
wpCookies.setHash(
647
'ip-geo-block', c, new Date(Date.now() + 2592000000), ip_geo_block_auth.home + ip_geo_block_auth.admin
648
);
@@ -902,7 +902,7 @@
902
cmd: cmd,
903
which: data
904
}, function (data) {
905
- if ('undefined' !== typeof data.page) {
906
redirect(data.page, 'tab=' + tabNo);
907
} else if (data) {
908
table.ajax.reload();
@@ -997,9 +997,9 @@
997
// Name of base class
998
var name = ID('%', 'settings');
999
1000
- /*---------------------------
1001
- * Validation rule settings
1002
- *---------------------------*/
1003
// Scan your country code
1004
$('[id^="' + ID('scan-') + '"]').on('click', function (/*event*/) {
1005
var $this = $(this),
@@ -1373,7 +1373,7 @@
1373
1374
// Export settings
1375
$(ID('#', 'export')).on('click', function (/*event*/) {
1376
- if ('undefined' === typeof JSON) {
1377
notice_html5();
1378
return false;
1379
}
@@ -1394,7 +1394,7 @@
1394
1395
// Import settings
1396
$(ID('#', 'file-dialog')).on('change', function (event) {
1397
- if ('undefined' === typeof window.FileReader) {
1398
notice_html5();
1399
return false;
1400
}
@@ -1404,7 +1404,7 @@
1404
readfile(file, function (data) {
1405
data = JSON.parse(data);
1406
id = name + '[signature]';
1407
- if ('undefined' !== typeof data[id]) {
1408
data[id] = encode_str(data[id]);
1409
}
1410
ajax_post('export-import', {
@@ -1475,7 +1475,7 @@
1475
confirm(ip_geo_block.msg[0], function () {
1476
ajax_post('login-loading', {
1477
cmd: 'delete-link'
1478
- }, function (data) {
1479
$this.text(ip_geo_block.msg[2]);
1480
$this.addClass(type).nextAll(ID('.', 'desc')).remove();
1481
});
@@ -1485,9 +1485,9 @@
1485
});
1486
1487
// Manipulate DB table for validation logs
1488
- $(ID('@', 'init_table')).on('click', function (/*event*/) {
1489
confirm(ip_geo_block.msg[0], function () {
1490
- ajax_table('init-table');
1491
});
1492
return false;
1493
});
@@ -1563,8 +1563,7 @@
1563
1564
// Submit
1565
$('#submit').on('click', function (/*event*/) {
1566
- var elm = $(ID('@', 'signature')),
1567
- str = elm.val();
1568
if (str.indexOf(',') !== -1) {
1569
elm.val(encode_str(str));
1570
}
5
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
6
* This software is released under the MIT License.
7
*/
8
+ (function ($, window, document, undefined) {
9
// External variables
10
var skip_error = false,
11
timer_stack = [],
22
'%': 'ip_geo_block_',
23
'!': 'ip_geo_block_settings_'
24
};
25
+ return id !== undefined ? keys[selector] + id : keys.$ + selector;
26
}
27
28
function escapeHTML(str) {
37
}).replace(/&amp;(#\d{2,4}|\w{4,7});/g, "&$1;"); // revert html character entity
38
}
39
40
function stripTag(str) {
41
return str ? escapeHTML(str.toString().replace(/(<([^>]+)>)/ig, '')) : '';
42
}
45
var w = $(window).width();
46
if (w !== window_width) {
47
window_width = w;
48
+ if (timer_stack[name] === undefined) {
49
timer_stack[name] = {id: false, callback: callback};
50
}
51
$(window).off('resize').on('resize', function (/*event*/) {
82
83
function redirect(page, tab) {
84
if (-1 !== window.location.href.indexOf(page)) {
85
+ window.location = stripTag(page) + (tab ? '&' + stripTag(tab) : '') + '&' + (ip_geo_block_auth.key ? (ip_geo_block_auth.key + '=' + ip_geo_block_auth.nonce) : '');
86
}
87
}
88
261
}
262
}
263
264
+ function is_blocked(result) {
265
+ return -1 === result.indexOf('pass');
266
+ }
267
+
268
/**
269
* jQuery deserialize plugin based on https://gist.github.com/nissuk/835256
270
*
279
for (key in json) {
280
if(json.hasOwnProperty(key)) {
281
try {
282
+ name = stripTag(decodeURIComponent(key)); // URIError: malformed URI sequence
283
+ value = stripTag(decodeURIComponent(json[key]));
284
285
if (!data.hasOwnProperty(name)) { // !(name in data)
286
data[name] = [];
377
viewPie: [],
378
drawPie: function (id) {
379
var i, data;
380
+ if (chart.dataPie[id] === undefined) {
381
i = chart.dataPie[id] = new window.google.visualization.DataTable();
382
i.addColumn('string', 'Country');
383
i.addColumn('number', 'Requests');
385
chart.dataPie[id].addRows(data);
386
}
387
388
+ if (chart.viewPie[id] === undefined) {
389
chart.viewPie[id] = new window.google.visualization.PieChart(
390
document.getElementById(id)
391
);
392
}
393
394
+ if (chart.dataPie[id] !== undefined &&
395
+ chart.viewPie[id] !== undefined &&
396
0 < (i = $('#' + id).width())) {
397
chart.viewPie[id].draw(chart.dataPie[id], {
398
backgroundColor: { fill: 'transparent' },
412
viewLine: [],
413
drawLine: function (id, datetype) {
414
var i, n, data;
415
+ if (chart.dataLine[id] === undefined) {
416
i = chart.dataLine[id] = new window.google.visualization.DataTable();
417
i.addColumn(datetype, 'Date' );
418
i.addColumn('number', 'comment');
428
chart.dataLine[id].addRows(data);
429
}
430
431
+ if (chart.viewLine[id] === undefined) {
432
chart.viewLine[id] = new window.google.visualization.LineChart(
433
document.getElementById(id)
434
);
435
}
436
437
+ if (chart.dataLine[id] !== undefined &&
438
+ chart.viewLine[id] !== undefined &&
439
0 < (i = $('#' + id).width())) {
440
chart.viewLine[id].draw(chart.dataLine[id], {
441
legend: { position: 'bottom' },
456
dataStacked: [],
457
viewStacked: [],
458
drawStacked: function (id) {
459
+ var i, w, data, range, $id = $('#' + stripTag(id));
460
461
+ if (chart.dataStacked[id] === undefined) {
462
data = $.parseJSON($id.attr('data-' + id));
463
if (data) {
464
data.unshift(['site', 'comment', 'xmlrpc', 'login', 'admin', 'poblic', { role: 'link' } ]);
466
}
467
}
468
469
+ if (chart.viewStacked[id] === undefined) {
470
chart.viewStacked[id] = new window.google.visualization.BarChart(
471
document.getElementById(id)
472
);
506
}
507
508
if (0 < (w = $id.width()) &&
509
+ chart.dataStacked[id] !== undefined &&
510
+ chart.viewStacked[id] !== undefined) {
511
512
i = ID('range');
513
range = $.parseJSON($('.' + i).attr('data-' + i));
555
data = array_chunk(data, row);
556
557
$(ID('.', 'network')).each(function (index, obj) {
558
+ if (data[index] !== undefined) {
559
id = $(obj).attr('id');
560
dt = chart.dataStacked[id];
561
n = Math.min(row, data[index].length);
609
610
// Load / Save cookie using wpCookies in wp-includes/js/utils.js
611
function loadCookie(tabNo) {
612
+ var i, cookie = (wpCookies !== undefined && wpCookies.getHash('ip-geo-block')) || [];
613
614
for (i in cookie) {
615
if(cookie.hasOwnProperty(i)) {
617
}
618
}
619
620
+ if (cookie[tabNo] === undefined) {
621
cookie[tabNo] = [];
622
}
623
630
631
$.each(cookie, function(i, obj) {
632
c[i] = '';
633
+ if (obj !== undefined) {
634
n = obj.length;
635
if (n) {
636
c[i] = (obj[0] || 'o').toString();
642
});
643
644
// setHash( name, value, expires, path, domain, secure )
645
+ if (wpCookies !== undefined) {
646
wpCookies.setHash(
647
'ip-geo-block', c, new Date(Date.now() + 2592000000), ip_geo_block_auth.home + ip_geo_block_auth.admin
648
);
902
cmd: cmd,
903
which: data
904
}, function (data) {
905
+ if (data.page !== undefined) {
906
redirect(data.page, 'tab=' + tabNo);
907
} else if (data) {
908
table.ajax.reload();
997
// Name of base class
998
var name = ID('%', 'settings');
999
1000
+ /*--------------------------------
1001
+ * Validation rules and behavior
1002
+ *--------------------------------*/
1003
// Scan your country code
1004
$('[id^="' + ID('scan-') + '"]').on('click', function (/*event*/) {
1005
var $this = $(this),
1373
1374
// Export settings
1375
$(ID('#', 'export')).on('click', function (/*event*/) {
1376
+ if (JSON === undefined) {
1377
notice_html5();
1378
return false;
1379
}
1394
1395
// Import settings
1396
$(ID('#', 'file-dialog')).on('change', function (event) {
1397
+ if (window.FileReader === undefined) {
1398
notice_html5();
1399
return false;
1400
}
1404
readfile(file, function (data) {
1405
data = JSON.parse(data);
1406
id = name + '[signature]';
1407
+ if (data[id] !== undefined) {
1408
data[id] = encode_str(data[id]);
1409
}
1410
ajax_post('export-import', {
1475
confirm(ip_geo_block.msg[0], function () {
1476
ajax_post('login-loading', {
1477
cmd: 'delete-link'
1478
+ }, function (/*data*/) {
1479
$this.text(ip_geo_block.msg[2]);
1480
$this.addClass(type).nextAll(ID('.', 'desc')).remove();
1481
});
1485
});
1486
1487
// Manipulate DB table for validation logs
1488
+ $(ID('@', 'diag_tables')).on('click', function (/*event*/) {
1489
confirm(ip_geo_block.msg[0], function () {
1490
+ ajax_table('diag-tables');
1491
});
1492
return false;
1493
});
1563
1564
// Submit
1565
$('#submit').on('click', function (/*event*/) {
1566
+ var elm = $(ID('@', 'signature')), str = elm.val();
1567
if (str.indexOf(',') !== -1) {
1568
elm.val(encode_str(str));
1569
}
admin/js/admin.min.js CHANGED
@@ -3,4 +3,4 @@
3
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
- !function(e,t,n){var i=!1,a=[],o=e(t).width(),r=IP_GEO_BLOCK,l=IP_GEO_BLOCK_AUTH;function c(e,t){var n={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_","!":"ip_geo_block_settings_"};return void 0!==t?n[e]+t:n.$+e}function s(e){return e?function(e){return e.toString().replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]}).replace(/&amp;(#\d{2,4}|\w{4,7});/g,"&$1;")}(e.toString().replace(/(<([^>]+)>)/gi,"")):""}function d(n,i){var r=e(t).width();r!==o&&(o=r,void 0===a[n]&&(a[n]={id:!1,callback:i}),e(t).off("resize").on("resize",function(){return!1!==a[n].id&&t.clearTimeout(a[n].id),a[n].time=t.setTimeout(a[n].callback,200),!1}))}function u(t,n){n?e(c("#",t)).addClass(c("loading")):e(c("#",t)).removeClass(c("loading"))}function p(e,n){t.confirm(s(e))&&n()}function h(e,n,i){t.alert(s(n||r.msg[11].replace("%s",i)+" ("+e+")"))}function f(){h(null,s(r.msg[9]))}function g(e,n){-1!==t.location.href.indexOf(e)&&(t.location=s(e)+(n?"&"+s(n):"")+"&ip-geo-block-auth-nonce="+l.nonce)}function v(t,n,a,o){t&&u(t,!0),n.action=r.action,n.nonce=r.nonce,e.post(r.url,n).done(function(e){a&&a(e)}).fail(function(e){i||h(e.status,e.responseText,n.action)}).always(function(){t&&("object"==typeof o?e.when.apply(e,o).then(function(){u(t,!1)}):u(t,!1))})}function m(e,t){v(e,{cmd:"clear-"+e,which:t},function(e){g(e.page,e.tab)})}function b(e){return e.stopImmediatePropagation(),!1}function k(e,t){t?e.removeClass("folding-disable"):(e.children(c(".","hide")).hide(),e.addClass("folding-disable"),e.removeClass(c("dropdown")).addClass(c("dropup")))}function w(t,n,i){var a=t.prop("type")||"",o=0===a.indexOf("checkbox")&&t.is(":checked")||0===a.indexOf("select")&&"0"!==t.val();t.siblings('input[name^="'+c("%","settings")+'"]:checkbox').prop("disabled",!o),e.isArray(n)?e.each(n,function(t,n){e(n).nextAll(c(".","settings-folding")).each(function(n,a){k(e(a),o&&i[t])})}):n.nextAll(c(".","settings-folding")).each(function(t,n){k(e(n),o&&i)})}function x(t){var n=c("@","validation_ajax_");k(t.closest("ul").next(),e(n+"1").is(":checked")||e(n+"2").is(":checked"))}function y(e){return String(e).replace(/[a-z]/gi,function(e){return String.fromCharCode(e.charCodeAt(0)+(e.toLowerCase()<"n"?13:-13))})}function _(e){return function(e){return t.btoa(e)}(y(e))}function C(e){return y(function(e){return t.atob(e)}(e))}function P(t){var n=t.is(":checked"),i=e(c("@","public_target_rule")),a=e(c("@","public_behavior")),o=t.closest("tr").nextAll("tr");o.find('[name^="'+c("%","settings")+'"]').prop("disabled",!n),o.find(c(".","desc")).css("opacity",n?1:.5),w(t,[i,a],["1"===i.val(),a.val()]),n&&a.change()}function S(t,n){t&&("string"==typeof t&&(t=JSON.parse(t)),n&&(e('input[type="checkbox"]').prop("checked",!1).change(),e("input[name*=providers]").prop("disabled",!1).change()),e(c("#","import")).closest("form").deserialize(t),e(c("@","exception_admin")+","+c("@","validation_mimetype")).change(),e('select[name*="'+c("%","settings")+'"]').change(),e(c("@","validation_login")).change(),P(e(c("@","validation_public"))),x(e(c("@","validation_ajax_1"))),n&&(n=c("%","settings[providers][IPInfoDB]"),e(c("@","providers_IPInfoDB")).prop("checked",!!t[n])))}e.fn.deserialize=function(t){return this.each(function(){var n,i,a,o=this,r={};for(n in t)if(t.hasOwnProperty(n))try{i=decodeURIComponent(n),a=decodeURIComponent(t[n]),r.hasOwnProperty(i)||(r[i]=[]),r[i].push(a)}catch(e){}e.each(r,function(t,i){"hidden"!==(n=e('[name="'+t+'"]:input',o).val(i)).attr("type")&&n.before('<span style="color:red">*</span>')})})};var A={dataPie:[],viewPie:[],drawPie:function(i){var a,o;void 0===A.dataPie[i]&&((a=A.dataPie[i]=new t.google.visualization.DataTable).addColumn("string","Country"),a.addColumn("number","Requests"),o=e.parseJSON(e("#"+i).attr("data-"+i)),A.dataPie[i].addRows(o)),void 0===A.viewPie[i]&&(A.viewPie[i]=new t.google.visualization.PieChart(n.getElementById(i))),void 0!==A.dataPie[i]&&void 0!==A.viewPie[i]&&0<(a=e("#"+i).width())&&A.viewPie[i].draw(A.dataPie[i],{backgroundColor:{fill:"transparent"},chartArea:{left:0,top:"5%",width:"100%",height:"90%"},sliceVisibilityThreshold:.015})},dataLine:[],viewLine:[],drawLine:function(i,a){var o,r,l;if(void 0===A.dataLine[i]){for((o=A.dataLine[i]=new t.google.visualization.DataTable).addColumn(a,"Date"),o.addColumn("number","comment"),o.addColumn("number","xmlrpc"),o.addColumn("number","login"),o.addColumn("number","admin"),o.addColumn("number","public"),r=(l=e.parseJSON(e("#"+i).attr("data-"+i))).length,o=0;o<r;++o)l[o][0]=new Date(1e3*l[o][0]);A.dataLine[i].addRows(l)}void 0===A.viewLine[i]&&(A.viewLine[i]=new t.google.visualization.LineChart(n.getElementById(i))),void 0!==A.dataLine[i]&&void 0!==A.viewLine[i]&&0<(o=e("#"+i).width())&&A.viewLine[i].draw(A.dataLine[i],{legend:{position:"bottom"},backgroundColor:{fill:"transparent"},hAxis:{format:"MM/dd"+("datetime"===a?" HH:mm":"")},vAxis:{textPosition:o>320?"out":"in"},chartArea:{left:o>320?"10%":0,top:"5%",width:"100%",height:"75%"}})},dataStacked:[],viewStacked:[],drawStacked:function(i){var a,o,r,l,s=e("#"+i);void 0===A.dataStacked[i]&&(r=e.parseJSON(s.attr("data-"+i)))&&(r.unshift(["site","comment","xmlrpc","login","admin","poblic",{role:"link"}]),A.dataStacked[i]=t.google.visualization.arrayToDataTable(r)),void 0===A.viewStacked[i]&&(A.viewStacked[i]=new t.google.visualization.BarChart(n.getElementById(i)),t.google.visualization.events.addListener(A.viewStacked[i],"animationfinish",function(){var t,a,o,r=[],l=A.dataStacked[i],d=l.getNumberOfRows(),u=e(c("#","open-new")).prop("checked");for(t=0;t<d;t++)r.push({label:l.getValue(t,0),link:l.getValue(t,6)});d="http://www.w3.org/1999/xlink",s.find("text").each(function(e,t){"g"===(o=t.parentNode).tagName.toLowerCase()&&-1!==(e=function(e,t){var n,i=t.length;for(e=e.replace("…",""),n=0;n<i;++n)if(t.hasOwnProperty(n)&&0===t[n].label.indexOf(e))return n;return-1}(t.textContent,r))&&((a=n.createElementNS("http://www.w3.org/2000/svg","a")).setAttributeNS(d,"xlink:href",r[e].link),a.setAttributeNS(d,"title",r[e].label),a.setAttribute("target",u?"_blank":"_self"),a.setAttribute("class","site"),a.appendChild(o.removeChild(t)),o.appendChild(a),r.splice(e,1))})})),0<(o=s.width())&&void 0!==A.dataStacked[i]&&void 0!==A.viewStacked[i]&&(a=c("range"),l=e.parseJSON(e("."+a).attr("data-"+a)),a=40*(r=A.dataStacked[i]).getNumberOfRows(),A.viewStacked[i].draw(r,{width:o,height:a+80,allowHtml:!0,isStacked:!0,legend:{position:"top"},chartArea:{top:50,left:90,width:"100%",height:a},hAxis:{minValue:0,maxValue:l[1]},backgroundColor:{fill:"transparent"},animation:{startup:!0,duration:200,easing:"out"}}))},ajaxStacked:function(t,n,i,a){v(null,{cmd:"restore-network",which:t=Math.max(0,Math.min(4,t)),offset:(n=5*Math.max(1,Math.min(5,n)))*i*a,length:n},function(t){var i,a,o,r,l;t=function(e,t){var n,i,a=Math.ceil(e.length/t),o=[];for(n=0;n<a;++n)i=n*t,o.push(e.slice(i,i+t));return o}(t,n),e(c(".","network")).each(function(c,s){if(void 0!==t[c]){for(r=e(s).attr("id"),l=A.dataStacked[r],o=Math.min(n,t[c].length),i=0;i<o;++i)for(a=1;a<=5;a++)l.setValue(i,a,t[c][i][a]);A.drawStacked(r)}})})}};function O(n){"object"==typeof t.google&&(1===n?e(c("#","chart-countries")).length&&(A.drawPie(c("chart-countries")),A.drawLine(c("chart-daily"),"date")):5===n&&e(c(".","network")).each(function(t,n){A.drawStacked(e(n).attr("id"))}))}function I(e){if("object"==typeof t.google){var n=["corechart"];5===e&&n.push("bar"),t.google.charts.load("current",{packages:n,callback:function(){O(e)}}),d("draw-chart."+e,function(){O(e)})}}function N(t){var n,i,a=[];e.each(t,function(e,t){if(a[e]="",void 0!==t&&(i=t.length))for(a[e]=(t[0]||"o").toString(),n=1;n<i;++n)a[e]+=(t[n]||"o").toString()}),"undefined"!=typeof wpCookies&&wpCookies.setHash("ip-geo-block",a,new Date(Date.now()+2592e6),l.home+l.admin)}function D(t){var i=function(e){var t,n="undefined"!=typeof wpCookies&&wpCookies.getHash("ip-geo-block")||[];for(t in n)n.hasOwnProperty(t)&&(n[t]=n[t].replace(/[^ox\d]/gi,"").split(""));return void 0===n[e]&&(n[e]=[]),n}(t);return e(n).on("click","form>h2,h3",function(){return function(e,t,n){var i,a=e.closest("fieldset").data("section"),o=e.parent().nextAll(".panel-body").toggle();e.toggleClass(c("dropup")).toggleClass(c("dropdown")),(i=e.hasClass(c("dropdown")))?o.addClass(c("border")).trigger(c("show-body")):o.removeClass(c("border")),n[t][a]=i?"o":"x",N(n),O(t)}(e(this),t,i),!1}),e(c("#","toggle-sections")).on("click",function(){var n,a=e(c(".","field")).find("h2,h3"),o=[c("dropdown"),c("dropup")],r=a.filter("."+o[0]).length;return a.each(function(a){(n=e(this)).removeClass(o.join(" ")).addClass(r?o[1]:o[0]),n=n.parent().nextAll(".panel-body").toggle(!r),r?n.removeClass(c("border")):n.addClass(c("border")).trigger("show-body"),i[t][a]=r?"x":"o"}),N(i),O(t),!1}),i}function j(t){e("body").append('<div style="display:none"><form method="POST" id="'+c("export-form")+'" action="'+r.url.replace("ajax.php","post.php")+'"><input type="hidden" name="action" value="'+r.action+'" /><input type="hidden" name="nonce" value="'+r.nonce+'" /><input type="hidden" name="cmd" value="'+t+'" /><input type="hidden" name="data" value="" id="'+c("export-data")+'"/><input type="submit" value="submit" /></form><input type="file" name="settings" id="'+c("file-dialog")+'" /></div>')}function T(e,t,n,i){var a,o;return(a=e.cloneNode(!1)).setAttribute("title",s(n)),(o=t.cloneNode(!1)).setAttribute("class","dashicons dashicons-"+i),a.appendChild(o),a}function L(n,i,a,o){var l=Number(o[n][1===n?3:2])||0;l=[10,25,50,100][l],e.extend(!0,e.fn.dataTable.defaults,a,{dom:"tlp",serverSide:!1,autoWidth:!1,processing:!0,deferRender:!0,language:{emptyTable:r.i18n[1],loadingRecords:r.i18n[0],processing:r.i18n[0],zeroRecords:r.i18n[2],lengthMenu:"_MENU_",paginate:{first:"&laquo;",last:"&raquo;",next:"&rsaquo;",previous:"&lsaquo;"}},responsive:{details:{type:"column",target:"td:nth-child(n+2)"}},columnDefs:[{width:"1.25em",targets:0},{orderable:!1,targets:0},{searchable:!1,targets:0},{targets:[0],data:null,defaultContent:'<input type="checkbox">'}],pagingType:"full_numbers",lengthMenu:[10,25,50,100],pageLength:l,scroller:!0,scrollY:1e4,scrollCollapse:!0,drawCallback:function(t){var n=e(c("#",i.tableID)).find("td.dataTables_empty"),a="restore-logs"===i.ajaxCMD?3:2;a>t.iDraw?n.html(r.i18n[0]):a===t.iDraw&&(n.html(r.i18n[1]),(n=e(c("@","search_filter"))).val()&&n.trigger("keyup"))}});var s=e(c("#",i.tableID)).DataTable({ajax:{url:r.url,type:"POST",data:{cmd:i.ajaxCMD,action:r.action,nonce:r.nonce}},mark:!0}),u=function(){s.columns.adjust().responsive.recalc().draw(!1)};return d("draw-table."+n,u),e(c("#",i.sectionID)).find(".panel-body").off(c("show-body")).on(c("show-body"),function(){return u(),!1}).off("change").on("change",'th>input[type="checkbox"]',function(){var t=e(this).prop("checked");return e(c("#",i.tableID)).find('td>input[type="checkbox"]').prop("checked",t),!1}),e(c("#","select-target")).off("change").on("change",function(){var t=e(this).find('input[name="'+c("target")+'"]:checked').val();return s.columns(i.targetColumn).search("all"!==t?t:"").draw(),!1}).trigger("change"),e(c("#","bulk-action")).off("click").on("click",function(){var t,a,o=e(this).prev().val(),l=/(<([^>]+)>)/gi,d=/data-hash=[\W]([\w]+)[\W]/i,u={IP:[],AS:[]},p=s.$("input:checked");return!!o&&(p.length?(p.each(function(){a=s.cell(this.parentNode).data(),t=("bulk-action-remove"===o||"bulk-action-ip-erase"===o)&&(t=a[i.columnIP].match(d))?","+t[1]:"",u.IP.push(a[i.columnIP].replace(l,"")+t),u.AS.push(a[i.columnAS].replace(l,""))}),u.IP.length&&v("loading",{cmd:o,which:u},function(t){void 0!==t.page?g(t.page,"tab="+n):t&&(s.ajax.reload(),e(c("#",i.tableID)).find('th input[type="checkbox"]').prop("checked",!1))}),!1):(h(null,r.msg[10]),!1))}),e(c("@","search_filter")).off("keyup").on("keyup",function(){return s.search(this.value,!1,!0,!/[A-Z]/.test(this.value)).draw(),!1}),e(c("#","reset-filter")).off("click").on("click",function(){return e(c("@","search_filter")).val(""),s.search("").draw(),!1}),e(c("@","clear_all")).off("click").on("click",function(){return p(r.msg[0],function(){m(1===n?"cache":"logs",null)}),!1}),e("table"+c(".","dataTable")+" tbody").on("click","a",function(){var i,a,o=t.location.search.slice(1).split("&"),r=o.length,l={};for(i=0;i<r;++i)l[(a=o[i].split("="))[0]]=a[1];for(i in l.tab=1===n?4:2,l.s=e(this).text().replace(/[^\w\.\:\*]/,""),a=[],l)l.hasOwnProperty(i)&&a.push(i+"="+l[i]);return t.open(t.location.pathname+"?"+a.join("&"),"_blank"),!1}),e(c("#",i.tableID)).on("length.dt",function(e,t,i){o[n][1===n?3:2]={10:0,25:1,50:2,100:3}[i]||0,N(o)}),s}e(function(){var a=Number(r.tab)||0,o=D(a);switch(e(c(".","inhibit")).on("submit",function(){return!1}),e(t).on("beforeunload",function(){i=!0}),a){case 0:var d=c("%","settings");e('[id^="'+c("scan-")+'"]').on("click",function(){var t=e(this),n=t.attr("id"),i=t.parent();return v(n.replace(/^.*(?:scan)/,"scanning"),{cmd:"scan-code",which:n.replace(c("scan-"),"")},function(e){var t,n;for(t in i.children("ul").length||i.append('<ul id="'+c("code-list")+'"></ul>'),i=i.children("ul").empty(),e)e.hasOwnProperty(t)&&("string"==typeof e[t=s(t)]?n=s(e[t]):(n=s(e[t].code),t='<abbr title="'+s(e[t].type)+'">'+t+"</abbr>"),i.append("<li>"+t+' : <span class="'+c("notice")+'">'+n+"</span></li>"));i.show("slow")}),!1}),e(c("@","matching_rule")).on("change",function(){var t=this.value;return e(c("@","white_list")).closest("tr").toggle("0"===t),e(c("@","black_list")).closest("tr").toggle("1"===t),!1}).change(),e(c(".","icon-cidr")).on("click",function(){var n=e(c("#","admin-styles-css")).get(0).href,i=t.open("about:blank","","width=560,height=170");return n=n.slice(0,n.lastIndexOf("css/")),i.document.write('<!DOCTYPE html><html lang=en><meta charset=utf-8><title>CIDR calculator for IPv4 / IPv6</title><link href="'+n+'css/cidr.min.css?v=.1" rel=stylesheet><div class="row container"><div class=row id=i><fieldset class="col span_11"><legend>Range <input id=a type=button value=Clear tabindex=1></legend><textarea id=c name=range placeholder="192.168.0.0 - 192.168.255.255" rows=5 wrap=off tabindex=2></textarea></fieldset><ul class="col span_2" id=h><li class=row><input id=e type=button value=&rarr; class="col span_24" tabindex=3><li class=row><input id=f type=button value=&larr; class="col span_24" tabindex=6></ul><fieldset class="col span_11"><legend>CIDR <input id=b type=button value=Clear tabindex=4></legend><textarea id=d name=cidr placeholder=192.168.0.0/16 rows=5 wrap=off tabindex=5></textarea></fieldset></div><div class=row id=j><span class=col id=g> </span></div></div><script src="'+n+'js/cidr.min.js?v=.1"><\/script>'),i.document.close(),!1}),e(c("@","validation_mimetype")).on("change",function(t){var n=e(this),i=Number(n.val());return n.nextAll(c(".","settings-folding")).each(function(t,n){k(e(n),i===t+1||i&&2===t)}),b(t)}).change(),e('select[name*="response_code"]').on("change",function(t){var n=e(this),i=parseInt(n.val()/100,10),a=n.closest("tr").nextAll("tr");return 0<=n.attr("name").indexOf("public")&&-1===Number(e(c("@","public_matching_rule")).val())?(a.each(function(t){1>=t&&e(this).hide()}),b(t)):(i<=3?a.each(function(t){0===t?e(this).show():1===t&&e(this).hide()}):a.each(function(t){0===t?e(this).hide():1===t&&e(this).show()}),b(t))}).change(),e(c("#","decode")).on("click",function(){var t=e(c("@","signature")),n=t.val();return-1===n.search(/,/)?t.val(C(n)):t.val(_(n)),!1}),e(c("@","validation_login")).on("change",function(t){var n=e(this);return w(n,n,d),b(t)}).change(),v(null,{cmd:"get-actions"},function(t){var i,a,o,d,u=e(c("#","list-admin")),p=n.createElement("li"),h=n.createElement("input"),f=n.createElement("label"),g=n.createElement("dfn"),m=n.createElement("span");for(d in t)t.hasOwnProperty(d)&&(d=s(d),u.find("#"+(o=c("!","exception_admin_"+d))).size()||((i=h.cloneNode(!1)).setAttribute("id",o),i.setAttribute("value",d),i.setAttribute("type","checkbox"),(a=p.cloneNode(!1)).appendChild(i),(i=f.cloneNode(!1)).setAttribute("for",o),i.appendChild(n.createTextNode(d)),a.appendChild(i),1&t[d]&&a.appendChild(T(g,m,r.msg[5],"lock")),2&t[d]&&a.appendChild(T(g,m,r.msg[6],"unlock")),u.append(a)));e(c(".","icon-unlock")).on("click",function(){return e(c("#","list-admin")+">li").filter(function(){return!e(this).find(".dashicons-unlock").length}).toggle(),!1}),e(c("@","exception_admin")).on("change",function(t){var n=e.grep(e(this).val().split(","),function(e){return""!==e.replace(/^\s+|\s+#x2F;g,"")});return e(c("#","list-admin")).find("input").each(function(){var t=e(this),i=t.val();t.prop("checked",-1!==e.inArray(i,n))}),b(t)}).change(),e(c("#","list-admin")).on("click","input",function(){var t,n=e(this),i=e(c("@","exception_admin")),a=n.val(),o=e.grep(i.val().split(","),function(e){return""!==e.replace(/^\s+|\s+#x2F;g,"")});-1===(t=e.inArray(a,o))?o.push(a):o.splice(t,1),i.val(o.join(",")).change()}),e(c(".","icon-find")).on("click",function(){var t,n,i,a,o=e(this),d=[],u=0,p=s(r.msg[8]),h=s(o.data("target"));return e(c("#","find-"+h)).empty(),o.next().children(c(".","find-desc")).show(),(o=e(c("#","list-"+h))).children("li").each(function(t,n){d.push(e(n).find("input").val())}),v("find-"+h,{cmd:"find-"+h},function(f){var g;for(g in f)f.hasOwnProperty(g)&&(++u,t=s(f[g]),g=s(g),n=e.inArray(g,d),i=c("!","exception_"+h+"_"+g),a="admin"===h?t+"="+g:"/"+t+"/"+g+"/",a='<a class="ip-geo-block-icon ip-geo-block-icon-alert" href="'+l.sites[0]+l.admin+"options-general.php?page=ip-geo-block&tab=4&s="+encodeURIComponent(a)+'" title="'+p.replace("%s",a)+'" target="_blank"><span></span></a>',n<0?(d.push(g),o.prepend('<li><input id="'+i+'" value="'+g+'" type="checkbox" '+("admin"===h?"/>":"name=ip_geo_block_settings[exception]["+h+"]["+g+"] />")+'<label for="'+i+'">'+g+"</lable>"+a+"</li>")):(i=o.find("#"+i).parent()).find("a").length||i.append(a));e(c("@","exception_"+h)).trigger("change"),e(c("#","find-"+h)).append(' <span class="ip-geo-block-warn">'+s(r.msg[7].replace("%d",u))+"</span>")}),!1})}),e('input[id^="'+c("!","validation_ajax_")+'"]').on("change",function(){x(e(this))}).change(),e(c("@","validation_public")).on("change",function(t){return P(e(this)),b(t)}).change(),e(c("@","public_matching_rule")).on("change",function(t){var n=this.value;return e(c("@","public_white_list")).closest("tr").toggle("0"===n),e(c("@","public_black_list")).closest("tr").toggle("1"===n),e(c("@","public_response_code")).change().closest("tr").toggle("-1"!==n),b(t)}).change(),e(c("@","public_behavior")).on("change",function(t){var n=e(this);return k(n.siblings("ul"),n.prop("checked")),b(t)}).change(),e(c("@","update")).on("click",function(){return v("download",{cmd:"download"},function(t){var n,i,a;for(n in t)if(t.hasOwnProperty(n))for(i in a=t[n])a.hasOwnProperty(i)&&(a[i=s(i)].filename&&e(c("@",n+"_"+i+"_path")).val(s(a[i].filename)),a[i].message&&e(c("#",n+"-"+i)).text(s(a[i].message)))}),!1}),e(c("@","restrict_api")).on("change",function(){e('input[class*="remote"]').prop("disabled",e(this).prop("checked"))}).trigger("change"),e(c("@","save_statistics")).on("change",function(){return e(c("@","validation_recdays")).prop("disabled",!e(this).prop("checked")),!1}).trigger("change"),e(c("@","validation_reclogs")).on("change",function(){var t=e(this);t.parent().parent().nextAll().find('input[id*="validation"]').prop("disabled",0===Number(t.prop("selectedIndex")))}).trigger("change"),e(c("@","cache_hold")).on("change",function(){var t=e(this).prop("checked");e('input[name*="[cache_time]"]').prop("disabled",!t),e('select[id*="login_fails"]').prop("disabled",!t)}).trigger("change"),e(c("@","comment_pos")).on("change",function(){var t=e(this);t.nextAll('input[type="text"]').prop("disabled",0===Number(t.prop("selectedIndex")))}).trigger("change"),j("validate"),e(c("#","export")).on("click",function(){if("undefined"==typeof JSON)return f(),!1;var t=d,n={};return e.each(e(this).closest("form").serializeArray(),function(e,i){-1!==i.name.indexOf(t)&&(n[i.name]=i.value)}),n[t+="[signature]"]=_(n[t]),e(c("#","export-data")).val(JSON.stringify(n)),e(c("#","export-form")).submit(),!1}),e(c("#","file-dialog")).on("change",function(e){if(void 0===t.FileReader)return f(),!1;var n,i=e.target.files[0];return i&&function(e,n){var i=new t.FileReader;i.onload=function(e){n&&n(e.target.result)},i.onerror=function(e){h("Error",e.target.error.code)},i.readAsText(e)}(i,function(e){void 0!==(e=JSON.parse(e))[n=d+"[signature]"]&&(e[n]=_(e[n])),v("export-import",{cmd:"validate",data:JSON.stringify(e)},function(e){S(e,!0)})}),!1}),e(c("#","import")).on("click",function(){return e(c("#","file-dialog")).click(),!1}),e(c("#","default")).on("click",function(){return p(r.msg[0],function(){v("pre-defined",{cmd:"import-default"},function(e){S(e,!0)})}),!1}),e(c("#","preferred")).on("click",function(){return p(r.msg[0],function(){v("pre-defined",{cmd:"import-preferred"},function(e){S(e,!1)})}),!1}),e(c("@","reset_live")).on("click",function(){return v("reset-live",{cmd:"reset-live"}),!1}),e(c("#","login-link")).on("click",function(){var t=e(this),n=c("quot;,"primary");return t.hasClass(n)?v("login-loading",{cmd:"generate-link"},function(i){t.text(r.msg[3]),t.removeClass(n).nextAll(c(".","desc")).remove(),e('<p class="ip-geo-block-desc"></p>').appendTo(t.parent()).append(r.msg[4],'<a href="'+i.link+'" title="'+r.msg[1]+'" target=_blank>'+i.link+"</a></p>")}):p(r.msg[0],function(){v("login-loading",{cmd:"delete-link"},function(e){t.text(r.msg[2]),t.addClass(n).nextAll(c(".","desc")).remove()})}),!1}),e(c("@","init_table")).on("click",function(){return p(r.msg[0],function(){var e;v(e="init-table",{cmd:e},function(e){g(e.page,e.tab)})}),!1}),e(c("#","show-info")).on("click",function(){e(c("#","wp-info")).empty(),v("wp-info",{cmd:"show-info"},function(t){var n,i=[];for(n in t)t.hasOwnProperty(n)&&i.push("- "+n+" "+t[n]);return e(c("#","wp-info")).html('<textarea class="regular-text code" rows="'+i.length+'">'+i.join("\n")+"</textarea>").find("textarea").select(),!1})}),e('select[name^="'+d+'"]').on("change",function(){var t,n,i,a=e(this);return t=a,i=c(".","desc"),t.next(i).empty(),(n=t.children("option:selected").data("desc"))&&t.next(i).html(e.parseHTML(n)),w(a,a,d),!1}).change(),e(c(".","icon-cycle")).on("click",function(){var t,n=e(this).nextAll("li"),i=n.find(c("@","exception_admin")),a=n.find("input:checkbox").filter(":visible"),o=a.filter(":checked").length;return a.prop("checked",!o),i.length&&(o?i.val(""):(t=[],a.each(function(n,i){t.push(e(i).val())}),i.val(t.join(",")))),e(this).blur(),!1}),e(c(".","settings-folding>dfn")).on("click",function(){var t=c("drop"),n=e(this).parent();return n.children(c(".","hide")).toggle(),n.toggleClass(t+"up").toggleClass(t+"down"),n.hasClass(t+"up")&&n.children("div").hide(),!1}),e("#submit").on("click",function(){var t=e(c("@","signature")),n=t.val();return-1!==n.indexOf(",")&&t.val(_(n)),!0});break;case 1:I(a);var u=0;e(c("#","sort-slug")).on("click",function(){var t=e(this).closest("ol"),n=t.children("li");(u=!u)?n.sort(function(t,n){return e(t).text()>e(n).text()}):n.sort(function(t,n){return Number(e(t).text().replace(/^.*\((\d+)\)#x2F;,"$1"))<=Number(e(n).text().replace(/^.*\((\d+)\)#x2F;,"$1"))}),t.children("li").remove(),n.appendTo(t)}),e(c("@","clear_statistics")).on("click",function(){return p(r.msg[0],function(){m("statistics",null)}),!1}),e(c("@","clear_logs")).on("click",function(){return p(r.msg[0],function(){m("logs",null)}),!1}),L(a,{tableID:"statistics-cache",ajaxCMD:"restore-cache",sectionID:"section-2",targetColumn:4,columnIP:1,columnAS:3},{columns:[{title:'<input type="checkbox">'},{title:r.i18n[3]},{title:r.i18n[4]},{title:r.i18n[5]},{title:r.i18n[6]},{title:r.i18n[7]},{title:r.i18n[8]},{title:r.i18n[9]}],columnDefs:[{responsivePriority:0,targets:0},{responsivePriority:1,targets:1},{responsivePriority:2,targets:2},{responsivePriority:6,targets:3},{responsivePriority:7,targets:4},{responsivePriority:3,targets:5},{responsivePriority:4,targets:6},{responsivePriority:5,targets:7},{className:"all",targets:[0,1,2,5]}]},o),j("export-cache"),e(c("#","export-cache")).on("click",function(){return e(c("#","export-form")).submit(),!1});break;case 4:var y={tableID:"validation-logs",sectionID:"section-0",targetColumn:6,columnIP:3,columnAS:5},O={columns:[{title:'<input type="checkbox">'},{title:""},{title:r.i18n[10]},{title:r.i18n[3]},{title:r.i18n[4]},{title:r.i18n[5]},{title:r.i18n[7]},{title:r.i18n[11]},{title:r.i18n[12]},{title:r.i18n[13]},{title:r.i18n[14]},{title:r.i18n[15]}],columnDefs:[{responsivePriority:11,targets:0},{responsivePriority:0,targets:1},{responsivePriority:1,targets:2},{responsivePriority:2,targets:3},{responsivePriority:3,targets:4},{responsivePriority:6,targets:5},{responsivePriority:4,targets:6},{responsivePriority:5,targets:7},{responsivePriority:7,targets:8},{responsivePriority:8,targets:9},{responsivePriority:9,targets:10},{responsivePriority:10,targets:11},{visible:!1,targets:1},{className:"all",targets:[0,2,3,4]},{className:"none",targets:[8,9,10,11]}]},R=null,M=null,z=e(c("#","live-loading")),E=null,$=function(){R&&(t.clearTimeout(R),R=null),M&&(z.removeClass(c("live-timer")),t.clearTimeout(M),M=null)},J=function(){$(),v("live-loading",{cmd:"live-start"},function(e){if(e.error)h(null,e.error);else if(e.data.length){var n,i=e.data.length;for(n=0;n<i;n++)E.row.add(e.data[n]);E.draw(!1)}R=t.setTimeout(J,1e3*r.interval)})},B=function(e,t){$(),v(null,{cmd:e||"live-stop",callback:t})},q=c(""),H=function(t,n,i){-1===n[7].indexOf("pass")?e(t).addClass(q+i+"blocked"):e(t).addClass(q+i+"passed")},V=e(c("#","live-log")),G=e(c("#","live-update"));e(c("#","validation-logs")).on("animationend",function(){return e(this).find('tr[class*="'+q+'new"]').each(function(){var t=e(this);-1!==t.prop("class").indexOf("passed")?t.addClass(q+"passed").removeClass(q+"new-passed"):t.addClass(q+"blocked").removeClass(q+"new-blocked")}),!1}),V.on("change",function(){switch(e('input[name="'+c("live-log")+'"]:checked').val()){case"start":J();break;case"pause":B("live-pause",function(){z.addClass(c("live-timer")),M=t.setTimeout(function(){$(),e(c("#","live-log-stop")).prop("checked",!0)},1e3*r.timeout)});break;case"stop":B()}}),G.on("change",function(){var t=V.closest("tr"),n=G.prop("checked");return o[a][1]=n?"o":"x",N(o),E&&E.clear().destroy(),n?(t.show().next().next().next().nextAll().hide(),y.ajaxCMD="live-stop",O.order=[1,"desc"],O.createdRow=function(e,t){H(e,t,"new-")}):(t.hide().next().next().next().nextAll().show(),y.ajaxCMD="restore-logs",O.order=[0,""],O.createdRow=function(e,t){H(e,t,"")}),e(c("#","live-log-stop")).trigger("click"),E=L(a,y,O,o),!1}).trigger("change"),e(c("#","logs-preset")).on("click","a",function(){var t=e(this).data("value");return e(c("@","search_filter")).val(t),E.search(t,!1,!0,!/[A-Z]/.test(t)).draw(),!1}),j("export-logs"),e(c("#","export-logs")).on("click",function(){return e(c("#","export-form")).submit(),!1});break;case 2:e(t).on(c("gmap-error"),function(){v(null,{cmd:"gmap-error"},function(e){g(e.page,e.tab)})});var U=e(c("#","map"));"object"==typeof t.google?U.each(function(){e(this).GmapRS()}):U.each(function(){e(this).empty().html('<iframe src="'+r.altgmap+'?output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')});O=[];e('select[id^="'+c("!","service")+'"]').on("change",function(){e(this).children("option").each(function(t,n){O[e(n).text()]=t,o[a][3+t]=e(n).prop("selected")?"o":"x"}),"o"!==o[a][3+(Number(o[a][2])||0)]&&(o[a][2]=e(this).prop("selectedIndex")),N(o)}).change(),e(c("@","get_location")).on("click",function(){var n,i=e(c("#","whois")),l=e(c("#","apis")),d=e(c("@","service")).val(),u=e.trim(e(c("@","ip_address")).val());if(u&&d){if(e(c("@","anonymize")).prop("checked")){if(/[^0-9a-f\.:]/.test(u))return h(null,"illegal format."),!1;-1!==u.indexOf(".")?u=u.replace(/\.\w+#x2F;,".0"):(-1===(u=(u=u.split(":")).splice(0,4).join(":")).indexOf("::")&&(u+="::"),u=u.replace(/:{3,}/,"::")),e(c("@","ip_address")).val(u)}i.hide().empty(),l.hide().empty(),n=e.whois(u,function(t){var n,r="";for(n=0;n<t.length;++n)r+="<tr><td>"+t[n].name+"</td><td>"+t[n].value+"</td></tr>";i.html('<fieldset id="'+c("section-1")+'" class="'+c("field")+' panel panel-default" data-section="1"><legend class="panel-heading"><h3 id="'+c("whois-title")+'" class="'+c("dropdown")+'">Whois</h3></legend><div class="panel-body '+c("border")+'"><table class="'+c("table")+'">'+r+"</table></div></fieldset>").fadeIn("slow"),"x"===o[a][1]&&e(c("#","whois-title")).trigger("click")}),v("loading",{cmd:"search",ip:u,which:d},function(n){var i,d="",p=Number(o[a][2])||0;for(i in n)n.hasOwnProperty(i)&&(d+='<a href="#!" class="nav-tab'+(O[i]===p?" nav-tab-active":"")+'" data-index="'+O[i]+"\" data-api='"+s(JSON.stringify(n[i]))+"'>"+i+"</a>");l.html('<div class="nav-tab-wrapper">'+d+'</div><div id="ip-geo-block-geoinfo"></div>').fadeIn("slow").on("click","a",function(){var n,i=e(this),l=e(this).data("api"),d="",p=s(l.latitude||"0"),h=s(l.longitude||"0"),f=l.latitude||l.longitude?7:2;for(n in i.parent().children("a").removeClass("nav-tab-active"),i.addClass("nav-tab-active"),o[a][2]=i.data("index"),N(o),l)l.hasOwnProperty(n)&&(n=s(n),d+='<li><span class="'+c("title")+'">'+n+' : </span><span class="'+c("result")+'">'+s(l[n])+"</span></li>");"object"==typeof t.google?U.GmapRS("deleteMarkers").GmapRS("addMarker",{latitude:p,longitude:h,title:u,content:"<ul>"+d+"</ul>",show:!0,zoom:f}):(U.empty().html('<iframe src="'+r.altgmap+"?q="+p+","+h+"&z="+f+'&output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>'),e(c("#","geoinfo")).html("<ul>"+d+"</ul>"))}).find(".nav-tab-active").trigger("click")},[n])}return!1}),e(c("@","ip_address")).on("keypress",function(t){if(t.which&&13===t.which||t.keyCode&&13===t.keyCode)return e(c("@","get_location")).click(),!1}),e(c("@","ip_address")).val()&&e(c("@","get_location")).click();break;case 5:I(a),e("input[name="+c("duration")+"]:radio").on("click",function(){var t=e('div[class*="paginate"]').find('a[class*="current"]').text();o[a][2]=e(this).val()||0,o[a][3]=o[a][3]||2,o[a][4]=o[a][4]||1,N(o),A.ajaxStacked(o[a][2],o[a][3],o[a][4],t-1)}),e(c("#","open-new")).on("change",function(){var t=e(this).prop("checked");o[a][1]=t?"o":"x",N(o),e(c("#","section-0 svg")).find("a").each(function(){this.setAttribute("target",t?"_blank":"_self")})}),e(c("#","apply-layout")).on("click",function(){var t=e(c("#","select-layout"));o[a][3]=t.find('select[name="rows"] option:selected').val(),o[a][4]=t.find('select[name="cols"] option:selected').val(),N(o)}),e("ul.wp-submenu>li.wp-first-item").removeClass("current").next().addClass("current")}})}(jQuery,window,document);
3
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
+ !function(e,t,n,i){var a=!1,o=[],r=e(t).width(),l=IP_GEO_BLOCK,c=IP_GEO_BLOCK_AUTH;function s(e,t){var n={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_","!":"ip_geo_block_settings_"};return t!==i?n[e]+t:n.$+e}function d(e){return e?function(e){return e.toString().replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]}).replace(/&amp;(#\d{2,4}|\w{4,7});/g,"&$1;")}(e.toString().replace(/(<([^>]+)>)/gi,"")):""}function u(n,a){var l=e(t).width();l!==r&&(r=l,o[n]===i&&(o[n]={id:!1,callback:a}),e(t).off("resize").on("resize",function(){return!1!==o[n].id&&t.clearTimeout(o[n].id),o[n].time=t.setTimeout(o[n].callback,200),!1}))}function p(t,n){n?e(s("#",t)).addClass(s("loading")):e(s("#",t)).removeClass(s("loading"))}function h(e,n){t.confirm(d(e))&&n()}function f(e,n,i){t.alert(d(n||l.msg[11].replace("%s",i)+" ("+e+")"))}function g(){f(null,d(l.msg[9]))}function m(e,n){-1!==t.location.href.indexOf(e)&&(t.location=d(e)+(n?"&"+d(n):"")+"&"+(c.key?c.key+"="+c.nonce:""))}function v(t,n,i,o){t&&p(t,!0),n.action=l.action,n.nonce=l.nonce,e.post(l.url,n).done(function(e){i&&i(e)}).fail(function(e){a||f(e.status,e.responseText,n.action)}).always(function(){t&&("object"==typeof o?e.when.apply(e,o).then(function(){p(t,!1)}):p(t,!1))})}function b(e,t){v(e,{cmd:"clear-"+e,which:t},function(e){m(e.page,e.tab)})}function k(e){return e.stopImmediatePropagation(),!1}function w(e,t){t?e.removeClass("folding-disable"):(e.children(s(".","hide")).hide(),e.addClass("folding-disable"),e.removeClass(s("dropdown")).addClass(s("dropup")))}function x(t,n,i){var a=t.prop("type")||"",o=0===a.indexOf("checkbox")&&t.is(":checked")||0===a.indexOf("select")&&"0"!==t.val();t.siblings('input[name^="'+s("%","settings")+'"]:checkbox').prop("disabled",!o),e.isArray(n)?e.each(n,function(t,n){e(n).nextAll(s(".","settings-folding")).each(function(n,a){w(e(a),o&&i[t])})}):n.nextAll(s(".","settings-folding")).each(function(t,n){w(e(n),o&&i)})}function y(t){var n=s("@","validation_ajax_");w(t.closest("ul").next(),e(n+"1").is(":checked")||e(n+"2").is(":checked"))}function _(e){return String(e).replace(/[a-z]/gi,function(e){return String.fromCharCode(e.charCodeAt(0)+(e.toLowerCase()<"n"?13:-13))})}function C(e){return function(e){return t.btoa(e)}(_(e))}function P(e){return _(function(e){return t.atob(e)}(e))}function S(t){var n=t.is(":checked"),i=e(s("@","public_target_rule")),a=e(s("@","public_behavior")),o=t.closest("tr").nextAll("tr");o.find('[name^="'+s("%","settings")+'"]').prop("disabled",!n),o.find(s(".","desc")).css("opacity",n?1:.5),x(t,[i,a],["1"===i.val(),a.val()]),n&&a.change()}function A(t,n){t&&("string"==typeof t&&(t=JSON.parse(t)),n&&(e('input[type="checkbox"]').prop("checked",!1).change(),e("input[name*=providers]").prop("disabled",!1).change()),e(s("#","import")).closest("form").deserialize(t),e(s("@","exception_admin")+","+s("@","validation_mimetype")).change(),e('select[name*="'+s("%","settings")+'"]').change(),e(s("@","validation_login")).change(),S(e(s("@","validation_public"))),y(e(s("@","validation_ajax_1"))),n&&(n=s("%","settings[providers][IPInfoDB]"),e(s("@","providers_IPInfoDB")).prop("checked",!!t[n])))}e.fn.deserialize=function(t){return this.each(function(){var n,i,a,o=this,r={};for(n in t)if(t.hasOwnProperty(n))try{i=d(decodeURIComponent(n)),a=d(decodeURIComponent(t[n])),r.hasOwnProperty(i)||(r[i]=[]),r[i].push(a)}catch(e){}e.each(r,function(t,i){"hidden"!==(n=e('[name="'+t+'"]:input',o).val(i)).attr("type")&&n.before('<span style="color:red">*</span>')})})};var O={dataPie:[],viewPie:[],drawPie:function(a){var o,r;O.dataPie[a]===i&&((o=O.dataPie[a]=new t.google.visualization.DataTable).addColumn("string","Country"),o.addColumn("number","Requests"),r=e.parseJSON(e("#"+a).attr("data-"+a)),O.dataPie[a].addRows(r)),O.viewPie[a]===i&&(O.viewPie[a]=new t.google.visualization.PieChart(n.getElementById(a))),O.dataPie[a]!==i&&O.viewPie[a]!==i&&0<(o=e("#"+a).width())&&O.viewPie[a].draw(O.dataPie[a],{backgroundColor:{fill:"transparent"},chartArea:{left:0,top:"5%",width:"100%",height:"90%"},sliceVisibilityThreshold:.015})},dataLine:[],viewLine:[],drawLine:function(a,o){var r,l,c;if(O.dataLine[a]===i){for((r=O.dataLine[a]=new t.google.visualization.DataTable).addColumn(o,"Date"),r.addColumn("number","comment"),r.addColumn("number","xmlrpc"),r.addColumn("number","login"),r.addColumn("number","admin"),r.addColumn("number","public"),l=(c=e.parseJSON(e("#"+a).attr("data-"+a))).length,r=0;r<l;++r)c[r][0]=new Date(1e3*c[r][0]);O.dataLine[a].addRows(c)}O.viewLine[a]===i&&(O.viewLine[a]=new t.google.visualization.LineChart(n.getElementById(a))),O.dataLine[a]!==i&&O.viewLine[a]!==i&&0<(r=e("#"+a).width())&&O.viewLine[a].draw(O.dataLine[a],{legend:{position:"bottom"},backgroundColor:{fill:"transparent"},hAxis:{format:"MM/dd"+("datetime"===o?" HH:mm":"")},vAxis:{textPosition:r>320?"out":"in"},chartArea:{left:r>320?"10%":0,top:"5%",width:"100%",height:"75%"}})},dataStacked:[],viewStacked:[],drawStacked:function(a){var o,r,l,c,u=e("#"+d(a));O.dataStacked[a]===i&&(l=e.parseJSON(u.attr("data-"+a)))&&(l.unshift(["site","comment","xmlrpc","login","admin","poblic",{role:"link"}]),O.dataStacked[a]=t.google.visualization.arrayToDataTable(l)),O.viewStacked[a]===i&&(O.viewStacked[a]=new t.google.visualization.BarChart(n.getElementById(a)),t.google.visualization.events.addListener(O.viewStacked[a],"animationfinish",function(){var t,i,o,r=[],l=O.dataStacked[a],c=l.getNumberOfRows(),d=e(s("#","open-new")).prop("checked");for(t=0;t<c;t++)r.push({label:l.getValue(t,0),link:l.getValue(t,6)});c="http://www.w3.org/1999/xlink",u.find("text").each(function(e,t){"g"===(o=t.parentNode).tagName.toLowerCase()&&-1!==(e=function(e,t){var n,i=t.length;for(e=e.replace("…",""),n=0;n<i;++n)if(t.hasOwnProperty(n)&&0===t[n].label.indexOf(e))return n;return-1}(t.textContent,r))&&((i=n.createElementNS("http://www.w3.org/2000/svg","a")).setAttributeNS(c,"xlink:href",r[e].link),i.setAttributeNS(c,"title",r[e].label),i.setAttribute("target",d?"_blank":"_self"),i.setAttribute("class","site"),i.appendChild(o.removeChild(t)),o.appendChild(i),r.splice(e,1))})})),0<(r=u.width())&&O.dataStacked[a]!==i&&O.viewStacked[a]!==i&&(o=s("range"),c=e.parseJSON(e("."+o).attr("data-"+o)),o=40*(l=O.dataStacked[a]).getNumberOfRows(),O.viewStacked[a].draw(l,{width:r,height:o+80,allowHtml:!0,isStacked:!0,legend:{position:"top"},chartArea:{top:50,left:90,width:"100%",height:o},hAxis:{minValue:0,maxValue:c[1]},backgroundColor:{fill:"transparent"},animation:{startup:!0,duration:200,easing:"out"}}))},ajaxStacked:function(t,n,a,o){v(null,{cmd:"restore-network",which:t=Math.max(0,Math.min(4,t)),offset:(n=5*Math.max(1,Math.min(5,n)))*a*o,length:n},function(t){var a,o,r,l,c;t=function(e,t){var n,i,a=Math.ceil(e.length/t),o=[];for(n=0;n<a;++n)i=n*t,o.push(e.slice(i,i+t));return o}(t,n),e(s(".","network")).each(function(s,d){if(t[s]!==i){for(l=e(d).attr("id"),c=O.dataStacked[l],r=Math.min(n,t[s].length),a=0;a<r;++a)for(o=1;o<=5;o++)c.setValue(a,o,t[s][a][o]);O.drawStacked(l)}})})}};function I(n){"object"==typeof t.google&&(1===n?e(s("#","chart-countries")).length&&(O.drawPie(s("chart-countries")),O.drawLine(s("chart-daily"),"date")):5===n&&e(s(".","network")).each(function(t,n){O.drawStacked(e(n).attr("id"))}))}function N(e){if("object"==typeof t.google){var n=["corechart"];5===e&&n.push("bar"),t.google.charts.load("current",{packages:n,callback:function(){I(e)}}),u("draw-chart."+e,function(){I(e)})}}function D(t){var n,a,o=[];e.each(t,function(e,t){if(o[e]="",t!==i&&(a=t.length))for(o[e]=(t[0]||"o").toString(),n=1;n<a;++n)o[e]+=(t[n]||"o").toString()}),wpCookies!==i&&wpCookies.setHash("ip-geo-block",o,new Date(Date.now()+2592e6),c.home+c.admin)}function j(t){var a=function(e){var t,n=wpCookies!==i&&wpCookies.getHash("ip-geo-block")||[];for(t in n)n.hasOwnProperty(t)&&(n[t]=n[t].replace(/[^ox\d]/gi,"").split(""));return n[e]===i&&(n[e]=[]),n}(t);return e(n).on("click","form>h2,h3",function(){return function(e,t,n){var i,a=e.closest("fieldset").data("section"),o=e.parent().nextAll(".panel-body").toggle();e.toggleClass(s("dropup")).toggleClass(s("dropdown")),(i=e.hasClass(s("dropdown")))?o.addClass(s("border")).trigger(s("show-body")):o.removeClass(s("border")),n[t][a]=i?"o":"x",D(n),I(t)}(e(this),t,a),!1}),e(s("#","toggle-sections")).on("click",function(){var n,i=e(s(".","field")).find("h2,h3"),o=[s("dropdown"),s("dropup")],r=i.filter("."+o[0]).length;return i.each(function(i){(n=e(this)).removeClass(o.join(" ")).addClass(r?o[1]:o[0]),n=n.parent().nextAll(".panel-body").toggle(!r),r?n.removeClass(s("border")):n.addClass(s("border")).trigger("show-body"),a[t][i]=r?"x":"o"}),D(a),I(t),!1}),a}function T(t){e("body").append('<div style="display:none"><form method="POST" id="'+s("export-form")+'" action="'+l.url.replace("ajax.php","post.php")+'"><input type="hidden" name="action" value="'+l.action+'" /><input type="hidden" name="nonce" value="'+l.nonce+'" /><input type="hidden" name="cmd" value="'+t+'" /><input type="hidden" name="data" value="" id="'+s("export-data")+'"/><input type="submit" value="submit" /></form><input type="file" name="settings" id="'+s("file-dialog")+'" /></div>')}function L(e,t,n,i){var a,o;return(a=e.cloneNode(!1)).setAttribute("title",d(n)),(o=t.cloneNode(!1)).setAttribute("class","dashicons dashicons-"+i),a.appendChild(o),a}function R(n,a,o,r){var c=Number(r[n][1===n?3:2])||0;c=[10,25,50,100][c],e.extend(!0,e.fn.dataTable.defaults,o,{dom:"tlp",serverSide:!1,autoWidth:!1,processing:!0,deferRender:!0,language:{emptyTable:l.i18n[1],loadingRecords:l.i18n[0],processing:l.i18n[0],zeroRecords:l.i18n[2],lengthMenu:"_MENU_",paginate:{first:"&laquo;",last:"&raquo;",next:"&rsaquo;",previous:"&lsaquo;"}},responsive:{details:{type:"column",target:"td:nth-child(n+2)"}},columnDefs:[{width:"1.25em",targets:0},{orderable:!1,targets:0},{searchable:!1,targets:0},{targets:[0],data:null,defaultContent:'<input type="checkbox">'}],pagingType:"full_numbers",lengthMenu:[10,25,50,100],pageLength:c,scroller:!0,scrollY:1e4,scrollCollapse:!0,drawCallback:function(t){var n=e(s("#",a.tableID)).find("td.dataTables_empty"),i="restore-logs"===a.ajaxCMD?3:2;i>t.iDraw?n.html(l.i18n[0]):i===t.iDraw&&(n.html(l.i18n[1]),(n=e(s("@","search_filter"))).val()&&n.trigger("keyup"))}});var d=e(s("#",a.tableID)).DataTable({ajax:{url:l.url,type:"POST",data:{cmd:a.ajaxCMD,action:l.action,nonce:l.nonce}},mark:!0}),p=function(){d.columns.adjust().responsive.recalc().draw(!1)};return u("draw-table."+n,p),e(s("#",a.sectionID)).find(".panel-body").off(s("show-body")).on(s("show-body"),function(){return p(),!1}).off("change").on("change",'th>input[type="checkbox"]',function(){var t=e(this).prop("checked");return e(s("#",a.tableID)).find('td>input[type="checkbox"]').prop("checked",t),!1}),e(s("#","select-target")).off("change").on("change",function(){var t=e(this).find('input[name="'+s("target")+'"]:checked').val();return d.columns(a.targetColumn).search("all"!==t?t:"").draw(),!1}).trigger("change"),e(s("#","bulk-action")).off("click").on("click",function(){var t,o,r=e(this).prev().val(),c=/(<([^>]+)>)/gi,u=/data-hash=[\W]([\w]+)[\W]/i,p={IP:[],AS:[]},h=d.$("input:checked");return!!r&&(h.length?(h.each(function(){o=d.cell(this.parentNode).data(),t=("bulk-action-remove"===r||"bulk-action-ip-erase"===r)&&(t=o[a.columnIP].match(u))?","+t[1]:"",p.IP.push(o[a.columnIP].replace(c,"")+t),p.AS.push(o[a.columnAS].replace(c,""))}),p.IP.length&&v("loading",{cmd:r,which:p},function(t){t.page!==i?m(t.page,"tab="+n):t&&(d.ajax.reload(),e(s("#",a.tableID)).find('th input[type="checkbox"]').prop("checked",!1))}),!1):(f(null,l.msg[10]),!1))}),e(s("@","search_filter")).off("keyup").on("keyup",function(){return d.search(this.value,!1,!0,!/[A-Z]/.test(this.value)).draw(),!1}),e(s("#","reset-filter")).off("click").on("click",function(){return e(s("@","search_filter")).val(""),d.search("").draw(),!1}),e(s("@","clear_all")).off("click").on("click",function(){return h(l.msg[0],function(){b(1===n?"cache":"logs",null)}),!1}),e("table"+s(".","dataTable")+" tbody").on("click","a",function(){var i,a,o=t.location.search.slice(1).split("&"),r=o.length,l={};for(i=0;i<r;++i)l[(a=o[i].split("="))[0]]=a[1];for(i in l.tab=1===n?4:2,l.s=e(this).text().replace(/[^\w\.\:\*]/,""),a=[],l)l.hasOwnProperty(i)&&a.push(i+"="+l[i]);return t.open(t.location.pathname+"?"+a.join("&"),"_blank"),!1}),e(s("#",a.tableID)).on("length.dt",function(e,t,i){r[n][1===n?3:2]={10:0,25:1,50:2,100:3}[i]||0,D(r)}),d}e(function(){var o=Number(l.tab)||0,r=j(o);switch(e(s(".","inhibit")).on("submit",function(){return!1}),e(t).on("beforeunload",function(){a=!0}),o){case 0:var u=s("%","settings");e('[id^="'+s("scan-")+'"]').on("click",function(){var t=e(this),n=t.attr("id"),i=t.parent();return v(n.replace(/^.*(?:scan)/,"scanning"),{cmd:"scan-code",which:n.replace(s("scan-"),"")},function(e){var t,n;for(t in i.children("ul").length||i.append('<ul id="'+s("code-list")+'"></ul>'),i=i.children("ul").empty(),e)e.hasOwnProperty(t)&&("string"==typeof e[t=d(t)]?n=d(e[t]):(n=d(e[t].code),t='<abbr title="'+d(e[t].type)+'">'+t+"</abbr>"),i.append("<li>"+t+' : <span class="'+s("notice")+'">'+n+"</span></li>"));i.show("slow")}),!1}),e(s("@","matching_rule")).on("change",function(){var t=this.value;return e(s("@","white_list")).closest("tr").toggle("0"===t),e(s("@","black_list")).closest("tr").toggle("1"===t),!1}).change(),e(s(".","icon-cidr")).on("click",function(){var n=e(s("#","admin-styles-css")).get(0).href,i=t.open("about:blank","","width=560,height=170");return n=n.slice(0,n.lastIndexOf("css/")),i.document.write('<!DOCTYPE html><html lang=en><meta charset=utf-8><title>CIDR calculator for IPv4 / IPv6</title><link href="'+n+'css/cidr.min.css?v=.1" rel=stylesheet><div class="row container"><div class=row id=i><fieldset class="col span_11"><legend>Range <input id=a type=button value=Clear tabindex=1></legend><textarea id=c name=range placeholder="192.168.0.0 - 192.168.255.255" rows=5 wrap=off tabindex=2></textarea></fieldset><ul class="col span_2" id=h><li class=row><input id=e type=button value=&rarr; class="col span_24" tabindex=3><li class=row><input id=f type=button value=&larr; class="col span_24" tabindex=6></ul><fieldset class="col span_11"><legend>CIDR <input id=b type=button value=Clear tabindex=4></legend><textarea id=d name=cidr placeholder=192.168.0.0/16 rows=5 wrap=off tabindex=5></textarea></fieldset></div><div class=row id=j><span class=col id=g> </span></div></div><script src="'+n+'js/cidr.min.js?v=.1"><\/script>'),i.document.close(),!1}),e(s("@","validation_mimetype")).on("change",function(t){var n=e(this),i=Number(n.val());return n.nextAll(s(".","settings-folding")).each(function(t,n){w(e(n),i===t+1||i&&2===t)}),k(t)}).change(),e('select[name*="response_code"]').on("change",function(t){var n=e(this),i=parseInt(n.val()/100,10),a=n.closest("tr").nextAll("tr");return 0<=n.attr("name").indexOf("public")&&-1===Number(e(s("@","public_matching_rule")).val())?(a.each(function(t){1>=t&&e(this).hide()}),k(t)):(i<=3?a.each(function(t){0===t?e(this).show():1===t&&e(this).hide()}):a.each(function(t){0===t?e(this).hide():1===t&&e(this).show()}),k(t))}).change(),e(s("#","decode")).on("click",function(){var t=e(s("@","signature")),n=t.val();return-1===n.search(/,/)?t.val(P(n)):t.val(C(n)),!1}),e(s("@","validation_login")).on("change",function(t){var n=e(this);return x(n,n,u),k(t)}).change(),v(null,{cmd:"get-actions"},function(t){var i,a,o,r,u=e(s("#","list-admin")),p=n.createElement("li"),h=n.createElement("input"),f=n.createElement("label"),g=n.createElement("dfn"),m=n.createElement("span");for(r in t)t.hasOwnProperty(r)&&(r=d(r),u.find("#"+(o=s("!","exception_admin_"+r))).size()||((i=h.cloneNode(!1)).setAttribute("id",o),i.setAttribute("value",r),i.setAttribute("type","checkbox"),(a=p.cloneNode(!1)).appendChild(i),(i=f.cloneNode(!1)).setAttribute("for",o),i.appendChild(n.createTextNode(r)),a.appendChild(i),1&t[r]&&a.appendChild(L(g,m,l.msg[5],"lock")),2&t[r]&&a.appendChild(L(g,m,l.msg[6],"unlock")),u.append(a)));e(s(".","icon-unlock")).on("click",function(){return e(s("#","list-admin")+">li").filter(function(){return!e(this).find(".dashicons-unlock").length}).toggle(),!1}),e(s("@","exception_admin")).on("change",function(t){var n=e.grep(e(this).val().split(","),function(e){return""!==e.replace(/^\s+|\s+#x2F;g,"")});return e(s("#","list-admin")).find("input").each(function(){var t=e(this),i=t.val();t.prop("checked",-1!==e.inArray(i,n))}),k(t)}).change(),e(s("#","list-admin")).on("click","input",function(){var t,n=e(this),i=e(s("@","exception_admin")),a=n.val(),o=e.grep(i.val().split(","),function(e){return""!==e.replace(/^\s+|\s+#x2F;g,"")});-1===(t=e.inArray(a,o))?o.push(a):o.splice(t,1),i.val(o.join(",")).change()}),e(s(".","icon-find")).on("click",function(){var t,n,i,a,o=e(this),r=[],u=0,p=d(l.msg[8]),h=d(o.data("target"));return e(s("#","find-"+h)).empty(),o.next().children(s(".","find-desc")).show(),(o=e(s("#","list-"+h))).children("li").each(function(t,n){r.push(e(n).find("input").val())}),v("find-"+h,{cmd:"find-"+h},function(f){var g;for(g in f)f.hasOwnProperty(g)&&(++u,t=d(f[g]),g=d(g),n=e.inArray(g,r),i=s("!","exception_"+h+"_"+g),a="admin"===h?t+"="+g:"/"+t+"/"+g+"/",a='<a class="ip-geo-block-icon ip-geo-block-icon-alert" href="'+c.sites[0]+c.admin+"options-general.php?page=ip-geo-block&tab=4&s="+encodeURIComponent(a)+'" title="'+p.replace("%s",a)+'" target="_blank"><span></span></a>',n<0?(r.push(g),o.prepend('<li><input id="'+i+'" value="'+g+'" type="checkbox" '+("admin"===h?"/>":"name=ip_geo_block_settings[exception]["+h+"]["+g+"] />")+'<label for="'+i+'">'+g+"</lable>"+a+"</li>")):(i=o.find("#"+i).parent()).find("a").length||i.append(a));e(s("@","exception_"+h)).trigger("change"),e(s("#","find-"+h)).append(' <span class="ip-geo-block-warn">'+d(l.msg[7].replace("%d",u))+"</span>")}),!1})}),e('input[id^="'+s("!","validation_ajax_")+'"]').on("change",function(){y(e(this))}).change(),e(s("@","validation_public")).on("change",function(t){return S(e(this)),k(t)}).change(),e(s("@","public_matching_rule")).on("change",function(t){var n=this.value;return e(s("@","public_white_list")).closest("tr").toggle("0"===n),e(s("@","public_black_list")).closest("tr").toggle("1"===n),e(s("@","public_response_code")).change().closest("tr").toggle("-1"!==n),k(t)}).change(),e(s("@","public_behavior")).on("change",function(t){var n=e(this);return w(n.siblings("ul"),n.prop("checked")),k(t)}).change(),e(s("@","update")).on("click",function(){return v("download",{cmd:"download"},function(t){var n,i,a;for(n in t)if(t.hasOwnProperty(n))for(i in a=t[n])a.hasOwnProperty(i)&&(a[i=d(i)].filename&&e(s("@",n+"_"+i+"_path")).val(d(a[i].filename)),a[i].message&&e(s("#",n+"-"+i)).text(d(a[i].message)))}),!1}),e(s("@","restrict_api")).on("change",function(){e('input[class*="remote"]').prop("disabled",e(this).prop("checked"))}).trigger("change"),e(s("@","save_statistics")).on("change",function(){return e(s("@","validation_recdays")).prop("disabled",!e(this).prop("checked")),!1}).trigger("change"),e(s("@","validation_reclogs")).on("change",function(){var t=e(this);t.parent().parent().nextAll().find('input[id*="validation"]').prop("disabled",0===Number(t.prop("selectedIndex")))}).trigger("change"),e(s("@","cache_hold")).on("change",function(){var t=e(this).prop("checked");e('input[name*="[cache_time]"]').prop("disabled",!t),e('select[id*="login_fails"]').prop("disabled",!t)}).trigger("change"),e(s("@","comment_pos")).on("change",function(){var t=e(this);t.nextAll('input[type="text"]').prop("disabled",0===Number(t.prop("selectedIndex")))}).trigger("change"),T("validate"),e(s("#","export")).on("click",function(){if(JSON===i)return g(),!1;var t=u,n={};return e.each(e(this).closest("form").serializeArray(),function(e,i){-1!==i.name.indexOf(t)&&(n[i.name]=i.value)}),n[t+="[signature]"]=C(n[t]),e(s("#","export-data")).val(JSON.stringify(n)),e(s("#","export-form")).submit(),!1}),e(s("#","file-dialog")).on("change",function(e){if(t.FileReader===i)return g(),!1;var n,a=e.target.files[0];return a&&function(e,n){var i=new t.FileReader;i.onload=function(e){n&&n(e.target.result)},i.onerror=function(e){f("Error",e.target.error.code)},i.readAsText(e)}(a,function(e){(e=JSON.parse(e))[n=u+"[signature]"]!==i&&(e[n]=C(e[n])),v("export-import",{cmd:"validate",data:JSON.stringify(e)},function(e){A(e,!0)})}),!1}),e(s("#","import")).on("click",function(){return e(s("#","file-dialog")).click(),!1}),e(s("#","default")).on("click",function(){return h(l.msg[0],function(){v("pre-defined",{cmd:"import-default"},function(e){A(e,!0)})}),!1}),e(s("#","preferred")).on("click",function(){return h(l.msg[0],function(){v("pre-defined",{cmd:"import-preferred"},function(e){A(e,!1)})}),!1}),e(s("@","reset_live")).on("click",function(){return v("reset-live",{cmd:"reset-live"}),!1}),e(s("#","login-link")).on("click",function(){var t=e(this),n=s("quot;,"primary");return t.hasClass(n)?v("login-loading",{cmd:"generate-link"},function(i){t.text(l.msg[3]),t.removeClass(n).nextAll(s(".","desc")).remove(),e('<p class="ip-geo-block-desc"></p>').appendTo(t.parent()).append(l.msg[4],'<a href="'+i.link+'" title="'+l.msg[1]+'" target=_blank>'+i.link+"</a></p>")}):h(l.msg[0],function(){v("login-loading",{cmd:"delete-link"},function(){t.text(l.msg[2]),t.addClass(n).nextAll(s(".","desc")).remove()})}),!1}),e(s("@","diag_tables")).on("click",function(){return h(l.msg[0],function(){var e;v(e="diag-tables",{cmd:e},function(e){m(e.page,e.tab)})}),!1}),e(s("#","show-info")).on("click",function(){e(s("#","wp-info")).empty(),v("wp-info",{cmd:"show-info"},function(t){var n,i=[];for(n in t)t.hasOwnProperty(n)&&i.push("- "+n+" "+t[n]);return e(s("#","wp-info")).html('<textarea class="regular-text code" rows="'+i.length+'">'+i.join("\n")+"</textarea>").find("textarea").select(),!1})}),e('select[name^="'+u+'"]').on("change",function(){var t,n,i,a=e(this);return t=a,i=s(".","desc"),t.next(i).empty(),(n=t.children("option:selected").data("desc"))&&t.next(i).html(e.parseHTML(n)),x(a,a,u),!1}).change(),e(s(".","icon-cycle")).on("click",function(){var t,n=e(this).nextAll("li"),i=n.find(s("@","exception_admin")),a=n.find("input:checkbox").filter(":visible"),o=a.filter(":checked").length;return a.prop("checked",!o),i.length&&(o?i.val(""):(t=[],a.each(function(n,i){t.push(e(i).val())}),i.val(t.join(",")))),e(this).blur(),!1}),e(s(".","settings-folding>dfn")).on("click",function(){var t=s("drop"),n=e(this).parent();return n.children(s(".","hide")).toggle(),n.toggleClass(t+"up").toggleClass(t+"down"),n.hasClass(t+"up")&&n.children("div").hide(),!1}),e("#submit").on("click",function(){var t=e(s("@","signature")),n=t.val();return-1!==n.indexOf(",")&&t.val(C(n)),!0});break;case 1:N(o);var p=0;e(s("#","sort-slug")).on("click",function(){var t=e(this).closest("ol"),n=t.children("li");(p=!p)?n.sort(function(t,n){return e(t).text()>e(n).text()}):n.sort(function(t,n){return Number(e(t).text().replace(/^.*\((\d+)\)#x2F;,"$1"))<=Number(e(n).text().replace(/^.*\((\d+)\)#x2F;,"$1"))}),t.children("li").remove(),n.appendTo(t)}),e(s("@","clear_statistics")).on("click",function(){return h(l.msg[0],function(){b("statistics",null)}),!1}),e(s("@","clear_logs")).on("click",function(){return h(l.msg[0],function(){b("logs",null)}),!1}),R(o,{tableID:"statistics-cache",ajaxCMD:"restore-cache",sectionID:"section-2",targetColumn:4,columnIP:1,columnAS:3},{columns:[{title:'<input type="checkbox">'},{title:l.i18n[3]},{title:l.i18n[4]},{title:l.i18n[5]},{title:l.i18n[6]},{title:l.i18n[7]},{title:l.i18n[8]},{title:l.i18n[9]}],columnDefs:[{responsivePriority:0,targets:0},{responsivePriority:1,targets:1},{responsivePriority:2,targets:2},{responsivePriority:6,targets:3},{responsivePriority:7,targets:4},{responsivePriority:3,targets:5},{responsivePriority:4,targets:6},{responsivePriority:5,targets:7},{className:"all",targets:[0,1,2,5]}]},r),T("export-cache"),e(s("#","export-cache")).on("click",function(){return e(s("#","export-form")).submit(),!1});break;case 4:var _={tableID:"validation-logs",sectionID:"section-0",targetColumn:6,columnIP:3,columnAS:5},I={columns:[{title:'<input type="checkbox">'},{title:""},{title:l.i18n[10]},{title:l.i18n[3]},{title:l.i18n[4]},{title:l.i18n[5]},{title:l.i18n[7]},{title:l.i18n[11]},{title:l.i18n[12]},{title:l.i18n[13]},{title:l.i18n[14]},{title:l.i18n[15]}],columnDefs:[{responsivePriority:11,targets:0},{responsivePriority:0,targets:1},{responsivePriority:1,targets:2},{responsivePriority:2,targets:3},{responsivePriority:3,targets:4},{responsivePriority:6,targets:5},{responsivePriority:4,targets:6},{responsivePriority:5,targets:7},{responsivePriority:7,targets:8},{responsivePriority:8,targets:9},{responsivePriority:9,targets:10},{responsivePriority:10,targets:11},{visible:!1,targets:1},{className:"all",targets:[0,2,3,4]},{className:"none",targets:[8,9,10,11]}]},M=null,z=null,E=e(s("#","live-loading")),$=null,J=function(){M&&(t.clearTimeout(M),M=null),z&&(E.removeClass(s("live-timer")),t.clearTimeout(z),z=null)},B=function(){J(),v("live-loading",{cmd:"live-start"},function(e){if(e.error)f(null,e.error);else if(e.data.length){var n,i=e.data.length;for(n=0;n<i;n++)$.row.add(e.data[n]);$.draw(!1)}M=t.setTimeout(B,1e3*l.interval)})},q=function(e,t){J(),v(null,{cmd:e||"live-stop",callback:t})},H=s(""),V=function(t,n,i){-1===n[7].indexOf("pass")?e(t).addClass(H+i+"blocked"):e(t).addClass(H+i+"passed")},G=e(s("#","live-log")),U=e(s("#","live-update"));e(s("#","validation-logs")).on("animationend",function(){return e(this).find('tr[class*="'+H+'new"]').each(function(){var t=e(this);-1!==t.prop("class").indexOf("passed")?t.addClass(H+"passed").removeClass(H+"new-passed"):t.addClass(H+"blocked").removeClass(H+"new-blocked")}),!1}),G.on("change",function(){switch(e('input[name="'+s("live-log")+'"]:checked').val()){case"start":B();break;case"pause":q("live-pause",function(){E.addClass(s("live-timer")),z=t.setTimeout(function(){J(),e(s("#","live-log-stop")).prop("checked",!0)},1e3*l.timeout)});break;case"stop":q()}}),U.on("change",function(){var t=G.closest("tr"),n=U.prop("checked");return r[o][1]=n?"o":"x",D(r),amp;&$.clear().destroy(),n?(t.show().next().next().next().nextAll().hide(),_.ajaxCMD="live-stop",I.order=[1,"desc"],I.createdRow=function(e,t){V(e,t,"new-")}):(t.hide().next().next().next().nextAll().show(),_.ajaxCMD="restore-logs",I.order=[0,""],I.createdRow=function(e,t){V(e,t,"")}),e(s("#","live-log-stop")).trigger("click"),$=R(o,_,I,r),!1}).trigger("change"),e(s("#","logs-preset")).on("click","a",function(){var t=e(this).data("value");return e(s("@","search_filter")).val(t),$.search(t,!1,!0,!/[A-Z]/.test(t)).draw(),!1}),T("export-logs"),e(s("#","export-logs")).on("click",function(){return e(s("#","export-form")).submit(),!1});break;case 2:e(t).on(s("gmap-error"),function(){v(null,{cmd:"gmap-error"},function(e){m(e.page,e.tab)})});var W=e(s("#","map"));"object"==typeof t.google?W.each(function(){e(this).GmapRS()}):W.each(function(){e(this).empty().html('<iframe src="'+l.altgmap+'?output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')});I=[];e('select[id^="'+s("!","service")+'"]').on("change",function(){e(this).children("option").each(function(t,n){I[e(n).text()]=t,r[o][3+t]=e(n).prop("selected")?"o":"x"}),"o"!==r[o][3+(Number(r[o][2])||0)]&&(r[o][2]=e(this).prop("selectedIndex")),D(r)}).change(),e(s("@","get_location")).on("click",function(){var n,i=e(s("#","whois")),a=e(s("#","apis")),c=e(s("@","service")).val(),u=e.trim(e(s("@","ip_address")).val());if(u&&c){if(e(s("@","anonymize")).prop("checked")){if(/[^0-9a-f\.:]/.test(u))return f(null,"illegal format."),!1;-1!==u.indexOf(".")?u=u.replace(/\.\w+#x2F;,".0"):(-1===(u=(u=u.split(":")).splice(0,4).join(":")).indexOf("::")&&(u+="::"),u=u.replace(/:{3,}/,"::")),e(s("@","ip_address")).val(u)}i.hide().empty(),a.hide().empty(),n=e.whois(u,function(t){var n,a="";for(n=0;n<t.length;++n)a+="<tr><td>"+t[n].name+"</td><td>"+t[n].value+"</td></tr>";i.html('<fieldset id="'+s("section-1")+'" class="'+s("field")+' panel panel-default" data-section="1"><legend class="panel-heading"><h3 id="'+s("whois-title")+'" class="'+s("dropdown")+'">Whois</h3></legend><div class="panel-body '+s("border")+'"><table class="'+s("table")+'">'+a+"</table></div></fieldset>").fadeIn("slow"),"x"===r[o][1]&&e(s("#","whois-title")).trigger("click")}),v("loading",{cmd:"search",ip:u,which:c},function(n){var i,c="",p=Number(r[o][2])||0;for(i in n)n.hasOwnProperty(i)&&(c+='<a href="#!" class="nav-tab'+(I[i]===p?" nav-tab-active":"")+'" data-index="'+I[i]+"\" data-api='"+d(JSON.stringify(n[i]))+"'>"+i+"</a>");a.html('<div class="nav-tab-wrapper">'+c+'</div><div id="ip-geo-block-geoinfo"></div>').fadeIn("slow").on("click","a",function(){var n,i=e(this),a=e(this).data("api"),c="",p=d(a.latitude||"0"),h=d(a.longitude||"0"),f=a.latitude||a.longitude?7:2;for(n in i.parent().children("a").removeClass("nav-tab-active"),i.addClass("nav-tab-active"),r[o][2]=i.data("index"),D(r),a)a.hasOwnProperty(n)&&(n=d(n),c+='<li><span class="'+s("title")+'">'+n+' : </span><span class="'+s("result")+'">'+d(a[n])+"</span></li>");"object"==typeof t.google?W.GmapRS("deleteMarkers").GmapRS("addMarker",{latitude:p,longitude:h,title:u,content:"<ul>"+c+"</ul>",show:!0,zoom:f}):(W.empty().html('<iframe src="'+l.altgmap+"?q="+p+","+h+"&z="+f+'&output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>'),e(s("#","geoinfo")).html("<ul>"+c+"</ul>"))}).find(".nav-tab-active").trigger("click")},[n])}return!1}),e(s("@","ip_address")).on("keypress",function(t){if(t.which&&13===t.which||t.keyCode&&13===t.keyCode)return e(s("@","get_location")).click(),!1}),e(s("@","ip_address")).val()&&e(s("@","get_location")).click();break;case 5:N(o),e("input[name="+s("duration")+"]:radio").on("click",function(){var t=e('div[class*="paginate"]').find('a[class*="current"]').text();r[o][2]=e(this).val()||0,r[o][3]=r[o][3]||2,r[o][4]=r[o][4]||1,D(r),O.ajaxStacked(r[o][2],r[o][3],r[o][4],t-1)}),e(s("#","open-new")).on("change",function(){var t=e(this).prop("checked");r[o][1]=t?"o":"x",D(r),e(s("#","section-0 svg")).find("a").each(function(){this.setAttribute("target",t?"_blank":"_self")})}),e(s("#","apply-layout")).on("click",function(){var t=e(s("#","select-layout"));r[o][3]=t.find('select[name="rows"] option:selected').val(),r[o][4]=t.find('select[name="cols"] option:selected').val(),D(r)}),e("ul.wp-submenu>li.wp-first-item").removeClass("current").next().addClass("current")}})}(jQuery,window,document);
admin/js/authenticate.js CHANGED
@@ -5,9 +5,10 @@
5
* This software is released under the MIT License.
6
*/
7
(function ($, window, document) {
8
var auth = IP_GEO_BLOCK_AUTH, wpzep = {
9
init: false,
10
- name: 'ip-geo-block-auth-nonce'
11
},
12
13
// regular expression to find target for is_admin()
@@ -15,14 +16,14 @@
15
'^(?:' + (auth.home || '') + auth.admin
16
+ '|' + (auth.home || '') + auth.plugins
17
+ '|' + (auth.home || '') + auth.themes
18
- + ')(?:.*\.php|.*\/)?#x27;
19
),
20
21
// `theme-install.php` eats the query and set it to `request[browse]` as a parameter
22
theme_featured = function (data) {
23
- var i = data.length;
24
while (i-- > 0) {
25
- if (data[i].indexOf('request%5Bbrowse%5D=ip-geo-block-auth') !== -1) {
26
data[i] = 'request%5Bbrowse%5D=featured'; // correct the parameter
27
break;
28
}
@@ -32,9 +33,9 @@
32
33
// `upload.php` eats the query and set it to `query[ip-geo-block-auth-nonce]` as a parameter
34
media_library = function (data) {
35
- var i = data.length;
36
while (i-- > 0) {
37
- if (data[i].indexOf('query%5Bip-geo-block-auth-nonce%5D=') !== -1) {
38
delete data[i];
39
break;
40
}
@@ -62,7 +63,7 @@
62
html = elem.innerHTML.replace(/["']/g, function (match) {
63
return {
64
'"': '&quot;',
65
- "'": '&#39;'
66
}[match];
67
});
68
elem = '';
@@ -201,17 +202,18 @@
201
}
202
203
var data = uri.query ? uri.query.split('&') : [],
204
- i = data.length;
205
206
// remove an old nonce
207
while (i-- > 0) {
208
- if (data[i].indexOf(wpzep.name) === 0) {
209
data.splice(i, 1);
210
break;
211
}
212
}
213
214
- data.push(wpzep.name + '=' + encodeURIComponent(nonce));//RFC3986
215
uri.query = data.join('&');
216
217
return compose_uri(uri);
@@ -261,7 +263,7 @@
261
262
// Check if current page is admin area and the target of wp-zep
263
function is_backend() {
264
- return (is_admin(window.location.pathname) === 1 || window.location.search.indexOf(wpzep.name) >= 0);
265
}
266
267
// Check if url belongs to multisite
@@ -269,7 +271,7 @@
269
var i, j, n = auth.sites.length;
270
271
for (i = 0; i < n; ++i) {
272
- j = url.indexOf(auth.sites[i] + '/')
273
if (0 <= j && j <= 6) { // from `//` to `https://`
274
return true;
275
}
@@ -314,7 +316,7 @@
314
// multipart/form-data (XMLHttpRequest Level 2)
315
// IE10+, Firefox 4+, Safari 5+, Android 3+
316
if (typeof window.FormData !== 'undefined' && settings.data instanceof FormData) {
317
- settings.data.append(wpzep.name, auth.nonce);
318
}
319
320
// application/x-www-form-urlencoded
@@ -333,7 +335,7 @@
333
if (callback) {
334
data = callback(data);
335
}
336
- data.push(wpzep.name + '=' + encodeURIComponent(auth.nonce));//RFC3986
337
settings.data = data.join('&');
338
}
339
}
@@ -369,8 +371,7 @@
369
370
if (typeof $.fn.onFirst === 'undefined') {
371
$.fn.onFirst = function(types, selector) {
372
- var type, $el = $(this),
373
- isDelegated = typeof selector === 'string';
374
375
$.fn.on.apply($el, arguments);
376
@@ -406,9 +407,9 @@
406
if (check_uri(uri)) {
407
admin = is_admin(href);
408
}
409
- /*
410
- console.log('href:' + href, uri, 'admin:' + admin, 'is_backend:' + is_backend(), 'is_multisite:' + is_multisite(href));
411
- //*/
412
// if context menu then continue and should be checked in check_nonce()
413
if ('click' !== event.type) {
414
return;
@@ -455,15 +456,15 @@
455
});
456
457
elem.onFirst('submit', 'form', function (/*event*/) {
458
- var $this = $(this),
459
- action = $this.attr('action'); // possibly 'undefined'
460
461
// if admin area then add the nonce
462
if (is_admin(action) === 1) {
463
if ('post' === ($this.attr('method') || '').toLowerCase()) {
464
$this.attr('action', add_query_nonce(action, auth.nonce));
465
} else {
466
- $this.append('<input type="hidden" name="' + wpzep.name + '" value="' + auth.nonce + '">');
467
}
468
}
469
});
@@ -487,11 +488,10 @@
487
488
// Restore post revisions (wp-admin/revisions.php @since 2.6.0)
489
if ('undefined' !== typeof window._wpRevisionsSettings) {
490
- var i, data = window._wpRevisionsSettings.revisionData,
491
- n = data.length;
492
493
for (i = 0; i < n; ++i) {
494
- if (-1 === data[i].restoreUrl.indexOf(wpzep.name)) {
495
window._wpRevisionsSettings.revisionData[i].restoreUrl = add_query_nonce(data[i].restoreUrl, auth.nonce);
496
}
497
}
5
* This software is released under the MIT License.
6
*/
7
(function ($, window, document) {
8
+ // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Description
9
var auth = IP_GEO_BLOCK_AUTH, wpzep = {
10
init: false,
11
+ regexp: new RegExp(auth.key + '(?:=|%3D)\\w+')
12
},
13
14
// regular expression to find target for is_admin()
16
'^(?:' + (auth.home || '') + auth.admin
17
+ '|' + (auth.home || '') + auth.plugins
18
+ '|' + (auth.home || '') + auth.themes
19
+ + ')(?:.*\\.php|.*\\/)?#x27;
20
),
21
22
// `theme-install.php` eats the query and set it to `request[browse]` as a parameter
23
theme_featured = function (data) {
24
+ var i = data.length, q = 'request%5Bbrowse%5D=' + auth.key;
25
while (i-- > 0) {
26
+ if (data[i].indexOf(q) !== -1) {
27
data[i] = 'request%5Bbrowse%5D=featured'; // correct the parameter
28
break;
29
}
33
34
// `upload.php` eats the query and set it to `query[ip-geo-block-auth-nonce]` as a parameter
35
media_library = function (data) {
36
+ var i = data.length, q = 'query%5B' + auth.key + '%5D=';
37
while (i-- > 0) {
38
+ if (data[i].indexOf(q) !== -1) {
39
delete data[i];
40
break;
41
}
63
html = elem.innerHTML.replace(/["']/g, function (match) {
64
return {
65
'"': '&quot;',
66
+ "'": '&#39;' //"
67
}[match];
68
});
69
elem = '';
202
}
203
204
var data = uri.query ? uri.query.split('&') : [],
205
+ i = data.length,
206
+ q = auth.key + '=';
207
208
// remove an old nonce
209
while (i-- > 0) {
210
+ if (data[i].indexOf(q) === 0) { // or `wpzep.regexp.test(data[i])`
211
data.splice(i, 1);
212
break;
213
}
214
}
215
216
+ data.push(auth.key + '=' + encodeURIComponent(nonce)); //RFC3986
217
uri.query = data.join('&');
218
219
return compose_uri(uri);
263
264
// Check if current page is admin area and the target of wp-zep
265
function is_backend() {
266
+ return (is_admin(window.location.pathname) === 1 || wpzep.regexp(window.location.search));
267
}
268
269
// Check if url belongs to multisite
271
var i, j, n = auth.sites.length;
272
273
for (i = 0; i < n; ++i) {
274
+ j = url.indexOf(auth.sites[i] + '/');
275
if (0 <= j && j <= 6) { // from `//` to `https://`
276
return true;
277
}
316
// multipart/form-data (XMLHttpRequest Level 2)
317
// IE10+, Firefox 4+, Safari 5+, Android 3+
318
if (typeof window.FormData !== 'undefined' && settings.data instanceof FormData) {
319
+ settings.data.append(auth.key, auth.nonce);
320
}
321
322
// application/x-www-form-urlencoded
335
if (callback) {
336
data = callback(data);
337
}
338
+ data.push(auth.key + '=' + encodeURIComponent(auth.nonce)); //RFC3986
339
settings.data = data.join('&');
340
}
341
}
371
372
if (typeof $.fn.onFirst === 'undefined') {
373
$.fn.onFirst = function(types, selector) {
374
+ var type, $el = $(this), isDelegated = (typeof selector === 'string');
375
376
$.fn.on.apply($el, arguments);
377
407
if (check_uri(uri)) {
408
admin = is_admin(href);
409
}
410
+
411
+ // console.log('href:' + href, uri, 'admin:' + admin, 'is_backend:' + is_backend(), 'is_multisite:' + is_multisite(href));
412
+
413
// if context menu then continue and should be checked in check_nonce()
414
if ('click' !== event.type) {
415
return;
456
});
457
458
elem.onFirst('submit', 'form', function (/*event*/) {
459
+ var $this = $(this), action = $this.attr('action'); // possibly 'undefined'
460
461
// if admin area then add the nonce
462
if (is_admin(action) === 1) {
463
if ('post' === ($this.attr('method') || '').toLowerCase()) {
464
$this.attr('action', add_query_nonce(action, auth.nonce));
465
} else {
466
+ // https://www.w3.org/TR/1999/REC-html401-19991224/types.html#type-name
467
+ $this.append('<input type="hidden" name="' + auth.key + '" value="' + auth.nonce + '">');
468
}
469
}
470
});
488
489
// Restore post revisions (wp-admin/revisions.php @since 2.6.0)
490
if ('undefined' !== typeof window._wpRevisionsSettings) {
491
+ var i, data = window._wpRevisionsSettings.revisionData, n = data.length;
492
493
for (i = 0; i < n; ++i) {
494
+ if (!wpzep.regexp.test(data[i].restoreUrl)) {
495
window._wpRevisionsSettings.revisionData[i].restoreUrl = add_query_nonce(data[i].restoreUrl, auth.nonce);
496
}
497
}
admin/js/authenticate.min.js CHANGED
@@ -3,7 +3,7 @@
3
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
- !function(e,t,n){var r=IP_GEO_BLOCK_AUTH,o={init:!1,name:"ip-geo-block-auth-nonce"},a=new RegExp("^(?:"+(r.home||"")+r.admin+"|"+(r.home||"")+r.plugins+"|"+(r.home||"")+r.themes+")(?:.*.php|.*/)?quot;),i=function(e){for(var t=e.length;t-- >0;)if(-1!==e[t].indexOf("request%5Bbrowse%5D=ip-geo-block-auth")){e[t]="request%5Bbrowse%5D=featured";break}return e},h={"upload.php":function(e){for(var t=e.length;t-- >0;)if(-1!==e[t].indexOf("query%5Bip-geo-block-auth-nonce%5D=")){delete e[t];break}return e},"theme-install.php":i,"network/theme-install.php":i};function c(e){var t=(e=e?e.toString():"").match(/^(?:([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return{scheme:t[1]||"",relative:t[2]||"",authority:t[3]||"",path:t[4]||"",query:t[5]||"",fragment:t[6]||""}}var s,l=function(){var e=null;try{new URL("/","http://example.com/")}catch(t){try{e=(new DOMParser).parseFromString("<html><head></head><body></body></html>","text/html")}catch(t){e=n.implementation.createHTMLDocument("")}}return function(r,o){var a,i,h,c=n;if(r=void 0!==r?r:t.location.href,null===e){void 0===o&&(o=t.location.href);try{h=new URL(r,o)}catch(e){h=new URL(r,t.location.href)}}else{if(void 0!==o){for(c=e;c.head.firstChild;)c.head.removeChild(c.head.firstChild);(a=c.createElement("base")).setAttribute("href",o),c.head.appendChild(a)}(i=c.createElement("a")).setAttribute("href",r),i.setAttribute("href",i.href),"http:"===(h={protocol:i.protocol,host:i.host,hostname:i.hostname,port:i.port,pathname:i.pathname,search:i.search,hash:i.hash,href:i.href,username:"",password:"",origin:i.origin||null}).protocol&&"80"===h.port?(h.port="",h.host=h.host.replace(/:80#x2F;,"")):"https:"===h.protocol&&"443"===h.port&&(h.port="",h.host=h.host.replace(/:443#x2F;,"")),"http:"!==h.protocol&&"https:"!==h.protocol||(h.pathname&&"/"!==h.pathname.charAt(0)&&(h.pathname="/"+h.pathname),h.origin||(h.origin=h.protocol+"//"+h.hostname+(h.port?":"+h.port:"")))}if(h.username||h.password)throw new URIError(h.username+":"+h.password);return h}}();function p(e,n){"object"!=typeof e&&(e=c(e||t.location.href));for(var r=e.query?e.query.split("&"):[],a=r.length;a-- >0;)if(0===r[a].indexOf(o.name)){r.splice(a,1);break}return r.push(o.name+"="+encodeURIComponent(n)),e.query=r.join("&"),function(e){return(e.scheme?e.scheme+":":"")+(e.relative+e.path)+(e.query?"?"+e.query:"")+(e.fragment?"#"+e.fragment:"")}(e)}function f(e){return(!e.scheme||/^https?#x2F;.test(e.scheme))&&(e.path||e.query)}function u(e){try{e=e||t.location.pathname||""}catch(t){e=""}var n=c(e.toLowerCase());if(f(n)){if((n=l(e)).origin!==t.location.origin)return-1;if((e=a.exec(n.pathname))&&(0<=e[0].indexOf(r.admin+"admin-")||0<=e[0].indexOf(r.admin)||0<=e[0].indexOf(r.plugins)||0<=e[0].indexOf(r.themes)))return 1}return 0}function m(e){return/\/#x2F;.test(e.path)}function d(e){return-1!==(e.attr("rel")||"").indexOf("nofollow")}
7
/*
8
* jQuery.bind-first library v0.2.3 (jquery >= 1.7)
9
* Copyright (c) 2013 Vladimir Zhuravlev
@@ -13,4 +13,4 @@
13
*
14
* Date: Thu Feb 6 10:13:59 ICT 2014
15
*/
16
- function v(t,n,r){var o=e._data(t[0]).events[n],a=r?o.splice(o.delegateCount-1,1)[0]:o.pop();o.splice(r?0:o.delegateCount||0,0,a)}function g(t,n,r){var o=n.split(/\s+/);t.each(function(t){for(t=0;t<o.length;++t){var n=e.trim(o[t]).match(/[^\.]+/i)[0];v(e(this),n,r)}})}function w(){if(!o.init){if(o.init=!0,e("img").each(function(){var t=e(this).attr("src");1===u(t)&&e(this).attr("src",p(t,r.nonce))}),void 0!==t._wpRevisionsSettings){var n,a=t._wpRevisionsSettings.revisionData,i=a.length;for(n=0;n<i;++n)-1===a[n].restoreUrl.indexOf(o.name)&&(t._wpRevisionsSettings.revisionData[n].restoreUrl=p(a[n].restoreUrl,r.nonce))}e("#toplevel_page_ip-geo-block li.wp-first-item").each(function(){var t=e(this);t.css("display","IP Geo Block"===t.children("a").text()?"none":"block")})}}e.ajaxPrefilter(function(e){if(1===u(e.url)&&!e.url.match(/async-upload\.php#x2F;))if(void 0!==t.FormData&&e.data instanceof FormData)e.data.append(o.name,r.nonce);else{var n,a,i=c(e.url);void 0===e.data||i.query?e.url=p(i,r.nonce):(n=e.data?e.data.split("&"):[],s=(s=t.location.pathname).replace(r.home+r.admin,""),(a=h.hasOwnProperty(s)?h[s]:null)&&(n=a(n)),n.push(o.name+"="+encodeURIComponent(r.nonce)),e.data=n.join("&"))}var s}),void 0===e.fn.onFirst&&(e.fn.onFirst=function(t,n){var r,o=e(this),a="string"==typeof n;if(e.fn.on.apply(o,arguments),"object"==typeof t)for(r in t)t.hasOwnProperty(r)&&g(o,r,a);else"string"==typeof t&&g(o,t,a);return o}),e(t).on("error",function(){w()}),e(function(){w()}),(s=e(n)).onFirst("click contextmenu","a",function(a){var i,h,s=0,l=e(this),v=l.attr("href")||"",g=c(v);if(f(g)&&(s=u(v)),"click"===a.type)if(1===s)l.attr("href",m(g)?v:p(v,d(l)?"nofollow":r.nonce));else if(-1===s&&(1===u(t.location.pathname)||t.location.search.indexOf(o.name)>=0))if("_self"===l.attr("target")||function(e){var t,n,o=r.sites.length;for(t=0;t<o;++t)if(0<=(n=e.indexOf(r.sites[t]+"/"))&&n<=6)return!0;return!1}(v))l.attr("href",m(g)?v:p(v,d(l)?"nofollow":r.nonce));else if(!this.hasAttribute("onClick"))return v=v.split(";",2).shift(),i=decodeURIComponent(this.href),(h=n.createElement("div")).appendChild(n.createTextNode(i)),i=h.innerHTML.replace(/["']/g,function(e){return{'"':"&quot;","'":"&#39;"}[e]}),h="",v=i,(s=t.open()).document.write('<!DOCTYPE html><html><head><meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+v+'" />'+(e("body").hasClass("webview")?'<script>window.location.replace("'+v+'")<\/script>':"")+"</head></html>"),s.document.close(),a.stopImmediatePropagation(),!1}),s.onFirst("submit","form",function(){var t=e(this),n=t.attr("action");1===u(n)&&("post"===(t.attr("method")||"").toLowerCase()?t.attr("action",p(n,r.nonce)):t.append('<input type="hidden" name="'+o.name+'" value="'+r.nonce+'">'))})}(jQuery,window,document);
3
* Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
+ !function(e,t,n){var r=IP_GEO_BLOCK_AUTH,o={init:!1,regexp:new RegExp(r.key+"(?:=|%3D)\\w+")},a=new RegExp("^(?:"+(r.home||"")+r.admin+"|"+(r.home||"")+r.plugins+"|"+(r.home||"")+r.themes+")(?:.*\\.php|.*\\/)?quot;),i=function(e){for(var t=e.length,n="request%5Bbrowse%5D="+r.key;t-- >0;)if(-1!==e[t].indexOf(n)){e[t]="request%5Bbrowse%5D=featured";break}return e},h={"upload.php":function(e){for(var t=e.length,n="query%5B"+r.key+"%5D=";t-- >0;)if(-1!==e[t].indexOf(n)){delete e[t];break}return e},"theme-install.php":i,"network/theme-install.php":i};function s(e){var t=(e=e?e.toString():"").match(/^(?:([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return{scheme:t[1]||"",relative:t[2]||"",authority:t[3]||"",path:t[4]||"",query:t[5]||"",fragment:t[6]||""}}var c,p=function(){var e=null;try{new URL("/","http://example.com/")}catch(t){try{e=(new DOMParser).parseFromString("<html><head></head><body></body></html>","text/html")}catch(t){e=n.implementation.createHTMLDocument("")}}return function(r,o){var a,i,h,s=n;if(r=void 0!==r?r:t.location.href,null===e){void 0===o&&(o=t.location.href);try{h=new URL(r,o)}catch(e){h=new URL(r,t.location.href)}}else{if(void 0!==o){for(s=e;s.head.firstChild;)s.head.removeChild(s.head.firstChild);(a=s.createElement("base")).setAttribute("href",o),s.head.appendChild(a)}(i=s.createElement("a")).setAttribute("href",r),i.setAttribute("href",i.href),"http:"===(h={protocol:i.protocol,host:i.host,hostname:i.hostname,port:i.port,pathname:i.pathname,search:i.search,hash:i.hash,href:i.href,username:"",password:"",origin:i.origin||null}).protocol&&"80"===h.port?(h.port="",h.host=h.host.replace(/:80#x2F;,"")):"https:"===h.protocol&&"443"===h.port&&(h.port="",h.host=h.host.replace(/:443#x2F;,"")),"http:"!==h.protocol&&"https:"!==h.protocol||(h.pathname&&"/"!==h.pathname.charAt(0)&&(h.pathname="/"+h.pathname),h.origin||(h.origin=h.protocol+"//"+h.hostname+(h.port?":"+h.port:"")))}if(h.username||h.password)throw new URIError(h.username+":"+h.password);return h}}();function l(e,n){"object"!=typeof e&&(e=s(e||t.location.href));for(var o=e.query?e.query.split("&"):[],a=o.length,i=r.key+"=";a-- >0;)if(0===o[a].indexOf(i)){o.splice(a,1);break}return o.push(r.key+"="+encodeURIComponent(n)),e.query=o.join("&"),function(e){return(e.scheme?e.scheme+":":"")+(e.relative+e.path)+(e.query?"?"+e.query:"")+(e.fragment?"#"+e.fragment:"")}(e)}function f(e){return(!e.scheme||/^https?#x2F;.test(e.scheme))&&(e.path||e.query)}function u(e){try{e=e||t.location.pathname||""}catch(t){e=""}var n=s(e.toLowerCase());if(f(n)){if((n=p(e)).origin!==t.location.origin)return-1;if((e=a.exec(n.pathname))&&(0<=e[0].indexOf(r.admin+"admin-")||0<=e[0].indexOf(r.admin)||0<=e[0].indexOf(r.plugins)||0<=e[0].indexOf(r.themes)))return 1}return 0}function m(e){return/\/#x2F;.test(e.path)}function d(e){return-1!==(e.attr("rel")||"").indexOf("nofollow")}
7
/*
8
* jQuery.bind-first library v0.2.3 (jquery >= 1.7)
9
* Copyright (c) 2013 Vladimir Zhuravlev
13
*
14
* Date: Thu Feb 6 10:13:59 ICT 2014
15
*/
16
+ function v(t,n,r){var o=e._data(t[0]).events[n],a=r?o.splice(o.delegateCount-1,1)[0]:o.pop();o.splice(r?0:o.delegateCount||0,0,a)}function g(t,n,r){var o=n.split(/\s+/);t.each(function(t){for(t=0;t<o.length;++t){var n=e.trim(o[t]).match(/[^\.]+/i)[0];v(e(this),n,r)}})}function y(){if(!o.init){if(o.init=!0,e("img").each(function(){var t=e(this).attr("src");1===u(t)&&e(this).attr("src",l(t,r.nonce))}),void 0!==t._wpRevisionsSettings){var n,a=t._wpRevisionsSettings.revisionData,i=a.length;for(n=0;n<i;++n)o.regexp.test(a[n].restoreUrl)||(t._wpRevisionsSettings.revisionData[n].restoreUrl=l(a[n].restoreUrl,r.nonce))}e("#toplevel_page_ip-geo-block li.wp-first-item").each(function(){var t=e(this);t.css("display","IP Geo Block"===t.children("a").text()?"none":"block")})}}e.ajaxPrefilter(function(e){if(1===u(e.url)&&!e.url.match(/async-upload\.php#x2F;))if(void 0!==t.FormData&&e.data instanceof FormData)e.data.append(r.key,r.nonce);else{var n,o,a=s(e.url);void 0===e.data||a.query?e.url=l(a,r.nonce):(n=e.data?e.data.split("&"):[],i=(i=t.location.pathname).replace(r.home+r.admin,""),(o=h.hasOwnProperty(i)?h[i]:null)&&(n=o(n)),n.push(r.key+"="+encodeURIComponent(r.nonce)),e.data=n.join("&"))}var i}),void 0===e.fn.onFirst&&(e.fn.onFirst=function(t,n){var r,o=e(this),a="string"==typeof n;if(e.fn.on.apply(o,arguments),"object"==typeof t)for(r in t)t.hasOwnProperty(r)&&g(o,r,a);else"string"==typeof t&&g(o,t,a);return o}),e(t).on("error",function(){y()}),e(function(){y()}),(c=e(n)).onFirst("click contextmenu","a",function(a){var i,h,c=0,p=e(this),v=p.attr("href")||"",g=s(v);if(f(g)&&(c=u(v)),"click"===a.type)if(1===c)p.attr("href",m(g)?v:l(v,d(p)?"nofollow":r.nonce));else if(-1===c&&(1===u(t.location.pathname)||o.regexp(t.location.search)))if("_self"===p.attr("target")||function(e){var t,n,o=r.sites.length;for(t=0;t<o;++t)if(0<=(n=e.indexOf(r.sites[t]+"/"))&&n<=6)return!0;return!1}(v))p.attr("href",m(g)?v:l(v,d(p)?"nofollow":r.nonce));else if(!this.hasAttribute("onClick"))return v=v.split(";",2).shift(),i=decodeURIComponent(this.href),(h=n.createElement("div")).appendChild(n.createTextNode(i)),i=h.innerHTML.replace(/["']/g,function(e){return{'"':"&quot;","'":"&#39;"}[e]}),h="",v=i,(c=t.open()).document.write('<!DOCTYPE html><html><head><meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+v+'" />'+(e("body").hasClass("webview")?'<script>window.location.replace("'+v+'")<\/script>':"")+"</head></html>"),c.document.close(),a.stopImmediatePropagation(),!1}),c.onFirst("submit","form",function(){var t=e(this),n=t.attr("action");1===u(n)&&("post"===(t.attr("method")||"").toLowerCase()?t.attr("action",l(n,r.nonce)):t.append('<input type="hidden" name="'+r.key+'" value="'+r.nonce+'">'))})}(jQuery,window,document);
admin/js/cidr.min.js CHANGED
@@ -1,11 +1,11 @@
1
- /*
2
- Project: IP address range - CIDR converter
3
- Copyright (c) 2018 tokkonopapa (tokkonopapa@yahoo.com)
4
- The following libraries are ported to this program.
5
- - S1lentium/IPTools (https://github.com/S1lentium/IPTools)
6
- - kvz/locutus (https://github.com/kvz/locutus)
7
- - MikeMcl/big.js (https://github.com/MikeMcl/big.js/)
8
- - jQuery (https://jquery.com/)
9
- This software is released under the MIT License.
10
- */
11
(function(B,S,y){function aa(){function a(c){if(!(this instanceof a))return void 0===c?aa():new a(c);if(c instanceof a)this.s=c.s,this.e=c.e,this.c=c.c.slice();else{var b,e;if(0===c&&0>1/c)c="-0";else if(!ia.test(c+=""))throw Error("Invalid number");"-"==c.charAt(0)?(c=c.slice(1),this.s=-1):this.s=1;-1<(b=c.indexOf("."))&&(c=c.replace(".",""));0<(e=c.search(/e/i))?(0>b&&(b=e),b+=+c.slice(e+1),c=c.substring(0,e)):0>b&&(b=c.length);var f=c.length;for(e=0;e<f&&"0"==c.charAt(e);++e);if(e===f)this.c=[this.e=0];else{for(;0<f&&"0"==c.charAt(--f););this.e=b-e-1;this.c=[];for(b=0;e<=f;)this.c[b++]=+c.charAt(e++)}}this.constructor=a}a.prototype=n;a.DP=20;a.RM=1;a.NE=-7;a.PE=21;a.version="5.0.2";return a}function N(a,c,b,e){var f=a.c,g=a.e+c+1;if(g<f.length){if(1===b)e=5<=f[g];else if(2===b)e=5<f[g]||5==f[g]&&(e||0>g||void 0!==f[g+1]||f[g-1]&1);else if(3===b)e=e||void 0!==f[g]||0>g;else if(e=!1,0!==b)throw Error("Invalid rounding mode");if(1>g)f.length=1,e?(a.e=-c,f[0]=1):f[0]=a.e=0;else{f.length=g--;if(e)for(;9<++f[g];)f[g]=0,g--||(++a.e,f.unshift(1));for(g=f.length;!f[--g];)f.pop()}}else if(0>b||3<b||b!==~~b)throw Error("Invalid rounding mode");return a}function J(a,c,b,e){var f=a.constructor,g=!a.c[0];if(void 0!==b){if(b!==~~b||b<(3===c)||1E6<b)throw Error(3===c?"Invalid precision":"Invalid decimal places");a=new f(a);b=e-a.e;a.c.length>++e&&N(a,b,f.RM);for(2===c&&(e=a.e+b+1);a.c.length<e;)a.c.push(0)}var h=a.e;var k=a.c.join("");b=k.length;if(2!==c&&(1===c||3===c&&e<=h||h<=f.NE||h>=f.PE))k=k.charAt(0)+(1<b?"."+k.slice(1):"")+(0>h?"e":"e+")+h;else if(0>h){for(;++h;)k="0"+k;k="0."+k}else if(0<h)if(++h>b)for(h-=b;h--;)k+="0";else h<b&&(k=k.slice(0,h)+"."+k.slice(h));else 1<b&&(k=k.charAt(0)+"."+k.slice(1));return 0>a.s&&(!g||4===c)?"-"+k:k}function ba(a){var c=Object.getPrototypeOf,b={},e=b.toString,f=b.hasOwnProperty;b=f.toString;if(!a||"[object Object]"!==e.call(a))return!1;a=c(a);if(!a)return!0;a=f.call(a,"constructor")&&a.constructor;return"function"===typeof a&&b.call(a)===b.call(Object)}function H(){var a,c,b,e=arguments[0]||{},f=1,g=arguments.length,h=!1;"boolean"===typeof e&&(h=e,e=arguments[f]||{},f++);"object"===typeof e||"function"===typeof e&&"number"!==typeof e.nodeType||(e={});f===g&&(e=this,f--);for(;f<g;f++)if(null!=(a=arguments[f]))for(c in a){var k=e[c];var m=a[c];e!==m&&(h&&m&&(ba(m)||(b=Array.isArray(m)))?(b?(b=!1,k=k&&Array.isArray(k)?k:[]):k=k&&ba(k)?k:{},e[c]=H(h,k,m)):m!==y&&(e[c]=m))}return e}function O(a,c){return p(a).plus(c)}function ca(){var a=/%%|%(?:(\d+)\$)?((?:[-+#0 ]|'[\s\S])*)(\d+)?(?:\.(\d*))?([\s\S])/g,c=arguments,b=0,e=c[b++],f=function(a,b,c,e){c||(c=" ");b=a.length>=b?"":Array(1+b-a.length>>>0).join(c);return e?a+b:b+a},g=function(a,b,c,e,g){var h=e-a.length;0<h&&(a=c||"0"!==g?f(a,e,g,c):[a.slice(0,b.length),f("",h,"0",!0),a.slice(b.length)].join(""));return a},h=function(a,b,c,e,h,k){a=f((a>>>0).toString(b),h||0,"0",!1);return g(a,"",c,e,k)},k=function(a,b,c,e,f){null!==e&&e!==y&&(a=a.slice(0,e));return g(a,"",b,c,f)},m=function(a,e,m,l,n,t){if("%%"===a)return"%";a=" ";var D=!1;var p="";var u;var F=0;for(u=m.length;F<u;F++)switch(m.charAt(F)){case " ":case "0":a=m.charAt(F);break;case "+":p="+";break;case "-":D=!0;break;case "'":F+1<u&&(a=m.charAt(F+1),F++)}l=l?+l:0;if(!isFinite(l))throw Error("Width must be finite");n=n?+n:"d"===t?0:-1<"fFeE".indexOf(t)?6:y;if(e&&0===+e)throw Error("Argument number must be greater than zero");if(e&&+e>=c.length)throw Error("Too few arguments");e=e?c[+e]:c[b++];switch(t){case "%":return"%";case "s":return k(e+"",D,l,n,a);case "c":return k(String.fromCharCode(+e),D,l,n,a);case "b":return h(e,2,D,l,n,a);case "o":return h(e,8,D,l,n,a);case "x":return h(e,16,D,l,n,a);case "X":return h(e,16,D,l,n,a).toUpperCase();case "u":return h(e,10,D,l,n,a);case "i":case "d":return e=+e||0,e=Math.round(e-e%1),p=0>e?"-":p,e=p+f(String(Math.abs(e)),n,"0",!1),D&&"0"===a&&(a=" "),g(e,p,D,l,a);case "e":case "E":case "f":case "F":case "g":case "G":return e=+e,p=0>e?"-":p,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(t.toLowerCase())],t=["toString","toUpperCase"]["eEfFgG".indexOf(t)%2],e=p+Math.abs(e)[m](n),g(e,p,D,l,a)[t]();default:return""}};try{return e.replace(a,m)}catch(D){return!1}}function da(){var a=arguments,c=a.length,b=0;if(0===c)throw Error("Empty isset");for(;b!==c;){if(a[b]===y||null===a[b])return!1;b++}return!0}function ea(a){return("number"===typeof a||"string"===typeof a&&-1===" \n\r\t\f\x0B\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000".indexOf(a.slice(-1)))&&""!==a&&!isNaN(a)}function v(a,c){return a===c?0:a>c?1:-1}function E(a,c,b){a=(a+"").indexOf(c,b||0);return-1===a?!1:a}function K(a,c,b){a+="";var e=a.length;0>c&&(c+=e);b!==y&&(e=0>b?b+e:b+c);return c>=a.length||0>c||c>e?!1:a.slice(c,e)}function T(a,c){var b,e=0;if(null===a||a===y)return 0;if(a.constructor!==Array&&a.constructor!