IP Geo Block - Version 3.0.6.1

Version Description

Sorry for frequent update but the following bug should be fixed. * Bug fix: Fix the bug that "Candidate actions/pages" at "Exceptions" in "Admin ajax/post" were not displayed.

Download this release

Release Info

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

Code changes from version 3.0.5 to 3.0.6.1

Files changed (47) hide show
  1. README.md +0 -58
  2. README.txt +17 -2
  3. admin/class-ip-geo-block-admin.php +55 -45
  4. admin/css/admin-icons.css +20 -8
  5. admin/css/admin-icons.min.css +1 -1
  6. admin/css/admin.css +148 -150
  7. admin/css/admin.min.css +2 -2
  8. admin/css/fonts/icomoon.eot +0 -0
  9. admin/css/fonts/icomoon.svg +1 -1
  10. admin/css/fonts/icomoon.ttf +0 -0
  11. admin/css/fonts/icomoon.woff +0 -0
  12. admin/images/alert.png +0 -0
  13. admin/images/find.png +0 -0
  14. admin/includes/class-admin-ajax.php +91 -7
  15. admin/includes/class-admin-rewrite.php +73 -17
  16. admin/includes/tab-accesslog.php +3 -3
  17. admin/includes/tab-settings.php +66 -40
  18. admin/includes/tab-statistics.php +25 -24
  19. admin/js/admin.js +180 -88
  20. admin/js/admin.min.js +2 -2
  21. admin/js/authenticate.js +25 -25
  22. admin/js/authenticate.min.js +2 -2
  23. admin/js/gmap.js +1 -1
  24. admin/js/gmap.min.js +1 -1
  25. classes/class-ip-geo-block-actv.php +1 -1
  26. classes/class-ip-geo-block-apis.php +1 -1
  27. classes/class-ip-geo-block-cron.php +1 -1
  28. classes/class-ip-geo-block-file.php +7 -9
  29. classes/class-ip-geo-block-lkup.php +1 -1
  30. classes/class-ip-geo-block-load.php +1 -1
  31. classes/class-ip-geo-block-logs.php +27 -7
  32. classes/class-ip-geo-block-opts.php +2 -2
  33. classes/class-ip-geo-block-util.php +4 -4
  34. classes/class-ip-geo-block.php +21 -19
  35. ip-geo-block.php +2 -2
  36. languages/ip-geo-block-ja.mo +0 -0
  37. languages/ip-geo-block-ja.po +308 -269
  38. languages/ip-geo-block.mo +0 -0
  39. languages/ip-geo-block.po +281 -244
  40. languages/ip-geo-block.pot +284 -245
  41. rewrite-ini.php +75 -0
  42. rewrite.php +2 -2
  43. samples.php +3 -4
  44. uninstall.php +1 -1
  45. wp-content/ip-geo-api/ip2location/class-ip2location.php +1 -1
  46. wp-content/ip-geo-api/maxmind/class-maxmind.php +1 -1
  47. wp-content/mu-plugins/ip-geo-block-mu.php +1 -1
README.md DELETED
@@ -1,58 +0,0 @@
1
- IP Geo Block
2
- ==============
3
-
4
- ### Description:
5
-
6
- It blocks any spams, login attempts and malicious access to the admin area
7
- posted from the specific countries, and also prevents zero-day exploit.
8
-
9
- See more detail at [WordPress.org][IPGB].
10
-
11
- ### Dependency:
12
-
13
- [IP Geo API 1.1.6][IPGeoAPI]
14
-
15
- ### Requirement:
16
-
17
- - WordPress 3.7+
18
-
19
- ### Attribution:
20
-
21
- This package includes GeoLite data created by MaxMind, available from
22
- [MaxMind][MaxMind],
23
- and also includes IP2Location open source libraries available from
24
- [IP2Location][IP2Loc].
25
-
26
- Also thanks for providing the following great services and REST APIs for free.
27
-
28
- Provider | Supported type | Licence
29
- ---------------------------------------|----------------|--------
30
- [http://freegeoip.net/] [freegeoip] | IPv4, IPv6 | free
31
- [http://ipinfo.io/] [ipinfo] | IPv4, IPv6 | free
32
- [http://geoip.nekudo.com/] [Nekudo] | IPv4, IPv6 | free
33
- [http://xhanch.com/] [Xhanch] | IPv4 | free
34
- [http://www.geoplugin.com/][geoplugin] | IPv4, IPv6 | free, need an attribution link
35
- [http://geoiplookup.net/] [geoiplkup] | IPv4, IPv6 | free
36
- [http://ip-api.com/] [ipapi] | IPv4, IPv6 | free for non-commercial use
37
- [http://ipinfodb.com/] [IPInfoDB] | IPv4, IPv6 | free for registered user
38
-
39
- ### License:
40
-
41
- This plugin is licensed under the GPL v2 or later.
42
-
43
- [IPGB]: https://wordpress.org/plugins/ip-geo-block/ "IP Geo Block — WordPress Plugins"
44
- [freegeoip]: http://freegeoip.net/ "freegeoip.net: FREE IP Geolocation Web Service"
45
- [ipinfo]: http://ipinfo.io/ "ipinfo.io - ip address information including geolocation, hostname and network details"
46
- [Telize]: http://www.telize.com/ "Telize - JSON IP and GeoIP REST API"
47
- [IPJson]: http://ip-json.rhcloud.com/ "Free IP Geolocation Web Service"
48
- [Pycox]: http://ip.pycox.com/ "Free IP Geolocation Web Service"
49
- [Nekudo]: http://geoip.nekudo.com/ "eoip.nekudo.com | Free IP geolocation API"
50
- [Xhanch]: http://xhanch.com/xhanch-api-ip-get-detail/ "Xhanch API - IP Get Detail | Xhanch Studio"
51
- [geoplugin]: http://www.geoplugin.com/ "geoPlugin to geolocate your visitors"
52
- [ipapi]: http://ip-api.com/ "IP-API.com - Free Geolocation API"
53
- [IPInfoDB]: http://ipinfodb.com/ "IPInfoDB | Free IP Address Geolocation Tools"
54
- [MaxMind]: http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention"
55
- [IP2Loc]: http://www.ip2location.com "IP Address Geolocation to Identify Website Visitor's Geographical Location"
56
- [Cache]: http://www.designbombs.com/top-wordpress-caching-plugins-compared/ "Top 6 Fastest WordPress Caching Plugins Compared (2016 Edition)"
57
- [IPGeoAPI]: https://github.com/tokkonopapa/WordPress-IP-Geo-API "GitHub - tokkonopapa/WordPress-IP-Geo-API: A class library combined with WordPress plugin IP Geo Block to handle geo-location database of Maxmind and IP2Location."
58
- [geoiplkup]: http://geoiplookup.net/ "What Is My IP Address | GeoIP Lookup"
README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: tokkonopapa
3
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
7
- Stable tag: 3.0.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -352,6 +352,21 @@ Please refer to "[How can I fix permission troubles?](http://www.ipgeoblock.com/
352
353
== Changelog ==
354
355
= 3.0.5 =
356
* **New feature:** Add "Live update" mode on "Logs" tab.
357
* **Improvement:** List all the IP addresses in cache are now displayed and manageable on "Statistics" tab.
3
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.1
7
+ Stable tag: 3.0.6.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
352
353
== Changelog ==
354
355
+ = 3.0.6.1 =
356
+ Sorry for frequent update but the following bug should be fixed.
357
+ * **Bug fix:** Fix the bug that "Candidate actions/pages" at "Exceptions" in "Admin ajax/post" were not displayed.
358
+
359
+ = 3.0.6 =
360
+ * **New feature:** Add "Find blocked requests in Logs" button at "Exceptions". This helps to find a solution related to the incompatibility with unwanted blocking.
361
+ * **Improvement:** Support nginx for "Force to load WP core" at "Plugins area" / "Themes area".
362
+ * **Improvement:** Improve the extraction ability and verifiability of "Slug in back-end".
363
+ * **Improvement:** Add a new result "UAlist" that indicate a request is blocked by "UA string and qualification" in "Front-end target settings" section.
364
+ * **Improvement:** Improve responsiveness of live update control button on windows system.
365
+ * **Bug fix:** Fix the bug using php short open tag on "Logs" tab.
366
+ * **Bug fix:** Fix the bug related to absolute path in filesystem on windows system.
367
+ * **Bug fix:** Fix the issue that "Auto updating (once a month)" could not be disabled.
368
+ * See [3.0.6 release note](http://www.ipgeoblock.com/changelog/release-3.0.6.html "3.0.6 Release Note | IP Geo Block") for some details.
369
+
370
= 3.0.5 =
371
* **New feature:** Add "Live update" mode on "Logs" tab.
372
* **Improvement:** List all the IP addresses in cache are now displayed and manageable on "Statistics" tab.
admin/class-ip-geo-block-admin.php CHANGED
@@ -6,7 +6,7 @@
6
* @author tokkonopapa <tokkonopapa@yahoo.com>
7
* @license GPL-2.0+
8
* @link http://www.ipgeoblock.com/
9
- * @copyright 2013-2017 tokkonopapa
10
*/
11
12
class IP_Geo_Block_Admin {
@@ -178,14 +178,14 @@ class IP_Geo_Block_Admin {
178
* @see https://developers.google.com/maps/faq#china_ws_access
179
*/
180
public function enqueue_admin_assets() {
181
$footer = TRUE;
182
$dependency = array( 'jquery' );
183
- $version = ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
184
- IP_Geo_Block::VERSION :
185
- max(
186
- filemtime( plugin_dir_path( __FILE__ ) . 'css/admin.css' ),
187
- filemtime( plugin_dir_path( __FILE__ ) . 'js/admin.js' )
188
- );
189
190
switch ( $this->admin_tab ) {
191
case 1: /* Statistics */
@@ -217,9 +217,7 @@ class IP_Geo_Block_Admin {
217
$settings = IP_Geo_Block::get_option();
218
if ( $key = $settings['api_key']['GoogleMap'] ) {
219
wp_enqueue_script( IP_Geo_Block::PLUGIN_NAME . '-gmap-js',
220
- plugins_url( ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
221
- 'js/gmap.min.js' : 'js/gmap.js', __FILE__
222
- ),
223
$dependency, IP_Geo_Block::VERSION, $footer
224
);
225
wp_enqueue_script( IP_Geo_Block::PLUGIN_NAME . '-google-map',
@@ -229,34 +227,25 @@ class IP_Geo_Block_Admin {
229
);
230
}
231
wp_enqueue_script( IP_Geo_Block::PLUGIN_NAME . '-whois-js',
232
- plugins_url( ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
233
- 'js/whois.min.js' : 'js/whois.js', __FILE__
234
- ),
235
$dependency, IP_Geo_Block::VERSION, $footer
236
);
237
- break;
238
}
239
240
// css for option page
241
wp_enqueue_style( IP_Geo_Block::PLUGIN_NAME . '-admin-icons',
242
- plugins_url( ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
243
- 'css/admin-icons.min.css' : 'css/admin-icons.css', __FILE__
244
- ),
245
array(), IP_Geo_Block::VERSION
246
);
247
wp_enqueue_style( IP_Geo_Block::PLUGIN_NAME . '-admin-styles',
248
- plugins_url( ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
249
- 'css/admin.min.css' : 'css/admin.css', __FILE__
250
- ),
251
array(), $version
252
);
253
254
// js for IP Geo Block admin page
255
wp_register_script(
256
$handle = IP_Geo_Block::PLUGIN_NAME . '-admin-script',
257
- plugins_url( ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
258
- 'js/admin.min.js' : 'js/admin.js', __FILE__
259
- ),
260
$dependency + ( isset( $addon ) ? array( $addon ) : array() ),
261
$version, $footer
262
);
@@ -276,8 +265,11 @@ class IP_Geo_Block_Admin {
276
/* [ 5] */ __( 'Clear logs ?', 'ip-geo-block' ),
277
/* [ 6] */ __( 'ajax for logged-in user', 'ip-geo-block' ),
278
/* [ 7] */ __( 'ajax for non logged-in user', 'ip-geo-block' ),
279
- /* [ 8] */ __( 'This feature is available with HTML5 compliant browsers.', 'ip-geo-block' ),
280
- /* [ 9] */ __( 'The selected row cannot be found in the visible area.', 'ip-geo-block' ),
281
),
282
'i18n' => array(
283
/* [ 0] */ '<div class="ip-geo-block-loading"></div>',
@@ -299,6 +291,7 @@ class IP_Geo_Block_Admin {
299
),
300
'interval' => self::INTERVAL_LIVE_UPDATE, // interval for live update [sec]
301
'timeout' => self::TIMEOUT_LIVE_UPDATE, // timeout of pausing live update [sec]
302
)
303
);
304
wp_enqueue_script( $handle );
@@ -400,8 +393,8 @@ class IP_Geo_Block_Admin {
400
}
401
402
if ( $admin_menu ) {
403
- // `settings-updated` would be added when `network_wide` is saved as TRUE
404
- if ( $this->is_network && isset( $_REQUEST['settings-updated'] ) ) {
405
$this->sync_multisite_option( $settings );
406
wp_safe_redirect(
407
esc_url_raw( add_query_arg(
@@ -660,7 +653,7 @@ class IP_Geo_Block_Admin {
660
661
if ( $this->is_network ) {
662
unset( $tabs[0], $tabs[5] ); // Settings, Site List
663
- $title .= ' <span class="ip-geo-block-title-link">';
664
$title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 0 ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Settings', 'ip-geo-block' ) . '</a> ]';
665
$title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 5 ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Site List', 'ip-geo-block' ) . '</a> ]';
666
$title .= '</span>';
@@ -672,7 +665,7 @@ class IP_Geo_Block_Admin {
672
673
if ( $settings['network_wide'] ) {
674
unset( $tabs[1], $tabs[4], $tabs[2], $tabs[3] ); // Statistics, Logs, Search, Attribution
675
- $title .= ' <span class="ip-geo-block-title-link">';
676
$title .= '[ ' . __( 'Network wide', 'ip-geo-block' ) . ' ]';
677
$title .= '</span>';
678
}
@@ -688,11 +681,11 @@ class IP_Geo_Block_Admin {
688
</h2>
689
<p style="text-align:left">[ <a id="ip-geo-block-toggle-sections" href="#!"><?php _e( 'Toggle all', 'ip-geo-block' ); ?></a> ]
690
<?php if ( 4 === $tab ) { /* Logs tab */ ?>
691
- <input id="ip-geo-block-live-update" type="checkbox"<? checked( isset( $cookie[4][1] ) && 'o' === $cookie[4][1] ); disabled( extension_loaded( 'pdo_sqlite' ), FALSE ); ?> /><label for="ip-geo-block-live-update">
692
<dfn title="<?php _e( 'Independent of &#8220;Statistics and Logs 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>
693
</label>
694
<?php } elseif (5 === $tab ) { /* Site List tab */ ?>
695
- <input id="ip-geo-block-open-new" type="checkbox"<? checked( isset( $cookie[5][1] ) && 'o' === $cookie[5][1] );?> /><label for="ip-geo-block-open-new">
696
<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>
697
</label>
698
<?php } ?></p>
@@ -1069,8 +1062,8 @@ class IP_Geo_Block_Admin {
1069
$output['public'][ $key ] = array();
1070
}
1071
1072
- // 3.0.4 AS number
1073
- $output['Maxmind']['use_asn'] = FALSE;
1074
1075
// 3.0.5 Live update
1076
$output['live_update']['in_memory'] = 0;
@@ -1288,9 +1281,12 @@ class IP_Geo_Block_Admin {
1288
1289
require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php';
1290
1291
$settings = IP_Geo_Block::get_option();
1292
$which = isset( $_POST['which'] ) ? $_POST['which'] : NULL;
1293
- switch ( isset( $_POST['cmd' ] ) ? $_POST['cmd' ] : NULL ) {
1294
case 'download':
1295
$res = IP_Geo_Block::get_instance();
1296
$res = $res->exec_update_db();
@@ -1326,8 +1322,6 @@ class IP_Geo_Block_Admin {
1326
1327
case 'clear-logs':
1328
// Delete logs in MySQL DB
1329
- $hook = array( 'comment', 'login', 'admin', 'xmlrpc', 'public' );
1330
- $which = in_array( $which, $hook ) ? $which : NULL;
1331
IP_Geo_Block_Logs::clear_logs( $which );
1332
$res = array(
1333
'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
@@ -1382,6 +1376,11 @@ class IP_Geo_Block_Admin {
1382
$res = IP_Geo_Block_Util::get_registered_actions( TRUE );
1383
break;
1384
1385
case 'restore-cache':
1386
// Restore cache from database and format for DataTables
1387
$res = IP_Geo_Block_Admin_Ajax::restore_cache( $which );
@@ -1389,7 +1388,7 @@ class IP_Geo_Block_Admin {
1389
1390
case 'bulk-action-remove':
1391
// Delete specified IP addresses from cache
1392
- $res = IP_Geo_Block_Logs::delete_cache_entry( $which['IP'] );
1393
break;
1394
1395
case 'bulk-action-ip-white':
@@ -1397,21 +1396,25 @@ class IP_Geo_Block_Admin {
1397
case 'bulk-action-as-white':
1398
case 'bulk-action-as-black':
1399
// Bulk actions for registration of settings
1400
- $src = ( FALSE !== strpos( $_POST['cmd'], '-ip-' ) ? 'IP' : 'AS' );
1401
- $dst = ( FALSE !== strpos( $_POST['cmd'], '-white' ) ? 'white_list' : 'black_list' );
1402
1403
- if ( empty( $which[ $src ] ) )
1404
break;
1405
1406
- foreach ( array_unique( $which[ $src ] ) as $val ) {
1407
// replace anonymized IP address with CIDR (IPv4:256, IPv6:4096)
1408
$val = preg_replace(
1409
- array( '!\.\*\*\*!', '!\*\*\*!', '![^\w\.:/]!' ),
1410
- array( '.0/24', '000/116', '' ),
1411
$val
1412
);
1413
- if ( FALSE === strpos( $settings['extra_ips'][ $dst ], $val ) )
1414
$settings['extra_ips'][ $dst ] .= "\n" . $val;
1415
}
1416
1417
if ( $settings['network_wide'] && is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) )
@@ -1458,10 +1461,17 @@ class IP_Geo_Block_Admin {
1458
$res = IP_Geo_Block_Admin_Ajax::reset_live_log();
1459
break;
1460
1461
case 'create-table':
1462
case 'delete-table':
1463
// Need to define `IP_GEO_BLOCK_DEBUG` to true
1464
- if ( 'create-table' === $_POST['cmd'] )
1465
IP_Geo_Block_Logs::create_tables();
1466
else
1467
IP_Geo_Block_Logs::delete_tables();
6
* @author tokkonopapa <tokkonopapa@yahoo.com>
7
* @license GPL-2.0+
8
* @link http://www.ipgeoblock.com/
9
+ * @copyright 2013-2018 tokkonopapa
10
*/
11
12
class IP_Geo_Block_Admin {
178
* @see https://developers.google.com/maps/faq#china_ws_access
179
*/
180
public function enqueue_admin_assets() {
181
+ $release = ( ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG );
182
+
183
$footer = TRUE;
184
$dependency = array( 'jquery' );
185
+ $version = $release ? IP_Geo_Block::VERSION : max(
186
+ filemtime( plugin_dir_path( __FILE__ ) . 'css/admin.css' ),
187
+ filemtime( plugin_dir_path( __FILE__ ) . 'js/admin.js' )
188
+ );
189
190
switch ( $this->admin_tab ) {
191
case 1: /* Statistics */
217
$settings = IP_Geo_Block::get_option();
218
if ( $key = $settings['api_key']['GoogleMap'] ) {
219
wp_enqueue_script( IP_Geo_Block::PLUGIN_NAME . '-gmap-js',
220
+ plugins_url( $release ? 'js/gmap.min.js' : 'js/gmap.js', __FILE__ ),
221
$dependency, IP_Geo_Block::VERSION, $footer
222
);
223
wp_enqueue_script( IP_Geo_Block::PLUGIN_NAME . '-google-map',
227
);
228
}
229
wp_enqueue_script( IP_Geo_Block::PLUGIN_NAME . '-whois-js',
230
+ plugins_url( $release ? 'js/whois.min.js' : 'js/whois.js', __FILE__ ),
231
$dependency, IP_Geo_Block::VERSION, $footer
232
);
233
}
234
235
// css for option page
236
wp_enqueue_style( IP_Geo_Block::PLUGIN_NAME . '-admin-icons',
237
+ plugins_url( $release ? 'css/admin-icons.min.css' : 'css/admin-icons.css', __FILE__ ),
238
array(), IP_Geo_Block::VERSION
239
);
240
wp_enqueue_style( IP_Geo_Block::PLUGIN_NAME . '-admin-styles',
241
+ plugins_url( $release ? 'css/admin.min.css' : 'css/admin.css', __FILE__ ),
242
array(), $version
243
);
244
245
// js for IP Geo Block admin page
246
wp_register_script(
247
$handle = IP_Geo_Block::PLUGIN_NAME . '-admin-script',
248
+ plugins_url( $release ? 'js/admin.min.js' : 'js/admin.js', __FILE__ ),
249
$dependency + ( isset( $addon ) ? array( $addon ) : array() ),
250
$version, $footer
251
);
265
/* [ 5] */ __( 'Clear logs ?', 'ip-geo-block' ),
266
/* [ 6] */ __( 'ajax for logged-in user', 'ip-geo-block' ),
267
/* [ 7] */ __( 'ajax for non logged-in user', 'ip-geo-block' ),
268
+ /* [ 8] */ __( '[Found: %d]', 'ip-geo-block' ),
269
+ /* [ 9] */ __( 'Find and verify `%s` on &#8220;Logs&#8221; tab.', 'ip-geo-block' ),
270
+ /* [10] */ __( 'This feature is available with HTML5 compliant browsers.', 'ip-geo-block' ),
271
+ /* [11] */ __( 'The selected row cannot be found in the visible area.', 'ip-geo-block' ),
272
+ /* [12] */ __( 'An error occurred while executing the ajax command `%s`.', 'ip-geo-block' ),
273
),
274
'i18n' => array(
275
/* [ 0] */ '<div class="ip-geo-block-loading"></div>',
291
),
292
'interval' => self::INTERVAL_LIVE_UPDATE, // interval for live update [sec]
293
'timeout' => self::TIMEOUT_LIVE_UPDATE, // timeout of pausing live update [sec]
294
+ 'altgmap' => apply_filters( 'google-maps-nokey', '//maps.google.com/maps' ),
295
)
296
);
297
wp_enqueue_script( $handle );
393
}
394
395
if ( $admin_menu ) {
396
+ // `settings-updated` would be added just after settings updated.
397
+ if ( ! empty( $_REQUEST['settings-updated'] ) && $this->is_network ) {
398
$this->sync_multisite_option( $settings );
399
wp_safe_redirect(
400
esc_url_raw( add_query_arg(
653
654
if ( $this->is_network ) {
655
unset( $tabs[0], $tabs[5] ); // Settings, Site List
656
+ $title .= ' <span class="ip-geo-block-menu-link">';
657
$title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 0 ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Settings', 'ip-geo-block' ) . '</a> ]';
658
$title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 5 ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Site List', 'ip-geo-block' ) . '</a> ]';
659
$title .= '</span>';
665
666
if ( $settings['network_wide'] ) {
667
unset( $tabs[1], $tabs[4], $tabs[2], $tabs[3] ); // Statistics, Logs, Search, Attribution
668
+ $title .= ' <span class="ip-geo-block-menu-link">';
669
$title .= '[ ' . __( 'Network wide', 'ip-geo-block' ) . ' ]';
670
$title .= '</span>';
671
}
681
</h2>
682
<p style="text-align:left">[ <a id="ip-geo-block-toggle-sections" href="#!"><?php _e( 'Toggle all', 'ip-geo-block' ); ?></a> ]
683
<?php if ( 4 === $tab ) { /* Logs tab */ ?>
684
+ <input id="ip-geo-block-live-update" type="checkbox"<?php checked( isset( $cookie[4][1] ) && 'o' === $cookie[4][1] ); disabled( extension_loaded( 'pdo_sqlite' ), FALSE ); ?> /><label for="ip-geo-block-live-update">
685
<dfn title="<?php _e( 'Independent of &#8220;Statistics and Logs 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>
686
</label>
687
<?php } elseif (5 === $tab ) { /* Site List tab */ ?>
688
+ <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">
689
<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>
690
</label>
691
<?php } ?></p>
1062
$output['public'][ $key ] = array();
1063
}
1064
1065
+ // 3.0.4 AS number, 3.0.6 Auto updating of DB files
1066
+ $output['Maxmind']['use_asn'] = $output['update']['auto'] = FALSE;
1067
1068
// 3.0.5 Live update
1069
$output['live_update']['in_memory'] = 0;
1281
1282
require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php';
1283
1284
+ // `$which` and `$cmd` should be restricted by whitelist in each function
1285
$settings = IP_Geo_Block::get_option();
1286
$which = isset( $_POST['which'] ) ? $_POST['which'] : NULL;
1287
+ $cmd = isset( $_POST['cmd' ] ) ? $_POST['cmd' ] : NULL;
1288
+
1289
+ switch ( $cmd ) {
1290
case 'download':
1291
$res = IP_Geo_Block::get_instance();
1292
$res = $res->exec_update_db();
1322
1323
case 'clear-logs':
1324
// Delete logs in MySQL DB
1325
IP_Geo_Block_Logs::clear_logs( $which );
1326
$res = array(
1327
'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
1376
$res = IP_Geo_Block_Util::get_registered_actions( TRUE );
1377
break;
1378
1379
+ case 'get-blocked':
1380
+ // Get blocked actions and pages
1381
+ $res = IP_Geo_Block_Admin_Ajax::get_blocked_queries( $which );
1382
+ break;
1383
+
1384
case 'restore-cache':
1385
// Restore cache from database and format for DataTables
1386
$res = IP_Geo_Block_Admin_Ajax::restore_cache( $which );
1388
1389
case 'bulk-action-remove':
1390
// Delete specified IP addresses from cache
1391
+ $res = IP_Geo_Block_Logs::delete_cache_entry( @$which['IP'] );
1392
break;
1393
1394
case 'bulk-action-ip-white':
1396
case 'bulk-action-as-white':
1397
case 'bulk-action-as-black':
1398
// Bulk actions for registration of settings
1399
+ $src = ( FALSE !== strpos( $cmd, '-ip-' ) ? 'IP' : 'AS' );
1400
+ $dst = ( FALSE !== strpos( $cmd, '-white' ) ? 'white_list' : 'black_list' );
1401
1402
+ if ( empty( $which[ $src ] ) ) {
1403
+ $res = array( 'error' => sprintf( __( 'An error occurred while executing the ajax command `%s`.', 'ip-geo-block' ), $cmd ) );
1404
break;
1405
+ }
1406
1407
+ foreach ( array_unique( (array)$which[ $src ] ) as $val ) {
1408
// replace anonymized IP address with CIDR (IPv4:256, IPv6:4096)
1409
$val = preg_replace(
1410
+ array( '!\.\*\*\*$!', '!\*\*\*$!' ),
1411
+ array( '.0/24', '000/116' ),
1412
$val
1413
);
1414
+ if ( ( filter_var( preg_replace( '!/\d+$!', '', $val ), FILTER_VALIDATE_IP ) || preg_match( '^AS\d+#x27;, $val ) ) &&
1415
+ ( FALSE === strpos( $settings['extra_ips'][ $dst ], $val ) ) ) {
1416
$settings['extra_ips'][ $dst ] .= "\n" . $val;
1417
+ }
1418
}
1419
1420
if ( $settings['network_wide'] && is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) )
1461
$res = IP_Geo_Block_Admin_Ajax::reset_live_log();
1462
break;
1463
1464
+ case 'find-admin':
1465
+ case 'find-plugins':
1466
+ case 'find-themes':
1467
+ // Get slug in blocked requests for exceptions
1468
+ $res = IP_Geo_Block_Admin_Ajax::find_exceptions( $cmd );
1469
+ break;
1470
+
1471
case 'create-table':
1472
case 'delete-table':
1473
// Need to define `IP_GEO_BLOCK_DEBUG` to true
1474
+ if ( 'create-table' === $cmd )
1475
IP_Geo_Block_Logs::create_tables();
1476
else
1477
IP_Geo_Block_Logs::delete_tables();
admin/css/admin-icons.css CHANGED
@@ -1,11 +1,11 @@
1
/*! IP Geo Block admin icons */
2
@font-face {
3
font-family: 'icomoon';
4
- src: url('fonts/icomoon.eot?9y580b');
5
- src: url('fonts/icomoon.eot?9y580b#iefix') format('embedded-opentype'),
6
- url('fonts/icomoon.ttf?9y580b') format('truetype'),
7
- url('fonts/icomoon.woff?9y580b') format('woff'),
8
- url('fonts/icomoon.svg?9y580b#icomoon') format('svg');
9
font-weight: normal;
10
font-style: normal;
11
}
@@ -24,18 +24,30 @@
24
-moz-osx-font-smoothing: grayscale;
25
}
26
27
- .ip-geo-block-icon-play3:before {
28
content: "\ea1c";
29
}
30
- .ip-geo-block-icon-pause2:before {
31
content: "\ea1d";
32
}
33
- .ip-geo-block-icon-stop2:before {
34
content: "\ea1e";
35
}
36
37
#toplevel_page_ip-geo-block .dashicons-admin-generic:before {
38
font-family: 'icomoon';
39
content: "\e9c9";
40
font-size: 18px;
41
}
1
/*! IP Geo Block admin icons */
2
@font-face {
3
font-family: 'icomoon';
4
+ src: url('fonts/icomoon.eot?astkh8');
5
+ src: url('fonts/icomoon.eot?astkh8#iefix') format('embedded-opentype'),
6
+ url('fonts/icomoon.ttf?astkh8') format('truetype'),
7
+ url('fonts/icomoon.woff?astkh8') format('woff'),
8
+ url('fonts/icomoon.svg?astkh8#icomoon') format('svg');
9
font-weight: normal;
10
font-style: normal;
11
}
24
-moz-osx-font-smoothing: grayscale;
25
}
26
27
+ .ip-geo-block-icon-play:before {
28
content: "\ea1c";
29
}
30
+ .ip-geo-block-icon-pause:before {
31
content: "\ea1d";
32
}
33
+ .ip-geo-block-icon-stop:before {
34
content: "\ea1e";
35
}
36
+ .ip-geo-block-icon-warn:before {
37
+ content: "\ea07";
38
+ color: #c43322;
39
+ }
40
41
#toplevel_page_ip-geo-block .dashicons-admin-generic:before {
42
font-family: 'icomoon';
43
content: "\e9c9";
44
font-size: 18px;
45
}
46
+ /*#toplevel_page_ip-geo-block .dashicons-admin-generic:after {
47
+ font-family: 'icomoon';
48
+ content: "\e9b4";
49
+ font-size: 10px;
50
+ position: absolute;
51
+ top: 1.4em;
52
+ left: 2em;
53
+ }*/
admin/css/admin-icons.min.css CHANGED
@@ -1,2 +1,2 @@
1
/*! IP Geo Block admin icons */
2
- @font-face{font-family:icomoon;src:url(fonts/icomoon.eot?9y580b);src:url(fonts/icomoon.eot?9y580b#iefix) format('embedded-opentype'),url(fonts/icomoon.ttf?9y580b) format('truetype'),url(fonts/icomoon.woff?9y580b) format('woff'),url(fonts/icomoon.svg?9y580b#icomoon) format('svg');font-weight:400;font-style:normal}[class*=" ip-geo-block-icon-"],[class^=ip-geo-block-icon-]{font-family:icomoon!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ip-geo-block-icon-play3:before{content:"\ea1c"}.ip-geo-block-icon-pause2:before{content:"\ea1d"}.ip-geo-block-icon-stop2:before{content:"\ea1e"}#toplevel_page_ip-geo-block .dashicons-admin-generic:before{font-family:icomoon;content:"\e9c9";font-size:18px}
1
/*! IP Geo Block admin icons */
2
+ @font-face{font-family:icomoon;src:url(fonts/icomoon.eot?astkh8);src:url(fonts/icomoon.eot?astkh8#iefix) format('embedded-opentype'),url(fonts/icomoon.ttf?astkh8) format('truetype'),url(fonts/icomoon.woff?astkh8) format('woff'),url(fonts/icomoon.svg?astkh8#icomoon) format('svg');font-weight:400;font-style:normal}[class*=" ip-geo-block-icon-"],[class^=ip-geo-block-icon-]{font-family:icomoon!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ip-geo-block-icon-play:before{content:"\ea1c"}.ip-geo-block-icon-pause:before{content:"\ea1d"}.ip-geo-block-icon-stop:before{content:"\ea1e"}.ip-geo-block-icon-warn:before{content:"\ea07";color:#c43322}#toplevel_page_ip-geo-block .dashicons-admin-generic:before{font-family:icomoon;content:"\e9c9";font-size:18px}
admin/css/admin.css CHANGED
@@ -1,6 +1,6 @@
1
/*!
2
* Project: WordPress IP Geo Block
3
- * Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
dfn {
@@ -72,6 +72,9 @@ fieldset.ip-geo-block-field h3 {
72
margin: 0;
73
font-size: 14px !important;
74
}
75
fieldset.ip-geo-block-field legend.panel-heading {
76
padding: 10px;
77
}
@@ -100,34 +103,39 @@ fieldset.ip-geo-block-field .ip-geo-block-dropdown:before {
100
left: -2px;
101
top: 38%;
102
}
103
fieldset.ip-geo-block-field ul.ip-geo-block-dropup:before {
104
top: 0.25em;
105
}
106
fieldset.ip-geo-block-field ul.ip-geo-block-dropdown:before {
107
- top: 0.45em;
108
}
109
fieldset.ip-geo-block-field table.form-table {
110
margin: 0 0 0.5em;
111
width: 100%;
112
}
113
- fieldset.ip-geo-block-field .ip-geo-block-desc {
114
- color: #666;
115
- font-size: 13px !important;
116
- /* font-style: italic;*/
117
- }
118
119
textarea.regular-text {
120
width: 25em;
121
}
122
123
- ul.ip-geo-block-settings-folding {
124
margin: 0.5em 0;
125
}
126
- ul.ip-geo-block-settings-folding ul {
127
margin-bottom: 0;
128
}
129
- ul.ip-geo-block-settings-folding li:first-child {
130
- margin-top: 0.5em;
131
}
132
.folding-disable {
133
pointer-events: none;
@@ -138,52 +146,46 @@ ul.ip-geo-block-settings-folding li:first-child {
138
font-style:oblique !important;
139
}
140
141
- ul.ip-geo-block-float li {
142
display: inline-block;
143
width: 18em;
144
- }
145
-
146
- ul#ip-geo-block-actions dfn {
147
- border: none;
148
- }
149
- ul#ip-geo-block-actions span.dashicons {
150
- font-size: 14px;
151
}
152
.ip-geo-block-checked {
153
list-style-type: disc;
154
}
155
-
156
.ip-geo-block-ip-addr {
157
display: inline-block;
158
padding-top: 5px;
159
}
160
-
161
.ip-geo-block-hide {
162
display: none;
163
}
164
-
165
.ip-geo-block-sup {
166
margin-left: 0.2em;
167
display: inline-block;
168
}
169
-
170
- ul.ip-geo-block-note {
171
margin-top: 1em;
172
list-style: disc inside;
173
}
174
- ul.ip-geo-block-list {
175
- margin-top: 0.25em;
176
- margin-bottom: 0.25em;
177
}
178
- ul.ip-geo-block-list label {
179
display: inline-block;
180
}
181
- @media screen and (min-width:782px) {
182
- ul.ip-geo-block-list .code {
183
- width: 15em;
184
- }
185
}
186
187
.ip-geo-block-loading,
188
#ip-geo-block-live-loading {
189
background-size: 16px 16px;
@@ -194,36 +196,17 @@ ul.ip-geo-block-list label {
194
margin-left: 1em;
195
margin-top: 0.2em;
196
display: inline-block;
197
- vertical-align: middle;
198
}
199
.ip-geo-block-loading {
200
background-image: url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==);
201
}
202
203
- .ip-geo-block-border {
204
- border-top: inherit;
205
- }
206
-
207
- .ip-geo-block-notice {
208
- color: #dd3d36;
209
- }
210
-
211
- .ip-geo-block-title {
212
- width: 100px;
213
- display: inline-block;
214
- }
215
-
216
- .ip-geo-block-result {
217
- color: #2786C2;
218
- display: inline-block;
219
- }
220
-
221
#ip-geo-block-map {
222
height: 400px;
223
margin: 1em auto;
224
}
225
-
226
- /* google map infomation window */
227
.gm-style-iw {
228
width: 18em;
229
height: auto !important;
@@ -237,11 +220,13 @@ ul.ip-geo-block-list label {
237
margin: 0.2em;
238
}
239
240
- ul.ip-geo-block-statistics-countries li {
241
- width: 12em;
242
- float: left;
243
- text-align: right;
244
- padding: 0.2em;
245
}
246
247
/* table */
@@ -272,7 +257,7 @@ table.ip-geo-block-table td:first-child {
272
min-width: 4.3em;
273
}
274
275
- /* for whois */
276
@media screen and (max-width:782px) {
277
#ip-geo-block-whois .panel-body {
278
padding: 0 0.5em;
@@ -288,7 +273,7 @@ table.ip-geo-block-table td:first-child {
288
margin-bottom: 0;
289
}
290
291
- /* for google chart */
292
#ip-geo-block-chart-countries {
293
height: 200px;
294
}
@@ -301,10 +286,6 @@ table.ip-geo-block-table td:first-child {
301
#ip_geo_block_settings_validation_mimetype + label + ul {
302
margin-top: 0.7em;
303
}
304
- #ip_geo_block_settings_validation_plugins,
305
- #ip_geo_block_settings_validation_themes {
306
- margin-top: 0.7em;
307
- }
308
#ip_geo_block_settings_create_user {
309
margin-bottom: 0.5em;
310
}
@@ -330,35 +311,36 @@ table.ip-geo-block-table td:first-child {
330
background-color: #00919e !important;
331
border-color: #00525a !important;
332
}
333
334
- span.ip-geo-block-title-link {
335
font-size: 13px !important;
336
}
337
- /*span.ip-geo-block-title-link a {
338
- box-shadow: none;
339
- }*/
340
341
- dfn ~ .ip-geo-block-cycle,
342
- dfn ~ .ip-geo-block-lock,
343
- dfn ~ .ip-geo-block-unlock {
344
margin-left: 0.6em;
345
}
346
- .ip-geo-block-cycle,
347
- .ip-geo-block-lock,
348
- .ip-geo-block-unlock {
349
cursor: pointer;
350
box-shadow: none;
351
text-decoration: none;
352
}
353
- .ip-geo-block-cycle:active,
354
- .ip-geo-block-lock:active,
355
- .ip-geo-block-unlock:active {
356
position: relative;
357
top: 1px;
358
}
359
- .ip-geo-block-cycle span,
360
- .ip-geo-block-lock span,
361
- .ip-geo-block-unlock span {
362
height: 16px;
363
width: 16px;
364
margin: 0;
@@ -369,79 +351,94 @@ dfn ~ .ip-geo-block-unlock {
369
background-position: center center;
370
background-repeat: no-repeat;
371
}
372
- .ip-geo-block-cycle span {
373
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);
374
}
375
- .ip-geo-block-lock span {
376
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3Ny3y9Zzq8dRmb7M1dlXnsIFdK0AcawAcqwphrYAcKvZ29wAb6oJd680jrqlw9MBcqxmo8MUfbJLl75eoMI7kbzX2ttqp8VSmL1YnL8NeK+Tu89DlL1ImMEOebBNmL4OkqMoAAAAAXRSTlMAQObYZgAAAPlJREFUeAG9kAWyhTAQBIPOsCzufv9TPnf4Ll0CSbpmxXwNy3Yc23rz2fV8kPA99433AIQIiGDTCD0lojiOQPXCDSFJIbF16CMWItkQMkF+inZzSLYhFKLl+a9UKTZaqJTZJYtarZuo40chrv9CqJTN+behVi+Cm7RdDgRld6AMgLxrE/dxBz0BEjwBEmD/uIsWPAOAF9A+CE56ufSryr8oqfOYcBbQJ8YkES7COkFOYzTypqCDOTDo2wljaEw4vp1APYyWKd8WMBozylvCpcvmXeHQ5fCegHia4s1FgZcIVeVFeFx1M4MvYG4eBHdYWufC+addBtf8E3vdjBNhWnVQqAAAAABJRU5ErkJggg==);
377
}
378
- .ip-geo-block-unlock span {
379
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NyzydRzq8dRmb7I09hYnsEFdK0AcawAcqzP1toqhrYAcKvZ29wAb6oMeK8zjbqrxtQBcazBz9Zko8MVfbLF0thMmL07kbtpp8WjwtJSmL1YnL+Tu89DlL1JmMEPebBFV++UAAAAAXRSTlMAQObYZgAAAONJREFUeAG9kAWChDAMAIMmJaTFXf7/ynXflvMbnE5j8DU8Pwh8D1yEUYxEGEchWFEJEjEflESBhTQSQm2MRpIotQhZTmgKgMIg5ZlFKBmrGg7UFXJpEQKW8qIKN7YeikJdBJI2BTtXwfyx0L3XoPphvBEliNU49OoxqEa6g4cTST/OYshvi3hV8+FxSNfluG3jqxG8C6h7gF6jU+AODnTsFGSCA5O4I8wpQDq7I5CUAKWQW+AZYOYtoQPoGDeECWDaioBmWQxeBduoWURso+5WpBdw7R4ENTVDcGE435tJwT+xB+vMEnZRNB0YAAAAAElFTkSuQmCC);
380
}
381
table.form-table th .ip-geo-block-cycle span {
382
vertical-align: text-bottom;
383
}
384
385
- /* https://developer.wordpress.org/resource/dashicons/ for WordPress 3.8
386
- .ip-geo-block-cycle span:before {
387
- background: none;
388
- content: "\f463";
389
- display: inline-block;
390
- font: normal 16px/20px dashicons;
391
- speak: none;
392
- height: 1em;
393
- width: 1em;
394
- text-align: center;
395
- vertical-align: text-top;
396
- -webkit-font-smoothing: antialiased;
397
- -moz-osx-font-smoothing: grayscale;
398
- }*/
399
- #ip-geo-block-back-to-top {
400
- margin:0;
401
- text-align:right;
402
}
403
- #ip-geo-block-open-new,
404
- #ip-geo-block-live-update {
405
- margin-left: 1em;
406
}
407
408
- /* embeded data for network site list */
409
- .ip-geo-block-network {
410
- margin-bottom: 1em;
411
}
412
-
413
- /* for statistics */
414
- ol.ip-geo-block-top-list {
415
- display: inline-table;
416
- list-style-position: outside;
417
- margin: 0 2em 0.5em 1.75em;
418
}
419
- ol.ip-geo-block-top-list h4 {
420
- margin: 1em 0;
421
}
422
- ol.ip-geo-block-top-list li code {
423
- background: none;
424
}
425
426
- /* icon for top level menu ... this must be included in every admin page */
427
- #adminmenu #toplevel_page_ip-geo-block .wp-menu-image img {
428
- height: 20px !important;
429
- width: 20px !important;
430
}
431
432
- /* action for admin post */
433
.ip-geo-block-admin-post {
434
color: #c43322;
435
margin-left: 0.25em;
436
}
437
438
- /* SVG in google chart */
439
- svg a > text {
440
- fill: #0073aa;
441
- text-decoration: underline;
442
}
443
- svg a:hover > text {
444
- fill: #0096dd;
445
}
446
447
/*------------------------------------------------------------
@@ -556,11 +553,11 @@ table.dataTable > tbody > tr > td span {
556
table.dataTable input[type="checkbox"] {
557
height: 16px;
558
width: 16px;
559
- margin: 0;
560
}
561
table.dataTable > thead > tr > th:first-child,
562
table.dataTable > tbody > tr > td:first-child {
563
- padding: 8px 4px 8px 18px;
564
text-align: left;
565
}
566
@@ -599,12 +596,11 @@ table.collapsed > tbody > tr.parent > td:first-child::before {
599
}
600
table.collapsed > tbody > tr > td:first-child::before {
601
border-left: 5px solid #555;
602
- top: 1px;
603
left: -2px;
604
}
605
table.collapsed > tbody > tr.parent > td:first-child::before {
606
border-top: 5px solid #555;
607
- top: 4px;
608
left: -4px;
609
}
610
table.collapsed > tbody > tr.child > td:first-child::before {
@@ -706,24 +702,24 @@ table.collapsed > tbody > tr.child > td.child > ul li span.dtr-data {
706
}
707
708
/* Select target / Period to extract */
709
- ul#ip-geo-block-select-target,
710
- ul#ip-geo-block-select-layout,
711
- ul#ip-geo-block-select-duration {
712
margin: 0;
713
}
714
- ul#ip-geo-block-select-target li,
715
- ul#ip-geo-block-select-layout li,
716
- ul#ip-geo-block-select-duration li {
717
float: left;
718
margin-right: 1.5em;
719
}
720
- ul#ip-geo-block-select-target li label,
721
- ul#ip-geo-block-select-duration li label {
722
cursor: pointer;
723
}
724
725
/* Filter */
726
- input#ip_geo_block_settings_search_filter {
727
width: 16em;
728
padding-top: 3px;
729
}
@@ -757,20 +753,21 @@ mark {
757
}
758
759
/* Live update log */
760
- ul#ip-geo-block-live-log {
761
margin: 0;
762
}
763
- ul#ip-geo-block-live-log li {
764
float: left;
765
margin-right: 3em;
766
}
767
- ul#ip-geo-block-live-log li:last-child {
768
margin-right: 0;
769
}
770
- ul#ip-geo-block-live-log li input[type=radio] {
771
- display: none;
772
}
773
- ul#ip-geo-block-live-log li input[type=radio] + label {
774
display:inline-block;
775
margin:-2px;
776
padding: 4px 12px;
@@ -799,7 +796,7 @@ ul#ip-geo-block-live-log li input[type=radio] + label {
799
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
800
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
801
}
802
- ul#ip-geo-block-live-log li input[type=radio]:checked + label {
803
background-image: none;
804
outline: 0;
805
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);
@@ -814,9 +811,10 @@ ul#ip-geo-block-live-log li input[type=radio]:checked + label {
814
.ip-geo-block-live-timer {
815
height: 1em;
816
width: 1em;
817
- position: relative;
818
- top: -0.1em;
819
margin: 0;
820
}
821
.ip-geo-block-live-timer:before {
822
content: "";
@@ -824,8 +822,8 @@ ul#ip-geo-block-live-log li input[type=radio]:checked + label {
824
height: 1em;
825
width: 1em;
826
background: radial-gradient(#0073aa, #72777c);
827
- position: absolute;
828
border-radius: 50%;
829
top: 0;
830
left: 0;
831
}
1
/*!
2
* Project: WordPress IP Geo Block
3
+ * Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
* This software is released under the MIT License.
5
*/
6
dfn {
72
margin: 0;
73
font-size: 14px !important;
74
}
75
+ fieldset.ip-geo-block-field h4 {
76
+ margin: 0.75em 0 0.5em 0;
77
+ }
78
fieldset.ip-geo-block-field legend.panel-heading {
79
padding: 10px;
80
}
103
left: -2px;
104
top: 38%;
105
}
106
+ fieldset.ip-geo-block-field .form-table .ip-geo-block-dropup,
107
+ fieldset.ip-geo-block-field .form-table .ip-geo-block-dropdown {
108
+ margin-top: 0.75em;
109
+ }
110
fieldset.ip-geo-block-field ul.ip-geo-block-dropup:before {
111
top: 0.25em;
112
}
113
fieldset.ip-geo-block-field ul.ip-geo-block-dropdown:before {
114
+ top: 0.5em;
115
}
116
fieldset.ip-geo-block-field table.form-table {
117
margin: 0 0 0.5em;
118
width: 100%;
119
}
120
121
+ /* Text */
122
textarea.regular-text {
123
width: 25em;
124
}
125
+ fieldset.ip-geo-block-field input.regular-text,
126
+ fieldset.ip-geo-block-field textarea.regular-text {
127
+ font-size: 95%;
128
+ }
129
130
+ /* Folding */
131
+ .ip-geo-block-settings-folding {
132
margin: 0.5em 0;
133
}
134
+ .ip-geo-block-settings-folding ul {
135
margin-bottom: 0;
136
}
137
+ .ip-geo-block-settings-folding li {
138
+ margin: 0.5em 0;
139
}
140
.folding-disable {
141
pointer-events: none;
146
font-style:oblique !important;
147
}
148
149
+ /* Etc */
150
+ .ip-geo-block-float li {
151
display: inline-block;
152
width: 18em;
153
+ margin-top: 0;
154
}
155
.ip-geo-block-checked {
156
list-style-type: disc;
157
}
158
.ip-geo-block-ip-addr {
159
display: inline-block;
160
padding-top: 5px;
161
}
162
.ip-geo-block-hide {
163
display: none;
164
}
165
.ip-geo-block-sup {
166
margin-left: 0.2em;
167
display: inline-block;
168
}
169
+ .ip-geo-block-note {
170
margin-top: 1em;
171
list-style: disc inside;
172
}
173
+ .ip-geo-block-border {
174
+ border-top: inherit;
175
}
176
+ .ip-geo-block-notice {
177
+ color: #dd3d36;
178
+ }
179
+ .ip-geo-block-title {
180
+ width: 100px;
181
display: inline-block;
182
}
183
+ .ip-geo-block-result {
184
+ color: #2786C2;
185
+ display: inline-block;
186
}
187
188
+ /* Loading image */
189
.ip-geo-block-loading,
190
#ip-geo-block-live-loading {
191
background-size: 16px 16px;
196
margin-left: 1em;
197
margin-top: 0.2em;
198
display: inline-block;
199
+ vertical-align: top;
200
}
201
.ip-geo-block-loading {
202
background-image: url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==);
203
}
204
205
+ /* Google Map infomation window */
206
#ip-geo-block-map {
207
height: 400px;
208
margin: 1em auto;
209
}
210
.gm-style-iw {
211
width: 18em;
212
height: auto !important;
220
margin: 0.2em;
221
}
222
223
+ /* SVG in google chart */
224
+ svg a > text {
225
+ fill: #0073aa;
226
+ text-decoration: underline;
227
+ }
228
+ svg a:hover > text {
229
+ fill: #0096dd;
230
}
231
232
/* table */
257
min-width: 4.3em;
258
}
259
260
+ /* Whois */
261
@media screen and (max-width:782px) {
262
#ip-geo-block-whois .panel-body {
263
padding: 0 0.5em;
273
margin-bottom: 0;
274
}
275
276
+ /* Google Chart */
277
#ip-geo-block-chart-countries {
278
height: 200px;
279
}
286
#ip_geo_block_settings_validation_mimetype + label + ul {
287
margin-top: 0.7em;
288
}
289
#ip_geo_block_settings_create_user {
290
margin-bottom: 0.5em;
291
}
311
background-color: #00919e !important;
312
border-color: #00525a !important;
313
}
314
+ #ip-geo-block-back-to-top {
315
+ margin:0;
316
+ text-align:right;
317
+ }
318
+ #ip-geo-block-open-new,
319
+ #ip-geo-block-live-update {
320
+ margin-left: 1em;
321
+ }
322
323
+ /* Top menu link */
324
+ .ip-geo-block-menu-link {
325
font-size: 13px !important;
326
}
327
328
+ /* Icons */
329
+ dfn ~ .ip-geo-block-icon {
330
margin-left: 0.6em;
331
}
332
+ .ip-geo-block-icon {
333
cursor: pointer;
334
+ outline: none;
335
box-shadow: none;
336
text-decoration: none;
337
+ background-color: transparent;
338
}
339
+ .ip-geo-block-icon:active {
340
position: relative;
341
top: 1px;
342
}
343
+ .ip-geo-block-icon span {
344
height: 16px;
345
width: 16px;
346
margin: 0;
351
background-position: center center;
352
background-repeat: no-repeat;
353
}
354
+ .ip-geo-block-icon-cycle span {
355
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);
356
}
357
+ .ip-geo-block-icon-lock span {
358
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3Ny3y9Zzq8dRmb7M1dlXnsIFdK0AcawAcqwphrYAcKvZ29wAb6oJd680jrqlw9MBcqxmo8MUfbJLl75eoMI7kbzX2ttqp8VSmL1YnL8NeK+Tu89DlL1ImMEOebBNmL4OkqMoAAAAAXRSTlMAQObYZgAAAPlJREFUeAG9kAWyhTAQBIPOsCzufv9TPnf4Ll0CSbpmxXwNy3Yc23rz2fV8kPA99433AIQIiGDTCD0lojiOQPXCDSFJIbF16CMWItkQMkF+inZzSLYhFKLl+a9UKTZaqJTZJYtarZuo40chrv9CqJTN+behVi+Cm7RdDgRld6AMgLxrE/dxBz0BEjwBEmD/uIsWPAOAF9A+CE56ufSryr8oqfOYcBbQJ8YkES7COkFOYzTypqCDOTDo2wljaEw4vp1APYyWKd8WMBozylvCpcvmXeHQ5fCegHia4s1FgZcIVeVFeFx1M4MvYG4eBHdYWufC+addBtf8E3vdjBNhWnVQqAAAAABJRU5ErkJggg==);
359
}
360
+ .ip-geo-block-icon-unlock span {
361
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NyzydRzq8dRmb7I09hYnsEFdK0AcawAcqzP1toqhrYAcKvZ29wAb6oMeK8zjbqrxtQBcazBz9Zko8MVfbLF0thMmL07kbtpp8WjwtJSmL1YnL+Tu89DlL1JmMEPebBFV++UAAAAAXRSTlMAQObYZgAAAONJREFUeAG9kAWChDAMAIMmJaTFXf7/ynXflvMbnE5j8DU8Pwh8D1yEUYxEGEchWFEJEjEflESBhTQSQm2MRpIotQhZTmgKgMIg5ZlFKBmrGg7UFXJpEQKW8qIKN7YeikJdBJI2BTtXwfyx0L3XoPphvBEliNU49OoxqEa6g4cTST/OYshvi3hV8+FxSNfluG3jqxG8C6h7gF6jU+AODnTsFGSCA5O4I8wpQDq7I5CUAKWQW+AZYOYtoQPoGDeECWDaioBmWQxeBduoWURso+5WpBdw7R4ENTVDcGE435tJwT+xB+vMEnZRNB0YAAAAAElFTkSuQmCC);
362
}
363
+ .ip-geo-block-icon-find span {
364
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NzS19rD0NWHtMpGk7kYfbAGda0Req+WtcTT1temwM4AcasAcqwAc6wAcKydvMt1pr8Ab6pqpcLX2doggrKoxdNYm7yzw8u/y9HO1tkKdq4th7Td3t6DrcLL0taxyNPGe/YhAAAAAXRSTlMAQObYZgAAARVJREFUeAGtkkeiwyAMRP2xDfxoRjElvd3/lOkNUlZ5u0GPruan/Bnz96Xadr21rvP/7+ujXsAjom78rj4ApCoERIipqfGB1H7wPmYhw1DXjZI6nOel1oJhVAmdUP0tTEDkVC4AYvqIbaDOCqFV6vwRF0tIeYoo6J/X7ICuPAJl9ZynwiIfB5DXxZlRChulbh8xZci0EHZK3TziJFDL504rEOZ+iR5cVj82DoS7XtSshLJpKqaB0Dg3ZjcsQWKaKiF1gVQlITwh/bw2pgKeEeURhE29yKSzUFF03p1V7Wqj2Y7GfrY9X/NirJsPxKsxfBLSSs5GmH8yjAWPSNd8Yoez4f4/G1nIsksqFtGK1i9e39o0P+EAqaoRLlQ+r94AAAAASUVORK5CYII=);
365
+ }
366
+ span.ip-geo-block-icon-alert,
367
+ .ip-geo-block-icon-alert span {
368
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAkFBMVEXc3Nzc2trWl5DHRDTFOyvOgXfc1tXCLBrEMiHEMyLNcmfaxMLDMSDDLx7bu7jRiYHDLhzDMB/LX1PaxsTDLh3YtrHMY1bWmpPJVknSjYXUkYnZuLTMZVnENCPWlI3QhXzENiXXrqrDLRzXsa3Oal7Pe3Hc2NjVn5nNbmPayMbbwb7ay8rUj4fc09Lbw8Db0dDBbRUDAAAAAXRSTlMAQObYZgAAAPVJREFUeAG9ktXWwyAQBonC12brFvff5f2frr4nBredK2DnTFS8Gst2XM8XZmypIGeWcT4PFABaGIXlClfWG1NiC4Ubu705oKRcY32wTAHl2MdTYEqEK8hIiHgHSnSJeaogMyEWO4BijZCvwII2MS9UJ2BXTh+hQidoEttboBOwq3WBnkCNpQlA2iyAhol2hRu71n97p4fw0Z9/ugoPHCfFA+o/iLfCkyBglRJdICBas7uuey+R56fF14wNanj+/QjwY3aX23cBFn6EiHmHNT/ICYxystv/wJy4UHWGlN2cuPB72tFqAq3dP/Hk3zs0E5LZVryGC/hqGNnUa0SVAAAAAElFTkSuQmCC);
369
+ vertical-align: bottom;
370
+ }
371
+
372
table.form-table th .ip-geo-block-cycle span {
373
vertical-align: text-bottom;
374
}
375
376
+ /* Option list */
377
+ .ip-geo-block-list {
378
+ margin-top: 0;
379
+ margin-bottom: 0.7em;
380
}
381
+ @media screen and (min-width:782px) {
382
+ ul.ip-geo-block-list .code {
383
+ width: 15em;
384
+ }
385
}
386
387
+ /* Exceptions */
388
+ .ip-geo-block-list-exceptions label {
389
+ display: inline-block;
390
}
391
+ .ip-geo-block-list-exceptions dfn {
392
+ border: none;
393
}
394
+ .ip-geo-block-list-exceptions span.dashicons {
395
+ font-size: 14px;
396
}
397
+ .ip-geo-block-list-exceptions a.ip-geo-block-icon {
398
+ margin-left: 0.3em;
399
+ outline: none;
400
+ box-shadow: none;
401
+ text-decoration: none;
402
+ background-color: transparent;
403
}
404
405
+ /* Description */
406
+ .form-table td p.ip-geo-block-desc,
407
+ .form-table td p.ip-geo-block-find-desc {
408
+ color: #666;
409
+ font-size: 13px !important;
410
+ margin: 4px 0 0.5em 0.5em;
411
+ }
412
+ .ip-geo-block-find-desc {
413
+ display: none;
414
}
415
416
+ /* Action for admin post */
417
.ip-geo-block-admin-post {
418
color: #c43322;
419
margin-left: 0.25em;
420
}
421
+ .ip-geo-block-found {
422
+ color: #c43322;
423
+ font-weight: bold;
424
+ }
425
426
+ /* Statistics */
427
+ .ip-geo-block-top-list {
428
+ display: inline-table;
429
+ list-style-position: outside;
430
+ margin: 0 2em 0.5em 1.75em;
431
}
432
+ .ip-geo-block-top-list h4 {
433
+ margin: 1em 0;
434
+ }
435
+ .ip-geo-block-top-list li code {
436
+ background: none;
437
+ }
438
+
439
+ /* Embeded data for network site list */
440
+ .ip-geo-block-network {
441
+ margin-bottom: 1em;
442
}
443
444
/*------------------------------------------------------------
553
table.dataTable input[type="checkbox"] {
554
height: 16px;
555
width: 16px;
556
+ margin: -4px 1px 0 0;
557
}
558
table.dataTable > thead > tr > th:first-child,
559
table.dataTable > tbody > tr > td:first-child {
560
+ padding: 8px 4px 8px 1.4em;
561
text-align: left;
562
}
563
596
}
597
table.collapsed > tbody > tr > td:first-child::before {
598
border-left: 5px solid #555;
599
left: -2px;
600
}
601
table.collapsed > tbody > tr.parent > td:first-child::before {
602
border-top: 5px solid #555;
603
+ top: 3px;
604
left: -4px;
605
}
606
table.collapsed > tbody > tr.child > td:first-child::before {
702
}
703
704
/* Select target / Period to extract */
705
+ #ip-geo-block-select-target,
706
+ #ip-geo-block-select-layout,
707
+ #ip-geo-block-select-duration {
708
margin: 0;
709
}
710
+ #ip-geo-block-select-target li,
711
+ #ip-geo-block-select-layout li,
712
+ #ip-geo-block-select-duration li {
713
float: left;
714
margin-right: 1.5em;
715
}
716
+ #ip-geo-block-select-target li label,
717
+ #ip-geo-block-select-duration li label {
718
cursor: pointer;
719
}
720
721
/* Filter */
722
+ #ip_geo_block_settings_search_filter {
723
width: 16em;
724
padding-top: 3px;
725
}
753
}
754
755
/* Live update log */
756
+ #ip-geo-block-live-log {
757
margin: 0;
758
}
759
+ #ip-geo-block-live-log li {
760
float: left;
761
margin-right: 3em;
762
}
763
+ #ip-geo-block-live-log li:last-child {
764
margin-right: 0;
765
}
766
+ #ip-geo-block-live-log li input[type=radio] {
767
+ visibility: hidden;
768
+ position: absolute;
769
}
770
+ #ip-geo-block-live-log li input[type=radio] + label {
771
display:inline-block;
772
margin:-2px;
773
padding: 4px 12px;
796
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
797
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
798
}
799
+ #ip-geo-block-live-log li input[type=radio]:checked + label {
800
background-image: none;
801
outline: 0;
802
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);
811
.ip-geo-block-live-timer {
812
height: 1em;
813
width: 1em;
814
margin: 0;
815
+ position: relative;
816
+ top: 0;
817
+ left: 0;
818
}
819
.ip-geo-block-live-timer:before {
820
content: "";
822
height: 1em;
823
width: 1em;
824
background: radial-gradient(#0073aa, #72777c);
825
border-radius: 50%;
826
+ position: absolute;
827
top: 0;
828
left: 0;
829
}
admin/css/admin.min.css CHANGED
@@ -1,6 +1,6 @@
1
/*
2
Project: WordPress IP Geo Block
3
- Copyright (c) 2015-2017 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%}.panel-body,label{display:inline-block}label{max-width:100%}.panel{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;-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}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 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 ul.ip-geo-block-dropup:before{top:.25em}fieldset.ip-geo-block-field ul.ip-geo-block-dropdown:before{top:.45em}fieldset.ip-geo-block-field table.form-table{margin:0 0 .5em;width:100%}fieldset.ip-geo-block-field .ip-geo-block-desc{color:#666;font-size:13px!important}textarea.regular-text{width:25em}ul.ip-geo-block-settings-folding{margin:.5em 0}ul.ip-geo-block-settings-folding ul{margin-bottom:0}ul.ip-geo-block-settings-folding li:first-child{margin-top:.5em}.folding-disable{pointer-events:none;opacity:.5}.folding-inactive{opacity:.5;font-style:oblique!important}ul.ip-geo-block-float li{display:inline-block;width:18em}ul#ip-geo-block-actions dfn{border:none}ul#ip-geo-block-actions span.dashicons{font-size:14px}.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-result,.ip-geo-block-sup,.ip-geo-block-title,ul.ip-geo-block-list label{display:inline-block}.ip-geo-block-sup{margin-left:.2em}ul.ip-geo-block-note{margin-top:1em;list-style:disc inside}ul.ip-geo-block-list{margin-top:.25em;margin-bottom:.25em}@media screen and (min-width:782px){ul.ip-geo-block-list .code{width:15em}}#ip-geo-block-live-loading,.ip-geo-block-loading{background-size:16px 16px;background-position:center center;background-repeat:no-repeat;height:16px;width:16px;margin-left:1em;margin-top:.2em;display:inline-block;vertical-align:middle}.ip-geo-block-loading{background-image:url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==)}.ip-geo-block-border{border-top:inherit}.ip-geo-block-notice{color:#dd3d36}.ip-geo-block-title{width:100px}.ip-geo-block-result{color:#2786C2}#ip-geo-block-map{height:400px;margin:1em auto}.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}ul.ip-geo-block-statistics-countries li{width:12em;float:left;text-align:right;padding:.2em}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,#ip_geo_block_settings_validation_plugins,#ip_geo_block_settings_validation_themes{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-preferred{color:#fff;background:#00838f!important;border-color:#00707a!important;text-shadow:none}#ip-geo-block-preferred:hover{background-color:#00919e!important;border-color:#00525a!important}span.ip-geo-block-title-link{font-size:13px!important}dfn~.ip-geo-block-cycle,dfn~.ip-geo-block-lock,dfn~.ip-geo-block-unlock{margin-left:.6em}.ip-geo-block-cycle,.ip-geo-block-lock,.ip-geo-block-unlock{cursor:pointer;box-shadow:none;text-decoration:none}.ip-geo-block-cycle:active,.ip-geo-block-lock:active,.ip-geo-block-unlock:active{position:relative;top:1px}.ip-geo-block-cycle span,.ip-geo-block-lock span,.ip-geo-block-unlock 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}.dataTables_wrapper.no-footer .dataTables_scrollBody,table.dataTable.no-footer,table.dataTable>thead>tr>td,table.dataTable>thead>tr>th{border-bottom:1px solid #ddd}.ip-geo-block-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-lock span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3Ny3y9Zzq8dRmb7M1dlXnsIFdK0AcawAcqwphrYAcKvZ29wAb6oJd680jrqlw9MBcqxmo8MUfbJLl75eoMI7kbzX2ttqp8VSmL1YnL8NeK+Tu89DlL1ImMEOebBNmL4OkqMoAAAAAXRSTlMAQObYZgAAAPlJREFUeAG9kAWyhTAQBIPOsCzufv9TPnf4Ll0CSbpmxXwNy3Yc23rz2fV8kPA99433AIQIiGDTCD0lojiOQPXCDSFJIbF16CMWItkQMkF+inZzSLYhFKLl+a9UKTZaqJTZJYtarZuo40chrv9CqJTN+behVi+Cm7RdDgRld6AMgLxrE/dxBz0BEjwBEmD/uIsWPAOAF9A+CE56ufSryr8oqfOYcBbQJ8YkES7COkFOYzTypqCDOTDo2wljaEw4vp1APYyWKd8WMBozylvCpcvmXeHQ5fCegHia4s1FgZcIVeVFeFx1M4MvYG4eBHdYWufC+addBtf8E3vdjBNhWnVQqAAAAABJRU5ErkJggg==)}.ip-geo-block-unlock span{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NyzydRzq8dRmb7I09hYnsEFdK0AcawAcqzP1toqhrYAcKvZ29wAb6oMeK8zjbqrxtQBcazBz9Zko8MVfbLF0thMmL07kbtpp8WjwtJSmL1YnL+Tu89DlL1JmMEPebBFV++UAAAAAXRSTlMAQObYZgAAAONJREFUeAG9kAWChDAMAIMmJaTFXf7/ynXflvMbnE5j8DU8Pwh8D1yEUYxEGEchWFEJEjEflESBhTQSQm2MRpIotQhZTmgKgMIg5ZlFKBmrGg7UFXJpEQKW8qIKN7YeikJdBJI2BTtXwfyx0L3XoPphvBEliNU49OoxqEa6g4cTST/OYshvi3hV8+FxSNfluG3jqxG8C6h7gF6jU+AODnTsFGSCA5O4I8wpQDq7I5CUAKWQW+AZYOYtoQPoGDeECWDaioBmWQxeBduoWURso+5WpBdw7R4ENTVDcGE435tJwT+xB+vMEnZRNB0YAAAAAElFTkSuQmCC)}table.form-table th .ip-geo-block-cycle span{vertical-align:text-bottom}#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-network{margin-bottom:1em}ol.ip-geo-block-top-list{display:inline-table;list-style-position:outside;margin:0 2em .5em 1.75em}ol.ip-geo-block-top-list h4{margin:1em 0}ol.ip-geo-block-top-list li code{background:0 0}#adminmenu #toplevel_page_ip-geo-block .wp-menu-image img{height:20px!important;width:20px!important}.ip-geo-block-admin-post{color:#c43322;margin-left:.25em}svg a>text{fill:#0073aa;text-decoration:underline}svg a:hover>text{fill:#0096dd}.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.dataTable{clear:none!important}table.dataTable td,table.dataTable th{text-align:right}table.dataTable td:nth-child(n+2),table.dataTable th:nth-child(n+2){padding-left:0!important}table.dataTable th{white-space:nowrap}table.dataTable>thead>tr{line-height:1.8em}table.dataTable>tbody>tr{cursor:pointer}table.dataTable thead td,table.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}table.dataTable.nowrap td,table.dataTable>tbody>tr>td span{white-space:normal!important;word-wrap:break-word!important;word-break:break-all!important}table.dataTable>tbody>tr>td span{display:inline-block}table.dataTable input[type=checkbox]{height:16px;width:16px;margin:0}table.dataTable>tbody>tr>td:first-child,table.dataTable>thead>tr>th:first-child{padding:8px 4px 8px 18px;text-align:left}table.collapsed>tbody>tr>td.dataTables_empty:first-child::before,table.dataTable>tbody>tr>td.dataTables_empty{border:none;text-align:center}table.dataTable thead>tr>th:first-child.sorting_asc{background-image:none!important}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.display tbody tr:hover>.sorting_1{background-color:inherit!important}table.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}.dataTables_wrapper .dataTables_paginate{float:none;text-align:center;margin-bottom:1em}.dataTables_wrapper .dataTables_paginate a.paginate_button,.dataTables_wrapper .dataTables_paginate a.paginate_button.current,.dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,.dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate a.paginate_button:active,.dataTables_wrapper .dataTables_paginate a.paginate_button:hover,.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;padding:.25em 0;display:inline-block;text-decoration:none}#ip-geo-block-1 #ip-geo-block-section-2 .panel-body,#ip-geo-block-4 #ip-geo-block-section-0 .panel-body,mark{padding:0}.dataTables_wrapper .dataTables_paginate:active>a.paginate_button:first-child,.dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:first-child,.dataTables_wrapper .dataTables_paginate>a.paginate_button:first-child{border-left-width:1px;border-bottom-left-radius:4px;border-top-left-radius:4px}.dataTables_wrapper .dataTables_paginate:active>a.paginate_button:last-child,.dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:last-child,.dataTables_wrapper .dataTables_paginate>a.paginate_button:last-child{border-bottom-right-radius:4px;border-top-right-radius:4px}.dataTables_wrapper .dataTables_paginate a.paginate_button{color:#0073aa!important}.dataTables_wrapper .dataTables_paginate a.paginate_button:hover{color:#0096dd!important;background-color:#fff}.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate span.ellipsis{cursor:default;color:#999!important;background-color:transparent}.dataTables_wrapper .dataTables_paginate a.paginate_button.current,.dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,.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 table.form-table,#ip-geo-block-4 #ip-geo-block-section-0 table.form-table{margin-left:1em;max-width:95%}ul#ip-geo-block-live-log,ul#ip-geo-block-select-duration,ul#ip-geo-block-select-layout,ul#ip-geo-block-select-target{margin:0}ul#ip-geo-block-select-duration li,ul#ip-geo-block-select-layout li,ul#ip-geo-block-select-target li{float:left;margin-right:1.5em}ul#ip-geo-block-select-duration li label,ul#ip-geo-block-select-target li label{cursor:pointer}input#ip_geo_block_settings_search_filter{width:16em;padding-top:3px}table.dataTable.display tbody tr.ip-geo-block-passed{background-color:#edf6ff!important}table.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{background:gold}ul#ip-geo-block-live-log li{float:left;margin-right:3em}ul#ip-geo-block-live-log li:last-child{margin-right:0}ul#ip-geo-block-live-log li input[type=radio]{display:none}ul#ip-geo-block-live-log li input[type=radio]+label{display:inline-block;margin:-2px -2px 0;padding:4px 12px;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;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-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)}ul#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;position:relative;top:-.1em;margin:0}.ip-geo-block-live-timer:before{content:"";display:block;height:1em;width:1em;background:radial-gradient(#0073aa,#72777c);position:absolute;border-radius:50%;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(.00001deg);animation:30s spin-timer linear 30s forwards}@keyframes spin-timer{0%{transform:rotate(0)}100%{transform:rotate(180deg)}}
1
/*
2
Project: WordPress IP Geo Block
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}.ip-geo-block-icon,table.dataTable>tbody>tr{cursor:pointer}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%}.panel-body,label{display:inline-block}label{max-width:100%}.panel{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;-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}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}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%}.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-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-live-loading,.ip-geo-block-loading{background-size:16px 16px;background-position:center center;background-repeat:no-repeat;height:16px;width:16px;margin-left:1em;margin-top:.2em;display:inline-block;vertical-align:top}.ip-geo-block-loading{background-image:url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==)}#ip-geo-block-map{height:400px;margin:1em auto}.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>text{fill:#0073aa;text-decoration:underline}svg a:hover>text{fill:#0096dd}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-preferred{color:#fff;background:#00838f!important;border-color:#00707a!important;text-shadow:none}#ip-geo-block-preferred:hover{background-color:#00919e!important;border-color:#00525a!important}.ip-geo-block-icon,.ip-geo-block-list-exceptions a.ip-geo-block-icon{background-color:transparent;box-shadow:none;text-decoration:none;outline:0}#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:.6em}.ip-geo-block-icon:active{position:relative;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}.dataTables_wrapper.no-footer .dataTables_scrollBody,table.dataTable.no-footer,table.dataTable>thead>tr>td,table.dataTable>thead>tr>th{border-bottom:1px solid #ddd}.ip-geo-block-list-exceptions span.dashicons{font-size:14px}.ip-geo-block-list-exceptions a.ip-geo-block-icon{margin-left:.3em}.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-found{color:#c43322;font-weight:700}.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.dataTable{clear:none!important}table.dataTable td,table.dataTable th{text-align:right}table.dataTable td:nth-child(n+2),table.dataTable th:nth-child(n+2){padding-left:0!important}table.dataTable th{white-space:nowrap}table.dataTable>thead>tr{line-height:1.8em}table.dataTable thead td,table.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}table.dataTable.nowrap td,table.dataTable>tbody>tr>td span{white-space:normal!important;word-wrap:break-word!important;word-break:break-all!important}table.dataTable>tbody>tr>td span{display:inline-block}table.dataTable input[type=checkbox]{height:16px;width:16px;margin:-4px 1px 0 0}table.dataTable>tbody>tr>td:first-child,table.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.dataTable>tbody>tr>td.dataTables_empty{border:none;text-align:center}table.dataTable thead>tr>th:first-child.sorting_asc{background-image:none!important}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.display tbody tr:hover>.sorting_1{background-color:inherit!important}table.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;left:-2px}table.collapsed>tbody>tr.parent>td:first-child::before{border-top:5px solid #555;top:3px;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}.dataTables_wrapper .dataTables_paginate{float:none;text-align:center;margin-bottom:1em}.dataTables_wrapper .dataTables_paginate a.paginate_button,.dataTables_wrapper .dataTables_paginate a.paginate_button.current,.dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,.dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate a.paginate_button:active,.dataTables_wrapper .dataTables_paginate a.paginate_button:hover,.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;padding:.25em 0;display:inline-block;text-decoration:none}#ip-geo-block-1 #ip-geo-block-section-2 .panel-body,#ip-geo-block-4 #ip-geo-block-section-0 .panel-body,mark{padding:0}.dataTables_wrapper .dataTables_paginate:active>a.paginate_button:first-child,.dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:first-child,.dataTables_wrapper .dataTables_paginate>a.paginate_button:first-child{border-left-width:1px;border-bottom-left-radius:4px;border-top-left-radius:4px}.dataTables_wrapper .dataTables_paginate:active>a.paginate_button:last-child,.dataTables_wrapper .dataTables_paginate:hover>a.paginate_button:last-child,.dataTables_wrapper .dataTables_paginate>a.paginate_button:last-child{border-bottom-right-radius:4px;border-top-right-radius:4px}.dataTables_wrapper .dataTables_paginate a.paginate_button{color:#0073aa!important}.dataTables_wrapper .dataTables_paginate a.paginate_button:hover{color:#0096dd!important;background-color:#fff}.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:active,.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate span.ellipsis{cursor:default;color:#999!important;background-color:transparent}.dataTables_wrapper .dataTables_paginate a.paginate_button.current,.dataTables_wrapper .dataTables_paginate a.paginate_button.current:active,.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 table.form-table,#ip-geo-block-4 #ip-geo-block-section-0 table.form-table{margin-left:1em;max-width:95%}#ip-geo-block-live-log,#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.dataTable.display tbody tr.ip-geo-block-passed{background-color:#edf6ff!important}table.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{background:gold}#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 -2px 0;padding:4px 12px;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;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-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:radial-gradient(#0073aa,#72777c);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(.00001deg);animation:30s spin-timer linear 30s forwards}@keyframes spin-timer{0%{transform:rotate(0)}100%{transform:rotate(180deg)}}
admin/css/fonts/icomoon.eot CHANGED
Binary file
admin/css/fonts/icomoon.svg CHANGED
@@ -7,11 +7,11 @@
7
<font-face units-per-em="1024" ascent="960" descent="-64" />
8
<missing-glyph horiz-adv-x="1024" />
9
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
<glyph unicode="&#xe933;" glyph-name="folder-download" d="M576 704l-128 128h-448v-832h1024v704h-448zM512 96l-224 224h160v256h128v-256h160l-224-224z" />
11
<glyph unicode="&#xe948;" glyph-name="location2" d="M512 960c-176.732 0-320-143.268-320-320 0-320 320-704 320-704s320 384 320 704c0 176.732-143.27 320-320 320zM512 444c-108.248 0-196 87.752-196 196s87.752 196 196 196 196-87.752 196-196-87.752-196-196-196zM388 640c0 68.483 55.517 124 124 124s124-55.517 124-124c0-68.483-55.517-124-124-124s-124 55.517-124 124z" />
12
<glyph unicode="&#xe94b;" glyph-name="map" d="M0 768l320 128v-768l-320-128zM384 928l320-192v-736l-320 160zM768 736l256 192v-768l-256-192z" />
13
<glyph unicode="&#xe964;" glyph-name="database" d="M512 960c-282.77 0-512-71.634-512-160v-128c0-88.366 229.23-160 512-160s512 71.634 512 160v128c0 88.366-229.23 160-512 160zM512 416c-282.77 0-512 71.634-512 160v-192c0-88.366 229.23-160 512-160s512 71.634 512 160v192c0-88.366-229.23-160-512-160zM512 128c-282.77 0-512 71.634-512 160v-192c0-88.366 229.23-160 512-160s512 71.634 512 160v192c0-88.366-229.23-160-512-160z" />
14
- <glyph unicode="&#xe97b;" glyph-name="spinner2" d="M1024 448c-1.278 66.862-15.784 133.516-42.576 194.462-26.704 61-65.462 116.258-113.042 161.92-47.552 45.696-103.944 81.82-164.984 105.652-61.004 23.924-126.596 35.352-191.398 33.966-64.81-1.282-129.332-15.374-188.334-41.356-59.048-25.896-112.542-63.47-156.734-109.576-44.224-46.082-79.16-100.708-102.186-159.798-23.114-59.062-34.128-122.52-32.746-185.27 1.286-62.76 14.964-125.148 40.134-182.206 25.088-57.1 61.476-108.828 106.11-151.548 44.61-42.754 97.472-76.504 154.614-98.72 57.118-22.304 118.446-32.902 179.142-31.526 60.708 1.29 120.962 14.554 176.076 38.914 55.15 24.282 105.116 59.48 146.366 102.644 41.282 43.14 73.844 94.236 95.254 149.43 13.034 33.458 21.88 68.4 26.542 103.798 1.246-0.072 2.498-0.12 3.762-0.12 35.346 0 64 28.652 64 64 0 1.796-0.094 3.572-0.238 5.332h0.238zM922.306 278.052c-23.472-53.202-57.484-101.4-99.178-141.18-41.67-39.81-91-71.186-144.244-91.79-53.228-20.678-110.29-30.452-166.884-29.082-56.604 1.298-112.596 13.736-163.82 36.474-51.25 22.666-97.684 55.49-135.994 95.712-38.338 40.198-68.528 87.764-88.322 139.058-19.87 51.284-29.228 106.214-27.864 160.756 1.302 54.552 13.328 108.412 35.254 157.69 21.858 49.3 53.498 93.97 92.246 130.81 38.73 36.868 84.53 65.87 133.874 84.856 49.338 19.060 102.136 28.006 154.626 26.644 52.5-1.306 104.228-12.918 151.562-34.034 47.352-21.050 90.256-51.502 125.624-88.782 35.396-37.258 63.21-81.294 81.39-128.688 18.248-47.392 26.782-98.058 25.424-148.496h0.238c-0.144-1.76-0.238-3.536-0.238-5.332 0-33.012 24.992-60.174 57.086-63.624-6.224-34.822-16.53-68.818-30.78-100.992z" />
15
<glyph unicode="&#xe985;" glyph-name="binoculars" d="M64 960h384v-64h-384zM576 960h384v-64h-384zM952 640h-56v256h-256v-256h-256v256h-256v-256h-56c-39.6 0-72-32.4-72-72v-560c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v376h128v-376c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v560c0 39.6-32.4 72-72 72zM348 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32zM544 448h-64c-17.6 0-32 14.4-32 32s14.4 32 32 32h64c17.6 0 32-14.4 32-32s-14.4-32-32-32zM924 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32z" />
16
<glyph unicode="&#xe986;" glyph-name="search" d="M992.262 88.604l-242.552 206.294c-25.074 22.566-51.89 32.926-73.552 31.926 57.256 67.068 91.842 154.078 91.842 249.176 0 212.078-171.922 384-384 384-212.076 0-384-171.922-384-384s171.922-384 384-384c95.098 0 182.108 34.586 249.176 91.844-1-21.662 9.36-48.478 31.926-73.552l206.294-242.552c35.322-39.246 93.022-42.554 128.22-7.356s31.892 92.898-7.354 128.22zM384 320c-141.384 0-256 114.616-256 256s114.616 256 256 256 256-114.616 256-256-114.614-256-256-256z" />
17
<glyph unicode="&#xe98d;" glyph-name="key" d="M704 960c-176.73 0-320-143.268-320-320 0-20.026 1.858-39.616 5.376-58.624l-389.376-389.376v-192c0-35.346 28.654-64 64-64h64v64h128v128h128v128h128l83.042 83.042c34.010-12.316 70.696-19.042 108.958-19.042 176.73 0 320 143.268 320 320s-143.27 320-320 320zM799.874 639.874c-53.020 0-96 42.98-96 96s42.98 96 96 96 96-42.98 96-96-42.98-96-96-96z" />
7
<font-face units-per-em="1024" ascent="960" descent="-64" />
8
<missing-glyph horiz-adv-x="1024" />
9
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
+ <glyph unicode="&#xe900;" glyph-name="warning" d="M1010.432 121.248l-383.968 768c-21.664 43.36-65.952 70.752-114.464 70.752s-92.8-27.392-114.464-70.752l-383.968-768c-19.84-39.68-17.728-86.816 5.6-124.576 23.328-37.696 64.512-60.672 108.864-60.672h767.904c44.384 0 85.568 22.976 108.864 60.672 23.328 37.76 25.44 84.896 5.632 124.576zM575.936 96c0-17.696-14.304-32-32-32h-64c-17.696 0-32 14.304-32 32v64c0 17.696 14.304 32 32 32h64c17.696 0 32-14.304 32-32v-64zM575.936 352c0-17.696-14.304-32-32-32h-64c-17.696 0-32 14.304-32 32v320c0 17.664 14.304 32 32 32h64c17.696 0 32-14.336 32-32v-320z" />
11
<glyph unicode="&#xe933;" glyph-name="folder-download" d="M576 704l-128 128h-448v-832h1024v704h-448zM512 96l-224 224h160v256h128v-256h160l-224-224z" />
12
<glyph unicode="&#xe948;" glyph-name="location2" d="M512 960c-176.732 0-320-143.268-320-320 0-320 320-704 320-704s320 384 320 704c0 176.732-143.27 320-320 320zM512 444c-108.248 0-196 87.752-196 196s87.752 196 196 196 196-87.752 196-196-87.752-196-196-196zM388 640c0 68.483 55.517 124 124 124s124-55.517 124-124c0-68.483-55.517-124-124-124s-124 55.517-124 124z" />
13
<glyph unicode="&#xe94b;" glyph-name="map" d="M0 768l320 128v-768l-320-128zM384 928l320-192v-736l-320 160zM768 736l256 192v-768l-256-192z" />
14
<glyph unicode="&#xe964;" glyph-name="database" d="M512 960c-282.77 0-512-71.634-512-160v-128c0-88.366 229.23-160 512-160s512 71.634 512 160v128c0 88.366-229.23 160-512 160zM512 416c-282.77 0-512 71.634-512 160v-192c0-88.366 229.23-160 512-160s512 71.634 512 160v192c0-88.366-229.23-160-512-160zM512 128c-282.77 0-512 71.634-512 160v-192c0-88.366 229.23-160 512-160s512 71.634 512 160v192c0-88.366-229.23-160-512-160z" />
15
<glyph unicode="&#xe985;" glyph-name="binoculars" d="M64 960h384v-64h-384zM576 960h384v-64h-384zM952 640h-56v256h-256v-256h-256v256h-256v-256h-56c-39.6 0-72-32.4-72-72v-560c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v376h128v-376c0-39.6 32.4-72 72-72h304c39.6 0 72 32.4 72 72v560c0 39.6-32.4 72-72 72zM348 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32zM544 448h-64c-17.6 0-32 14.4-32 32s14.4 32 32 32h64c17.6 0 32-14.4 32-32s-14.4-32-32-32zM924 0h-248c-19.8 0-36 14.4-36 32s16.2 32 36 32h248c19.8 0 36-14.4 36-32s-16.2-32-36-32z" />
16
<glyph unicode="&#xe986;" glyph-name="search" d="M992.262 88.604l-242.552 206.294c-25.074 22.566-51.89 32.926-73.552 31.926 57.256 67.068 91.842 154.078 91.842 249.176 0 212.078-171.922 384-384 384-212.076 0-384-171.922-384-384s171.922-384 384-384c95.098 0 182.108 34.586 249.176 91.844-1-21.662 9.36-48.478 31.926-73.552l206.294-242.552c35.322-39.246 93.022-42.554 128.22-7.356s31.892 92.898-7.354 128.22zM384 320c-141.384 0-256 114.616-256 256s114.616 256 256 256 256-114.616 256-256-114.614-256-256-256z" />
17
<glyph unicode="&#xe98d;" glyph-name="key" d="M704 960c-176.73 0-320-143.268-320-320 0-20.026 1.858-39.616 5.376-58.624l-389.376-389.376v-192c0-35.346 28.654-64 64-64h64v64h128v128h128v128h128l83.042 83.042c34.010-12.316 70.696-19.042 108.958-19.042 176.73 0 320 143.268 320 320s-143.27 320-320 320zM799.874 639.874c-53.020 0-96 42.98-96 96s42.98 96 96 96 96-42.98 96-96-42.98-96-96-96z" />
admin/css/fonts/icomoon.ttf CHANGED
Binary file
admin/css/fonts/icomoon.woff CHANGED
Binary file
admin/images/alert.png ADDED
Binary file
admin/images/find.png ADDED
Binary file
admin/includes/class-admin-ajax.php CHANGED
@@ -9,7 +9,7 @@ class IP_Geo_Block_Admin_Ajax {
9
/**
10
* Admin ajax sub functions
11
*
12
- * @param string $which name of the geolocation api provider
13
*/
14
public static function search_ip( $which ) {
15
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
@@ -53,7 +53,7 @@ class IP_Geo_Block_Admin_Ajax {
53
/**
54
* Get country code from providers
55
*
56
- * @param string $which 'ip_client' or 'ip_server'
57
*/
58
public static function scan_country( $which ) {
59
// scan all the country code using selected APIs
@@ -642,6 +642,87 @@ endif; // TEST_RESTORE_NETWORK
642
);
643
}
644
645
public static function get_wp_info() {
646
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
647
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
@@ -656,15 +737,19 @@ endif; // TEST_RESTORE_NETWORK
656
$res = array(
657
'Server:' => $_SERVER['SERVER_SOFTWARE'],
658
'PHP:' => PHP_VERSION,
659
'WordPress:' => $GLOBALS['wp_version'],
660
'Multisite:' => is_multisite() ? 'yes' : 'no',
661
'File system:' => $fs->get_method(),
662
'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
663
'ZipArchive:' => class_exists( 'ZipArchive', FALSE ) ? 'yes' : 'no',
664
'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
665
'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no',
666
- 'SQLite(PDO):' => extension_loaded('pdo_sqlite') ? 'yes' : 'no',
667
'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
668
);
669
670
// Child and parent themes
@@ -690,10 +775,9 @@ endif; // TEST_RESTORE_NETWORK
690
}
691
}
692
693
- // Logs (hook, time, ip, code, result, method, user_agent, headers, data)
694
- $installed = IP_Geo_Block_Logs::search_logs( IP_Geo_Block::get_ip_address() );
695
-
696
- foreach ( array_reverse( $installed ) as $val ) {
697
// hide port and nonce
698
$method = preg_replace( '/\[\d+\]/', '', $val['method'] );
699
$method = preg_replace( '/(' . IP_Geo_Block::PLUGIN_NAME . '-auth-nonce)(?:=|%3D)([\w]+)/', '$1=...', $method );
9
/**
10
* Admin ajax sub functions
11
*
12
+ * @param string $which name of the geolocation api provider (should be validated by whitelist)
13
*/
14
public static function search_ip( $which ) {
15
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
53
/**
54
* Get country code from providers
55
*
56
+ * @param string $which 'ip_client' or 'ip_server' (not in use)
57
*/
58
public static function scan_country( $which ) {
59
// scan all the country code using selected APIs
642
);
643
}
644
645
+ /**
646
+ * Get blocked action and pages
647
+ *
648
+ * @param string $which 'page', 'action', 'plugin', 'theme'
649
+ * @return array of the name of action/page, plugin or theme
650
+ */
651
+ private static function get_blocked_queries( $which ) {
652
+ $result = array();
653
+
654
+ switch ( $which ) {
655
+ case 'page':
656
+ case 'action':
657
+ $dir = admin_url();
658
+ $dir = preg_replace( '!https?://.+?/!', '/', IP_Geo_Block_Util::slashit( $dir ) );
659
+
660
+ foreach ( IP_Geo_Block_Logs::search_blocked_logs( 'method', $dir ) as $log ) {
661
+ foreach ( array( 'method', 'data' ) as $key ) {
662
+ if ( preg_match( '!' . $which . '=([\-\w]+)!', $log[ $key ], $matches ) ) {
663
+ $result += array( $matches[1] => $which );
664
+ }
665
+ }
666
+ }
667
+ break;
668
+
669
+ case 'plugins':
670
+ case 'themes':
671
+ // make a list of installed plugins/themes
672
+ if ( 'plugins' === $which ) {
673
+ $key = array();
674
+ foreach ( get_plugins() as $pat => $log ) {
675
+ $pat = explode( '/', $pat, 2 );
676
+ $key[] = $pat[0];
677
+ }
678
+ } else {
679
+ $key = wp_get_themes();
680
+ }
681
+
682
+ $dir = 'plugins' === $which ? plugins_url() : get_theme_root_uri();
683
+ $dir = preg_replace( '!https?://.+?/!', '/', IP_Geo_Block_Util::slashit( $dir ) );
684
+ $pat = preg_quote( $dir, '!' ); // `/wp-content/[plugins|themes]/`
685
+
686
+ foreach ( IP_Geo_Block_Logs::search_blocked_logs( 'method', $dir ) as $log ) {
687
+ if ( preg_match( '!' . $pat . '(.+?)/!', $log['method'], $matches ) && in_array( $matches[1], $key, TRUE ) ) {
688
+ $result += array( $matches[1] => $which );
689
+ }
690
+ }
691
+ }
692
+
693
+ return $result;
694
+ }
695
+
696
+ /**
697
+ * Get slug in blocked requests for exceptions
698
+ *
699
+ */
700
+ public static function find_exceptions( $target ) {
701
+ $res = array();
702
+
703
+ switch ( $target ) {
704
+ case 'find-admin':
705
+ foreach ( array( 'action', 'page' ) as $which ) {
706
+ $res += self::get_blocked_queries( $which );
707
+ }
708
+ break;
709
+
710
+ case 'find-plugins':
711
+ $res = self::get_blocked_queries( 'plugins' );
712
+ break;
713
+
714
+ case 'find-themes':
715
+ $res = self::get_blocked_queries( 'themes' );
716
+ break;
717
+ }
718
+
719
+ return $res;
720
+ }
721
+
722
+ /**
723
+ * Get debug information related to WordPress
724
+ *
725
+ */
726
public static function get_wp_info() {
727
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
728
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
737
$res = array(
738
'Server:' => $_SERVER['SERVER_SOFTWARE'],
739
'PHP:' => PHP_VERSION,
740
+ 'PHP SAPI:' => php_sapi_name(),
741
'WordPress:' => $GLOBALS['wp_version'],
742
'Multisite:' => is_multisite() ? 'yes' : 'no',
743
'File system:' => $fs->get_method(),
744
+ 'Temp folder:' => get_temp_dir(),
745
+ 'Umask:' => sprintf( '%o', umask() ^ 511 /*0777*/ ),
746
'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
747
'ZipArchive:' => class_exists( 'ZipArchive', FALSE ) ? 'yes' : 'no',
748
'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
749
'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no',
750
+ 'SQLite(PDO):' => extension_loaded( 'pdo_sqlite' ) ? 'yes' : 'no',
751
'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
752
+ 'User agent:' => $_SERVER['HTTP_USER_AGENT'],
753
);
754
755
// Child and parent themes
775
}
776
}
777
778
+ // Blocked self requests
779
+ $installed = array_reverse( IP_Geo_Block_Logs::search_logs( IP_Geo_Block::get_ip_address() ) );
780
+ foreach ( $installed as $val ) {
781
// hide port and nonce
782
$method = preg_replace( '/\[\d+\]/', '', $val['method'] );
783
$method = preg_replace( '/(' . IP_Geo_Block::PLUGIN_NAME . '-auth-nonce)(?:=|%3D)([\w]+)/', '$1=...', $method );
admin/includes/class-admin-rewrite.php CHANGED
@@ -37,13 +37,13 @@ class IP_Geo_Block_Admin_Rewrite {
37
),
38
'.user.ini' => array(
39
'plugins' => array(
40
- '; BEGIN IP Geo Block',
41
- 'auto_prepend_file = "%ABSPATH%wp-load.php"',
42
'; END IP Geo Block',
43
),
44
'themes' => array(
45
- '; BEGIN IP Geo Block',
46
- 'auto_prepend_file = "%ABSPATH%wp-load.php"',
47
'; END IP Geo Block',
48
),
49
),
@@ -53,13 +53,13 @@ class IP_Geo_Block_Admin_Rewrite {
53
// '# BEGIN IP Geo Block',
54
// 'location ~ %REWRITE_BASE%rewrite.php$ {}',
55
// 'location %WP_CONTENT_DIR%/plugins/ {',
56
- // ' rewrite ^%WP_CONTENT_DIR%/plugins/.*/.*\.php$ %REWRITE_BASE%rewrite.php break;',
57
// '}',
58
// '# END IP Geo Block',
59
// 'themes' => array(
60
// '# BEGIN IP Geo Block',
61
// 'location %WP_CONTENT_DIR%/themes/ {',
62
- // ' rewrite ^%WP_CONTENT_DIR%/themes/.*/.*\.php$ %REWRITE_BASE%rewrite.php break;',
63
// '}',
64
// '# END IP Geo Block',
65
// ),
@@ -68,11 +68,11 @@ class IP_Geo_Block_Admin_Rewrite {
68
69
private function __construct() {
70
// http://stackoverflow.com/questions/25017381/setting-php-document-root-on-webserver
71
- $this->doc_root = str_replace( $_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME'] );
72
- $this->base_uri = str_replace( $this->doc_root, '', IP_GEO_BLOCK_PATH );
73
74
// target directories
75
- $path = str_replace( $this->doc_root, '', WP_CONTENT_DIR );
76
$this->wp_dirs = array(
77
'plugins' => $path . '/plugins/',
78
'themes' => $path . '/themes/',
@@ -80,12 +80,12 @@ class IP_Geo_Block_Admin_Rewrite {
80
81
// Apache in wp-includes/vars.php
82
global $is_apache;
83
- if ( $is_apache )
84
$this->config_file = '.htaccess';
85
86
// CGI/FastCGI SAPI (cgi, cgi-fcgi, fpm-fcgi)
87
- // elseif ( version_compare( PHP_VERSION, '5.3' ) >= 0 && FALSE !== strpos( php_sapi_name(), 'cgi' ) )
88
- // $this->config_file = ini_get( 'user_ini.filename' );
89
}
90
91
/**
@@ -96,6 +96,32 @@ class IP_Geo_Block_Admin_Rewrite {
96
return self::$instance ? self::$instance : ( self::$instance = new self );
97
}
98
99
/**
100
* Extract the block of rewrite rule
101
*
@@ -104,8 +130,7 @@ class IP_Geo_Block_Admin_Rewrite {
104
*/
105
private function find_rewrite_block( $content ) {
106
return preg_grep(
107
- '/^\s*?[#;]\s*?(?:BEGIN|END)\s*?IP Geo Block\s*?#x2F;i',
108
- (array)$content
109
);
110
}
111
@@ -173,6 +198,7 @@ class IP_Geo_Block_Admin_Rewrite {
173
}
174
175
// if content is empty then remove file
176
return empty( $content ) ? $fs->delete( $file ) : TRUE;
177
}
178
@@ -251,15 +277,45 @@ class IP_Geo_Block_Admin_Rewrite {
251
*/
252
private function append_rewrite_block( $which, $content ) {
253
if ( $type = $this->config_file ) {
254
- // in case `.user.ini` is configured differently
255
if ( '.htaccess' !== $type && '.user.ini' !== $type )
256
$type = '.user.ini';
257
258
return array_merge(
259
$content,
260
str_replace(
261
- array( '%REWRITE_BASE%', '%WP_CONTENT_DIR%', '%ABSPATH%' ),
262
- array( $this->base_uri, WP_CONTENT_DIR, ABSPATH ),
263
$this->rewrite_rule[ $type ][ $which ]
264
)
265
);
37
),
38
'.user.ini' => array(
39
'plugins' => array(
40
+ '; BEGIN IP Geo Block%ADDITIONAL%',
41
+ 'auto_prepend_file = "%IP_GEO_BLOCK_PATH%rewrite-ini.php"',
42
'; END IP Geo Block',
43
),
44
'themes' => array(
45
+ '; BEGIN IP Geo Block%ADDITIONAL%',
46
+ 'auto_prepend_file = "%IP_GEO_BLOCK_PATH%rewrite-ini.php"',
47
'; END IP Geo Block',
48
),
49
),
53
// '# BEGIN IP Geo Block',
54
// 'location ~ %REWRITE_BASE%rewrite.php$ {}',
55
// 'location %WP_CONTENT_DIR%/plugins/ {',
56
+ // ' rewrite ^%WP_CONTENT_DIR%/plugins/.*\.php$ %REWRITE_BASE%rewrite.php break;',
57
// '}',
58
// '# END IP Geo Block',
59
// 'themes' => array(
60
// '# BEGIN IP Geo Block',
61
// 'location %WP_CONTENT_DIR%/themes/ {',
62
+ // ' rewrite ^%WP_CONTENT_DIR%/themes/.*\.php$ %REWRITE_BASE%rewrite.php break;',
63
// '}',
64
// '# END IP Geo Block',
65
// ),
68
69
private function __construct() {
70
// http://stackoverflow.com/questions/25017381/setting-php-document-root-on-webserver
71
+ $this->doc_root = str_replace( DIRECTORY_SEPARATOR, '/', str_replace( $_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME'] ) );
72
+ $this->base_uri = str_replace( $this->doc_root, '', str_replace( DIRECTORY_SEPARATOR, '/', IP_GEO_BLOCK_PATH ) );
73
74
// target directories
75
+ $path = str_replace( $this->doc_root, '', str_replace( '\\', '/', WP_CONTENT_DIR ) );
76
$this->wp_dirs = array(
77
'plugins' => $path . '/plugins/',
78
'themes' => $path . '/themes/',
80
81
// Apache in wp-includes/vars.php
82
global $is_apache;
83
+ if ( ! empty( $is_apache ) )
84
$this->config_file = '.htaccess';
85
86
// CGI/FastCGI SAPI (cgi, cgi-fcgi, fpm-fcgi)
87
+ elseif ( version_compare( PHP_VERSION, '5.3' ) >= 0 && FALSE !== strpos( php_sapi_name(), 'cgi' ) )
88
+ $this->config_file = ini_get( 'user_ini.filename' );
89
}
90
91
/**
96
return self::$instance ? self::$instance : ( self::$instance = new self );
97
}
98
99
+ /**
100
+ * Remove empty element from the array
101
+ *
102
+ * @param array contents of configuration file
103
+ * @return array updated array of contents
104
+ */
105
+ private function remove_empty( $content ) {
106
+ while ( FALSE !== ( $tmp = reset( $content ) ) ) {
107
+ if ( strlen( trim( $tmp ) ) ) {
108
+ break;
109
+ } else {
110
+ array_shift( $content );
111
+ }
112
+ }
113
+
114
+ while ( FALSE !== ( $tmp = end( $content ) ) ) {
115
+ if ( strlen( trim( $tmp ) ) ) {
116
+ break;
117
+ } else {
118
+ array_pop( $content );
119
+ }
120
+ }
121
+
122
+ return $content;
123
+ }
124
+
125
/**
126
* Extract the block of rewrite rule
127
*
130
*/
131
private function find_rewrite_block( $content ) {
132
return preg_grep(
133
+ '/^\s*?[#;]\s*?(?:BEGIN|END)\s*?IP Geo Block\s*?#x2F;i', (array)$content
134
);
135
}
136
198
}
199
200
// if content is empty then remove file
201
+ $content = $this->remove_empty( $content );
202
return empty( $content ) ? $fs->delete( $file ) : TRUE;
203
}
204
277
*/
278
private function append_rewrite_block( $which, $content ) {
279
if ( $type = $this->config_file ) {
280
+ // in case that `.user.ini` is configured differently
281
if ( '.htaccess' !== $type && '.user.ini' !== $type )
282
$type = '.user.ini';
283
284
+ // in case that another `.user.ini` in ascendant directory
285
+ $additional = '';
286
+ if ( '.user.ini' === $type ) {
287
+ require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
288
+ $fs = IP_Geo_Block_FS::init( 'append_rewrite_block' );
289
+
290
+ $dir = dirname( IP_GEO_BLOCK_PATH ); // `/wp-content/plugins`
291
+ $ini = $this->config_file;
292
+ $doc = $this->doc_root;
293
+
294
+ do {
295
+ // avoid loop just in case
296
+ if ( ( $next = dirname( $dir ) ) !== $dir )
297
+ $dir = $next;
298
+ else
299
+ break;
300
+
301
+ if ( $fs->exists( "$dir/$ini" ) ) {
302
+ $tmp = $fs->get_contents_array( "$dir/$ini" );
303
+ $tmp = preg_replace( '/^\s*(auto_prepend_file.*)#x2F;', '; $1', $tmp );
304
+ $tmp = $this->remove_empty( $tmp );
305
+
306
+ if ( ! empty( $tmp ) )
307
+ $additional = PHP_EOL . PHP_EOL . implode( PHP_EOL, $tmp ) . PHP_EOL;
308
+
309
+ break;
310
+ }
311
+ } while ( $dir !== $doc );
312
+ }
313
+
314
return array_merge(
315
$content,
316
str_replace(
317
+ array( '%REWRITE_BASE%', '%WP_CONTENT_DIR%', '%IP_GEO_BLOCK_PATH%', '%ADDITIONAL%' ),
318
+ array( $this->base_uri, WP_CONTENT_DIR, IP_GEO_BLOCK_PATH, $additional ),
319
$this->rewrite_rule[ $type ][ $which ]
320
)
321
);
admin/includes/tab-accesslog.php CHANGED
@@ -25,9 +25,9 @@ class IP_Geo_Block_Admin_Tab {
25
);
26
27
$html = '<ul id="ip-geo-block-live-log">';
28
- $html .= '<li><input type="radio" name="ip-geo-block-live-log" id="ip-geo-block-live-log-start" value="start"><label for="ip-geo-block-live-log-start" title="Start"><span class="ip-geo-block-icon-play3"></span></label></li>';
29
- $html .= '<li><input type="radio" name="ip-geo-block-live-log" id="ip-geo-block-live-log-pause" value="pause"><label for="ip-geo-block-live-log-pause" title="Pause"><span class="ip-geo-block-icon-pause2"></span></label></li>';
30
- $html .= '<li><input type="radio" name="ip-geo-block-live-log" id="ip-geo-block-live-log-stop" value="stop" checked><label for="ip-geo-block-live-log-stop" title="Stop"><span class="ip-geo-block-icon-stop2"></span></label></li>';
31
$html .= '</ul>';
32
33
// Live update
25
);
26
27
$html = '<ul id="ip-geo-block-live-log">';
28
+ $html .= '<li><input type="radio" name="ip-geo-block-live-log" id="ip-geo-block-live-log-start" value="start"><label for="ip-geo-block-live-log-start" title="Start"><span class="ip-geo-block-icon-play"></span></label></li>';
29
+ $html .= '<li><input type="radio" name="ip-geo-block-live-log" id="ip-geo-block-live-log-pause" value="pause"><label for="ip-geo-block-live-log-pause" title="Pause"><span class="ip-geo-block-icon-pause"></span></label></li>';
30
+ $html .= '<li><input type="radio" name="ip-geo-block-live-log" id="ip-geo-block-live-log-stop" value="stop" checked><label for="ip-geo-block-live-log-stop" title="Stop"><span class="ip-geo-block-icon-stop"></span></label></li>';
31
$html .= '</ul>';
32
33
// Live update
admin/includes/tab-settings.php CHANGED
@@ -116,6 +116,8 @@ endif;
116
'<span class="ip-geo-block-sup">' . __( '(comma separated)', 'ip-geo-block' ) . '</span>',
117
'<span class="ip-geo-block-sup">' . __( '(comma or RET separated)', 'ip-geo-block' ) . '</span>',
118
'<span title="' . __( 'Toggle selection', 'ip-geo-block' ) . '"></span>',
119
);
120
121
// Matching rule
@@ -261,7 +263,7 @@ endif;
261
$field = 'signature';
262
add_settings_field(
263
$option_name.'_'.$field,
264
- __( '<dfn title="It validates malicious signatures independently of &#8220;Block by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target &#8220;Admin area&#8221;, &#8220;Admin ajax/post&#8221;, &#8220;Plugins area&#8221; and &#8220;Themes area&#8221;.">Bad signatures in query</dfn> <nobr>(<a class="ip-geo-block-cycle" id="ip-geo-block-decode" title="When you find ugly character string in the text area, please click to restore."><span></span></a>)</nobr>', 'ip-geo-block' ),
265
array( $context, 'callback_field' ),
266
$option_slug,
267
$section,
@@ -275,7 +277,7 @@ endif;
275
);
276
277
// Prevent malicious upload - white list of file extention and MIME type
278
- $list = '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Select allowed MIME type.">Whitelist of allowed MIME type</dfn>', 'ip-geo-block' ) . "<a class=\"ip-geo-block-cycle ip-geo-block-hide\">" . $comma[2] . "</a>\n<li class=\"ip-geo-block-hide\"><ul class=\"ip-geo-block-float\">\n";
279
280
// get_allowed_mime_types() in wp-includes/functions.php @since 2.8.6
281
foreach ( IP_Geo_Block_Util::get_allowed_mime_types() as $key => $val ) {
@@ -283,9 +285,9 @@ endif;
283
$val = esc_attr( $val );
284
$list .= '<li><input type="checkbox" id="ip_geo_block_settings_mimetype_white_list' . $key . '" name="ip_geo_block_settings[mimetype][white_list][' . $key . ']" value="' . $val . '"' . checked( isset( $options['mimetype']['white_list'][ $key ] ), TRUE, FALSE ) . '><label for="ip_geo_block_settings_mimetype_white_list' . $key . '"><dfn title="' . $val . '">' . $key . '</dfn></label></li>' . "\n";
285
}
286
- $list .= "</ul></li></ul>\n";
287
288
// Prevent malicious upload - black list of file extension
289
$list .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Put forbidden file extensions.">Blacklist of forbidden file extensions</dfn>', 'ip-geo-block' ) . "\n" . '<li class="ip-geo-block-hide"><ul><li><input type="text" class="regular-text code" id="ip_geo_block_settings_mimetype_black_list" name="ip_geo_block_settings[mimetype][black_list]" value="' . esc_attr( $options['mimetype']['black_list'] ) . '"/></li>';
290
$list .= "</ul></li></ul>\n";
291
@@ -524,7 +526,7 @@ endif;
524
'sub-field' => $key,
525
'value' => $options[ $field ][ $key ],
526
'text' => __( 'Block by country', 'ip-geo-block' ),
527
- 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual action as a blocking target.">Target actions</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $list . "</ul></li></ul>\n",
528
)
529
);
530
@@ -557,23 +559,22 @@ endif;
557
)
558
);
559
560
- // Get all the admin-post actions
561
- $installed = IP_Geo_Block_Util::get_registered_actions( FALSE );
562
-
563
$tmp = array(
564
__( 'admin post for logged-in user', 'ip-geo-block' ),
565
__( 'admin post for non logged-in user', 'ip-geo-block' ),
566
);
567
568
$exception = '';
569
foreach ( $installed as $key => $val ) {
570
$val = '';
571
$val .= $installed[ $key ] & 1 ? '<dfn title="' . $tmp[0] . '"><span class="ip-geo-block-admin-post dashicons dashicons-lock">*</span></dfn>' : '';
572
$val .= $installed[ $key ] & 2 ? '<dfn title="' . $tmp[1] . '"><span class="ip-geo-block-admin-post dashicons dashicons-unlock">*</span></dfn>' : '';
573
$key = esc_attr( $key );
574
$exception .= '<li>'
575
- . '<input id="ip_geo_block_' . $key . '" type="checkbox" value="1"' . checked( in_array( $key, $options['exception']['admin'] ), TRUE, FALSE ) . ' />'
576
- . '<label for="ip_geo_block_' . $key . '">' . $key . '</label>' . $val
577
. '</li>' . "\n";
578
}
579
@@ -596,23 +597,29 @@ endif;
596
'value' => $options[ $field ][ $key ],
597
'list' => $list,
598
'desc' => $desc,
599
- 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">'
600
- . __( '<dfn title="Specify the page name (&#8220;page=&hellip;&#8221;) or the action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking caused by &#8220;Block by country&#8221; for non logged-in user and &#8220;Prevent Zero-day Exploit&#8221; for logged-in user.">Exceptions</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-unlock ip-geo-block-hide"><span title="' . __( 'Toggle with non logged-in user', 'ip-geo-block' ) . '"></span></a><a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>'
601
- . "\n<li class=\"ip-geo-block-hide\"><ul><li>\n"
602
- . '<input class="regular-text code" id="ip_geo_block_settings_exception_admin" name="ip_geo_block_settings[exception][admin]" type="text" value="' . esc_attr( implode( ',', $options['exception']['admin'] ) ) . '">' . "\n"
603
- . $comma[0]
604
- . '</li><li><ul id="ip-geo-block-actions">'
605
- . '<h4>' . __( 'Candidate actions', 'ip-geo-block' ) . '</h4>'
606
- . $exception
607
- . '</ul></li></ul></li></ul>' . "\n",
608
)
609
);
610
611
array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
612
$desc = array(
613
__( 'Regardless of the country code, it will block a malicious request to <code>%s&ctdot;/*.php</code>.', 'ip-geo-block' ),
614
- __( '<dfn title="Select the item which causes undesired blocking in order to exclude from the validation target. Grayed item indicates &#8220;INACTIVE&#8221;.">Exceptions</dfn>', 'ip-geo-block' ),
615
- __( 'It configures &#8220;%s&#8221; to validate a request to the PHP file which does not load WordPress core.', 'ip-geo-block' ),
616
__( 'Sorry, but your server type is not supported.', 'ip-geo-block' ),
617
);
618
@@ -623,7 +630,6 @@ endif;
623
// Get all the plugins
624
$exception = '';
625
$installed = get_plugins(); // @since 1.5.0
626
- unset( $installed[ IP_GEO_BLOCK_BASE ] ); // exclude myself
627
628
$activated = get_site_option( 'active_sitewide_plugins' ); // @since 2.8.0
629
! is_array( $activated ) and $activated = array();
@@ -636,7 +642,7 @@ endif;
636
$key = esc_attr( $key[0] );
637
$exception .= '<li><input type="checkbox" id="ip_geo_block_settings_exception_plugins_' . $key
638
. '" name="ip_geo_block_settings[exception][plugins][' . $key
639
- . ']" value="1"' . checked( in_array( $key, $options['exception']['plugins'] ), TRUE, FALSE )
640
. ' /><label for="ip_geo_block_settings_exception_plugins_' . $key
641
. ($active ? '">' : '" class="folding-inactive">') . esc_html( $val['Name'] ) . "</label></li>\n";
642
}
@@ -669,15 +675,26 @@ endif;
669
'desc' => array(
670
2 => sprintf( $desc[0], $val ),
671
),
672
- 'before' => $tmp,
673
- 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . $desc[1] . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $exception . "</ul></li></ul>\n",
674
)
675
);
676
677
// Get all the themes
678
$exception = '';
679
- $installed = wp_get_themes( NULL ); // @since 3.4.0
680
- $activated = wp_get_theme(); // @since 3.4.0
681
$activated = $activated->get( 'Name' );
682
683
// List of installed themes
@@ -686,7 +703,7 @@ endif;
686
$active = ( ( $val = $val->get( 'Name' ) ) === $activated );
687
$exception .= '<li><input type="checkbox" id="ip_geo_block_settings_exception_themes_' . $key
688
. '" name="ip_geo_block_settings[exception][themes][' . $key
689
- . ']" value="1"' . checked( in_array( $key, $options['exception']['themes'] ), TRUE, FALSE )
690
. ' /><label for="ip_geo_block_settings_exception_themes_' . $key
691
. ($active ? '">' : '" class="folding-inactive">') . esc_html( $val ) . "</label></li>\n";
692
}
@@ -719,8 +736,19 @@ endif;
719
'desc' => array(
720
2 => sprintf( $desc[0], $val ),
721
),
722
- 'before' => $tmp,
723
- 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . $desc[1] . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $exception . "</ul></li></ul>\n",
724
)
725
);
726
@@ -881,7 +909,7 @@ endif;
881
);
882
883
// List of page
884
- $exception = '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual page as a blocking target.">Page</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
885
$tmp = get_pages();
886
if ( ! empty( $tmp ) ) {
887
foreach ( $tmp as $key ) {
@@ -893,7 +921,7 @@ endif;
893
$exception .= '</ul></li></ul>' . "\n";
894
895
// List of post type
896
- $exception .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual post type on a single page as a blocking target.">Post type</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
897
$tmp = get_post_types( array( 'public' => TRUE ) );
898
if ( ! empty( $tmp ) ) {
899
foreach ( $tmp as $key ) {
@@ -905,7 +933,7 @@ endif;
905
$exception .= '</ul></li></ul>' . "\n";
906
907
// List of category
908
- $exception .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual category on a single page or archive page as a blocking target.">Category</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
909
$tmp = get_categories( array( 'hide_empty' => FALSE ) );
910
if ( ! empty( $tmp ) ) {
911
foreach ( $tmp as $key ) {
@@ -917,7 +945,7 @@ endif;
917
$exception .= '</ul></li></ul>' . "\n";
918
919
// List of tag
920
- $exception .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual tag on a single page or archive page as a blocking target.">Tag</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
921
$tmp = get_tags( array( 'hide_empty' => FALSE ) );
922
if ( ! empty( $tmp ) ) {
923
foreach ( $tmp as $key ) {
@@ -1077,12 +1105,10 @@ endif;
1077
// Local DBs for each API
1078
$providers = IP_Geo_Block_Provider::get_addons();
1079
if ( empty( $providers ) ) {
1080
- $context->add_admin_notice( 'error',
1081
- sprintf(
1082
- __( 'Can not find geolocation API libraries in <code>%s</code>. It seems to have failed downloading <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip" title="Download the contents of tokkonopapa/WordPress-IP-Geo-API as a zip file">ZIP file</a> from <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API" title="tokkonopapa/WordPress-IP-Geo-API - GitHub">WordPress-IP-Geo-API</a>. Please install <code>ip-geo-api</code> with write permission according to <a rel="noreferrer" href="http://www.ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How can I fix permission troubles? | IP Geo Block">this instruction</a>.', 'ip-geo-block' ),
1083
- apply_filters( 'ip-geo-block-api-dir', basename( WP_CONTENT_DIR ) )
1084
- )
1085
- );
1086
}
1087
1088
add_settings_section(
@@ -1205,7 +1231,7 @@ endif;
1205
0 => __( 'Disable', 'ip-geo-block' ),
1206
1 => __( 'When requests blocked', 'ip-geo-block' ),
1207
2 => __( 'When requests passed', 'ip-geo-block' ),
1208
- 6 => __( 'When blocked or passed from undesired country', 'ip-geo-block' ),
1209
3 => __( 'Unauthenticated visitor', 'ip-geo-block' ),
1210
4 => __( 'Authenticated user', 'ip-geo-block' ),
1211
5 => __( 'All the validation', 'ip-geo-block' ),
116
'<span class="ip-geo-block-sup">' . __( '(comma separated)', 'ip-geo-block' ) . '</span>',
117
'<span class="ip-geo-block-sup">' . __( '(comma or RET separated)', 'ip-geo-block' ) . '</span>',
118
'<span title="' . __( 'Toggle selection', 'ip-geo-block' ) . '"></span>',
119
+ '<span title="' . __( 'Find blocked requests in &#8220;Logs&#8220;', 'ip-geo-block' ) . '"></span>',
120
+ __( 'Before adding as &#8220;Exception&#8221;, please click on &#8220;<a class="ip-geo-block-icon ip-geo-block-icon-alert" title="This button is just a sample."><span></span></a>&#8221; button (if exists) attached to the following list to confirm that the blocked request is not malicious.', 'ip-geo-block' ),
121
);
122
123
// Matching rule
263
$field = 'signature';
264
add_settings_field(
265
$option_name.'_'.$field,
266
+ __( '<dfn title="It validates malicious signatures independently of &#8220;Block by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target &#8220;Admin area&#8221;, &#8220;Admin ajax/post&#8221;, &#8220;Plugins area&#8221; and &#8220;Themes area&#8221;.">Bad signatures in query</dfn> <nobr>(<a class="ip-geo-block-icon ip-geo-block-icon-cycle" id="ip-geo-block-decode" title="When you find ugly character string in the text area, please click to restore."><span></span></a>)</nobr>', 'ip-geo-block' ),
267
array( $context, 'callback_field' ),
268
$option_slug,
269
$section,
277
);
278
279
// Prevent malicious upload - white list of file extention and MIME type
280
+ $list = '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Select allowed MIME type.">Whitelist of allowed MIME type</dfn>', 'ip-geo-block' ) . "<a class=\"ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide\">" . $comma[2] . "</a>\n<li class=\"ip-geo-block-hide\"><ul class=\"ip-geo-block-float\">\n";
281
282
// get_allowed_mime_types() in wp-includes/functions.php @since 2.8.6
283
foreach ( IP_Geo_Block_Util::get_allowed_mime_types() as $key => $val ) {
285
$val = esc_attr( $val );
286
$list .= '<li><input type="checkbox" id="ip_geo_block_settings_mimetype_white_list' . $key . '" name="ip_geo_block_settings[mimetype][white_list][' . $key . ']" value="' . $val . '"' . checked( isset( $options['mimetype']['white_list'][ $key ] ), TRUE, FALSE ) . '><label for="ip_geo_block_settings_mimetype_white_list' . $key . '"><dfn title="' . $val . '">' . $key . '</dfn></label></li>' . "\n";
287
}
288
289
// Prevent malicious upload - black list of file extension
290
+ $list .= "</ul></li></ul>\n";
291
$list .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Put forbidden file extensions.">Blacklist of forbidden file extensions</dfn>', 'ip-geo-block' ) . "\n" . '<li class="ip-geo-block-hide"><ul><li><input type="text" class="regular-text code" id="ip_geo_block_settings_mimetype_black_list" name="ip_geo_block_settings[mimetype][black_list]" value="' . esc_attr( $options['mimetype']['black_list'] ) . '"/></li>';
292
$list .= "</ul></li></ul>\n";
293
526
'sub-field' => $key,
527
'value' => $options[ $field ][ $key ],
528
'text' => __( 'Block by country', 'ip-geo-block' ),
529
+ 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual action as a blocking target.">Target actions</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $list . "</ul></li></ul>\n",
530
)
531
);
532
559
)
560
);
561
562
$tmp = array(
563
__( 'admin post for logged-in user', 'ip-geo-block' ),
564
__( 'admin post for non logged-in user', 'ip-geo-block' ),
565
);
566
567
+ // Get all the admin-post actions
568
$exception = '';
569
+ $installed = IP_Geo_Block_Util::get_registered_actions( FALSE );
570
foreach ( $installed as $key => $val ) {
571
$val = '';
572
$val .= $installed[ $key ] & 1 ? '<dfn title="' . $tmp[0] . '"><span class="ip-geo-block-admin-post dashicons dashicons-lock">*</span></dfn>' : '';
573
$val .= $installed[ $key ] & 2 ? '<dfn title="' . $tmp[1] . '"><span class="ip-geo-block-admin-post dashicons dashicons-unlock">*</span></dfn>' : '';
574
$key = esc_attr( $key );
575
$exception .= '<li>'
576
+ . '<input id="ip_geo_block_settings_exception_admin_' . $key . '" type="checkbox" value="' . $key . '"' . checked( in_array( $key, $options['exception']['admin'] ), TRUE, FALSE ) . ' />'
577
+ . '<label for="ip_geo_block_settings_exception_admin_' . $key . '">' . $key . '</label>' . $val
578
. '</li>' . "\n";
579
}
580
597
'value' => $options[ $field ][ $key ],
598
'list' => $list,
599
'desc' => $desc,
600
+ 'after' =>
601
+ '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . "\n" .
602
+ ' <dfn title="' . __( 'Specify the action name (&#8220;action=&hellip;&#8221;) or the page name (&#8220;page=&hellip;&#8221;) to prevent unintended blocking caused by &#8220;Block by country&#8221; (for non logged-in user) and &#8220;Prevent Zero-day Exploit&#8221; (for logged-in user).', 'ip-geo-block' ) . '">' . __( 'Exceptions', 'ip-geo-block' ) . "</dfn>\n" .
603
+ ' <a class="ip-geo-block-hide ip-geo-block-icon ip-geo-block-icon-unlock"><span title="' . __( 'Toggle with non logged-in user', 'ip-geo-block' ) . '"></span></a><a class="ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide" data-target="admin">' . $comma[2] . '</a><a class="ip-geo-block-icon ip-geo-block-icon-find ip-geo-block-hide" data-target="admin">' . $comma[3] . "</a>\n" .
604
+ ' <li class="ip-geo-block-hide">' . "\n" .
605
+ ' <input class="regular-text code" id="ip_geo_block_settings_exception_admin" name="ip_geo_block_settings[exception][admin]" type="text" value="' . esc_attr( implode( ',', $options['exception']['admin'] ) ) . '">' . $comma[0] . "\n" .
606
+ ' <h4>' . __( 'Candidate actions/pages', 'ip-geo-block' ) . "</h4>\n" .
607
+ ' <p class="ip-geo-block-find-desc">' . $comma[4] . '<span id="ip-geo-block-find-admin"></span></p>' . "\n" .
608
+ ' </li>' . "\n" .
609
+ ' <li class="ip-geo-block-hide">' . "\n" .
610
+ ' <ul class="ip-geo-block-list-exceptions" id="ip-geo-block-list-admin">' . "\n" .
611
+ $exception .
612
+ ' </ul>' . "\n" .
613
+ ' </li>' . "\n" .
614
+ '</ul>'
615
)
616
);
617
618
array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
619
$desc = array(
620
__( 'Regardless of the country code, it will block a malicious request to <code>%s&ctdot;/*.php</code>.', 'ip-geo-block' ),
621
+ __( 'Select the item which causes unintended blocking in order to exclude from the validation target. Grayed item indicates &#8220;INACTIVE&#8221;.', 'ip-geo-block' ),
622
+ __( 'It configures &#8220;%s&#8221; to validate a request to the PHP file which does not load WordPress core. Make sure to deny direct access to the hidden files beginning with a dot by the server\'s configuration.', 'ip-geo-block' ),
623
__( 'Sorry, but your server type is not supported.', 'ip-geo-block' ),
624
);
625
630
// Get all the plugins
631
$exception = '';
632
$installed = get_plugins(); // @since 1.5.0
633
634
$activated = get_site_option( 'active_sitewide_plugins' ); // @since 2.8.0
635
! is_array( $activated ) and $activated = array();
642
$key = esc_attr( $key[0] );
643
$exception .= '<li><input type="checkbox" id="ip_geo_block_settings_exception_plugins_' . $key
644
. '" name="ip_geo_block_settings[exception][plugins][' . $key
645
+ . ']" value="' . $key . '"' . checked( in_array( $key, $options['exception']['plugins'] ), TRUE, FALSE )
646
. ' /><label for="ip_geo_block_settings_exception_plugins_' . $key
647
. ($active ? '">' : '" class="folding-inactive">') . esc_html( $val['Name'] ) . "</label></li>\n";
648
}
675
'desc' => array(
676
2 => sprintf( $desc[0], $val ),
677
),
678
+ 'after' => $tmp .
679
+ '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . "\n" .
680
+ ' <dfn title="' . $desc[1] . '">' . __( 'Exceptions', 'ip-geo-block' ) . "</dfn>\n" .
681
+ ' <a class="ip-geo-block-hide ip-geo-block-icon ip-geo-block-icon-cycle">' . $comma[2] . '</a><a class="ip-geo-block-icon ip-geo-block-icon-find ip-geo-block-hide" data-target="plugins">' . $comma[3] . "</a>\n" .
682
+ ' <li class="ip-geo-block-hide">' . "\n" .
683
+ ' <p class="ip-geo-block-find-desc">' . $comma[4] . '<span id="ip-geo-block-find-plugins"></span></p>' . "\n" .
684
+ ' </li>' . "\n" .
685
+ ' <li class="ip-geo-block-hide">' . "\n" .
686
+ ' <ul class="ip-geo-block-list-exceptions" id="ip-geo-block-list-plugins">' . "\n" .
687
+ $exception .
688
+ ' </ul>' . "\n" .
689
+ ' </li>' . "\n" .
690
+ '</ul>'
691
)
692
);
693
694
// Get all the themes
695
$exception = '';
696
+ $installed = wp_get_themes(); // @since 3.4.0
697
+ $activated = wp_get_theme(); // @since 3.4.0
698
$activated = $activated->get( 'Name' );
699
700
// List of installed themes
703
$active = ( ( $val = $val->get( 'Name' ) ) === $activated );
704
$exception .= '<li><input type="checkbox" id="ip_geo_block_settings_exception_themes_' . $key
705
. '" name="ip_geo_block_settings[exception][themes][' . $key
706
+ . ']" value="' . $key . '"' . checked( in_array( $key, $options['exception']['themes'] ), TRUE, FALSE )
707
. ' /><label for="ip_geo_block_settings_exception_themes_' . $key
708
. ($active ? '">' : '" class="folding-inactive">') . esc_html( $val ) . "</label></li>\n";
709
}
736
'desc' => array(
737
2 => sprintf( $desc[0], $val ),
738
),
739
+ 'after' => $tmp .
740
+ '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . "\n" .
741
+ ' <dfn title="' . $desc[1] . '">' . __( 'Exceptions', 'ip-geo-block' ) . "</dfn>\n" .
742
+ ' <a class="ip-geo-block-hide ip-geo-block-icon ip-geo-block-icon-cycle">' . $comma[2] . '</a><a class="ip-geo-block-icon ip-geo-block-icon-find ip-geo-block-hide" data-target="themes">' . $comma[3] . "</a>\n" .
743
+ ' <li class="ip-geo-block-hide">' . "\n" .
744
+ ' <p class="ip-geo-block-find-desc">' . $comma[4] . '<span id="ip-geo-block-find-themes"></span></p>' . "\n" .
745
+ ' </li>' . "\n" .
746
+ ' <li class="ip-geo-block-hide">' . "\n" .
747
+ ' <ul class="ip-geo-block-list-exceptions" id="ip-geo-block-list-themes">' . "\n" .
748
+ $exception .
749
+ ' </ul>' . "\n" .
750
+ ' </li>' . "\n" .
751
+ '</ul>'
752
)
753
);
754
909
);
910
911
// List of page
912
+ $exception = '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual page as a blocking target.">Page</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
913
$tmp = get_pages();
914
if ( ! empty( $tmp ) ) {
915
foreach ( $tmp as $key ) {
921
$exception .= '</ul></li></ul>' . "\n";
922
923
// List of post type
924
+ $exception .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual post type on a single page as a blocking target.">Post type</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
925
$tmp = get_post_types( array( 'public' => TRUE ) );
926
if ( ! empty( $tmp ) ) {
927
foreach ( $tmp as $key ) {
933
$exception .= '</ul></li></ul>' . "\n";
934
935
// List of category
936
+ $exception .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual category on a single page or archive page as a blocking target.">Category</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
937
$tmp = get_categories( array( 'hide_empty' => FALSE ) );
938
if ( ! empty( $tmp ) ) {
939
foreach ( $tmp as $key ) {
945
$exception .= '</ul></li></ul>' . "\n";
946
947
// List of tag
948
+ $exception .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the individual tag on a single page or archive page as a blocking target.">Tag</dfn>', 'ip-geo-block' ) . '<a class="ip-geo-block-icon ip-geo-block-icon-cycle ip-geo-block-hide">' . $comma[2] . '</a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
949
$tmp = get_tags( array( 'hide_empty' => FALSE ) );
950
if ( ! empty( $tmp ) ) {
951
foreach ( $tmp as $key ) {
1105
// Local DBs for each API
1106
$providers = IP_Geo_Block_Provider::get_addons();
1107
if ( empty( $providers ) ) {
1108
+ $context->add_admin_notice( 'error', sprintf(
1109
+ __( 'Can not find geolocation API libraries in <code>%s</code>. It seems to have failed downloading <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip" title="Download the contents of tokkonopapa/WordPress-IP-Geo-API as a zip file">ZIP file</a> from <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API" title="tokkonopapa/WordPress-IP-Geo-API - GitHub">WordPress-IP-Geo-API</a>. Please install <code>ip-geo-api</code> with write permission according to <a rel="noreferrer" href="http://www.ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How can I fix permission troubles? | IP Geo Block">this instruction</a>.', 'ip-geo-block' ),
1110
+ apply_filters( 'ip-geo-block-api-dir', basename( WP_CONTENT_DIR ) )
1111
+ ) );
1112
}
1113
1114
add_settings_section(
1231
0 => __( 'Disable', 'ip-geo-block' ),
1232
1 => __( 'When requests blocked', 'ip-geo-block' ),
1233
2 => __( 'When requests passed', 'ip-geo-block' ),
1234
+ 6 => __( 'When &#8220;blocked&#8221; or &#8220;passed (not in whitelist)&#8221;', 'ip-geo-block' ),
1235
3 => __( 'Unauthenticated visitor', 'ip-geo-block' ),
1236
4 => __( 'Authenticated user', 'ip-geo-block' ),
1237
5 => __( 'All the validation', 'ip-geo-block' ),
admin/includes/tab-statistics.php CHANGED
@@ -182,7 +182,7 @@ endif;
182
*----------------------------------------*/
183
add_settings_section(
184
$section = $plugin_slug . '-stat-logs',
185
- __( 'Statistics in logs', 'ip-geo-block' ),
186
( $options['validation']['reclogs'] ?
187
array( __CLASS__, 'statistics_logs' ) :
188
array( __CLASS__, 'warn_validation' )
@@ -282,9 +282,6 @@ endif;
282
*
283
*/
284
public static function statistics_logs() {
285
- // array of ( `time`, `ip`, `hook`, `code`, `method`, `data` )
286
- $logs = IP_Geo_Block_Logs::get_recent_logs( YEAR_IN_SECONDS );
287
-
288
// Count by key
289
$count = array();
290
$keys = array(
@@ -294,61 +291,65 @@ endif;
294
'slug' => __( 'Slug in back-end', 'ip-geo-block' ),
295
);
296
297
- // Make list of top 10
298
- foreach( $logs as $val ) {
299
- $val['ip'] = '[' . $val['code'] . '] ' . $val['ip'];
300
- $key = $val['method'] . ' ' . $val['data'];
301
302
// <methodName>...</methodName>
303
if ( preg_match( '#<methodName>(.*?)</methodName>#', $key, $matches ) ) {
304
- $val['slug'] = '/xmlrpc.php ' . $matches[1];
305
}
306
307
// /wp-content/(plugins|themes)/...
308
elseif ( preg_match( '#(/wp-content/(?:plugins|themes)/.*?/)#', $key, $matches ) ) {
309
- $val['slug'] = $matches[1];
310
}
311
312
// /wp-admin/admin*.php?action=...
313
- elseif ( preg_match( '#(/wp-admin/admin.*?\.php).*((?:page|action)=[\w-]+)#', $key, $matches ) ) {
314
- $val['slug'] = $matches[1] . (isset( $matches[2] ) ? ' ' . $matches[2] : '');
315
}
316
317
// /wp-admin/*.php
318
elseif ( preg_match( '#(/wp-admin/(?!admin).*?\.php)#', $key, $matches ) ) {
319
- $val['slug'] = $matches[1];
320
}
321
322
// file uploading *.(zip|tar|rar|gz|php|...)
323
elseif ( preg_match( '#(\[name\]\s*?=>.*\.\w+?)\b#', $key, $matches ) ) {
324
- $val['slug'] = $matches[1];
325
}
326
327
- // /*.php
328
- elseif ( preg_match( '#^\w+?\[\d+?\]:(/[^/]+?\.php)#', $key, $matches ) ) {
329
- $val['slug'] = $matches[1];
330
}
331
332
foreach ( array_keys( $keys ) as $key ) {
333
- if ( ! empty( $val[ $key ] ) ) {
334
- $count[ $key ][] = $val[ $key ];
335
}
336
}
337
}
338
339
$options = IP_Geo_Block::get_option();
340
341
- foreach ( $keys as $slug => $val ) {
342
- echo '<ol class="ip-geo-block-top-list"><h4>', esc_html( $val ), '</h4>';
343
344
if ( isset( $count[ $slug ] ) ) {
345
$logs = array_count_values( $count[ $slug ] );
346
arsort( $logs );
347
348
if ( 'slug' !== $slug )
349
- $logs = array_slice( $logs, 0, 10 );
350
351
- foreach ( $logs as $key => $val ) {
352
$link = explode( ' ', $key );
353
$link = esc_html( end( $link ) );
354
$key = esc_html( $key );
@@ -367,7 +368,7 @@ endif;
367
'" target=_blank>' . $link . '</a>',
368
$key
369
);
370
- echo '</code> (', (int)$val, ')</li>', "\n";
371
}
372
}
373
182
*----------------------------------------*/
183
add_settings_section(
184
$section = $plugin_slug . '-stat-logs',
185
+ __( 'Statistics in Logs', 'ip-geo-block' ),
186
( $options['validation']['reclogs'] ?
187
array( __CLASS__, 'statistics_logs' ) :
188
array( __CLASS__, 'warn_validation' )
282
*
283
*/
284
public static function statistics_logs() {
285
// Count by key
286
$count = array();
287
$keys = array(
291
'slug' => __( 'Slug in back-end', 'ip-geo-block' ),
292
);
293
294
+ // Count by keys ($log: `time`, `ip`, `hook`, `code`, `method`, `data`)
295
+ foreach( IP_Geo_Block_Logs::get_recent_logs( YEAR_IN_SECONDS ) as $log ) {
296
+ $log['ip'] = '[' . $log['code'] . '] ' . $log['ip'];
297
+ $key = $log['method'] . ' ' . $log['data'];
298
299
// <methodName>...</methodName>
300
if ( preg_match( '#<methodName>(.*?)</methodName>#', $key, $matches ) ) {
301
+ $log['slug'] = '/xmlrpc.php ' . $matches[1];
302
}
303
304
// /wp-content/(plugins|themes)/...
305
elseif ( preg_match( '#(/wp-content/(?:plugins|themes)/.*?/)#', $key, $matches ) ) {
306
+ $log['slug'] = $matches[1];
307
}
308
309
// /wp-admin/admin*.php?action=...
310
+ elseif ( preg_match( '#(/wp-admin/admin.*?\.php).*((?:page|action)=[-\w]+)#', $key, $matches ) ) {
311
+ $log['slug'] = $matches[1] . ' ' . $matches[2];
312
}
313
314
// /wp-admin/*.php
315
elseif ( preg_match( '#(/wp-admin/(?!admin).*?\.php)#', $key, $matches ) ) {
316
+ $log['slug'] = $matches[1];
317
}
318
319
// file uploading *.(zip|tar|rar|gz|php|...)
320
elseif ( preg_match( '#(\[name\]\s*?=>.*\.\w+?)\b#', $key, $matches ) ) {
321
+ $log['slug'] = $matches[1];
322
}
323
324
+ // other *.php file with or without query string
325
+ elseif ( preg_match( '#(/[^/]*\.php)[^/\w]#', $key, $matches ) && FALSE === strpos( $key, '/wp-admin/' ) ) {
326
+ $log['slug'] = $matches[1];
327
}
328
329
foreach ( array_keys( $keys ) as $key ) {
330
+ if ( ! empty( $log[ $key ] ) ) {
331
+ $count[ $key ][] = $log[ $key ];
332
}
333
}
334
}
335
336
$options = IP_Geo_Block::get_option();
337
338
+ // Statistics by keys
339
+ foreach ( $keys as $slug => $log ) {
340
+ if ( 'slug' !== $slug )
341
+ echo '<ol class="ip-geo-block-top-list"><h4>', esc_html( $log ), '</h4>';
342
+ else
343
+ echo '<ol class="ip-geo-block-top-list"><h4>', esc_html( $log ), ' <a class="ip-geo-block-icon ip-geo-block-icon-cycle" id="ip-geo-block-sort-slug" title="', __( 'Toggle sorting order', 'ip-geo-block' ) ,'"><span></span></a></h4>';
344
345
if ( isset( $count[ $slug ] ) ) {
346
$logs = array_count_values( $count[ $slug ] );
347
arsort( $logs );
348
349
if ( 'slug' !== $slug )
350
+ $logs = array_slice( $logs, 0, 10 ); // Make list of top 10
351
352
+ foreach ( $logs as $key => $log ) {
353
$link = explode( ' ', $key );
354
$link = esc_html( end( $link ) );
355
$key = esc_html( $key );
368
'" target=_blank>' . $link . '</a>',
369
$key
370
);
371
+ echo '</code> (', (int)$log, ')</li>', "\n";
372
}
373
}
374
admin/js/admin.js CHANGED
@@ -2,7 +2,7 @@
2
/*eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"]*/
3
/*!
4
* Project: WordPress IP Geo Block
5
- * Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
6
* This software is released under the MIT License.
7
*/
8
(function ($, window, document) {
@@ -10,7 +10,7 @@
10
11
// External variables
12
var timer_stack = [],
13
- window_width = $(window).width(),
14
ip_geo_block = IP_GEO_BLOCK,
15
ip_geo_block_auth = IP_GEO_BLOCK_AUTH;
16
@@ -27,7 +27,7 @@
27
}
28
29
function escapeHTML(str) {
30
- return str ? str.toString().replace(/[&<>"']/g, function (match) {
31
return {
32
'&': '&amp;',
33
'<': '&lt;',
@@ -35,11 +35,11 @@
35
'"': '&quot;',
36
"'": '&#39;'
37
}[match];
38
- }) : '';
39
}
40
41
function stripTag(str) {
42
- return str.replace(/(<([^>]+)>)/ig, '');
43
}
44
45
function onresize(name, callback) {
@@ -68,22 +68,22 @@
68
}
69
70
function confirm(msg, callback) {
71
- if (window.confirm(stripTag(msg))) {
72
callback();
73
}
74
}
75
76
- function warning(status, msg) {
77
- window.alert(stripTag(status ? status + ': ' + msg : msg));
78
}
79
80
function notice_html5() {
81
- warning(null, ip_geo_block.msg[8]);
82
}
83
84
function redirect(page, tab) {
85
if (-1 !== window.location.href.indexOf(page)) {
86
- window.location = escapeHTML(page) + (tab ? '&' + escapeHTML(tab) : '') + '&ip-geo-block-auth-nonce=' + ip_geo_block_auth.nonce;
87
}
88
}
89
@@ -103,13 +103,13 @@
103
}
104
})
105
106
- .fail(function (jqXHR, textStatus/*, errorThrown*/) {
107
- warning(textStatus, jqXHR.responseText);
108
})
109
110
.always(function () {
111
if (id) {
112
- if (objs) {
113
$.when.apply($, objs).then(function () {
114
loading(id, false);
115
});
@@ -160,18 +160,22 @@
160
if (stat) {
161
obj.removeClass('folding-disable');
162
} else {
163
- obj.children('li,a').hide();
164
obj.addClass('folding-disable');
165
obj.removeClass(ID('dropdown')).addClass(ID('dropup'));
166
}
167
}
168
169
- // Show/Hide folding list
170
- function show_folding_list($this, element, mask) {
171
var stat = (0 === $this.prop('type').indexOf('checkbox') && $this.is(':checked')) ||
172
(0 === $this.prop('type').indexOf('select' ) && '0' !== $this.val());
173
174
- element.nextAll(ID('.', 'settings-folding')).each(function (i, obj) {
175
fold_elements($(obj), stat && mask);
176
});
177
}
@@ -238,7 +242,7 @@
238
parent.find(ID('.', 'desc')).css('opacity', checked ? 1.0 : 0.5);
239
240
// Show / Hide validation target
241
- show_folding_list($this, select, '1' === select.val() ? true : false);
242
}
243
244
/**
@@ -701,7 +705,7 @@
701
function add_icon(dfn, span, title, icon) {
702
var i, j;
703
i = dfn.cloneNode(false);
704
- i.setAttribute('title', title);
705
j = span.cloneNode(false);
706
j.setAttribute('class', 'dashicons dashicons-' + icon);
707
i.appendChild(j);
@@ -845,7 +849,7 @@
845
if (!cmd) {
846