IP Geo Block - Version 3.0.4.6

Version Description

  • Bug fix: Fix the issue that the emergent functionality didn't work when the number of login attempts reached to the limit.
  • Bug fix: Fix the issue that the result would be always limited when "Max number of failed login attempts per IP address" is "Disabled".
Download this release

Release Info

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

Code changes from version 3.0.3.4 to 3.0.4.6

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.8
7
- Stable tag: 3.0.3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,42 +12,42 @@ It blocks spam posts, login attempts and malicious access to the back-end reques
12
 
13
  == Description ==
14
 
15
- A considerable number of WordPress vulnerabilities in plugins and themes have been disclosed every month. You can easily find them at [WPScan Vulnerability Database](https://wpvulndb.com/ "WPScan Vulnerability Database") and [Exploits Database](https://www.exploit-db.com/ "Exploits Database by Offensive Security"). It means that we're always exposed to the threats of being exploited caused by those vulnerabilities.
16
 
17
- This plugin protects your site against such threats of attack against the back-end of your site such as login form, XML-RPC (login attempt) and admin area. It also blocks undesired comment spam, trackback and pingback spam and any requests to public facing pages aka front-end from undesired countries.
18
 
19
  After several days of installation, you'll be supprised to find many malicious or undesirable accesses are blocked especially if you enable Zero-day Expoit Prevention.
20
 
21
  = Features =
22
 
23
  * **Immigration control:**
24
- Access to the basic and important entrances into the back-end such as `wp-comments-post.php`, `xmlrpc.php`, `wp-login.php`, `wp-signup.php`, `wp-admin/admin.php`, `wp-admin/admin-ajax.php`, `wp-admin/admin-post.php` will be validated by means of a country code based on IP address. It allows you to configure either whitelist or blacklist to specify the countires.
25
 
26
  * **Zero-day Exploit Prevention:**
27
- Unlike other security plugins and firewalls based on attack patterns, the original feature "**W**ord**P**ress **Z**ero-day **E**xploit **P**revention" (WP-ZEP) is focused on vulnerability patterns. It is simple but still smart and strong enough to block any malicious accesses to `wp-admin/*.php`, `plugins/*.php` and `themes/*.php` even from the permitted countries. It will protect your site against certain types of attack such as CSRF, LFI, SQLi, XSS and so on, **even if you have some vulnerable plugins and themes in your site**.
28
 
29
  * **Guard against login attempts:**
30
  In order to prevent hacking through the login form and XML-RPC by brute-force and the reverse-brute-force attacks, the number of login attempts will be limited per IP address even from the permitted countries.
31
 
32
  * **Minimize server load against brute-force attacks:**
33
- You can configure this plugin as a [Must Use Plugins](https://codex.wordpress.org/Must_Use_Plugins "Must Use Plugins « WordPress Codex") which would be loaded prior to regular plugins and can massively [reduce the load on server](http://www.ipgeoblock.com/codex/validation-timing.html "Validation timing | IP Geo Block").
34
 
35
  * **Prevent malicious down/uploading:**
36
- A malicious request such as exposing `wp-config.php` and uploading undesired files via vulnerable plugins or themes can be blocked.
37
 
38
  * **Support of BuddyPress and bbPress:**
39
- You can configure this plugin such that a registered user can login as the membership from anywhere, but a request such as a new user registration, lost password, creating a new topic, and subscribing comment is blocked by the country code. It is suitable for [BuddyPress](https://wordpress.org/plugins/buddypress/ "BuddyPress — WordPress Plugins") and [bbPress](https://wordpress.org/plugins/bbpress/ "WordPress bbPress « WordPress Plugins") to help reducing spams.
40
 
41
  * **Referrer suppressor for external links:**
42
  When you click an external hyperlink on admin screens, http referrer will be eliminated to hide a footprint of your site.
43
 
44
  * **Multiple source of IP Geolocation databases:**
45
- [MaxMind GeoLite free databases](http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention") and [IP2Location LITE databases](http://www.ip2location.com/ "IP Address Geolocation to Identify Website Visitor's Geographical Location") can be installed in this plugin. Those will be downloaded and updated (once a month) automatically. Also free Geolocation REST APIs and whois information can be available for audit purposes.
46
- Father more, if you use CloudFlare or CloudFront as a reverse proxy service, you can get [dedicated API class libraries](http://www.ipgeoblock.com/article/api-class-library.html "CloudFlare & CloudFront API class library | IP Geo Block") for these services.
47
 
48
  * **Customizing response:**
49
  HTTP response code can be selectable as `403 Forbidden` to deny access pages, `404 Not Found` to hide pages or even `200 OK` to redirect to the top page.
50
- You can also have the custom error page (for example `403.php`) in your theme template directory or child theme directory to fit your theme.
51
 
52
  * **Validation logs:**
53
  Validation logs can be recorded with useful information to audit attack patterns.
@@ -107,7 +107,10 @@ or following descriptions for your best setup.
107
  Specify the country code with two letters (see [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements "ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia")). Each of them should be separated by comma.
108
 
109
  * **White/Black list of extra IPs for prior validation**
110
- The list of extra IP addresses prior to the validation of country code. [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing "Classless Inter-Domain Routing - Wikipedia, the free encyclopedia") is acceptable to specify the range.
 
 
 
111
 
112
  * **$_SERVER keys for extra IPs**
113
  Additional IP addresses will be validated if some of keys in `$_SERVER` variable are specified in this textfield. Typically `HTTP_X_FORWARDED_FOR`.
@@ -143,10 +146,10 @@ or following descriptions for your best setup.
143
  Validate access to `wp-admin/admin-(ajax|post)*.php`.
144
 
145
  * **Plugins area**
146
- Validate direct access to plugins. Typically `wp-content/plugins/…/*.php`.
147
 
148
  * **Themes area**
149
- Validate direct access to themes. Typically `wp-content/themes/…/*.php`.
150
 
151
  = Front-end target settings =
152
 
@@ -273,15 +276,15 @@ You can find the "**Emergent Functionality**" code section near the bottom of `i
273
  * How to use: Activate the following code and upload this file via FTP.
274
  */
275
  /* -- ADD '/' TO THE TOP OR END OF THIS LINE TO ACTIVATE THE FOLLOWINGS -- */
276
- function ip_geo_block_emergency( $validate ) {
277
  $validate['result'] = 'passed';
278
  return $validate;
279
  }
280
- add_filter( 'ip-geo-block-login', 'ip_geo_block_emergency' );
281
- add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency' );
282
  // */`
283
 
284
- Please not that you have to use an [appropriate editor](https://codex.wordpress.org/Editing_Files#Using_Text_Editors "Editing Files « WordPress Codex").
285
 
286
  After saving and uploading it to `/wp-content/plugins/ip-geo-block/` on your server via FTP, you become to be able to login again as an admin.
287
 
@@ -349,6 +352,49 @@ Please refer to "[How can I fix permission troubles?](http://www.ipgeoblock.com/
349
 
350
  == Changelog ==
351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  = 3.0.3.4 =
353
  * **Improvement:** Some minor refactoring for the future release.
354
  * **Improvement:** Better throughput against attacks on admin area when `"mu-plugins" (ip-geo-block-mu.php)` is enable.
@@ -489,14 +535,14 @@ This is a maintenance release addressing some issues.
489
  * **Improvement:** Support clean uninstall for network / multisite.
490
  * **Improvement:** Improve the compatibility of downloading IP address databases for Microsoft IIS.
491
  * **Bug fix:** Support `FORCE_SSL_ADMIN`.
492
- * **Bug fix:** Fix the issue of [@](https://wordpress.org/support/topic/compatibility-with-ag-custom-admin "WordPress Support » Compatibility with AG Custom Admin") and change the option name "**Important files**" to "**Bad signatures in query**" to avoid misuse.
493
- * **Bug fix:** Fix the issue of [@](https://wordpress.org/support/topic/gb-added-to-whitelist "WordPress Support » GB added to whitelist") which might be caused by some race condition.
494
  * **Bug fix:** Fix the issue of restoring post revisions which was blocked.
495
 
496
  = 2.2.4.1 =
497
  Sorry for frequent updating.
498
 
499
- * **Bug fix:** Fixed the issue of `Warning: strpos(): Empty needle in...` that was reported in [@](https://wordpress.org/support/topic/version-224-produces-warning-message "WordPress Support » Version 2.2.4 Produces Warning Message") and [@](https://wordpress.org/support/topic/error-after-update-to-newest-version "WordPress › Support » Error after Update to newest version").
500
 
501
  = 2.2.4 =
502
  * **Bug fix:** Fixed the issue that some links on network admin of multisite were blocked when WP-ZEP for `admin area` or `admin ajax/post` was enabled.
@@ -553,7 +599,7 @@ Sorry for frequent update.
553
  * **Improvement:** Improved connectivity with Jetpack.
554
  * **Improvement:** Improved immediacy of downloading databases at upgrading.
555
  * **Improvement:** Replaced a terminated RESTful API service with a new stuff.
556
- * **Bug fix:** Fixed issue that clicking a link tag without href always refreshed the page. Thanks to [wyclef](https://wordpress.org/support/topic/conflict-with-menu-editor-plugin "WordPress Support » Conflict with Menu Editor plugin?").
557
  * **Bug fix:** Fixed issue that deactivating and activating repeatedly caused to show the welcome message.
558
  * **Bug fix:** Fixed issue that a misaligned argument in the function caused 500 internal server error when a request to the php files in plugins/themes area was rewrited to `rewrite.php`.
559
 
@@ -565,25 +611,25 @@ Sorry for frequent update.
565
  = 2.2.0 =
566
  * **Important:** Now **Block by country** and **Prevent Zero-day Exploit** become to work independently on **Admin area**, **Admin ajax/post** at **Validation target settings**. Please reconfirm them.
567
  * **Important:** Previously, a request whose country code can't be available was always blocked. But from this release, such a request is considered as comming from the country whose code is `ZZ`. It means that you can put `ZZ` into the white list and black list.
568
- * **New feature:** White list and Black list of extra IP addresses prior to the validation of country code. Thanks to Fabiano for good suggestions at [support forum](https://wordpress.org/support/topic/white-list-of-ip-addresses-or-ranges "WordPress Support » White list of IP addresses or ranges?")
569
  * **New feature:** Malicious signatures to prevent disclosing the important files via vulnerable plugins or themes. A malicious request to try to expose `wp-config.php` or `passwd` can be blocked.
570
  * **New feature:** Add privacy considerations related to IP address. Add **Anonymize IP address** at **Record settings**.
571
  * **Bug fix:** Fix the issue that spaces in **Text message on comment form** are deleted.
572
  * See details at [2.2.0 release note](http://www.ipgeoblock.com/changelog/release-2.2.0.html "2.2.0 Release Note").
573
 
574
  = 2.1.5.1 =
575
- * **Bug fix:** Fixed the issue that the Blacklist did not work properly. Thanks to TJayYay for reporting this issue at [support forum](https://wordpress.org/support/topic/hackers-from-country-in-blocked-list-of-countries-trying-to-login "WordPress Support » Hackers from country in Blocked List of Countries trying to login").
576
 
577
  = 2.1.5 =
578
- * **Enhancement:** Enforce preventing self blocking at the first installation. And add the scan button to get all the country code using selected API. Thanks to **Nils** for a nice idea at [support forum](https://wordpress.org/support/topic/locked-out-due-to-eu-vs-country "WordPress Support » Locked out due to EU vs. Country").
579
  * **New feature:** Add pie chart to display statistics of "Blocked by country".
580
  * **Enhancement:** WP-ZEP is reinforced against CSRF.
581
  * **Bug fix:** Fix illegal handling of the fragment in a link.
582
  * See details at [2.1.5 release note](http://www.ipgeoblock.com/changelog/release-2.1.5.html "2.1.5 Release Note").
583
 
584
  = 2.1.4 =
585
- * **Bug fix:** Fix the issue that this plugin broke functionality of a certain plugin. Thanks to **opsec** for reporting this issue at [support forum](https://wordpress.org/support/topic/blocks-saves-in-types-or-any-plugins-from-wp-typescom "WordPress Support » Blocks saves in Types or any plugins from wp-types.com").
586
- * **Improvement:** Add checking process for validation rule to prevent being blocked itself. Thanks to **internationals** for proposing at [support forum](https://wordpress.org/support/topic/locked-out-due-to-eu-vs-country "WordPress Support » Locked out due to EU vs. Country")
587
  * **Improvement:** Arrage the order of setting sections to focus the goal of this plugin.
588
  * See details at [2.1.4 release note](http://www.ipgeoblock.com/changelog/release-2.1.4.html "2.1.4 Release Note").
589
 
@@ -601,7 +647,7 @@ This is a maintenance release.
601
 
602
  * **Bug fix:** Fix the issue that the login-fail-counter didn't work when the validation at `Login form` was `block by country (register, lost password)`. In this release, the login-fail-counter works correctly.
603
  * **Bug fix:** Fix the issue that the validation settings of `Admin area` and `Admin ajax/post` were influential with each other. Now each of those works individually.
604
- * **Bug fix:** "Site Stats" of Jetpack is now shown on the admin bar which issue was reported on [support forum](https://wordpress.org/support/topic/admin-area-prevent-zero-day-exploit-incompatible-with-jetpack-site-stats-in-a "WordPress Support » Admin area - Prevent zero-day exploit: Incompatible with Jetpack Site Stats in A").
605
  * **Improvement:** Hide checking the existence of log db behind the symbol `IP_GEO_BLOCK_DEBUG` to reduce 1 query on admin screen.
606
  * **Improvement:** Add alternative functions of BCMath extension to avoid `PHP Fatal error: Call to undefined function` in `IP2Location.php` when IPv6 is specified.
607
  * **Improvement:** Use MaxMind database at the activating process not to be locked out by means of inconsistency of database at the activation and after.
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.8.2
7
+ Stable tag: 3.0.4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ A considerable number of WordPress vulnerabilities in plugins and themes have been disclosed every month on a site like [WPScan Vulnerability Database](https://wpvulndb.com/ "WPScan Vulnerability Database") and [Exploits Database](https://www.exploit-db.com/ "Exploits Database by Offensive Security"). It means that we're always exposed to the threats of being exploited caused by them.
16
 
17
+ This plugin guards your site against threats of attack to back-end of your site such as login form, XML-RPC (login attempt) and admin area. It also blocks undesired comment spam, trackback and pingback spam and any requests to public facing pages aka front-end from undesired countries.
18
 
19
  After several days of installation, you'll be supprised to find many malicious or undesirable accesses are blocked especially if you enable Zero-day Expoit Prevention.
20
 
21
  = Features =
22
 
23
  * **Immigration control:**
24
+ Access to the basic and important entrances into back-end such as `wp-comments-post.php`, `xmlrpc.php`, `wp-login.php`, `wp-signup.php`, `wp-admin/admin.php`, `wp-admin/admin-ajax.php`, `wp-admin/admin-post.php` will be validated by means of a country code based on IP address. It allows you to configure either whitelist or blacklist to [specify the countires](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements "ISO 3166-1 alpha-2 - Wikipedia"), [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing "Classless Inter-Domain Routing - Wikipedia") for a range of IP addresses and [AS number](https://en.wikipedia.org/wiki/Autonomous_system_(Internet) "Autonomous system (Internet) - Wikipedia") for a group of IP networks.
25
 
26
  * **Zero-day Exploit Prevention:**
27
+ Unlike other security firewalls based on attack patterns (vectors), the original feature "**W**ord**P**ress **Z**ero-day **E**xploit **P**revention" (WP-ZEP) is focused on patterns of vulnerability. It is simple but still smart and strong enough to block any malicious accesses to `wp-admin/*.php`, `plugins/*.php` and `themes/*.php` even from the permitted countries. It will protect your site against certain types of attack such as CSRF, LFI, SQLi, XSS and so on, **even if you have some vulnerable plugins and themes in your site**.
28
 
29
  * **Guard against login attempts:**
30
  In order to prevent hacking through the login form and XML-RPC by brute-force and the reverse-brute-force attacks, the number of login attempts will be limited per IP address even from the permitted countries.
31
 
32
  * **Minimize server load against brute-force attacks:**
33
+ You can configure this plugin as a [Must Use Plugins](https://codex.wordpress.org/Must_Use_Plugins "Must Use Plugins « WordPress Codex") so that this plugin can be loaded prior to regular plugins. It can massively [reduce the load on server](http://www.ipgeoblock.com/codex/validation-timing.html "Validation timing | IP Geo Block").
34
 
35
  * **Prevent malicious down/uploading:**
36
+ A malicious request such as exposing `wp-config.php` or uploading malwares via vulnerable plugins/themes can be blocked.
37
 
38
  * **Support of BuddyPress and bbPress:**
39
+ You can configure this plugin so that a registered user can login as a membership from anywhere, while a request such as a new user registration, lost password, creating a new topic and subscribing comment can be blocked by country. It is suitable for [BuddyPress](https://wordpress.org/plugins/buddypress/ "BuddyPress — WordPress Plugins") and [bbPress](https://wordpress.org/plugins/bbpress/ "WordPress › bbPress « WordPress Plugins") to help reducing spams.
40
 
41
  * **Referrer suppressor for external links:**
42
  When you click an external hyperlink on admin screens, http referrer will be eliminated to hide a footprint of your site.
43
 
44
  * **Multiple source of IP Geolocation databases:**
45
+ [MaxMind GeoLite free databases](http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention") and [IP2Location LITE databases](http://www.ip2location.com/ "IP Address Geolocation to Identify Website Visitor's Geographical Location") can be installed in this plugin. Also free Geolocation REST APIs and whois information can be available for audit purposes.
46
+ Father more, if you use CloudFlare or CloudFront as a reverse proxy service, you can install the [dedicated API class libraries](http://www.ipgeoblock.com/article/api-class-library.html "CloudFlare & CloudFront API class library | IP Geo Block") for these services.
47
 
48
  * **Customizing response:**
49
  HTTP response code can be selectable as `403 Forbidden` to deny access pages, `404 Not Found` to hide pages or even `200 OK` to redirect to the top page.
50
+ You can also have a human friendly page (like `404.php`) in your theme template directory or child theme directory to fit your theme.
51
 
52
  * **Validation logs:**
53
  Validation logs can be recorded with useful information to audit attack patterns.
107
  Specify the country code with two letters (see [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements "ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia")). Each of them should be separated by comma.
108
 
109
  * **White/Black list of extra IPs for prior validation**
110
+ The list of extra IP addresses prior to the validation of country code. [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing "Classless Inter-Domain Routing - Wikipedia, the free encyclopedia") and [AS number](https://en.wikipedia.org/wiki/Autonomous_system_(Internet) "Autonomous system (Internet) - Wikipedia") are also acceptable to specify the range.
111
+
112
+ * **Use Autonomous System Number (ASN)**
113
+ It enables you to use "AS number" in the whitelist and blacklist of extra IP addresses to specify a group of IP networks.
114
 
115
  * **$_SERVER keys for extra IPs**
116
  Additional IP addresses will be validated if some of keys in `$_SERVER` variable are specified in this textfield. Typically `HTTP_X_FORWARDED_FOR`.
146
  Validate access to `wp-admin/admin-(ajax|post)*.php`.
147
 
148
  * **Plugins area**
149
+ Validate direct access to plugins. Typically `wp-content/plugins/…/*.php`.
150
 
151
  * **Themes area**
152
+ Validate direct access to themes. Typically `wp-content/themes/…/*.php`.
153
 
154
  = Front-end target settings =
155
 
276
  * How to use: Activate the following code and upload this file via FTP.
277
  */
278
  /* -- ADD '/' TO THE TOP OR END OF THIS LINE TO ACTIVATE THE FOLLOWINGS -- */
279
+ function ip_geo_block_emergency( $validate, $settings ) {
280
  $validate['result'] = 'passed';
281
  return $validate;
282
  }
283
+ add_filter( 'ip-geo-block-login', 'ip_geo_block_emergency', 1, 2 );
284
+ add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency', 1, 2 );
285
  // */`
286
 
287
+ Please not that you have to use an [appropriate editor](https://codex.wordpress.org/Editing_Files#Using_Text_Editors "Editing Files « WordPress Codex").
288
 
289
  After saving and uploading it to `/wp-content/plugins/ip-geo-block/` on your server via FTP, you become to be able to login again as an admin.
290
 
352
 
353
  == Changelog ==
354
 
355
+ = 3.0.4.6 =
356
+ * **Bug fix:** Fix the issue that the emergent functionality didn't work when the number of login attempts reached to the limit.
357
+ * **Bug fix:** Fix the issue that the result would be always `limited` when "Max number of failed login attempts per IP address" is "Disabled".
358
+
359
+ = 3.0.4.5 =
360
+ * **Improvement:** Avoid conflict with [WP Limit Login Attempts](https://wordpress.org/plugins/wp-limit-login-attempts/ "WP Limit Login Attempts — WordPress Plugins"). See some details in ["Sorry, your request cannot be accepted."](https://wordpress.org/support/topic/sorry-your-request-cannot-be-accepted/#post-9544556 "Topic: “Sorry, your request cannot be accepted.” « WordPress.org Forums").
361
+
362
+ = 3.0.4.4 =
363
+ Sorry for the frequent update, but it should be fixed before the next release.
364
+ * **Bug fix:** Fix the issue that limit of login attempts took precedence over authority of admin.
365
+ * **Improvement:** Suppress "Unable to read" error message on dashboard in a certain type of server.
366
+
367
+ = 3.0.4.3 =
368
+ * **Bug fix:** Fix a bug of "Missing argument 2 for IP_Geo_Block_Admin_Rewrite::show_message()".
369
+
370
+ = 3.0.4.2 =
371
+ This is a maintenance release addressing various internal improvement toward the next version.
372
+ * **Bug fix:** Fix a bug that the counter of login attempt counted illegally.
373
+ * **Bug fix:** Fix a bug that the emergency functionality did not work properly.
374
+ * **Bug fix:** Fix a bug that an error messages was not displayed when downloading database file.
375
+ * **Improvement:** Improve the compatibility with a certain type of server using "ftpext" as a method of file system.
376
+ * **Improvement:** Change rewrite setting from server type base to server function base.
377
+ * **Improvement:** Strict evaluation of URL on anchor tags for zero-day exploit prevention.
378
+ * **Improvement:** Avoid blocking on redirection between multisite admin screen.
379
+
380
+ = 3.0.4.1 =
381
+ Thank you all for taking your time again since last update.
382
+ * **Bug fix:** Fix the error on updating 3.0.4. ([@](https://wordpress.org/support/topic/error-on-updating-3-0-4/ "Topic: Error on updating 3.0.4 « WordPress.org Forums"))
383
+ * **Bug fix:** Fix the issue of unexpected redirection on anchor tag with empty href in multisite. ([@](https://wordpress.org/support/topic/refresh-the-backend-page/ "Topic: refresh the backend page « WordPress.org Forums"))
384
+ * **Bug fix:** Fix the issue that "Remove all settings at uninstallation" could not be unchecked. ([@](https://github.com/tokkonopapa/WordPress-IP-Geo-Block/issues/19 "Bugs in v3.0.4 - Issue #19 - tokkonopapa/WordPress-IP-Geo-Block"))
385
+
386
+ = 3.0.4 =
387
+ * **New feature:** Autonomous System Number (ASN) in whitelist and blacklist of extra IP addresses instead of specifying many IP addresses.
388
+ * **New feature:** Statistics in logs - a new section in Statistics tab.
389
+ * **Deprecated:** Add a new filter hook `ip-geo-block-upload-forbidden` instead of `ip-geo-block-forbidden-upload`.
390
+ * **Improvement:** Add a new filter hook `ip-geo-block-upload-capability` to improve compatibility with other plugins that have uploading functionality.
391
+ * **Improvement:** Add a new option for verifying file upload capability. It can be set apart from verifying file extension and MIME type in "Prevent malicious file uploading".
392
+ * **Improvement:** Improve ability to extract Ajax actions for "Exception" in "Admin post/ajax".
393
+ * **Improvement:** Inhibit to embed a special nonce into links when WP-ZEP is disabled at each target. This may improve compatibility with some plugins and themes.
394
+ * **Bug fix:** Fix the issue of verifying file upload. It could not handle multiple files. ([@](https://wordpress.org/support/topic/incompatible-with-awesome-support-plugin/#post-9403708 "Topic: incompatible with Awesome Support plugin « WordPress.org Forums"))
395
+ * **Bug fix:** Fix the issue of illegal click event handling on anchor tag without href. ([@](https://wordpress.org/support/topic/pagebuilder-broken-by-ipgeoblock-v3-0-3-4/ "Topic: Pagebuilder broken by IPGeoblock v3.0.3.4 « WordPress.org Forums"))
396
+ * See [3.0.4 release note](http://www.ipgeoblock.com/changelog/release-3.0.4.html "3.0.4 Release Note | IP Geo Block") for some details.
397
+
398
  = 3.0.3.4 =
399
  * **Improvement:** Some minor refactoring for the future release.
400
  * **Improvement:** Better throughput against attacks on admin area when `"mu-plugins" (ip-geo-block-mu.php)` is enable.
535
  * **Improvement:** Support clean uninstall for network / multisite.
536
  * **Improvement:** Improve the compatibility of downloading IP address databases for Microsoft IIS.
537
  * **Bug fix:** Support `FORCE_SSL_ADMIN`.
538
+ * **Bug fix:** Fix the issue of [@](https://wordpress.org/support/topic/compatibility-with-ag-custom-admin "WordPress › Support » Compatibility with AG Custom Admin") and change the option name "**Important files**" to "**Bad signatures in query**" to avoid misuse.
539
+ * **Bug fix:** Fix the issue of [@](https://wordpress.org/support/topic/gb-added-to-whitelist "WordPress › Support » GB added to whitelist") which might be caused by some race condition.
540
  * **Bug fix:** Fix the issue of restoring post revisions which was blocked.
541
 
542
  = 2.2.4.1 =
543
  Sorry for frequent updating.
544
 
545
+ * **Bug fix:** Fixed the issue of `Warning: strpos(): Empty needle in...` that was reported in [@](https://wordpress.org/support/topic/version-224-produces-warning-message "WordPress › Support » Version 2.2.4 Produces Warning Message") and [@](https://wordpress.org/support/topic/error-after-update-to-newest-version "WordPress › Support » Error after Update to newest version").
546
 
547
  = 2.2.4 =
548
  * **Bug fix:** Fixed the issue that some links on network admin of multisite were blocked when WP-ZEP for `admin area` or `admin ajax/post` was enabled.
599
  * **Improvement:** Improved connectivity with Jetpack.
600
  * **Improvement:** Improved immediacy of downloading databases at upgrading.
601
  * **Improvement:** Replaced a terminated RESTful API service with a new stuff.
602
+ * **Bug fix:** Fixed issue that clicking a link tag without href always refreshed the page. Thanks to [wyclef](https://wordpress.org/support/topic/conflict-with-menu-editor-plugin "WordPress › Support » Conflict with Menu Editor plugin?").
603
  * **Bug fix:** Fixed issue that deactivating and activating repeatedly caused to show the welcome message.
604
  * **Bug fix:** Fixed issue that a misaligned argument in the function caused 500 internal server error when a request to the php files in plugins/themes area was rewrited to `rewrite.php`.
605
 
611
  = 2.2.0 =
612
  * **Important:** Now **Block by country** and **Prevent Zero-day Exploit** become to work independently on **Admin area**, **Admin ajax/post** at **Validation target settings**. Please reconfirm them.
613
  * **Important:** Previously, a request whose country code can't be available was always blocked. But from this release, such a request is considered as comming from the country whose code is `ZZ`. It means that you can put `ZZ` into the white list and black list.
614
+ * **New feature:** White list and Black list of extra IP addresses prior to the validation of country code. Thanks to Fabiano for good suggestions at [support forum](https://wordpress.org/support/topic/white-list-of-ip-addresses-or-ranges "WordPress › Support » White list of IP addresses or ranges?")
615
  * **New feature:** Malicious signatures to prevent disclosing the important files via vulnerable plugins or themes. A malicious request to try to expose `wp-config.php` or `passwd` can be blocked.
616
  * **New feature:** Add privacy considerations related to IP address. Add **Anonymize IP address** at **Record settings**.
617
  * **Bug fix:** Fix the issue that spaces in **Text message on comment form** are deleted.
618
  * See details at [2.2.0 release note](http://www.ipgeoblock.com/changelog/release-2.2.0.html "2.2.0 Release Note").
619
 
620
  = 2.1.5.1 =
621
+ * **Bug fix:** Fixed the issue that the Blacklist did not work properly. Thanks to TJayYay for reporting this issue at [support forum](https://wordpress.org/support/topic/hackers-from-country-in-blocked-list-of-countries-trying-to-login "WordPress › Support » Hackers from country in Blocked List of Countries trying to login").
622
 
623
  = 2.1.5 =
624
+ * **Enhancement:** Enforce preventing self blocking at the first installation. And add the scan button to get all the country code using selected API. Thanks to **Nils** for a nice idea at [support forum](https://wordpress.org/support/topic/locked-out-due-to-eu-vs-country "WordPress › Support » Locked out due to EU vs. Country").
625
  * **New feature:** Add pie chart to display statistics of "Blocked by country".
626
  * **Enhancement:** WP-ZEP is reinforced against CSRF.
627
  * **Bug fix:** Fix illegal handling of the fragment in a link.
628
  * See details at [2.1.5 release note](http://www.ipgeoblock.com/changelog/release-2.1.5.html "2.1.5 Release Note").
629
 
630
  = 2.1.4 =
631
+ * **Bug fix:** Fix the issue that this plugin broke functionality of a certain plugin. Thanks to **opsec** for reporting this issue at [support forum](https://wordpress.org/support/topic/blocks-saves-in-types-or-any-plugins-from-wp-typescom "WordPress › Support » Blocks saves in Types or any plugins from wp-types.com").
632
+ * **Improvement:** Add checking process for validation rule to prevent being blocked itself. Thanks to **internationals** for proposing at [support forum](https://wordpress.org/support/topic/locked-out-due-to-eu-vs-country "WordPress › Support » Locked out due to EU vs. Country")
633
  * **Improvement:** Arrage the order of setting sections to focus the goal of this plugin.
634
  * See details at [2.1.4 release note](http://www.ipgeoblock.com/changelog/release-2.1.4.html "2.1.4 Release Note").
635
 
647
 
648
  * **Bug fix:** Fix the issue that the login-fail-counter didn't work when the validation at `Login form` was `block by country (register, lost password)`. In this release, the login-fail-counter works correctly.
649
  * **Bug fix:** Fix the issue that the validation settings of `Admin area` and `Admin ajax/post` were influential with each other. Now each of those works individually.
650
+ * **Bug fix:** "Site Stats" of Jetpack is now shown on the admin bar which issue was reported on [support forum](https://wordpress.org/support/topic/admin-area-prevent-zero-day-exploit-incompatible-with-jetpack-site-stats-in-a "WordPress › Support » Admin area - Prevent zero-day exploit: Incompatible with Jetpack Site Stats in A").
651
  * **Improvement:** Hide checking the existence of log db behind the symbol `IP_GEO_BLOCK_DEBUG` to reduce 1 query on admin screen.
652
  * **Improvement:** Add alternative functions of BCMath extension to avoid `PHP Fatal error: Call to undefined function` in `IP2Location.php` when IPv6 is specified.
653
  * **Improvement:** Use MaxMind database at the activating process not to be locked out by means of inconsistency of database at the activation and after.
admin/class-ip-geo-block-admin.php CHANGED
@@ -17,6 +17,7 @@ class IP_Geo_Block_Admin {
17
  */
18
  private static $instance = NULL;
19
  private $admin_tab = 0;
 
20
 
21
  /**
22
  * Initialize the plugin by loading admin scripts & styles
@@ -58,6 +59,10 @@ class IP_Geo_Block_Admin {
58
  // when a blog is created or deleted.
59
  add_action( 'wpmu_new_blog', array( $this, 'create_blog' ), 10, 6 ); // @since MU
60
  add_action( 'delete_blog', array( $this, 'delete_blog' ), 10, 2 ); // @since 3.0.0
 
 
 
 
61
  }
62
 
63
  // loads a plugin’s translated strings.
@@ -107,6 +112,20 @@ class IP_Geo_Block_Admin {
107
  return $revisions_data;
108
  }
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  /**
111
  * Do some procedures when a blog is created or deleted.
112
  *
@@ -162,6 +181,7 @@ class IP_Geo_Block_Admin {
162
 
163
  switch ( $this->admin_tab ) {
164
  case 1:
 
165
  // js for google chart
166
  wp_register_script(
167
  $addon = IP_Geo_Block::PLUGIN_NAME . '-google-chart',
@@ -224,12 +244,14 @@ class IP_Geo_Block_Admin {
224
  'url' => admin_url( 'admin-ajax.php' ),
225
  'nonce' => IP_Geo_Block_Util::create_nonce( $this->get_ajax_action() ),
226
  'msg' => array(
227
- __( 'Import settings ?', 'ip-geo-block' ),
228
- __( 'Create table ?', 'ip-geo-block' ),
229
- __( 'Delete table ?', 'ip-geo-block' ),
230
- __( 'Clear statistics ?', 'ip-geo-block' ),
231
- __( 'Clear cache ?', 'ip-geo-block' ),
232
- __( 'Clear logs ?', 'ip-geo-block' ),
 
 
233
  __( 'This feature is available with HTML5 compliant browsers.', 'ip-geo-block' ),
234
  ),
235
  )
@@ -304,26 +326,84 @@ class IP_Geo_Block_Admin {
304
  }
305
  }
306
 
 
 
 
 
 
 
 
 
307
  /**
308
  * Register the administration menu into the WordPress Dashboard menu.
309
  *
310
  */
311
  private function add_plugin_admin_menu() {
 
 
 
 
 
 
312
  // Setup the tab number.
313
  $this->admin_tab = isset( $_GET['tab'] ) ? (int)$_GET['tab'] : 0;
314
- $this->admin_tab = min( 4, max( 0, $this->admin_tab ) );
315
-
316
- // Add a settings page for this plugin to the Settings menu.
317
- $hook = add_options_page(
318
- __( 'IP Geo Block', 'ip-geo-block' ),
319
- __( 'IP Geo Block', 'ip-geo-block' ),
320
- 'manage_options',
321
- IP_Geo_Block::PLUGIN_NAME,
322
- array( $this, 'display_plugin_admin_page' )
323
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
  // If successful, load admin assets only on this page.
326
- if ( ! empty( $hook ) )
327
  add_action( "load-$hook", array( $this, 'enqueue_admin_assets' ) );
328
  }
329
 
@@ -333,7 +413,7 @@ class IP_Geo_Block_Admin {
333
  */
334
  private function diagnose_admin_screen() {
335
  $settings = IP_Geo_Block::get_option();
336
- $adminurl = 'options-general.php';
337
 
338
  // Check version and compatibility
339
  if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
@@ -505,22 +585,50 @@ class IP_Geo_Block_Admin {
505
  public function display_plugin_admin_page() {
506
  $tab = $this->admin_tab;
507
  $tabs = array(
508
- 0 => __( 'Settings', 'ip-geo-block' ),
509
- 1 => __( 'Statistics', 'ip-geo-block' ),
510
- 4 => __( 'Logs', 'ip-geo-block' ),
511
- 2 => __( 'Search', 'ip-geo-block' ),
512
- 3 => __( 'Attribution', 'ip-geo-block' ),
 
513
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
514
  ?>
515
  <div class="wrap">
516
- <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
517
  <h2 class="nav-tab-wrapper">
518
  <?php foreach ( $tabs as $key => $val ) {
519
  echo '<a href="?page=', IP_Geo_Block::PLUGIN_NAME, '&amp;tab=', $key, '" class="nav-tab', ($tab === $key ? ' nav-tab-active' : ''), '">', $val, '</a>';
520
  } ?>
521
  </h2>
522
  <p style="text-align:left">[ <a id="ip-geo-block-toggle-sections" href="javascript:void(0)"><?php _e( 'Toggle all', 'ip-geo-block' ); ?></a> ]</p>
523
- <form method="post" action="options.php" id="<?php echo IP_Geo_Block::PLUGIN_NAME, '-', $tab; ?>"<?php if ( $tab ) echo " class=\"", IP_Geo_Block::PLUGIN_NAME, "-inhibit\""; ?>>
524
  <?php
525
  settings_fields( IP_Geo_Block::PLUGIN_NAME );
526
  $this->do_settings_sections( IP_Geo_Block::PLUGIN_NAME, $tab );
@@ -562,6 +670,7 @@ class IP_Geo_Block_Admin {
562
  1 => 'admin/includes/tab-statistics.php',
563
  4 => 'admin/includes/tab-accesslog.php',
564
  2 => 'admin/includes/tab-geolocation.php',
 
565
  3 => 'admin/includes/tab-attribution.php',
566
  );
567
 
@@ -674,9 +783,9 @@ class IP_Geo_Block_Admin {
674
  $args['value'] = $args['text']; // should be escaped because it can contain allowed tags
675
 
676
  case 'text': ?>
677
- <input type="text" class="regular-text code" id="<?php echo $id, $sub_id; ?>" name="<?php echo $name, $sub_name; ?>" value="<?php echo esc_attr( $args['value'] ); ?>"
678
- <?php disabled( ! empty( $args['disabled'] ), TRUE ); ?>
679
- <?php if ( isset( $args['placeholder'] ) ) echo ' placeholder="', $args['placeholder'], '"'; ?> />
680
  <?php
681
  break; // disabled @since 3.0
682
 
@@ -731,7 +840,7 @@ class IP_Geo_Block_Admin {
731
  * Sanitize a string from user input
732
  */
733
  foreach ( $output as $key => $val ) {
734
- $key = sanitize_text_field( $key );
735
 
736
  // delete old key
737
  if ( ! array_key_exists( $key, $default ) ) {
@@ -761,8 +870,7 @@ class IP_Geo_Block_Admin {
761
  // need key
762
  else {
763
  $output[ $key ][ $provider ] =
764
- isset( $input[ $key ][ $provider ] ) ?
765
- sanitize_text_field( $input[ $key ][ $provider ] ) : '';
766
  }
767
  }
768
 
@@ -781,21 +889,21 @@ class IP_Geo_Block_Admin {
781
 
782
  case 'white_list':
783
  case 'black_list':
784
- $output[ $key ] = isset( $input[ $key ] ) ?
785
- sanitize_text_field(
786
- preg_replace( '/[^A-Z,]/', '', strtoupper( $input[ $key ] ) )
787
- ) : '';
788
  break;
789
 
790
  case 'mimetype':
791
  if ( isset( $input[ $key ]['white_list'] ) ) { // for json file before 3.0.3
792
  foreach ( $input[ $key ]['white_list'] as $k => $v ) {
793
- $output[ $key ]['white_list'][ $k ] = sanitize_text_field( $v );
794
  }
795
  }
796
  if ( isset( $input[ $key ]['black_list'] ) ) { // for json file before 3.0.3
797
  $output[ $key ]['black_list'] = sanitize_text_field( $input[ $key ]['black_list'] );
798
  }
 
 
 
799
  break;
800
 
801
  default: // checkbox, select, text
@@ -867,7 +975,7 @@ class IP_Geo_Block_Admin {
867
  // Initialize not on the form (mainly unchecked checkbox)
868
  public function preprocess_options( $output, $default ) {
869
  // initialize checkboxes not in the form (added after 2.0.0, just in case)
870
- foreach ( array( 'providers', 'save_statistics', 'anonymize', 'network_wide' ) as $key ) {
871
  $output[ $key ] = is_array( $default[ $key ] ) ? array() : 0;
872
  }
873
 
@@ -894,6 +1002,9 @@ class IP_Geo_Block_Admin {
894
  $output['public'][ $key ] = array();
895
  }
896
 
 
 
 
897
  return $output;
898
  }
899
 
@@ -922,8 +1033,8 @@ class IP_Geo_Block_Admin {
922
  $output['signature'] = implode ( ',', $this->trim( $output['signature'] ) );
923
 
924
  // 3.0.3 trim extra space and comma
925
- $output['mimetype' ]['black_list'] = preg_replace( $key, $val, trim( $output['mimetype']['black_list'] ) );
926
- $output['mimetype' ]['black_list'] = implode ( ',', $this->trim( $output['mimetype']['black_list'] ) );
927
 
928
  // 3.0.0 convert country code to upper case, remove redundant spaces
929
  $output['public']['ua_list'] = preg_replace( $key, $val, trim( $output['public']['ua_list'] ) );
@@ -932,7 +1043,9 @@ class IP_Geo_Block_Admin {
932
 
933
  // 3.0.0 public : convert country code to upper case
934
  foreach ( array( 'white_list', 'black_list' ) as $key ) {
935
- $output['public'][ $key ] = strtoupper( preg_replace( '/\s/', '', $output['public'][ $key ] ) );
 
 
936
  }
937
 
938
  // 2.2.5 exception : convert associative array to simple array
@@ -950,6 +1063,16 @@ class IP_Geo_Block_Admin {
950
  }
951
  }
952
 
 
 
 
 
 
 
 
 
 
 
953
  return $output;
954
  }
955
 
@@ -978,17 +1101,19 @@ class IP_Geo_Block_Admin {
978
  *
979
  */
980
  private function check_admin_post( $ajax = FALSE ) {
981
- if ( FALSE === $ajax ) {
982
- // a postfix '-options' is added at settings_fields().
983
- $nonce = check_admin_referer( IP_Geo_Block::PLUGIN_NAME . '-options' );
984
- } else {
985
  $nonce = IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( 'nonce' ), $this->get_ajax_action() );
986
- }
 
987
 
988
- $action = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce';
989
- $nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( $action ), $action );
 
 
 
 
990
 
991
- if ( ! $nonce || ( ! current_user_can( 'manage_options' ) ) ) {
992
  status_header( 403 );
993
  wp_die(
994
  __( 'You do not have sufficient permissions to access this page.' ), '',
@@ -1011,26 +1136,7 @@ class IP_Geo_Block_Admin {
1011
 
1012
  // activate rewrite rules
1013
  require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
1014
- $stat = IP_Geo_Block_Admin_Rewrite::activate_rewrite_all( $options['rewrite'] );
1015
-
1016
- // check the status of rewrite rules
1017
- $diff = array_diff_assoc( $options['rewrite'], $stat );
1018
- if ( ! empty( $diff ) ) {
1019
- $options['rewrite'] = $stat;
1020
-
1021
- $file = array();
1022
- $dirs = IP_Geo_Block_Admin_Rewrite::get_dirs();
1023
-
1024
- // show which file would be the issue
1025
- foreach ( $diff as $key => $stat ) {
1026
- $file[] = '<code>' . $dirs[ $key ] . '.htaccess</code>';
1027
- }
1028
-
1029
- self::add_admin_notice( 'error',
1030
- sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), implode( ', ', $file ) ) . ' ' .
1031
- sprintf( _n( 'Or please refer to %s to set it manually.', 'Or please refer to %s to set them manually.', count( $file ), 'ip-geo-block' ), '<a href="http://ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How to fix permission troubles? | IP Geo Block">How to fix permission troubles?</a>' )
1032
- );
1033
- }
1034
 
1035
  // additional configuration
1036
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
@@ -1038,7 +1144,7 @@ class IP_Geo_Block_Admin {
1038
  if ( TRUE !== $file ) {
1039
  $options['validation']['timing'] = 0;
1040
  self::add_admin_notice( 'error', sprintf(
1041
- __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $file
1042
  ) );
1043
  }
1044
 
@@ -1048,6 +1154,54 @@ class IP_Geo_Block_Admin {
1048
  return $options;
1049
  }
1050
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1051
  /**
1052
  * Ajax callback function
1053
  *
@@ -1065,7 +1219,7 @@ class IP_Geo_Block_Admin {
1065
  switch ( isset( $_POST['cmd' ] ) ? $_POST['cmd' ] : NULL ) {
1066
  case 'download':
1067
  $res = IP_Geo_Block::get_instance();
1068
- $res = $res->update_database();
1069
  break;
1070
 
1071
  case 'search':
@@ -1149,6 +1303,11 @@ class IP_Geo_Block_Admin {
1149
  $res = IP_Geo_Block_Admin_Ajax::get_wp_info();
1150
  break;
1151
 
 
 
 
 
 
1152
  case 'create-table':
1153
  case 'delete-table':
1154
  // Need to define `IP_GEO_BLOCK_DEBUG` to true
@@ -1160,7 +1319,6 @@ class IP_Geo_Block_Admin {
1160
  $res = array(
1161
  'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
1162
  );
1163
- break;
1164
  }
1165
 
1166
  if ( isset( $res ) ) // wp_send_json_{success,error}() @since 3.5.0
17
  */
18
  private static $instance = NULL;
19
  private $admin_tab = 0;
20
+ private $is_network = NULL;
21
 
22
  /**
23
  * Initialize the plugin by loading admin scripts & styles
59
  // when a blog is created or deleted.
60
  add_action( 'wpmu_new_blog', array( $this, 'create_blog' ), 10, 6 ); // @since MU
61
  add_action( 'delete_blog', array( $this, 'delete_blog' ), 10, 2 ); // @since 3.0.0
62
+
63
+ // validate capability instead of nonce. @since 2.0.0 && 3.0.0
64
+ if ( $this->is_network = is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) )
65
+ add_filter( IP_Geo_Block::PLUGIN_NAME . '-bypass-admins', array( $this, 'verify_network_redirect' ), 10, 2 );
66
  }
67
 
68
  // loads a plugin’s translated strings.
112
  return $revisions_data;
113
  }
114
 
115
+ /**
116
+ * Verify admin screen without action instead of validating nonce.
117
+ *
118
+ */
119
+ public function verify_network_redirect( $queries, $settings ) {
120
+ if ( IP_Geo_Block_Util::is_user_logged_in() && $settings['network_wide'] ) {
121
+ if ( 'GET' === $_SERVER['REQUEST_METHOD'] && isset( $_GET['page'] ) ) {
122
+ $queries[] = $_GET['page']; // $_GET['action'] should be checked in IP_Geo_Block::validate_admin()
123
+ }
124
+ }
125
+
126
+ return $queries;
127
+ }
128
+
129
  /**
130
  * Do some procedures when a blog is created or deleted.
131
  *
181
 
182
  switch ( $this->admin_tab ) {
183
  case 1:
184
+ case 5:
185
  // js for google chart
186
  wp_register_script(
187
  $addon = IP_Geo_Block::PLUGIN_NAME . '-google-chart',
244
  'url' => admin_url( 'admin-ajax.php' ),
245
  'nonce' => IP_Geo_Block_Util::create_nonce( $this->get_ajax_action() ),
246
  'msg' => array(
247
+ __( 'Import settings ?', 'ip-geo-block' ),
248
+ __( 'Create table ?', 'ip-geo-block' ),
249
+ __( 'Delete table ?', 'ip-geo-block' ),
250
+ __( 'Clear statistics ?', 'ip-geo-block' ),
251
+ __( 'Clear cache ?', 'ip-geo-block' ),
252
+ __( 'Clear logs ?', 'ip-geo-block' ),
253
+ __( 'ajax for logged-in user', 'ip-geo-block' ),
254
+ __( 'ajax for non logged-in user', 'ip-geo-block' ),
255
  __( 'This feature is available with HTML5 compliant browsers.', 'ip-geo-block' ),
256
  ),
257
  )
326
  }
327
  }
328
 
329
+ /**
330
+ * Get the admin url that depends on network multisite.
331
+ *
332
+ */
333
+ private function dashboard_url( $network ) {
334
+ return $network ? network_admin_url( 'admin.php' /*'settings.php'*/ ) : admin_url( 'options-general.php' );
335
+ }
336
+
337
  /**
338
  * Register the administration menu into the WordPress Dashboard menu.
339
  *
340
  */
341
  private function add_plugin_admin_menu() {
342
+ $settings = IP_Geo_Block::get_option();
343
+
344
+ // Network wide or not
345
+ $admin_menu = 'admin_menu' === current_filter();
346
+ $this->is_network &= current_user_can( 'manage_network_options' ) && $settings['network_wide'];
347
+
348
  // Setup the tab number.
349
  $this->admin_tab = isset( $_GET['tab'] ) ? (int)$_GET['tab'] : 0;
350
+ $this->admin_tab = min( 5, max( 0, $this->admin_tab ) );
351
+
352
+ if ( $this->is_network ) {
353
+ if ( $admin_menu ) {
354
+ $this->admin_tab = max( $this->admin_tab, 1 );
355
+ } elseif ( ! in_array( $this->admin_tab, array( 0, 5 ), TRUE ) ) {
356
+ $this->admin_tab = 0;
357
+ }
358
+ } else {
359
+ $this->admin_tab = min( 4, $this->admin_tab ); // exclude `Sites` in multisite.
360
+ }
361
+
362
+ if ( $admin_menu ) {
363
+ // `settings-updated` would be added when `network_wide` is saved as TRUE
364
+ if ( $this->is_network && isset( $_REQUEST['settings-updated'] ) ) {
365
+ $this->sync_multisite_option( $settings );
366
+ wp_safe_redirect(
367
+ esc_url_raw( add_query_arg(
368
+ array( 'page' => IP_Geo_Block::PLUGIN_NAME ),
369
+ $this->dashboard_url( TRUE )
370
+ ) )
371
+ );
372
+ exit;
373
+ }
374
+
375
+ // Add a settings page for this plugin to the Settings menu.
376
+ $hook = add_options_page(
377
+ __( 'IP Geo Block', 'ip-geo-block' ),
378
+ __( 'IP Geo Block', 'ip-geo-block' ),
379
+ 'manage_options',
380
+ IP_Geo_Block::PLUGIN_NAME,
381
+ array( $this, 'display_plugin_admin_page' )
382
+ );
383
+ }
384
+
385
+ elseif ( $this->is_network ) {
386
+ // Add a settings page for this plugin to the Settings menu.
387
+ $hook = add_menu_page(
388
+ __( 'IP Geo Block', 'ip-geo-block' ),
389
+ __( 'IP Geo Block', 'ip-geo-block' ),
390
+ 'manage_network_options',
391
+ IP_Geo_Block::PLUGIN_NAME,
392
+ array( $this, 'display_plugin_admin_page' ),
393
+ 'dashicons-shield' // plugins_url( 'img/icon-72x72.png', __FILE__ )
394
+ );
395
+ /*$hook = add_submenu_page(
396
+ 'settings.php',
397
+ __( 'IP Geo Block', 'ip-geo-block' ),
398
+ __( 'IP Geo Block', 'ip-geo-block' ),
399
+ 'manage_network_options',
400
+ IP_Geo_Block::PLUGIN_NAME,
401
+ array( $this, 'display_plugin_admin_page' )
402
+ );*/
403
+ }
404
 
405
  // If successful, load admin assets only on this page.
406
+ if ( ! empty( $hook ) ) // 'admin_enqueue_scripts'
407
  add_action( "load-$hook", array( $this, 'enqueue_admin_assets' ) );
408
  }
409
 
413
  */
414
  private function diagnose_admin_screen() {
415
  $settings = IP_Geo_Block::get_option();
416
+ $adminurl = $this->dashboard_url( FALSE );
417
 
418
  // Check version and compatibility
419
  if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
585
  public function display_plugin_admin_page() {
586
  $tab = $this->admin_tab;
587
  $tabs = array(
588
+ 0 => __( 'Settings', 'ip-geo-block' ),
589
+ 1 => __( 'Statistics', 'ip-geo-block' ),
590
+ 4 => __( 'Logs', 'ip-geo-block' ),
591
+ 2 => __( 'Search', 'ip-geo-block' ),
592
+ 5 => __( 'Sites', 'ip-geo-block' ),
593
+ 3 => __( 'Attribution', 'ip-geo-block' ),
594
  );
595
+
596
+ $settings = IP_Geo_Block::get_option();
597
+ $title = esc_html( get_admin_page_title() );
598
+
599
+ // Target page that depends on the network multisite or not.
600
+ if ( 'options-general.php' === $GLOBALS['pagenow'] ) {
601
+ $action = 'options.php';
602
+
603
+ if ( $this->is_network ) {
604
+ unset( $tabs[0], $tabs[5] ); // Settings, Sites
605
+ $title .= ' <span class="ip-geo-block-title-link">';
606
+ $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> ]';
607
+ $title .= ' [ <a href="' . esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 5 ), $this->dashboard_url( TRUE ) ) ) . '" target="_self">' . __( 'Sites', 'ip-geo-block' ) . '</a> ]';
608
+ $title .= '</span>';
609
+ } else {
610
+ unset( $tabs[5] ); // Sites
611
+ }
612
+ } else {
613
+ $action = 'edit.php?action=' . IP_Geo_Block::PLUGIN_NAME;
614
+
615
+ if ( $settings['network_wide'] ) {
616
+ unset( $tabs[1], $tabs[4], $tabs[2], $tabs[3] ); // Statistics, Logs, Search, Attribution
617
+ $title .= ' <span class="ip-geo-block-title-link">[ ' . __( 'Network', 'ip-geo-block' ) . ' ]';
618
+ $title .= '</span>';
619
+ }
620
+ }
621
+
622
  ?>
623
  <div class="wrap">
624
+ <h2><?php echo $title; ?></h2>
625
  <h2 class="nav-tab-wrapper">
626
  <?php foreach ( $tabs as $key => $val ) {
627
  echo '<a href="?page=', IP_Geo_Block::PLUGIN_NAME, '&amp;tab=', $key, '" class="nav-tab', ($tab === $key ? ' nav-tab-active' : ''), '">', $val, '</a>';
628
  } ?>
629
  </h2>
630
  <p style="text-align:left">[ <a id="ip-geo-block-toggle-sections" href="javascript:void(0)"><?php _e( 'Toggle all', 'ip-geo-block' ); ?></a> ]</p>
631
+ <form method="post" action="<?php echo $action; ?>" id="<?php echo IP_Geo_Block::PLUGIN_NAME, '-', $tab; ?>"<?php if ( $tab ) echo " class=\"", IP_Geo_Block::PLUGIN_NAME, "-inhibit\""; ?>>
632
  <?php
633
  settings_fields( IP_Geo_Block::PLUGIN_NAME );
634
  $this->do_settings_sections( IP_Geo_Block::PLUGIN_NAME, $tab );
670
  1 => 'admin/includes/tab-statistics.php',
671
  4 => 'admin/includes/tab-accesslog.php',
672
  2 => 'admin/includes/tab-geolocation.php',
673
+ 5 => 'admin/includes/tab-network.php',
674
  3 => 'admin/includes/tab-attribution.php',
675
  );
676
 
783
  $args['value'] = $args['text']; // should be escaped because it can contain allowed tags
784
 
785
  case 'text': ?>
786
+ <input type="text" class="regular-text code" id="<?php echo $id, $sub_id; ?>" name="<?php echo $name, $sub_name; ?>" value="<?php echo esc_attr( $args['value'] ); ?>"<?php
787
+ disabled( ! empty( $args['disabled'] ), TRUE );
788
+ if ( isset( $args['placeholder'] ) ) echo ' placeholder="', esc_html( $args['placeholder'] ), '"'; ?> />
789
  <?php
790
  break; // disabled @since 3.0
791
 
840
  * Sanitize a string from user input
841
  */
842
  foreach ( $output as $key => $val ) {
843
+ $key = sanitize_text_field( $key ); // @since 3.0.0 can't use sanitize_key() because of capital letters.
844
 
845
  // delete old key
846
  if ( ! array_key_exists( $key, $default ) ) {
870
  // need key
871
  else {
872
  $output[ $key ][ $provider ] =
873
+ isset( $input[ $key ][ $provider ] ) ? sanitize_text_field( $input[ $key ][ $provider ] ) : '';
 
874
  }
875
  }
876
 
889
 
890
  case 'white_list':
891
  case 'black_list':
892
+ $output[ $key ] = isset( $input[ $key ] ) ? preg_replace( '/[^A-Z,]/', '', strtoupper( $input[ $key ] ) ) : '';
 
 
 
893
  break;
894
 
895
  case 'mimetype':
896
  if ( isset( $input[ $key ]['white_list'] ) ) { // for json file before 3.0.3
897
  foreach ( $input[ $key ]['white_list'] as $k => $v ) {
898
+ $output[ $key ]['white_list'][ sanitize_text_field( $k ) ] = sanitize_mime_type( $v ); // @since 3.1.3
899
  }
900
  }
901
  if ( isset( $input[ $key ]['black_list'] ) ) { // for json file before 3.0.3
902
  $output[ $key ]['black_list'] = sanitize_text_field( $input[ $key ]['black_list'] );
903
  }
904
+ if ( isset( $input[ $key ]['capability'] ) ) {
905
+ $output[ $key ]['capability'] = array_map( 'sanitize_key', explode( ',', trim( $input[ $key ]['capability'], ',' ) ) ); // @since 3.0.0
906
+ }
907
  break;
908
 
909
  default: // checkbox, select, text
975
  // Initialize not on the form (mainly unchecked checkbox)
976
  public function preprocess_options( $output, $default ) {
977
  // initialize checkboxes not in the form (added after 2.0.0, just in case)
978
+ foreach ( array( 'providers', 'save_statistics', 'anonymize', 'network_wide', 'clean_uninstall' ) as $key ) {
979
  $output[ $key ] = is_array( $default[ $key ] ) ? array() : 0;
980
  }
981
 
1002
  $output['public'][ $key ] = array();
1003
  }
1004
 
1005
+ // 3.0.4 AS number
1006
+ $output['Maxmind']['use_asn'] = FALSE;
1007
+
1008
  return $output;
1009
  }
1010
 
1033
  $output['signature'] = implode ( ',', $this->trim( $output['signature'] ) );
1034
 
1035
  // 3.0.3 trim extra space and comma
1036
+ $output['mimetype']['black_list'] = preg_replace( $key, $val, trim( $output['mimetype']['black_list'] ) );
1037
+ $output['mimetype']['black_list'] = implode ( ',', $this->trim( $output['mimetype']['black_list'] ) );
1038
 
1039
  // 3.0.0 convert country code to upper case, remove redundant spaces
1040
  $output['public']['ua_list'] = preg_replace( $key, $val, trim( $output['public']['ua_list'] ) );
1043
 
1044
  // 3.0.0 public : convert country code to upper case
1045
  foreach ( array( 'white_list', 'black_list' ) as $key ) {
1046
+ $output['public' ][ $key ] = strtoupper( preg_replace( '/\s/', '', $output['public'][ $key ] ) );
1047
+ // 3.0.4 extra_ips : convert AS number to upper case
1048
+ $output['extra_ips'][ $key ] = strtoupper( $output['extra_ips'][ $key ] );
1049
  }
1050
 
1051
  // 2.2.5 exception : convert associative array to simple array
1063
  }
1064
  }
1065
 
1066
+ // 3.0.4 AS number
1067
+ if ( $output['Maxmind']['use_asn'] && empty( $output['Maxmind']['asn4_path'] ) ) {
1068
+ require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-cron.php';
1069
+ IP_Geo_Block_Cron::start_update_db( $output, TRUE ); // force to update
1070
+ }
1071
+ elseif ( ! $output['Maxmind']['use_asn'] && ! @file_exists( $output['Maxmind']['asn4_path'] ) ) {
1072
+ $output['Maxmind']['asn4_path'] = NULL; // force to delete
1073
+ $output['Maxmind']['asn6_path'] = NULL;
1074
+ }
1075
+
1076
  return $output;
1077
  }
1078
 
1101
  *
1102
  */
1103
  private function check_admin_post( $ajax = FALSE ) {
1104
+ if ( $ajax )
 
 
 
1105
  $nonce = IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( 'nonce' ), $this->get_ajax_action() );
1106
+ else
1107
+ $nonce = check_admin_referer( IP_Geo_Block::PLUGIN_NAME . '-options' ); // a postfix '-options' is added at settings_fields().
1108
 
1109
+ $settings = IP_Geo_Block::get_option();
1110
+ if ( ( $ajax and $settings['validation']['ajax' ] & 2 ) ||
1111
+ ( ! $ajax and $settings['validation']['admin'] & 2 ) ) {
1112
+ $action = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce';
1113
+ $nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( $action ), $action );
1114
+ }
1115
 
1116
+ if ( ! $nonce || ( ! current_user_can( 'manage_options' ) && ! current_user_can( 'manage_network_options' ) ) ) {
1117
  status_header( 403 );
1118
  wp_die(
1119
  __( 'You do not have sufficient permissions to access this page.' ), '',
1136
 
1137
  // activate rewrite rules
1138
  require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
1139
+ $options['rewrite'] = IP_Geo_Block_Admin_Rewrite::activate_rewrite_all( $options['rewrite'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1140
 
1141
  // additional configuration
1142
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
1144
  if ( TRUE !== $file ) {
1145
  $options['validation']['timing'] = 0;
1146
  self::add_admin_notice( 'error', sprintf(
1147
+ __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), '<code>' . $file . '</code>'
1148
  ) );
1149
  }
1150
 
1154
  return $options;
1155
  }
1156
 
1157
+ /**
1158
+ * Validate settings and configure some features for network multisite.
1159
+ *
1160
+ * @see https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/
1161
+ */
1162
+ public function validate_network_settings() {
1163
+ // Must check that the user has the required capability
1164
+ $this->check_admin_post( FALSE );
1165
+
1166
+ // The list of registered options (IP_Geo_Block::OPTION_NAME).
1167
+ global $new_whitelist_options;
1168
+ $options = $new_whitelist_options[ IP_Geo_Block::PLUGIN_NAME ];
1169
+
1170
+ // Go through the posted data and save the targetted options.
1171
+ foreach ( $options as $option ) {
1172
+ if ( isset( $_POST[ $option ] ) )
1173
+ $this->sync_multisite_option( $_POST[ $option ] );
1174
+ }
1175
+
1176
+ // Register a settings error to be displayed to the user
1177
+ self::add_admin_notice( 'updated', __( 'Settings saved.' ) );
1178
+
1179
+ // Redirect in order to back to the settings page.
1180
+ wp_redirect( esc_url_raw(
1181
+ add_query_arg(
1182
+ array( 'page' => IP_Geo_Block::PLUGIN_NAME ),
1183
+ $this->dashboard_url( ! empty( $_POST[ $option ]['network_wide'] ) )
1184
+ )
1185
+ ) );
1186
+ exit;
1187
+ }
1188
+
1189
+ /**
1190
+ * Update option in all blogs.
1191
+ *
1192
+ * @note: This function triggers `validate_settings()` on register_setting() in wp-include/option.php.
1193
+ */
1194
+ private function sync_multisite_option( $option ) {
1195
+ global $wpdb;
1196
+ $blog_ids = $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" );
1197
+
1198
+ foreach ( $blog_ids as $id ) {
1199
+ switch_to_blog( $id );
1200
+ update_option( IP_Geo_Block::OPTION_NAME, $option );
1201
+ restore_current_blog();
1202
+ }
1203
+ }
1204
+
1205
  /**
1206
  * Ajax callback function
1207
  *
1219
  switch ( isset( $_POST['cmd' ] ) ? $_POST['cmd' ] : NULL ) {
1220
  case 'download':
1221
  $res = IP_Geo_Block::get_instance();
1222
+ $res = $res->exec_update_db();
1223
  break;
1224
 
1225
  case 'search':
1303
  $res = IP_Geo_Block_Admin_Ajax::get_wp_info();
1304
  break;
1305
 
1306
+ case 'get-actions':
1307
+ // Get all the ajax/post actions
1308
+ $res = IP_Geo_Block_Util::get_registered_actions( TRUE );
1309
+ break;
1310
+
1311
  case 'create-table':
1312
  case 'delete-table':
1313
  // Need to define `IP_GEO_BLOCK_DEBUG` to true
1319
  $res = array(
1320
  'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
1321
  );
 
1322
  }
1323
 
1324
  if ( isset( $res ) ) // wp_send_json_{success,error}() @since 3.5.0
admin/css/admin.css CHANGED
@@ -143,7 +143,7 @@ ul#ip-geo-block-actions dfn {
143
  border: none;
144
  }
145
  ul#ip-geo-block-actions span.dashicons {
146
- font-size: 90%;
147
  }
148
  .ip-geo-block-checked {
149
  list-style-type: disc;
@@ -465,19 +465,27 @@ span.ip-geo-block-title-link {
465
  box-shadow: none;
466
  }*/
467
 
468
- dfn + a.ip-geo-block-cycle {
469
- margin-left: 0.5em;
470
- }
471
- .ip-geo-block-cycle {
 
 
 
 
472
  cursor: pointer;
473
  box-shadow: none;
474
  text-decoration: none;
475
  }
476
- .ip-geo-block-cycle:active {
 
 
477
  position: relative;
478
  top: 1px;
479
  }
480
- .ip-geo-block-cycle span {
 
 
481
  height: 16px;
482
  width: 16px;
483
  margin: 0;
@@ -487,8 +495,17 @@ dfn + a.ip-geo-block-cycle {
487
  background-size: 16px 16px;
488
  background-position: center center;
489
  background-repeat: no-repeat;
 
 
490
  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);
491
  }
 
 
 
 
 
 
 
492
  /* https://developer.wordpress.org/resource/dashicons/ for WordPress 3.8
493
  .ip-geo-block-cycle span:before {
494
  background: none;
@@ -502,17 +519,17 @@ dfn + a.ip-geo-block-cycle {
502
  vertical-align: text-top;
503
  -webkit-font-smoothing: antialiased;
504
  -moz-osx-font-smoothing: grayscale;
505
- }
506
- */
507
  #ip-geo-block-back-to-top {
508
  margin:0;
509
  text-align:right;
510
  }
511
 
512
- /* for multisite */
513
  .ip-geo-block-multisite {
514
  margin-bottom: 1em;
515
  }
 
516
  /* for statistics */
517
  ol.ip-geo-block-top-list {
518
  display: inline-table;
@@ -520,9 +537,20 @@ ol.ip-geo-block-top-list {
520
  margin: 0 2em 0.5em 1.75em;
521
  }
522
  ol.ip-geo-block-top-list h4 {
523
- font-size: 13px;
524
- margin: 0.5em 0;
525
  }
526
  ol.ip-geo-block-top-list li code {
527
  background: none;
 
 
 
 
 
 
 
 
 
 
 
 
528
  }
143
  border: none;
144
  }
145
  ul#ip-geo-block-actions span.dashicons {
146
+ font-size: 14px;
147
  }
148
  .ip-geo-block-checked {
149
  list-style-type: disc;
465
  box-shadow: none;
466
  }*/
467
 
468
+ dfn ~ .ip-geo-block-cycle,
469
+ dfn ~ .ip-geo-block-lock,
470
+ dfn ~ .ip-geo-block-unlock {
471
+ margin-left: 0.75em;
472
+ }
473
+ .ip-geo-block-cycle,
474
+ .ip-geo-block-lock,
475
+ .ip-geo-block-unlock {
476
  cursor: pointer;
477
  box-shadow: none;
478
  text-decoration: none;
479
  }
480
+ .ip-geo-block-cycle:active,
481
+ .ip-geo-block-lock:active,
482
+ .ip-geo-block-unlock:active {
483
  position: relative;
484
  top: 1px;
485
  }
486
+ .ip-geo-block-cycle span,
487
+ .ip-geo-block-lock span,
488
+ .ip-geo-block-unlock span {
489
  height: 16px;
490
  width: 16px;
491
  margin: 0;
495
  background-size: 16px 16px;
496
  background-position: center center;
497
  background-repeat: no-repeat;
498
+ }
499
+ .ip-geo-block-cycle span {
500
  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);
501
  }
502
+ .ip-geo-block-lock span {
503
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3Ny3y9Zzq8dRmb7M1dlXnsIFdK0AcawAcqwphrYAcKvZ29wAb6oJd680jrqlw9MBcqxmo8MUfbJLl75eoMI7kbzX2ttqp8VSmL1YnL8NeK+Tu89DlL1ImMEOebBNmL4OkqMoAAAAAXRSTlMAQObYZgAAAPlJREFUeAG9kAWyhTAQBIPOsCzufv9TPnf4Ll0CSbpmxXwNy3Yc23rz2fV8kPA99433AIQIiGDTCD0lojiOQPXCDSFJIbF16CMWItkQMkF+inZzSLYhFKLl+a9UKTZaqJTZJYtarZuo40chrv9CqJTN+behVi+Cm7RdDgRld6AMgLxrE/dxBz0BEjwBEmD/uIsWPAOAF9A+CE56ufSryr8oqfOYcBbQJ8YkES7COkFOYzTypqCDOTDo2wljaEw4vp1APYyWKd8WMBozylvCpcvmXeHQ5fCegHia4s1FgZcIVeVFeFx1M4MvYG4eBHdYWufC+addBtf8E3vdjBNhWnVQqAAAAABJRU5ErkJggg==);
504
+ }
505
+ .ip-geo-block-unlock span {
506
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAYFBMVEXc3NyzydRzq8dRmb7I09hYnsEFdK0AcawAcqzP1toqhrYAcKvZ29wAb6oMeK8zjbqrxtQBcazBz9Zko8MVfbLF0thMmL07kbtpp8WjwtJSmL1YnL+Tu89DlL1JmMEPebBFV++UAAAAAXRSTlMAQObYZgAAAONJREFUeAG9kAWChDAMAIMmJaTFXf7/ynXflvMbnE5j8DU8Pwh8D1yEUYxEGEchWFEJEjEflESBhTQSQm2MRpIotQhZTmgKgMIg5ZlFKBmrGg7UFXJpEQKW8qIKN7YeikJdBJI2BTtXwfyx0L3XoPphvBEliNU49OoxqEa6g4cTST/OYshvi3hV8+FxSNfluG3jqxG8C6h7gF6jU+AODnTsFGSCA5O4I8wpQDq7I5CUAKWQW+AZYOYtoQPoGDeECWDaioBmWQxeBduoWURso+5WpBdw7R4ENTVDcGE435tJwT+xB+vMEnZRNB0YAAAAAElFTkSuQmCC);
507
+ }
508
+
509
  /* https://developer.wordpress.org/resource/dashicons/ for WordPress 3.8
510
  .ip-geo-block-cycle span:before {
511
  background: none;
519
  vertical-align: text-top;
520
  -webkit-font-smoothing: antialiased;
521
  -moz-osx-font-smoothing: grayscale;
522
+ }*/
 
523
  #ip-geo-block-back-to-top {
524
  margin:0;
525
  text-align:right;
526
  }
527
 
528
+ /* embeded data for multisite */
529
  .ip-geo-block-multisite {
530
  margin-bottom: 1em;
531
  }
532
+
533
  /* for statistics */
534
  ol.ip-geo-block-top-list {
535
  display: inline-table;
537
  margin: 0 2em 0.5em 1.75em;
538
  }
539
  ol.ip-geo-block-top-list h4 {
540
+ margin: 1em 0;
 
541
  }
542
  ol.ip-geo-block-top-list li code {
543
  background: none;
544
+ }
545
+
546
+ /* icon for top level menu */
547
+ #toplevel_page_ip-geo-block .wp-menu-image img {
548
+ height: 18px;
549
+ width: 18px;
550
+ }
551
+
552
+ /* action for admin post */
553
+ .ip-geo-block-admin-post {
554
+ color: #c43322;
555
+ margin-left: 0.25em;
556
  }
admin/css/admin.min.css CHANGED
@@ -1,2 +1,2 @@
1
  /* This stylesheet is used to style the admin option form of the plugin. */
2
- #ip-geo-block-scan-code,.ip-geo-block-loading,.ip-geo-block-log *{vertical-align:middle}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:3px;top:15%}fieldset.ip-geo-block-field .ip-geo-block-dropdown:before{border-top:.4em solid #555;left:0;top:35%}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 .form-table{margin:0;width:100%}fieldset.ip-geo-block-field .ip-geo-block-desc{color:#666;font-size:13px}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:90%}.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-loading{background-size:16px 16px;background-position:center center;background-repeat:no-repeat;background-image:url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==);height:16px;width:16px;margin-left:1em;margin-top:.2em;display:inline-block}.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-4 #ip-geo-block-section-1 .panel-body,#ip-geo-block-4 #ip-geo-block-section-2 .panel-body,#ip-geo-block-4 #ip-geo-block-section-3 .panel-body,#ip-geo-block-4 #ip-geo-block-section-4 .panel-body,#ip-geo-block-4 #ip-geo-block-section-5 .panel-body{padding:0;display:table-cell}.ip-geo-block-log{width:100%!important;margin:.5em 0}.ip-geo-block-log *{font-size:13px!important;line-height:1.5em}.ip-geo-block-log .pagination ul{border-radius:4px;display:inline-block;margin:.5em 0 0;padding:0}.ip-geo-block-log .pagination ul>li{display:inline}.ip-geo-block-log .pagination ul>li:first-child>a,.ip-geo-block-log .pagination ul>li:first-child>span{border-bottom-left-radius:4px;border-left-width:1px;border-top-left-radius:4px}.ip-geo-block-log .pagination ul>li:last-child>a,.ip-geo-block-log .pagination ul>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.ip-geo-block-log .pagination ul>.disabled>a,.ip-geo-block-log .pagination ul>.disabled>a:focus,.ip-geo-block-log .pagination ul>.disabled>a:hover,.ip-geo-block-log .pagination ul>.disabled>span{background-color:transparent;color:#999;cursor:default}.ip-geo-block-log .pagination ul>li>a,.ip-geo-block-log .pagination ul>li>span{border-color:#ddd;border-image:none;border-style:solid;border-width:1px 1px 1px 0;float:left;line-height:20px;padding:4px;width:20px;text-decoration:none}.ip-geo-block-log .pagination ul>.active>a,.ip-geo-block-log .pagination ul>.active>span{color:#999;cursor:default}.ip-geo-block-log .pagination ul>.active>a,.ip-geo-block-log .pagination ul>.active>span,.ip-geo-block-log .pagination ul>li>a:focus,.ip-geo-block-log .pagination ul>li>a:hover{background-color:#f7f7f7}.ip-geo-block-log .pagination-centered{text-align:center}.ip-geo-block-log.breakpoint>tbody>tr>td>span.footable-toggle{font-size:60%!important;position:relative;top:-1px;left:2px}.ip-geo-block-log>tbody>tr>td,.ip-geo-block-log>thead>tr>th{padding:4px 0;word-wrap:break-word;width:20%}.ip-geo-block-log>tbody>tr>td:first-child,.ip-geo-block-log>thead>tr>th:first-child{width:25%}.ip-geo-block-log>tbody>tr>td:first-child+td,.ip-geo-block-log>thead>tr>th:first-child+th{width:35%}.ip-geo-block-log>tbody>tr>td:nth-child(5),.ip-geo-block-log>tbody>tr>td:nth-child(5)+td,.ip-geo-block-log>thead>tr>th:nth-child(5),.ip-geo-block-log>thead>tr>th:nth-child(5)+th{width:60%;text-align:left}@media screen and (min-width:1024px){.ip-geo-block-log>tbody>tr>td:nth-child(3),.ip-geo-block-log>tbody>tr>td:nth-child(3)+td,.ip-geo-block-log>thead>tr>th:nth-child(3),.ip-geo-block-log>thead>tr>th:nth-child(3)+th{width:10%}}.ip-geo-block-log>thead>tr>th>span.footable-sort-indicator{color:#888}.ip-geo-block-log>tbody>tr>td{text-align:center}.ip-geo-block-log>tbody>tr>td:first-child{text-align:left;padding-left:.5em}.ip-geo-block-log .footable-row-detail-name,.ip-geo-block-log .footable-row-detail-row,.ip-geo-block-log .footable-row-detail-value{display:block}.ip-geo-block-log .footable-row-detail-value{padding:0 1em 4px;white-space:normal;word-wrap:break-word;word-break:break-all}input#ip_geo_block_settings_filter_logs{width:16em;padding-top:3px}#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}dfn+a.ip-geo-block-cycle{margin-left:.5em}.ip-geo-block-cycle{cursor:pointer;box-shadow:none;text-decoration:none}.ip-geo-block-cycle:active{position:relative;top:1px}.ip-geo-block-cycle 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;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-back-to-top{margin:0;text-align:right}.ip-geo-block-multisite{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{font-size:13px;margin:.5em 0}ol.ip-geo-block-top-list li code{background:0 0}
1
  /* This stylesheet is used to style the admin option form of the plugin. */
2
+ #ip-geo-block-scan-code,.ip-geo-block-loading,.ip-geo-block-log *{vertical-align:middle}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:3px;top:15%}fieldset.ip-geo-block-field .ip-geo-block-dropdown:before{border-top:.4em solid #555;left:0;top:35%}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 .form-table{margin:0;width:100%}fieldset.ip-geo-block-field .ip-geo-block-desc{color:#666;font-size:13px}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-loading{background-size:16px 16px;background-position:center center;background-repeat:no-repeat;background-image:url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==);height:16px;width:16px;margin-left:1em;margin-top:.2em;display:inline-block}.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-4 #ip-geo-block-section-1 .panel-body,#ip-geo-block-4 #ip-geo-block-section-2 .panel-body,#ip-geo-block-4 #ip-geo-block-section-3 .panel-body,#ip-geo-block-4 #ip-geo-block-section-4 .panel-body,#ip-geo-block-4 #ip-geo-block-section-5 .panel-body{padding:0;display:table-cell}.ip-geo-block-log{width:100%!important;margin:.5em 0}.ip-geo-block-log *{font-size:13px!important;line-height:1.5em}.ip-geo-block-log .pagination ul{border-radius:4px;display:inline-block;margin:.5em 0 0;padding:0}.ip-geo-block-log .pagination ul>li{display:inline}.ip-geo-block-log .pagination ul>li:first-child>a,.ip-geo-block-log .pagination ul>li:first-child>span{border-bottom-left-radius:4px;border-left-width:1px;border-top-left-radius:4px}.ip-geo-block-log .pagination ul>li:last-child>a,.ip-geo-block-log .pagination ul>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.ip-geo-block-log .pagination ul>.disabled>a,.ip-geo-block-log .pagination ul>.disabled>a:focus,.ip-geo-block-log .pagination ul>.disabled>a:hover,.ip-geo-block-log .pagination ul>.disabled>span{background-color:transparent;color:#999;cursor:default}.ip-geo-block-log .pagination ul>li>a,.ip-geo-block-log .pagination ul>li>span{border-color:#ddd;border-image:none;border-style:solid;border-width:1px 1px 1px 0;float:left;line-height:20px;padding:4px;width:20px;text-decoration:none}.ip-geo-block-log .pagination ul>.active>a,.ip-geo-block-log .pagination ul>.active>span{color:#999;cursor:default}.ip-geo-block-log .pagination ul>.active>a,.ip-geo-block-log .pagination ul>.active>span,.ip-geo-block-log .pagination ul>li>a:focus,.ip-geo-block-log .pagination ul>li>a:hover{background-color:#f7f7f7}.ip-geo-block-log .pagination-centered{text-align:center}.ip-geo-block-log.breakpoint>tbody>tr>td>span.footable-toggle{font-size:60%!important;position:relative;top:-1px;left:2px}.ip-geo-block-log>tbody>tr>td,.ip-geo-block-log>thead>tr>th{padding:4px 0;word-wrap:break-word;width:20%}.ip-geo-block-log>tbody>tr>td:first-child,.ip-geo-block-log>thead>tr>th:first-child{width:25%}.ip-geo-block-log>tbody>tr>td:first-child+td,.ip-geo-block-log>thead>tr>th:first-child+th{width:35%}.ip-geo-block-log>tbody>tr>td:nth-child(5),.ip-geo-block-log>tbody>tr>td:nth-child(5)+td,.ip-geo-block-log>thead>tr>th:nth-child(5),.ip-geo-block-log>thead>tr>th:nth-child(5)+th{width:60%;text-align:left}@media screen and (min-width:1024px){.ip-geo-block-log>tbody>tr>td:nth-child(3),.ip-geo-block-log>tbody>tr>td:nth-child(3)+td,.ip-geo-block-log>thead>tr>th:nth-child(3),.ip-geo-block-log>thead>tr>th:nth-child(3)+th{width:10%}}.ip-geo-block-log>thead>tr>th>span.footable-sort-indicator{color:#888}.ip-geo-block-log>tbody>tr>td{text-align:center}.ip-geo-block-log>tbody>tr>td:first-child{text-align:left;padding-left:.5em}.ip-geo-block-log .footable-row-detail-name,.ip-geo-block-log .footable-row-detail-row,.ip-geo-block-log .footable-row-detail-value{display:block}.ip-geo-block-log .footable-row-detail-value{padding:0 1em 4px;white-space:normal;word-wrap:break-word;word-break:break-all}input#ip_geo_block_settings_filter_logs{width:16em;padding-top:3px}#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}dfn~.ip-geo-block-cycle,dfn~.ip-geo-block-lock,dfn~.ip-geo-block-unlock{margin-left:.75em}.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}.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)}#ip-geo-block-back-to-top{margin:0;text-align:right}.ip-geo-block-multisite{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}#toplevel_page_ip-geo-block .wp-menu-image img{height:18px;width:18px}.ip-geo-block-admin-post{color:#c43322;margin-left:.25em}
admin/images/icon-72x72.png ADDED
Binary file
admin/images/lock.png ADDED
Binary file
admin/images/unlock.png ADDED
Binary file
admin/img/icon-72x72.png ADDED
Binary file
admin/img/lock.png ADDED
Binary file
admin/img/unlock.png ADDED
Binary file
admin/includes/class-admin-ajax.php CHANGED
@@ -27,8 +27,17 @@ class IP_Geo_Block_Admin_Ajax {
27
  }
28
 
29
  if ( empty( $res['errorMessage'] ) ) {
 
 
 
 
 
 
 
 
 
30
  $tmp = microtime( TRUE );
31
- $res['host'] = IP_Geo_Block_Lkup::gethostbyaddr( $ip );
32
  $tmp = microtime( TRUE ) - $tmp;
33
  $res['DNS lookup'] = sprintf( '%.1f [msec]', $tmp * 1000.0 );
34
  }
@@ -135,10 +144,12 @@ class IP_Geo_Block_Admin_Ajax {
135
  $n = 0;
136
 
137
  foreach ( $rows as $row ) {
 
138
  $log = (int)array_shift( $row );
139
  $html .= '<tr><td data-value='.$log.'>';
140
  $html .= IP_Geo_Block_Util::localdate( $log, 'Y-m-d H:i:s' ) . "</td>";
141
 
 
142
  $log = array_shift( $row );
143
  $html .= '<td><a href="#!">' . esc_html( $log ) . '</a></td>';
144
 
@@ -252,7 +263,7 @@ class IP_Geo_Block_Admin_Ajax {
252
  *
253
  */
254
  static public function settings_to_json( $input, $overwrite = TRUE ) {
255
- // [*]:checkbox, [$]:comma separated text to array, [%]:associative array
256
  $keys = array(
257
  '[version]',
258
  '[matching_rule]',
@@ -338,9 +349,11 @@ class IP_Geo_Block_Admin_Ajax {
338
  '[clean_uninstall]',
339
  '[api_key][GoogleMap]', // 2.2.7
340
  '[network_wide]', // 3.0.0
 
341
  '[mimetype][white_list][%]', // 3.0.3
342
  '[mimetype][black_list]', // 3.0.3
343
- '[others][%]', // 3.0.3
 
344
  );
345
  $json = array();
346
  $prfx = IP_Geo_Block::OPTION_NAME;
@@ -404,6 +417,7 @@ class IP_Geo_Block_Admin_Ajax {
404
  static public function preferred_to_json() {
405
  return self::settings_to_json(
406
  array(
 
407
  'validation' => array( // Action hook for validation
408
  'comment' => TRUE, // Validate on comment post
409
  'login' => 1, // Validate on login
@@ -414,6 +428,7 @@ class IP_Geo_Block_Admin_Ajax {
414
  'plugins' => 2, // Validate on wp-content/plugins
415
  'themes' => 2, // Validate on wp-content/themes
416
  'timing' => 1, // 0:init, 1:mu-plugins, 2:drop-in
 
417
  ),
418
  'signature' => "../,/wp-config.php,/passwd\ncurl,wget,eval,base64\nselect:.5,where:.5,union:.5\nload_file:.5,create:.6,password:.4",
419
  'rewrite' => array( // Apply rewrite rule
@@ -468,6 +483,8 @@ class IP_Geo_Block_Admin_Ajax {
468
 
469
  static public function get_wp_info() {
470
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
 
 
471
 
472
  // DNS reverse lookup
473
  $key = microtime( TRUE );
@@ -476,15 +493,16 @@ class IP_Geo_Block_Admin_Ajax {
476
 
477
  // Server, PHP, WordPress
478
  $res = array(
479
- 'Server:' => $_SERVER['SERVER_SOFTWARE'],
480
- 'PHP:' => PHP_VERSION,
481
- 'WordPress:' => $GLOBALS['wp_version'],
482
- 'Multisite:' => is_multisite() ? 'yes' : 'no',
483
- 'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
484
- 'ZipArchive:' => class_exists( 'ZipArchive', FALSE ) ? 'yes' : 'no',
485
- 'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
486
- 'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no',
487
- 'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
 
488
  );
489
 
490
  // Child and parent themes
27
  }
28
 
29
  if ( empty( $res['errorMessage'] ) ) {
30
+ if ( $options['Maxmind']['asn4_path'] && ( $geo = IP_Geo_Block_API::get_instance( 'Maxmind', $options ) ) ) {
31
+ $tmp = microtime( TRUE );
32
+ $geo = $geo->get_location( $ip, array( 'ASN' => TRUE ) );
33
+ $tmp = microtime( TRUE ) - $tmp;
34
+
35
+ $res['AS number'] = isset( $geo['ASN'] ) ? esc_html( $geo['ASN'] ) : '';
36
+ $res['AS number'] .= sprintf( ' (%.1f [msec])', $tmp * 1000.0 );
37
+ }
38
+
39
  $tmp = microtime( TRUE );
40
+ $res['host'] = esc_html( IP_Geo_Block_Lkup::gethostbyaddr( $ip ) );
41
  $tmp = microtime( TRUE ) - $tmp;
42
  $res['DNS lookup'] = sprintf( '%.1f [msec]', $tmp * 1000.0 );
43
  }
144
  $n = 0;
145
 
146
  foreach ( $rows as $row ) {
147
+ // Time of date
148
  $log = (int)array_shift( $row );
149
  $html .= '<tr><td data-value='.$log.'>';
150
  $html .= IP_Geo_Block_Util::localdate( $log, 'Y-m-d H:i:s' ) . "</td>";
151
 
152
+ // IP address
153
  $log = array_shift( $row );
154
  $html .= '<td><a href="#!">' . esc_html( $log ) . '</a></td>';
155
 
263
  *
264
  */
265
  static public function settings_to_json( $input, $overwrite = TRUE ) {
266
+ // [*]:list of checkboxes, [$]:comma separated text to array, [%]:associative array
267
  $keys = array(
268
  '[version]',
269
  '[matching_rule]',
349
  '[clean_uninstall]',
350
  '[api_key][GoogleMap]', // 2.2.7
351
  '[network_wide]', // 3.0.0
352
+ '[others][%]', // 3.0.3
353
  '[mimetype][white_list][%]', // 3.0.3
354
  '[mimetype][black_list]', // 3.0.3
355
+ '[mimetype][capability][$]', // 3.0.4
356
+ '[Maxmind][use_asn]', // 3.0.4
357
  );
358
  $json = array();
359
  $prfx = IP_Geo_Block::OPTION_NAME;
417
  static public function preferred_to_json() {
418
  return self::settings_to_json(
419
  array(
420
+ 'login_fails' => 10, // Limited number of login attempts
421
  'validation' => array( // Action hook for validation
422
  'comment' => TRUE, // Validate on comment post
423
  'login' => 1, // Validate on login
428
  'plugins' => 2, // Validate on wp-content/plugins
429
  'themes' => 2, // Validate on wp-content/themes
430
  'timing' => 1, // 0:init, 1:mu-plugins, 2:drop-in
431
+ 'mimetype' => 1, // 0:disable, 1:white_list, 2:black_list
432
  ),
433
  'signature' => "../,/wp-config.php,/passwd\ncurl,wget,eval,base64\nselect:.5,where:.5,union:.5\nload_file:.5,create:.6,password:.4",
434
  'rewrite' => array( // Apply rewrite rule
483
 
484
  static public function get_wp_info() {
485
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
486
+ require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
487
+ $fs = IP_Geo_Block_FS::init( 'get_wp_info' );
488
 
489
  // DNS reverse lookup
490
  $key = microtime( TRUE );
493
 
494
  // Server, PHP, WordPress
495
  $res = array(
496
+ 'Server:' => $_SERVER['SERVER_SOFTWARE'],
497
+ 'PHP:' => PHP_VERSION,
498
+ 'WordPress:' => $GLOBALS['wp_version'],
499
+ 'Multisite:' => is_multisite() ? 'yes' : 'no',
500
+ 'File system:' => $fs->get_method(),
501
+ 'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
502
+ 'ZipArchive:' => class_exists( 'ZipArchive', FALSE ) ? 'yes' : 'no',
503
+ 'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
504
+ 'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no',
505
+ 'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
506
  );
507
 
508
  // Child and parent themes
admin/includes/class-admin-rewrite.php CHANGED
@@ -4,16 +4,17 @@ class IP_Geo_Block_Admin_Rewrite {
4
  /**
5
  * Instance of this class.
6
  */
7
- protected static $instance = NULL;
8
 
9
  // private values
10
- private $doc_root = NULL; // document root
11
- private $base_uri = NULL; // plugins base uri
12
- private $wp_dirs = array();
 
13
 
14
  // template of rewrite rule in wp-content/(plugins|themes)/
15
  private $rewrite_rule = array(
16
- 'apache' => array(
17
  'plugins' => array(
18
  '# BEGIN IP Geo Block',
19
  '<IfModule mod_rewrite.c>',
@@ -34,36 +35,57 @@ class IP_Geo_Block_Admin_Rewrite {
34
  '# END IP Geo Block',
35
  ),
36
  ),
37
- 'nginx' => array(
38
  'plugins' => array(
39
- '# BEGIN IP Geo Block',
40
- 'location ~ %REWRITE_BASE%rewrite.php$ {}',
41
- 'location %WP_CONTENT_DIR%/plugins/ {',
42
- ' rewrite ^%WP_CONTENT_DIR%/plugins/.*/.*\.php$ %REWRITE_BASE%rewrite.php break;',
43
- '}',
44
- '# END IP Geo Block',
45
  ),
46
  'themes' => array(
47
- '# BEGIN IP Geo Block',
48
- 'location %WP_CONTENT_DIR%/themes/ {',
49
- ' rewrite ^%WP_CONTENT_DIR%/themes/.*/.*\.php$ %REWRITE_BASE%rewrite.php break;',
50
- '}',
51
- '# END IP Geo Block',
52
  ),
53
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  );
55
 
56
- public function __construct() {
57
  // http://stackoverflow.com/questions/25017381/setting-php-document-root-on-webserver
58
  $this->doc_root = str_replace( $_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_FILENAME'] );
59
  $this->base_uri = str_replace( $this->doc_root, '', IP_GEO_BLOCK_PATH );
60
 
61
  // target directories
62
- $condir = str_replace( $this->doc_root, '', WP_CONTENT_DIR );
63
  $this->wp_dirs = array(
64
- 'plugins' => $condir . '/plugins/',
65
- 'themes' => $condir . '/themes/',
66
  );
 
 
 
 
 
 
 
 
 
67
  }
68
 
69
  /**
@@ -74,129 +96,135 @@ class IP_Geo_Block_Admin_Rewrite {
74
  return self::$instance ? self::$instance : ( self::$instance = new self );
75
  }
76
 
77
- /**
78
- * Get type of server
79
- *
80
- * @return string 'apache', 'nginx' or NULL
81
- */
82
- private function get_server_type() {
83
- global $is_apache, $is_nginx; // wp-includes/vars.php
84
- return $is_apache ? 'apache' : ( $is_nginx ? 'nginx' : NULL );
85
- }
86
-
87
  /**
88
  * Extract the block of rewrite rule
89
  *
90
- * @param array contents of configuration file
91
  * @return array list of begin and end
92
  */
93
  private function find_rewrite_block( $content ) {
94
  return preg_grep(
95
- '/^\s*?[#;]\s*?(BEGIN|END)?\s*?IP Geo Block\s*?(BEGIN|END)?\s*?$/i',
96
- $content
97
  );
98
  }
99
 
100
  /**
101
  * Get the path of .htaccess in wp-content/plugins/themes/
102
  *
103
- * @param string 'plugins' or 'themes'
104
- * @return string absolute path to the .htaccess
105
  */
106
  private function get_rewrite_file( $which ) {
107
- global $is_apache, $is_nginx; // wp-includes/vars.php
108
-
109
- if ( $is_apache ) {
110
- return $this->doc_root . $this->wp_dirs[ $which ] . '.htaccess';
111
- }
112
-
113
- elseif ( $is_nginx ) {
114
- return NULL; /* MUST FIX */
115
- }
116
-
117
- else {
118
  return NULL; /* NOT SUPPORTED */
119
- }
120
  }
121
 
122
  /**
123
  * Get contents in .htaccess in wp-content/(plugins|themes)/
124
  *
125
  * @param string 'plugins' or 'themes'
126
- * @return array contents of configuration file
127
  */
128
  private function get_rewrite_rule( $which ) {
129
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
130
  $fs = IP_Geo_Block_FS::init( 'get_rewrite_rule' );
131
 
 
132
  $file = $this->get_rewrite_file( $which );
133
- $exist = $fs->exists( $file );
134
 
135
  // check permission
136
  if ( $exist ) {
137
- if ( ! $fs->is_readable( $file ) )
138
- return FALSE;
139
- } else {
140
- if ( ! $fs->is_readable( dirname( $file ) ) )
141
- return FALSE;
 
142
  }
143
 
144
  // get file contents as an array
145
- return $exist ? $fs->get_contents_array( $file ) : array();
 
146
  }
147
 
148
  /**
149
  * Put contents to .htaccess in wp-content/(plugins|themes)/
150
  *
151
- * @param string 'plugins' or 'themes'
152
- * @param array contents of configuration file
 
153
  */
154
  private function put_rewrite_rule( $which, $content ) {
155
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
156
  $fs = IP_Geo_Block_FS::init( 'put_rewrite_rule' );
157
 
158
  $file = $this->get_rewrite_file( $which );
159
- if ( ! $file || FALSE === $fs->put_contents( $file, implode( PHP_EOL, $content ) ) )
 
 
 
 
 
160
  return FALSE;
 
161
 
162
  // if content is empty then remove file
163
- if ( empty( $content ) )
164
- return $fs->delete( $file );
165
-
166
- return TRUE;
167
  }
168
 
169
  /**
170
  * Check if the block of rewrite rule exists
171
  *
172
  * @param string 'plugins' or 'themes'
173
- * @return bool TRUE or FALSE
174
  */
175
  private function get_rewrite_stat( $which ) {
176
- global $is_apache, $is_nginx; // wp-includes/vars.php
 
177
 
178
- if ( $is_apache ) {
179
- if ( FALSE === ( $content = $this->get_rewrite_rule( $which ) ) )
180
- return FALSE;
181
 
182
  $block = $this->find_rewrite_block( $content );
183
- return empty( $block ) ? FALSE : TRUE;
184
- }
185
 
186
- elseif ( $is_nginx ) {
187
- // https://www.wordfence.com/blog/2014/05/nginx-wordfence-falcon-engine-php-fpm-fastcgi-fast-cgi/
188
- return -1; /* CURRENTLY NOT SUPPORTED */
189
- }
190
 
191
- else {
192
- return -1; /* NOT SUPPORTED */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  }
 
 
194
  }
195
 
196
  /**
197
  * Remove the block of rewrite rule
198
  *
199
- * @param array contents of configuration file
 
200
  * @return array array of contents without rewrite rule
201
  */
202
  private function remove_rewrite_block( $content, $block ) {
@@ -218,67 +246,102 @@ class IP_Geo_Block_Admin_Rewrite {
218
  * Append the block of rewrite rule
219
  *
220
  * @param string 'plugins' or 'themes'
221
- * @param array contents of configuration file
222
  * @return array array of contents with the block of rewrite rule
223
  */
224
  private function append_rewrite_block( $which, $content ) {
225
- $server_type = $this->get_server_type();
226
-
227
- return $server_type ? array_merge(
228
- $content,
229
- str_replace(
230
- array( '%REWRITE_BASE%', '%WP_CONTENT_DIR%' ),
231
- array( $this->base_uri, WP_CONTENT_DIR ),
232
- $this->rewrite_rule[ $server_type ][ $which ]
233
- )
234
- ) : array();
 
 
 
 
 
 
235
  }
236
 
237
  /**
238
  * Add rewrite rule to server configration
239
  *
240
  * @param string 'plugins' or 'themes'
 
241
  */
242
  private function add_rewrite_rule( $which ) {
243
- global $is_apache, $is_nginx; // wp-includes/vars.php
244
 
245
- if ( $is_apache ) {
246
- if ( FALSE === ( $content = $this->get_rewrite_rule( $which ) ) )
247
- return FALSE;
 
248
 
249
- $block = $this->find_rewrite_block( $content );
 
 
250
 
251
- if ( empty( $block ) ) {
252
- $content = $this->remove_rewrite_block( $content, $block );
253
- $content = $this->append_rewrite_block( $which, $content );
254
- return $this->put_rewrite_rule( $which, $content );
 
 
255
  }
 
 
 
256
  }
257
 
258
- return TRUE;
259
  }
260
 
261
  /**
262
  * Delete rewrite rule to server configration
263
  *
264
  * @param string 'plugins' or 'themes'
 
265
  */
266
  private function del_rewrite_rule( $which ) {
267
- global $is_apache, $is_nginx; // wp-includes/vars.php
268
 
269
- if ( $is_apache ) {
270
- if ( FALSE === ( $content = $this->get_rewrite_rule( $which ) ) )
271
- return FALSE;
 
272
 
273
- $block = $this->find_rewrite_block( $content );
 
 
 
 
 
274
 
275
- if ( ! empty( $block ) ) {
276
- $content = $this->remove_rewrite_block( $content, $block );
277
- return $this->put_rewrite_rule( $which, $content );
278
  }
 
 
 
 
279
  }
280
 
281
- return TRUE;
 
 
 
 
 
 
 
 
 
282
  }
283
 
284
  /**
@@ -286,11 +349,12 @@ class IP_Geo_Block_Admin_Rewrite {
286
  *
287
  */
288
  public static function check_rewrite_all() {
289
- $status = array();
290
  $rewrite = self::get_instance();
291
 
292
- foreach ( array_keys( $rewrite->rewrite_rule['apache'] ) as $key ) {
293
- $status[ $key ] = $rewrite->get_rewrite_stat( $key );
 
 
294
  }
295
 
296
  return $status;
@@ -303,7 +367,7 @@ class IP_Geo_Block_Admin_Rewrite {
303
  public static function activate_rewrite_all( $options ) {
304
  $rewrite = self::get_instance();
305
 
306
- foreach ( array_keys( $rewrite->rewrite_rule['apache'] ) as $key ) {
307
  if ( $options[ $key ] )
308
  // if it fails to write, then return FALSE
309
  $options[ $key ] = $rewrite->add_rewrite_rule( $key ) ? TRUE : FALSE;
@@ -322,9 +386,8 @@ class IP_Geo_Block_Admin_Rewrite {
322
  public static function deactivate_rewrite_all() {
323
  $rewrite = self::get_instance();
324
 
325
- foreach ( array_keys( $rewrite->rewrite_rule['apache'] ) as $key ) {
326
- if ( FALSE === $rewrite->del_rewrite_rule( $key ) )
327
- return FALSE;
328
  }
329
 
330
  return TRUE;
@@ -339,4 +402,13 @@ class IP_Geo_Block_Admin_Rewrite {
339
  return str_replace( $rewrite->doc_root, '', $rewrite->wp_dirs );
340
  }
341
 
 
 
 
 
 
 
 
 
 
342
  }
4
  /**
5
  * Instance of this class.
6
  */
7
+ private static $instance = NULL;
8
 
9
  // private values
10
+ private $doc_root = NULL; // document root
11
+ private $base_uri = NULL; // plugins base uri
12
+ private $config_file = NULL; // `.htaccess` or `.user.ini`
13
+ private $wp_dirs = array(); // path to `plugins` and `themes`
14
 
15
  // template of rewrite rule in wp-content/(plugins|themes)/
16
  private $rewrite_rule = array(
17
+ '.htaccess' => array(
18
  'plugins' => array(
19
  '# BEGIN IP Geo Block',
20
  '<IfModule mod_rewrite.c>',
35
  '# END IP Geo Block',
36
  ),
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
  ),
50
+ // https://www.wordfence.com/blog/2014/05/nginx-wordfence-falcon-engine-php-fpm-fastcgi-fast-cgi/
51
+ // 'nginx' => array(
52
+ // 'plugins' => array(
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
+ // ),
66
+ // ),
67
  );
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/',
79
  );
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
  return self::$instance ? self::$instance : ( self::$instance = new self );
97
  }
98
 
 
 
 
 
 
 
 
 
 
 
99
  /**
100
  * Extract the block of rewrite rule
101
  *
102
+ * @param array contents of configuration file
103
  * @return array list of begin and end
104
  */
105
  private function find_rewrite_block( $content ) {
106
  return preg_grep(
107
+ '/^\s*?[#;]\s*?(?:BEGIN|END)\s*?IP Geo Block\s*?$/i',
108
+ (array)$content
109
  );
110
  }
111
 
112
  /**
113
  * Get the path of .htaccess in wp-content/plugins/themes/
114
  *
115
+ * @param string 'plugins' or 'themes'
116
+ * @return string absolute path to the .htaccess or NULL
117
  */
118
  private function get_rewrite_file( $which ) {
119
+ if ( $this->config_file )
120
+ return $this->doc_root . $this->wp_dirs[ $which ] . $this->config_file;
121
+ else
 
 
 
 
 
 
 
 
122
  return NULL; /* NOT SUPPORTED */
 
123
  }
124
 
125
  /**
126
  * Get contents in .htaccess in wp-content/(plugins|themes)/
127
  *
128
  * @param string 'plugins' or 'themes'
129
+ * @return array contents of configuration file or WP_Error
130
  */
131
  private function get_rewrite_rule( $which ) {
132
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
133
  $fs = IP_Geo_Block_FS::init( 'get_rewrite_rule' );
134
 
135
+ // check the existence of configuration file
136
  $file = $this->get_rewrite_file( $which );
137
+ $exist = $file ? $fs->exists( $file ) : FALSE;
138
 
139
  // check permission
140
  if ( $exist ) {
141
+ if ( ! $fs->is_readable( $file ) ) {
142
+ return new WP_Error( 'Error',
143
+ sprintf( __( 'Unable to read <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $file ) . ' ' .
144
+ sprintf( __( 'Or please refer to %s to set it manually.', 'ip-geo-block' ), '<a href="http://www.ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How to fix permission troubles? | IP Geo Block">How to fix permission troubles?</a>' )
145
+ );
146
+ }
147
  }
148
 
149
  // get file contents as an array
150
+ $exist = $fs->get_contents_array( $file );
151
+ return FALSE !== $exist ? $exist : array();
152
  }
153
 
154
  /**
155
  * Put contents to .htaccess in wp-content/(plugins|themes)/
156
  *
157
+ * @param string $which 'plugins' or 'themes'
158
+ * @param array contents of configuration file
159
+ * @return bool TRUE (success) or FALSE (failure)
160
  */
161
  private function put_rewrite_rule( $which, $content ) {
162
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
163
  $fs = IP_Geo_Block_FS::init( 'put_rewrite_rule' );
164
 
165
  $file = $this->get_rewrite_file( $which );
166
+
167
+ if ( ! $file || FALSE === $fs->put_contents( $file, implode( PHP_EOL, $content ) ) ) {
168
+ $this->show_message(
169
+ sprintf( __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $file ) . ' ' .
170
+ sprintf( __( 'Or please refer to %s to set it manually.', 'ip-geo-block' ), '<a href="http://www.ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How to fix permission troubles? | IP Geo Block">How to fix permission troubles?</a>' )
171
+ );
172
  return FALSE;
173
+ }
174
 
175
  // if content is empty then remove file
176
+ return empty( $content ) ? $fs->delete( $file ) : TRUE;
 
 
 
177
  }
178
 
179
  /**
180
  * Check if the block of rewrite rule exists
181
  *
182
  * @param string 'plugins' or 'themes'
183
+ * @return bool TRUE (found), FALSE (not found or unavailable) or WP_Error
184
  */
185
  private function get_rewrite_stat( $which ) {
186
+ if ( $this->config_file ) {
187
+ $content = $this->get_rewrite_rule( $which );
188
 
189
+ if ( is_wp_error( $content ) )
190
+ return $content;
 
191
 
192
  $block = $this->find_rewrite_block( $content );
 
 
193
 
194
+ if ( '.htaccess' === $this->config_file ) {
195
+ return empty( $block ) ? FALSE : TRUE;
196
+ }
 
197
 
198
+ else {
199
+ if ( empty( $block ) ) {
200
+ $block = preg_grep( '/auto_prepend_file/i', $content );
201
+
202
+ if ( empty( $block ) ) {
203
+ return FALSE; // rewrite rule is not found in configuration file
204
+ }
205
+
206
+ else {
207
+ return new WP_Error( 'Error', sprintf(
208
+ __( '&#8220;auto_prepend_file&#8221; already defined in %s.', 'ip-geo-block' ),
209
+ $this->get_rewrite_file( $which )
210
+ ) );
211
+ }
212
+ }
213
+
214
+ else {
215
+ return TRUE; // rewrite rule already exists in configuration file
216
+ }
217
+ }
218
  }
219
+
220
+ return -1; /* NOT SUPPORTED */
221
  }
222
 
223
  /**
224
  * Remove the block of rewrite rule
225
  *
226
+ * @param array contents of configuration file
227
+ * @param array contents to be removed
228
  * @return array array of contents without rewrite rule
229
  */
230
  private function remove_rewrite_block( $content, $block ) {
246
  * Append the block of rewrite rule
247
  *
248
  * @param string 'plugins' or 'themes'
249
+ * @param array contents of configuration file
250
  * @return array array of contents with the block of rewrite rule
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
+ );
266
+ }
267
+
268
+ return array();
269
  }
270
 
271
  /**
272
  * Add rewrite rule to server configration
273
  *
274
  * @param string 'plugins' or 'themes'
275
+ * @return bool TRUE (found), FALSE (not found or unavailable)
276
  */
277
  private function add_rewrite_rule( $which ) {
278
+ $stat = $this->get_rewrite_stat( $which );
279
 
280
+ if ( is_wp_error( $stat ) ) {
281
+ $this->show_message( $stat->get_error_message() );
282
+ return FALSE;
283
+ }
284
 
285
+ elseif ( TRUE === $stat ) {
286
+ return TRUE;
287
+ }
288
 
289
+ elseif ( FALSE === $stat ) {
290
+ $content = $this->get_rewrite_rule( $which );
291
+
292
+ if ( is_wp_error( $content ) ) {
293
+ $this->show_message( $content->get_error_message() );
294
+ return FALSE;
295
  }
296
+
297
+ $content = $this->append_rewrite_block( $which, $content );
298
+ return $this->put_rewrite_rule( $which, $content );
299
  }
300
 
301
+ return -1; /* NOT SUPPORTED */
302
  }
303
 
304
  /**
305
  * Delete rewrite rule to server configration
306
  *
307
  * @param string 'plugins' or 'themes'
308
+ * @return bool TRUE (found), FALSE (not found or unavailable)
309
  */
310
  private function del_rewrite_rule( $which ) {
311
+ $stat = $this->get_rewrite_stat( $which );
312
 
313
+ if ( is_wp_error( $stat ) ) {
314
+ $this->show_message( $stat->get_error_message() );
315
+ return FALSE;
316
+ }
317
 
318
+ elseif ( FALSE === $stat ) {
319
+ return TRUE;
320
+ }
321
+
322
+ elseif ( TRUE === $stat ) {
323
+ $content = $this->get_rewrite_rule( $which );
324
 
325
+ if ( is_wp_error( $content ) ) {
326
+ $this->show_message( $content->get_error_message() );
327
+ return FALSE;
328
  }
329
+
330
+ $block = $this->find_rewrite_block( $content );
331
+ $content = $this->remove_rewrite_block( $content, $block );
332
+ return $this->put_rewrite_rule( $which, $content );
333
  }
334
 
335
+ return -1; /* NOT SUPPORTED */
336
+ }
337
+
338
+ /**
339
+ * Show notice message
340
+ *
341
+ */
342
+ private function show_message( $msg ) {
343
+ if ( class_exists( 'IP_Geo_Block_Admin' ) )
344
+ IP_Geo_Block_Admin::add_admin_notice( 'error', $msg );
345
  }
346
 
347
  /**
349
  *
350
  */
351
  public static function check_rewrite_all() {
 
352
  $rewrite = self::get_instance();
353
 
354
+ $status = array();
355
+ foreach ( array_keys( $rewrite->rewrite_rule['.htaccess'] ) as $key ) {
356
+ $stat = $rewrite->get_rewrite_stat( $key );
357
+ $status[ $key ] = is_wp_error( $stat ) ? FALSE : $stat;
358
  }
359
 
360
  return $status;
367
  public static function activate_rewrite_all( $options ) {
368
  $rewrite = self::get_instance();
369
 
370
+ foreach ( array_keys( $rewrite->rewrite_rule['.htaccess'] ) as $key ) {
371
  if ( $options[ $key ] )
372
  // if it fails to write, then return FALSE
373
  $options[ $key ] = $rewrite->add_rewrite_rule( $key ) ? TRUE : FALSE;
386
  public static function deactivate_rewrite_all() {
387
  $rewrite = self::get_instance();
388
 
389
+ foreach ( array_keys( $rewrite->rewrite_rule['.htaccess'] ) as $key ) {
390
+ $rewrite->del_rewrite_rule( $key );
 
391
  }
392
 
393
  return TRUE;
402
  return str_replace( $rewrite->doc_root, '', $rewrite->wp_dirs );
403
  }
404
 
405
+ /**
406
+ * Return configuration file type.
407
+ *
408
+ */
409
+ public static function get_config_file() {
410
+ $rewrite = self::get_instance();
411
+ return $rewrite->config_file;
412
+ }
413
+
414
  }
admin/includes/tab-accesslog.php CHANGED
@@ -14,9 +14,8 @@ if ( $options['validation']['reclogs'] ) :
14
  /*----------------------------------------*
15
  * Validation logs
16
  *----------------------------------------*/
17
- $section = IP_Geo_Block::PLUGIN_NAME . '-accesslog';
18
  add_settings_section(
19
- $section,
20
  __( 'Validation logs', 'ip-geo-block' ),
21
  NULL,
22
  $option_slug
@@ -34,7 +33,7 @@ if ( $options['validation']['reclogs'] ) :
34
  'type' => 'text',
35
  'option' => $option_name,
36
  'field' => $field,
37
- 'value' => '',
38
  'after' => '<a class="button button-secondary" id="ip-geo-block-reset-filter" title="' . __( 'Reset', 'ip-geo-block' ) . '" href="javascript:void(0)">'. __( 'Reset', 'ip-geo-block' ) . '</a>',
39
  )
40
  );
@@ -88,14 +87,13 @@ if ( $options['validation']['reclogs'] ) :
88
  );
89
  }
90
 
91
- else:
92
 
93
  /*----------------------------------------*
94
  * Warning
95
  *----------------------------------------*/
96
- $section = IP_Geo_Block::PLUGIN_NAME . '-accesslog';
97
  add_settings_section(
98
- $section,
99
  __( 'Validation logs', 'ip-geo-block' ),
100
  array( __CLASS__, 'warn_accesslog' ),
101
  $option_slug
@@ -114,7 +112,8 @@ else:
114
  )
115
  );
116
 
117
- endif;
 
118
  }
119
 
120
  /**
@@ -129,11 +128,12 @@ endif;
129
 
130
  private static function list_accesslog( $key ) {
131
  echo '<table class="fixed ', IP_Geo_Block::PLUGIN_NAME, '-log" data-page-size="10" data-limit-navigation="5" data-filter="#', IP_Geo_Block::OPTION_NAME, '_filter_logs" data-filter-text-only="true" style="display:none"><thead><tr>', "\n";
132
- echo '<th data-type="numeric">', __( 'Date', 'ip-geo-block' ), '</th>', "\n";
133
- echo '<th>', __( 'IP address', 'ip-geo-block' ), '</th>', "\n";
134
- echo '<th>', __( 'Code', 'ip-geo-block' ), '</th>', "\n";
135
- echo '<th>', __( 'Result', 'ip-geo-block' ), '</th>', "\n";
136
- echo '<th data-hide="phone,tablet">', __( 'Request', 'ip-geo-block' ), '</th>', "\n";
 
137
  echo '<th data-hide="all">', __( 'User agent', 'ip-geo-block' ), '</th>', "\n";
138
  echo '<th data-hide="all">', __( 'HTTP headers', 'ip-geo-block' ), '</th>', "\n";
139
  echo '<th data-hide="all">', __( '$_POST data', 'ip-geo-block' ), '</th>', "\n";
14
  /*----------------------------------------*
15
  * Validation logs
16
  *----------------------------------------*/
 
17
  add_settings_section(
18
+ $section = IP_Geo_Block::PLUGIN_NAME . '-accesslog',
19
  __( 'Validation logs', 'ip-geo-block' ),
20
  NULL,
21
  $option_slug
33
  'type' => 'text',
34
  'option' => $option_name,
35
  'field' => $field,
36
+ 'value' => isset( $_GET['s'] ) ? esc_html( $_GET['s'] ) : '', // preset filter
37
  'after' => '<a class="button button-secondary" id="ip-geo-block-reset-filter" title="' . __( 'Reset', 'ip-geo-block' ) . '" href="javascript:void(0)">'. __( 'Reset', 'ip-geo-block' ) . '</a>',
38
  )
39
  );
87
  );
88
  }
89
 
90
+ else: // $options['validation']['reclogs']
91
 
92
  /*----------------------------------------*
93
  * Warning
94
  *----------------------------------------*/
 
95
  add_settings_section(
96
+ $section = IP_Geo_Block::PLUGIN_NAME . '-accesslog',
97
  __( 'Validation logs', 'ip-geo-block' ),
98
  array( __CLASS__, 'warn_accesslog' ),
99
  $option_slug
112
  )
113
  );
114
 
115
+ endif; // $options['validation']['reclogs']
116
+
117
  }
118
 
119
  /**
128
 
129
  private static function list_accesslog( $key ) {
130
  echo '<table class="fixed ', IP_Geo_Block::PLUGIN_NAME, '-log" data-page-size="10" data-limit-navigation="5" data-filter="#', IP_Geo_Block::OPTION_NAME, '_filter_logs" data-filter-text-only="true" style="display:none"><thead><tr>', "\n";
131
+ echo '<th data-type="numeric">', __( 'Date', 'ip-geo-block' ), '</th>', "\n";
132
+ echo '<th>', __( 'IP address', 'ip-geo-block' ), '</th>', "\n";
133
+ echo '<th>', __( 'Code', 'ip-geo-block' ), '</th>', "\n";
134
+ echo '<th>', __( 'Result', 'ip-geo-block' ), '</th>', "\n";
135
+ echo '<th data-hide="phone,tablet">', __( 'AS number', 'ip-geo-block' ), '</th>', "\n";
136
+ echo '<th data-hide="all">', __( 'Request', 'ip-geo-block' ), '</th>', "\n";
137
  echo '<th data-hide="all">', __( 'User agent', 'ip-geo-block' ), '</th>', "\n";
138
  echo '<th data-hide="all">', __( 'HTTP headers', 'ip-geo-block' ), '</th>', "\n";
139
  echo '<th data-hide="all">', __( '$_POST data', 'ip-geo-block' ), '</th>', "\n";
admin/includes/tab-network.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class IP_Geo_Block_Admin_Tab {
3
+
4
+ public static function tab_setup( $context, $tab ) {
5
+
6
+ register_setting(
7
+ $option_slug = IP_Geo_Block::PLUGIN_NAME,
8
+ $option_name = IP_Geo_Block::OPTION_NAME
9
+ );
10
+
11
+ $section = IP_Geo_Block::PLUGIN_NAME . '-multisite';
12
+ $field = 'multisite';
13
+
14
+ global $wpdb;
15
+ foreach ( $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" ) as $id ) {
16
+ switch_to_blog( $id );
17
+
18
+ add_settings_section(
19
+ $section . '-' . $id,
20
+ get_bloginfo( 'name' ),
21
+ array( __CLASS__, 'render_log' ),
22
+ $option_slug
23
+ );
24
+
25
+ restore_current_blog();
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Render log data
31
+ *
32
+ * @param array $args associative array of `id`, `title`, `callback`.
33
+ */
34
+ public static function render_log( $args ) {
35
+ switch_to_blog( str_replace( IP_Geo_Block::PLUGIN_NAME . '-multisite-', '', $args['id'] ) );
36
+
37
+ echo '<p>';
38
+ echo '[ <a target="_self" href="', add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 1 ), admin_url( 'options-general.php' ) ), '">', __( 'Statistics', 'ip-geo-block' ), '</a> ] ';
39
+ echo '[ <a target="_self" href="', add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 4 ), admin_url( 'options-general.php' ) ), '">', __( 'Logs', 'ip-geo-block' ), '</a> ]';
40
+ echo '</p>', "\n";
41
+
42
+ // array of ( `time`, `ip`, `hook`, `code`, `method`, `data` )
43
+ $logs = IP_Geo_Block_Logs::get_recent_logs( DAY_IN_SECONDS ); // YEAR_IN_SECONDS
44
+
45
+ // duration time
46
+ $interval = MINUTE_IN_SECONDS * 15; // DAY_IN_SECONDS
47
+
48
+ // Blocked hooks by time
49
+ $count = array();
50
+ foreach( $logs as $val ) {
51
+ $key = (int)( $val['time'] / $interval ) * $interval;
52
+ $count[ $key ][] = $val['hook'];
53
+ }
54
+
55
+ // Add current time
56
+ if ( ! empty( $count ) ) {
57
+ $key = (int)( $_SERVER['REQUEST_TIME'] / $interval + 1 ) * $interval;
58
+ if ( empty( $count[ $key ] ) ) {
59
+ $count[ $key ] = array();
60
+ }
61
+ }
62
+
63
+ // Count of hooks by time
64
+ $logs = array();
65
+ foreach ( $count as $key => $val ) {
66
+ $logs[ $key ] = array_count_values( $val );
67
+ }
68
+
69
+ $zero = array(
70
+ 'comment' => 0,
71
+ 'xmlrpc' => 0,
72
+ 'login' => 0,
73
+ 'admin' => 0,
74
+ 'public' => 0,
75
+ );
76
+
77
+ $prev = 0;
78
+ $count = array();
79
+
80
+ // Make array( `time`, `comment`, `xlmrpc`, `login`, `admin`, `public` )
81
+ foreach ( $logs as $key => $val ) {
82
+ while ( $prev && $key - $prev > $interval ) {
83
+ $count[] = array( $prev += $interval, 0, 0, 0, 0, 0 );
84
+ }
85
+ $count[] = array_merge(
86
+ array( $prev = $key ),
87
+ array_values( array_merge( $zero, $val ) )
88
+ );
89
+ }
90
+
91
+ // Embed array into data attribute as json
92
+ echo '<div class="', IP_Geo_Block::PLUGIN_NAME, '-multisite" id="', $args['id'], '" data-', $args['id'], '=\'', json_encode( $count ), '\'></div>';
93
+ // http://jsdo.it/taw_yame_bury/tG9t
94
+ // https://developers.google.com/chart/
95
+
96
+ restore_current_blog();
97
+ }
98
+
99
+ }
admin/includes/tab-settings.php CHANGED
@@ -1,17 +1,13 @@
1
  <?php
 
2
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
3
  require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
4
 
5
- if ( ! function_exists( 'get_plugins' ) )
6
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
7
-
8
  class IP_Geo_Block_Admin_Tab {
9
 
10
  public static function tab_setup( $context, $tab ) {
11
- $plugin_slug = IP_Geo_Block::PLUGIN_NAME; // 'ip-geo-block'
12
- $option_slug = IP_Geo_Block::PLUGIN_NAME; // 'ip-geo-block'
13
- $option_name = IP_Geo_Block::OPTION_NAME; // 'ip_geo_block_settings'
14
  $options = IP_Geo_Block::get_option();
 
15
 
16
  /**
17
  * Register a setting and its sanitization callback.
@@ -24,8 +20,8 @@ class IP_Geo_Block_Admin_Tab {
24
  * @since 2.7.0
25
  */
26
  register_setting(
27
- $option_slug,
28
- $option_name,
29
  array( $context, 'validate_settings' )
30
  );
31
 
@@ -43,9 +39,8 @@ class IP_Geo_Block_Admin_Tab {
43
  /*----------------------------------------*
44
  * Validation rule settings
45
  *----------------------------------------*/
46
- $section = $plugin_slug . '-validation-rule';
47
  add_settings_section(
48
- $section,
49
  __( 'Validation rule settings', 'ip-geo-block' ),
50
  NULL,
51
  $option_slug
@@ -120,6 +115,7 @@ endif;
120
  $comma = array(
121
  '<span class="ip-geo-block-sup">' . __( '(comma separated)', 'ip-geo-block' ) . '</span>',
122
  '<span class="ip-geo-block-sup">' . __( '(comma or RET separated)', 'ip-geo-block' ) . '</span>',
 
123
  );
124
 
125
  // Matching rule
@@ -180,13 +176,34 @@ endif;
180
  )
181
  );
182
 
183
- // White list of extra IP addresses prior to country code (CIDR)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  $field = 'extra_ips';
185
  $key = 'white_list';
186
  add_settings_field(
187
  $option_name.'_'.$field.'_'.$key,
188
- __( '<dfn title="e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, &#8220;69.46.36.0/27&#8221; for WordFence server">Whitelist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
189
- ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia, the free encyclopedia">CIDR</a>)',
 
190
  array( $context, 'callback_field' ),
191
  $option_slug,
192
  $section,
@@ -200,12 +217,13 @@ endif;
200
  )
201
  );
202
 
203
- // Black list of extra IP addresses prior to country code (CIDR)
204
  $key = 'black_list';
205
  add_settings_field(
206
  $option_name.'_'.$field.'_'.$key,
207
  __( '<dfn title="Server level access control is recommended (e.g. .htaccess).">Blacklist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
208
- ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia, the free encyclopedia">CIDR</a>)',
 
209
  array( $context, 'callback_field' ),
210
  $option_slug,
211
  $section,
@@ -257,7 +275,7 @@ endif;
257
  );
258
 
259
  // Prevent malicious upload - white list of file extention and MIME type
260
- $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\"><span></span></a>\n<li class=\"ip-geo-block-hide\"><ul class=\"ip-geo-block-float\">\n";
261
 
262
  // get_allowed_mime_types() in wp-includes/functions.php @since 2.8.6
263
  foreach ( IP_Geo_Block_Util::get_allowed_mime_types() as $key => $val ) {
@@ -271,11 +289,15 @@ endif;
271
  $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>';
272
  $list .= "</ul></li></ul>\n";
273
 
 
 
 
 
274
  $field = 'validation';
275
  $key = 'mimetype';
276
  add_settings_field(
277
  $option_name.'_'.$field.'_'.$key,
278
- __( '<dfn title="It restricts the file types on upload to block malware and backdoor via both back-end and front-end. Please consider to select &#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation timing&#8221; so that other staff would not fetch uploaded files before this validation.">Prevent malicious file uploading</dfn>', 'ip-geo-block' ),
279
  array( $context, 'callback_field' ),
280
  $option_slug,
281
  $section,
@@ -286,39 +308,14 @@ endif;
286
  'sub-field' => $key,
287
  'value' => $options[ $field ][ $key ],
288
  'list' => array(
289
- 0 => __( 'Disable', 'ip-geo-block' ),
290
- 1 => __( 'Verify capability and MIME type', 'ip-geo-block' ),
291
- 2 => __( 'Verify only file extension', 'ip-geo-block' ),
292
  ),
293
  'after' => $list,
294
  )
295
  );
296
- /*
297
- // Create a new user
298
- $field = 'others';
299
- $key = 'create_user';
300
- add_settings_field(
301
- $option_name.'_'.$field,
302
- __( '<dfn title="It enables/disables to restrict creation of new user accounts.">Create a newe user</dfn>', 'ip-geo-block' ),
303
- array( $context, 'callback_field' ),
304
- $option_slug,
305
- $section,
306
- array(
307
- 'type' => 'select',
308
- 'option' => $option_name,
309
- 'field' => $field,
310
- 'sub-field' => $key,
311
- 'value' => $options[ $field ][ $key ],
312
- 'list' => array(
313
- 0 => __( 'Disable', 'ip-geo-block' ),
314
- 1 => __( 'Block by country', 'ip-geo-block' ),
315
- 2 => 'Only by admin',
316
- 3 => 'Prohibit',
317
- ),
318
- 'after' => '<br /><input id="ip_geo_block_settings_' . $field . '_' . $key . '" name="ip_geo_block_settings[' . $field . '][' . $key . ']" type="checkbox"' . checked( ! empty( $options[ $field ][ $key ] ), TRUE, FALSE ) . '/><label for="ip_geo_block_settings_' . $field . '_' . $key . '"><dfn title="It enables to send email to administrator when a new user count is created.">Send email</dfn></label>',
319
- )
320
- );
321
- */
322
  // Response code (RFC 2616)
323
  $field = 'response_code';
324
  add_settings_field(
@@ -363,6 +360,7 @@ endif;
363
  'field' => $field,
364
  'value' => $options[ $field ],
365
  'class' => $options['response_code'] < 400 ? '' : 'ip-geo-block-hide',
 
366
  )
367
  );
368
 
@@ -439,9 +437,8 @@ endif;
439
  /*----------------------------------------*
440
  * Back-end target settings
441
  *----------------------------------------*/
442
- $section = $plugin_slug . '-validation-target';
443
  add_settings_section(
444
- $section,
445
  __( 'Back-end target settings', 'ip-geo-block' ),
446
  array( __CLASS__, 'note_target' ),
447
  $option_slug
@@ -527,7 +524,7 @@ endif;
527
  'sub-field' => $key,
528
  'value' => $options[ $field ][ $key ],
529
  'text' => __( 'Block by country', 'ip-geo-block' ),
530
- '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"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $list . "</ul></li></ul>\n",
531
  )
532
  );
533
 
@@ -560,43 +557,19 @@ endif;
560
  )
561
  );
562
 
563
- // Get all the ajax/post actions
564
- $exception = '';
565
- $installed = array();
566
-
567
- global $wp_filter;
568
- foreach ( $wp_filter as $key => $val ) {
569
- if ( FALSE !== strpos( $key, 'wp_ajax_' ) ) {
570
- if ( 0 === strpos( $key, 'wp_ajax_nopriv_' ) ) {
571
- $key = substr( $key, 15 );
572
- $val = 2;
573
- } else {
574
- $key = substr( $key, 8 );
575
- $val = 1;
576
- }
577
- $installed[ $key ] = isset( $installed[ $key ] ) ? $installed[ $key ] | $val : $val;
578
- } elseif ( FALSE !== strpos( $key, 'admin_post_' ) ) {
579
- if ( 0 === strpos( $key, 'admin_post_nopriv_' ) ) {
580
- $key = substr( $key, 18 );
581
- $val = 2;
582
- } else {
583
- $key = substr( $key, 11 );
584
- $val = 1;
585
- }
586
- $installed[ $key ] = isset( $installed[ $key ] ) ? $installed[ $key ] | $val : $val;
587
- }
588
- }
589
- unset( $installed['ip_geo_block'] );
590
 
591
  $tmp = array(
592
- __( 'for logged-in user', 'ip-geo-block' ),
593
- __( 'for non logged-in user', 'ip-geo-block' ),
594
  );
595
 
 
596
  foreach ( $installed as $key => $val ) {
597
  $val = '';
598
- $val .= $installed[ $key ] & 1 ? '<dfn title="' . $tmp[0] . '"><span class="dashicons dashicons-lock"></span></dfn>' : '';
599
- $val .= $installed[ $key ] & 2 ? '<dfn title="' . $tmp[1] . '"><span class="dashicons dashicons-unlock"></span></dfn>' : '';
600
  $key = esc_attr( $key );
601
  $exception .= '<li>'
602
  . '<input id="ip_geo_block_' . $key . '" type="checkbox" value="1"' . checked( in_array( $key, $options['exception']['admin'] ), TRUE, FALSE ) . ' />'
@@ -624,7 +597,7 @@ endif;
624
  'list' => $list,
625
  'desc' => $desc,
626
  'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">'
627
- . __( '<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-cycle ip-geo-block-hide"><span></span></a>'
628
  . "\n<li class=\"ip-geo-block-hide\"><ul><li>\n"
629
  . '<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"
630
  . $comma[0]
@@ -638,11 +611,13 @@ endif;
638
  array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
639
  $desc = array(
640
  __( 'Regardless of the country code, it will block a malicious request to <code>%s&ctdot;/*.php</code>.', 'ip-geo-block' ),
641
- __( 'It configures &#8220;%s&#8221; to validate a request to the PHP file which does not load WordPress core.', 'ip-geo-block' ),
642
  __( '<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' ),
 
 
643
  );
644
 
645
  // Set rewrite condition
 
646
  $options['rewrite'] = IP_Geo_Block_Admin_Rewrite::check_rewrite_all();
647
 
648
  // Get all the plugins
@@ -674,7 +649,7 @@ endif;
674
  . ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
675
  . disabled( $options['rewrite'][ $key ], -1, FALSE ) . ' />'
676
  . '<label for="ip_geo_block_settings_rewrite_' . $key . '"><dfn title="'
677
- . sprintf( $desc[1], $val . '.htaccess' )
678
  . '">' . __( 'Force to load WP core', 'ip-geo-block' )
679
  . '</dfn></label><br />';
680
 
@@ -695,7 +670,7 @@ endif;
695
  2 => sprintf( $desc[0], $val ),
696
  ),
697
  'before' => $tmp,
698
- 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . $desc[2] . '<a class="ip-geo-block-cycle ip-geo-block-hide"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $exception . "</ul></li></ul>\n",
699
  )
700
  );
701
 
@@ -724,7 +699,7 @@ endif;
724
  . ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
725
  . disabled( $options['rewrite'][ $key ], -1, FALSE ) . ' />'
726
  . '<label for="ip_geo_block_settings_rewrite_' . $key . '"><dfn title="'
727
- . sprintf( $desc[1], $val . '.htaccess' )
728
  . '">' . __( 'Force to load WP core', 'ip-geo-block' )
729
  . '</dfn></label><br />';
730
 
@@ -745,16 +720,15 @@ endif;
745
  2 => sprintf( $desc[0], $val ),
746
  ),
747
  'before' => $tmp,
748
- 'after' => '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . $desc[2] . '<a class="ip-geo-block-cycle ip-geo-block-hide"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n" . $exception . "</ul></li></ul>\n",
749
  )
750
  );
751
 
752
  /*----------------------------------------*
753
  * Front-end settings
754
  *----------------------------------------*/
755
- $section = $plugin_slug . '-public';
756
  add_settings_section(
757
- $section,
758
  __( 'Front-end target settings', 'ip-geo-block' ),
759
  array( __CLASS__, 'note_public' ),
760
  $option_slug
@@ -884,6 +858,7 @@ endif;
884
  'sub-field' => $key,
885
  'value' => $options[ $field ][ $key ],
886
  'class' => $options[ $field ]['matching_rule'] != -1 && $options[ $field ]['response_code'] < 400 ? '' : 'ip-geo-block-hide',
 
887
  )
888
  );
889
 
@@ -906,7 +881,7 @@ endif;
906
  );
907
 
908
  // List of page
909
- $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"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
910
  $tmp = get_pages();
911
  if ( ! empty( $tmp ) ) {
912
  foreach ( $tmp as $key ) {
@@ -918,7 +893,7 @@ endif;
918
  $exception .= '</ul></li></ul>' . "\n";
919
 
920
  // List of post type
921
- $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"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
922
  $tmp = get_post_types( array( 'public' => TRUE ) );
923
  if ( ! empty( $tmp ) ) {
924
  foreach ( $tmp as $key ) {
@@ -930,7 +905,7 @@ endif;
930
  $exception .= '</ul></li></ul>' . "\n";
931
 
932
  // List of category
933
- $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"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
934
  $tmp = get_categories( array( 'hide_empty' => FALSE ) );
935
  if ( ! empty( $tmp ) ) {
936
  foreach ( $tmp as $key ) {
@@ -942,7 +917,7 @@ endif;
942
  $exception .= '</ul></li></ul>' . "\n";
943
 
944
  // List of tag
945
- $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"><span></span></a>' . "\n<li class=\"ip-geo-block-hide\"><ul>\n";
946
  $tmp = get_tags( array( 'hide_empty' => FALSE ) );
947
  if ( ! empty( $tmp ) ) {
948
  foreach ( $tmp as $key ) {
@@ -1053,9 +1028,8 @@ endif;
1053
  /*----------------------------------------*
1054
  * Geolocation service settings
1055
  *----------------------------------------*/
1056
- $section = $plugin_slug . '-provider';
1057
  add_settings_section(
1058
- $section,
1059
  __( 'Geolocation API settings', 'ip-geo-block' ),
1060
  array( __CLASS__, 'note_services' ),
1061
  $option_slug
@@ -1111,9 +1085,8 @@ endif;
1111
  );
1112
  }
1113
 
1114
- $section = $plugin_slug . '-database';
1115
  add_settings_section(
1116
- $section,
1117
  __( 'Local database settings', 'ip-geo-block' ),
1118
  NULL,
1119
  $option_slug
@@ -1172,9 +1145,8 @@ endif;
1172
  /*----------------------------------------*
1173
  * Record settings
1174
  *----------------------------------------*/
1175
- $section = $plugin_slug . '-recording';
1176
  add_settings_section(
1177
- $section,
1178
  __( 'Record settings', 'ip-geo-block' ),
1179
  array( __CLASS__, 'note_record' ),
1180
  $option_slug
@@ -1291,9 +1263,8 @@ endif;
1291
  /*----------------------------------------*
1292
  * Cache settings
1293
  *----------------------------------------*/
1294
- $section = $plugin_slug . '-cache';
1295
  add_settings_section(
1296
- $section,
1297
  __( 'IP address cache settings', 'ip-geo-block' ),
1298
  NULL,
1299
  $option_slug
@@ -1352,9 +1323,8 @@ endif;
1352
  /*----------------------------------------*
1353
  * Submission settings
1354
  *----------------------------------------*/
1355
- $section = $plugin_slug . '-submission';
1356
  add_settings_section(
1357
- $section,
1358
  __( 'Submission settings', 'ip-geo-block' ),
1359
  NULL,
1360
  $option_slug
@@ -1390,14 +1360,35 @@ endif;
1390
  /*----------------------------------------*
1391
  * Plugin settings
1392
  *----------------------------------------*/
1393
- $section = $plugin_slug . '-others';
1394
  add_settings_section(
1395
- $section,
1396
  __( 'Plugin settings', 'ip-geo-block' ),
1397
  NULL,
1398
  $option_slug
1399
  );
 
 
 
 
1400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1401
  // Remove all settings at uninstallation
1402
  $field = 'clean_uninstall';
1403
  add_settings_field(
@@ -1505,11 +1496,11 @@ if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1505
  );
1506
  endif;
1507
 
1508
- // Show WordPress installation info
1509
  $field = 'show-info';
1510
  add_settings_field(
1511
  $option_name.'_'.$field,
1512
- __( '<dfn title="Please copy &amp; paste when submitting your issue to support forum.">Installation information</dfn><br />[ <a rel="noreferrer" href="https://wordpress.org/support/plugin/ip-geo-block" title="WordPress &#8250; Support &raquo; IP Geo Block">support forum</a> ]', 'ip-geo-block' ),
1513
  array( $context, 'callback_field' ),
1514
  $option_slug,
1515
  $section,
1
  <?php
2
+ require_once ABSPATH . 'wp-admin/includes/plugin.php'; // for get_plugins()
3
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
4
  require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
5
 
 
 
 
6
  class IP_Geo_Block_Admin_Tab {
7
 
8
  public static function tab_setup( $context, $tab ) {
 
 
 
9
  $options = IP_Geo_Block::get_option();
10
+ $plugin_slug = IP_Geo_Block::PLUGIN_NAME; // 'ip-geo-block'
11
 
12
  /**
13
  * Register a setting and its sanitization callback.
20
  * @since 2.7.0
21
  */
22
  register_setting(
23
+ $option_slug = IP_Geo_Block::PLUGIN_NAME, // 'ip-geo-block'
24
+ $option_name = IP_Geo_Block::OPTION_NAME, // 'ip_geo_block_settings'
25
  array( $context, 'validate_settings' )
26
  );
27
 
39
  /*----------------------------------------*
40
  * Validation rule settings
41
  *----------------------------------------*/
 
42
  add_settings_section(
43
+ $section = $plugin_slug . '-validation-rule',
44
  __( 'Validation rule settings', 'ip-geo-block' ),
45
  NULL,
46
  $option_slug
115
  $comma = array(
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
176
  )
177
  );
178
 
179
+ // Use AS number
180
+ $field = 'Maxmind';
181
+ $key = 'use_asn';
182
+ add_settings_field(
183
+ $option_name.'_'.$field.'_'.$key,
184
+ __( '<dfn title="It enables utilizing &#8220;AS number&#8221; in the &#8220;Whitelist/Blacklist of extra IP addresses&#8221; to specify a group of IP networks.">Use Autonomous System Number</dfn>', 'ip-geo-block' ) .
185
+ ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)" title="Autonomous system (Internet) - Wikipedia">ASN</a>)',
186
+ array( $context, 'callback_field' ),
187
+ $option_slug,
188
+ $section,
189
+ array(
190
+ 'type' => 'checkbox',
191
+ 'option' => $option_name,
192
+ 'field' => $field,
193
+ 'sub-field' => $key,
194
+ 'value' => 1 === (int)$options[ $field ][ $key ],
195
+ 'after' => '<p class="ip-geo-block-desc">' . sprintf( __( 'Some useful tools for investigating ASN are introduced in &#8220;%s&#8221;.', 'ip-geo-block' ), '<a rel="noreferrer" href="http://www.ipgeoblock.com/codex/utilizing-asnumber.html" title="Utilizing AS number | IP Geo Block">Utilizing AS number</a>' ) . '</p>',
196
+ )
197
+ );
198
+
199
+ // White list of extra IP addresses prior to country code (CIDR, ASN)
200
  $field = 'extra_ips';
201
  $key = 'white_list';
202
  add_settings_field(
203
  $option_name.'_'.$field.'_'.$key,
204
+ __( '<dfn title="e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, &#8220;69.46.36.0/27&#8221; for WordFence server or &#8220;AS32934&#8221; for Facebook.">Whitelist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
205
+ ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia">CIDR</a>'.
206
+ ', <a rel="noreferrer" href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)" title="Autonomous system (Internet) - Wikipedia">ASN</a>)',
207
  array( $context, 'callback_field' ),
208
  $option_slug,
209
  $section,
217
  )
218
  );
219
 
220
+ // Black list of extra IP addresses prior to country code (CIDR, ASN)
221
  $key = 'black_list';
222
  add_settings_field(
223
  $option_name.'_'.$field.'_'.$key,
224
  __( '<dfn title="Server level access control is recommended (e.g. .htaccess).">Blacklist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
225
+ ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia">CIDR</a>'.
226
+ ', <a rel="noreferrer" href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)" title="Autonomous system (Internet) - Wikipedia">ASN</a>)',
227
  array( $context, 'callback_field' ),
228
  $option_slug,
229
  $section,
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 ) {
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
 
292
+ // Verify capability
293
+ $list .= '<ul class="ip-geo-block-settings-folding ip-geo-block-dropup">' . __( '<dfn title="Specify the capabilities to be verified. Depending on the particular type of uploader, certain capability may be required. Default is &#8220;upload_files&#8221; for Administrator, Editor and Author. This verification will be skipped if empty.">Capabilities to be verified</dfn>', 'ip-geo-block' ) . '&nbsp;<span class="ip-geo-block-desc">' . __( '(&thinsp;See &#8220;<a rel="noreferrer" href="https://codex.wordpress.org/Roles_and_Capabilities" title="Roles and Capabilities &laquo; WordPress Codex">Roles and Capabilities</a>&#8221;&thinsp;)', 'ip-geo-block' ) . '</span>' . "\n";
294
+ $list .= '<li class="ip-geo-block-hide"><ul><li><input type="text" id="ip_geo_block_settings_mimetype_capability" name="ip_geo_block_settings[mimetype][capability]" class="regular-text code" placeholder="upload_files" value="' . esc_attr( implode( ',', $options['mimetype']['capability'] ) ) . '" />' . $comma[0] . '</li></ul></li></ul>';
295
+
296
  $field = 'validation';
297
  $key = 'mimetype';
298
  add_settings_field(
299
  $option_name.'_'.$field.'_'.$key,
300
+ __( '<dfn title="It restricts the file types on upload in order to block malware and backdoor via both back-end and front-end. Please consider to select &#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation timing&#8221; so that other staff would not fetch the uploaded files before this validation.">Prevent malicious file uploading</dfn>', 'ip-geo-block' ),
301
  array( $context, 'callback_field' ),
302
  $option_slug,
303
  $section,
308
  'sub-field' => $key,
309
  'value' => $options[ $field ][ $key ],
310
  'list' => array(
311
+ 0 => __( 'Disable', 'ip-geo-block' ),
312
+ 1 => __( 'Verify file extension and MIME type', 'ip-geo-block' ),
313
+ 2 => __( 'Verify file extension only', 'ip-geo-block' ),
314
  ),
315
  'after' => $list,
316
  )
317
  );
318
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  // Response code (RFC 2616)
320
  $field = 'response_code';
321
  add_settings_field(
360
  'field' => $field,
361
  'value' => $options[ $field ],
362
  'class' => $options['response_code'] < 400 ? '' : 'ip-geo-block-hide',
363
+ 'placeholder' => '/about/',
364
  )
365
  );
366
 
437
  /*----------------------------------------*
438
  * Back-end target settings
439
  *----------------------------------------*/
 
440
  add_settings_section(
441
+ $section = $plugin_slug . '-validation-target',
442
  __( 'Back-end target settings', 'ip-geo-block' ),
443
  array( __CLASS__, 'note_target' ),
444
  $option_slug
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
  )
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 ) . ' />'
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]
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
 
619
  // Set rewrite condition
620
+ $config = IP_Geo_Block_Admin_Rewrite::get_config_file();
621
  $options['rewrite'] = IP_Geo_Block_Admin_Rewrite::check_rewrite_all();
622
 
623
  // Get all the plugins
649
  . ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
650
  . disabled( $options['rewrite'][ $key ], -1, FALSE ) . ' />'
651
  . '<label for="ip_geo_block_settings_rewrite_' . $key . '"><dfn title="'
652
+ . ( $config ? sprintf( $desc[2], $val . $config ) : $desc[3] )
653
  . '">' . __( 'Force to load WP core', 'ip-geo-block' )
654
  . '</dfn></label><br />';
655
 
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
 
699
  . ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
700
  . disabled( $options['rewrite'][ $key ], -1, FALSE ) . ' />'
701
  . '<label for="ip_geo_block_settings_rewrite_' . $key . '"><dfn title="'
702
+ . ( $config ? sprintf( $desc[2], $val . $config ) : $desc[3] )
703
  . '">' . __( 'Force to load WP core', 'ip-geo-block' )
704
  . '</dfn></label><br />';
705
 
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
 
727
  /*----------------------------------------*
728
  * Front-end settings
729
  *----------------------------------------*/
 
730
  add_settings_section(
731
+ $section = $plugin_slug . '-public',
732
  __( 'Front-end target settings', 'ip-geo-block' ),
733
  array( __CLASS__, 'note_public' ),
734
  $option_slug
858
  'sub-field' => $key,
859
  'value' => $options[ $field ][ $key ],
860
  'class' => $options[ $field ]['matching_rule'] != -1 && $options[ $field ]['response_code'] < 400 ? '' : 'ip-geo-block-hide',
861
+ 'placeholder' => '/about/',
862
  )
863
  );
864
 
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
  $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
  $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
  $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 ) {
1028
  /*----------------------------------------*
1029
  * Geolocation service settings
1030
  *----------------------------------------*/
 
1031
  add_settings_section(
1032
+ $section = $plugin_slug . '-provider',
1033
  __( 'Geolocation API settings', 'ip-geo-block' ),
1034
  array( __CLASS__, 'note_services' ),
1035
  $option_slug
1085
  );
1086
  }
1087
 
 
1088
  add_settings_section(
1089
+ $section = $plugin_slug . '-database',
1090
  __( 'Local database settings', 'ip-geo-block' ),
1091
  NULL,
1092
  $option_slug
1145
  /*----------------------------------------*
1146
  * Record settings
1147
  *----------------------------------------*/
 
1148
  add_settings_section(
1149
+ $section = $plugin_slug . '-recording',
1150
  __( 'Record settings', 'ip-geo-block' ),
1151
  array( __CLASS__, 'note_record' ),
1152
  $option_slug
1263
  /*----------------------------------------*
1264
  * Cache settings
1265
  *----------------------------------------*/
 
1266
  add_settings_section(
1267
+ $section = $plugin_slug . '-cache',
1268
  __( 'IP address cache settings', 'ip-geo-block' ),
1269
  NULL,
1270
  $option_slug
1323
  /*----------------------------------------*
1324
  * Submission settings
1325
  *----------------------------------------*/
 
1326
  add_settings_section(
1327
+ $section = $plugin_slug . '-submission',
1328
  __( 'Submission settings', 'ip-geo-block' ),
1329
  NULL,
1330
  $option_slug
1360
  /*----------------------------------------*
1361
  * Plugin settings
1362
  *----------------------------------------*/
 
1363
  add_settings_section(
1364
+ $section = $plugin_slug . '-others',
1365
  __( 'Plugin settings', 'ip-geo-block' ),
1366
  NULL,
1367
  $option_slug
1368
  );
1369
+ if (0):
1370
+ // @see https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/
1371
+ if ( is_main_site() && is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
1372
+ add_action( 'network_admin_edit_' . IP_Geo_Block::PLUGIN_NAME, array( $context, 'validate_network_settings' ) );
1373
 
1374
+ // Network wide configuration
1375
+ $field = 'network_wide';
1376
+ add_settings_field(
1377
+ $option_name.'_'.$field,
1378
+ __( '<dfn title="Synchronize all settings over the network wide.">Network wide settings</dfn>', 'ip-geo-block' ),
1379
+ array( $context, 'callback_field' ),
1380
+ $option_slug,
1381
+ $section,
1382
+ array(
1383
+ 'type' => 'checkbox',
1384
+ 'option' => $option_name,
1385
+ 'field' => $field,
1386
+ 'value' => $options[ $field ],
1387
+ 'disabled' => ! current_user_can( 'manage_network_options' ),
1388
+ )
1389
+ );
1390
+ }
1391
+ endif;
1392
  // Remove all settings at uninstallation
1393
  $field = 'clean_uninstall';
1394
  add_settings_field(
1496
  );
1497
  endif;
1498
 
1499
+ // Show WordPress system info
1500
  $field = 'show-info';
1501
  add_settings_field(
1502
  $option_name.'_'.$field,
1503
+ __( '<dfn title="Please copy &amp; paste when submitting your issue to support forum.">System information</dfn><br />[ <a rel="noreferrer" href="https://wordpress.org/support/plugin/ip-geo-block" title="WordPress &#8250; Support &raquo; IP Geo Block">support forum</a> ]', 'ip-geo-block' ),
1504
  array( $context, 'callback_field' ),
1505
  $option_slug,
1506
  $section,
admin/includes/tab-statistics.php CHANGED
@@ -2,15 +2,13 @@
2
  class IP_Geo_Block_Admin_Tab {
3
 
4
  public static function tab_setup( $context, $tab ) {
5
- $plugin_slug = IP_Geo_Block::PLUGIN_NAME;
6
- $option_slug = IP_Geo_Block::PLUGIN_NAME;
7
- $option_name = IP_Geo_Block::OPTION_NAME;
8
  $options = IP_Geo_Block::get_option();
9
  $statistics = IP_Geo_Block_Logs::restore_stat( TRUE );
 
10
 
11
  register_setting(
12
- $option_slug,
13
- $option_name
14
  );
15
 
16
  if ( $options['save_statistics'] ) :
@@ -18,9 +16,8 @@ if ( $options['save_statistics'] ) :
18
  /*----------------------------------------*
19
  * Statistics of validation
20
  *----------------------------------------*/
21
- $section = $plugin_slug . '-statistics';
22
  add_settings_section(
23
- $section,
24
  __( 'Statistics of validation', 'ip-geo-block' ),
25
  NULL,
26
  $option_slug
@@ -175,14 +172,38 @@ if ( $options['save_statistics'] ) :
175
  )
176
  );
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  else:
179
 
180
  /*----------------------------------------*
181
  * Warning
182
  *----------------------------------------*/
183
- $section = $plugin_slug . '-statistics';
184
  add_settings_section(
185
- $section,
186
  __( 'Statistics of validation', 'ip-geo-block' ),
187
  array( __CLASS__, 'warn_statistics' ),
188
  $option_slug
@@ -206,9 +227,8 @@ endif;
206
  /*----------------------------------------*
207
  * Statistics in cache
208
  *----------------------------------------*/
209
- $section = $plugin_slug . '-cache';
210
  add_settings_section(
211
- $section,
212
  __( 'Statistics in cache', 'ip-geo-block' ),
213
  NULL, // array( $context, 'callback_cache_stat' ),
214
  $option_slug
@@ -289,4 +309,98 @@ endif;
289
  echo '<p>', __( 'Please set the proper condition to record and analyze the validation statistics.', 'ip-geo-block' ), '</p>', "\n";
290
  }
291
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  }
2
  class IP_Geo_Block_Admin_Tab {
3
 
4
  public static function tab_setup( $context, $tab ) {
 
 
 
5
  $options = IP_Geo_Block::get_option();
6
  $statistics = IP_Geo_Block_Logs::restore_stat( TRUE );
7
+ $plugin_slug = IP_Geo_Block::PLUGIN_NAME;
8
 
9
  register_setting(
10
+ $option_slug = IP_Geo_Block::PLUGIN_NAME,
11
+ $option_name = IP_Geo_Block::OPTION_NAME
12
  );
13
 
14
  if ( $options['save_statistics'] ) :
16
  /*----------------------------------------*
17
  * Statistics of validation
18
  *----------------------------------------*/
 
19
  add_settings_section(
20
+ $section = $plugin_slug . '-statistics',
21
  __( 'Statistics of validation', 'ip-geo-block' ),
22
  NULL,
23
  $option_slug
172
  )
173
  );
174
 
175
+ /*----------------------------------------*
176
+ * Statistics in logs
177
+ *----------------------------------------*/
178
+ add_settings_section(
179
+ $section = $plugin_slug . '-stat-logs',
180
+ __( 'Statistics in logs', 'ip-geo-block' ),
181
+ array( __CLASS__, 'statistics_logs' ),
182
+ $option_slug
183
+ );
184
+
185
+ $field = 'clear_logs';
186
+ add_settings_field(
187
+ $option_name.'_'.$field,
188
+ __( 'Clear logs', 'ip-geo-block' ),
189
+ array( $context, 'callback_field' ),
190
+ $option_slug,
191
+ $section,
192
+ array(
193
+ 'type' => 'button',
194
+ 'option' => $option_name,
195
+ 'field' => $field,
196
+ 'value' => __( 'Clear now', 'ip-geo-block' ),
197
+ )
198
+ );
199
+
200
  else:
201
 
202
  /*----------------------------------------*
203
  * Warning
204
  *----------------------------------------*/
 
205
  add_settings_section(
206
+ $section = $plugin_slug . '-statistics',
207
  __( 'Statistics of validation', 'ip-geo-block' ),
208
  array( __CLASS__, 'warn_statistics' ),
209
  $option_slug
227
  /*----------------------------------------*
228
  * Statistics in cache
229
  *----------------------------------------*/
 
230
  add_settings_section(
231
+ $section = $plugin_slug . '-cache',
232
  __( 'Statistics in cache', 'ip-geo-block' ),
233
  NULL, // array( $context, 'callback_cache_stat' ),
234
  $option_slug
309
  echo '<p>', __( 'Please set the proper condition to record and analyze the validation statistics.', 'ip-geo-block' ), '</p>', "\n";
310
  }
311
 
312
+ /**
313
+ * Render top list
314
+ *
315
+ */
316
+ public static function statistics_logs() {
317
+ // array of ( `time`, `ip`, `hook`, `code`, `method`, `data` )
318
+ $logs = IP_Geo_Block_Logs::get_recent_logs( YEAR_IN_SECONDS );
319
+
320
+ // Count by key
321
+ $count = array();
322
+ $keys = array(
323
+ 'code' => __( 'Country (Top 10)', 'ip-geo-block' ),
324
+ 'asn' => __( 'AS number (Top 10)', 'ip-geo-block' ),
325
+ 'ip' => __( 'IP address (Top 10)', 'ip-geo-block' ),
326
+ 'slug' => __( 'Slug in back-end', 'ip-geo-block' ),
327
+ );
328
+
329
+ foreach( $logs as $val ) {
330
+ $val['ip'] = '[' . $val['code'] . '] ' . $val['ip'];
331
+ $key = $val['method'] . ' ' . $val['data'];
332
+
333
+ // <methodName>...</methodName>
334
+ if ( preg_match( '#<methodName>(.*?)</methodName>#', $key, $matches ) ) {
335
+ $val['slug'] = '/xmlrpc.php ' . $matches[1];
336
+ }
337
+
338
+ // /wp-content/(plugins|themes)/...
339
+ elseif ( preg_match( '#(/wp-content/(?:plugins|themes)/.*?/)#', $key, $matches ) ) {
340
+ $val['slug'] = $matches[1];
341
+ }
342
+
343
+ // /wp-admin/admin*.php?action=...
344
+ elseif ( preg_match( '#(/wp-admin/admin.*?\.php).*((?:page|action)=[\w-]+)#', $key, $matches ) ) {
345
+ $val['slug'] = $matches[1] . (isset( $matches[2] ) ? ' ' . $matches[2] : '');
346
+ }
347
+
348
+ // /wp-admin/*.php
349
+ elseif ( preg_match( '#(/wp-admin/(?!admin).*?\.php)#', $key, $matches ) ) {
350
+ $val['slug'] = $matches[1];
351
+ }
352
+
353
+ // file uploading *.(zip|tar|rar|gz|php|...)
354
+ elseif ( preg_match( '#(\[name\]\s*?=>.*\.\w+?)\b#', $key, $matches ) ) {
355
+ $val['slug'] = $matches[1];
356
+ }
357
+
358
+ // /*.php
359
+ elseif ( preg_match( '#^\w+?\[\d+?\]:(/[^/]+?\.php)#', $key, $matches ) ) {
360
+ $val['slug'] = $matches[1];
361
+ }
362
+
363
+ foreach ( array_keys( $keys ) as $key ) {
364
+ if ( ! empty( $val[ $key ] ) ) {
365
+ $count[ $key ][] = $val[ $key ];
366
+ }
367
+ }
368
+ }
369
+
370
+ foreach ( $keys as $slug => $val ) {
371
+ echo '<ol class="ip-geo-block-top-list"><h4>', esc_html( $val ), '</h4>';
372
+
373
+ if ( isset( $count[ $slug ] ) ) {
374
+ $logs = array_count_values( $count[ $slug ] );
375
+ arsort( $logs );
376
+
377
+ if ( 'slug' !== $slug )
378
+ $logs = array_slice( $logs, 0, 10 );
379
+
380
+ foreach ( $logs as $key => $val ) {
381
+ $link = explode( ' ', $key );
382
+ $link = esc_html( end( $link ) );
383
+ $key = esc_html( $key ) ;
384
+
385
+ echo '<li><code>';
386
+ echo 'code' === $slug ?
387
+ $key :
388
+ str_replace(
389
+ $link,
390
+ '<a href="' .
391
+ esc_url( add_query_arg(
392
+ array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 4, 's' => $link ),
393
+ admin_url( 'options-general.php' )
394
+ ) ) .
395
+ '" target=_blank>' . $link . '</a>',
396
+ $key
397
+ );
398
+ echo '</code> (', (int)$val, ')</li>';
399
+ }
400
+ }
401
+
402
+ echo '</ol>', "\n";
403
+ }
404
+ }
405
+
406
  }
admin/js/admin.js CHANGED
@@ -52,7 +52,7 @@ var ip_geo_block_time = new Date();
52
  }
53
 
54
  function notice_html5() {
55
- warning(null, IP_GEO_BLOCK.msg[6]);
56
  }
57
 
58
  function redirect(page, tab) {
@@ -241,7 +241,10 @@ var ip_geo_block_time = new Date();
241
  }
242
 
243
  $.each(data, function (name, val) {
244
- $('[name="' + name + '"]:input', self).val(val);
 
 
 
245
  });
246
  });
247
  };
@@ -273,6 +276,9 @@ var ip_geo_block_time = new Date();
273
  // Public facing pages
274
  set_front_end($(ID('@', 'validation_public')));
275
 
 
 
 
276
  // Additional edge case
277
  if (clear) {
278
  clear = ID('%', 'settings[providers][IPInfoDB]');
@@ -318,7 +324,7 @@ var ip_geo_block_time = new Date();
318
  dataLine: [],
319
  viewLine: [],
320
  drawLine: function (id, datetype) {
321
- var i, n, t, data;
322
  if ('undefined' === typeof chart.dataLine[id]) {
323
  i = chart.dataLine[id] = new google.visualization.DataTable();
324
  i.addColumn(datetype, 'Date' );
@@ -357,11 +363,24 @@ var ip_geo_block_time = new Date();
357
  }
358
  });
359
  }
360
- },
361
  };
362
 
363
  // google chart
364
- function initChart(tabNo) {
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  if ('object' === typeof google) {
366
  google.load('visualization', '1', {
367
  packages: ['corechart'],
@@ -372,17 +391,6 @@ var ip_geo_block_time = new Date();
372
  }
373
  }
374
 
375
- function drawChart(tabNo) {
376
- if (1 === tabNo) {
377
- chart.drawPie(ID('chart-countries'));
378
- chart.drawLine(ID('chart-daily'), 'date');
379
- } else if (5 === tabNo) {
380
- $(ID('.', 'multisite')).each(function (i, obj) {
381
- chart.drawLine($(obj).attr('id'), 'datetime');
382
- });
383
- }
384
- }
385
-
386
  // Load / Save cookie using wpCookies in wp-includes/js/utils.js
387
  function loadCookie(tabNo) {
388
  var i, cookie = ('undefined' !== typeof wpCookies && wpCookies.getHash('ip-geo-block')) || [];
@@ -502,6 +510,17 @@ var ip_geo_block_time = new Date();
502
  );
503
  }
504
 
 
 
 
 
 
 
 
 
 
 
 
505
  $(function () {
506
  // Get tab number
507
  var tabNo = Number(IP_GEO_BLOCK.tab) || 0,
@@ -573,7 +592,7 @@ var ip_geo_block_time = new Date();
573
  var $this = $(this),
574
  stat = parseInt($this.val(), 10);
575
  $this.nextAll(ID('.', 'settings-folding')).each(function (i, obj) {
576
- fold_elements($(obj), stat === i + 1);
577
  });
578
  return stopPropergation(event);
579
  }).change();
@@ -586,7 +605,7 @@ var ip_geo_block_time = new Date();
586
 
587
  // only for Front-end target settings
588
  if (0 <= $this.attr('name').indexOf('public')) {
589
- if (-1 == $(ID('@', 'public_matching_rule')).val()) {
590
  elm.each(function (index) {
591
  if (1 >= index) {
592
  $(this).hide();
@@ -632,46 +651,87 @@ var ip_geo_block_time = new Date();
632
  return stopPropergation(event);
633
  }).change();
634
 
 
 
 
 
 
635
  // Exceptions for Admin ajax/post
636
- $(ID('@', 'exception_admin')).on('change', function (event) {
637
- var actions = $.grep($(this).val().split(','), function (e){
638
- return '' !== e.replace(/^\s+|\s+$/g, ''); // remove empty element
639
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
 
641
- $(ID('#', 'actions')).find('input').each(function (i, e) {
642
- var $this = $(this),
643
- action = $this.attr('id').replace(ID('%', ''), '');
644
- $this.prop('checked', -1 !== $.inArray(action, actions));
645
- });
646
- return stopPropergation(event);
647
- }).change();
648
 
649
- // Candidate actions
650
- $(ID('#', 'actions')).on('click', 'input', function (event) {
651
- var i, $this = $(this),
652
- action = $this.attr('id').replace(ID('%', ''), ''),
653
- $admin = $(ID('@', 'exception_admin')),
654
- actions = $.grep($admin.val().split(','), function (e){
655
- return '' !== e.replace(/^\s+|\s+$/g, ''); // remove empty element
656
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
 
658
- // find the action
659
- i = $.inArray(action, actions);
660
 
661
- if (-1 === i) {
662
- actions.push(action);
663
- } else {
664
- actions.splice(i, 1);
665
- }
666
 
667
- $admin.val(actions.join(',')).change();
 
668
  });
669
 
670
  // Enable / Disable Exceptions
671
- show_folding_ajax($(ID('@', 'validation_ajax_1')));
672
- $('input[id^="' + ID('!', 'validation_ajax_') + '"]').on('click', function (event) {
673
  show_folding_ajax($(this));
674
- });
675
 
676
  /*---------------------------
677
  * Front-end target settings
@@ -850,17 +910,35 @@ var ip_geo_block_time = new Date();
850
 
851
  // Toggle checkbox
852
  $(ID('.', 'cycle')).on('click', function (event) {
853
- var $that = $(this).next('li'),
854
  text = $that.find(ID('@', 'exception_admin')),
855
- cbox = $that.find('input:checkbox'),
856
  stat = cbox.filter(':checked').length;
857
 
 
 
858
  if (text.length) {
859
- cbox.filter(stat ? ':checked' : ':not(:checked)').click();
860
- } else {
861
- cbox.prop('checked', !stat);
 
 
 
 
 
 
 
862
  }
863
 
 
 
 
 
 
 
 
 
 
864
  return false;
865
  });
866
 
@@ -898,7 +976,7 @@ var ip_geo_block_time = new Date();
898
  // https://developers.google.com/loader/#Dynamic
899
  initChart(tabNo);
900
 
901
- // Statistics
902
  $(ID('@', 'clear_statistics')).on('click', function (event) {
903
  confirm(IP_GEO_BLOCK.msg[3], function () {
904
  ajax_clear('statistics', null);
@@ -906,7 +984,15 @@ var ip_geo_block_time = new Date();
906
  return false;
907
  });
908
 
909
- // Statistics
 
 
 
 
 
 
 
 
910
  $(ID('@', 'clear_cache')).on('click', function (event) {
911
  confirm(IP_GEO_BLOCK.msg[4], function () {
912
  ajax_clear('cache', null);
@@ -1090,12 +1176,22 @@ var ip_geo_block_time = new Date();
1090
  });
1091
  });
1092
 
1093
- // Clear filter logs
1094
  $(ID('#', 'reset-filter')).on('click', function (event) {
1095
  $('.footable').trigger('footable_clear_filter');
1096
  return false;
1097
  });
1098
 
 
 
 
 
 
 
 
 
 
 
1099
  // Validation logs
1100
  $(ID('@', 'clear_logs')).on('click', function (event) {
1101
  confirm(IP_GEO_BLOCK.msg[5], function () {
52
  }
53
 
54
  function notice_html5() {
55
+ warning(null, IP_GEO_BLOCK.msg[8]);
56
  }
57
 
58
  function redirect(page, tab) {
241
  }
242
 
243
  $.each(data, function (name, val) {
244
+ key = $('[name="' + name + '"]:input', self).val(val);
245
+ if (key.attr('type') !== 'hidden') { // version
246
+ key.before('<span style="color:red">*</span>');
247
+ }
248
  });
249
  });
250
  };
276
  // Public facing pages
277
  set_front_end($(ID('@', 'validation_public')));
278
 
279
+ // Admin ajax/post
280
+ show_folding_ajax($(ID('@', 'validation_ajax_1')));
281
+
282
  // Additional edge case
283
  if (clear) {
284
  clear = ID('%', 'settings[providers][IPInfoDB]');
324
  dataLine: [],
325
  viewLine: [],
326
  drawLine: function (id, datetype) {
327
+ var i, n, data;
328
  if ('undefined' === typeof chart.dataLine[id]) {
329
  i = chart.dataLine[id] = new google.visualization.DataTable();
330
  i.addColumn(datetype, 'Date' );
363
  }
364
  });
365
  }
366
+ }
367
  };
368
 
369
  // google chart
370
+ function drawChart(tabNo) {
371
+ if ('object' === typeof google) {
372
+ if (1 === tabNo) {
373
+ chart.drawPie(ID('chart-countries'));
374
+ chart.drawLine(ID('chart-daily'), 'date');
375
+ } else if (5 === tabNo) {
376
+ $(ID('.', 'multisite')).each(function (i, obj) {
377
+ chart.drawLine($(obj).attr('id'), 'datetime');
378
+ });
379
+ }
380
+ }
381
+ }
382
+
383
+ function initChart(tabNo) {
384
  if ('object' === typeof google) {
385
  google.load('visualization', '1', {
386
  packages: ['corechart'],
391
  }
392
  }
393
 
 
 
 
 
 
 
 
 
 
 
 
394
  // Load / Save cookie using wpCookies in wp-includes/js/utils.js
395
  function loadCookie(tabNo) {
396
  var i, cookie = ('undefined' !== typeof wpCookies && wpCookies.getHash('ip-geo-block')) || [];
510
  );
511
  }
512
 
513
+ // form for export / import
514
+ function add_icon(dfn, span, title, icon) {
515
+ var i, j;
516
+ i = dfn.cloneNode(false);
517
+ i.setAttribute('title', title);
518
+ j = span.cloneNode(false);
519
+ j.setAttribute('class', 'dashicons dashicons-' + icon);
520
+ i.appendChild(j);
521
+ return i;
522
+ }
523
+
524
  $(function () {
525
  // Get tab number
526
  var tabNo = Number(IP_GEO_BLOCK.tab) || 0,
592
  var $this = $(this),
593
  stat = parseInt($this.val(), 10);
594
  $this.nextAll(ID('.', 'settings-folding')).each(function (i, obj) {
595
+ fold_elements($(obj), (stat === i + 1) || (stat && 2 === i));
596
  });
597
  return stopPropergation(event);
598
  }).change();
605
 
606
  // only for Front-end target settings
607
  if (0 <= $this.attr('name').indexOf('public')) {
608
+ if (-1 === parseInt($(ID('@', 'public_matching_rule')).val(), 10)) {
609
  elm.each(function (index) {
610
  if (1 >= index) {
611
  $(this).hide();
651
  return stopPropergation(event);
652
  }).change();
653
 
654
+ // WP-ZEP in Admin area
655
+ $(ID('@', 'validation_admin_2')).on('change', function (event) {
656
+ IP_GEO_BLOCK_AUTH.zep.admin = true;
657
+ });
658
+
659
  // Exceptions for Admin ajax/post
660
+ ajax_post(null, {
661
+ cmd: 'get-actions'
662
+ }, function (data) {
663
+ var i, j, id, key, $this = $(ID('#', 'actions')),
664
+ li = document.createElement('li' ),
665
+ input = document.createElement('input'),
666
+ label = document.createElement('label'),
667
+ dfn = document.createElement('dfn' ),
668
+ span = document.createElement('span' );
669
+ for (key in data) {
670
+ id = ID('%', key);
671
+ if (data.hasOwnProperty(key) && ! $this.find('#' + id).size()) {
672
+ i = input.cloneNode(false);
673
+ i.setAttribute('id', id);
674
+ i.setAttribute('value', '1');
675
+ i.setAttribute('type', 'checkbox');
676
+ j = li.cloneNode(false);
677
+ j.appendChild(i);
678
+
679
+ i = label.cloneNode(false);
680
+ i.setAttribute('for', id);
681
+ i.appendChild(document.createTextNode(key));
682
+ j.appendChild(i);
683
+
684
+ if (1 & data[key]) {
685
+ j.appendChild(add_icon(dfn, span, IP_GEO_BLOCK.msg[6], 'lock'));
686
+ }
687
+ if (2 & data[key]) {
688
+ j.appendChild(add_icon(dfn, span, IP_GEO_BLOCK.msg[7], 'unlock'));
689
+ }
690
 
691
+ $this.append(j);
692
+ }
693
+ }
 
 
 
 
694
 
695
+ // Handle text field for actions
696
+ $(ID('@', 'exception_admin')).on('change', function (event) {
697
+ var actions = $.grep($(this).val().split(','), function (e){
698
+ return '' !== e.replace(/^\s+|\s+$/g, ''); // remove empty element
699
+ });
700
+
701
+ $(ID('#', 'actions')).find('input').each(function (i, e) {
702
+ var $this = $(this),
703
+ action = $this.attr('id').replace(ID('%', ''), '');
704
+ $this.prop('checked', -1 !== $.inArray(action, actions));
705
+ });
706
+ return stopPropergation(event);
707
+ }).change();
708
+
709
+ // Candidate actions
710
+ $(ID('#', 'actions')).on('click', 'input', function (event) {
711
+ var i, $this = $(this),
712
+ action = $this.attr('id').replace(ID('%', ''), ''),
713
+ $admin = $(ID('@', 'exception_admin')),
714
+ actions = $.grep($admin.val().split(','), function (e){
715
+ return '' !== e.replace(/^\s+|\s+$/g, ''); // remove empty element
716
+ });
717
 
718
+ // find the action
719
+ i = $.inArray(action, actions);
720
 
721
+ if (-1 === i) {
722
+ actions.push(action);
723
+ } else {
724
+ actions.splice(i, 1);
725
+ }
726
 
727
+ $admin.val(actions.join(',')).change();
728
+ });
729
  });
730
 
731
  // Enable / Disable Exceptions
732
+ $('input[id^="' + ID('!', 'validation_ajax_') + '"]').on('change', function (event) {
 
733
  show_folding_ajax($(this));
734
+ }).change();
735
 
736
  /*---------------------------
737
  * Front-end target settings
910
 
911
  // Toggle checkbox
912
  $(ID('.', 'cycle')).on('click', function (event) {
913
+ var regex, $that = $(this).nextAll('li'), actions,
914
  text = $that.find(ID('@', 'exception_admin')),
915
+ cbox = $that.find('input:checkbox').filter(':visible'),
916
  stat = cbox.filter(':checked').length;
917
 
918
+ cbox.prop('checked', !stat);
919
+
920
  if (text.length) {
921
+ if (stat) {
922
+ text.val('');
923
+ } else {
924
+ regex = new RegExp(ID('%', ''));
925
+ actions = [];
926
+ cbox.each(function (i) {
927
+ actions[i] = $(this).attr('id').replace(regex, '');
928
+ });
929
+ text.val(actions.join(','));
930
+ }
931
  }
932
 
933
+ $(this).blur(); // unfocus anchor tag
934
+ return false;
935
+ });
936
+
937
+ // Show/Hide logged in user only
938
+ $(ID('.', 'unlock')).on('click', function (event) {
939
+ $(this).nextAll('li').find('h4').nextAll('li').filter(function (i, elm) {
940
+ return ! $(this).find('.dashicons-unlock').length;
941
+ }).toggle();
942
  return false;
943
  });
944
 
976
  // https://developers.google.com/loader/#Dynamic
977
  initChart(tabNo);
978
 
979
+ // Statistics of validation
980
  $(ID('@', 'clear_statistics')).on('click', function (event) {
981
  confirm(IP_GEO_BLOCK.msg[3], function () {
982
  ajax_clear('statistics', null);
984
  return false;
985
  });
986
 
987
+ // Statistics in logs
988
+ $(ID('@', 'clear_logs')).on('click', function (event) {
989
+ confirm(IP_GEO_BLOCK.msg[5], function () {
990
+ ajax_clear('logs', null);
991
+ });
992
+ return false;
993
+ });
994
+
995
+ // Statistics in cache
996
  $(ID('@', 'clear_cache')).on('click', function (event) {
997
  confirm(IP_GEO_BLOCK.msg[4], function () {
998
  ajax_clear('cache', null);
1176
  });
1177
  });
1178
 
1179
+ // Clear filter
1180
  $(ID('#', 'reset-filter')).on('click', function (event) {
1181
  $('.footable').trigger('footable_clear_filter');
1182
  return false;
1183
  });
1184
 
1185
+ // Preset filter
1186
+ $(ID('.', 'field')).on('footable_initialized', function (event) {
1187
+ $('.footable').trigger(
1188
+ 'footable_filter', {
1189
+ 'filter': $(ID('@', 'filter_logs')).val()
1190
+ }
1191
+ );
1192
+ return false;
1193
+ });
1194
+
1195
  // Validation logs
1196
  $(ID('@', 'clear_logs')).on('click', function (event) {
1197
  confirm(IP_GEO_BLOCK.msg[5], function () {
admin/js/admin.min.js CHANGED
@@ -3,4 +3,4 @@
3
  Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
4
  This software is released under the MIT License.
5
  */
6
- var ip_geo_block_time=new Date;(function(b,n,E){function a(b,a){var c={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_","!":"ip_geo_block_settings_"};return"undefined"!==typeof a?c[b]+a:c.$+b}function l(b){return b?b.toString().replace(/[&<>"']/g,function(b){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[b]}):""}function w(c,e){e?b(a("#",c)).addClass(a("loading")):b(a("#",c)).removeClass(a("loading"))}function r(b,a){n.confirm(l(b))&&a()}function v(b,a){n.alert(b?l(b+": "+a):l(a))}function x(b,a){-1!==location.href.indexOf(b)&&(n.location=l(b)+(a?"&"+l(a):""))}function p(a,e,g,f){a&&w(a,!0);e.action=IP_GEO_BLOCK.action;e.nonce=IP_GEO_BLOCK.nonce;b.post(IP_GEO_BLOCK.url,e).done(function(b,a,c){g(b)}).fail(function(b,a,c){v(a,b.responseText)}).always(function(){a&&(f?b.when.apply(b,f).then(function(){w(a,!1)}):w(a,!1))})}function y(b,a){p(b,{cmd:"clear-"+b,which:a},function(b){x(b.page,b.tab)})}function F(b){p(b,{cmd:b},function(b){x(b.page,b.tab)})}function t(b){b.stopImmediatePropagation();return!1}function z(b,e){e?b.removeClass("folding-disable"):(b.children("li,a").hide(),b.addClass("folding-disable"),b.removeClass(a("dropdown")).addClass(a("dropup")))}function A(c,e,g){var f=0===c.prop("type").indexOf("checkbox")&&c.is(":checked")||0===c.prop("type").indexOf("select")&&"0"!==c.val();e.nextAll(a(".","settings-folding")).each(function(a,k){z(b(k),f&&g)})}function G(c){var e=a("@","validation_ajax_");z(c.closest("ul").next(),b(e+"1").is(":checked")||b(e+"2").is(":checked"))}function u(b){return String(b).replace(/[a-z]/gi,function(b){return String.fromCharCode(b.charCodeAt(0)+("n">b.toLowerCase()?13:-13))})}function K(b,a){var c=new FileReader;c.onload=function(b){a&&a(b.target.result)};c.onerror=function(b){v("Error",b.target.error.code)};c.readAsText(b)}function H(c){var e=c.is(":checked"),g=b(a("@","public_target_rule")),f=c.closest("tr").nextAll("tr");f.find('[name^="'+a("%","settings")+'"]').prop("disabled",!e);f.find(a(".","desc")).css("opacity",e?1:.5);A(c,g,"1"===g.val()?!0:!1)}function B(c,e){c&&("string"===typeof c&&(c=JSON.parse(c)),e&&b('input[type="checkbox"]').prop("checked",!1).change(),b(a("#","import")).closest("form").deserialize(c),b(a("@","exception_admin")+","+a("@","validation_mimetype")).change(),b('select[name*="'+a("%","settings")+'"]').change(),b(a("@","validation_login")).change(),H(b(a("@","validation_public"))),e&&(e=a("%","settings[providers][IPInfoDB]"),b(a("@","providers_IPInfoDB")).prop("checked",c[e]?!0:!1)))}function I(b){"object"===typeof google&&google.load("visualization","1",{packages:["corechart"],callback:function(){C(b)}})}function C(c){1===c?(m.drawPie(a("chart-countries")),m.drawLine(a("chart-daily"),"date")):5===c&&b(a(".","multisite")).each(function(a,c){m.drawLine(b(c).attr("id"),"datetime")})}function L(b){var a,c="undefined"!==typeof wpCookies&&wpCookies.getHash("ip-geo-block")||[];for(a in c)c.hasOwnProperty(a)&&(c[a]=c[a].replace(/[^ox\d]/g,"").split(""));"undefined"===typeof c[b]&&(c[b]=[]);return c}function D(a){var c,g=[];b.each(a,function(b,a){g[b]="";if("undefined"!==typeof a&&(c=a.length))for(g[b]=a[0]||"o",f=1;f<c;++f)g[b]+=a[f]||"o"});if("undefined"!==typeof wpCookies){var f="undefined"!==typeof IP_GEO_BLOCK_AUTH?IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin:"";wpCookies.setHash("ip-geo-block",g,new Date(Date.now()+2592E6),f)}}function M(c){var e=L(c);b("form").on("click","h2,h3",function(g){var f=b(this);g=f.closest("fieldset").data("section");var d=f.parent().nextAll(".panel-body").toggle();f.toggleClass(a("dropup")).toggleClass(a("dropdown"));(f=f.hasClass(a("dropdown")))?d.addClass(a("border")):d.removeClass(a("border"));e[c][g]=f?"o":"x";D(e);C(c);return!1});b(a("#","toggle-sections")).on("click",function(g){var f;g=b(a(".","field")).find("h2,h3");var d=[a("dropdown"),a("dropup")],k=g.filter("."+d[0]).length;g.each(function(h){f=b(this);f.removeClass(d.join(" ")).addClass(k?d[1]:d[0]);f=f.parent().nextAll(".panel-body").toggle(k?!1:!0);k?f.removeClass(a("border")):f.addClass(a("border"));e[c][h]=k?"x":"o"});D(e);C(c);return!1});return e}function J(c){b("body").append('<div style="display:none"><form method="POST" id="'+a("export-form")+'" action="'+IP_GEO_BLOCK.url.replace("ajax.php","post.php")+'"><input type="hidden" name="action" value="'+IP_GEO_BLOCK.action+'" /><input type="hidden" name="nonce" value="'+IP_GEO_BLOCK.nonce+'" /><input type="hidden" name="cmd" value="'+c+'" /><input type="hidden" name="data" value="" id="'+a("export-data")+'"/><input type="submit" value="submit" /></form><input type="file" name="settings" id="'+a("file-dialog")+'" /></div>')}b.fn.deserialize=function(a,e){return this.each(function(){var c,e=this,d={};for(c in a)if(a.hasOwnProperty(c))try{var k=decodeURIComponent(c);var h=decodeURIComponent(a[c]);d.hasOwnProperty(k)||(d[k]=[]);d[k].push(h)}catch(q){}b.each(d,function(a,d){b('[name="'+a+'"]:input',e).val(d)})})};var m={dataPie:[],viewPie:[],drawPie:function(a){if("undefined"===typeof m.dataPie[a]){var c=m.dataPie[a]=new google.visualization.DataTable;c.addColumn("string","Country");c.addColumn("number","Requests");c=b.parseJSON(b("#"+a).attr("data-"+a));m.dataPie[a].addRows(c)}"undefined"===typeof m.viewPie[a]&&(m.viewPie[a]=new google.visualization.PieChart(E.getElementById(a)));b("#"+a).width()&&m.viewPie[a].draw(m.dataPie[a],{backgroundColor:{fill:"transparent"},chartArea:{left:0,top:"5%",width:"100%",height:"90%"},sliceVisibilityThreshold:.015})},dataLine:[],viewLine:[],drawLine:function(a,e){if("undefined"===typeof m.dataLine[a]){var c=m.dataLine[a]=new google.visualization.DataTable;c.addColumn(e,"Date");c.addColumn("number","comment");c.addColumn("number","xmlrpc");c.addColumn("number","login");c.addColumn("number","admin");c.addColumn("number","public");var f=b.parseJSON(b("#"+a).attr("data-"+a));var d=f.length;for(c=0;c<d;++c)f[c][0]=new Date(1E3*f[c][0]);m.dataLine[a].addRows(f)}"undefined"===typeof m.viewLine[a]&&(m.viewLine[a]=new google.visualization.LineChart(E.getElementById(a)));if(c=b("#"+a).width())c=320<c?!0:!1,m.viewLine[a].draw(m.dataLine[a],{backgroundColor:{fill:"transparent"},legend:{position:"bottom"},hAxis:{format:"MM/dd"+("datetime"===e?" HH:mm":"")},vAxis:{textPosition:c?"out":"in"},chartArea:{left:c?"10%":0,top:"5%",width:"100%",height:"75%"}})}};b(function(){var c=Number(IP_GEO_BLOCK.tab)||0,e=M(c);b(a(".","inhibit")).on("submit",function(){return!1});switch(c){case 0:var g=a("%","settings");b('[id^="'+a("scan-")+'"]').on("click",function(d){d=b(this);var c=d.attr("id"),h=d.parent();p(c.replace(/^.*(?:scan)/,"scanning"),{cmd:"scan-code",which:c.replace(a("scan-"),"")},function(b){h.children("ul").length||h.append('<ul id="'+a("code-list")+'"></ul>');h=h.children("ul").empty();for(d in b)if(b.hasOwnProperty(d)){var d=l(d);if("string"===typeof b[d])var c=l(b[d]);else c=l(b[d].code),d='<abbr title="'+l(b[d].type)+'">'+d+"</abbr>";h.append("<li>"+d+' : <span class="'+a("notice")+'">'+c+"</span></li>")}h.show("slow")});return!1});b(a("@","matching_rule")).on("change",function(){var d=this.value;b(a("@","white_list")).closest("tr").toggle("0"===d);b(a("@","black_list")).closest("tr").toggle("1"===d);return!1}).change();b(a("@","validation_mimetype")).on("change",function(d){var c=b(this),h=parseInt(c.val(),10);c.nextAll(a(".","settings-folding")).each(function(a,d){z(b(d),h===a+1)});return t(d)}).change();b('select[name*="response_code"]').on("change",function(d){var c=b(this),h=parseInt(c.val()/100,10),q=c.closest("tr").nextAll("tr");if(0<=c.attr("name").indexOf("public")&&-1==b(a("@","public_matching_rule")).val())return q.each(function(a){1>=a&&b(this).hide()}),t(d);3>=h?q.each(function(a){0===a?b(this).show():1===a&&b(this).hide()}):q.each(function(a){0===a?b(this).hide():1===a&&b(this).show()});return t(d)}).change();b(a("#","decode")).on("click",function(d){d=b(a("@","signature"));var c=d.val();-1===c.search(/,/)?d.val(u(n.atob(c))):d.val(n.btoa(u(c)));return!1});b(a("@","validation_login")).on("change",function(a){var d=b(this);A(d,d,g,!0);return t(a)}).change();b(a("@","exception_admin")).on("change",function(d){var c=b.grep(b(this).val().split(","),function(a){return""!==a.replace(/^\s+|\s+$/g,"")});b(a("#","actions")).find("input").each(function(d,k){var h=b(this),q=h.attr("id").replace(a("%",""),"");h.prop("checked",-1!==b.inArray(q,c))});return t(d)}).change();b(a("#","actions")).on("click","input",function(d){var c=b(this).attr("id").replace(a("%",""),""),h=b(a("@","exception_admin")),q=b.grep(h.val().split(","),function(a){return""!==a.replace(/^\s+|\s+$/g,"")});d=b.inArray(c,q);-1===d?q.push(c):q.splice(d,1);h.val(q.join(",")).change()});G(b(a("@","validation_ajax_1")));b('input[id^="'+a("!","validation_ajax_")+'"]').on("click",function(a){G(b(this))});b(a("@","validation_public")).on("change",function(a){H(b(this));return t(a)}).change();b(a("@","public_matching_rule")).on("change",function(c){var d=this.value;b(a("@","public_white_list")).closest("tr").toggle("0"===d);b(a("@","public_black_list")).closest("tr").toggle("1"===d);b(a("@","public_response_code")).change().closest("tr").toggle("-1"!==d);return t(c)}).change();b(a("@","update")).on("click",function(c){p("download",{cmd:"download"},function(c){var d;for(d in c)if(c.hasOwnProperty(d)){var k=c[d];for(e in k)if(k.hasOwnProperty(e)){var e=l(e);k[e].filename&&b(a("@",d+"_"+e+"_path")).val(l(k[e].filename));k[e].message&&b(a("#",d+"-"+e)).text(l(k[e].message))}}});return!1});J("validate");b(a("#","export")).on("click",function(c){if("undefined"===typeof JSON)return v(null,IP_GEO_BLOCK.msg[6]),!1;var d=g,h={};b.each(b(this).closest("form").serializeArray(),function(a,b){-1!==b.name.indexOf(d)&&(h[b.name]=b.value)});h[d+="[signature]"]=n.btoa(u(h[d]));b(a("#","export-data")).val(JSON.stringify(h));b(a("#","export-form")).submit();return!1});b(a("#","file-dialog")).on("change",function(a){if("undefined"===typeof FileReader)return v(null,IP_GEO_BLOCK.msg[6]),!1;var b;(a=a.target.files[0])&&K(a,function(a){a=JSON.parse(a);b=g+"[signature]";"undefined"!==typeof a[b]&&(a[b]=n.btoa(u(a[b])));p("export-import",{cmd:"validate",data:JSON.stringify(a)},function(a){B(a,!0)})});return!1});b(a("#","import")).on("click",function(c){b(a("#","file-dialog")).click();return!1});b(a("#","default")).on("click",function(a){r(IP_GEO_BLOCK.msg[0],function(){p("pre-defined",{cmd:"import-default"},function(a){B(a,!0)})});return!1});b(a("#","preferred")).on("click",function(a){r(IP_GEO_BLOCK.msg[0],function(){p("pre-defined",{cmd:"import-preferred"},function(a){B(a,!1)})});return!1});b(a("@","create_table")).on("click",function(a){r(IP_GEO_BLOCK.msg[1],function(){F("create-table")});return!1});b(a("@","delete_table")).on("click",function(a){r(IP_GEO_BLOCK.msg[2],function(){F("delete-table")});return!1});b(a("#","show-info")).on("click",function(c){b(a("#","wp-info")).empty();p("wp-info",{cmd:"show-info"},function(c){var d,k=[];for(d in c)c.hasOwnProperty(d)&&k.push("- "+d+" "+c[d]);b(a("#","wp-info")).html('<textarea rows="'+k.length+'">'+k.join("\n")+"</textarea>").find("textarea").select();return!1})});b('select[name^="'+g+'"]').on("change",function(c){c=b(this);var d,e=a(".","desc");c.next(e).empty();(d=c.children("option:selected").data("desc"))&&c.next(e).html(b.parseHTML(d));A(c,c,g,!0);return!1}).change();b(a(".","cycle")).on("click",function(c){var d=b(this).next("li");c=d.find(a("@","exception_admin"));var d=d.find("input:checkbox"),e=d.filter(":checked").length;c.length?d.filter(e?":checked":":not(:checked)").click():d.prop("checked",!e);return!1});b(a(".","settings-folding>dfn")).on("click",function(c){c=a("drop");var d=b(this).parent();d.children("li").toggle();d.toggleClass(c+"up").toggleClass(c+"down");d.hasClass(c+"down")?d.children("a").show():d.children("a").hide();return!1});b("#submit").on("click",function(c){c=b(a("@","signature"));var d=c.val();-1!==d.indexOf(",")&&c.val(n.btoa(u(d)));return!0});break;case 1:I(c);b(a("@","clear_statistics")).on("click",function(a){r(IP_GEO_BLOCK.msg[3],function(){y("statistics",null)});return!1});b(a("@","clear_cache")).on("click",function(a){r(IP_GEO_BLOCK.msg[4],function(){y("cache",null)});return!1});break;case 2:b(n).on(a("gmap-error"),function(){p(null,{cmd:"gmap-error"},function(a){x(a.page,a.tab)})});var f=b(a("#","map"));"object"===typeof google?f.each(function(){b(this).GmapRS()}):f.each(function(){b(this).empty().html('<iframe src="//maps.google.com/maps?output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')});b('select[id^="'+a("!","service")+'"]').on("change",function(a){e[c][3]=b(this).prop("selectedIndex");D(e)}).change();b(a("@","get_location")).on("click",function(c){var d=b(a("#","whois")),e=b(a("@","ip_address")).val();e&&(d.hide().empty(),c=b.whois(e,function(c){var e,f="";for(e=0;e<c.length;++e)f+="<tr><td>"+c[e].name+"</td><td>"+c[e].value+"</td></tr>";d.html('<fieldset id="'+a("section-1")+'" class="'+a("field")+' panel panel-default" data-section="1"><legend class="panel-heading"><h3 id="'+a("whois-title")+'" class="'+a("dropdown")+'">Whois</h3></legend><div class="panel-body '+a("border")+'"><table class="'+a("table")+'">'+f+"</table></div></fieldset>").fadeIn("slow");b(a("#","whois-title")).on("click",function(c){c=b(this);c.parent().nextAll().toggle();c.toggleClass(a("dropup")).toggleClass(a("dropdown"));return!1})}),p("loading",{cmd:"search",ip:e,which:b(a("@","service")).val()},function(b){var c="",d=l(b.latitude||"0"),k=l(b.longitude||"0"),h=b.latitude||b.longitude?8:2;for(g in b)if(b.hasOwnProperty(g)){var g=l(g);c+='<li><span class="'+a("title")+'">'+g+' : </span><span class="'+a("result")+'">'+l(b[g])+"</span></li>"}"object"===typeof google?f.GmapRS("addMarker",{latitude:d,longitude:k,title:e,content:"<ul>"+c+"</ul>",show:!0,zoom:h}):f.css({height:"600px",backgroundColor:"transparent"}).empty().html('<ul style="margin-top:0; margin-left:1em;"><li><span class="'+a("title")+'">IP address : </span><span class="'+a("result")+'">'+l(e)+"</span></li>"+c+'</ul><iframe src="//maps.google.com/maps?q='+d+","+k+"&z="+h+'&output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')},[c]));return!1});b(a("@","ip_address")).val()&&b(a("@","get_location")).click();break;case 4:p("logs",{cmd:"restore",which:null,time:new Date-ip_geo_block_time},function(d){for(var f in d)d.hasOwnProperty(f)&&(f=l(f),b(a("#","log-"+f)).html(d[f]));if("function"===typeof b.fn.footable){d=b(a(".","log"));var g=d.parent().prevAll("legend").find("h2,h3");g.removeClass(a("dropup")).addClass(a("dropdown"));d.fadeIn("slow").footable();g.each(function(a,d){"x"===(e[c][a+1]||"o")&&(e[c][a+1]="o",b(d).click())})}b('tbody[id^="'+a("log-")+'"]').on("click","a",function(a){f=n.location.pathname+n.location.search;n.open(f.replace(/tab=\d/,"tab=2")+"&ip="+b(this).text().replace(/[^\w\.\:\*]/,""),"_blank");return!1})});b(a("#","reset-filter")).on("click",function(a){b(".footable").trigger("footable_clear_filter");return!1});b(a("@","clear_logs")).on("click",function(a){r(IP_GEO_BLOCK.msg[5],function(){y("logs",null)});return!1});J("export-logs");b(a("#","export-logs")).on("click",function(c){b(a("#","export-form")).submit();return!1});break;case 5:I(c)}})})(jQuery,window,document);
3
  Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
4
  This software is released under the MIT License.
5
  */
6
+ var ip_geo_block_time=new Date;(function(a,p,r){function b(a,b){var c={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_","!":"ip_geo_block_settings_"};return"undefined"!==typeof b?c[a]+b:c.$+a}function l(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function x(c,f){f?a(b("#",c)).addClass(b("loading")):a(b("#",c)).removeClass(b("loading"))}function q(a,b){p.confirm(l(a))&&b()}function v(a,b){p.alert(a?l(a+": "+b):l(b))}function y(a,b){-1!==location.href.indexOf(a)&&(p.location=l(a)+(b?"&"+l(b):""))}function m(b,f,g,e){b&&x(b,!0);f.action=IP_GEO_BLOCK.action;f.nonce=IP_GEO_BLOCK.nonce;a.post(IP_GEO_BLOCK.url,f).done(function(a,b,c){g(a)}).fail(function(a,b,c){v(b,a.responseText)}).always(function(){b&&(e?a.when.apply(a,e).then(function(){x(b,!1)}):x(b,!1))})}function w(a,b){m(a,{cmd:"clear-"+a,which:b},function(a){y(a.page,a.tab)})}function E(a){m(a,{cmd:a},function(a){y(a.page,a.tab)})}function t(a){a.stopImmediatePropagation();return!1}function z(a,f){f?a.removeClass("folding-disable"):(a.children("li,a").hide(),a.addClass("folding-disable"),a.removeClass(b("dropdown")).addClass(b("dropup")))}function A(c,f,g){var e=0===c.prop("type").indexOf("checkbox")&&c.is(":checked")||0===c.prop("type").indexOf("select")&&"0"!==c.val();f.nextAll(b(".","settings-folding")).each(function(b,k){z(a(k),e&&g)})}function F(c){var f=b("@","validation_ajax_");z(c.closest("ul").next(),a(f+"1").is(":checked")||a(f+"2").is(":checked"))}function u(a){return String(a).replace(/[a-z]/gi,function(a){return String.fromCharCode(a.charCodeAt(0)+("n">a.toLowerCase()?13:-13))})}function K(a,b){var c=new FileReader;c.onload=function(a){b&&b(a.target.result)};c.onerror=function(a){v("Error",a.target.error.code)};c.readAsText(a)}function G(c){var f=c.is(":checked"),g=a(b("@","public_target_rule")),e=c.closest("tr").nextAll("tr");e.find('[name^="'+b("%","settings")+'"]').prop("disabled",!f);e.find(b(".","desc")).css("opacity",f?1:.5);A(c,g,"1"===g.val()?!0:!1)}function B(c,f){c&&("string"===typeof c&&(c=JSON.parse(c)),f&&a('input[type="checkbox"]').prop("checked",!1).change(),a(b("#","import")).closest("form").deserialize(c),a(b("@","exception_admin")+","+b("@","validation_mimetype")).change(),a('select[name*="'+b("%","settings")+'"]').change(),a(b("@","validation_login")).change(),G(a(b("@","validation_public"))),F(a(b("@","validation_ajax_1"))),f&&(f=b("%","settings[providers][IPInfoDB]"),a(b("@","providers_IPInfoDB")).prop("checked",c[f]?!0:!1)))}function C(c){"object"===typeof google&&(1===c?(n.drawPie(b("chart-countries")),n.drawLine(b("chart-daily"),"date")):5===c&&a(b(".","multisite")).each(function(b,c){n.drawLine(a(c).attr("id"),"datetime")}))}function H(a){"object"===typeof google&&google.load("visualization","1",{packages:["corechart"],callback:function(){C(a)}})}function L(a){var b,c="undefined"!==typeof wpCookies&&wpCookies.getHash("ip-geo-block")||[];for(b in c)c.hasOwnProperty(b)&&(c[b]=c[b].replace(/[^ox\d]/g,"").split(""));"undefined"===typeof c[a]&&(c[a]=[]);return c}function D(b){var c,g=[];a.each(b,function(a,b){g[a]="";if("undefined"!==typeof b&&(c=b.length))for(g[a]=b[0]||"o",e=1;e<c;++e)g[a]+=b[e]||"o"});if("undefined"!==typeof wpCookies){var e="undefined"!==typeof IP_GEO_BLOCK_AUTH?IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin:"";wpCookies.setHash("ip-geo-block",g,new Date(Date.now()+2592E6),e)}}function M(c){var f=L(c);a("form").on("click","h2,h3",function(g){var e=a(this);g=e.closest("fieldset").data("section");var d=e.parent().nextAll(".panel-body").toggle();e.toggleClass(b("dropup")).toggleClass(b("dropdown"));(e=e.hasClass(b("dropdown")))?d.addClass(b("border")):d.removeClass(b("border"));f[c][g]=e?"o":"x";D(f);C(c);return!1});a(b("#","toggle-sections")).on("click",function(g){var e;g=a(b(".","field")).find("h2,h3");var d=[b("dropdown"),b("dropup")],k=g.filter("."+d[0]).length;g.each(function(h){e=a(this);e.removeClass(d.join(" ")).addClass(k?d[1]:d[0]);e=e.parent().nextAll(".panel-body").toggle(k?!1:!0);k?e.removeClass(b("border")):e.addClass(b("border"));f[c][h]=k?"x":"o"});D(f);C(c);return!1});return f}function I(c){a("body").append('<div style="display:none"><form method="POST" id="'+b("export-form")+'" action="'+IP_GEO_BLOCK.url.replace("ajax.php","post.php")+'"><input type="hidden" name="action" value="'+IP_GEO_BLOCK.action+'" /><input type="hidden" name="nonce" value="'+IP_GEO_BLOCK.nonce+'" /><input type="hidden" name="cmd" value="'+c+'" /><input type="hidden" name="data" value="" id="'+b("export-data")+'"/><input type="submit" value="submit" /></form><input type="file" name="settings" id="'+b("file-dialog")+'" /></div>')}function J(a,b,g,e){a=a.cloneNode(!1);a.setAttribute("title",g);b=b.cloneNode(!1);b.setAttribute("class","dashicons dashicons-"+e);a.appendChild(b);return a}a.fn.deserialize=function(b,f){return this.each(function(){var c,e=this,d={};for(c in b)if(b.hasOwnProperty(c))try{var k=decodeURIComponent(c);var h=decodeURIComponent(b[c]);d.hasOwnProperty(k)||(d[k]=[]);d[k].push(h)}catch(N){}a.each(d,function(b,d){c=a('[name="'+b+'"]:input',e).val(d);"hidden"!==c.attr("type")&&c.before('<span style="color:red">*</span>')})})};var n={dataPie:[],viewPie:[],drawPie:function(b){if("undefined"===typeof n.dataPie[b]){var c=n.dataPie[b]=new google.visualization.DataTable;c.addColumn("string","Country");c.addColumn("number","Requests");c=a.parseJSON(a("#"+b).attr("data-"+b));n.dataPie[b].addRows(c)}"undefined"===typeof n.viewPie[b]&&(n.viewPie[b]=new google.visualization.PieChart(r.getElementById(b)));a("#"+b).width()&&n.viewPie[b].draw(n.dataPie[b],{backgroundColor:{fill:"transparent"},chartArea:{left:0,top:"5%",width:"100%",height:"90%"},sliceVisibilityThreshold:.015})},dataLine:[],viewLine:[],drawLine:function(b,f){if("undefined"===typeof n.dataLine[b]){var c=n.dataLine[b]=new google.visualization.DataTable;c.addColumn(f,"Date");c.addColumn("number","comment");c.addColumn("number","xmlrpc");c.addColumn("number","login");c.addColumn("number","admin");c.addColumn("number","public");var e=a.parseJSON(a("#"+b).attr("data-"+b));var d=e.length;for(c=0;c<d;++c)e[c][0]=new Date(1E3*e[c][0]);n.dataLine[b].addRows(e)}"undefined"===typeof n.viewLine[b]&&(n.viewLine[b]=new google.visualization.LineChart(r.getElementById(b)));if(c=a("#"+b).width())c=320<c?!0:!1,n.viewLine[b].draw(n.dataLine[b],{backgroundColor:{fill:"transparent"},legend:{position:"bottom"},hAxis:{format:"MM/dd"+("datetime"===f?" HH:mm":"")},vAxis:{textPosition:c?"out":"in"},chartArea:{left:c?"10%":0,top:"5%",width:"100%",height:"75%"}})}};a(function(){var c=Number(IP_GEO_BLOCK.tab)||0,f=M(c);a(b(".","inhibit")).on("submit",function(){return!1});switch(c){case 0:var g=b("%","settings");a('[id^="'+b("scan-")+'"]').on("click",function(d){d=a(this);var c=d.attr("id"),h=d.parent();m(c.replace(/^.*(?:scan)/,"scanning"),{cmd:"scan-code",which:c.replace(b("scan-"),"")},function(a){h.children("ul").length||h.append('<ul id="'+b("code-list")+'"></ul>');h=h.children("ul").empty();for(d in a)if(a.hasOwnProperty(d)){var d=l(d);if("string"===typeof a[d])var c=l(a[d]);else c=l(a[d].code),d='<abbr title="'+l(a[d].type)+'">'+d+"</abbr>";h.append("<li>"+d+' : <span class="'+b("notice")+'">'+c+"</span></li>")}h.show("slow")});return!1});a(b("@","matching_rule")).on("change",function(){var d=this.value;a(b("@","white_list")).closest("tr").toggle("0"===d);a(b("@","black_list")).closest("tr").toggle("1"===d);return!1}).change();a(b("@","validation_mimetype")).on("change",function(d){var c=a(this),h=parseInt(c.val(),10);c.nextAll(b(".","settings-folding")).each(function(b,d){z(a(d),h===b+1||h&&2===b)});return t(d)}).change();a('select[name*="response_code"]').on("change",function(d){var c=a(this),h=parseInt(c.val()/100,10),e=c.closest("tr").nextAll("tr");if(0<=c.attr("name").indexOf("public")&&-1===parseInt(a(b("@","public_matching_rule")).val(),10))return e.each(function(b){1>=b&&a(this).hide()}),t(d);3>=h?e.each(function(b){0===b?a(this).show():1===b&&a(this).hide()}):e.each(function(b){0===b?a(this).hide():1===b&&a(this).show()});return t(d)}).change();a(b("#","decode")).on("click",function(d){d=a(b("@","signature"));var c=d.val();-1===c.search(/,/)?d.val(u(p.atob(c))):d.val(p.btoa(u(c)));return!1});a(b("@","validation_login")).on("change",function(b){var d=a(this);A(d,d,g,!0);return t(b)}).change();a(b("@","validation_admin_2")).on("change",function(a){IP_GEO_BLOCK_AUTH.zep.admin=!0});m(null,{cmd:"get-actions"},function(d){var c,h=a(b("#","actions")),e=r.createElement("li"),f=r.createElement("input"),g=r.createElement("label"),l=r.createElement("dfn"),n=r.createElement("span");for(c in d){var p=b("%",c);if(d.hasOwnProperty(c)&&!h.find("#"+p).size()){var m=f.cloneNode(!1);m.setAttribute("id",p);m.setAttribute("value","1");m.setAttribute("type","checkbox");var q=e.cloneNode(!1);q.appendChild(m);m=g.cloneNode(!1);m.setAttribute("for",p);m.appendChild(r.createTextNode(c));q.appendChild(m);1&d[c]&&q.appendChild(J(l,n,IP_GEO_BLOCK.msg[6],"lock"));2&d[c]&&q.appendChild(J(l,n,IP_GEO_BLOCK.msg[7],"unlock"));h.append(q)}}a(b("@","exception_admin")).on("change",function(c){var d=a.grep(a(this).val().split(","),function(a){return""!==a.replace(/^\s+|\s+$/g,"")});a(b("#","actions")).find("input").each(function(c,k){var h=a(this),e=h.attr("id").replace(b("%",""),"");h.prop("checked",-1!==a.inArray(e,d))});return t(c)}).change();a(b("#","actions")).on("click","input",function(c){var d=a(this).attr("id").replace(b("%",""),""),k=a(b("@","exception_admin")),h=a.grep(k.val().split(","),function(a){return""!==a.replace(/^\s+|\s+$/g,"")});c=a.inArray(d,h);-1===c?h.push(d):h.splice(c,1);k.val(h.join(",")).change()})});a('input[id^="'+b("!","validation_ajax_")+'"]').on("change",function(b){F(a(this))}).change();a(b("@","validation_public")).on("change",function(b){G(a(this));return t(b)}).change();a(b("@","public_matching_rule")).on("change",function(c){var d=this.value;a(b("@","public_white_list")).closest("tr").toggle("0"===d);a(b("@","public_black_list")).closest("tr").toggle("1"===d);a(b("@","public_response_code")).change().closest("tr").toggle("-1"!==d);return t(c)}).change();a(b("@","update")).on("click",function(c){m("download",{cmd:"download"},function(c){var d;for(d in c)if(c.hasOwnProperty(d)){var k=c[d];for(e in k)if(k.hasOwnProperty(e)){var e=l(e);k[e].filename&&a(b("@",d+"_"+e+"_path")).val(l(k[e].filename));k[e].message&&a(b("#",d+"-"+e)).text(l(k[e].message))}}});return!1});I("validate");a(b("#","export")).on("click",function(c){if("undefined"===typeof JSON)return v(null,IP_GEO_BLOCK.msg[8]),!1;var d=g,e={};a.each(a(this).closest("form").serializeArray(),function(a,b){-1!==b.name.indexOf(d)&&(e[b.name]=b.value)});e[d+="[signature]"]=p.btoa(u(e[d]));a(b("#","export-data")).val(JSON.stringify(e));a(b("#","export-form")).submit();return!1});a(b("#","file-dialog")).on("change",function(a){if("undefined"===typeof FileReader)return v(null,IP_GEO_BLOCK.msg[8]),!1;var b;(a=a.target.files[0])&&K(a,function(a){a=JSON.parse(a);b=g+"[signature]";"undefined"!==typeof a[b]&&(a[b]=p.btoa(u(a[b])));m("export-import",{cmd:"validate",data:JSON.stringify(a)},function(a){B(a,!0)})});return!1});a(b("#","import")).on("click",function(c){a(b("#","file-dialog")).click();return!1});a(b("#","default")).on("click",function(a){q(IP_GEO_BLOCK.msg[0],function(){m("pre-defined",{cmd:"import-default"},function(a){B(a,!0)})});return!1});a(b("#","preferred")).on("click",function(a){q(IP_GEO_BLOCK.msg[0],function(){m("pre-defined",{cmd:"import-preferred"},function(a){B(a,!1)})});return!1});a(b("@","create_table")).on("click",function(a){q(IP_GEO_BLOCK.msg[1],function(){E("create-table")});return!1});a(b("@","delete_table")).on("click",function(a){q(IP_GEO_BLOCK.msg[2],function(){E("delete-table")});return!1});a(b("#","show-info")).on("click",function(c){a(b("#","wp-info")).empty();m("wp-info",{cmd:"show-info"},function(c){var d,e=[];for(d in c)c.hasOwnProperty(d)&&e.push("- "+d+" "+c[d]);a(b("#","wp-info")).html('<textarea rows="'+e.length+'">'+e.join("\n")+"</textarea>").find("textarea").select();return!1})});a('select[name^="'+g+'"]').on("change",function(c){c=a(this);var d,e=b(".","desc");c.next(e).empty();(d=c.children("option:selected").data("desc"))&&c.next(e).html(a.parseHTML(d));A(c,c,g,!0);return!1}).change();a(b(".","cycle")).on("click",function(c){var d=a(this).nextAll("li");c=d.find(b("@","exception_admin"));d=d.find("input:checkbox").filter(":visible");var e=d.filter(":checked").length;d.prop("checked",!e);if(c.length)if(e)c.val("");else{var f=new RegExp(b("%",""));var g=[];d.each(function(b){g[b]=a(this).attr("id").replace(f,"")});c.val(g.join(","))}a(this).blur();return!1});a(b(".","unlock")).on("click",function(b){a(this).nextAll("li").find("h4").nextAll("li").filter(function(b,c){return!a(this).find(".dashicons-unlock").length}).toggle();return!1});a(b(".","settings-folding>dfn")).on("click",function(c){c=b("drop");var d=a(this).parent();d.children("li").toggle();d.toggleClass(c+"up").toggleClass(c+"down");d.hasClass(c+"down")?d.children("a").show():d.children("a").hide();return!1});a("#submit").on("click",function(c){c=a(b("@","signature"));var d=c.val();-1!==d.indexOf(",")&&c.val(p.btoa(u(d)));return!0});break;case 1:H(c);a(b("@","clear_statistics")).on("click",function(a){q(IP_GEO_BLOCK.msg[3],function(){w("statistics",null)});return!1});a(b("@","clear_logs")).on("click",function(a){q(IP_GEO_BLOCK.msg[5],function(){w("logs",null)});return!1});a(b("@","clear_cache")).on("click",function(a){q(IP_GEO_BLOCK.msg[4],function(){w("cache",null)});return!1});break;case 2:a(p).on(b("gmap-error"),function(){m(null,{cmd:"gmap-error"},function(a){y(a.page,a.tab)})});var e=a(b("#","map"));"object"===typeof google?e.each(function(){a(this).GmapRS()}):e.each(function(){a(this).empty().html('<iframe src="//maps.google.com/maps?output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')});a('select[id^="'+b("!","service")+'"]').on("change",function(b){f[c][3]=a(this).prop("selectedIndex");D(f)}).change();a(b("@","get_location")).on("click",function(c){var d=a(b("#","whois")),f=a(b("@","ip_address")).val();f&&(d.hide().empty(),c=a.whois(f,function(c){var e,f="";for(e=0;e<c.length;++e)f+="<tr><td>"+c[e].name+"</td><td>"+c[e].value+"</td></tr>";d.html('<fieldset id="'+b("section-1")+'" class="'+b("field")+' panel panel-default" data-section="1"><legend class="panel-heading"><h3 id="'+b("whois-title")+'" class="'+b("dropdown")+'">Whois</h3></legend><div class="panel-body '+b("border")+'"><table class="'+b("table")+'">'+f+"</table></div></fieldset>").fadeIn("slow");a(b("#","whois-title")).on("click",function(c){c=a(this);c.parent().nextAll().toggle();c.toggleClass(b("dropup")).toggleClass(b("dropdown"));return!1})}),m("loading",{cmd:"search",ip:f,which:a(b("@","service")).val()},function(a){var c="",d=l(a.latitude||"0"),g=l(a.longitude||"0"),k=a.latitude||a.longitude?8:2;for(h in a)if(a.hasOwnProperty(h)){var h=l(h);c+='<li><span class="'+b("title")+'">'+h+' : </span><span class="'+b("result")+'">'+l(a[h])+"</span></li>"}"object"===typeof google?e.GmapRS("addMarker",{latitude:d,longitude:g,title:f,content:"<ul>"+c+"</ul>",show:!0,zoom:k}):e.css({height:"600px",backgroundColor:"transparent"}).empty().html('<ul style="margin-top:0; margin-left:1em;"><li><span class="'+b("title")+'">IP address : </span><span class="'+b("result")+'">'+l(f)+"</span></li>"+c+'</ul><iframe src="//maps.google.com/maps?q='+d+","+g+"&z="+k+'&output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')},[c]));return!1});a(b("@","ip_address")).val()&&a(b("@","get_location")).click();break;case 4:m("logs",{cmd:"restore",which:null,time:new Date-ip_geo_block_time},function(d){for(var e in d)d.hasOwnProperty(e)&&(e=l(e),a(b("#","log-"+e)).html(d[e]));if("function"===typeof a.fn.footable){d=a(b(".","log"));var g=d.parent().prevAll("legend").find("h2,h3");g.removeClass(b("dropup")).addClass(b("dropdown"));d.fadeIn("slow").footable();g.each(function(b,d){"x"===(f[c][b+1]||"o")&&(f[c][b+1]="o",a(d).click())})}a('tbody[id^="'+b("log-")+'"]').on("click","a",function(b){e=p.location.pathname+p.location.search;p.open(e.replace(/tab=\d/,"tab=2")+"&ip="+a(this).text().replace(/[^\w\.\:\*]/,""),"_blank");return!1})});a(b("#","reset-filter")).on("click",function(b){a(".footable").trigger("footable_clear_filter");return!1});a(b(".","field")).on("footable_initialized",function(c){a(".footable").trigger("footable_filter",{filter:a(b("@","filter_logs")).val()});return!1});a(b("@","clear_logs")).on("click",function(a){q(IP_GEO_BLOCK.msg[5],function(){w("logs",null)});return!1});I("export-logs");a(b("#","export-logs")).on("click",function(c){a(b("#","export-form")).submit();return!1});break;case 5:H(c)}})})(jQuery,window,document);
admin/js/authenticate.js CHANGED
@@ -4,29 +4,62 @@
4
  * Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
5
  * This software is released under the MIT License.
6
  */
7
- // utility object
8
- var IP_GEO_BLOCK_ZEP = {
9
- init: false,
10
- auth: 'ip-geo-block-auth-nonce',
11
- nonce: IP_GEO_BLOCK_AUTH.nonce || '',
12
- sites: IP_GEO_BLOCK_AUTH.sites || [],
13
- redirect: function (url) {
14
- 'use strict';
15
- var i, n = this.sites.length;
16
- for (i = 0; i < n; ++i) {
17
- if (url && -1 !== url.indexOf(this.sites[i]) && this.nonce) {
18
- window.location = url;
19
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
  }
22
- return false;
23
- }
24
- };
25
 
26
- (function ($, document) {
27
- 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
- // produce safe text for HTML
30
  function escapeHTML(html) {
31
  var elem = document.createElement('div');
32
  elem.appendChild(document.createTextNode(html));
@@ -70,62 +103,93 @@ var IP_GEO_BLOCK_ZEP = {
70
  }
71
 
72
  /**
73
- * Returns canonicalized absolute pathname
74
  *
75
- * This code is based on http://phpjs.org/functions/realpath/
 
 
76
  */
77
- function realpath(uri) {
78
- var i, path, real = [];
79
-
80
- // extract pathname (avoid `undefined`)
81
- if (typeof uri !== 'object') {
82
- uri = parse_uri(uri);
83
- }
84
-
85
- // focusing only at pathname
86
- path = uri.path;
87
-
88
- // if it's not absolute, add root path
89
- if ('/' !== path.charAt(0)) {
90
- i = window.location.pathname;
91
- path = i.substring(0, i.lastIndexOf('/') + 1) + path;
92
- }
93
-
94
- // explode the given path into it's parts
95
- path = path.split('/');
96
-
97
- // if path ends with `/`, adds it to the last part
98
- if ('' === path[path.length - 1]) {
99
- path.pop();
100
- path[path.length - 1] += '/';
101
  }
102
 
103
- for (i in path) {
104
- if (path.hasOwnProperty(i)) {
105
- // this is'nt really interesting
106
- if ('.' === path[i]) {
107
- continue;
 
108
  }
109
-
110
- // this reduces the realpath
111
- if ('..' === path[i]) {
112
- if (real.length > 0) {
113
- real.pop();
 
 
 
 
 
 
 
114
  }
 
 
 
115
  }
116
-
117
- // this adds parts to the realpath
118
- else {
119
- if ((real.length < 1) || (path[i] !== '')) {
120
- real.push(path[i]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  }
122
  }
123
  }
124
- }
125
-
126
- // returns the absloute path as a string
127
- return real.join('/').replace(/\/\//g, '/');
128
- }
 
 
129
  /*
130
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
131
  function encodeURIComponentRFC3986(str) {
@@ -134,7 +198,7 @@ var IP_GEO_BLOCK_ZEP = {
134
  });
135
  }
136
  */
137
- // append the nonce as query strings to the uri
138
  function add_query_nonce(uri, nonce) {
139
  if (typeof uri !== 'object') { // `string` or `undefined`
140
  uri = parse_uri(uri || location.href);
@@ -145,99 +209,78 @@ var IP_GEO_BLOCK_ZEP = {
145
 
146
  // remove an old nonce
147
  while (i-- > 0) {
148
- if (data[i].indexOf(IP_GEO_BLOCK_ZEP.auth) === 0) {
149
  data.splice(i, 1);
150
  break;
151
  }
152
  }
153
 
154
- data.push(IP_GEO_BLOCK_ZEP.auth + '=' + encodeURIComponent(nonce));//RFC3986
155
  uri.query = data.join('&');
156
 
157
  return compose_uri(uri);
158
  }
159
 
160
- // regular expression to find target for is_admin()
161
- var regexp = new RegExp(
162
- '^(?:' + (IP_GEO_BLOCK_AUTH.home || '') + IP_GEO_BLOCK_AUTH.admin
163
- + '|' + (IP_GEO_BLOCK_AUTH.home || '') + IP_GEO_BLOCK_AUTH.plugins
164
- + '|' + (IP_GEO_BLOCK_AUTH.home || '') + IP_GEO_BLOCK_AUTH.themes
165
- + ')(?:.*\.php|.*\/)?$'
166
- );
167
 
168
- // check the URI where the nonce is needed
169
- function is_admin(uri) {
170
  // parse uri and get real path
171
- uri = uri || location.pathname;
172
  uri = parse_uri(uri.toLowerCase());
173
 
174
- // get absolute path with flattening `./`, `../`, `//`
175
- var path = realpath(uri);
176
-
177
  // possibly scheme is `javascript` and path is `void(0);`
178
- if (!uri.scheme || /^https?$/.test(uri.scheme)) {
 
 
 
179
  // external domain (`http://example` or `www.example`)
180
  // https://tools.ietf.org/html/rfc6454#section-4
181
- if (uri.authority && uri.authority !== location.host.toLowerCase()) {
182
  return -1; // external
183
  }
184
 
185
- // exclude the case which component is only fragment (`#...`)
186
- if ((uri.scheme || uri.path || uri.query) && regexp.test(path)) {
187
- return 1; // internal for admin
 
 
 
 
 
 
188
  }
189
  }
190
 
191
  return 0; // internal not admin
192
  }
193
 
194
- var nonce = IP_GEO_BLOCK_ZEP.nonce,
195
-
196
- // `theme-install.php` eats the query and set it to `request[browse]` as a parameter
197
- theme_featured = function (data) {
198
- var i = data.length;
199
- while (i-- > 0) {
200
- if (data[i].indexOf('request%5Bbrowse%5D=ip-geo-block-auth') !== -1) {
201
- data[i] = 'request%5Bbrowse%5D=featured'; // correct the parameter
202
- break;
203
- }
204
- }
205
- return data;
206
- },
207
 
208
- // `upload.php` eats the query and set it to `query[ip-geo-block-auth-nonce]` as a parameter
209
- media_library = function (data) {
210
- var i = data.length;
211
- while (i-- > 0) {
212
- if (data[i].indexOf('query%5Bip-geo-block-auth-nonce%5D=') !== -1) {
213
- delete data[i];
214
- break;
215
  }
216
  }
217
- return data;
218
- },
219
-
220
- // list of excluded links
221
- ajax_links = {
222
- 'upload.php': media_library,
223
- 'theme-install.php': theme_featured,
224
- 'network/theme-install.php': theme_featured
225
- };
226
-
227
- // check excluded path
228
- function check_ajax(path) {
229
- path = path.replace(IP_GEO_BLOCK_AUTH.home + IP_GEO_BLOCK_AUTH.admin, '');
230
- return ajax_links.hasOwnProperty(path) ? ajax_links[path] : null;
231
  }
232
 
233
- // embed a nonce before an Ajax request is sent
234
  $.ajaxPrefilter(function (settings, original, jqxhr) {
235
  // POST to async-upload.php causes an error in https://wordpress.org/plugins/mammoth-docx-converter/
236
  if (is_admin(settings.url) === 1 && !settings.url.match(/async-upload\.php$/)) {
237
  // multipart/form-data (XMLHttpRequest Level 2)
238
  // IE10+, Firefox 4+, Safari 5+, Android 3+
239
  if (typeof window.FormData !== 'undefined' && settings.data instanceof FormData) {
240
- settings.data.append(IP_GEO_BLOCK_ZEP.auth, nonce);
241
  }
242
 
243
  // application/x-www-form-urlencoded
@@ -246,17 +289,17 @@ var IP_GEO_BLOCK_ZEP = {
246
  // method url url+data data
247
  // GET query query data
248
  // POST query query data
249
- var uri = parse_uri(settings.url);
250
 
251
  if (typeof settings.data === 'undefined' || uri.query) {
252
- settings.url = add_query_nonce(uri, nonce);
253
  } else {
254
- var data = settings.data ? settings.data.split('&') : [],
255
- callback = check_ajax(location.pathname);
256
  if (callback) {
257
  data = callback(data);
258
  }
259
- data.push(IP_GEO_BLOCK_ZEP.auth + '=' + encodeURIComponent(nonce));//RFC3986
260
  settings.data = data.join('&');
261
  }
262
  }
@@ -312,10 +355,9 @@ var IP_GEO_BLOCK_ZEP = {
312
  };
313
  }
314
 
315
- function is_back_end() {
316
- return (is_admin(location.pathname) === 1 || location.search.indexOf(IP_GEO_BLOCK_ZEP.auth) >= 0);
317
- }
318
-
319
  function attach_event() {
320
  // https://www.sitepoint.com/jquery-body-on-document-on/
321
  var elem = $(document); // `html` or `body` doesn't work with some browsers
@@ -325,31 +367,25 @@ var IP_GEO_BLOCK_ZEP = {
325
  var $this = $(this),
326
  href = $this.attr('href'),
327
  rel = $this.attr('rel' ),
328
- admin = "undefined" !== typeof href ? is_admin(href) : 0;
329
 
330
  // if context menu then continue and should be checked in check_nonce()
331
- if ('contextmenu' === event.type) {
332
- return true;
333
  }
334
 
335
  // if admin area (except in comment with nofollow) then add a nonce
336
  else if (admin === 1) {
337
  $this.attr('href', add_query_nonce(
338
- href, (!rel || rel.indexOf('nofollow') < 0) ? nonce : 'nofollow'
339
  ));
340
- return true;
341
- }
342
-
343
- // if internal then check network admin url
344
- else if (admin === 0) {
345
- return ! IP_GEO_BLOCK_ZEP.redirect(add_query_nonce(href, nonce));
346
  }
347
 
348
  // if external then redirect with no referrer not to leak out the nonce
349
- else if (admin === -1 && is_back_end()) {
350
  if ('_self' === $this.attr('target')) {
351
- IP_GEO_BLOCK_ZEP.redirect(add_query_nonce(href, nonce));
352
- return false;
353
  }
354
 
355
  href = escapeHTML(decodeURIComponent(this.href));
@@ -372,10 +408,6 @@ var IP_GEO_BLOCK_ZEP = {
372
  // automatically call event.stopPropagation() and event.preventDefault()
373
  return false;
374
  }
375
-
376
- else {
377
- return true;
378
- }
379
  });
380
 
381
  elem.onFirst('submit', 'form', function (event) {
@@ -384,55 +416,58 @@ var IP_GEO_BLOCK_ZEP = {
384
 
385
  // if admin area then add the nonce
386
  if (is_admin(action) === 1) {
387
- $this.attr('action', add_query_nonce(action, nonce));
388
  }
389
  });
390
  }
391
 
392
- function attach_ready() {
393
- // avoid conflict with "Open external links in a new window"
394
- if (is_back_end()) {
395
- $('a').each(function () {
396
- if(!this.hasAttribute('onClick') && is_admin(this.getAttribute('href')) === -1) {
397
- this.setAttribute('onClick', 'javascript:void(0);return false;');
398
- }
399
- });
400
- }
 
 
 
 
 
 
401
 
402
- $('img').each(function (index) {
403
- var src = $(this).attr('src');
404
 
405
- // if admin area
406
- if (is_admin(src) === 1) {
407
- $(this).attr('src', add_query_nonce(src, nonce));
408
- }
409
- });
410
 
411
- // Restore post revisions (wp-admin/revisions.php @since 2.6.0)
412
- if ('undefined' !== typeof window._wpRevisionsSettings) {
413
- var i, data = window._wpRevisionsSettings.revisionData,
414
- n = data.length;
415
 
416
- for (i = 0; i < n; ++i) {
417
- if (-1 === data[i].restoreUrl.indexOf(IP_GEO_BLOCK_ZEP.auth)) {
418
- window._wpRevisionsSettings.revisionData[i].restoreUrl = add_query_nonce(data[i].restoreUrl, nonce);
 
419
  }
420
  }
421
  }
422
  }
423
 
424
- // fallback on error
425
- $(window).on('error', function () {
426
- if (!IP_GEO_BLOCK_ZEP.init) {
427
- attach_ready();
428
- }
429
  });
430
 
431
  $(function () {
432
- attach_ready();
433
- IP_GEO_BLOCK_ZEP.init = true; // finish to attach event
434
  });
435
 
436
- // attach event to add nonce
437
  attach_event();
438
- }(jQuery, document));
4
  * Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
5
  * This software is released under the MIT License.
6
  */
7
+ (function ($, window, document) {
8
+ 'use strict';
9
+
10
+ var wpzep = {
11
+ init: false,
12
+ auth: 'ip-geo-block-auth-nonce',
13
+ nonce: IP_GEO_BLOCK_AUTH.nonce || '',
14
+ sites: IP_GEO_BLOCK_AUTH.sites || []
15
+ },
16
+
17
+ // regular expression to find target for is_admin()
18
+ regexp = new RegExp(
19
+ '^(?:' + (IP_GEO_BLOCK_AUTH.home || '') + IP_GEO_BLOCK_AUTH.admin
20
+ + '|' + (IP_GEO_BLOCK_AUTH.home || '') + IP_GEO_BLOCK_AUTH.plugins
21
+ + '|' + (IP_GEO_BLOCK_AUTH.home || '') + IP_GEO_BLOCK_AUTH.themes
22
+ + ')(?:.*\.php|.*\/)?$'
23
+ ),
24
+
25
+ // `theme-install.php` eats the query and set it to `request[browse]` as a parameter
26
+ theme_featured = function (data) {
27
+ var i = data.length;
28
+ while (i-- > 0) {
29
+ if (data[i].indexOf('request%5Bbrowse%5D=ip-geo-block-auth') !== -1) {
30
+ data[i] = 'request%5Bbrowse%5D=featured'; // correct the parameter
31
+ break;
32
  }
33
  }
34
+ return data;
35
+ },
 
36
 
37
+ // `upload.php` eats the query and set it to `query[ip-geo-block-auth-nonce]` as a parameter
38
+ media_library = function (data) {
39
+ var i = data.length;
40
+ while (i-- > 0) {
41
+ if (data[i].indexOf('query%5Bip-geo-block-auth-nonce%5D=') !== -1) {
42
+ delete data[i];
43
+ break;
44
+ }
45
+ }
46
+ return data;
47
+ },
48
+
49
+ // list of excluded links
50
+ ajax_links = {
51
+ 'upload.php': media_library,
52
+ 'theme-install.php': theme_featured,
53
+ 'network/theme-install.php': theme_featured
54
+ };
55
+
56
+ // Check path that should be excluded
57
+ function check_ajax(path) {
58
+ path = path.replace(IP_GEO_BLOCK_AUTH.home + IP_GEO_BLOCK_AUTH.admin, '');
59
+ return ajax_links.hasOwnProperty(path) ? ajax_links[path] : null;
60
+ }
61
 
62
+ // Escape string for use in HTML.
63
  function escapeHTML(html) {
64
  var elem = document.createElement('div');
65
  elem.appendChild(document.createTextNode(html));
103
  }
104
 
105
  /**
106
+ * Convert relative url to absolute url using browser feature
107
  *
108
+ * @param string target url
109
+ * @param string base of absolute url (default window.locatoin.href)
110
+ * @return component of url
111
  */
112
+ var absolute_uri = (function () {
113
+ var doc = null;
114
+
115
+ try {
116
+ new URL('/', 'http://example.com/'); // test if URL object is abailable
117
+ } catch (e) {
118
+ try {
119
+ doc = (new DOMParser()).parseFromString('<html><head></head><body></body></html>', 'text/html'); // IE11
120
+ } catch (f) {
121
+ doc = document.implementation.createHTMLDocument(''); // IE10
122
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
 
125
+ return function (url, base) {
126
+ var d = document, baseElm, aElm, result;
127
+ url = typeof url !== 'undefined' ? url : location.href;
128
+ if (null === doc) {
129
+ if (typeof base === 'undefined') {
130
+ base = location.href; // based on current url
131
  }
132
+ try {
133
+ result = new URL(url, base); // base must be valid
134
+ } catch (e) {
135
+ result = new URL(url, location.href);
136
+ }
137
+ } else {
138
+ // use anchor element to resolve url
139
+ if (typeof base !== 'undefined') {
140
+ // assign base element to anchor to be independent of the current document
141
+ d = doc;
142
+ while (d.head.firstChild) {
143
+ d.head.removeChild(d.head.firstChild);
144
  }
145
+ baseElm = d.createElement('base');
146
+ baseElm.setAttribute('href', base);
147
+ d.head.appendChild(baseElm);
148
  }
149
+ aElm = d.createElement('a');
150
+ aElm.setAttribute('href', url);
151
+ aElm.setAttribute('href', aElm.href);
152
+ //d.appendChild(aElm);
153
+
154
+ result = {
155
+ protocol: aElm.protocol,
156
+ host: aElm.host,
157
+ hostname: aElm.hostname,
158
+ port: aElm.port,
159
+ pathname: aElm.pathname,
160
+ search: aElm.search,
161
+ hash: aElm.hash,
162
+ href: aElm.href,
163
+ username: '',
164
+ password: '',
165
+ origin : aElm.origin || null
166
+ };
167
+ if ('http:' === result.protocol && '80' === result.port) {
168
+ // remove port number `80` in case of `http` and defalut port
169
+ result.port = '';
170
+ result.host = result.host.replace(/:80$/, '');
171
+ } else if ('https:' === result.protocol && '443' === result.port) {
172
+ // remove port number `443` in case of `https` and defalut port
173
+ result.port = '';
174
+ result.host = result.host.replace(/:443$/, '');
175
+ }
176
+ if ('http:' === result.protocol || 'https:' === result.protocol) {
177
+ if (result.pathname && result.pathname.charAt(0) !== '/') {
178
+ // in case no `/` at the top
179
+ result.pathname = '/' + result.pathname;
180
+ }
181
+ if (!result.origin) {
182
+ result.origin = result.protocol + '//' + result.hostname + (result.port ? ':' + result.port : '');
183
  }
184
  }
185
  }
186
+ if (result.username || result.password) {
187
+ // throw an error if basic basic authentication is targeted
188
+ throw new URIError(result.username + ':' + result.password);
189
+ }
190
+ return result;
191
+ };
192
+ }());
193
  /*
194
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
195
  function encodeURIComponentRFC3986(str) {
198
  });
199
  }
200
  */
201
+ // Append the nonce as query strings to the uri
202
  function add_query_nonce(uri, nonce) {
203
  if (typeof uri !== 'object') { // `string` or `undefined`
204
  uri = parse_uri(uri || location.href);
209
 
210
  // remove an old nonce
211
  while (i-- > 0) {
212
+ if (data[i].indexOf(wpzep.auth) === 0) {
213
  data.splice(i, 1);
214
  break;
215
  }
216
  }
217
 
218
+ data.push(wpzep.auth + '=' + encodeURIComponent(nonce));//RFC3986
219
  uri.query = data.join('&');
220
 
221
  return compose_uri(uri);
222
  }
223
 
224
+ // Check uri component if it is not empty or only fragment (`#...`)
225
+ function check_uri(uri) {
226
+ return (!uri.scheme || /^https?$/.test(uri.scheme)) && (uri.path || uri.query);
227
+ }
 
 
 
228
 
229
+ // Check uri where the nonce is needed
230
+ function is_admin(url) {
231
  // parse uri and get real path
232
+ var uri = url || location.pathname; // in case of empty `action` on the form tag
233
  uri = parse_uri(uri.toLowerCase());
234
 
 
 
 
235
  // possibly scheme is `javascript` and path is `void(0);`
236
+ if (check_uri(uri)) {
237
+ // get absolute path with flattening `./`, `../`, `//`
238
+ uri = absolute_uri(url);
239
+
240
  // external domain (`http://example` or `www.example`)
241
  // https://tools.ietf.org/html/rfc6454#section-4
242
+ if (uri.origin !== location.origin) {
243
  return -1; // external
244
  }
245
 
246
+ // check if uri includes the target path of zep
247
+ uri = regexp.exec(uri.pathname);
248
+ if (uri) {
249
+ if ((IP_GEO_BLOCK_AUTH.zep.ajax && 0 <= uri[0].indexOf(IP_GEO_BLOCK_AUTH.admin + 'admin-')) ||
250
+ (IP_GEO_BLOCK_AUTH.zep.admin && 0 <= uri[0].indexOf(IP_GEO_BLOCK_AUTH.admin )) ||
251
+ (IP_GEO_BLOCK_AUTH.zep.plugins && 0 <= uri[0].indexOf(IP_GEO_BLOCK_AUTH.plugins )) ||
252
+ (IP_GEO_BLOCK_AUTH.zep.themes && 0 <= uri[0].indexOf(IP_GEO_BLOCK_AUTH.themes ))) {
253
+ return 1; // internal for admin
254
+ }
255
  }
256
  }
257
 
258
  return 0; // internal not admin
259
  }
260
 
261
+ // Check if current page is admin area and the target of wp-zep
262
+ function is_backend_nonce() {
263
+ return (is_admin(location.pathname) === 1 || location.search.indexOf(wpzep.auth) >= 0);
264
+ }
 
 
 
 
 
 
 
 
 
265
 
266
+ // Redirect if current page is admin area and the target of wp-zep
267
+ function redirect(url) {
268
+ var i, n = wpzep.sites.length;
269
+ for (i = 0; i < n; ++i) {
270
+ if (url && 0 <= url.indexOf(wpzep.sites[i]) && wpzep.nonce) {
271
+ window.location = add_query_nonce(url, wpzep.nonce);
 
272
  }
273
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  }
275
 
276
+ // Embed a nonce before an Ajax request is sent
277
  $.ajaxPrefilter(function (settings, original, jqxhr) {
278
  // POST to async-upload.php causes an error in https://wordpress.org/plugins/mammoth-docx-converter/
279
  if (is_admin(settings.url) === 1 && !settings.url.match(/async-upload\.php$/)) {
280
  // multipart/form-data (XMLHttpRequest Level 2)
281
  // IE10+, Firefox 4+, Safari 5+, Android 3+
282
  if (typeof window.FormData !== 'undefined' && settings.data instanceof FormData) {
283
+ settings.data.append(wpzep.auth, wpzep.nonce);
284
  }
285
 
286
  // application/x-www-form-urlencoded
289
  // method url url+data data
290
  // GET query query data
291
  // POST query query data
292
+ var data, callback, uri = parse_uri(settings.url);
293
 
294
  if (typeof settings.data === 'undefined' || uri.query) {
295
+ settings.url = add_query_nonce(uri, wpzep.nonce);
296
  } else {
297
+ data = settings.data ? settings.data.split('&') : [];
298
+ callback = check_ajax(location.pathname);
299
  if (callback) {
300
  data = callback(data);
301
  }
302
+ data.push(wpzep.auth + '=' + encodeURIComponent(wpzep.nonce));//RFC3986
303
  settings.data = data.join('&');
304
  }
305
  }
355
  };
356
  }
357
 
358
+ /*--------------------------------
359
+ * Attach event to the document
360
+ *--------------------------------*/
 
361
  function attach_event() {
362
  // https://www.sitepoint.com/jquery-body-on-document-on/
363
  var elem = $(document); // `html` or `body` doesn't work with some browsers
367
  var $this = $(this),
368
  href = $this.attr('href'),
369
  rel = $this.attr('rel' ),
370
+ admin = check_uri(parse_uri(href)) ? is_admin(href) : 0; // 0: do nothing if href is empty
371
 
372
  // if context menu then continue and should be checked in check_nonce()
373
+ if ('click' !== event.type) {
374
+ return;
375
  }
376
 
377
  // if admin area (except in comment with nofollow) then add a nonce
378
  else if (admin === 1) {
379
  $this.attr('href', add_query_nonce(
380
+ href, (!rel || rel.indexOf('nofollow') < 0) ? wpzep.nonce : 'nofollow'
381
  ));
 
 
 
 
 
 
382
  }
383
 
384
  // if external then redirect with no referrer not to leak out the nonce
385
+ else if (admin === -1 && is_backend_nonce()) {
386
  if ('_self' === $this.attr('target')) {
387
+ redirect(href);
388
+ return; // just in case redirection fails
389
  }
390
 
391
  href = escapeHTML(decodeURIComponent(this.href));
408
  // automatically call event.stopPropagation() and event.preventDefault()
409
  return false;
410
  }
 
 
 
 
411
  });
412
 
413
  elem.onFirst('submit', 'form', function (event) {
416
 
417
  // if admin area then add the nonce
418
  if (is_admin(action) === 1) {
419
+ $this.attr('action', add_query_nonce(action, wpzep.nonce));
420
  }
421
  });
422
  }
423
 
424
+ /*--------------------------------
425
+ * Something after document ready
426
+ *--------------------------------*/
427
+ function attach_ready(stat) {
428
+ if (!wpzep.init) {
429
+ wpzep.init = true;
430
+
431
+ // avoid conflict with "Open external links in a new window"
432
+ if (is_backend_nonce()) {
433
+ $('a').each(function () {
434
+ if (!this.hasAttribute('onClick') && is_admin(this.getAttribute('href')) === -1) {
435
+ this.setAttribute('onClick', 'javascript:return false');
436
+ }
437
+ });
438
+ }
439
 
440
+ $('img').each(function (index) {
441
+ var src = $(this).attr('src');
442
 
443
+ // if admin area
444
+ if (is_admin(src) === 1) {
445
+ $(this).attr('src', add_query_nonce(src, wpzep.nonce));
446
+ }
447
+ });
448
 
449
+ // Restore post revisions (wp-admin/revisions.php @since 2.6.0)
450
+ if ('undefined' !== typeof window._wpRevisionsSettings) {
451
+ var i, data = window._wpRevisionsSettings.revisionData,
452
+ n = data.length;
453
 
454
+ for (i = 0; i < n; ++i) {
455
+ if (-1 === data[i].restoreUrl.indexOf(wpzep.auth)) {
456
+ window._wpRevisionsSettings.revisionData[i].restoreUrl = add_query_nonce(data[i].restoreUrl, wpzep.nonce);
457
+ }
458
  }
459
  }
460
  }
461
  }
462
 
463
+ $(window).on('error', function (event) { // event.originalEvent.message
464
+ attach_ready(false); // fallback on error
 
 
 
465
  });
466
 
467
  $(function () {
468
+ attach_ready(true);
 
469
  });
470
 
471
+ // Attach event to add nonce
472
  attach_event();
473
+ }(jQuery, window, document));
admin/js/authenticate.min.js CHANGED
@@ -3,4 +3,4 @@
3
  Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
4
  This software is released under the MIT License.
5
  */
6
- var IP_GEO_BLOCK_ZEP={init:!1,auth:"ip-geo-block-auth-nonce",nonce:IP_GEO_BLOCK_AUTH.nonce||"",sites:IP_GEO_BLOCK_AUTH.sites||[],redirect:function(e){var g,n=this.sites.length;for(g=0;g<n;++g)if(e&&-1!==e.indexOf(this.sites[g])&&this.nonce)return window.location=e,!0;return!1}};(function(e,g){function n(a){var b=g.createElement("div");b.appendChild(g.createTextNode(a));a=b.innerHTML.replace(/["']/g,function(a){return{'"':"&quot;","'":"&#39;"}[a]});b="";return a}function m(a){a=a?a.toString():"";a=a.match(/^(?:([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return{scheme:a[1]||"",relative:a[2]||"",authority:a[3]||"",path:a[4]||"",query:a[5]||"",fragment:a[6]||""}}function h(a,b){"object"!==typeof a&&(a=m(a||location.href));for(var d=a.query?a.query.split("&"):[],c=d.length;0<c--;)if(0===d[c].indexOf(IP_GEO_BLOCK_ZEP.auth)){d.splice(c,1);break}d.push(IP_GEO_BLOCK_ZEP.auth+"="+encodeURIComponent(b));a.query=d.join("&");return(a.scheme?a.scheme+":":"")+(a.relative+a.path)+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")}function k(a){a=a||location.pathname;a=m(a.toLowerCase());var b=a,d=[];"object"!==typeof b&&(b=m(b));b=b.path;if("/"!==b.charAt(0)){var c=window.location.pathname;b=c.substring(0,c.lastIndexOf("/")+1)+b}b=b.split("/");""===b[b.length-1]&&(b.pop(),b[b.length-1]+="/");for(c in b)b.hasOwnProperty(c)&&"."!==b[c]&&(".."===b[c]?0<d.length&&d.pop():(1>d.length||""!==b[c])&&d.push(b[c]));c=d.join("/").replace(/\/\//g,"/");if(!a.scheme||/^https?$/.test(a.scheme)){if(a.authority&&a.authority!==location.host.toLowerCase())return-1;if((a.scheme||a.path||a.query)&&v.test(c))return 1}return 0}function p(a,b,d){var c=b.split(/\s+/);a.each(function(a){for(a=0;a<c.length;++a){var b=e.trim(c[a]).match(/[^\.]+/i)[0],f=e(this),g=b,b=d,f=e._data(f[0]).events[g],g=b?f.splice(f.delegateCount-1,1)[0]:f.pop();f.splice(b?0:f.delegateCount||0,0,g)}})}function q(){return 1===k(location.pathname)||0<=location.search.indexOf(IP_GEO_BLOCK_ZEP.auth)}function r(){q()&&e("a").each(function(){this.hasAttribute("onClick")||-1!==k(this.getAttribute("href"))||this.setAttribute("onClick","javascript:void(0);return false;")});e("img").each(function(a){a=e(this).attr("src");1===k(a)&&e(this).attr("src",h(a,f))});if("undefined"!==typeof window._wpRevisionsSettings){var a,b=window._wpRevisionsSettings.revisionData,d=b.length;for(a=0;a<d;++a)-1===b[a].restoreUrl.indexOf(IP_GEO_BLOCK_ZEP.auth)&&(window._wpRevisionsSettings.revisionData[a].restoreUrl=h(b[a].restoreUrl,f))}}var v=new RegExp("^(?:"+(IP_GEO_BLOCK_AUTH.home||"")+IP_GEO_BLOCK_AUTH.admin+"|"+(IP_GEO_BLOCK_AUTH.home||"")+IP_GEO_BLOCK_AUTH.plugins+"|"+(IP_GEO_BLOCK_AUTH.home||"")+IP_GEO_BLOCK_AUTH.themes+")(?:.*.php|.*/)?$"),f=IP_GEO_BLOCK_ZEP.nonce,t=function(a){for(var b=a.length;0<b--;)if(-1!==a[b].indexOf("request%5Bbrowse%5D=ip-geo-block-auth")){a[b]="request%5Bbrowse%5D=featured";break}return a},u={"upload.php":function(a){for(var b=a.length;0<b--;)if(-1!==a[b].indexOf("query%5Bip-geo-block-auth-nonce%5D=")){delete a[b];break}return a},"theme-install.php":t,"network/theme-install.php":t};e.ajaxPrefilter(function(a,b,d){1!==k(a.url)||a.url.match(/async-upload\.php$/)||("undefined"!==typeof window.FormData&&a.data instanceof FormData?a.data.append(IP_GEO_BLOCK_ZEP.auth,f):(b=m(a.url),"undefined"===typeof a.data||b.query?a.url=h(b,f):(b=a.data?a.data.split("&"):[],d=location.pathname,d=d.replace(IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin,""),(d=u.hasOwnProperty(d)?u[d]:null)&&(b=d(b)),b.push(IP_GEO_BLOCK_ZEP.auth+"="+encodeURIComponent(f)),a.data=b.join("&"))))});"undefined"===typeof e.fn.onFirst&&(e.fn.onFirst=function(a,b){var d,c=e(this),f="string"===typeof b;e.fn.on.apply(c,arguments);if("object"===typeof a)for(d in a)a.hasOwnProperty(d)&&p(c,d,f);else"string"===typeof a&&p(c,a,f);return c});e(window).on("error",function(){IP_GEO_BLOCK_ZEP.init||r()});e(function(){r();IP_GEO_BLOCK_ZEP.init=!0});(function(){var a=e(g);a.onFirst("click contextmenu","a",function(a){var b=e(this),c=b.attr("href"),g=b.attr("rel"),l="undefined"!==typeof c?k(c):0;if("contextmenu"===a.type)return!0;if(1===l)return b.attr("href",h(c,!g||0>g.indexOf("nofollow")?f:"nofollow")),!0;if(0===l)return!IP_GEO_BLOCK_ZEP.redirect(h(c,f));if(-1===l&&q()){if("_self"===b.attr("target"))return IP_GEO_BLOCK_ZEP.redirect(h(c,f)),!1;c=n(decodeURIComponent(this.href));c=c.split(";",2).shift();l=window.open();l.document.write('<!DOCTYPE html><html><head><meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+c+'" />'+(e("body").hasClass("webview")?'<script>window.location.replace("'+c+'")\x3c/script>':"")+"</head></html>");l.document.close();a.stopImmediatePropagation();return!1}return!0});a.onFirst("submit","form",function(a){a=e(this);var b=a.attr("action");1===k(b)&&a.attr("action",h(b,f))})})()})(jQuery,document);
3
  Copyright (c) 2015-2017 tokkonopapa (tokkonopapa@yahoo.com)
4
  This software is released under the MIT License.
5
  */
6
+ (function(g,h,n){function x(a){var b=n.createElement("div");b.appendChild(n.createTextNode(a));a=b.innerHTML.replace(/["']/g,function(a){return{'"':"&quot;","'":"&#39;"}[a]});b="";return a}function p(a){a=a?a.toString():"";a=a.match(/^(?:([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return{scheme:a[1]||"",relative:a[2]||"",authority:a[3]||"",path:a[4]||"",query:a[5]||"",fragment:a[6]||""}}function k(a,b){"object"!==typeof a&&(a=p(a||location.href));for(var e=a.query?a.query.split("&"):[],d=e.length;0<d--;)if(0===e[d].indexOf(f.auth)){e.splice(d,1);break}e.push(f.auth+"="+encodeURIComponent(b));a.query=e.join("&");return(a.scheme?a.scheme+":":"")+(a.relative+a.path)+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")}function q(a){return(!a.scheme||/^https?$/.test(a.scheme))&&(a.path||a.query)}function l(a){var b=a||location.pathname;b=p(b.toLowerCase());if(q(b)){b=y(a);if(b.origin!==location.origin)return-1;if((b=z.exec(b.pathname))&&(IP_GEO_BLOCK_AUTH.zep.ajax&&0<=b[0].indexOf(IP_GEO_BLOCK_AUTH.admin+"admin-")||IP_GEO_BLOCK_AUTH.zep.admin&&0<=b[0].indexOf(IP_GEO_BLOCK_AUTH.admin)||IP_GEO_BLOCK_AUTH.zep.plugins&&0<=b[0].indexOf(IP_GEO_BLOCK_AUTH.plugins)||IP_GEO_BLOCK_AUTH.zep.themes&&0<=b[0].indexOf(IP_GEO_BLOCK_AUTH.themes)))return 1}return 0}function r(){return 1===l(location.pathname)||0<=location.search.indexOf(f.auth)}function t(a,b,e){var d=b.split(/\s+/);a.each(function(a){for(a=0;a<d.length;++a){var b=g.trim(d[a]).match(/[^\.]+/i)[0],c=g(this),f=b;b=e;c=g._data(c[0]).events[f];f=b?c.splice(c.delegateCount-1,1)[0]:c.pop();c.splice(b?0:c.delegateCount||0,0,f)}})}function u(a){if(!f.init&&(f.init=!0,r()&&g("a").each(function(){this.hasAttribute("onClick")||-1!==l(this.getAttribute("href"))||this.setAttribute("onClick","javascript:return false")}),g("img").each(function(a){a=g(this).attr("src");1===l(a)&&g(this).attr("src",k(a,f.nonce))}),"undefined"!==typeof h._wpRevisionsSettings)){var b=h._wpRevisionsSettings.revisionData,e=b.length;for(a=0;a<e;++a)-1===b[a].restoreUrl.indexOf(f.auth)&&(h._wpRevisionsSettings.revisionData[a].restoreUrl=k(b[a].restoreUrl,f.nonce))}}var f={init:!1,auth:"ip-geo-block-auth-nonce",nonce:IP_GEO_BLOCK_AUTH.nonce||"",sites:IP_GEO_BLOCK_AUTH.sites||[]},z=new RegExp("^(?:"+(IP_GEO_BLOCK_AUTH.home||"")+IP_GEO_BLOCK_AUTH.admin+"|"+(IP_GEO_BLOCK_AUTH.home||"")+IP_GEO_BLOCK_AUTH.plugins+"|"+(IP_GEO_BLOCK_AUTH.home||"")+IP_GEO_BLOCK_AUTH.themes+")(?:.*.php|.*/)?$"),v=function(a){for(var b=a.length;0<b--;)if(-1!==a[b].indexOf("request%5Bbrowse%5D=ip-geo-block-auth")){a[b]="request%5Bbrowse%5D=featured";break}return a},w={"upload.php":function(a){for(var b=a.length;0<b--;)if(-1!==a[b].indexOf("query%5Bip-geo-block-auth-nonce%5D=")){delete a[b];break}return a},"theme-install.php":v,"network/theme-install.php":v},y=function(){var a=null;try{new URL("/","http://example.com/")}catch(b){try{a=(new DOMParser).parseFromString("<html><head></head><body></body></html>","text/html")}catch(e){a=n.implementation.createHTMLDocument("")}}return function(b,e){var d=n;b="undefined"!==typeof b?b:location.href;if(null===a){"undefined"===typeof e&&(e=location.href);try{var c=new URL(b,e)}catch(m){c=new URL(b,location.href)}}else{if("undefined"!==typeof e){for(d=a;d.head.firstChild;)d.head.removeChild(d.head.firstChild);c=d.createElement("base");c.setAttribute("href",e);d.head.appendChild(c)}d=d.createElement("a");d.setAttribute("href",b);d.setAttribute("href",d.href);c={protocol:d.protocol,host:d.host,hostname:d.hostname,port:d.port,pathname:d.pathname,search:d.search,hash:d.hash,href:d.href,username:"",password:"",origin:d.origin||null};"http:"===c.protocol&&"80"===c.port?(c.port="",c.host=c.host.replace(/:80$/,"")):"https:"===c.protocol&&"443"===c.port&&(c.port="",c.host=c.host.replace(/:443$/,""));if("http:"===c.protocol||"https:"===c.protocol)c.pathname&&"/"!==c.pathname.charAt(0)&&(c.pathname="/"+c.pathname),c.origin||(c.origin=c.protocol+"//"+c.hostname+(c.port?":"+c.port:""))}if(c.username||c.password)throw new URIError(c.username+":"+c.password);return c}}();g.ajaxPrefilter(function(a,b,e){1!==l(a.url)||a.url.match(/async-upload\.php$/)||("undefined"!==typeof h.FormData&&a.data instanceof FormData?a.data.append(f.auth,f.nonce):(b=p(a.url),"undefined"===typeof a.data||b.query?a.url=k(b,f.nonce):(b=a.data?a.data.split("&"):[],e=location.pathname,e=e.replace(IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin,""),(e=w.hasOwnProperty(e)?w[e]:null)&&(b=e(b)),b.push(f.auth+"="+encodeURIComponent(f.nonce)),a.data=b.join("&"))))});"undefined"===typeof g.fn.onFirst&&(g.fn.onFirst=function(a,b){var e,d=g(this),c="string"===typeof b;g.fn.on.apply(d,arguments);if("object"===typeof a)for(e in a)a.hasOwnProperty(e)&&t(d,e,c);else"string"===typeof a&&t(d,a,c);return d});g(h).on("error",function(a){u(!1)});g(function(){u(!0)});(function(){var a=g(n);a.onFirst("click contextmenu","a",function(a){var b=g(this),d=b.attr("href"),c=b.attr("rel"),m=q(p(d))?l(d):0;if("click"===a.type)if(1===m)b.attr("href",k(d,!c||0>c.indexOf("nofollow")?f.nonce:"nofollow"));else if(-1===m&&r())if("_self"===b.attr("target"))for(a=d,d=f.sites.length,b=0;b<d;++b)a&&0<=a.indexOf(f.sites[b])&&f.nonce&&(h.location=k(a,f.nonce));else return d=x(decodeURIComponent(this.href)),d=d.split(";",2).shift(),m=h.open(),m.document.write('<!DOCTYPE html><html><head><meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+d+'" />'+(g("body").hasClass("webview")?'<script>window.location.replace("'+d+'")\x3c/script>':"")+"</head></html>"),m.document.close(),a.stopImmediatePropagation(),!1});a.onFirst("submit","form",function(a){a=g(this);var b=a.attr("action");1===l(b)&&a.attr("action",k(b,f.nonce))})})()})(jQuery,window,document);
admin/js/whois.js CHANGED
@@ -78,7 +78,11 @@
78
  }*/
79
 
80
  if (value.link) {
81
- value.value = '<a href="' + escapeHTML(value.link.href) + '.json" target=_blank>' + escapeHTML(value.value) + '</a>';
 
 
 
 
82
  }
83
 
84
  else if ('remarks' === value.name) {
78
  }*/
79
 
80
  if (value.link) {
81
+ if ((value['referenced-type'] || false) && 'aut-num' === value['referenced-type']) {
82
+ value.value += ' [ <a href="http://ipinfo.io/' + escapeHTML(value.value) + '" target=_blank>Search on ipinfo.io</a> ]';
83
+ } else {
84
+ value.value = '<a href="' + escapeHTML(value.link.href) + '.json" target=_blank>' + escapeHTML(value.value) + '</a>';
85
+ }
86
  }
87
 
88
  else if ('remarks' === value.name) {
admin/js/whois.min.js CHANGED
@@ -5,4 +5,4 @@
5
  Copyright (c) 2016 tokkonopapa (tokkonopapa@yahoo.com)
6
  This software is released under the MIT License.
7
  */
8
- (function(g){g.extend({whois:function(l,e){function b(b){return b?b.toString().replace(/[&<>"']/g,function(b){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[b]}):""}var f=[];return g.ajax({url:'https://query.yahooapis.com/v1/public/yql?q=select * from xml where url="%URL%"&format=json&jsonCompat=new'.replace(/%URL%/,"https://rest.db.ripe.net/search%3fflags=no-filtering%26flags=resource%26query-string="+l),method:"GET",dataType:"json"}).done(function(c,d,e){function k(c,a){if(a&&"object"===typeof a)if(a.errormessage){var d=a.errormessage,e=d.text.split(/\n+/);f.push({name:b(d.severity),value:b(e[1].replace(/%s/,d.args.value))})}else a.href?(a.href=b(a.href),f.push({name:b(c),value:'<a href="'+a.href+'.json" target=_blank>'+a.href+"</a>"})):a.name&&a.value?(a.link?a.value='<a href="'+b(a.link.href)+'.json" target=_blank>'+b(a.value)+"</a>":"remarks"===a.name&&(a.value=b(a.value),a.value=a.value.replace(/(https?:\/\/[^\s]+)/gi,'<a href="$1" target=_blank>$1</a>')),f.push({name:b(a.name),value:a.value})):"primary-key"!==c&&g.each(a,function(a,b){k(a,b)})}var h;c=c.query.results;d=[];for(h in c)if(c.hasOwnProperty(h)){d=c[h];break}k(null,d)}).fail(function(c,d,e){f.push({name:b(d),value:b(e)})}).always(function(){f.push({name:"copyright",value:'<a href="https://apps.db.ripe.net/search/query.html" title="Database Query - RIPE Network Coordination Centre">RIPE NCC</a>'});e&&e(f)})}})})(jQuery);
5
  Copyright (c) 2016 tokkonopapa (tokkonopapa@yahoo.com)
6
  This software is released under the MIT License.
7
  */
8
+ (function(g){g.extend({whois:function(l,e){function b(b){return b?b.toString().replace(/[&<>"']/g,function(b){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[b]}):""}var f=[];return g.ajax({url:'https://query.yahooapis.com/v1/public/yql?q=select * from xml where url="%URL%"&format=json&jsonCompat=new'.replace(/%URL%/,"https://rest.db.ripe.net/search%3fflags=no-filtering%26flags=resource%26query-string="+l),method:"GET",dataType:"json"}).done(function(c,d,e){function k(c,a){if(a&&"object"===typeof a)if(a.errormessage){var d=a.errormessage,e=d.text.split(/\n+/);f.push({name:b(d.severity),value:b(e[1].replace(/%s/,d.args.value))})}else a.href?(a.href=b(a.href),f.push({name:b(c),value:'<a href="'+a.href+'.json" target=_blank>'+a.href+"</a>"})):a.name&&a.value?(a.link?a.value=a["referenced-type"]&&"aut-num"===a["referenced-type"]?a.value+(' [ <a href="http://ipinfo.io/'+b(a.value)+'" target=_blank>Search on ipinfo.io</a> ]'):'<a href="'+b(a.link.href)+'.json" target=_blank>'+b(a.value)+"</a>":"remarks"===a.name&&(a.value=b(a.value),a.value=a.value.replace(/(https?:\/\/[^\s]+)/gi,'<a href="$1" target=_blank>$1</a>')),f.push({name:b(a.name),value:a.value})):"primary-key"!==c&&g.each(a,function(a,b){k(a,b)})}var h;c=c.query.results;d=[];for(h in c)if(c.hasOwnProperty(h)){d=c[h];break}k(null,d)}).fail(function(c,d,e){f.push({name:b(d),value:b(e)})}).always(function(){f.push({name:"copyright",value:'<a href="https://apps.db.ripe.net/search/query.html" title="Database Query - RIPE Network Coordination Centre">RIPE NCC</a>'});e&&e(f)})}})})(jQuery);
classes/class-ip-geo-block-apis.php CHANGED
@@ -458,8 +458,8 @@ class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
458
  $cache = self::get_cache( $ip = $validate['ip'] );
459
 
460
  if ( $cache ) {
461
- $fail = $cache['fail'] + ( empty( $validate['fail'] ) ? 0 : 1 );
462
- $call = $cache['call'] + ( empty( $validate['fail'] ) ? 1 : 0 );
463
  } else { // if new cache then reset these values
464
  $fail = 0;
465
  $call = 1;
@@ -469,10 +469,11 @@ class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
469
  IP_Geo_Block_Logs::update_cache( $cache = array(
470
  'time' => $_SERVER['REQUEST_TIME'],
471
  'ip' => $ip,
 
472
  'hook' => $hook,
473
  'code' => $validate['code'],
474
  'auth' => $validate['auth'], // get_current_user_id() > 0
475
- 'fail' => $fail, // $validate['auth'] ? 0 : $fail,
476
  'call' => $settings['save_statistics'] ? $call : 0,
477
  'host' => isset( $validate['host'] ) ? $validate['host'] : NULL,
478
  ) );
@@ -504,7 +505,7 @@ class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
504
  }
505
 
506
  public function get_country( $ip, $args = array() ) {
507
- return ( $cache = self::get_cache( $ip ) ) ? $cache['code'] : NULL;
508
  }
509
  }
510
 
@@ -605,8 +606,9 @@ class IP_Geo_Block_Provider {
605
  if ( $rand )
606
  shuffle( $tmp );
607
 
608
- foreach ( $tmp as $name )
609
  $list[ $name ] = self::$providers[ $name ][ $key ];
 
610
 
611
  return $list;
612
  }
458
  $cache = self::get_cache( $ip = $validate['ip'] );
459
 
460
  if ( $cache ) {
461
+ $fail = $cache['fail'] + ( 'failed' === $validate['result'] ? 1 : 0 );
462
+ $call = $cache['call'] + ( 'failed' !== $validate['result'] ? 1 : 0 );
463
  } else { // if new cache then reset these values
464
  $fail = 0;
465
  $call = 1;
469
  IP_Geo_Block_Logs::update_cache( $cache = array(
470
  'time' => $_SERVER['REQUEST_TIME'],
471
  'ip' => $ip,
472
+ 'asn' => $validate['asn' ], // @since 3.0.4
473
  'hook' => $hook,
474
  'code' => $validate['code'],
475
  'auth' => $validate['auth'], // get_current_user_id() > 0
476
+ 'fail' => $validate['auth'] ? 0 : $fail,
477
  'call' => $settings['save_statistics'] ? $call : 0,
478
  'host' => isset( $validate['host'] ) ? $validate['host'] : NULL,
479
  ) );
505
  }
506
 
507
  public function get_country( $ip, $args = array() ) {
508
+ return ( $cache = self::get_cache( $ip ) ) ? ( isset( $args['cache'] ) ? $cache : $cache['code'] ) : NULL;
509
  }
510
  }
511
 
606
  if ( $rand )
607
  shuffle( $tmp );
608
 
609
+ foreach ( $tmp as $name ) {
610
  $list[ $name ] = self::$providers[ $name ][ $key ];
611
+ }
612
 
613
  return $list;
614
  }
classes/class-ip-geo-block-cron.php CHANGED
@@ -47,7 +47,7 @@ class IP_Geo_Block_Cron {
47
  * A. Once per site when this plugin is activated on network wide
48
  * B. Multiple time for each blog when this plugin is individually activated
49
  */
50
- public static function exec_job( $immediate = FALSE ) {
51
  $settings = IP_Geo_Block::get_option();
52
  $args = IP_Geo_Block::get_request_headers( $settings );
53
 
@@ -141,12 +141,12 @@ class IP_Geo_Block_Cron {
141
  * Kick off a cron job to download database immediately in background on activation.
142
  *
143
  */
144
- public static function start_update_db( $settings ) {
145
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
146
 
147
  // the status is still inactive when this plugin is activated on dashboard.
148
- if ( ! ( is_plugin_active ( IP_GEO_BLOCK_BASE ) || // @since 2.5.0
149
- is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) ) { // @since 3.0.0
150
  set_transient( IP_Geo_Block::CRON_NAME, IP_Geo_Block::get_ip_address(), MINUTE_IN_SECONDS );
151
  self::schedule_cron_job( $settings['update'], NULL, TRUE );
152
  }
@@ -159,7 +159,6 @@ class IP_Geo_Block_Cron {
159
  /**
160
  * Kick off a cron job to garbage collection for IP address cache.
161
  *
162
- * Note: When the init action occurs in /wp-settings.php, wp_cron() runs.
163
  */
164
  public static function exec_cache_gc( $settings ) {
165
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
@@ -266,17 +265,17 @@ class IP_Geo_Block_Cron {
266
  if ( 'gz' === $args && function_exists( 'gzopen' ) ) {
267
  if ( FALSE === ( $gz = gzopen( $src, 'r' ) ) )
268
  throw new Exception(
269
- sprintf( __( 'Unable to read %s. Please check the permission.', 'ip-geo-block' ), $src )
270
  );
271
 
272
  if ( FALSE === ( $fp = @fopen( $filename, 'cb' ) ) )
273
  throw new Exception(
274
- sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), $filename )
275
  );
276
 
277
  if ( ! flock( $fp, LOCK_EX ) )
278
  throw new Exception(
279
- sprintf( __( 'Can\'t lock %s. Please try again after a while.', 'ip-geo-block' ), $filename )
280
  );
281
 
282
  ftruncate( $fp, 0 ); // truncate file
@@ -296,27 +295,15 @@ class IP_Geo_Block_Cron {
296
  $ret->get_error_code() . ' ' . $ret->get_error_message()
297
  );
298
 
299
- if ( FALSE === ( $gz = @fopen( $tmp .= basename( $filename ), 'r' ) ) )
300
  throw new Exception(
301
- sprintf( __( 'Unable to read %s. Please check the permission.', 'ip-geo-block' ), $src )
302
  );
303
 
304
- if ( FALSE === ( $fp = @fopen( $filename, 'cb' ) ) )
305
  throw new Exception(
306
- sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), $filename )
307
  );
308
-
309
- if ( ! flock( $fp, LOCK_EX ) )
310
- throw new Exception(
311
- sprintf( __( 'Can\'t lock %s. Please try again after a while.', 'ip-geo-block' ), $filename )
312
- );
313
-
314
- ftruncate( $fp, 0 ); // truncate file
315
-
316
- // same block size in wp-includes/class-http.php
317
- while ( $data = fread( $gz, 4096 ) ) {
318
- fwrite( $fp, $data, strlen( $data ) );
319
- }
320
  }
321
 
322
  else {
@@ -326,7 +313,10 @@ class IP_Geo_Block_Cron {
326
 
327
  // error handler
328
  catch ( Exception $e ) {
329
- $err = new WP_Error( $e->getCode(), $e->getMessage() );
 
 
 
330
  }
331
 
332
  if ( ! empty( $fp ) ) {
@@ -335,22 +325,16 @@ class IP_Geo_Block_Cron {
335
  fclose( $fp );
336
  }
337
 
338
- ! empty( $gz ) and gzclose( $gz );
339
- ! empty( $tmp ) && @is_file( $tmp ) and @unlink( $tmp );
340
- ! is_wp_error( $src ) && @is_file( $src ) and @unlink( $src );
341
 
342
  return empty( $err ) ? array(
343
  'code' => $code,
344
- 'message' => sprintf(
345
- __( 'Last update: %s', 'ip-geo-block' ),
346
- IP_Geo_Block_Util::localdate( $modified )
347
- ),
348
  'filename' => $filename,
349
  'modified' => $modified,
350
- ) : array(
351
- 'code' => $err->get_error_code(),
352
- 'message' => $err->get_error_message(),
353
- );
354
  }
355
 
356
  }
47
  * A. Once per site when this plugin is activated on network wide
48
  * B. Multiple time for each blog when this plugin is individually activated
49
  */
50
+ public static function exec_update_db( $immediate = FALSE ) {
51
  $settings = IP_Geo_Block::get_option();
52
  $args = IP_Geo_Block::get_request_headers( $settings );
53
 
141
  * Kick off a cron job to download database immediately in background on activation.
142
  *
143
  */
144
+ public static function start_update_db( $settings, $force = FALSE ) {
145
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
146
 
147
  // the status is still inactive when this plugin is activated on dashboard.
148
+ if ( ! ( is_plugin_active ( IP_GEO_BLOCK_BASE ) || // @since 2.5.0
149
+ is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) || $force ) { // @since 3.0.0
150
  set_transient( IP_Geo_Block::CRON_NAME, IP_Geo_Block::get_ip_address(), MINUTE_IN_SECONDS );
151
  self::schedule_cron_job( $settings['update'], NULL, TRUE );
152
  }
159
  /**
160
  * Kick off a cron job to garbage collection for IP address cache.
161
  *
 
162
  */
163
  public static function exec_cache_gc( $settings ) {
164
  require_once ABSPATH . 'wp-admin/includes/plugin.php';
265
  if ( 'gz' === $args && function_exists( 'gzopen' ) ) {
266
  if ( FALSE === ( $gz = gzopen( $src, 'r' ) ) )
267
  throw new Exception(
268
+ sprintf( __( 'Unable to read <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $src )
269
  );
270
 
271
  if ( FALSE === ( $fp = @fopen( $filename, 'cb' ) ) )
272
  throw new Exception(
273
+ sprintf( __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $filename )
274
  );
275
 
276
  if ( ! flock( $fp, LOCK_EX ) )
277
  throw new Exception(
278
+ sprintf( __( 'Can\'t lock <code>%s</code>. Please try again after a while.', 'ip-geo-block' ), $filename )
279
  );
280
 
281
  ftruncate( $fp, 0 ); // truncate file
295
  $ret->get_error_code() . ' ' . $ret->get_error_message()
296
  );
297
 
298
+ if ( FALSE === ( $data = $fs->get_contents( $tmp .= basename( $filename ) ) ) )
299
  throw new Exception(
300
+ sprintf( __( 'Unable to read <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $tmp )
301
  );
302
 
303
+ if ( FALSE === $fs->put_contents( $filename, $data, LOCK_EX ) )
304
  throw new Exception(
305
+ sprintf( __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $filename )
306
  );
 
 
 
 
 
 
 
 
 
 
 
 
307
  }
308
 
309
  else {
313
 
314
  // error handler
315
  catch ( Exception $e ) {
316
+ $err = array(
317
+ 'code' => $e->getCode(),
318
+ 'message' => $e->getMessage(),
319
+ );
320
  }
321
 
322
  if ( ! empty( $fp ) ) {
325
  fclose( $fp );
326
  }
327
 
328
+ ! empty( $gz ) and gzclose( $gz );
329
+ ! empty( $tmp ) && $fs->is_file( $tmp ) and $fs->delete( $tmp );
330
+ ! is_wp_error( $src ) && $fs->is_file( $src ) and $fs->delete( $src );
331
 
332
  return empty( $err ) ? array(
333
  'code' => $code,
334
+ 'message' => sprintf( __( 'Last update: %s', 'ip-geo-block' ), IP_Geo_Block_Util::localdate( $modified ) ),
 
 
 
335
  'filename' => $filename,
336
  'modified' => $modified,
337
+ ) : $err;
 
 
 
338
  }
339
 
340
  }
classes/class-ip-geo-block-file.php CHANGED
@@ -90,6 +90,19 @@ if (0) {
90
  return $file;
91
  }
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  /**
94
  * Check if a file or directory exists.
95
  *
@@ -228,16 +241,35 @@ if (0) {
228
  return FALSE;
229
 
230
  if ( 'direct' === self::$method )
231
- return file_put_contents( $file, $contents, LOCK_EX );
232
  else
233
  return $wp_filesystem->put_contents( $this->absolute_path( $file ), $contents, $mode );
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  /**
237
  * Read entire file into an array.
238
  *
239
- * @param string $file Filename.
240
- * @return array
241
  */
242
  public function get_contents_array( $file ) {
243
  global $wp_filesystem;
@@ -250,8 +282,8 @@ if (0) {
250
  if ( 'direct' === self::$method )
251
  return @file( $file, FILE_IGNORE_NEW_LINES );
252
 
253
- else // `rtrim`: same as FILE_IGNORE_NEW_LINES flag in file()
254
- return array_map( 'rtrim', $wp_filesystem->get_contents_array( $this->absolute_path( $file ) ) );
255
  }
256
 
257
  /**
90
  return $file;
91
  }
92
 
93
+ /**
94
+ * Get method of the file system;
95
+ *
96
+ * @return string method of file system
97
+ */
98
+ public function get_method() {
99
+ global $wp_filesystem;
100
+ if ( empty( $wp_filesystem ) )
101
+ return FALSE;
102
+
103
+ return self::$method;
104
+ }
105
+
106
  /**
107
  * Check if a file or directory exists.
108
  *
241
  return FALSE;
242
 
243
  if ( 'direct' === self::$method )
244
+ return @file_put_contents( $file, $contents, LOCK_EX );
245
  else
246
  return $wp_filesystem->put_contents( $this->absolute_path( $file ), $contents, $mode );
247
  }
248
 
249
+ /**
250
+ * Reads entire file into a string
251
+ *
252
+ * @access public
253
+ *
254
+ * @param string $file Name of the file to read.
255
+ * @return string|bool The data of contents or false on failure.
256
+ */
257
+ public function get_contents( $file ) {
258
+ global $wp_filesystem;
259
+ if ( empty( $wp_filesystem ) )
260
+ return FALSE;
261
+
262
+ if ( 'direct' === self::$method )
263
+ return @file_get_contents( $file );
264
+ else
265
+ return $wp_filesystem->get_contents( $this->absolute_path( $file ) );
266
+ }
267
+
268
  /**
269
  * Read entire file into an array.
270
  *
271
+ * @param string $file Filename.
272
+ * @return array|bool An array of contents or false on failure.
273
  */
274
  public function get_contents_array( $file ) {
275
  global $wp_filesystem;
282
  if ( 'direct' === self::$method )
283
  return @file( $file, FILE_IGNORE_NEW_LINES );
284
 
285
+ $file = $wp_filesystem->get_contents_array( $this->absolute_path( $file ) );
286
+ return FALSE !== $file ? array_map( 'rtrim', $file ) : FALSE;
287
  }
288
 
289
  /**
classes/class-ip-geo-block-logs.php CHANGED
@@ -51,6 +51,7 @@ class IP_Geo_Block_Logs {
51
  `No` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
52
  `time` int(10) unsigned NOT NULL DEFAULT 0,
53
  `ip` varchar(40) NOT NULL,
 
54
  `hook` varchar(8) NOT NULL,
55
  `auth` int(10) unsigned NOT NULL DEFAULT 0,
56
  `code` varchar(2) NOT NULL DEFAULT 'ZZ',
@@ -65,6 +66,13 @@ class IP_Geo_Block_Logs {
65
  ) CHARACTER SET $charset"
66
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
67
 
 
 
 
 
 
 
 
68
  // for statistics
69
  $table = $wpdb->prefix . self::TABLE_STAT;
70
  $result &= ( FALSE !== $wpdb->query( "CREATE TABLE IF NOT EXISTS `$table` (
@@ -86,6 +94,7 @@ class IP_Geo_Block_Logs {
86
  `No` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
87
  `time` int(10) unsigned NOT NULL DEFAULT 0,
88
  `ip` varchar(40) NOT NULL,
 
89
  `hook` varchar(8) NOT NULL,
90
  `auth` int(10) unsigned NOT NULL DEFAULT 0,
91
  `code` varchar(2) NOT NULL DEFAULT 'ZZ',
@@ -97,6 +106,13 @@ class IP_Geo_Block_Logs {
97
  ) CHARACTER SET $charset"
98
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
99
 
 
 
 
 
 
 
 
100
  return $result;
101
  }
102
 
@@ -104,7 +120,7 @@ class IP_Geo_Block_Logs {
104
  * Search table by specific IP address
105
  *
106
  */
107
- private static function search_table( $table, $ip, $type = FALSE ) {
108
  global $wpdb;
109
  $table = $wpdb->prefix . $table;
110
 
@@ -112,7 +128,7 @@ class IP_Geo_Block_Logs {
112
  "SELECT * FROM `$table` WHERE `ip` = '%s'", $ip
113
  ) and $result = $wpdb->get_results( $sql, ARRAY_A ) or self::error( __LINE__ );
114
 
115
- if ( ! $type )
116
  return ! empty( $result[0] ) ? $result[0] : NULL; // for cache
117
  else
118
  return ! empty( $result ) ? $result : array(); // for logs
@@ -418,9 +434,10 @@ class IP_Geo_Block_Logs {
418
  if ( validate_file( $path ) === 0 ) {
419
  file_put_contents(
420
  IP_Geo_Block_Util::slashit( $path ) . IP_Geo_Block::PLUGIN_NAME . date('-Y-m') . '.log',
421
- sprintf( "%d,%s,%s,%d,%s,%s,%s,%s,%s,%s\n",
422
  $_SERVER['REQUEST_TIME'],
423
  $validate['ip'],
 
424
  $hook,
425
  $validate['auth'],
426
  $validate['code'],
@@ -478,7 +495,7 @@ class IP_Geo_Block_Logs {
478
  // Can't start transaction on the assumption that the storage engine is innoDB.
479
  // So there are some cases where logs are excessively deleted.
480
  $sql = $wpdb->prepare(
481
- "DELETE FROM `$table` WHERE `hook` = '%s' ORDER BY `No` ASC LIMIT %d",
482
  $hook, $count - $rows + 1
483
  ) and $wpdb->query( $sql ) or self::error( __LINE__ );
484
  }
@@ -486,10 +503,11 @@ class IP_Geo_Block_Logs {
486
  // insert into DB
487
  $sql = $wpdb->prepare(
488
  "INSERT INTO `$table`
489
- (`time`, `ip`, `hook`, `auth`, `code`, `result`, `method`, `user_agent`, `headers`, `data`)
490
- VALUES (%d, %s, %s, %d, %s, %s, %s, %s, %s, %s)",
491
  $_SERVER['REQUEST_TIME'],
492
  $validate['ip'],
 
493
  $hook,
494
  $validate['auth'],
495
  $validate['code'],
@@ -521,12 +539,12 @@ class IP_Geo_Block_Logs {
521
  global $wpdb;
522
  $table = $wpdb->prefix . self::TABLE_LOGS;
523
 
524
- $sql = "SELECT `hook`, `time`, `ip`, `code`, `result`, `method`, `user_agent`, `headers`, `data` FROM `$table`";
525
 
526
  if ( ! $hook )
527
- $sql .= " ORDER BY `hook`, `No` DESC";
528
  else
529
- $sql .= $wpdb->prepare( " WHERE `hook` = '%s' ORDER BY `No` DESC", $hook );
530
 
531
  return $sql ? $wpdb->get_results( $sql, ARRAY_N ) : array();
532
  }
@@ -536,7 +554,22 @@ class IP_Geo_Block_Logs {
536
  *
537
  */
538
  public static function search_logs( $ip ) {
539
- return self::search_table( self::TABLE_LOGS, $ip, TRUE );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
540
  }
541
 
542
  /**
@@ -591,7 +624,7 @@ class IP_Geo_Block_Logs {
591
  *
592
  */
593
  public static function search_cache( $ip ) {
594
- return self::search_table( IP_Geo_Block::CACHE_NAME, $ip );
595
  }
596
 
597
  /**
@@ -631,18 +664,18 @@ class IP_Geo_Block_Logs {
631
 
632
  $sql = $wpdb->prepare(
633
  "INSERT INTO `$table`
634
- (`time`, `ip`, `hook`, `auth`, `code`, `fail`, `call`, `host`)
635
- VALUES (%d, %s, %s, %d, %s, %d, %d, %s)
636
  ON DUPLICATE KEY UPDATE
637
  `time` = VALUES(`time`),
638
  `hook` = VALUES(`hook`),
639
  `auth` = VALUES(`auth`),
640
  `code` = VALUES(`code`),
641
  `fail` = VALUES(`fail`),
642
- `call` = VALUES(`call`),
643
- `host` = VALUES(`host`)",
644
  $cache['time'],
645
  $cache['ip' ],
 
646
  $cache['hook'],
647
  $cache['auth'],
648
  $cache['code'],
@@ -667,21 +700,6 @@ class IP_Geo_Block_Logs {
667
  return $result;
668
  }
669
 
670
- /**
671
- *
672
- *
673
- */
674
- public static function get_recent( $duration = DAY_IN_SECONDS ) {
675
- global $wpdb;
676
- $table = $wpdb->prefix . self::TABLE_LOGS;
677
-
678
- $sql = $wpdb->prepare(
679
- "SELECT `time`, `ip`, `hook`, `code`, `method`, `data` FROM `$table` WHERE `time` > %d", $_SERVER['REQUEST_TIME'] - $duration
680
- ) and $result = $wpdb->get_results( $sql, ARRAY_A ) or self::error( __LINE__ );
681
-
682
- return $result;
683
- }
684
-
685
  /**
686
  * SQL Error handling
687
  *
51
  `No` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
52
  `time` int(10) unsigned NOT NULL DEFAULT 0,
53
  `ip` varchar(40) NOT NULL,
54
+ `asn` varchar(8) NULL,
55
  `hook` varchar(8) NOT NULL,
56
  `auth` int(10) unsigned NOT NULL DEFAULT 0,
57
  `code` varchar(2) NOT NULL DEFAULT 'ZZ',
66
  ) CHARACTER SET $charset"
67
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
68
 
69
+ // Add column for AS Number @since 3.0.4
70
+ if ( ! $wpdb->query( "DESCRIBE `$table` `asn`" ) ) {
71
+ $wpdb->query(
72
+ "ALTER TABLE `$table` ADD `asn` varchar(8) AFTER `ip`"
73
+ ) or self::error( __LINE__ );
74
+ }
75
+
76
  // for statistics
77
  $table = $wpdb->prefix . self::TABLE_STAT;
78
  $result &= ( FALSE !== $wpdb->query( "CREATE TABLE IF NOT EXISTS `$table` (
94
  `No` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
95
  `time` int(10) unsigned NOT NULL DEFAULT 0,
96
  `ip` varchar(40) NOT NULL,
97
+ `asn` varchar(8) NULL,
98
  `hook` varchar(8) NOT NULL,
99
  `auth` int(10) unsigned NOT NULL DEFAULT 0,
100
  `code` varchar(2) NOT NULL DEFAULT 'ZZ',
106
  ) CHARACTER SET $charset"
107
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
108
 
109
+ // Add column for AS Number @since 3.0.4
110
+ if ( ! $wpdb->query( "DESCRIBE `$table` `asn`" ) ) {
111
+ $wpdb->query(
112
+ "ALTER TABLE `$table` ADD `asn` varchar(8) AFTER `ip`"
113
+ ) or self::error( __LINE__ );
114
+ }
115
+
116
  return $result;
117
  }
118
 
120
  * Search table by specific IP address
121
  *
122
  */
123
+ private static function search_table( $table, $ip, $type = TRUE ) {
124
  global $wpdb;
125
  $table = $wpdb->prefix . $table;
126
 
128
  "SELECT * FROM `$table` WHERE `ip` = '%s'", $ip
129
  ) and $result = $wpdb->get_results( $sql, ARRAY_A ) or self::error( __LINE__ );
130
 
131
+ if ( $type )
132
  return ! empty( $result[0] ) ? $result[0] : NULL; // for cache
133
  else
134
  return ! empty( $result ) ? $result : array(); // for logs
434
  if ( validate_file( $path ) === 0 ) {
435
  file_put_contents(
436
  IP_Geo_Block_Util::slashit( $path ) . IP_Geo_Block::PLUGIN_NAME . date('-Y-m') . '.log',
437
+ sprintf( "%d,%s,%s,%s,%d,%s,%s,%s,%s,%s,%s\n",
438
  $_SERVER['REQUEST_TIME'],
439
  $validate['ip'],
440
+ $validate['asn'],
441
  $hook,
442
  $validate['auth'],
443
  $validate['code'],
495
  // Can't start transaction on the assumption that the storage engine is innoDB.
496
  // So there are some cases where logs are excessively deleted.
497
  $sql = $wpdb->prepare(
498
+ "DELETE FROM `$table` WHERE `hook` = '%s' ORDER BY `time` ASC LIMIT %d",
499
  $hook, $count - $rows + 1
500
  ) and $wpdb->query( $sql ) or self::error( __LINE__ );
501
  }
503
  // insert into DB
504
  $sql = $wpdb->prepare(
505
  "INSERT INTO `$table`
506
+ (`time`, `ip`, `asn`, `hook`, `auth`, `code`, `result`, `method`, `user_agent`, `headers`, `data`)
507
+ VALUES (%d, %s, %s, %s, %d, %s, %s, %s, %s, %s, %s)",
508
  $_SERVER['REQUEST_TIME'],
509
  $validate['ip'],
510
+ $validate['asn'],
511
  $hook,
512
  $validate['auth'],
513
  $validate['code'],
539
  global $wpdb;
540
  $table = $wpdb->prefix . self::TABLE_LOGS;
541
 
542
+ $sql = "SELECT `hook`, `time`, `ip`, `code`, `result`, `asn`, `method`, `user_agent`, `headers`, `data` FROM `$table`";
543
 
544
  if ( ! $hook )
545
+ $sql .= " ORDER BY `hook`, `time` DESC";
546
  else
547
+ $sql .= $wpdb->prepare( " WHERE `hook` = '%s' ORDER BY `time` DESC", $hook );
548
 
549
  return $sql ? $wpdb->get_results( $sql, ARRAY_N ) : array();
550
  }
554
  *
555
  */
556
  public static function search_logs( $ip ) {
557
+ return self::search_table( self::TABLE_LOGS, $ip, FALSE );
558
+ }
559
+
560
+ /**
561
+ * Get logs for a specified duration in the past
562
+ *
563
+ */
564
+ public static function get_recent_logs( $duration = DAY_IN_SECONDS ) {
565
+ global $wpdb;
566
+ $table = $wpdb->prefix . self::TABLE_LOGS;
567
+
568
+ $sql = $wpdb->prepare(
569
+ "SELECT `time`, `ip`, `asn`, `hook`, `code`, `method`, `data` FROM `$table` WHERE `time` > %d", $_SERVER['REQUEST_TIME'] - $duration
570
+ ) and $result = $wpdb->get_results( $sql, ARRAY_A ) or self::error( __LINE__ );
571
+
572
+ return $result;
573
  }
574
 
575
  /**
624
  *
625
  */
626
  public static function search_cache( $ip ) {
627
+ return self::search_table( IP_Geo_Block::CACHE_NAME, $ip, TRUE );
628
  }
629
 
630
  /**
664
 
665
  $sql = $wpdb->prepare(
666
  "INSERT INTO `$table`
667
+ (`time`, `ip`, `asn`, `hook`, `auth`, `code`, `fail`, `call`, `host`)
668
+ VALUES (%d, %s, %s, %s, %d, %s, %d, %d, %s)
669
  ON DUPLICATE KEY UPDATE
670
  `time` = VALUES(`time`),
671
  `hook` = VALUES(`hook`),
672
  `auth` = VALUES(`auth`),
673
  `code` = VALUES(`code`),
674
  `fail` = VALUES(`fail`),
675
+ `call` = VALUES(`call`)",
 
676
  $cache['time'],
677
  $cache['ip' ],
678
+ $cache['asn' ],
679
  $cache['hook'],
680
  $cache['auth'],
681
  $cache['code'],
700
  return $result;
701
  }
702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  /**
704
  * SQL Error handling
705
  *
classes/class-ip-geo-block-opts.php CHANGED
@@ -16,7 +16,7 @@ class IP_Geo_Block_Opts {
16
  *
17
  */
18
  private static $option_table = array(
19
- 'version' => '3.0.0', // Version of this table (not package)
20
  // since version 1.0
21
  'providers' => array(), // List of providers and API keys
22
  'comment' => array( // Message on the comment form
@@ -36,7 +36,7 @@ class IP_Geo_Block_Opts {
36
  // since version 3.0.0
37
  'cache_time_gc' => 900, // Cache garbage collection time
38
  // since version 1.2, 1.3
39
- 'login_fails' => 5, // Limited number of login attempts
40
  'validation' => array( // Action hook for validation
41
  'comment' => FALSE, // Validate on comment post
42
  'login' => 1, // Validate on login
@@ -50,8 +50,8 @@ class IP_Geo_Block_Opts {
50
  'maxlogs' => 100, // Max number of rows of log
51
  'backup' => NULL, // Absolute path to directory for backup logs
52
  // since version 2.1.0
53
- 'plugins' => 0, // Validate on wp-content/plugins
54
- 'themes' => 0, // Validate on wp-content/themes
55
  // since version 2.2.9
56
  'timing' => 0, // 0:init, 1:mu-plugins, 2:drop-in
57
  'recdays' => 30, // Number of days for recording logs
@@ -93,6 +93,12 @@ class IP_Geo_Block_Opts {
93
  // since version 2.2.1
94
  'ipv4_last' => 0, // Last-Modified of DB file
95
  'ipv6_last' => 0, // Last-Modified of DB file
 
 
 
 
 
 
96
  ),
97
  'IP2Location' => array( // IP2Location
98
  // since version 2.2.2
@@ -157,6 +163,8 @@ class IP_Geo_Block_Opts {
157
  'mimetype' => array(
158
  'white_list' => array(), // key and value
159
  'black_list' => "asp,aspx,cgi,exe,js,jsp,php,php3,php4,php5,pl,py,pht,phtml,html,htm,shtml,htaccess,sh,svg,gz,zip,rar,tar", // comma separated extension
 
 
160
  ),
161
  'others' => array(), // TBD
162
  );
@@ -204,6 +212,7 @@ class IP_Geo_Block_Opts {
204
  'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
205
  'odt' => 'application/vnd.oasis.opendocument.text',
206
  );
 
207
  return self::$option_table;
208
  }
209
 
@@ -273,16 +282,13 @@ class IP_Geo_Block_Opts {
273
  if ( version_compare( $version, '2.2.5' ) < 0 ) {
274
  // https://wordpress.org/support/topic/compatibility-with-ag-custom-admin
275
  $arr = array();
276
-
277
  foreach ( explode( ',', $settings['signature'] ) as $tmp ) {
278
  $tmp = trim( $tmp );
279
  if ( 'wp-config.php' === $tmp || 'passwd' === $tmp )
280
  $tmp = '/' . $tmp;
281
  array_push( $arr, $tmp );
282
  }
283
-
284
  $settings['signature'] = implode( ',', $arr );
285
-
286
  foreach ( array( 'plugins', 'themes' ) as $tmp ) {
287
  $settings['exception'][ $tmp ] = $default['exception'][ $tmp ];
288
  }
@@ -351,13 +357,24 @@ class IP_Geo_Block_Opts {
351
  );
352
  }
353
 
 
 
 
 
 
 
 
 
 
 
 
354
  // save package version number
355
  $settings['version'] = IP_Geo_Block::VERSION;
356
  }
357
 
358
- // install addons for IP Geolocation database API ver. 1.1.8
359
  $providers = IP_Geo_Block_Provider::get_addons();
360
- if ( empty( $providers ) || ! $settings['api_dir'] || version_compare( $version, '3.0.3' ) < 0 )
361
  $settings['api_dir'] = self::install_api( $settings );
362
 
363
  // update option table
@@ -379,10 +396,9 @@ class IP_Geo_Block_Opts {
379
  try {
380
  if ( FALSE === self::recurse_copy( $src, $dst ) )
381
  throw new Exception();
382
- }
383
- catch ( Exception $e ) {
384
  if ( class_exists( 'IP_Geo_Block_Admin', FALSE ) )
385
- IP_Geo_Block_Admin::add_admin_notice( 'error', sprintf( __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), $dst ) );
386
 
387
  return NULL;
388
  }
16
  *
17
  */
18
  private static $option_table = array(
19
+ 'version' => '3.0.4', // Version of this table (not package)
20
  // since version 1.0
21
  'providers' => array(), // List of providers and API keys
22
  'comment' => array( // Message on the comment form
36
  // since version 3.0.0
37
  'cache_time_gc' => 900, // Cache garbage collection time
38
  // since version 1.2, 1.3
39
+ 'login_fails' => -1, // Limited number of login attempts
40
  'validation' => array( // Action hook for validation
41
  'comment' => FALSE, // Validate on comment post
42
  'login' => 1, // Validate on login
50
  'maxlogs' => 100, // Max number of rows of log
51
  'backup' => NULL, // Absolute path to directory for backup logs
52
  // since version 2.1.0
53
+ 'plugins' => 0, // Validate on wp-content/plugins (1:country 2:ZEP)
54
+ 'themes' => 0, // Validate on wp-content/themes (1:country 2:ZEP)
55
  // since version 2.2.9
56
  'timing' => 0, // 0:init, 1:mu-plugins, 2:drop-in
57
  'recdays' => 30, // Number of days for recording logs
93
  // since version 2.2.1
94
  'ipv4_last' => 0, // Last-Modified of DB file
95
  'ipv6_last' => 0, // Last-Modified of DB file
96
+ // since version 3.0.4
97
+ 'use_asn' => -1, // -1:install, 0:disable, 1:enable
98
+ 'asn4_path' => NULL, // AS Number for IPv4
99
+ 'asn6_path' => NULL, // AS Number for IPv6
100
+ 'asn4_last' => 0, // AS Number for IPv4
101
+ 'asn6_last' => 0, // AS Number for IPv6
102
  ),
103
  'IP2Location' => array( // IP2Location
104
  // since version 2.2.2
163
  'mimetype' => array(
164
  'white_list' => array(), // key and value
165
  'black_list' => "asp,aspx,cgi,exe,js,jsp,php,php3,php4,php5,pl,py,pht,phtml,html,htm,shtml,htaccess,sh,svg,gz,zip,rar,tar", // comma separated extension
166
+ // since version 3.0.4
167
+ 'capability' => array( 'upload_files' ),
168
  ),
169
  'others' => array(), // TBD
170
  );
212
  'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
213
  'odt' => 'application/vnd.oasis.opendocument.text',
214
  );
215
+
216
  return self::$option_table;
217
  }
218
 
282
  if ( version_compare( $version, '2.2.5' ) < 0 ) {
283
  // https://wordpress.org/support/topic/compatibility-with-ag-custom-admin
284
  $arr = array();
 
285
  foreach ( explode( ',', $settings['signature'] ) as $tmp ) {
286
  $tmp = trim( $tmp );
287
  if ( 'wp-config.php' === $tmp || 'passwd' === $tmp )
288
  $tmp = '/' . $tmp;
289
  array_push( $arr, $tmp );
290
  }
 
291
  $settings['signature'] = implode( ',', $arr );
 
292
  foreach ( array( 'plugins', 'themes' ) as $tmp ) {
293
  $settings['exception'][ $tmp ] = $default['exception'][ $tmp ];
294
  }
357
  );
358
  }
359
 
360
+ if ( version_compare( $version, '3.0.4.1' ) < 0 ) {
361
+ if ( ! isset( $settings['Maxmind']['use_asn'] ) ) {
362
+ $settings['Maxmind' ]['use_asn' ] = 0; // disable
363
+ $settings['Maxmind' ]['asn4_path' ] = $default['Maxmind' ]['asn4_path' ];
364
+ $settings['Maxmind' ]['asn4_last' ] = $default['Maxmind' ]['asn4_last' ];
365
+ $settings['Maxmind' ]['asn6_path' ] = $default['Maxmind' ]['asn6_path' ];
366
+ $settings['Maxmind' ]['asn6_last' ] = $default['Maxmind' ]['asn6_last' ];
367
+ $settings['mimetype']['capability'] = $default['mimetype']['capability'];
368
+ }
369
+ }
370
+
371
  // save package version number
372
  $settings['version'] = IP_Geo_Block::VERSION;
373
  }
374
 
375
+ // install addons for IP Geolocation database API ver. 1.1.9
376
  $providers = IP_Geo_Block_Provider::get_addons();
377
+ if ( empty( $providers ) || ! $settings['api_dir'] || version_compare( $version, '3.0.4.1' ) < 0 )
378
  $settings['api_dir'] = self::install_api( $settings );
379
 
380
  // update option table
396
  try {
397
  if ( FALSE === self::recurse_copy( $src, $dst ) )
398
  throw new Exception();
399
+ } catch ( Exception $e ) {
 
400
  if ( class_exists( 'IP_Geo_Block_Admin', FALSE ) )
401
+ IP_Geo_Block_Admin::add_admin_notice( 'error', sprintf( __( 'Unable to write <code>%s</code>. Please check the permission.', 'ip-geo-block' ), '<code>' . $dst . '</code>' ) );
402
 
403
  return NULL;
404
  }
classes/class-ip-geo-block-util.php CHANGED
@@ -214,12 +214,15 @@ class IP_Geo_Block_Util {
214
  case 'auth':
215
  $cookie_name = AUTH_COOKIE;
216
  break;
 
217
  case 'secure_auth':
218
  $cookie_name = SECURE_AUTH_COOKIE;
219
  break;
 
220
  case "logged_in":
221
  $cookie_name = LOGGED_IN_COOKIE;
222
  break;
 
223
  default:
224
  if ( is_ssl() ) {
225
  $cookie_name = SECURE_AUTH_COOKIE;
@@ -644,6 +647,28 @@ class IP_Geo_Block_Util {
644
  return TRUE;
645
  }
646
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  /**
648
  * WP alternative function for advanced-cache.php
649
  *
@@ -817,4 +842,61 @@ class IP_Geo_Block_Util {
817
  ( isset( $_SERVER['LOCAL_ADDR' ] ) ? $_SERVER['LOCAL_ADDR' ] : NULL ) : NULL );
818
  }
819
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
  }
214
  case 'auth':
215
  $cookie_name = AUTH_COOKIE;
216
  break;
217
+
218
  case 'secure_auth':
219
  $cookie_name = SECURE_AUTH_COOKIE;
220
  break;
221
+
222
  case "logged_in":
223
  $cookie_name = LOGGED_IN_COOKIE;
224
  break;
225
+
226
  default:
227
  if ( is_ssl() ) {
228
  $cookie_name = SECURE_AUTH_COOKIE;
647
  return TRUE;
648
  }
649
 
650
+ /**
651
+ * Arrange $_FILES array
652
+ *
653
+ * @see http://php.net/manual/ja/features.file-upload.multiple.php#53240
654
+ */
655
+ public static function arrange_files( $files ) {
656
+ if ( ! is_array( $files['name'] ) )
657
+ return array( $files );
658
+
659
+ $file_array = array();
660
+ $file_count = count( $files['name'] );
661
+ $file_keys = array_keys( $files );
662
+
663
+ for ( $i=0; $i < $file_count; ++$i ) {
664
+ foreach ( $file_keys as $key ) {
665
+ $file_array[ $i ][ $key ] = $files[ $key ][ $i ];
666
+ }
667
+ }
668
+
669
+ return $file_array;
670
+ }
671
+
672
  /**
673
  * WP alternative function for advanced-cache.php
674
  *
842
  ( isset( $_SERVER['LOCAL_ADDR' ] ) ? $_SERVER['LOCAL_ADDR' ] : NULL ) : NULL );
843
  }
844
 
845
+ /**
846
+ * Get the list of registered actions
847
+ *
848
+ */
849
+ public static function get_registered_actions( $ajax = FALSE ) {
850
+ $installed = array();
851
+
852
+ global $wp_filter;
853
+ foreach ( $wp_filter as $key => $val ) {
854
+ if ( $ajax && FALSE !== strpos( $key, 'wp_ajax_' ) ) {
855
+ if ( 0 === strpos( $key, 'wp_ajax_nopriv_' ) ) {
856
+ $key = substr( $key, 15 ); // 'wp_ajax_nopriv_'
857
+ $val = 2; // without privilege
858
+ } else {
859
+ $key = substr( $key, 8 ); // 'wp_ajax_'
860
+ $val = 1; // with privilege
861
+ }
862
+ $installed[ $key ] = isset( $installed[ $key ] ) ? $installed[ $key ] | $val : $val;
863
+ } elseif ( FALSE !== strpos( $key, 'admin_post_' ) ) {
864
+ if ( 0 === strpos( $key, 'admin_post_nopriv_' ) ) {
865
+ $key = substr( $key, 18 ); // 'admin_post_nopriv_'
866
+ $val = 2; // without privilege
867
+ } else {
868
+ $key = substr( $key, 11 ); // 'admin_post_'
869
+ $val = 1; // with privilege
870
+ }
871
+ $installed[ $key ] = isset( $installed[ $key ] ) ? $installed[ $key ] | $val : $val;
872
+ }
873
+ }
874
+ unset( $installed['ip_geo_block'] );
875
+
876
+ return $installed;
877
+ }
878
+
879
+ /**
880
+ * Get the list of multisite
881
+ *
882
+ */
883
+ public static function get_multisite() {
884
+ $sites = array();
885
+
886
+ if ( is_multisite() ) {
887
+ global $wpdb;
888
+ foreach ( $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" ) as $id ) {
889
+ switch_to_blog( $id );
890
+ $sites[] = admin_url();
891
+ restore_current_blog();
892
+ }
893
+
894
+ if ( empty( $sites[ $url = network_admin_url() ] ) ) {
895
+ $sites[] = $url;
896
+ }
897
+ }
898
+
899
+ return $sites;
900
+ }
901
+
902
  }
classes/class-ip-geo-block.php CHANGED
@@ -15,7 +15,7 @@ class IP_Geo_Block {
15
  * Unique identifier for this plugin.
16
  *
17
  */
18
- const VERSION = '3.0.3.4';
19
  const GEOAPI_NAME = 'ip-geo-api';
20
  const PLUGIN_NAME = 'ip-geo-block';
21
  const OPTION_NAME = 'ip_geo_block_settings';
@@ -38,11 +38,20 @@ class IP_Geo_Block {
38
  *
39
  */
40
  private function __construct() {
41
- // setup loader to configure validation function
 
 
 
 
 
 
 
 
 
 
42
  $settings = self::get_option();
43
  $priority = $settings['priority' ];
44
  $validate = $settings['validation'];
45
- $loader = new IP_Geo_Block_Loader();
46
 
47
  // get client IP address
48
  self::$remote_addr = IP_Geo_Block_Util::get_client_ip( $validate['proxy'] );
@@ -105,66 +114,47 @@ class IP_Geo_Block {
105
  if ( $validate['public'] || ( ! empty( $_FILES ) && $validate['mimetype'] ) /* && 'index.php' === $this->pagenow */ )
106
  $loader->add_action( 'init', array( $this, 'validate_public' ), $priority );
107
 
108
- // others on init action hook
109
- add_action( 'init', array( $this, 'actions_init' ) );
110
- }
111
-
112
- // force to change the redirect URL on logout to remove nonce, embed a nonce into pages
113
- add_filter( 'wp_redirect', array( $this, 'logout_redirect' ), 20, 2 ); // logout_redirect @4.2
114
- add_filter( 'http_request_args', array( $this, 'request_nonce' ), $priority, 2 ); // @since 2.7.0
115
-
116
- // Run the loader to execute all of the hooks with WordPress.
117
- $loader->run( $this );
118
- unset( $loader );
119
- }
120
-
121
- /**
122
- * Setup actions after init.
123
- *
124
- */
125
- public function actions_init() {
126
- $settings = self::get_option();
127
- $priority = $settings['priority' ];
128
- $validate = $settings['validation'];
129
 
130
- // prepare nonce for login user
131
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_nonce' ), $priority ); // @since 2.8.0
 
 
132
 
133
- // garbage collection for IP address cache
134
- add_action( self::CACHE_NAME, array( $this, 'exec_cache_gc' ) );
 
 
 
 
135
 
136
- // the action hook which will be fired by cron job
137
- if ( $settings['update']['auto'] )
138
- add_action( self::CRON_NAME, array( $this, 'update_database' ) );
139
 
140
- // message text on comment form
141
- if ( $settings['comment']['pos'] ) {
142
- $pos = ( 1 === (int)$settings['comment']['pos'] ? '_top' : '' );
143
- add_action( 'comment_form' . $pos, array( $this, 'comment_form_message' ) );
144
- }
 
145
 
146
- if ( $validate['comment'] ) {
147
- add_action( 'pre_comment_on_post', array( $this, 'validate_comment' ), $priority ); // wp-comments-post.php @since 2.8.0
148
- add_action( 'pre_trackback_post', array( $this, 'validate_comment' ), $priority ); // wp-trackback.php @since 4.7.0
149
- add_filter( 'preprocess_comment', array( $this, 'validate_comment' ), $priority ); // wp-includes/comment.php @since 1.5.0
150
 
151
- // bbPress: prevent creating topic/relpy and rendering form
152
- add_action( 'bbp_post_request_bbp-new-topic', array( $this, 'validate_comment' ), $priority );
153
- add_action( 'bbp_post_request_bbp-new-reply', array( $this, 'validate_comment' ), $priority );
154
- add_filter( 'bbp_current_user_can_access_create_topic_form', array( $this, 'validate_front' ), $priority );
155
- add_filter( 'bbp_current_user_can_access_create_reply_form', array( $this, 'validate_front' ), $priority );
156
  }
157
 
158
- if ( $validate['login'] ) {
159
- // for hide/rename wp-login.php, BuddyPress: prevent registration and rendering form
160
- add_action( 'login_init', array( $this, 'validate_login' ), $priority );
161
-
162
- // only when block on front-end is disabled
163
- if ( ! $validate['public'] ) {
164
- add_action( 'bp_core_screen_signup', array( $this, 'validate_login' ), $priority );
165
- add_action( 'bp_signup_pre_validate', array( $this, 'validate_login' ), $priority );
166
- }
167
- }
168
  }
169
 
170
  /**
@@ -230,28 +220,23 @@ class IP_Geo_Block {
230
  */
231
  public static function enqueue_nonce() {
232
  if ( is_user_logged_in() ) {
233
- $handle = self::PLUGIN_NAME . '-auth-nonce';
 
 
 
 
 
 
 
 
 
234
  $script = plugins_url(
235
  ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
236
  'admin/js/authenticate.min.js' : 'admin/js/authenticate.js', IP_GEO_BLOCK_BASE
237
  );
238
- $args = array( 'nonce' => IP_Geo_Block_Util::create_nonce( $handle ) ) + self::$wp_path;
239
-
240
- if ( is_multisite() ) {
241
- global $wpdb;
242
- foreach ( $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" ) as $id ) {
243
- switch_to_blog( $id );
244
- $sites[] = admin_url();
245
- restore_current_blog();
246
- }
247
- if ( empty( $sites[ $url = network_admin_url() ] ) ) {
248
- $sites[] = $url;
249
- }
250
- $args += array( 'sites' => $sites );
251
- }
252
 
253
  wp_enqueue_script( $handle, $script, array( 'jquery' ), self::VERSION );
254
- wp_localize_script( $handle, 'IP_GEO_BLOCK_AUTH', $args );
255
  }
256
  }
257
 
@@ -289,11 +274,12 @@ class IP_Geo_Block {
289
  *
290
  */
291
  private static function make_validation( $ip, $result ) {
 
292
  return array_merge( array(
293
  'ip' => $ip,
294
- 'auth' => IP_Geo_Block_Util::get_current_user_id(),
295
- 'code' => 'ZZ', // may be overwritten with $result
296
- ), $result );
297
  }
298
 
299
  /**
@@ -310,7 +296,7 @@ class IP_Geo_Block {
310
  if ( empty( $providers ) ) // make valid providers list
311
  $providers = IP_Geo_Block_Provider::get_valid_providers( $settings['providers'] );
312
 
313
- $result = self::_get_geolocation( $ip ? $ip : self::get_ip_address(), $settings, $providers, $callback );
314
 
315
  if ( ! empty( $result['countryCode'] ) )
316
  $result['code'] = $result['countryCode'];
@@ -322,22 +308,29 @@ class IP_Geo_Block {
322
  * API for internal.
323
  *
324
  */
325
- private static function _get_geolocation( $ip, $settings, $providers, $callback = 'get_country' ) {
326
  // check loop back / private address
327
  if ( IP_Geo_Block_Util::is_private_ip( $ip ) )
328
  return self::make_validation( $ip, array( 'time' => 0, 'provider' => 'Private', 'code' => 'XX' ) );
329
 
330
  // set arguments for wp_remote_get()
331
- $args = self::get_request_headers( $settings );
332
 
333
  foreach ( $providers as $provider ) {
334
  $time = microtime( TRUE );
335
  if ( ( $geo = IP_Geo_Block_API::get_instance( $provider, $settings ) ) &&
336
  ( $code = $geo->$callback( $ip, $args ) ) ) {
 
 
 
 
 
 
 
337
  return self::make_validation( $ip, array(
338
- 'time' => microtime( TRUE ) - $time,
339
  'provider' => $provider,
340
- ) + ( is_array( $code ) ? $code : array( 'code' => $code ) ) );
341
  }
342
  }
343
 
@@ -373,16 +366,14 @@ class IP_Geo_Block {
373
  public function send_response( $hook, $validate, $settings ) {
374
  require_once ABSPATH . WPINC . '/functions.php'; // for get_status_header_desc() @since 2.3.0
375
 
376
- // prevent caching (WP Super Cache, W3TC, Wordfence, Comet Cache)
377
- defined( 'DONOTCACHEPAGE' ) or define( 'DONOTCACHEPAGE', TRUE );
378
-
379
  $code = (int )apply_filters( self::PLUGIN_NAME . '-'.$hook.'-status', $settings['response_code'] );
380
  $mesg = (string)apply_filters( self::PLUGIN_NAME . '-'.$hook.'-reason', $settings['response_msg' ] ? $settings['response_msg'] : get_status_header_desc( $code ) );
381
 
382
  // custom action (for fail2ban) @since 1.2.0
383
  do_action( self::PLUGIN_NAME . '-send-response', $hook, $code, $validate );
384
 
385
- // Set the headers to prevent caching for the different browsers.
 
386
  nocache_headers(); // wp-includes/functions.php @since 2.0.0
387
 
388
  if ( defined( 'XMLRPC_REQUEST' ) && 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
@@ -430,31 +421,28 @@ class IP_Geo_Block {
430
  /**
431
  * Validate ip address.
432
  *
433
- * @param string $hook a name to identify action hook applied in this call.
434
- * @param array $settings option settings
435
- * @param boolean $block block if validation fails (for simulate)
436
- * @param boolean $die send http response and die if validation fails (for validate_front )
437
- * @param boolean $auth save log and block if validation fails (for admin dashboard)
438
  */
439
- public function validate_ip( $hook, $settings, $block = TRUE, $die = TRUE, $auth = TRUE ) {
440
- // set IP address to be validated
441
- $ips = IP_Geo_Block_Util::retrieve_ips( array( self::get_ip_address() ), $settings['validation']['proxy'] );
442
-
443
  // register auxiliary validation functions
444
  // priority high 4 close_xmlrpc, close_restapi
445
  // 5 check_nonce (high), check_user (low)
446
  // 6 check_upload (high), check_signature (low)
447
- // 7 check_auth
448
- // 8 check_fail
449
- // 9 check_ips_black (high), check_ips_white (low)
450
  // priority low 10 validate_country
451
  $var = self::PLUGIN_NAME . '-' . $hook;
452
- $settings['validation']['mimetype' ] and add_filter( $var, array( $this, 'check_upload' ), 6, 2 );
453
- $auth and add_filter( $var, array( $this, 'check_auth' ), 7, 2 );
454
- $settings['login_fails'] >= 0 and add_filter( $var, array( $this, 'check_fail' ), 8, 2 );
455
- $settings['extra_ips'] = apply_filters( self::PLUGIN_NAME . '-extra-ips', $settings['extra_ips'], $hook );
456
- $settings['extra_ips']['black_list'] and add_filter( $var, array( $this, 'check_ips_black' ), 9, 2 );
457
- $settings['extra_ips']['white_list'] and add_filter( $var, array( $this, 'check_ips_white' ), 9, 2 );
458
 
459
  // make valid provider name list
460
  $providers = IP_Geo_Block_Provider::get_valid_providers( $settings['providers'] );
@@ -467,8 +455,9 @@ class IP_Geo_Block {
467
  // 'code' => $code, /* country code or reason of rejection */
468
  // 'result' => $result, /* 'passed', 'blocked' */
469
  // );
 
470
  foreach ( $ips as self::$remote_addr ) {
471
- $validate = self::_get_geolocation( self::$remote_addr, $settings, $providers );
472
  $validate = apply_filters( $var, $validate, $settings );
473
 
474
  // if no 'result' then validate ip address by country
@@ -480,7 +469,7 @@ class IP_Geo_Block {
480
  break;
481
  }
482
 
483
- if ( $auth ) {
484
  // record log (0:no, 1:blocked, 2:passed, 3:unauth, 4:auth, 5:all)
485
  $var = (int)apply_filters( self::PLUGIN_NAME . '-record-logs', $settings['validation']['reclogs'], $hook, $validate );
486
  $block = ( 'passed' !== $validate['result'] );
@@ -550,13 +539,8 @@ class IP_Geo_Block {
550
  */
551
  public function validate_login() {
552
  // parse action
553
- $action = isset( $_GET['key'] ) ?
554
- 'resetpass' : ( isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login' );
555
-
556
- if ( 'retrievepassword' === $action )
557
- $action = 'lostpassword';
558
- elseif ( 'rp' === $action )
559
- $action = 'resetpass';
560
 
561
  $settings = self::get_option();
562
  $list = $settings['login_action'];
@@ -564,8 +548,8 @@ class IP_Geo_Block {
564
  // the same rule should be applied to login and logout
565
  ! empty( $list['login'] ) and $list['logout'] = TRUE;
566
 
567
- // wp-includes/pluggable.php @since 2.5.0
568
- add_action( 'wp_login_failed', array( $this, 'auth_fail' ), $settings['priority'] );
569
 
570
  // enables to skip validation of country on login/out except BuddyPress signup
571
  $this->validate_ip( 'login', $settings, ! empty( $list[ $action ] ) || 'bp_' === substr( current_filter(), 0, 3 ) );
@@ -578,7 +562,6 @@ class IP_Geo_Block {
578
  private function check_exceptions( $action, $page, $exceptions = array() ) {
579
  $in_action = in_array( $action, $exceptions, TRUE );
580
  $in_page = in_array( $page, $exceptions, TRUE );
581
-
582
  return ( ( $action xor $page ) && ( ! $in_action and ! $in_page ) ) ||
583
  ( ( $action and $page ) && ( ! $in_action or ! $in_page ) ) ? FALSE : TRUE;
584
  }
@@ -614,13 +597,12 @@ class IP_Geo_Block {
614
  }
615
 
616
  // list of request for specific action or page to bypass WP-ZEP
617
- $list = array_merge(
618
- apply_filters( self::PLUGIN_NAME . '-bypass-admins', array() ),
619
- array( 'save-widget', 'wp-compression-test', 'upload-attachment', 'imgedit-preview', // in wp-admin js/widget.js, includes/template.php, async-upload.php
620
- 'bp_avatar_upload', 'GOTMLS_logintime', // bbPress, Anti-Malware Security and Brute-Force Firewall
621
- 'jetpack', 'authorize', 'jetpack_modules', 'atd_settings', 'bulk-activate', 'bulk-deactivate', // jetpack page & action
622
- )
623
- );
624
 
625
  // skip validation of country code and WP-ZEP if exceptions matches action or page
626
  if ( ( $page || $action ) && $this->check_exceptions( $action, $page, $settings['exception']['admin'] ) )
@@ -661,7 +643,7 @@ class IP_Geo_Block {
661
 
662
  // list of request for specific action or page to bypass WP-ZEP
663
  $path = array( 'includes' => array( 'ms-files.php', 'js/tinymce/wp-tinymce.php', ), /* for wp-includes */ );
664
- $path = apply_filters( self::PLUGIN_NAME . "-bypass-{$type}", isset( $path[ $type ] ) ? $path[ $type ] : array() );
665
 
666
  // skip validation of country code if exceptions matches action or page
667
  if ( in_array( $name, $settings['exception'][ $type ], TRUE ) )
@@ -693,35 +675,40 @@ class IP_Geo_Block {
693
  */
694
  public function auth_fail( $something = NULL ) {
695
  // Count up a number of fails when authentication is failed
 
696
  if ( $cache = IP_Geo_Block_API_Cache::get_cache( self::$remote_addr ) ) {
697
  $validate = self::make_validation( self::$remote_addr, array(
698
- 'code' => $cache['code'],
699
- 'fail' => TRUE,
700
- 'result' => 'failed',
701
  'provider' => 'Cache',
702
- ) );
 
703
 
704
  $settings = self::get_option();
 
705
 
706
- if ( $cache['fail'] > max( 0, (int)$settings['login_fails'] ) )
707
- $validate['result'] = 'limited';
 
 
708
 
709
- // validate xmlrpc system.multicall
710
- elseif ( defined( 'XMLRPC_REQUEST' ) && FALSE !== stripos( file_get_contents( 'php://input' ), 'system.multicall' ) )
711
- $validate['result'] = 'multi';
 
712
 
713
- $cache = IP_Geo_Block_API_Cache::update_cache( 'login', $validate, $settings ); // count up 'fail'
 
714
 
715
  // (1) blocked, (3) unauthenticated, (5) all
716
  if ( 1 & (int)$settings['validation']['reclogs'] )
717
- IP_Geo_Block_Logs::record_logs( 'login', $validate, $settings );
718
 
719
  // send response code to refuse immediately
720
- if ( 'failed' !== $validate['result'] ) {
721
  if ( $settings['save_statistics'] )
722
- IP_Geo_Block_Logs::update_stat( 'login', $validate, $settings );
723
 
724
- $this->send_response( 'login', $validate, $settings );
725
  }
726
  }
727
 
@@ -731,7 +718,7 @@ class IP_Geo_Block {
731
  public function check_fail( $validate, $settings ) {
732
  // check if number of fails reaches the limit. can't overwrite existing result.
733
  $cache = IP_Geo_Block_API_Cache::get_cache( $validate['ip'] );
734
- return $cache && $cache['fail'] >= max( 0, (int)$settings['login_fails'] ) ? $validate + array( 'result' => 'limited' ) : $validate;
735
  }
736
 
737
  public function check_auth( $validate, $settings ) {
@@ -756,10 +743,8 @@ class IP_Geo_Block {
756
  if ( $sig && FALSE !== strpos( $query, $sig ) ) {
757
  if ( preg_match( '!\W!', $sig ) || // ex) `../` or `/wp-config.php`
758
  preg_match( '!\b' . preg_quote( $sig, '!' ) . '\b!', $query ) ) {
759
- $score += ( empty( $val[1] ) ? 1.0 : (float)$val[1] );
760
- if ( $score > 0.99 ) {
761
  return $validate + array( 'result' => 'badsig' ); // can't overwrite existing result
762
- }
763
  }
764
  }
765
  }
@@ -772,28 +757,28 @@ class IP_Geo_Block {
772
  * @see wp_handle_upload() in wp-admin/includes/file.php
773
  */
774
  public function check_upload( $validate, $settings ) {
775
- if ( ! empty( $_FILES ) ) {
776
  // check capability
777
- if ( 1 === (int)$settings['validation']['mimetype'] && ! IP_Geo_Block_Util::current_user_can( 'upload_files' ) )
778
- $upload = TRUE;
779
-
780
- else foreach ( $_FILES as $key => $val ) {
781
- // check $_FILES corruption attack
782
- if ( ! isset( $val['error'] ) || is_array( $val['error'] ) ) {
783
- $upload = TRUE;
784
- break;
785
- }
786
-
787
- // check mime type and extension
788
- if ( ! IP_Geo_Block_Util::check_filetype_and_ext( $val, $settings['validation']['mimetype'], $settings['mimetype'] ) ) {
789
- $upload = TRUE;
790
  break;
791
  }
792
  }
793
 
794
- if ( isset( $upload ) ) {
795
- $validate['upload'] = TRUE; // mark for logs
796
- $validate = apply_filters( self::PLUGIN_NAME . '-forbidden-upload', $validate + array( 'result' => 'upload' ) );
 
 
 
 
 
 
 
 
 
797
  }
798
  }
799
 
@@ -805,24 +790,23 @@ class IP_Geo_Block {
805
  *
806
  */
807
  public function check_ips_white( $validate, $settings ) {
808
- return $this->check_ips( $validate, $settings['extra_ips']['white_list'], 0 );
809
  }
810
 
811
  public function check_ips_black( $validate, $settings ) {
812
- return $this->check_ips( $validate, $settings['extra_ips']['black_list'], 1 );
813
  }
814
 
815
- private function check_ips( $validate, $ips, $which ) {
816
  if ( filter_var( $ip = $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
817
  require_once IP_GEO_BLOCK_PATH . 'includes/Net/IPv4.php';
818
 
819
  foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $ips ) as $i ) {
820
  $j = explode( '/', $i, 2 );
821
 
822
- if ( filter_var( $j[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) &&
823
- Net_IPv4::ipInNetwork( $ip, isset( $j[1] ) ? $i : $i.'/32' ) )
824
- // can't overwrite existing result
825
- return $validate + array( 'result' => $which ? 'extra' : 'passed' );
826
  }
827
  }
828
 
@@ -832,14 +816,13 @@ class IP_Geo_Block {
832
  foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $ips ) as $i ) {
833
  $j = explode( '/', $i, 2 );
834
 
835
- if ( filter_var( $j[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) &&
836
- Net_IPv6::isInNetmask( $ip, isset( $j[1] ) ? $i : $i.'/128' ) )
837
- // can't overwrite existing result
838
- return $validate + array( 'result' => $which ? 'extra' : 'passed' );
839
  }
840
  }
841
 
842
- return $validate;
843
  }
844
 
845
  /**
@@ -959,8 +942,7 @@ class IP_Geo_Block {
959
  }
960
 
961
  elseif ( preg_match( '!^[a-f\d\.:/]+$!', $code = substr( $pat, strpos( $pat, $code ) ) ) ) {
962
- $name = $this->check_ips( $validate, $code, $which );
963
- if ( $not xor isset( $name['result'] ) )
964
  return $validate + array( 'result' => $which ? 'blocked' : 'passed' );
965
  }
966
  }
@@ -970,12 +952,12 @@ class IP_Geo_Block {
970
  }
971
 
972
  /**
973
- * Handlers of cron job
974
  *
975
  */
976
- public function update_database( $immediate = FALSE ) {
977
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-cron.php';
978
- return IP_Geo_Block_Cron::exec_job( $immediate );
979
  }
980
 
981
  public function exec_cache_gc() {
15
  * Unique identifier for this plugin.
16
  *
17
  */
18
+ const VERSION = '3.0.4.6';
19
  const GEOAPI_NAME = 'ip-geo-api';
20
  const PLUGIN_NAME = 'ip-geo-block';
21
  const OPTION_NAME = 'ip_geo_block_settings';
38
  *
39
  */
40
  private function __construct() {
41
+ // Run the loader to execute all of the hooks with WordPress.
42
+ $this->register_hooks( $loader = new IP_Geo_Block_Loader() );
43
+ $loader->run( $this );
44
+ unset( $loader );
45
+ }
46
+
47
+ /**
48
+ * Setup actions after init.
49
+ *
50
+ */
51
+ private function register_hooks( $loader ) {
52
  $settings = self::get_option();
53
  $priority = $settings['priority' ];
54
  $validate = $settings['validation'];
 
55
 
56
  // get client IP address
57
  self::$remote_addr = IP_Geo_Block_Util::get_client_ip( $validate['proxy'] );
114
  if ( $validate['public'] || ( ! empty( $_FILES ) && $validate['mimetype'] ) /* && 'index.php' === $this->pagenow */ )
115
  $loader->add_action( 'init', array( $this, 'validate_public' ), $priority );
116
 
117
+ // message text on comment form
118
+ if ( $settings['comment']['pos'] ) {
119
+ $key = ( 1 === (int)$settings['comment']['pos'] ? '_top' : '' );
120
+ add_action( 'comment_form' . $key, array( $this, 'comment_form_message' ) );
121
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
+ if ( $validate['comment'] ) {
124
+ add_action( 'pre_comment_on_post', array( $this, 'validate_comment' ), $priority ); // wp-comments-post.php @since 2.8.0
125
+ add_action( 'pre_trackback_post', array( $this, 'validate_comment' ), $priority ); // wp-trackback.php @since 4.7.0
126
+ add_filter( 'preprocess_comment', array( $this, 'validate_comment' ), $priority ); // wp-includes/comment.php @since 1.5.0
127
 
128
+ // bbPress: prevent creating topic/relpy and rendering form
129
+ add_action( 'bbp_post_request_bbp-new-topic', array( $this, 'validate_comment' ), $priority );
130
+ add_action( 'bbp_post_request_bbp-new-reply', array( $this, 'validate_comment' ), $priority );
131
+ add_filter( 'bbp_current_user_can_access_create_topic_form', array( $this, 'validate_front' ), $priority );
132
+ add_filter( 'bbp_current_user_can_access_create_reply_form', array( $this, 'validate_front' ), $priority );
133
+ }
134
 
135
+ if ( $validate['login'] ) {
136
+ // for hide/rename wp-login.php, BuddyPress: prevent registration and rendering form
137
+ add_action( 'login_init', array( $this, 'validate_login' ), $priority );
138
 
139
+ // only when block on front-end is disabled
140
+ if ( ! $validate['public'] ) {
141
+ add_action( 'bp_core_screen_signup', array( $this, 'validate_login' ), $priority );
142
+ add_action( 'bp_signup_pre_validate', array( $this, 'validate_login' ), $priority );
143
+ }
144
+ }
145
 
146
+ // the action hook which will be fired by cron job
147
+ if ( $settings['update']['auto'] )
148
+ add_action( self::CRON_NAME, array( $this, 'exec_update_db' ) );
 
149
 
150
+ // garbage collection for IP address cache, enque script for authentication
151
+ add_action( self::CACHE_NAME, array( $this, 'exec_cache_gc' ) );
152
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_nonce' ), $priority ); // @since 2.8.0
 
 
153
  }
154
 
155
+ // force to redirect on logout to remove nonce, embed a nonce into pages
156
+ add_filter( 'wp_redirect', array( $this, 'logout_redirect' ), 20, 2 ); // logout_redirect @4.2
157
+ add_filter( 'http_request_args', array( $this, 'request_nonce' ), $priority, 2 ); // @since 2.7.0
 
 
 
 
 
 
 
158
  }
159
 
160
  /**
220
  */
221
  public static function enqueue_nonce() {
222
  if ( is_user_logged_in() ) {
223
+ $args['sites'] = IP_Geo_Block_Util::get_multisite();
224
+ $args['nonce'] = IP_Geo_Block_Util::create_nonce( $handle = self::PLUGIN_NAME . '-auth-nonce' );
225
+
226
+ // target of wp-zep
227
+ $settings = self::get_option();
228
+ foreach ( array( 'ajax', 'admin', 'plugins', 'themes' ) as $key ) {
229
+ $args['zep'][ $key ] = (bool)( $settings['validation'][ $key ] & 2 );
230
+ }
231
+
232
+ // authentication
233
  $script = plugins_url(
234
  ! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
235
  'admin/js/authenticate.min.js' : 'admin/js/authenticate.js', IP_GEO_BLOCK_BASE
236
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
 
238
  wp_enqueue_script( $handle, $script, array( 'jquery' ), self::VERSION );
239
+ wp_localize_script( $handle, 'IP_GEO_BLOCK_AUTH', $args + self::$wp_path );
240
  }
241
  }
242
 
274
  *
275
  */
276
  private static function make_validation( $ip, $result ) {
277
+ // later parameters take precedence over previous ones
278
  return array_merge( array(
279
  'ip' => $ip,
280
+ 'asn' => NULL, // @since 3.0.4
281
+ 'code' => 'ZZ', // should be overwritten with $result
282
+ ), $result, array( 'auth' => IP_Geo_Block_Util::get_current_user_id() ) );
283
  }
284
 
285
  /**
296
  if ( empty( $providers ) ) // make valid providers list
297
  $providers = IP_Geo_Block_Provider::get_valid_providers( $settings['providers'] );
298
 
299
+ $result = self::_get_geolocation( $ip ? $ip : self::get_ip_address(), $settings, $providers, array(), $callback );
300
 
301
  if ( ! empty( $result['countryCode'] ) )
302
  $result['code'] = $result['countryCode'];
308
  * API for internal.
309
  *
310
  */
311
+ private static function _get_geolocation( $ip, $settings, $providers, $args = array(), $callback = 'get_country' ) {
312
  // check loop back / private address
313
  if ( IP_Geo_Block_Util::is_private_ip( $ip ) )
314
  return self::make_validation( $ip, array( 'time' => 0, 'provider' => 'Private', 'code' => 'XX' ) );
315
 
316
  // set arguments for wp_remote_get()
317
+ $args += self::get_request_headers( $settings );
318
 
319
  foreach ( $providers as $provider ) {
320
  $time = microtime( TRUE );
321
  if ( ( $geo = IP_Geo_Block_API::get_instance( $provider, $settings ) ) &&
322
  ( $code = $geo->$callback( $ip, $args ) ) ) {
323
+ // Get AS number @since 3.0.4
324
+ if ( ( $settings['Maxmind']['use_asn'] ) && ( ! isset( $code['asn'] ) || 0 !== strpos( $code['asn'], 'AS' ) ) &&
325
+ ( $geo = IP_Geo_Block_API::get_instance( 'Maxmind', $settings ) ) ) {
326
+ $asn = $geo->get_location( $ip, array( 'ASN' => TRUE ) );
327
+ $asn = isset( $asn['ASN'] ) ? strtok( $asn['ASN'], ' ' ) : NULL;
328
+ }
329
+
330
  return self::make_validation( $ip, array(
331
+ 'time' => microtime( TRUE ) - $time,
332
  'provider' => $provider,
333
+ ) + ( is_array( $code ) ? $code : array( 'code' => $code, 'asn' => isset( $asn ) ? $asn : NULL ) ) );
334
  }
335
  }
336
 
366
  public function send_response( $hook, $validate, $settings ) {
367
  require_once ABSPATH . WPINC . '/functions.php'; // for get_status_header_desc() @since 2.3.0
368
 
 
 
 
369
  $code = (int )apply_filters( self::PLUGIN_NAME . '-'.$hook.'-status', $settings['response_code'] );
370
  $mesg = (string)apply_filters( self::PLUGIN_NAME . '-'.$hook.'-reason', $settings['response_msg' ] ? $settings['response_msg'] : get_status_header_desc( $code ) );
371
 
372
  // custom action (for fail2ban) @since 1.2.0
373
  do_action( self::PLUGIN_NAME . '-send-response', $hook, $code, $validate );
374
 
375
+ // prevent caching (WP Super Cache, W3TC, Wordfence, Comet Cache)
376
+ defined( 'DONOTCACHEPAGE' ) or define( 'DONOTCACHEPAGE', TRUE );
377
  nocache_headers(); // wp-includes/functions.php @since 2.0.0
378
 
379
  if ( defined( 'XMLRPC_REQUEST' ) && 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
421
  /**
422
  * Validate ip address.
423
  *
424
+ * @param string $hook a name to identify action hook applied in this call.
425
+ * @param array $settings option settings
426
+ * @param boolean $block block if validation fails (for simulate)
427
+ * @param boolean $die send http response and die if validation fails (for validate_front )
428
+ * @param boolean $check_auth save log and block if validation fails (for admin dashboard)
429
  */
430
+ public function validate_ip( $hook, $settings, $block = TRUE, $die = TRUE, $check_auth = TRUE ) {
 
 
 
431
  // register auxiliary validation functions
432
  // priority high 4 close_xmlrpc, close_restapi
433
  // 5 check_nonce (high), check_user (low)
434
  // 6 check_upload (high), check_signature (low)
435
+ // 7 check_ips_black (high), check_ips_white (low)
436
+ // 8 check_auth
437
+ // 9 check_fail
438
  // priority low 10 validate_country
439
  $var = self::PLUGIN_NAME . '-' . $hook;
440
+ $settings['validation']['mimetype' ] and add_filter( $var, array( $this, 'check_upload' ), 6, 2 );
441
+ $settings['extra_ips' ] = apply_filters( self::PLUGIN_NAME . '-extra-ips', $settings['extra_ips'], $hook );
442
+ $settings['extra_ips' ]['black_list'] and add_filter( $var, array( $this, 'check_ips_black' ), 7, 2 );
443
+ $settings['extra_ips' ]['white_list'] and add_filter( $var, array( $this, 'check_ips_white' ), 7, 2 );
444
+ $check_auth and add_filter( $var, array( $this, 'check_auth' ), 8, 2 );
445
+ $settings['login_fails'] >= 0 and add_filter( $var, array( $this, 'check_fail' ), 9, 2 );
446
 
447
  // make valid provider name list
448
  $providers = IP_Geo_Block_Provider::get_valid_providers( $settings['providers'] );
455
  // 'code' => $code, /* country code or reason of rejection */
456
  // 'result' => $result, /* 'passed', 'blocked' */
457
  // );
458
+ $ips = IP_Geo_Block_Util::retrieve_ips( array( self::get_ip_address() ), $settings['validation']['proxy'] );
459
  foreach ( $ips as self::$remote_addr ) {
460
+ $validate = self::_get_geolocation( self::$remote_addr, $settings, $providers, array( 'cache' => TRUE ) );
461
  $validate = apply_filters( $var, $validate, $settings );
462
 
463
  // if no 'result' then validate ip address by country
469
  break;
470
  }
471
 
472
+ if ( $check_auth ) {
473
  // record log (0:no, 1:blocked, 2:passed, 3:unauth, 4:auth, 5:all)
474
  $var = (int)apply_filters( self::PLUGIN_NAME . '-record-logs', $settings['validation']['reclogs'], $hook, $validate );
475
  $block = ( 'passed' !== $validate['result'] );
539
  */
540
  public function validate_login() {
541
  // parse action
542
+ $action = isset( $_GET['key'] ) ? 'resetpass' : ( isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login' );
543
+ $action = 'retrievepassword' === $action ? 'lostpassword' : ( 'rp' === $action ? 'resetpass' : $action );
 
 
 
 
 
544
 
545
  $settings = self::get_option();
546
  $list = $settings['login_action'];
548
  // the same rule should be applied to login and logout
549
  ! empty( $list['login'] ) and $list['logout'] = TRUE;
550
 
551
+ // avoid conflict with WP Limit Login Attempts (wp-includes/pluggable.php @since 2.5.0)
552
+ ! empty( $_POST ) and add_action( 'wp_login_failed', array( $this, 'auth_fail' ), $settings['priority'] );
553
 
554
  // enables to skip validation of country on login/out except BuddyPress signup
555
  $this->validate_ip( 'login', $settings, ! empty( $list[ $action ] ) || 'bp_' === substr( current_filter(), 0, 3 ) );
562
  private function check_exceptions( $action, $page, $exceptions = array() ) {
563
  $in_action = in_array( $action, $exceptions, TRUE );
564
  $in_page = in_array( $page, $exceptions, TRUE );
 
565
  return ( ( $action xor $page ) && ( ! $in_action and ! $in_page ) ) ||
566
  ( ( $action and $page ) && ( ! $in_action or ! $in_page ) ) ? FALSE : TRUE;
567
  }
597
  }
598
 
599
  // list of request for specific action or page to bypass WP-ZEP
600
+ $list = array_merge( apply_filters( self::PLUGIN_NAME . '-bypass-admins', array(), $settings ), array(
601
+ // in wp-admin js/widget.js, includes/template.php, async-upload.php
602
+ 'heartbeat', 'save-widget', 'wp-compression-test', 'upload-attachment', 'imgedit-preview',
603
+ // bbPress, Anti-Malware Security and Brute-Force Firewall, jetpack page & action
604
+ 'bp_avatar_upload', 'GOTMLS_logintime', 'jetpack', 'authorize', 'jetpack_modules', 'atd_settings', 'bulk-activate', 'bulk-deactivate',
605
+ ) );
 
606
 
607
  // skip validation of country code and WP-ZEP if exceptions matches action or page
608
  if ( ( $page || $action ) && $this->check_exceptions( $action, $page, $settings['exception']['admin'] ) )
643
 
644
  // list of request for specific action or page to bypass WP-ZEP
645
  $path = array( 'includes' => array( 'ms-files.php', 'js/tinymce/wp-tinymce.php', ), /* for wp-includes */ );
646
+ $path = apply_filters( self::PLUGIN_NAME . "-bypass-{$type}", isset( $path[ $type ] ) ? $path[ $type ] : array(), $settings );
647
 
648
  // skip validation of country code if exceptions matches action or page
649
  if ( in_array( $name, $settings['exception'][ $type ], TRUE ) )
675
  */
676
  public function auth_fail( $something = NULL ) {
677
  // Count up a number of fails when authentication is failed
678
+ $time = microtime( TRUE );
679
  if ( $cache = IP_Geo_Block_API_Cache::get_cache( self::$remote_addr ) ) {
680
  $validate = self::make_validation( self::$remote_addr, array(
681
+ 'result' => 'failed', // count up $cache['fail'] in update_cache()
 
 
682
  'provider' => 'Cache',
683
+ 'time' => microtime( TRUE ) - $time,
684
+ ) + $cache );
685
 
686
  $settings = self::get_option();
687
+ $cache = IP_Geo_Block_API_Cache::update_cache( $hook = defined( 'XMLRPC_REQUEST' ) ? 'xmlrpc' : 'login', $validate, $settings );
688
 
689
+ // the whitelist of IP address should be prior
690
+ if ( ! $this->check_ips( $validate, $settings['extra_ips']['white_list'] ) ) {
691
+ if ( (int)$settings['login_fails'] >= 0 && $cache['fail'] > max( 0, (int)$settings['login_fails'] ) )
692
+ $validate['result'] = 'limited';
693
 
694
+ // validate xmlrpc system.multicall
695
+ elseif ( defined( 'XMLRPC_REQUEST' ) && FALSE !== stripos( file_get_contents( 'php://input' ), 'system.multicall' ) )
696
+ $validate['result'] = 'multi';
697
+ }
698
 
699
+ // apply filter hook for emergent functionality
700
+ $validate = apply_filters( self::PLUGIN_NAME . '-login', $validate, $settings );
701
 
702
  // (1) blocked, (3) unauthenticated, (5) all
703
  if ( 1 & (int)$settings['validation']['reclogs'] )
704
+ IP_Geo_Block_Logs::record_logs( $hook, $validate, $settings );
705
 
706
  // send response code to refuse immediately
707
+ if ( 'limited' === $validate['result'] || 'multi' === $validate['result'] ) {
708
  if ( $settings['save_statistics'] )
709
+ IP_Geo_Block_Logs::update_stat( $hook, $validate, $settings );
710
 
711
+ $this->send_response( $hook, $validate, $settings );
712
  }
713
  }
714
 
718
  public function check_fail( $validate, $settings ) {
719
  // check if number of fails reaches the limit. can't overwrite existing result.
720
  $cache = IP_Geo_Block_API_Cache::get_cache( $validate['ip'] );
721
+ return $cache && $cache['fail'] > max( 0, (int)$settings['login_fails'] ) ? $validate + array( 'result' => 'limited' ) : $validate;
722
  }
723
 
724
  public function check_auth( $validate, $settings ) {
743
  if ( $sig && FALSE !== strpos( $query, $sig ) ) {
744
  if ( preg_match( '!\W!', $sig ) || // ex) `../` or `/wp-config.php`
745
  preg_match( '!\b' . preg_quote( $sig, '!' ) . '\b!', $query ) ) {
746
+ if ( ( $score += ( empty( $val[1] ) ? 1.0 : (float)$val[1] ) ) > 0.99 )
 
747
  return $validate + array( 'result' => 'badsig' ); // can't overwrite existing result
 
748
  }
749
  }
750
  }
757
  * @see wp_handle_upload() in wp-admin/includes/file.php
758
  */
759
  public function check_upload( $validate, $settings ) {
760
+ if ( ! empty( $_FILES ) && $settings['validation']['mimetype'] ) {
761
  // check capability
762
+ $files = empty( $settings['mimetype']['capability'] ) ? TRUE : FALSE; // skip if empty
763
+ foreach ( $settings['mimetype']['capability'] as $file ) {
764
+ if ( empty( $file ) || IP_Geo_Block_Util::current_user_can( $file ) ) {
765
+ $files = TRUE;
 
 
 
 
 
 
 
 
 
766
  break;
767
  }
768
  }
769
 
770
+ // when a user does not have the capability, then block
771
+ if ( ! apply_filters( self::PLUGIN_NAME . '-upload-capability', $files ) )
772
+ return apply_filters( self::PLUGIN_NAME . '-upload-forbidden', $validate + array( 'upload' => TRUE, 'result' => 'upload' ) );
773
+
774
+ foreach ( $_FILES as $files ) {
775
+ foreach ( IP_Geo_Block_Util::arrange_files( $files ) as $file ) {
776
+ // check $_FILES corruption attack or mime type and extension
777
+ if ( ! empty( $file['name'] ) && UPLOAD_ERR_OK !== $file['error'] ||
778
+ ! IP_Geo_Block_Util::check_filetype_and_ext( $file, $settings['validation']['mimetype'], $settings['mimetype'] ) ) {
779
+ return apply_filters( self::PLUGIN_NAME . '-upload-forbidden', $validate + array( 'upload' => TRUE, 'result' => 'upload' ) );
780
+ }
781
+ }
782
  }
783
  }
784
 
790
  *
791
  */
792
  public function check_ips_white( $validate, $settings ) {
793
+ return $this->check_ips( $validate, $settings['extra_ips']['white_list'] ) ? $validate + array( 'result' => 'passed' ) : $validate;
794
  }
795
 
796
  public function check_ips_black( $validate, $settings ) {
797
+ return $this->check_ips( $validate, $settings['extra_ips']['black_list'] ) ? $validate + array( 'result' => 'extra' ) : $validate;
798
  }
799
 
800
+ private function check_ips( $validate, $ips ) {
801
  if ( filter_var( $ip = $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
802
  require_once IP_GEO_BLOCK_PATH . 'includes/Net/IPv4.php';
803
 
804
  foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $ips ) as $i ) {
805
  $j = explode( '/', $i, 2 );
806
 
807
+ if ( ( ! empty( $validate['asn'] ) && $validate['asn'] === $j[0] ) ||
808
+ ( filter_var( $j[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) && Net_IPv4::ipInNetwork( $ip, isset( $j[1] ) ? $i : $i.'/32' ) ) )
809
+ return TRUE;
 
810
  }
811
  }
812
 
816
  foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $ips ) as $i ) {
817
  $j = explode( '/', $i, 2 );
818
 
819
+ if ( ( ! empty( $validate['asn'] ) && $validate['asn'] === $j[0] ) ||
820
+ ( filter_var( $j[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) && Net_IPv6::isInNetmask( $ip, isset( $j[1] ) ? $i : $i.'/128' ) ) )
821
+ return TRUE;
 
822
  }
823
  }
824
 
825
+ return FALSE;
826
  }
827
 
828
  /**
942
  }
943
 
944
  elseif ( preg_match( '!^[a-f\d\.:/]+$!', $code = substr( $pat, strpos( $pat, $code ) ) ) ) {
945
+ if ( $not xor $this->check_ips( $validate, $code ) )
 
946
  return $validate + array( 'result' => $which ? 'blocked' : 'passed' );
947
  }
948
  }
952
  }
953
 
954
  /**
955
+ * Handlers of cron job for database and garbage collection for cache
956
  *
957
  */
958
+ public function exec_update_db( $immediate = FALSE ) {
959
  require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-cron.php';
960
+ return IP_Geo_Block_Cron::exec_update_db( $immediate );
961
  }
962
 
963
  public function exec_cache_gc() {
ip-geo-block.php CHANGED
@@ -13,7 +13,7 @@
13
  * Plugin Name: IP Geo Block
14
  * Plugin URI: http://wordpress.org/plugins/ip-geo-block/
15
  * Description: It blocks any spams, login attempts and malicious access to the admin area posted from outside your nation, and also prevents zero-day exploit.
16
- * Version: 3.0.3.4
17
  * Author: tokkonopapa
18
  * Author URI: http://www.ipgeoblock.com/
19
  * Text Domain: ip-geo-block
@@ -22,8 +22,7 @@
22
  * Domain Path: /languages
23
  */
24
 
25
- // If this file is called directly, abort.
26
- defined( 'WPINC' ) or die;
27
 
28
  if ( ! class_exists( 'IP_Geo_Block', FALSE ) ):
29
 
@@ -64,6 +63,22 @@ function ip_geo_block_deactivate( $network_wide = FALSE ) {
64
  register_activation_hook( __FILE__, 'ip_geo_block_activate' );
65
  register_deactivation_hook( __FILE__, 'ip_geo_block_deactivate' );
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  * Instantiate class
69
  *
@@ -93,12 +108,13 @@ if ( is_admin() ) {
93
  * How to use: Activate the following code and upload this file via FTP.
94
  */
95
  /* -- ADD `/` TO THE TOP OR END OF THIS LINE TO ACTIVATE THE FOLLOWINGS -- *
96
- function ip_geo_block_emergency( $validate ) {
97
  $validate['result'] = 'passed';
98
  return $validate;
99
  }
100
- add_filter( 'ip-geo-block-login', 'ip_geo_block_emergency' );
101
- add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency' );
 
102
  // */
103
 
104
  endif; // ! class_exists( 'IP_Geo_Block', FALSE )
13
  * Plugin Name: IP Geo Block
14
  * Plugin URI: http://wordpress.org/plugins/ip-geo-block/
15
  * Description: It blocks any spams, login attempts and malicious access to the admin area posted from outside your nation, and also prevents zero-day exploit.
16
+ * Version: 3.0.4.6
17
  * Author: tokkonopapa
18
  * Author URI: http://www.ipgeoblock.com/
19
  * Text Domain: ip-geo-block
22
  * Domain Path: /languages
23
  */
24
 
25
+ defined( 'WPINC' ) or die; // If this file is called directly, abort.
 
26
 
27
  if ( ! class_exists( 'IP_Geo_Block', FALSE ) ):
28
 
63
  register_activation_hook( __FILE__, 'ip_geo_block_activate' );
64
  register_deactivation_hook( __FILE__, 'ip_geo_block_deactivate' );
65
 
66
+ /**
67
+ * check version and update before instantiation
68
+ *
69
+ * @see https://make.wordpress.org/core/2010/10/27/plugin-activation-hooks/
70
+ * @see https://wordpress.stackexchange.com/questions/144870/wordpress-update-plugin-hook-action-since-3-9
71
+ */
72
+ function ip_geo_block_update() {
73
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
74
+ $settings = IP_Geo_Block::get_option();
75
+ if ( version_compare( $settings['version'], IP_Geo_Block::VERSION ) < 0 ) {
76
+ ip_geo_block_activate( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) );
77
+ }
78
+ }
79
+
80
+ add_action( 'plugins_loaded', 'ip_geo_block_update' );
81
+
82
  /**
83
  * Instantiate class
84
  *
108
  * How to use: Activate the following code and upload this file via FTP.
109
  */
110
  /* -- ADD `/` TO THE TOP OR END OF THIS LINE TO ACTIVATE THE FOLLOWINGS -- *
111
+ function ip_geo_block_emergency( $validate, $settings ) {
112
  $validate['result'] = 'passed';
113
  return $validate;
114
  }
115
+ add_filter( 'ip-geo-block-login', 'ip_geo_block_emergency', 1, 2 );
116
+ add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency', 1, 2 );
117
+ add_filter( 'ip-geo-block-public', 'ip_geo_block_emergency', 1, 2 );
118
  // */
119
 
120
  endif; // ! class_exists( 'IP_Geo_Block', FALSE )
languages/ip-geo-block-ja.mo CHANGED
Binary file
languages/ip-geo-block-ja.po CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: IP Geo Block 3.0.3.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
- "POT-Creation-Date: 2017-07-21 22:43+0900\n"
8
- "PO-Revision-Date: 2017-07-21 22:51+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -27,53 +27,64 @@ msgstr ""
27
  "自国以外から投稿されるスパム、ログインフォーム、さらにゼロデイ攻撃を含む管理"
28
  "領域への悪意あるアクセスからサイトを守ります。"
29
 
30
- #: admin/class-ip-geo-block-admin.php:227
31
  msgid "Import settings ?"
32
  msgstr "設定をインポートしますか?"
33
 
34
- #: admin/class-ip-geo-block-admin.php:228
35
  msgid "Create table ?"
36
  msgstr "テーブルを作成しますか?"
37
 
38
- #: admin/class-ip-geo-block-admin.php:229
39
  msgid "Delete table ?"
40
  msgstr "テーブルを削除しますか?"
41
 
42
- #: admin/class-ip-geo-block-admin.php:230
43
  msgid "Clear statistics ?"
44
  msgstr "統計をクリアしますか?"
45
 
46
- #: admin/class-ip-geo-block-admin.php:231
47
  msgid "Clear cache ?"
48
  msgstr "キャッシュをクリアしますか?"
49
 
50
- #: admin/class-ip-geo-block-admin.php:232
51
  msgid "Clear logs ?"
52
  msgstr "ログをクリアしますか?"
53
 
54
- #: admin/class-ip-geo-block-admin.php:233
 
 
 
 
 
 
 
 
55
  msgid "This feature is available with HTML5 compliant browsers."
56
  msgstr "HTML5準拠のブラウザでのみ機能します。"
57
 
58
- #: admin/class-ip-geo-block-admin.php:246
59
  msgid "Contribute at GitHub"
60
  msgstr "開発に参加"
61
 
62
- #: admin/class-ip-geo-block-admin.php:263
63
- #: admin/class-ip-geo-block-admin.php:508
 
64
  msgid "Settings"
65
  msgstr "設定"
66
 
67
- #: admin/class-ip-geo-block-admin.php:318
68
- #: admin/class-ip-geo-block-admin.php:319
 
 
69
  msgid "IP Geo Block"
70
  msgstr "IP Geo Block"
71
 
72
- #: admin/class-ip-geo-block-admin.php:340
73
  msgid "You need WordPress 3.7+."
74
  msgstr "WordPress 3.7&thinsp;以上が必要です。"
75
 
76
- #: admin/class-ip-geo-block-admin.php:346
77
  #, php-format
78
  msgid ""
79
  "Now downloading geolocation databases in background. After a little while, "
@@ -84,7 +95,7 @@ msgstr ""
84
  "いた後、あなたの国コードと「<strong>マッチング規則</strong>」を「<a href=\"%s"
85
  "\">検証ルールの設定</a>」で確認して下さい。"
86
 
87
- #: admin/class-ip-geo-block-admin.php:352
88
  #, php-format
89
  msgid ""
90
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
@@ -93,11 +104,11 @@ msgstr ""
93
  "「<strong>マッチング規則</strong>」が正しく設定されていません。「<a href=\"%s"
94
  "\">検証ルールの設定</a>」を確認して下さい。"
95
 
96
- #: admin/class-ip-geo-block-admin.php:361
97
  msgid "Local database and matching rule have been updated."
98
  msgstr "ローカル・データベースとマッチング規則を更新しました。"
99
 
100
- #: admin/class-ip-geo-block-admin.php:372
101
  msgid ""
102
  "Once you logout, you will be unable to login again because the number of "
103
  "login attempts reaches the limit."
@@ -105,7 +116,7 @@ msgstr ""
105
  "あなたのIPアドレスのログイン試行可能回数がリミットに達したため、ログアウトす"
106
  "ると再びログインする事が出来なくなります。"
107
 
108
- #: admin/class-ip-geo-block-admin.php:374
109
  #, php-format
110
  msgid ""
111
  "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
@@ -114,7 +125,7 @@ msgstr ""
114
  "<a href=\"%s\">「統計」タブ</a>の \"<strong>キャッシュのクリア</strong>\" を"
115
  "実行し、ロックアウトを回避してください。"
116
 
117
- #: admin/class-ip-geo-block-admin.php:384
118
  msgid ""
119
  "Once you logout, you will be unable to login again because your country code "
120
  "or IP address is in the blacklist."
@@ -122,7 +133,7 @@ msgstr ""
122
  "あなたの国コードまたはIPアドレスがブラックリストに含まれているため、ログアウ"
123
  "トすると再びログインする事が出来なくなります。"
124
 
125
- #: admin/class-ip-geo-block-admin.php:385
126
  msgid ""
127
  "Once you logout, you will be unable to login again because your country code "
128
  "or IP address is not in the whitelist."
@@ -130,12 +141,12 @@ msgstr ""
130
  "あなたの国コードまたはIPアドレスがホワイトリストに含まれていないため、ログア"
131
  "ウトすると再びログインする事が出来なくなります。"
132
 
133
- #: admin/class-ip-geo-block-admin.php:388
134
  #, php-format
135
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
136
  msgstr "「<a href=\"%s\">検証ルールの設定</a>」を確認して下さい。"
137
 
138
- #: admin/class-ip-geo-block-admin.php:399
139
  msgid ""
140
  "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
141
  "timing&#8221; is imcompatible with <strong>IP Geo Allow</strong>. Please "
@@ -145,31 +156,40 @@ msgstr ""
145
  "択されていますが、<strong>IP Geo Allow</strong> と互換性がありません。"
146
  "「&#8220;init&#8221; アクション・フック」を選択してください。"
147
 
148
- #: admin/class-ip-geo-block-admin.php:509
149
  msgid "Statistics"
150
  msgstr "統計"
151
 
152
- #: admin/class-ip-geo-block-admin.php:510
153
  msgid "Logs"
154
  msgstr "ログ"
155
 
156
- #: admin/class-ip-geo-block-admin.php:511
157
  msgid "Search"
158
  msgstr "検索"
159
 
160
- #: admin/class-ip-geo-block-admin.php:512
 
 
 
 
 
161
  msgid "Attribution"
162
  msgstr "リンク"
163
 
164
- #: admin/class-ip-geo-block-admin.php:522
 
 
 
 
165
  msgid "Toggle all"
166
  msgstr "全てを開閉"
167
 
168
- #: admin/class-ip-geo-block-admin.php:544
169
  msgid "Thanks for providing these great services for free."
170
  msgstr "これらのすばらしいサービスの提供元に、敬意と感謝の意を表します!"
171
 
172
- #: admin/class-ip-geo-block-admin.php:545
173
  msgid ""
174
  "(Most browsers will redirect you to each site <a href=\"http://www."
175
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
@@ -179,128 +199,143 @@ msgstr ""
179
  "html\" title=\"Referer Checker\">参照元を残さずにリンク先にリダイレクトできま"
180
  "す</a>。)"
181
 
182
- #: admin/class-ip-geo-block-admin.php:550
183
  msgid "Back to top"
184
  msgstr "トップに戻る"
185
 
186
- #: admin/class-ip-geo-block-admin.php:646
187
  msgid "Enable"
188
  msgstr "有効"
189
 
190
- #: admin/class-ip-geo-block-admin.php:1030
191
- #: classes/class-ip-geo-block-cron.php:274
192
- #: classes/class-ip-geo-block-cron.php:306
193
- #, php-format
194
- msgid "Unable to write %s. Please check the permission."
195
- msgstr "%s に書き込めません。パーミッションを確認して下さい。"
196
-
197
- #: admin/class-ip-geo-block-admin.php:1031
198
- #, php-format
199
- msgid "Or please refer to %s to set it manually."
200
- msgid_plural "Or please refer to %s to set them manually."
201
- msgstr[0] "あるいは %s を参照し、手動で設定して下さい。"
202
- msgstr[1] "あるいは %s を参照し、手動で設定して下さい。"
203
-
204
- #: admin/class-ip-geo-block-admin.php:1041
205
- #: classes/class-ip-geo-block-opts.php:385
206
  #, php-format
207
  msgid "Unable to write <code>%s</code>. Please check the permission."
208
- msgstr "<code>%s</code> に書き込めません。パーミションをチェックしてください。"
 
 
 
 
209
 
210
- #: admin/includes/class-admin-ajax.php:60
211
  msgid "n/a"
212
  msgstr "n/a"
213
 
214
- #: admin/includes/class-admin-ajax.php:63 admin/includes/tab-settings.php:81
215
- #: admin/includes/tab-settings.php:101
216
  msgid "UNKNOWN"
217
  msgstr "不明"
218
 
219
- #: admin/includes/class-admin-ajax.php:244
220
  #, php-format
221
  msgid ""
222
  "illegal format at %s. Please delete the corresponding line and try again."
223
- msgstr "%s は誤ったフォーマットです。該当行を削除し、再度、実行してください。"
224
 
225
- #: admin/includes/tab-accesslog.php:20 admin/includes/tab-accesslog.php:99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  msgid "Validation logs"
227
  msgstr "検証のログ"
228
 
229
- #: admin/includes/tab-accesslog.php:29
230
  msgid "Filter logs"
231
  msgstr "ログをフィルタ"
232
 
233
- #: admin/includes/tab-accesslog.php:38
234
  msgid "Reset"
235
  msgstr "リセット"
236
 
237
- #: admin/includes/tab-accesslog.php:45
238
  msgid "Clear logs"
239
  msgstr "ログのクリア"
240
 
241
- #: admin/includes/tab-accesslog.php:53 admin/includes/tab-statistics.php:173
242
- #: admin/includes/tab-statistics.php:277
243
  msgid "Clear now"
244
  msgstr "今すぐクリア"
245
 
246
- #: admin/includes/tab-accesslog.php:61
247
  msgid "Export logs"
248
  msgstr "ログをエクスポート"
249
 
250
- #: admin/includes/tab-accesslog.php:67 admin/includes/tab-settings.php:1450
251
  msgid "Export to the local file"
252
  msgstr "ローカル・ファイルにエクスポートする"
253
 
254
- #: admin/includes/tab-accesslog.php:67
255
  msgid "Export csv"
256
  msgstr "CSVをエクスポート"
257
 
258
- #: admin/includes/tab-accesslog.php:73
259
  #, php-format
260
  msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
261
  msgstr "<dfn title=\"%s に対するリクエストの検証ログです。\">%s</dfn>"
262
 
263
- #: admin/includes/tab-accesslog.php:75 admin/includes/tab-settings.php:453
264
  msgid "Comment post"
265
  msgstr "コメント投稿"
266
 
267
- #: admin/includes/tab-accesslog.php:76 admin/includes/tab-settings.php:454
268
  msgid "XML-RPC"
269
  msgstr "XML-RPC"
270
 
271
- #: admin/includes/tab-accesslog.php:77 admin/includes/tab-settings.php:455
272
  msgid "Login form"
273
  msgstr "ログイン・フォーム"
274
 
275
- #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:456
276
  msgid "Admin area"
277
  msgstr "管理領域"
278
 
279
- #: admin/includes/tab-accesslog.php:79 admin/includes/tab-settings.php:458
280
  msgid "public facing pages"
281
  msgstr "一般公開ページ"
282
 
283
- #: admin/includes/tab-accesslog.php:79 admin/includes/tab-settings.php:458
284
  msgid "Public facing pages"
285
  msgstr "一般公開ページ"
286
 
287
- #: admin/includes/tab-accesslog.php:132
288
  msgid "Date"
289
  msgstr "日時"
290
 
291
- #: admin/includes/tab-accesslog.php:133 admin/includes/tab-geolocation.php:67
292
- #: admin/includes/tab-statistics.php:219
293
  msgid "IP address"
294
  msgstr "IPアドレス"
295
 
296
- #: admin/includes/tab-accesslog.php:134
297
  msgid "Code"
298
  msgstr "国"
299
 
300
- #: admin/includes/tab-accesslog.php:135
301
  msgid "Result"
302
  msgstr "判定"
303
 
 
 
 
 
304
  #: admin/includes/tab-accesslog.php:136
305
  msgid "Request"
306
  msgstr "リクエスト"
@@ -350,11 +385,11 @@ msgstr "位置情報の検索"
350
  msgid "Search now"
351
  msgstr "今すぐ検索"
352
 
353
- #: admin/includes/tab-settings.php:49
354
  msgid "Validation rule settings"
355
  msgstr "検証ルールの設定"
356
 
357
- #: admin/includes/tab-settings.php:73
358
  msgid ""
359
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
360
  "code by referring &#8220;Scan country code&#8221;.\">Your IP address / "
@@ -363,15 +398,15 @@ msgstr ""
363
  "<dfn title=\"「国コードを検索する」を参照し、適切な位置情報APIと国コードを設"
364
  "定して下さい。\">あなたのIPアドレス / 国コード</dfn>"
365
 
366
- #: admin/includes/tab-settings.php:82 admin/includes/tab-settings.php:102
367
  msgid "Scan all the APIs you selected at Geolocation API settings"
368
  msgstr "選択された位置情報APIを検索します"
369
 
370
- #: admin/includes/tab-settings.php:82 admin/includes/tab-settings.php:102
371
  msgid "Scan country code"
372
  msgstr "国コードを検索する"
373
 
374
- #: admin/includes/tab-settings.php:93
375
  msgid ""
376
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
377
  "code by referring &#8220;Scan country code&#8221;.\">Server IP address / "
@@ -380,20 +415,20 @@ msgstr ""
380
  "<dfn title=\"「国コードを検索する」を参照し、適切な位置情報APIと国コードを設"
381
  "定して下さい。\">サーバーのIPアドレス / 国コード</dfn>"
382
 
383
- #: admin/includes/tab-settings.php:110
384
  msgid "Whitelist"
385
  msgstr "ホワイトリスト"
386
 
387
- #: admin/includes/tab-settings.php:111
388
  msgid "Blacklist"
389
  msgstr "ブラックリスト"
390
 
391
- #: admin/includes/tab-settings.php:115
392
  msgid ""
393
  "Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;."
394
  msgstr "「ホワイトリスト」または「ブラックリスト」のいずれかを選択して下さい。"
395
 
396
- #: admin/includes/tab-settings.php:116
397
  msgid ""
398
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
399
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
@@ -408,7 +443,7 @@ msgstr ""
408
  "ないことが必要な場合には、「YY」を指定してください。\">国コードのホワイトリス"
409
  "ト</dfn>"
410
 
411
- #: admin/includes/tab-settings.php:117
412
  msgid ""
413
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
414
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
@@ -423,19 +458,23 @@ msgstr ""
423
  "ないことが必要な場合には、「YY」を指定してください。\">国コードのブラックリス"
424
  "ト</dfn>"
425
 
426
- #: admin/includes/tab-settings.php:121
427
  msgid "(comma separated)"
428
  msgstr "(カンマ区切り)"
429
 
430
- #: admin/includes/tab-settings.php:122
431
  msgid "(comma or RET separated)"
432
  msgstr "(カンマ、または改行区切り)"
433
 
434
- #: admin/includes/tab-settings.php:129 admin/includes/tab-settings.php:789
 
 
 
 
435
  msgid "Matching rule"
436
  msgstr "マッチング規則"
437
 
438
- #: admin/includes/tab-settings.php:141
439
  msgid ""
440
  "A request from which the country code or IP address is <strong>NOT</strong> "
441
  "in the whitelist will be blocked."
@@ -443,7 +482,7 @@ msgstr ""
443
  "国コードまたはIPアドレスがホワイトリストに<strong>含まれていない</strong>リク"
444
  "エストを遮断します。"
445
 
446
- #: admin/includes/tab-settings.php:142
447
  msgid ""
448
  "A request from which the country code or IP address is in the blacklist will "
449
  "be blocked."
@@ -451,16 +490,33 @@ msgstr ""
451
  "国コードまたはIPアドレスがブラックリストに<strong>含まれている</strong>リクエ"
452
  "ストを遮断します。"
453
 
454
- #: admin/includes/tab-settings.php:188
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  msgid ""
456
  "<dfn title=\"e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, "
457
- "&#8220;69.46.36.0/27&#8221; for WordFence server\">Whitelist of extra IP "
458
- "addresses prior to country code</dfn>"
459
  msgstr ""
460
  "<dfn title=\"例)192.0.64.0/18(Jetpackサーバー)、69.46.36.0/27(WordFence"
461
- "サーバー)\">国コードに優先して検証するIPアドレスのホワイトリスト</dfn>"
 
462
 
463
- #: admin/includes/tab-settings.php:207
464
  msgid ""
465
  "<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
466
  "\">Blacklist of extra IP addresses prior to country code</dfn>"
@@ -468,7 +524,7 @@ msgstr ""
468
  "<dfn title=\"サーバー・レベルのアクセス制御の使用をお勧めします(例:."
469
  "htaccess)。\">国コードに優先して検証するIPアドレスのブラックリスト</dfn>"
470
 
471
- #: admin/includes/tab-settings.php:227
472
  msgid ""
473
  "<dfn title=\"If your server is placed behind the proxy server or the load "
474
  "balancing server, you need to put the appropriate key such as &#8220;"
@@ -482,7 +538,7 @@ msgstr ""
482
  "キーを指定してください。\">IPアドレスを追加抽出する&thinsp;$_SERVER&thinsp;の"
483
  "キー</dfn>"
484
 
485
- #: admin/includes/tab-settings.php:246
486
  msgid ""
487
  "<dfn title=\"It validates malicious signatures independently of &#8220;Block "
488
  "by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target "
@@ -499,14 +555,14 @@ msgstr ""
499
  "字化けした場合、クリックして復元して下さい。\"><span id=\"ip-geo-block-cycle"
500
  "\"></span></a>)</nobr>"
501
 
502
- #: admin/includes/tab-settings.php:260
503
  msgid ""
504
  "<dfn title=\"Select allowed MIME type.\">Whitelist of allowed MIME type</dfn>"
505
  msgstr ""
506
  "<dfn title=\"許可する&thinsp;MIME&thinsp;タイプを指定します。\">許可する"
507
  "&thinsp;MIME&thinsp;タイプのホワイトリスト</dfn>"
508
 
509
- #: admin/includes/tab-settings.php:271
510
  msgid ""
511
  "<dfn title=\"Put forbidden file extensions.\">Blacklist of forbidden file "
512
  "extensions</dfn>"
@@ -514,13 +570,36 @@ msgstr ""
514
  "<dfn title=\"禁止するファイルの拡張子を設定します。\">禁止するファイル拡張子"
515
  "のブラックリスト</dfn>"
516
 
517
- #: admin/includes/tab-settings.php:278
 
 
 
 
 
 
 
 
 
 
 
 
518
  msgid ""
519
- "<dfn title=\"It restricts the file types on upload to block malware and "
520
- "backdoor via both back-end and front-end. Please consider to select &#8220;"
521
- "mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation timing&#8221; "
522
- "so that other staff would not fetch uploaded files before this validation."
523
- "\">Prevent malicious file uploading</dfn>"
 
 
 
 
 
 
 
 
 
 
 
524
  msgstr ""
525
  "<dfn title=\"ファイル・タイプを限定し、バックエンド、またはフロントエンドを経"
526
  "由するマルウェアやバックドアのアップロードを遮断します。他のプラグインやテー"
@@ -528,22 +607,22 @@ msgstr ""
528
  "plugins&#8221; (ip-geo-block-mu.php)」に設定することを検討してください。\">悪"
529
  "意のあるアップロード防止</dfn>"
530
 
531
- #: admin/includes/tab-settings.php:289 admin/includes/tab-settings.php:495
532
- #: admin/includes/tab-settings.php:638 admin/includes/tab-settings.php:1214
533
  msgid "Disable"
534
  msgstr "無効"
535
 
536
- #: admin/includes/tab-settings.php:290
537
- msgid "Verify capability and MIME type"
538
  msgstr ""
539
- "<dfn title=\"権限、および拡張子と&thinsp;MIME&thinsp;タイプの整合性を検証しま"
540
- "す。\">権限と&thinsp;MIME&thinsp;タイプを検証</dfn>"
541
 
542
- #: admin/includes/tab-settings.php:291
543
- msgid "Verify only file extension"
544
  msgstr "ファイル拡張子のみを検証"
545
 
546
- #: admin/includes/tab-settings.php:326
547
  #, php-format
548
  msgid ""
549
  "<dfn title=\"You can put your original 403.php and so on into your theme "
@@ -552,7 +631,7 @@ msgstr ""
552
  "<dfn title=\"テーマ・ディレクトリには&thinsp;403.php&thinsp;など、独自のファ"
553
  "イルを設置する事が出来ます。\">レスポンス・コード</dfn> %s"
554
 
555
- #: admin/includes/tab-settings.php:356 admin/includes/tab-settings.php:876
556
  msgid ""
557
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. If it is pointed "
558
  "to a public facing page, visitors would not be blocked on the page to "
@@ -566,7 +645,7 @@ msgstr ""
566
  "ります。空欄の場合、サイトのホームが使用されます。\">リダイレクト先&thinsp;"
567
  "URL</dfn>"
568
 
569
- #: admin/includes/tab-settings.php:373 admin/includes/tab-settings.php:894
570
  msgid ""
571
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
572
  "message</dfn>"
@@ -574,7 +653,7 @@ msgstr ""
574
  "<dfn title=\"レスポンス・コード&thinsp;4xx、5xx&thinsp;用のメッセージを指定し"
575
  "ます。\">レスポンス・メッセージ</dfn>"
576
 
577
- #: admin/includes/tab-settings.php:390
578
  msgid ""
579
  "<dfn title=\"This is applied to &#8220;XML-RPC&#8221; and &#8220;Login "
580
  "form&#8221;. Lockout period is defined as expiration time at &#8220;Cache "
@@ -584,23 +663,23 @@ msgstr ""
584
  "時間は「キャッシュの設定」の「有効時間」で定義されます。\">IPアドレス当たりの"
585
  "ログイン試行可能回数</dfn>"
586
 
587
- #: admin/includes/tab-settings.php:418
588
  msgid "Select when to run the validation."
589
  msgstr "検証を実行するタイミングを選択します。"
590
 
591
- #: admin/includes/tab-settings.php:418
592
  msgid "Validation timing"
593
  msgstr "検証のタイミング"
594
 
595
- #: admin/includes/tab-settings.php:429
596
  msgid "&#8220;init&#8221; action hook"
597
  msgstr "&#8220;init&#8221; アクション・フック"
598
 
599
- #: admin/includes/tab-settings.php:430
600
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
601
  msgstr "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
602
 
603
- #: admin/includes/tab-settings.php:433
604
  msgid ""
605
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
606
  "plugins."
@@ -608,7 +687,7 @@ msgstr ""
608
  "標準的な他のプラグインと同様、init アクション・フックのタイミングで検証を実行"
609
  "します。"
610
 
611
- #: admin/includes/tab-settings.php:434
612
  msgid ""
613
  "Validate at an earlier phase than other typical plugins. It can reduce load "
614
  "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
@@ -620,48 +699,48 @@ msgstr ""
620
  "com/codex/validation-timing.html' title='Validation timing | IP Geo Block'>幾"
621
  "つかの制限事項</a>&thinsp;が生じます。"
622
 
623
- #: admin/includes/tab-settings.php:445
624
  msgid "Back-end target settings"
625
  msgstr "バックエンドの設定"
626
 
627
- #: admin/includes/tab-settings.php:451
628
  #, php-format
629
  msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
630
  msgstr "<dfn title=\"%s へのリクエストを検証します。\">%s</dfn>"
631
 
632
- #: admin/includes/tab-settings.php:457
633
  msgid "Other areas"
634
  msgstr "その他のディレクトリ"
635
 
636
- #: admin/includes/tab-settings.php:476 admin/includes/tab-settings.php:496
637
- #: admin/includes/tab-settings.php:529 admin/includes/tab-settings.php:535
638
- #: admin/includes/tab-settings.php:777
639
  msgid "Block by country"
640
  msgstr "国コードで遮断"
641
 
642
- #: admin/includes/tab-settings.php:497
643
  msgid "Completely close"
644
  msgstr "完全に閉鎖"
645
 
646
- #: admin/includes/tab-settings.php:530
647
  msgid ""
648
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
649
  "actions</dfn>"
650
  msgstr ""
651
  "<dfn title=\"遮断対象とするアクションを指定します。\">対象アクション</dfn>"
652
 
653
- #: admin/includes/tab-settings.php:536
654
  msgid "Prevent Zero-day Exploit"
655
  msgstr "ゼロデイ攻撃を遮断"
656
 
657
- #: admin/includes/tab-settings.php:540
658
  msgid ""
659
  "It will block a request related to the services for both public facing pages "
660
  "and the dashboard."
661
  msgstr ""
662
  "一般公開ページとダッシュボード向けサービスに関連するリクエストを遮断します。"
663
 
664
- #: admin/includes/tab-settings.php:541
665
  msgid ""
666
  "Regardless of the country code, it will block a malicious request related to "
667
  "the services only for the dashboard."
@@ -669,35 +748,40 @@ msgstr ""
669
  "国コードに拘らず、ダッシュボード向けサービスだけに関連する悪意のあるリクエス"
670
  "トを遮断します。"
671
 
672
- #: admin/includes/tab-settings.php:592
673
- msgid "for logged-in user"
674
- msgstr "ログインユーザー用"
675
 
676
- #: admin/includes/tab-settings.php:593
677
- msgid "for non logged-in user"
678
- msgstr "一般訪問者用"
679
 
680
- #: admin/includes/tab-settings.php:614
681
  msgid "Admin ajax/post"
682
  msgstr "管理領域&thinsp;ajax/post"
683
 
684
- #: admin/includes/tab-settings.php:627
685
  msgid ""
686
  "<dfn title=\"Specify the page name (&#8220;page=&hellip;&#8221;) or the "
687
  "action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking "
688
  "caused by &#8220;Block by country&#8221; for non logged-in user and &#8220;"
689
  "Prevent Zero-day Exploit&#8221; for logged-in user.\">Exceptions</dfn>"
690
  msgstr ""
691
- "<dfn title=\"「国コードで遮断」または「ゼロデイ攻撃を遮断」が、それぞれ一般訪"
692
- "問者、ログインユーザーを意図せず遮断する場合、検証対象から除外するリクエスト"
693
- "を特定するために、ページ名(&#8220;&hellip;&#8221;)、またはアクション名"
694
- "(&#8220;&hellip;&#8221;)を指定してください。\">除外する項目</dfn>"
 
 
 
 
 
695
 
696
- #: admin/includes/tab-settings.php:632
697
  msgid "Candidate actions"
698
  msgstr "候補アクション"
699
 
700
- #: admin/includes/tab-settings.php:640
701
  #, php-format
702
  msgid ""
703
  "Regardless of the country code, it will block a malicious request to <code>"
@@ -706,16 +790,7 @@ msgstr ""
706
  "国コードに拘らず、<code>%s&hellip;/*.php</code>への悪意のあるリクエストを遮断"
707
  "します。"
708
 
709
- #: admin/includes/tab-settings.php:641
710
- #, php-format
711
- msgid ""
712
- "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
713
- "does not load WordPress core."
714
- msgstr ""
715
- "WordPressコアを読み込まないPHPファイルへのリクエストを検証対象とするため"
716
- "に、%s を設定します。"
717
-
718
- #: admin/includes/tab-settings.php:642
719
  msgid ""
720
  "<dfn title=\"Select the item which causes undesired blocking in order to "
721
  "exclude from the validation target. Grayed item indicates &#8220;"
@@ -725,27 +800,40 @@ msgstr ""
725
  "灰色で表示された項目は、「非アクティブ」であることを示しています。\">除外する"
726
  "項目</dfn>"
727
 
728
- #: admin/includes/tab-settings.php:678 admin/includes/tab-settings.php:728
 
 
 
 
 
 
 
 
 
 
 
 
 
729
  msgid "Force to load WP core"
730
  msgstr "WPコアの読み込みを強制"
731
 
732
- #: admin/includes/tab-settings.php:683
733
  msgid "Plugins area"
734
  msgstr "プラグイン領域"
735
 
736
- #: admin/includes/tab-settings.php:733
737
  msgid "Themes area"
738
  msgstr "テーマ領域"
739
 
740
- #: admin/includes/tab-settings.php:758
741
  msgid "Front-end target settings"
742
  msgstr "フロントエンドの設定"
743
 
744
- #: admin/includes/tab-settings.php:782
745
  msgid "Follow &#8220;Validation rule settings&#8221;"
746
  msgstr "「検証ルールの設定」に従う"
747
 
748
- #: admin/includes/tab-settings.php:844
749
  #, php-format
750
  msgid ""
751
  "<dfn title=\"You can configure a different response code from the Back-end. "
@@ -756,12 +844,12 @@ msgstr ""
756
  "フィリエイト・プログラムに対する違反を防止するのに役立つでしょ"
757
  "う。\">Response code</dfn> %s"
758
 
759
- #: admin/includes/tab-settings.php:909
760
  msgid ""
761
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
762
  msgstr "<dfn title=\"特定のページを遮断対象に指定します。\">ページ</dfn>"
763
 
764
- #: admin/includes/tab-settings.php:921
765
  msgid ""
766
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
767
  "target.\">Post type</dfn>"
@@ -769,7 +857,7 @@ msgstr ""
769
  "<dfn title=\"特定の投稿タイプのシングルページを遮断対象に指定します。\">投稿"
770
  "タイプ</dfn>"
771
 
772
- #: admin/includes/tab-settings.php:933
773
  msgid ""
774
  "<dfn title=\"Specify the individual category on a single page or archive "
775
  "page as a blocking target.\">Category</dfn>"
@@ -777,7 +865,7 @@ msgstr ""
777
  "<dfn title=\"特定のカテゴリを含むシングルページかアーカイブページを遮断対象に"
778
  "指定します。\">カテゴリ</dfn>"
779
 
780
- #: admin/includes/tab-settings.php:945
781
  msgid ""
782
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
783
  "a blocking target.\">Tag</dfn>"
@@ -785,23 +873,23 @@ msgstr ""
785
  "<dfn title=\"特定のタグを含むシングルページかアーカイブページを遮断対象に指定"
786
  "します。\">タグ</dfn>"
787
 
788
- #: admin/includes/tab-settings.php:960
789
  msgid "Specify the validation target on front-end."
790
  msgstr "フロントエンドの検証対象を設定します。"
791
 
792
- #: admin/includes/tab-settings.php:960
793
  msgid "Validation target"
794
  msgstr "検証対象"
795
 
796
- #: admin/includes/tab-settings.php:971
797
  msgid "All requests"
798
  msgstr "全てのリクエスト"
799
 
800
- #: admin/includes/tab-settings.php:972
801
  msgid "Specify the targets"
802
  msgstr "ターゲットを指定"
803
 
804
- #: admin/includes/tab-settings.php:975
805
  msgid ""
806
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
807
  "wp&#8221; action hook. It means that this feature would not be compatible "
@@ -810,7 +898,7 @@ msgstr ""
810
  "「検証のタイミング」が &#8220;wp&#8221; アクション・フックまで遅延されます。"
811
  "これにより、ページ・キャッシュとの互換性がなくなることに注意してください。"
812
 
813
- #: admin/includes/tab-settings.php:985
814
  msgid ""
815
  "A part of user agent string and a qualification connected with a separator "
816
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
@@ -824,19 +912,19 @@ msgstr ""
824
  "国コード、または&nbsp;IPアドレス(CIDR記法)が使えます。また否定を表す記号"
825
  "「!」を「条件」の直前に配置する事が出来ます。"
826
 
827
- #: admin/includes/tab-settings.php:985
828
  msgid "UA string and qualification"
829
  msgstr "ユーザーエージェント文字列と条件"
830
 
831
- #: admin/includes/tab-settings.php:1004
832
  msgid "Specify the name of action that is invariably blocked."
833
  msgstr "遮断されるアクション名を指定します。"
834
 
835
- #: admin/includes/tab-settings.php:1004
836
  msgid "Excluded actions"
837
  msgstr "除外するアクション"
838
 
839
- #: admin/includes/tab-settings.php:1023
840
  msgid ""
841
  "It enables to verify the host by reverse DNS lookup which would spend some "
842
  "server resources. If it is disabled, &#8220;HOST&#8221; and &#8220;"
@@ -847,11 +935,11 @@ msgstr ""
847
  "ます)。無効にした場合、「ユーザーエージェント文字列と条件」中の「HOST」、"
848
  "「HOST=&hellip;」は常に真となります。"
849
 
850
- #: admin/includes/tab-settings.php:1023
851
  msgid "DNS reverse lookup"
852
  msgstr "DNS&thinsp;逆引き"
853
 
854
- #: admin/includes/tab-settings.php:1040
855
  msgid ""
856
  "It enables to simulate validation without deployment. The results can be "
857
  "found at &#8220;Public facing pages&#8221; in Logs."
@@ -859,15 +947,15 @@ msgstr ""
859
  "機能を有効にする事なくリクエストの検証をシミュレートします。結果はログで確認"
860
  "する事が出来ます。"
861
 
862
- #: admin/includes/tab-settings.php:1040
863
  msgid "Simulation mode"
864
  msgstr "シミュレーション・モード"
865
 
866
- #: admin/includes/tab-settings.php:1059
867
  msgid "Geolocation API settings"
868
  msgstr "位置情報APIの設定"
869
 
870
- #: admin/includes/tab-settings.php:1068
871
  msgid ""
872
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
873
  "selection and key settings</dfn>"
@@ -875,11 +963,11 @@ msgstr ""
875
  "<dfn title=\"キャッシュとローカルのデータベースが最優先で検索されます。\">API"
876
  "の選択とキーの設定</dfn>"
877
 
878
- #: admin/includes/tab-settings.php:1087
879
  msgid "Timeout for network API [sec]"
880
  msgstr "ネットワークAPIのタイムアウト[秒]"
881
 
882
- #: admin/includes/tab-settings.php:1108
883
  #, php-format
884
  msgid ""
885
  "Can not find geolocation API libraries in <code>%s</code>. It seems to have "
@@ -904,73 +992,73 @@ msgstr ""
904
  "IP Geo Block\">FAQ</a> を参照し、適切な書き込み権限と共に <code>ip-geo-api</"
905
  "code> をインストールしてください。"
906
 
907
- #: admin/includes/tab-settings.php:1117
908
  msgid "Local database settings"
909
  msgstr "ローカル・データベースの設定"
910
 
911
- #: admin/includes/tab-settings.php:1131
912
  msgid "database"
913
  msgstr "ファイル"
914
 
915
- #: admin/includes/tab-settings.php:1132
916
- #: classes/class-ip-geo-block-cron.php:345
917
  #, php-format
918
  msgid "Last update: %s"
919
  msgstr "最終更新:%s"
920
 
921
- #: admin/includes/tab-settings.php:1141
922
  msgid "Auto updating (once a month)"
923
  msgstr "自動更新(月1回)"
924
 
925
- #: admin/includes/tab-settings.php:1158
926
  msgid "Download database"
927
  msgstr "データベースのダウンロード"
928
 
929
- #: admin/includes/tab-settings.php:1166
930
  msgid "Download now"
931
  msgstr "今すぐダウンロード"
932
 
933
- #: admin/includes/tab-settings.php:1178
934
  msgid "Record settings"
935
  msgstr "記録の設定"
936
 
937
- #: admin/includes/tab-settings.php:1187
938
  msgid "Record validation statistics"
939
  msgstr "検証の統計を記録"
940
 
941
- #: admin/includes/tab-settings.php:1203
942
  msgid "Record validation logs"
943
  msgstr "検証のログを記録"
944
 
945
- #: admin/includes/tab-settings.php:1215
946
  msgid "Only when blocked"
947
  msgstr "遮断時に記録"
948
 
949
- #: admin/includes/tab-settings.php:1216
950
  msgid "Only when passed"
951
  msgstr "通過時に記録"
952
 
953
- #: admin/includes/tab-settings.php:1217
954
  msgid "Unauthenticated user"
955
  msgstr "未認証ユーザーを記録"
956
 
957
- #: admin/includes/tab-settings.php:1218
958
  msgid "Authenticated user"
959
  msgstr "認証済ユーザーを記録"
960
 
961
- #: admin/includes/tab-settings.php:1219
962
  msgid "All of validation"
963
  msgstr "すべての検証を記録"
964
 
965
- #: admin/includes/tab-settings.php:1228
966
  msgid "Recording period of the logs (days)"
967
  msgstr "ログの記録期間(日)"
968
 
969
- #: admin/includes/tab-settings.php:1244
970
  msgid "Maximum length of logs for each target"
971
  msgstr "ログの記録最大数"
972
 
973
- #: admin/includes/tab-settings.php:1261
974
  msgid ""
975
  "<dfn title=\"e.g. action, comment, log, pwd, FILES\">$_POST keys to be "
976
  "recorded with their values in logs</dfn>"
@@ -978,15 +1066,15 @@ msgstr ""
978
  "<dfn title=\"例)action, comment, log, pwd, FILES\">ログに記録する際に内容を"
979
  "展開する$_POSTのキー</dfn>"
980
 
981
- #: admin/includes/tab-settings.php:1279
982
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
983
  msgstr "<dfn title=\"例)123.456.789.***\">IPアドレスを匿名化する</dfn>"
984
 
985
- #: admin/includes/tab-settings.php:1297
986
  msgid "IP address cache settings"
987
  msgstr "IPアドレスのキャッシュ設定"
988
 
989
- #: admin/includes/tab-settings.php:1306
990
  #, php-format
991
  msgid ""
992
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
@@ -996,47 +1084,55 @@ msgstr ""
996
  "<dfn title=\"ユーザ認証が連続%d回失敗した場合も、以降のログインがこの期間だけ"
997
  "(ガベージコレクション周期を含む)禁止されます。\">有効時間 [sec]</dfn>"
998
 
999
- #: admin/includes/tab-settings.php:1322
1000
  msgid "Garbage collection period [sec]"
1001
  msgstr "ガベージコレクション周期 [秒]"
1002
 
1003
- #: admin/includes/tab-settings.php:1339
1004
  msgid "Number of entries to be displayed in cache"
1005
  msgstr "「キャッシュ中のIPアドレス」に表示する最大数"
1006
 
1007
- #: admin/includes/tab-settings.php:1358
1008
  msgid "Submission settings"
1009
  msgstr "投稿時の設定"
1010
 
1011
- #: admin/includes/tab-settings.php:1370
1012
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
1013
  msgstr "全体が&lt;p&gt;タグで囲われます。使用可能タグ:"
1014
 
1015
- #: admin/includes/tab-settings.php:1370
1016
  msgid "Message on comment form"
1017
  msgstr "投稿フォーム上のメッセージ"
1018
 
1019
- #: admin/includes/tab-settings.php:1382
1020
  msgid "None"
1021
  msgstr "なし"
1022
 
1023
- #: admin/includes/tab-settings.php:1383
1024
  msgid "Top"
1025
  msgstr "上部"
1026
 
1027
- #: admin/includes/tab-settings.php:1384
1028
  msgid "Bottom"
1029
  msgstr "下部"
1030
 
1031
- #: admin/includes/tab-settings.php:1396
1032
  msgid "Plugin settings"
1033
  msgstr "プラグインの設定"
1034
 
1035
- #: admin/includes/tab-settings.php:1405
 
 
 
 
 
 
 
 
1036
  msgid "Remove all settings at uninstallation"
1037
  msgstr "アンインストール時に全設定を削除"
1038
 
1039
- #: admin/includes/tab-settings.php:1423
1040
  msgid ""
1041
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
1042
  "dfn>"
@@ -1044,7 +1140,7 @@ msgstr ""
1044
  "<dfn title=\"Google Maps JavaScript API に有効なキー\">Google Maps API キー</"
1045
  "dfn>"
1046
 
1047
- #: admin/includes/tab-settings.php:1437
1048
  msgid ""
1049
  "You need to click the &#8220;Save Changes&#8221; button for imported "
1050
  "settings to take effect."
@@ -1052,37 +1148,37 @@ msgstr ""
1052
  "インポートされた設定を有効にするには、「変更を保存」ボタンをクリックする必要"
1053
  "があります。"
1054
 
1055
- #: admin/includes/tab-settings.php:1443
1056
  msgid "Export / Import settings"
1057
  msgstr "設定のエクスポート、インポート"
1058
 
1059
- #: admin/includes/tab-settings.php:1450
1060
  msgid "Export settings"
1061
  msgstr "エクスポート"
1062
 
1063
- #: admin/includes/tab-settings.php:1451
1064
  msgid "Import from the local file"
1065
  msgstr "ローカル・ファイルからインポートします"
1066
 
1067
- #: admin/includes/tab-settings.php:1451
1068
  msgid "Import settings"
1069
  msgstr "インポート"
1070
 
1071
- #: admin/includes/tab-settings.php:1460
1072
  msgid "Import pre-defined settings"
1073
  msgstr "プリセットのインポート"
1074
 
1075
- #: admin/includes/tab-settings.php:1467
1076
  msgid ""
1077
  "Import the default settings to revert to the &#8220;Right after "
1078
  "installing&#8221; state"
1079
  msgstr "インストール直後の状態に戻すための設定値をインポートします"
1080
 
1081
- #: admin/includes/tab-settings.php:1467
1082
  msgid "Default settings"
1083
  msgstr "初期設定"
1084
 
1085
- #: admin/includes/tab-settings.php:1468
1086
  msgid ""
1087
  "Import the preferred settings mainly by enabling Zero-day Exploit Prevention "
1088
  "for the &#8220;Back-end target settings&#8221;"
@@ -1090,47 +1186,47 @@ msgstr ""
1090
  "「ゼロデイ攻撃の遮断」など、主に「バックエンドの設定」に推奨される設定をイン"
1091
  "ポートします。"
1092
 
1093
- #: admin/includes/tab-settings.php:1468
1094
  msgid "Best for Back-end"
1095
  msgstr "バックエンドの推奨設定"
1096
 
1097
- #: admin/includes/tab-settings.php:1478
1098
  msgid "Delete DB table for validation logs"
1099
  msgstr "検証のログ用データベース・テーブルの削除"
1100
 
1101
- #: admin/includes/tab-settings.php:1486
1102
  msgid "Delete now"
1103
  msgstr "今すぐ削除"
1104
 
1105
- #: admin/includes/tab-settings.php:1494
1106
  msgid "Create DB table for validation logs"
1107
  msgstr "検証のログ用データベース・テーブルの作成"
1108
 
1109
- #: admin/includes/tab-settings.php:1502
1110
  msgid "Create now"
1111
  msgstr "今すぐ作成"
1112
 
1113
- #: admin/includes/tab-settings.php:1512
1114
  msgid ""
1115
  "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
1116
- "forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
1117
  "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
1118
  "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
1119
  msgstr ""
1120
  "<dfn title=\"フォーラムに問題を投稿する際、コピーして張り付けてください。\">"
1121
- "インストール情報</dfn><br />[ <a rel=\"noreferrer\" href=\"https://wordpress."
1122
- "org/support/plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; "
1123
- "IP Geo Block\">サポートフォーラム</a> ]"
1124
 
1125
- #: admin/includes/tab-settings.php:1519
1126
  msgid "Show PHP, WordPress, theme and plugins information."
1127
  msgstr "PHP、WordPress、テーマ、プラグインの情報を表示します。"
1128
 
1129
- #: admin/includes/tab-settings.php:1519
1130
  msgid "Show information"
1131
  msgstr "情報を表示"
1132
 
1133
- #: admin/includes/tab-settings.php:1535
1134
  msgid ""
1135
  "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
1136
  "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
@@ -1142,7 +1238,7 @@ msgstr ""
1142
  "\" title=\"The best practice for target settings | IP Geo Block\">The best "
1143
  "practice fortarget settings</a>&#8220;&thinsp;を参照してください。"
1144
 
1145
- #: admin/includes/tab-settings.php:1536
1146
  msgid ""
1147
  "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
1148
  "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
@@ -1156,7 +1252,7 @@ msgstr ""
1156
  "com/codex/#faq\" title=\"Codex | IP Geo Block\">Codex</a> の FAQ を参照してく"
1157
  "ださい。"
1158
 
1159
- #: admin/includes/tab-settings.php:1543
1160
  msgid ""
1161
  "While Maxmind and IP2Location will fetch the local database, others will "
1162
  "pass an IP address to the APIs via HTTP."
@@ -1164,12 +1260,12 @@ msgstr ""
1164
  "MaxmindとIP2Locationはローカルのデータベースを検索しますが、他はHTTPを介して"
1165
  "APIにIPアドレスを渡します。"
1166
 
1167
- #: admin/includes/tab-settings.php:1544
1168
  msgid ""
1169
  "Please select the appropriate APIs to fit the privacy law in your country."
1170
  msgstr "自国のプライバシー関連法規に合わせ、適切なAPIを選択して下さい。"
1171
 
1172
- #: admin/includes/tab-settings.php:1551
1173
  msgid ""
1174
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1175
  "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
@@ -1181,7 +1277,7 @@ msgstr ""
1181
  "end\" title=\"Codex | IP Geo Block\">Blocking on front-end</a>&#8221; を参照"
1182
  "してください。"
1183
 
1184
- #: admin/includes/tab-settings.php:1552
1185
  msgid ""
1186
  "If you find any issues or have something to suggest, please feel free to "
1187
  "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
@@ -1193,7 +1289,7 @@ msgstr ""
1193
  "&#8250; Support &raquo; IP Geo Block\">サポートフォーラム</a> に投稿をお願い"
1194
  "します。"
1195
 
1196
- #: admin/includes/tab-settings.php:1559
1197
  msgid ""
1198
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1199
  "ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
@@ -1203,67 +1299,71 @@ msgstr ""
1203
  "record-settings-and-logs.html\" title=\"Codex | IP Geo Block\">Record "
1204
  "settings and logs</a>&#8221; を参照ください。"
1205
 
1206
- #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:186
1207
  msgid "Statistics of validation"
1208
  msgstr "検証の統計"
1209
 
1210
- #: admin/includes/tab-statistics.php:33
1211
  msgid "Blocked"
1212
  msgstr "全遮断数"
1213
 
1214
- #: admin/includes/tab-statistics.php:58
1215
  msgid "Blocked by countries"
1216
  msgstr "国別遮断数"
1217
 
1218
- #: admin/includes/tab-statistics.php:99
1219
  msgid "Blocked per day"
1220
  msgstr "1日あたりの遮断数"
1221
 
1222
- #: admin/includes/tab-statistics.php:115
1223
  msgid "Blocked by type of IP address"
1224
  msgstr "遮断したIPアドレスのタイプ"
1225
 
1226
- #: admin/includes/tab-statistics.php:133
1227
  msgid "Name of API"
1228
  msgstr "API名"
1229
 
1230
- #: admin/includes/tab-statistics.php:134
1231
  msgid "Calls"
1232
  msgstr "リクエスト回数"
1233
 
1234
- #: admin/includes/tab-statistics.php:135
1235
  msgid "Response [msec]"
1236
  msgstr "応答時間 [msec]"
1237
 
1238
- #: admin/includes/tab-statistics.php:149
1239
  msgid "Average response time of each API"
1240
  msgstr "API毎の平均応答時間"
1241
 
1242
- #: admin/includes/tab-statistics.php:165
1243
  msgid "Clear statistics"
1244
  msgstr "統計のクリア"
1245
 
1246
- #: admin/includes/tab-statistics.php:212
 
 
 
 
1247
  msgid "Statistics in cache"
1248
  msgstr "キャッシュの統計"
1249
 
1250
- #: admin/includes/tab-statistics.php:220
1251
  msgid "Country code / Access"
1252
  msgstr "国コード / アクセス先"
1253
 
1254
- #: admin/includes/tab-statistics.php:221
1255
  msgid "Elapsed [sec] / Calls"
1256
  msgstr "経過時間 [sec] / 回数"
1257
 
1258
- #: admin/includes/tab-statistics.php:254
1259
  msgid "IP address in cache"
1260
  msgstr "キャッシュ中のIPアドレス"
1261
 
1262
- #: admin/includes/tab-statistics.php:269
1263
  msgid "Clear cache"
1264
  msgstr "キャッシュのクリア"
1265
 
1266
- #: admin/includes/tab-statistics.php:288
1267
  msgid ""
1268
  "Current setting of [<strong>Record validation statistics</strong>] on "
1269
  "[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
@@ -1271,13 +1371,29 @@ msgstr ""
1271
  "現在[<strong>設定</strong>]タブの[<strong>検証の統計を記録</strong>]は"
1272
  "[<strong>有効</strong>]が選択されていません。"
1273
 
1274
- #: admin/includes/tab-statistics.php:289
1275
  msgid ""
1276
  "Please set the proper condition to record and analyze the validation "
1277
  "statistics."
1278
  msgstr "検証の統計を記録し分析するためには、適切な条件を設定して下さい。"
1279
 
1280
- #: classes/class-ip-geo-block-apis.php:651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1281
  msgid ""
1282
  "You need to select at least one IP geolocation service. Otherwise "
1283
  "<strong>you'll be blocked</strong> after the cache expires."
@@ -1285,23 +1401,16 @@ msgstr ""
1285
  "少なくとも1つ以上の位置情報サービスを選択して下さい。未選択の場合、キャッシュ"
1286
  "の有効期限切れと共にロックアウトされます。"
1287
 
1288
- #: classes/class-ip-geo-block-cron.php:241
1289
  msgid "Your database file is up-to-date."
1290
  msgstr "データベース・ファイルは最新です。"
1291
 
1292
- #: classes/class-ip-geo-block-cron.php:269
1293
- #: classes/class-ip-geo-block-cron.php:301
1294
- #, php-format
1295
- msgid "Unable to read %s. Please check the permission."
1296
- msgstr "%s が読めません。パーミッションを確認して下さい。"
1297
-
1298
- #: classes/class-ip-geo-block-cron.php:279
1299
- #: classes/class-ip-geo-block-cron.php:311
1300
  #, php-format
1301
- msgid "Can't lock %s. Please try again after a while."
1302
- msgstr "%s をロックできません。パーミッションを確認して下さい。"
1303
 
1304
- #: classes/class-ip-geo-block-cron.php:323
1305
  msgid "gz or zip is not supported on your system."
1306
  msgstr "gz または zip がサポートされていません。"
1307
 
@@ -1332,7 +1441,7 @@ msgstr ""
1332
  "php#WordPress_Upgrade_Constants\" title=\"Editing wp-config.php &laquo; "
1333
  "WordPress Codex\">このドキュメント</a>を参照してください。"
1334
 
1335
- #: classes/class-ip-geo-block-logs.php:149
1336
  #, php-format
1337
  msgid ""
1338
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
@@ -1341,10 +1450,8 @@ msgstr ""
1341
  "%s 用のテーブルが作成されていません。一旦このプラグインを無効化し、再度有効化"
1342
  "して下さい。"
1343
 
1344
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:157
1345
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:186
1346
- #: wp-content/ip-geo-api/maxmind/class-maxmind.php:171
1347
- #: wp-content/ip-geo-api/maxmind/class-maxmind.php:200
1348
  msgid "Database file does not exist."
1349
  msgstr "データベース・ファイルが見つかりません。"
1350
 
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: IP Geo Block 3.0.4.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
+ "POT-Creation-Date: 2017-09-24 16:25+0900\n"
8
+ "PO-Revision-Date: 2017-09-24 16:32+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
27
  "自国以外から投稿されるスパム、ログインフォーム、さらにゼロデイ攻撃を含む管理"
28
  "領域への悪意あるアクセスからサイトを守ります。"
29
 
30
+ #: admin/class-ip-geo-block-admin.php:247
31
  msgid "Import settings ?"
32
  msgstr "設定をインポートしますか?"
33
 
34
+ #: admin/class-ip-geo-block-admin.php:248
35
  msgid "Create table ?"
36
  msgstr "テーブルを作成しますか?"
37
 
38
+ #: admin/class-ip-geo-block-admin.php:249
39
  msgid "Delete table ?"
40
  msgstr "テーブルを削除しますか?"
41
 
42
+ #: admin/class-ip-geo-block-admin.php:250
43
  msgid "Clear statistics ?"
44
  msgstr "統計をクリアしますか?"
45
 
46
+ #: admin/class-ip-geo-block-admin.php:251
47
  msgid "Clear cache ?"
48
  msgstr "キャッシュをクリアしますか?"
49
 
50
+ #: admin/class-ip-geo-block-admin.php:252
51
  msgid "Clear logs ?"
52
  msgstr "ログをクリアしますか?"
53
 
54
+ #: admin/class-ip-geo-block-admin.php:253
55
+ msgid "ajax for logged-in user"
56
+ msgstr "認証済ユーザー用 ajax"
57
+
58
+ #: admin/class-ip-geo-block-admin.php:254
59
+ msgid "ajax for non logged-in user"
60
+ msgstr "未認証ユーザー用 ajax"
61
+
62
+ #: admin/class-ip-geo-block-admin.php:255
63
  msgid "This feature is available with HTML5 compliant browsers."
64
  msgstr "HTML5準拠のブラウザでのみ機能します。"
65
 
66
+ #: admin/class-ip-geo-block-admin.php:268
67
  msgid "Contribute at GitHub"
68
  msgstr "開発に参加"
69
 
70
+ #: admin/class-ip-geo-block-admin.php:285
71
+ #: admin/class-ip-geo-block-admin.php:588
72
+ #: admin/class-ip-geo-block-admin.php:606
73
  msgid "Settings"
74
  msgstr "設定"
75
 
76
+ #: admin/class-ip-geo-block-admin.php:377
77
+ #: admin/class-ip-geo-block-admin.php:378
78
+ #: admin/class-ip-geo-block-admin.php:388
79
+ #: admin/class-ip-geo-block-admin.php:389
80
  msgid "IP Geo Block"
81
  msgstr "IP Geo Block"
82
 
83
+ #: admin/class-ip-geo-block-admin.php:420
84
  msgid "You need WordPress 3.7+."
85
  msgstr "WordPress 3.7&thinsp;以上が必要です。"
86
 
87
+ #: admin/class-ip-geo-block-admin.php:426
88
  #, php-format
89
  msgid ""
90
  "Now downloading geolocation databases in background. After a little while, "
95
  "いた後、あなたの国コードと「<strong>マッチング規則</strong>」を「<a href=\"%s"
96
  "\">検証ルールの設定</a>」で確認して下さい。"
97
 
98
+ #: admin/class-ip-geo-block-admin.php:432
99
  #, php-format
100
  msgid ""
101
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
104
  "「<strong>マッチング規則</strong>」が正しく設定されていません。「<a href=\"%s"
105
  "\">検証ルールの設定</a>」を確認して下さい。"
106
 
107
+ #: admin/class-ip-geo-block-admin.php:441
108
  msgid "Local database and matching rule have been updated."
109
  msgstr "ローカル・データベースとマッチング規則を更新しました。"
110
 
111
+ #: admin/class-ip-geo-block-admin.php:452
112
  msgid ""
113
  "Once you logout, you will be unable to login again because the number of "
114
  "login attempts reaches the limit."
116
  "あなたのIPアドレスのログイン試行可能回数がリミットに達したため、ログアウトす"
117
  "ると再びログインする事が出来なくなります。"
118
 
119
+ #: admin/class-ip-geo-block-admin.php:454
120
  #, php-format
121
  msgid ""
122
  "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
125
  "<a href=\"%s\">「統計」タブ</a>の \"<strong>キャッシュのクリア</strong>\" を"
126
  "実行し、ロックアウトを回避してください。"
127
 
128
+ #: admin/class-ip-geo-block-admin.php:464
129
  msgid ""
130
  "Once you logout, you will be unable to login again because your country code "
131
  "or IP address is in the blacklist."
133
  "あなたの国コードまたはIPアドレスがブラックリストに含まれているため、ログアウ"
134
  "トすると再びログインする事が出来なくなります。"
135
 
136
+ #: admin/class-ip-geo-block-admin.php:465
137
  msgid ""
138
  "Once you logout, you will be unable to login again because your country code "
139
  "or IP address is not in the whitelist."
141
  "あなたの国コードまたはIPアドレスがホワイトリストに含まれていないため、ログア"
142
  "ウトすると再びログインする事が出来なくなります。"
143
 
144
+ #: admin/class-ip-geo-block-admin.php:468
145
  #, php-format
146
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
147
  msgstr "「<a href=\"%s\">検証ルールの設定</a>」を確認して下さい。"
148
 
149
+ #: admin/class-ip-geo-block-admin.php:479
150
  msgid ""
151
  "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
152
  "timing&#8221; is imcompatible with <strong>IP Geo Allow</strong>. Please "
156
  "択されていますが、<strong>IP Geo Allow</strong> と互換性がありません。"
157
  "「&#8220;init&#8221; アクション・フック」を選択してください。"
158
 
159
+ #: admin/class-ip-geo-block-admin.php:589 admin/includes/tab-network.php:38
160
  msgid "Statistics"
161
  msgstr "統計"
162
 
163
+ #: admin/class-ip-geo-block-admin.php:590 admin/includes/tab-network.php:39
164
  msgid "Logs"
165
  msgstr "ログ"
166
 
167
+ #: admin/class-ip-geo-block-admin.php:591
168
  msgid "Search"
169
  msgstr "検索"
170
 
171
+ #: admin/class-ip-geo-block-admin.php:592
172
+ #: admin/class-ip-geo-block-admin.php:607
173
+ msgid "Sites"
174
+ msgstr "サイト一覧"
175
+
176
+ #: admin/class-ip-geo-block-admin.php:593
177
  msgid "Attribution"
178
  msgstr "リンク"
179
 
180
+ #: admin/class-ip-geo-block-admin.php:617
181
+ msgid "Network"
182
+ msgstr "ネットワーク"
183
+
184
+ #: admin/class-ip-geo-block-admin.php:630
185
  msgid "Toggle all"
186
  msgstr "全てを開閉"
187
 
188
+ #: admin/class-ip-geo-block-admin.php:652
189
  msgid "Thanks for providing these great services for free."
190
  msgstr "これらのすばらしいサービスの提供元に、敬意と感謝の意を表します!"
191
 
192
+ #: admin/class-ip-geo-block-admin.php:653
193
  msgid ""
194
  "(Most browsers will redirect you to each site <a href=\"http://www."
195
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
199
  "html\" title=\"Referer Checker\">参照元を残さずにリンク先にリダイレクトできま"
200
  "す</a>。)"
201
 
202
+ #: admin/class-ip-geo-block-admin.php:658
203
  msgid "Back to top"
204
  msgstr "トップに戻る"
205
 
206
+ #: admin/class-ip-geo-block-admin.php:755
207
  msgid "Enable"
208
  msgstr "有効"
209
 
210
+ #: admin/class-ip-geo-block-admin.php:1147
211
+ #: admin/includes/class-admin-rewrite.php:169
212
+ #: classes/class-ip-geo-block-cron.php:273
213
+ #: classes/class-ip-geo-block-cron.php:305
214
+ #: classes/class-ip-geo-block-opts.php:401
 
 
 
 
 
 
 
 
 
 
 
215
  #, php-format
216
  msgid "Unable to write <code>%s</code>. Please check the permission."
217
+ msgstr "<code>%s</code> に書き込めません。パーミッションを確認して下さい。"
218
+
219
+ #: admin/class-ip-geo-block-admin.php:1177
220
+ msgid "Settings saved."
221
+ msgstr "設定を保存しました。"
222
 
223
+ #: admin/includes/class-admin-ajax.php:69
224
  msgid "n/a"
225
  msgstr "n/a"
226
 
227
+ #: admin/includes/class-admin-ajax.php:72 admin/includes/tab-settings.php:76
228
+ #: admin/includes/tab-settings.php:96
229
  msgid "UNKNOWN"
230
  msgstr "不明"
231
 
232
+ #: admin/includes/class-admin-ajax.php:255
233
  #, php-format
234
  msgid ""
235
  "illegal format at %s. Please delete the corresponding line and try again."
236
+ msgstr "%sは誤ったフォーマットです。該当行を削除し、再実行してください。"
237
 
238
+ #: admin/includes/class-admin-rewrite.php:143
239
+ #: classes/class-ip-geo-block-cron.php:268
240
+ #: classes/class-ip-geo-block-cron.php:300
241
+ #, php-format
242
+ msgid "Unable to read <code>%s</code>. Please check the permission."
243
+ msgstr "<code>%s</code> が読めません。パーミッションを確認して下さい。"
244
+
245
+ #: admin/includes/class-admin-rewrite.php:144
246
+ #: admin/includes/class-admin-rewrite.php:170
247
+ #, php-format
248
+ msgid "Or please refer to %s to set it manually."
249
+ msgstr "あるいは %s を参照し、手動で設定して下さい。"
250
+
251
+ #: admin/includes/class-admin-rewrite.php:208
252
+ #, php-format
253
+ msgid "&#8220;auto_prepend_file&#8221; already defined in %s."
254
+ msgstr "%s&thinsp;で既に「auto_prepend_file」が設定されています。"
255
+
256
+ #: admin/includes/tab-accesslog.php:19 admin/includes/tab-accesslog.php:97
257
  msgid "Validation logs"
258
  msgstr "検証のログ"
259
 
260
+ #: admin/includes/tab-accesslog.php:28
261
  msgid "Filter logs"
262
  msgstr "ログをフィルタ"
263
 
264
+ #: admin/includes/tab-accesslog.php:37
265
  msgid "Reset"
266
  msgstr "リセット"
267
 
268
+ #: admin/includes/tab-accesslog.php:44 admin/includes/tab-statistics.php:188
269
  msgid "Clear logs"
270
  msgstr "ログのクリア"
271
 
272
+ #: admin/includes/tab-accesslog.php:52 admin/includes/tab-statistics.php:170
273
+ #: admin/includes/tab-statistics.php:196 admin/includes/tab-statistics.php:297
274
  msgid "Clear now"
275
  msgstr "今すぐクリア"
276
 
277
+ #: admin/includes/tab-accesslog.php:60
278
  msgid "Export logs"
279
  msgstr "ログをエクスポート"
280
 
281
+ #: admin/includes/tab-accesslog.php:66 admin/includes/tab-settings.php:1441
282
  msgid "Export to the local file"
283
  msgstr "ローカル・ファイルにエクスポートする"
284
 
285
+ #: admin/includes/tab-accesslog.php:66
286
  msgid "Export csv"
287
  msgstr "CSVをエクスポート"
288
 
289
+ #: admin/includes/tab-accesslog.php:72
290
  #, php-format
291
  msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
292
  msgstr "<dfn title=\"%s に対するリクエストの検証ログです。\">%s</dfn>"
293
 
294
+ #: admin/includes/tab-accesslog.php:74 admin/includes/tab-settings.php:450
295
  msgid "Comment post"
296
  msgstr "コメント投稿"
297
 
298
+ #: admin/includes/tab-accesslog.php:75 admin/includes/tab-settings.php:451
299
  msgid "XML-RPC"
300
  msgstr "XML-RPC"
301
 
302
+ #: admin/includes/tab-accesslog.php:76 admin/includes/tab-settings.php:452
303
  msgid "Login form"
304
  msgstr "ログイン・フォーム"
305
 
306
+ #: admin/includes/tab-accesslog.php:77 admin/includes/tab-settings.php:453
307
  msgid "Admin area"
308
  msgstr "管理領域"
309
 
310
+ #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:455
311
  msgid "public facing pages"
312
  msgstr "一般公開ページ"
313
 
314
+ #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:455
315
  msgid "Public facing pages"
316
  msgstr "一般公開ページ"
317
 
318
+ #: admin/includes/tab-accesslog.php:131
319
  msgid "Date"
320
  msgstr "日時"
321
 
322
+ #: admin/includes/tab-accesslog.php:132 admin/includes/tab-geolocation.php:67
323
+ #: admin/includes/tab-statistics.php:239
324
  msgid "IP address"
325
  msgstr "IPアドレス"
326
 
327
+ #: admin/includes/tab-accesslog.php:133
328
  msgid "Code"
329
  msgstr "国"
330
 
331
+ #: admin/includes/tab-accesslog.php:134
332
  msgid "Result"
333
  msgstr "判定"
334
 
335
+ #: admin/includes/tab-accesslog.php:135
336
+ msgid "AS number"
337
+ msgstr "AS番号"
338
+
339
  #: admin/includes/tab-accesslog.php:136
340
  msgid "Request"
341
  msgstr "リクエスト"
385
  msgid "Search now"
386
  msgstr "今すぐ検索"
387
 
388
+ #: admin/includes/tab-settings.php:44
389
  msgid "Validation rule settings"
390
  msgstr "検証ルールの設定"
391
 
392
+ #: admin/includes/tab-settings.php:68
393
  msgid ""
394
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
395
  "code by referring &#8220;Scan country code&#8221;.\">Your IP address / "
398
  "<dfn title=\"「国コードを検索する」を参照し、適切な位置情報APIと国コードを設"
399
  "定して下さい。\">あなたのIPアドレス / 国コード</dfn>"
400
 
401
+ #: admin/includes/tab-settings.php:77 admin/includes/tab-settings.php:97
402
  msgid "Scan all the APIs you selected at Geolocation API settings"
403
  msgstr "選択された位置情報APIを検索します"
404
 
405
+ #: admin/includes/tab-settings.php:77 admin/includes/tab-settings.php:97
406
  msgid "Scan country code"
407
  msgstr "国コードを検索する"
408
 
409
+ #: admin/includes/tab-settings.php:88
410
  msgid ""
411
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
412
  "code by referring &#8220;Scan country code&#8221;.\">Server IP address / "
415
  "<dfn title=\"「国コードを検索する」を参照し、適切な位置情報APIと国コードを設"
416
  "定して下さい。\">サーバーのIPアドレス / 国コード</dfn>"
417
 
418
+ #: admin/includes/tab-settings.php:105
419
  msgid "Whitelist"
420
  msgstr "ホワイトリスト"
421
 
422
+ #: admin/includes/tab-settings.php:106
423
  msgid "Blacklist"
424
  msgstr "ブラックリスト"
425
 
426
+ #: admin/includes/tab-settings.php:110
427
  msgid ""
428
  "Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;."
429
  msgstr "「ホワイトリスト」または「ブラックリスト」のいずれかを選択して下さい。"
430
 
431
+ #: admin/includes/tab-settings.php:111
432
  msgid ""
433
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
434
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
443
  "ないことが必要な場合には、「YY」を指定してください。\">国コードのホワイトリス"
444
  "ト</dfn>"
445
 
446
+ #: admin/includes/tab-settings.php:112
447
  msgid ""
448
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
449
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
458
  "ないことが必要な場合には、「YY」を指定してください。\">国コードのブラックリス"
459
  "ト</dfn>"
460
 
461
+ #: admin/includes/tab-settings.php:116
462
  msgid "(comma separated)"
463
  msgstr "(カンマ区切り)"
464
 
465
+ #: admin/includes/tab-settings.php:117
466
  msgid "(comma or RET separated)"
467
  msgstr "(カンマ、または改行区切り)"
468
 
469
+ #: admin/includes/tab-settings.php:118
470
+ msgid "Toggle selection"
471
+ msgstr "全選択/解除"
472
+
473
+ #: admin/includes/tab-settings.php:125 admin/includes/tab-settings.php:763
474
  msgid "Matching rule"
475
  msgstr "マッチング規則"
476
 
477
+ #: admin/includes/tab-settings.php:137
478
  msgid ""
479
  "A request from which the country code or IP address is <strong>NOT</strong> "
480
  "in the whitelist will be blocked."
482
  "国コードまたはIPアドレスがホワイトリストに<strong>含まれていない</strong>リク"
483
  "エストを遮断します。"
484
 
485
+ #: admin/includes/tab-settings.php:138
486
  msgid ""
487
  "A request from which the country code or IP address is in the blacklist will "
488
  "be blocked."
490
  "国コードまたはIPアドレスがブラックリストに<strong>含まれている</strong>リクエ"
491
  "ストを遮断します。"
492
 
493
+ #: admin/includes/tab-settings.php:184
494
+ msgid ""
495
+ "<dfn title=\"It enables utilizing &#8220;AS number&#8221; in the &#8220;"
496
+ "Whitelist/Blacklist of extra IP addresses&#8221; to specify a group of IP "
497
+ "networks.\">Use Autonomous System Number</dfn>"
498
+ msgstr ""
499
+ "<dfn title=\"ホワイトリスト、ブラックリストにIPアドレスを指定する代わりに、"
500
+ "ネットワークのグループを代表する「AS番号」の指定を可能にします。\">AS番号を使"
501
+ "用可能にする</dfn>"
502
+
503
+ #: admin/includes/tab-settings.php:195
504
+ #, php-format
505
+ msgid ""
506
+ "Some useful tools for investigating ASN are introduced in &#8220;%s&#8221;."
507
+ msgstr "AS番号の検索に役立つツールを「%s」に紹介しています。"
508
+
509
+ #: admin/includes/tab-settings.php:204
510
  msgid ""
511
  "<dfn title=\"e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, "
512
+ "&#8220;69.46.36.0/27&#8221; for WordFence server or &#8220;AS32934&#8221; "
513
+ "for Facebook.\">Whitelist of extra IP addresses prior to country code</dfn>"
514
  msgstr ""
515
  "<dfn title=\"例)192.0.64.0/18(Jetpackサーバー)、69.46.36.0/27(WordFence"
516
+ "サーバー)、AS32934(Facebook)\">国コードに優先して検証するIPアドレスのホワ"
517
+ "イトリスト</dfn>"
518
 
519
+ #: admin/includes/tab-settings.php:224
520
  msgid ""
521
  "<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
522
  "\">Blacklist of extra IP addresses prior to country code</dfn>"
524
  "<dfn title=\"サーバー・レベルのアクセス制御の使用をお勧めします(例:."
525
  "htaccess)。\">国コードに優先して検証するIPアドレスのブラックリスト</dfn>"
526
 
527
+ #: admin/includes/tab-settings.php:245
528
  msgid ""
529
  "<dfn title=\"If your server is placed behind the proxy server or the load "
530
  "balancing server, you need to put the appropriate key such as &#8220;"
538
  "キーを指定してください。\">IPアドレスを追加抽出する&thinsp;$_SERVER&thinsp;の"
539
  "キー</dfn>"
540
 
541
+ #: admin/includes/tab-settings.php:264
542
  msgid ""
543
  "<dfn title=\"It validates malicious signatures independently of &#8220;Block "
544
  "by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target "
555
  "字化けした場合、クリックして復元して下さい。\"><span id=\"ip-geo-block-cycle"
556
  "\"></span></a>)</nobr>"
557
 
558
+ #: admin/includes/tab-settings.php:278
559
  msgid ""
560
  "<dfn title=\"Select allowed MIME type.\">Whitelist of allowed MIME type</dfn>"
561
  msgstr ""
562
  "<dfn title=\"許可する&thinsp;MIME&thinsp;タイプを指定します。\">許可する"
563
  "&thinsp;MIME&thinsp;タイプのホワイトリスト</dfn>"
564
 
565
+ #: admin/includes/tab-settings.php:289
566
  msgid ""
567
  "<dfn title=\"Put forbidden file extensions.\">Blacklist of forbidden file "
568
  "extensions</dfn>"
570
  "<dfn title=\"禁止するファイルの拡張子を設定します。\">禁止するファイル拡張子"
571
  "のブラックリスト</dfn>"
572
 
573
+ #: admin/includes/tab-settings.php:293
574
+ msgid ""
575
+ "<dfn title=\"Specify the capabilities to be verified. Depending on the "
576
+ "particular type of uploader, certain capability may be required. Default is "
577
+ "&#8220;upload_files&#8221; for Administrator, Editor and Author. This "
578
+ "verification will be skipped if empty.\">Capabilities to be verified</dfn>"
579
+ msgstr ""
580
+ "<dfn title=\"検証する権限を指定します。アップローダーによっては、特定の権限を"
581
+ "必要とする場合があります。デフォルトは、管理者(Administrator)、編集者"
582
+ "(Editor)、投稿者(Author)向けの「upload_files」です。空欄の場合、この検証"
583
+ "はスキップされます。\">検証する権限</dfn>"
584
+
585
+ #: admin/includes/tab-settings.php:293
586
  msgid ""
587
+ "(&thinsp;See &#8220;<a rel=\"noreferrer\" href=\"https://codex.wordpress.org/"
588
+ "Roles_and_Capabilities\" title=\"Roles and Capabilities &laquo; WordPress "
589
+ "Codex\">Roles and Capabilities</a>&#8221;&thinsp;)"
590
+ msgstr ""
591
+ "(「<a rel=\"noreferrer\" href=\"http://wpdocs.osdn.jp/%E3%83%A6%E3%83%BC"
592
+ "%E3%82%B6%E3%83%BC%E3%81%AE%E7%A8%AE%E9%A1%9E%E3%81%A8%E6%A8%A9%E9%99%90\" "
593
+ "title=\"ユーザーの種類と権限 - WordPress Codex 日本語版\">ユーザーの種類と権"
594
+ "限</a>」を参照)"
595
+
596
+ #: admin/includes/tab-settings.php:300
597
+ msgid ""
598
+ "<dfn title=\"It restricts the file types on upload in order to block malware "
599
+ "and backdoor via both back-end and front-end. Please consider to select "
600
+ "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
601
+ "timing&#8221; so that other staff would not fetch the uploaded files before "
602
+ "this validation.\">Prevent malicious file uploading</dfn>"
603
  msgstr ""
604
  "<dfn title=\"ファイル・タイプを限定し、バックエンド、またはフロントエンドを経"
605
  "由するマルウェアやバックドアのアップロードを遮断します。他のプラグインやテー"
607
  "plugins&#8221; (ip-geo-block-mu.php)」に設定することを検討してください。\">悪"
608
  "意のあるアップロード防止</dfn>"
609
 
610
+ #: admin/includes/tab-settings.php:311 admin/includes/tab-settings.php:492
611
+ #: admin/includes/tab-settings.php:611 admin/includes/tab-settings.php:1186
612
  msgid "Disable"
613
  msgstr "無効"
614
 
615
+ #: admin/includes/tab-settings.php:312
616
+ msgid "Verify file extension and MIME type"
617
  msgstr ""
618
+ "<dfn title=\"拡張子と&thinsp;MIME&thinsp;タイプの整合性を検証します。\">拡張"
619
+ "子と&thinsp;MIME&thinsp;タイプを検証</dfn>"
620
 
621
+ #: admin/includes/tab-settings.php:313
622
+ msgid "Verify file extension only"
623
  msgstr "ファイル拡張子のみを検証"
624
 
625
+ #: admin/includes/tab-settings.php:323
626
  #, php-format
627
  msgid ""
628
  "<dfn title=\"You can put your original 403.php and so on into your theme "
631
  "<dfn title=\"テーマ・ディレクトリには&thinsp;403.php&thinsp;など、独自のファ"
632
  "イルを設置する事が出来ます。\">レスポンス・コード</dfn> %s"
633
 
634
+ #: admin/includes/tab-settings.php:353 admin/includes/tab-settings.php:850
635
  msgid ""
636
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. If it is pointed "
637
  "to a public facing page, visitors would not be blocked on the page to "
645
  "ります。空欄の場合、サイトのホームが使用されます。\">リダイレクト先&thinsp;"
646
  "URL</dfn>"
647
 
648
+ #: admin/includes/tab-settings.php:371 admin/includes/tab-settings.php:869
649
  msgid ""
650
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
651
  "message</dfn>"
653
  "<dfn title=\"レスポンス・コード&thinsp;4xx、5xx&thinsp;用のメッセージを指定し"
654
  "ます。\">レスポンス・メッセージ</dfn>"
655
 
656
+ #: admin/includes/tab-settings.php:388
657
  msgid ""
658
  "<dfn title=\"This is applied to &#8220;XML-RPC&#8221; and &#8220;Login "
659
  "form&#8221;. Lockout period is defined as expiration time at &#8220;Cache "
663
  "時間は「キャッシュの設定」の「有効時間」で定義されます。\">IPアドレス当たりの"
664
  "ログイン試行可能回数</dfn>"
665
 
666
+ #: admin/includes/tab-settings.php:416
667
  msgid "Select when to run the validation."
668
  msgstr "検証を実行するタイミングを選択します。"
669
 
670
+ #: admin/includes/tab-settings.php:416
671
  msgid "Validation timing"
672
  msgstr "検証のタイミング"
673
 
674
+ #: admin/includes/tab-settings.php:427
675
  msgid "&#8220;init&#8221; action hook"
676
  msgstr "&#8220;init&#8221; アクション・フック"
677
 
678
+ #: admin/includes/tab-settings.php:428
679
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
680
  msgstr "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
681
 
682
+ #: admin/includes/tab-settings.php:431
683
  msgid ""
684
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
685
  "plugins."
687
  "標準的な他のプラグインと同様、init アクション・フックのタイミングで検証を実行"
688
  "します。"
689
 
690
+ #: admin/includes/tab-settings.php:432
691
  msgid ""
692
  "Validate at an earlier phase than other typical plugins. It can reduce load "
693
  "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
699
  "com/codex/validation-timing.html' title='Validation timing | IP Geo Block'>幾"
700
  "つかの制限事項</a>&thinsp;が生じます。"
701
 
702
+ #: admin/includes/tab-settings.php:442
703
  msgid "Back-end target settings"
704
  msgstr "バックエンドの設定"
705
 
706
+ #: admin/includes/tab-settings.php:448
707
  #, php-format
708
  msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
709
  msgstr "<dfn title=\"%s へのリクエストを検証します。\">%s</dfn>"
710
 
711
+ #: admin/includes/tab-settings.php:454
712
  msgid "Other areas"
713
  msgstr "その他のディレクトリ"
714
 
715
+ #: admin/includes/tab-settings.php:473 admin/includes/tab-settings.php:493
716
+ #: admin/includes/tab-settings.php:526 admin/includes/tab-settings.php:532
717
+ #: admin/includes/tab-settings.php:751
718
  msgid "Block by country"
719
  msgstr "国コードで遮断"
720
 
721
+ #: admin/includes/tab-settings.php:494
722
  msgid "Completely close"
723
  msgstr "完全に閉鎖"
724
 
725
+ #: admin/includes/tab-settings.php:527
726
  msgid ""
727
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
728
  "actions</dfn>"
729
  msgstr ""
730
  "<dfn title=\"遮断対象とするアクションを指定します。\">対象アクション</dfn>"
731
 
732
+ #: admin/includes/tab-settings.php:533
733
  msgid "Prevent Zero-day Exploit"
734
  msgstr "ゼロデイ攻撃を遮断"
735
 
736
+ #: admin/includes/tab-settings.php:537
737
  msgid ""
738
  "It will block a request related to the services for both public facing pages "
739
  "and the dashboard."
740
  msgstr ""
741
  "一般公開ページとダッシュボード向けサービスに関連するリクエストを遮断します。"
742
 
743
+ #: admin/includes/tab-settings.php:538
744
  msgid ""
745
  "Regardless of the country code, it will block a malicious request related to "
746
  "the services only for the dashboard."
748
  "国コードに拘らず、ダッシュボード向けサービスだけに関連する悪意のあるリクエス"
749
  "トを遮断します。"
750
 
751
+ #: admin/includes/tab-settings.php:564
752
+ msgid "admin post for logged-in user"
753
+ msgstr "認証済ユーザー用 admin post"
754
 
755
+ #: admin/includes/tab-settings.php:565
756
+ msgid "admin post for non logged-in user"
757
+ msgstr "未認証ユーザー用 admin post"
758
 
759
+ #: admin/includes/tab-settings.php:587
760
  msgid "Admin ajax/post"
761
  msgstr "管理領域&thinsp;ajax/post"
762
 
763
+ #: admin/includes/tab-settings.php:600
764
  msgid ""
765
  "<dfn title=\"Specify the page name (&#8220;page=&hellip;&#8221;) or the "
766
  "action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking "
767
  "caused by &#8220;Block by country&#8221; for non logged-in user and &#8220;"
768
  "Prevent Zero-day Exploit&#8221; for logged-in user.\">Exceptions</dfn>"
769
  msgstr ""
770
+ "<dfn title=\"「国コードで遮断」または「ゼロデイ攻撃を遮断」が、それぞれ認証済"
771
+ "みユーザー、認証済ユーザーを意図せず遮断する場合、検証対象から除外するリクエ"
772
+ "ストを特定するために、ページ名(&#8220;page=&hellip;&#8221; の &#8220;"
773
+ "&hellip;&#8221; 部分)、またはアクション名(&#8220;action=&hellip;&#8221; の "
774
+ "&#8220;&hellip;&#8221; 部分)を指定してください。\">除外する項目</dfn>"
775
+
776
+ #: admin/includes/tab-settings.php:600
777
+ msgid "Toggle with non logged-in user"
778
+ msgstr "未認証ユーザー用を含む項目に限定して表示"
779
 
780
+ #: admin/includes/tab-settings.php:605
781
  msgid "Candidate actions"
782
  msgstr "候補アクション"
783
 
784
+ #: admin/includes/tab-settings.php:613
785
  #, php-format
786
  msgid ""
787
  "Regardless of the country code, it will block a malicious request to <code>"
790
  "国コードに拘らず、<code>%s&hellip;/*.php</code>への悪意のあるリクエストを遮断"
791
  "します。"
792
 
793
+ #: admin/includes/tab-settings.php:614
 
 
 
 
 
 
 
 
 
794
  msgid ""
795
  "<dfn title=\"Select the item which causes undesired blocking in order to "
796
  "exclude from the validation target. Grayed item indicates &#8220;"
800
  "灰色で表示された項目は、「非アクティブ」であることを示しています。\">除外する"
801
  "項目</dfn>"
802
 
803
+ #: admin/includes/tab-settings.php:615
804
+ #, php-format
805
+ msgid ""
806
+ "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
807
+ "does not load WordPress core."
808
+ msgstr ""
809
+ "WordPressコアを読み込まないPHPファイルへのリクエストを検証対象とするため"
810
+ "に、%s を設定します。"
811
+
812
+ #: admin/includes/tab-settings.php:616
813
+ msgid "Sorry, but your server type is not supported."
814
+ msgstr "このサーバーではサポートされません。"
815
+
816
+ #: admin/includes/tab-settings.php:653 admin/includes/tab-settings.php:703
817
  msgid "Force to load WP core"
818
  msgstr "WPコアの読み込みを強制"
819
 
820
+ #: admin/includes/tab-settings.php:658
821
  msgid "Plugins area"
822
  msgstr "プラグイン領域"
823
 
824
+ #: admin/includes/tab-settings.php:708
825
  msgid "Themes area"
826
  msgstr "テーマ領域"
827
 
828
+ #: admin/includes/tab-settings.php:732
829
  msgid "Front-end target settings"
830
  msgstr "フロントエンドの設定"
831
 
832
+ #: admin/includes/tab-settings.php:756
833
  msgid "Follow &#8220;Validation rule settings&#8221;"
834
  msgstr "「検証ルールの設定」に従う"
835
 
836
+ #: admin/includes/tab-settings.php:818
837
  #, php-format
838
  msgid ""
839
  "<dfn title=\"You can configure a different response code from the Back-end. "
844
  "フィリエイト・プログラムに対する違反を防止するのに役立つでしょ"
845
  "う。\">Response code</dfn> %s"
846
 
847
+ #: admin/includes/tab-settings.php:884
848
  msgid ""
849
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
850
  msgstr "<dfn title=\"特定のページを遮断対象に指定します。\">ページ</dfn>"
851
 
852
+ #: admin/includes/tab-settings.php:896
853
  msgid ""
854
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
855
  "target.\">Post type</dfn>"
857
  "<dfn title=\"特定の投稿タイプのシングルページを遮断対象に指定します。\">投稿"
858
  "タイプ</dfn>"
859
 
860
+ #: admin/includes/tab-settings.php:908
861
  msgid ""
862
  "<dfn title=\"Specify the individual category on a single page or archive "
863
  "page as a blocking target.\">Category</dfn>"
865
  "<dfn title=\"特定のカテゴリを含むシングルページかアーカイブページを遮断対象に"
866
  "指定します。\">カテゴリ</dfn>"
867
 
868
+ #: admin/includes/tab-settings.php:920
869
  msgid ""
870
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
871
  "a blocking target.\">Tag</dfn>"
873
  "<dfn title=\"特定のタグを含むシングルページかアーカイブページを遮断対象に指定"
874
  "します。\">タグ</dfn>"
875
 
876
+ #: admin/includes/tab-settings.php:935
877
  msgid "Specify the validation target on front-end."
878
  msgstr "フロントエンドの検証対象を設定します。"
879
 
880
+ #: admin/includes/tab-settings.php:935
881
  msgid "Validation target"
882
  msgstr "検証対象"
883
 
884
+ #: admin/includes/tab-settings.php:946
885
  msgid "All requests"
886
  msgstr "全てのリクエスト"
887
 
888
+ #: admin/includes/tab-settings.php:947
889
  msgid "Specify the targets"
890
  msgstr "ターゲットを指定"
891
 
892
+ #: admin/includes/tab-settings.php:950
893
  msgid ""
894
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
895
  "wp&#8221; action hook. It means that this feature would not be compatible "
898
  "「検証のタイミング」が &#8220;wp&#8221; アクション・フックまで遅延されます。"
899
  "これにより、ページ・キャッシュとの互換性がなくなることに注意してください。"
900
 
901
+ #: admin/includes/tab-settings.php:960
902
  msgid ""
903
  "A part of user agent string and a qualification connected with a separator "
904
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
912
  "国コード、または&nbsp;IPアドレス(CIDR記法)が使えます。また否定を表す記号"
913
  "「!」を「条件」の直前に配置する事が出来ます。"
914
 
915
+ #: admin/includes/tab-settings.php:960
916
  msgid "UA string and qualification"
917
  msgstr "ユーザーエージェント文字列と条件"
918
 
919
+ #: admin/includes/tab-settings.php:979
920
  msgid "Specify the name of action that is invariably blocked."
921
  msgstr "遮断されるアクション名を指定します。"
922
 
923
+ #: admin/includes/tab-settings.php:979
924
  msgid "Excluded actions"
925
  msgstr "除外するアクション"
926
 
927
+ #: admin/includes/tab-settings.php:998
928
  msgid ""
929
  "It enables to verify the host by reverse DNS lookup which would spend some "
930
  "server resources. If it is disabled, &#8220;HOST&#8221; and &#8220;"
935
  "ます)。無効にした場合、「ユーザーエージェント文字列と条件」中の「HOST」、"
936
  "「HOST=&hellip;」は常に真となります。"
937
 
938
+ #: admin/includes/tab-settings.php:998
939
  msgid "DNS reverse lookup"
940
  msgstr "DNS&thinsp;逆引き"
941
 
942
+ #: admin/includes/tab-settings.php:1015
943
  msgid ""
944
  "It enables to simulate validation without deployment. The results can be "
945
  "found at &#8220;Public facing pages&#8221; in Logs."
947
  "機能を有効にする事なくリクエストの検証をシミュレートします。結果はログで確認"
948
  "する事が出来ます。"
949
 
950
+ #: admin/includes/tab-settings.php:1015
951
  msgid "Simulation mode"
952
  msgstr "シミュレーション・モード"
953
 
954
+ #: admin/includes/tab-settings.php:1033
955
  msgid "Geolocation API settings"
956
  msgstr "位置情報APIの設定"
957
 
958
+ #: admin/includes/tab-settings.php:1042
959
  msgid ""
960
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
961
  "selection and key settings</dfn>"
963
  "<dfn title=\"キャッシュとローカルのデータベースが最優先で検索されます。\">API"
964
  "の選択とキーの設定</dfn>"
965
 
966
+ #: admin/includes/tab-settings.php:1061
967
  msgid "Timeout for network API [sec]"
968
  msgstr "ネットワークAPIのタイムアウト[秒]"
969
 
970
+ #: admin/includes/tab-settings.php:1082
971
  #, php-format
972
  msgid ""
973
  "Can not find geolocation API libraries in <code>%s</code>. It seems to have "
992
  "IP Geo Block\">FAQ</a> を参照し、適切な書き込み権限と共に <code>ip-geo-api</"
993
  "code> をインストールしてください。"
994
 
995
+ #: admin/includes/tab-settings.php:1090
996
  msgid "Local database settings"
997
  msgstr "ローカル・データベースの設定"
998
 
999
+ #: admin/includes/tab-settings.php:1104
1000
  msgid "database"
1001
  msgstr "ファイル"
1002
 
1003
+ #: admin/includes/tab-settings.php:1105
1004
+ #: classes/class-ip-geo-block-cron.php:334
1005
  #, php-format
1006
  msgid "Last update: %s"
1007
  msgstr "最終更新:%s"
1008
 
1009
+ #: admin/includes/tab-settings.php:1114
1010
  msgid "Auto updating (once a month)"
1011
  msgstr "自動更新(月1回)"
1012
 
1013
+ #: admin/includes/tab-settings.php:1131
1014
  msgid "Download database"
1015
  msgstr "データベースのダウンロード"
1016
 
1017
+ #: admin/includes/tab-settings.php:1139
1018
  msgid "Download now"
1019
  msgstr "今すぐダウンロード"
1020
 
1021
+ #: admin/includes/tab-settings.php:1150
1022
  msgid "Record settings"
1023
  msgstr "記録の設定"
1024
 
1025
+ #: admin/includes/tab-settings.php:1159
1026
  msgid "Record validation statistics"
1027
  msgstr "検証の統計を記録"
1028
 
1029
+ #: admin/includes/tab-settings.php:1175
1030
  msgid "Record validation logs"
1031
  msgstr "検証のログを記録"
1032
 
1033
+ #: admin/includes/tab-settings.php:1187
1034
  msgid "Only when blocked"
1035
  msgstr "遮断時に記録"
1036
 
1037
+ #: admin/includes/tab-settings.php:1188
1038
  msgid "Only when passed"
1039
  msgstr "通過時に記録"
1040
 
1041
+ #: admin/includes/tab-settings.php:1189
1042
  msgid "Unauthenticated user"
1043
  msgstr "未認証ユーザーを記録"
1044
 
1045
+ #: admin/includes/tab-settings.php:1190
1046
  msgid "Authenticated user"
1047
  msgstr "認証済ユーザーを記録"
1048
 
1049
+ #: admin/includes/tab-settings.php:1191
1050
  msgid "All of validation"
1051
  msgstr "すべての検証を記録"
1052
 
1053
+ #: admin/includes/tab-settings.php:1200
1054
  msgid "Recording period of the logs (days)"
1055
  msgstr "ログの記録期間(日)"
1056
 
1057
+ #: admin/includes/tab-settings.php:1216
1058
  msgid "Maximum length of logs for each target"
1059
  msgstr "ログの記録最大数"
1060
 
1061
+ #: admin/includes/tab-settings.php:1233
1062
  msgid ""
1063
  "<dfn title=\"e.g. action, comment, log, pwd, FILES\">$_POST keys to be "
1064
  "recorded with their values in logs</dfn>"
1066
  "<dfn title=\"例)action, comment, log, pwd, FILES\">ログに記録する際に内容を"
1067
  "展開する$_POSTのキー</dfn>"
1068
 
1069
+ #: admin/includes/tab-settings.php:1251
1070
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
1071
  msgstr "<dfn title=\"例)123.456.789.***\">IPアドレスを匿名化する</dfn>"
1072
 
1073
+ #: admin/includes/tab-settings.php:1268
1074
  msgid "IP address cache settings"
1075
  msgstr "IPアドレスのキャッシュ設定"
1076
 
1077
+ #: admin/includes/tab-settings.php:1277
1078
  #, php-format
1079
  msgid ""
1080
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
1084
  "<dfn title=\"ユーザ認証が連続%d回失敗した場合も、以降のログインがこの期間だけ"
1085
  "(ガベージコレクション周期を含む)禁止されます。\">有効時間 [sec]</dfn>"
1086
 
1087
+ #: admin/includes/tab-settings.php:1293
1088
  msgid "Garbage collection period [sec]"
1089
  msgstr "ガベージコレクション周期 [秒]"
1090
 
1091
+ #: admin/includes/tab-settings.php:1310
1092
  msgid "Number of entries to be displayed in cache"
1093
  msgstr "「キャッシュ中のIPアドレス」に表示する最大数"
1094
 
1095
+ #: admin/includes/tab-settings.php:1328
1096
  msgid "Submission settings"
1097
  msgstr "投稿時の設定"
1098
 
1099
+ #: admin/includes/tab-settings.php:1340
1100
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
1101
  msgstr "全体が&lt;p&gt;タグで囲われます。使用可能タグ:"
1102
 
1103
+ #: admin/includes/tab-settings.php:1340
1104
  msgid "Message on comment form"
1105
  msgstr "投稿フォーム上のメッセージ"
1106
 
1107
+ #: admin/includes/tab-settings.php:1352
1108
  msgid "None"
1109
  msgstr "なし"
1110
 
1111
+ #: admin/includes/tab-settings.php:1353
1112
  msgid "Top"
1113
  msgstr "上部"
1114
 
1115
+ #: admin/includes/tab-settings.php:1354
1116
  msgid "Bottom"
1117
  msgstr "下部"
1118
 
1119
+ #: admin/includes/tab-settings.php:1365
1120
  msgid "Plugin settings"
1121
  msgstr "プラグインの設定"
1122
 
1123
+ #: admin/includes/tab-settings.php:1378
1124
+ msgid ""
1125
+ "<dfn title=\"Synchronize all settings over the network wide.\">Network wide "
1126
+ "settings</dfn>"
1127
+ msgstr ""
1128
+ "<dfn title=\"全ての設定をネットワーク全体で同期させます。\">ネットワークの一"
1129
+ "括設定</dfn>"
1130
+
1131
+ #: admin/includes/tab-settings.php:1396
1132
  msgid "Remove all settings at uninstallation"
1133
  msgstr "アンインストール時に全設定を削除"
1134
 
1135
+ #: admin/includes/tab-settings.php:1414
1136
  msgid ""
1137
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
1138
  "dfn>"
1140
  "<dfn title=\"Google Maps JavaScript API に有効なキー\">Google Maps API キー</"
1141
  "dfn>"
1142
 
1143
+ #: admin/includes/tab-settings.php:1428
1144
  msgid ""
1145
  "You need to click the &#8220;Save Changes&#8221; button for imported "
1146
  "settings to take effect."
1148
  "インポートされた設定を有効にするには、「変更を保存」ボタンをクリックする必要"
1149
  "があります。"
1150
 
1151
+ #: admin/includes/tab-settings.php:1434
1152
  msgid "Export / Import settings"
1153
  msgstr "設定のエクスポート、インポート"
1154
 
1155
+ #: admin/includes/tab-settings.php:1441
1156
  msgid "Export settings"
1157
  msgstr "エクスポート"
1158
 
1159
+ #: admin/includes/tab-settings.php:1442
1160
  msgid "Import from the local file"
1161
  msgstr "ローカル・ファイルからインポートします"
1162
 
1163
+ #: admin/includes/tab-settings.php:1442
1164
  msgid "Import settings"
1165
  msgstr "インポート"
1166
 
1167
+ #: admin/includes/tab-settings.php:1451
1168
  msgid "Import pre-defined settings"
1169
  msgstr "プリセットのインポート"
1170
 
1171
+ #: admin/includes/tab-settings.php:1458
1172
  msgid ""
1173
  "Import the default settings to revert to the &#8220;Right after "
1174
  "installing&#8221; state"
1175
  msgstr "インストール直後の状態に戻すための設定値をインポートします"
1176
 
1177
+ #: admin/includes/tab-settings.php:1458
1178
  msgid "Default settings"
1179
  msgstr "初期設定"
1180
 
1181
+ #: admin/includes/tab-settings.php:1459
1182
  msgid ""
1183
  "Import the preferred settings mainly by enabling Zero-day Exploit Prevention "
1184
  "for the &#8220;Back-end target settings&#8221;"
1186
  "「ゼロデイ攻撃の遮断」など、主に「バックエンドの設定」に推奨される設定をイン"
1187
  "ポートします。"
1188
 
1189
+ #: admin/includes/tab-settings.php:1459
1190
  msgid "Best for Back-end"
1191
  msgstr "バックエンドの推奨設定"
1192
 
1193
+ #: admin/includes/tab-settings.php:1469
1194
  msgid "Delete DB table for validation logs"
1195
  msgstr "検証のログ用データベース・テーブルの削除"
1196
 
1197
+ #: admin/includes/tab-settings.php:1477
1198
  msgid "Delete now"
1199
  msgstr "今すぐ削除"
1200
 
1201
+ #: admin/includes/tab-settings.php:1485
1202
  msgid "Create DB table for validation logs"
1203
  msgstr "検証のログ用データベース・テーブルの作成"
1204
 
1205
+ #: admin/includes/tab-settings.php:1493
1206
  msgid "Create now"
1207
  msgstr "今すぐ作成"
1208
 
1209
+ #: admin/includes/tab-settings.php:1503
1210
  msgid ""
1211
  "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
1212
+ "forum.\">System information</dfn><br />[ <a rel=\"noreferrer\" href="
1213
  "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
1214
  "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
1215
  msgstr ""
1216
  "<dfn title=\"フォーラムに問題を投稿する際、コピーして張り付けてください。\">"
1217
+ "システム情報</dfn><br />[ <a rel=\"noreferrer\" href=\"https://wordpress.org/"
1218
+ "support/plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP "
1219
+ "Geo Block\">サポートフォーラム</a> ]"
1220
 
1221
+ #: admin/includes/tab-settings.php:1510
1222
  msgid "Show PHP, WordPress, theme and plugins information."
1223
  msgstr "PHP、WordPress、テーマ、プラグインの情報を表示します。"
1224
 
1225
+ #: admin/includes/tab-settings.php:1510
1226
  msgid "Show information"
1227
  msgstr "情報を表示"
1228
 
1229
+ #: admin/includes/tab-settings.php:1526
1230
  msgid ""
1231
  "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
1232
  "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
1238
  "\" title=\"The best practice for target settings | IP Geo Block\">The best "
1239
  "practice fortarget settings</a>&#8220;&thinsp;を参照してください。"
1240
 
1241
+ #: admin/includes/tab-settings.php:1527
1242
  msgid ""
1243
  "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
1244
  "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
1252
  "com/codex/#faq\" title=\"Codex | IP Geo Block\">Codex</a> の FAQ を参照してく"
1253
  "ださい。"
1254
 
1255
+ #: admin/includes/tab-settings.php:1534
1256
  msgid ""
1257
  "While Maxmind and IP2Location will fetch the local database, others will "
1258
  "pass an IP address to the APIs via HTTP."
1260
  "MaxmindとIP2Locationはローカルのデータベースを検索しますが、他はHTTPを介して"
1261
  "APIにIPアドレスを渡します。"
1262
 
1263
+ #: admin/includes/tab-settings.php:1535
1264
  msgid ""
1265
  "Please select the appropriate APIs to fit the privacy law in your country."
1266
  msgstr "自国のプライバシー関連法規に合わせ、適切なAPIを選択して下さい。"
1267
 
1268
+ #: admin/includes/tab-settings.php:1542
1269
  msgid ""
1270
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1271
  "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
1277
  "end\" title=\"Codex | IP Geo Block\">Blocking on front-end</a>&#8221; を参照"
1278
  "してください。"
1279
 
1280
+ #: admin/includes/tab-settings.php:1543
1281
  msgid ""
1282
  "If you find any issues or have something to suggest, please feel free to "
1283
  "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
1289
  "&#8250; Support &raquo; IP Geo Block\">サポートフォーラム</a> に投稿をお願い"
1290
  "します。"
1291
 
1292
+ #: admin/includes/tab-settings.php:1550
1293
  msgid ""
1294
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1295
  "ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
1299
  "record-settings-and-logs.html\" title=\"Codex | IP Geo Block\">Record "
1300
  "settings and logs</a>&#8221; を参照ください。"
1301
 
1302
+ #: admin/includes/tab-statistics.php:21 admin/includes/tab-statistics.php:207
1303
  msgid "Statistics of validation"
1304
  msgstr "検証の統計"
1305
 
1306
+ #: admin/includes/tab-statistics.php:30
1307
  msgid "Blocked"
1308
  msgstr "全遮断数"
1309
 
1310
+ #: admin/includes/tab-statistics.php:55
1311
  msgid "Blocked by countries"
1312
  msgstr "国別遮断数"
1313
 
1314
+ #: admin/includes/tab-statistics.php:96
1315
  msgid "Blocked per day"
1316
  msgstr "1日あたりの遮断数"
1317
 
1318
+ #: admin/includes/tab-statistics.php:112
1319
  msgid "Blocked by type of IP address"
1320
  msgstr "遮断したIPアドレスのタイプ"
1321
 
1322
+ #: admin/includes/tab-statistics.php:130
1323
  msgid "Name of API"
1324
  msgstr "API名"
1325
 
1326
+ #: admin/includes/tab-statistics.php:131
1327
  msgid "Calls"
1328
  msgstr "リクエスト回数"
1329
 
1330
+ #: admin/includes/tab-statistics.php:132
1331
  msgid "Response [msec]"
1332
  msgstr "応答時間 [msec]"
1333
 
1334
+ #: admin/includes/tab-statistics.php:146
1335
  msgid "Average response time of each API"
1336
  msgstr "API毎の平均応答時間"
1337
 
1338
+ #: admin/includes/tab-statistics.php:162
1339
  msgid "Clear statistics"
1340
  msgstr "統計のクリア"
1341
 
1342
+ #: admin/includes/tab-statistics.php:180
1343
+ msgid "Statistics in logs"
1344
+ msgstr "ログの統計"
1345
+
1346
+ #: admin/includes/tab-statistics.php:232
1347
  msgid "Statistics in cache"
1348
  msgstr "キャッシュの統計"
1349
 
1350
+ #: admin/includes/tab-statistics.php:240
1351
  msgid "Country code / Access"
1352
  msgstr "国コード / アクセス先"
1353
 
1354
+ #: admin/includes/tab-statistics.php:241
1355
  msgid "Elapsed [sec] / Calls"
1356
  msgstr "経過時間 [sec] / 回数"
1357
 
1358
+ #: admin/includes/tab-statistics.php:274
1359
  msgid "IP address in cache"
1360
  msgstr "キャッシュ中のIPアドレス"
1361
 
1362
+ #: admin/includes/tab-statistics.php:289
1363
  msgid "Clear cache"
1364
  msgstr "キャッシュのクリア"
1365
 
1366
+ #: admin/includes/tab-statistics.php:308
1367
  msgid ""
1368
  "Current setting of [<strong>Record validation statistics</strong>] on "
1369
  "[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
1371
  "現在[<strong>設定</strong>]タブの[<strong>検証の統計を記録</strong>]は"
1372
  "[<strong>有効</strong>]が選択されていません。"
1373
 
1374
+ #: admin/includes/tab-statistics.php:309
1375
  msgid ""
1376
  "Please set the proper condition to record and analyze the validation "
1377
  "statistics."
1378
  msgstr "検証の統計を記録し分析するためには、適切な条件を設定して下さい。"
1379
 
1380
+ #: admin/includes/tab-statistics.php:323
1381
+ msgid "Country (Top 10)"
1382
+ msgstr "国(トップ10)"
1383
+
1384
+ #: admin/includes/tab-statistics.php:324
1385
+ msgid "AS number (Top 10)"
1386
+ msgstr "AS番号(トップ10)"
1387
+
1388
+ #: admin/includes/tab-statistics.php:325
1389
+ msgid "IP address (Top 10)"
1390
+ msgstr "IPアドレス(トップ10)"
1391
+
1392
+ #: admin/includes/tab-statistics.php:326
1393
+ msgid "Slug in back-end"
1394
+ msgstr "バックエンドのスラッグ"
1395
+
1396
+ #: classes/class-ip-geo-block-apis.php:653
1397
  msgid ""
1398
  "You need to select at least one IP geolocation service. Otherwise "
1399
  "<strong>you'll be blocked</strong> after the cache expires."
1401
  "少なくとも1つ以上の位置情報サービスを選択して下さい。未選択の場合、キャッシュ"
1402
  "の有効期限切れと共にロックアウトされます。"
1403
 
1404
+ #: classes/class-ip-geo-block-cron.php:240
1405
  msgid "Your database file is up-to-date."
1406
  msgstr "データベース・ファイルは最新です。"
1407
 
1408
+ #: classes/class-ip-geo-block-cron.php:278
 
 
 
 
 
 
 
1409
  #, php-format
1410
+ msgid "Can't lock <code>%s</code>. Please try again after a while."
1411
+ msgstr "<code>%s</code> をロックできません。パーミッションを確認して下さい。"
1412
 
1413
+ #: classes/class-ip-geo-block-cron.php:310
1414
  msgid "gz or zip is not supported on your system."
1415
  msgstr "gz または zip がサポートされていません。"
1416
 
1441
  "php#WordPress_Upgrade_Constants\" title=\"Editing wp-config.php &laquo; "
1442
  "WordPress Codex\">このドキュメント</a>を参照してください。"
1443
 
1444
+ #: classes/class-ip-geo-block-logs.php:165
1445
  #, php-format
1446
  msgid ""
1447
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1450
  "%s 用のテーブルが作成されていません。一旦このプラグインを無効化し、再度有効化"
1451
  "して下さい。"
1452
 
1453
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:150
1454
+ #: wp-content/ip-geo-api/maxmind/class-maxmind.php:210
 
 
1455
  msgid "Database file does not exist."
1456
  msgstr "データベース・ファイルが見つかりません。"
1457
 
languages/ip-geo-block.mo CHANGED
Binary file
languages/ip-geo-block.po CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: IP Geo Block 3.0.3.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
- "POT-Creation-Date: 2017-07-21 22:43+0900\n"
8
- "PO-Revision-Date: 2017-07-21 22:45+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -25,53 +25,64 @@ msgid ""
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
- #: admin/class-ip-geo-block-admin.php:227
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
- #: admin/class-ip-geo-block-admin.php:228
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
- #: admin/class-ip-geo-block-admin.php:229
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
- #: admin/class-ip-geo-block-admin.php:230
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
- #: admin/class-ip-geo-block-admin.php:231
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
- #: admin/class-ip-geo-block-admin.php:232
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
- #: admin/class-ip-geo-block-admin.php:233
 
 
 
 
 
 
 
 
53
  msgid "This feature is available with HTML5 compliant browsers."
54
  msgstr ""
55
 
56
- #: admin/class-ip-geo-block-admin.php:246
57
  msgid "Contribute at GitHub"
58
  msgstr ""
59
 
60
- #: admin/class-ip-geo-block-admin.php:263
61
- #: admin/class-ip-geo-block-admin.php:508
 
62
  msgid "Settings"
63
  msgstr ""
64
 
65
- #: admin/class-ip-geo-block-admin.php:318
66
- #: admin/class-ip-geo-block-admin.php:319
 
 
67
  msgid "IP Geo Block"
68
  msgstr ""
69
 
70
- #: admin/class-ip-geo-block-admin.php:340
71
  msgid "You need WordPress 3.7+."
72
  msgstr ""
73
 
74
- #: admin/class-ip-geo-block-admin.php:346
75
  #, php-format
76
  msgid ""
77
  "Now downloading geolocation databases in background. After a little while, "
@@ -79,207 +90,231 @@ msgid ""
79
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
80
  msgstr ""
81
 
82
- #: admin/class-ip-geo-block-admin.php:352
83
  #, php-format
84
  msgid ""
85
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
86
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
87
  msgstr ""
88
 
89
- #: admin/class-ip-geo-block-admin.php:361
90
  msgid "Local database and matching rule have been updated."
91
  msgstr ""
92
 
93
- #: admin/class-ip-geo-block-admin.php:372
94
  msgid ""
95
  "Once you logout, you will be unable to login again because the number of "
96
  "login attempts reaches the limit."
97
  msgstr ""
98
 
99
- #: admin/class-ip-geo-block-admin.php:374
100
  #, php-format
101
  msgid ""
102
  "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
103
  "tab</a> to prevent locking yourself out."
104
  msgstr ""
105
 
106
- #: admin/class-ip-geo-block-admin.php:384
107
  msgid ""
108
  "Once you logout, you will be unable to login again because your country code "
109
  "or IP address is in the blacklist."
110
  msgstr ""
111
 
112
- #: admin/class-ip-geo-block-admin.php:385
113
  msgid ""
114
  "Once you logout, you will be unable to login again because your country code "
115
  "or IP address is not in the whitelist."
116
  msgstr ""
117
 
118
- #: admin/class-ip-geo-block-admin.php:388
119
  #, php-format
120
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
121
  msgstr ""
122
 
123
- #: admin/class-ip-geo-block-admin.php:399
124
  msgid ""
125
  "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
126
  "timing&#8221; is imcompatible with <strong>IP Geo Allow</strong>. Please "
127
  "select &#8220;init&#8221; action hook."
128
  msgstr ""
129
 
130
- #: admin/class-ip-geo-block-admin.php:509
131
  msgid "Statistics"
132
  msgstr ""
133
 
134
- #: admin/class-ip-geo-block-admin.php:510
135
  msgid "Logs"
136
  msgstr ""
137
 
138
- #: admin/class-ip-geo-block-admin.php:511
139
  msgid "Search"
140
  msgstr ""
141
 
142
- #: admin/class-ip-geo-block-admin.php:512
 
 
 
 
 
143
  msgid "Attribution"
144
  msgstr ""
145
 
146
- #: admin/class-ip-geo-block-admin.php:522
 
 
 
 
147
  msgid "Toggle all"
148
  msgstr ""
149
 
150
- #: admin/class-ip-geo-block-admin.php:544
151
  msgid "Thanks for providing these great services for free."
152
  msgstr ""
153
 
154
- #: admin/class-ip-geo-block-admin.php:545
155
  msgid ""
156
  "(Most browsers will redirect you to each site <a href=\"http://www."
157
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
158
  "when you click the link</a>.)"
159
  msgstr ""
160
 
161
- #: admin/class-ip-geo-block-admin.php:550
162
  msgid "Back to top"
163
  msgstr ""
164
 
165
- #: admin/class-ip-geo-block-admin.php:646
166
  msgid "Enable"
167
  msgstr ""
168
 
169
- #: admin/class-ip-geo-block-admin.php:1030
170
- #: classes/class-ip-geo-block-cron.php:274
171
- #: classes/class-ip-geo-block-cron.php:306
 
 
172
  #, php-format
173
- msgid "Unable to write %s. Please check the permission."
174
  msgstr ""
175
 
176
- #: admin/class-ip-geo-block-admin.php:1031
177
- #, php-format
178
- msgid "Or please refer to %s to set it manually."
179
- msgid_plural "Or please refer to %s to set them manually."
180
- msgstr[0] ""
181
- msgstr[1] ""
182
-
183
- #: admin/class-ip-geo-block-admin.php:1041
184
- #: classes/class-ip-geo-block-opts.php:385
185
- #, php-format
186
- msgid "Unable to write <code>%s</code>. Please check the permission."
187
  msgstr ""
188
 
189
- #: admin/includes/class-admin-ajax.php:60
190
  msgid "n/a"
191
  msgstr ""
192
 
193
- #: admin/includes/class-admin-ajax.php:63 admin/includes/tab-settings.php:81
194
- #: admin/includes/tab-settings.php:101
195
  msgid "UNKNOWN"
196
  msgstr ""
197
 
198
- #: admin/includes/class-admin-ajax.php:244
199
  #, php-format
200
  msgid ""
201
  "illegal format at %s. Please delete the corresponding line and try again."
202
  msgstr ""
203
 
204
- #: admin/includes/tab-accesslog.php:20 admin/includes/tab-accesslog.php:99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  msgid "Validation logs"
206
  msgstr ""
207
 
208
- #: admin/includes/tab-accesslog.php:29
209
  msgid "Filter logs"
210
  msgstr ""
211
 
212
- #: admin/includes/tab-accesslog.php:38
213
  msgid "Reset"
214
  msgstr ""
215
 
216
- #: admin/includes/tab-accesslog.php:45
217
  msgid "Clear logs"
218
  msgstr ""
219
 
220
- #: admin/includes/tab-accesslog.php:53 admin/includes/tab-statistics.php:173
221
- #: admin/includes/tab-statistics.php:277
222
  msgid "Clear now"
223
  msgstr ""
224
 
225
- #: admin/includes/tab-accesslog.php:61
226
  msgid "Export logs"
227
  msgstr ""
228
 
229
- #: admin/includes/tab-accesslog.php:67 admin/includes/tab-settings.php:1450
230
  msgid "Export to the local file"
231
  msgstr ""
232
 
233
- #: admin/includes/tab-accesslog.php:67
234
  msgid "Export csv"
235
  msgstr ""
236
 
237
- #: admin/includes/tab-accesslog.php:73
238
  #, php-format
239
  msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
240
  msgstr ""
241
 
242
- #: admin/includes/tab-accesslog.php:75 admin/includes/tab-settings.php:453
243
  msgid "Comment post"
244
  msgstr ""
245
 
246
- #: admin/includes/tab-accesslog.php:76 admin/includes/tab-settings.php:454
247
  msgid "XML-RPC"
248
  msgstr ""
249
 
250
- #: admin/includes/tab-accesslog.php:77 admin/includes/tab-settings.php:455
251
  msgid "Login form"
252
  msgstr ""
253
 
254
- #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:456
255
  msgid "Admin area"
256
  msgstr ""
257
 
258
- #: admin/includes/tab-accesslog.php:79 admin/includes/tab-settings.php:458
259
  msgid "public facing pages"
260
  msgstr ""
261
 
262
- #: admin/includes/tab-accesslog.php:79 admin/includes/tab-settings.php:458
263
  msgid "Public facing pages"
264
  msgstr ""
265
 
266
- #: admin/includes/tab-accesslog.php:132
267
  msgid "Date"
268
  msgstr ""
269
 
270
- #: admin/includes/tab-accesslog.php:133 admin/includes/tab-geolocation.php:67
271
- #: admin/includes/tab-statistics.php:219
272
  msgid "IP address"
273
  msgstr ""
274
 
275
- #: admin/includes/tab-accesslog.php:134
276
  msgid "Code"
277
  msgstr ""
278
 
279
- #: admin/includes/tab-accesslog.php:135
280
  msgid "Result"
281
  msgstr ""
282
 
 
 
 
 
283
  #: admin/includes/tab-accesslog.php:136
284
  msgid "Request"
285
  msgstr ""
@@ -327,46 +362,46 @@ msgstr ""
327
  msgid "Search now"
328
  msgstr ""
329
 
330
- #: admin/includes/tab-settings.php:49
331
  msgid "Validation rule settings"
332
  msgstr ""
333
 
334
- #: admin/includes/tab-settings.php:73
335
  msgid ""
336
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
337
  "code by referring &#8220;Scan country code&#8221;.\">Your IP address / "
338
  "Country</dfn>"
339
  msgstr ""
340
 
341
- #: admin/includes/tab-settings.php:82 admin/includes/tab-settings.php:102
342
  msgid "Scan all the APIs you selected at Geolocation API settings"
343
  msgstr ""
344
 
345
- #: admin/includes/tab-settings.php:82 admin/includes/tab-settings.php:102
346
  msgid "Scan country code"
347
  msgstr ""
348
 
349
- #: admin/includes/tab-settings.php:93
350
  msgid ""
351
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
352
  "code by referring &#8220;Scan country code&#8221;.\">Server IP address / "
353
  "Country</dfn>"
354
  msgstr ""
355
 
356
- #: admin/includes/tab-settings.php:110
357
  msgid "Whitelist"
358
  msgstr ""
359
 
360
- #: admin/includes/tab-settings.php:111
361
  msgid "Blacklist"
362
  msgstr ""
363
 
364
- #: admin/includes/tab-settings.php:115
365
  msgid ""
366
  "Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;."
367
  msgstr ""
368
 
369
- #: admin/includes/tab-settings.php:116
370
  msgid ""
371
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
372
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
@@ -376,7 +411,7 @@ msgid ""
376
  "country code</dfn>"
377
  msgstr ""
378
 
379
- #: admin/includes/tab-settings.php:117
380
  msgid ""
381
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
382
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
@@ -386,44 +421,61 @@ msgid ""
386
  "country code</dfn>"
387
  msgstr ""
388
 
389
- #: admin/includes/tab-settings.php:121
390
  msgid "(comma separated)"
391
  msgstr ""
392
 
393
- #: admin/includes/tab-settings.php:122
394
  msgid "(comma or RET separated)"
395
  msgstr ""
396
 
397
- #: admin/includes/tab-settings.php:129 admin/includes/tab-settings.php:789
 
 
 
 
398
  msgid "Matching rule"
399
  msgstr ""
400
 
401
- #: admin/includes/tab-settings.php:141
402
  msgid ""
403
  "A request from which the country code or IP address is <strong>NOT</strong> "
404
  "in the whitelist will be blocked."
405
  msgstr ""
406
 
407
- #: admin/includes/tab-settings.php:142
408
  msgid ""
409
  "A request from which the country code or IP address is in the blacklist will "
410
  "be blocked."
411
  msgstr ""
412
 
413
- #: admin/includes/tab-settings.php:188
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  msgid ""
415
  "<dfn title=\"e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, "
416
- "&#8220;69.46.36.0/27&#8221; for WordFence server\">Whitelist of extra IP "
417
- "addresses prior to country code</dfn>"
418
  msgstr ""
419
 
420
- #: admin/includes/tab-settings.php:207
421
  msgid ""
422
  "<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
423
  "\">Blacklist of extra IP addresses prior to country code</dfn>"
424
  msgstr ""
425
 
426
- #: admin/includes/tab-settings.php:227
427
  msgid ""
428
  "<dfn title=\"If your server is placed behind the proxy server or the load "
429
  "balancing server, you need to put the appropriate key such as &#8220;"
@@ -432,7 +484,7 @@ msgid ""
432
  "addresses</dfn>"
433
  msgstr ""
434
 
435
- #: admin/includes/tab-settings.php:246
436
  msgid ""
437
  "<dfn title=\"It validates malicious signatures independently of &#8220;Block "
438
  "by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target "
@@ -443,47 +495,62 @@ msgid ""
443
  "restore.\"><span></span></a>)</nobr>"
444
  msgstr ""
445
 
446
- #: admin/includes/tab-settings.php:260
447
  msgid ""
448
  "<dfn title=\"Select allowed MIME type.\">Whitelist of allowed MIME type</dfn>"
449
  msgstr ""
450
 
451
- #: admin/includes/tab-settings.php:271
452
  msgid ""
453
  "<dfn title=\"Put forbidden file extensions.\">Blacklist of forbidden file "
454
  "extensions</dfn>"
455
  msgstr ""
456
 
457
- #: admin/includes/tab-settings.php:278
 
 
 
 
 
 
 
 
458
  msgid ""
459
- "<dfn title=\"It restricts the file types on upload to block malware and "
460
- "backdoor via both back-end and front-end. Please consider to select &#8220;"
461
- "mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation timing&#8221; "
462
- "so that other staff would not fetch uploaded files before this validation."
463
- "\">Prevent malicious file uploading</dfn>"
464
  msgstr ""
465
 
466
- #: admin/includes/tab-settings.php:289 admin/includes/tab-settings.php:495
467
- #: admin/includes/tab-settings.php:638 admin/includes/tab-settings.php:1214
 
 
 
 
 
 
 
 
 
468
  msgid "Disable"
469
  msgstr ""
470
 
471
- #: admin/includes/tab-settings.php:290
472
- msgid "Verify capability and MIME type"
473
  msgstr ""
474
 
475
- #: admin/includes/tab-settings.php:291
476
- msgid "Verify only file extension"
477
  msgstr ""
478
 
479
- #: admin/includes/tab-settings.php:326
480
  #, php-format
481
  msgid ""
482
  "<dfn title=\"You can put your original 403.php and so on into your theme "
483
  "directory.\">Response code</dfn> %s"
484
  msgstr ""
485
 
486
- #: admin/includes/tab-settings.php:356 admin/includes/tab-settings.php:876
487
  msgid ""
488
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. If it is pointed "
489
  "to a public facing page, visitors would not be blocked on the page to "
@@ -492,42 +559,42 @@ msgid ""
492
  "\">Redirect URL</dfn>"
493
  msgstr ""
494
 
495
- #: admin/includes/tab-settings.php:373 admin/includes/tab-settings.php:894
496
  msgid ""
497
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
498
  "message</dfn>"
499
  msgstr ""
500
 
501
- #: admin/includes/tab-settings.php:390
502
  msgid ""
503
  "<dfn title=\"This is applied to &#8220;XML-RPC&#8221; and &#8220;Login "
504
  "form&#8221;. Lockout period is defined as expiration time at &#8220;Cache "
505
  "settings&#8221;.\">Max number of failed login attempts per IP address</dfn>"
506
  msgstr ""
507
 
508
- #: admin/includes/tab-settings.php:418
509
  msgid "Select when to run the validation."
510
  msgstr ""
511
 
512
- #: admin/includes/tab-settings.php:418
513
  msgid "Validation timing"
514
  msgstr ""
515
 
516
- #: admin/includes/tab-settings.php:429
517
  msgid "&#8220;init&#8221; action hook"
518
  msgstr ""
519
 
520
- #: admin/includes/tab-settings.php:430
521
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
522
  msgstr ""
523
 
524
- #: admin/includes/tab-settings.php:433
525
  msgid ""
526
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
527
  "plugins."
528
  msgstr ""
529
 
530
- #: admin/includes/tab-settings.php:434
531
  msgid ""
532
  "Validate at an earlier phase than other typical plugins. It can reduce load "
533
  "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
@@ -535,64 +602,64 @@ msgid ""
535
  "restrictions</a>."
536
  msgstr ""
537
 
538
- #: admin/includes/tab-settings.php:445
539
  msgid "Back-end target settings"
540
  msgstr ""
541
 
542
- #: admin/includes/tab-settings.php:451
543
  #, php-format
544
  msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
545
  msgstr ""
546
 
547
- #: admin/includes/tab-settings.php:457
548
  msgid "Other areas"
549
  msgstr ""
550
 
551
- #: admin/includes/tab-settings.php:476 admin/includes/tab-settings.php:496
552
- #: admin/includes/tab-settings.php:529 admin/includes/tab-settings.php:535
553
- #: admin/includes/tab-settings.php:777
554
  msgid "Block by country"
555
  msgstr ""
556
 
557
- #: admin/includes/tab-settings.php:497
558
  msgid "Completely close"
559
  msgstr ""
560
 
561
- #: admin/includes/tab-settings.php:530
562
  msgid ""
563
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
564
  "actions</dfn>"
565
  msgstr ""
566
 
567
- #: admin/includes/tab-settings.php:536
568
  msgid "Prevent Zero-day Exploit"
569
  msgstr ""
570
 
571
- #: admin/includes/tab-settings.php:540
572
  msgid ""
573
  "It will block a request related to the services for both public facing pages "
574
  "and the dashboard."
575
  msgstr ""
576
 
577
- #: admin/includes/tab-settings.php:541
578
  msgid ""
579
  "Regardless of the country code, it will block a malicious request related to "
580
  "the services only for the dashboard."
581
  msgstr ""
582
 
583
- #: admin/includes/tab-settings.php:592
584
- msgid "for logged-in user"
585
  msgstr ""
586
 
587
- #: admin/includes/tab-settings.php:593
588
- msgid "for non logged-in user"
589
  msgstr ""
590
 
591
- #: admin/includes/tab-settings.php:614
592
  msgid "Admin ajax/post"
593
  msgstr ""
594
 
595
- #: admin/includes/tab-settings.php:627
596
  msgid ""
597
  "<dfn title=\"Specify the page name (&#8220;page=&hellip;&#8221;) or the "
598
  "action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking "
@@ -600,52 +667,60 @@ msgid ""
600
  "Prevent Zero-day Exploit&#8221; for logged-in user.\">Exceptions</dfn>"
601
  msgstr ""
602
 
603
- #: admin/includes/tab-settings.php:632
 
 
 
 
604
  msgid "Candidate actions"
605
  msgstr ""
606
 
607
- #: admin/includes/tab-settings.php:640
608
  #, php-format
609
  msgid ""
610
  "Regardless of the country code, it will block a malicious request to <code>"
611
  "%s&ctdot;/*.php</code>."
612
  msgstr ""
613
 
614
- #: admin/includes/tab-settings.php:641
 
 
 
 
 
 
 
615
  #, php-format
616
  msgid ""
617
  "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
618
  "does not load WordPress core."
619
  msgstr ""
620
 
621
- #: admin/includes/tab-settings.php:642
622
- msgid ""
623
- "<dfn title=\"Select the item which causes undesired blocking in order to "
624
- "exclude from the validation target. Grayed item indicates &#8220;"
625
- "INACTIVE&#8221;.\">Exceptions</dfn>"
626
  msgstr ""
627
 
628
- #: admin/includes/tab-settings.php:678 admin/includes/tab-settings.php:728
629
  msgid "Force to load WP core"
630
  msgstr ""
631
 
632
- #: admin/includes/tab-settings.php:683
633
  msgid "Plugins area"
634
  msgstr ""
635
 
636
- #: admin/includes/tab-settings.php:733
637
  msgid "Themes area"
638
  msgstr ""
639
 
640
- #: admin/includes/tab-settings.php:758
641
  msgid "Front-end target settings"
642
  msgstr ""
643
 
644
- #: admin/includes/tab-settings.php:782
645
  msgid "Follow &#8220;Validation rule settings&#8221;"
646
  msgstr ""
647
 
648
- #: admin/includes/tab-settings.php:844
649
  #, php-format
650
  msgid ""
651
  "<dfn title=\"You can configure a different response code from the Back-end. "
@@ -653,53 +728,53 @@ msgid ""
653
  "\">Response code</dfn> %s"
654
  msgstr ""
655
 
656
- #: admin/includes/tab-settings.php:909
657
  msgid ""
658
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
659
  msgstr ""
660
 
661
- #: admin/includes/tab-settings.php:921
662
  msgid ""
663
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
664
  "target.\">Post type</dfn>"
665
  msgstr ""
666
 
667
- #: admin/includes/tab-settings.php:933
668
  msgid ""
669
  "<dfn title=\"Specify the individual category on a single page or archive "
670
  "page as a blocking target.\">Category</dfn>"
671
  msgstr ""
672
 
673
- #: admin/includes/tab-settings.php:945
674
  msgid ""
675
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
676
  "a blocking target.\">Tag</dfn>"
677
  msgstr ""
678
 
679
- #: admin/includes/tab-settings.php:960
680
  msgid "Specify the validation target on front-end."
681
  msgstr ""
682
 
683
- #: admin/includes/tab-settings.php:960
684
  msgid "Validation target"
685
  msgstr ""
686
 
687
- #: admin/includes/tab-settings.php:971
688
  msgid "All requests"
689
  msgstr ""
690
 
691
- #: admin/includes/tab-settings.php:972
692
  msgid "Specify the targets"
693
  msgstr ""
694
 
695
- #: admin/includes/tab-settings.php:975
696
  msgid ""
697
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
698
  "wp&#8221; action hook. It means that this feature would not be compatible "
699
  "with any page caching."
700
  msgstr ""
701
 
702
- #: admin/includes/tab-settings.php:985
703
  msgid ""
704
  "A part of user agent string and a qualification connected with a separator "
705
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
@@ -709,19 +784,19 @@ msgid ""
709
  "qualification&#8221;."
710
  msgstr ""
711
 
712
- #: admin/includes/tab-settings.php:985
713
  msgid "UA string and qualification"
714
  msgstr ""
715
 
716
- #: admin/includes/tab-settings.php:1004
717
  msgid "Specify the name of action that is invariably blocked."
718
  msgstr ""
719
 
720
- #: admin/includes/tab-settings.php:1004
721
  msgid "Excluded actions"
722
  msgstr ""
723
 
724
- #: admin/includes/tab-settings.php:1023
725
  msgid ""
726
  "It enables to verify the host by reverse DNS lookup which would spend some "
727
  "server resources. If it is disabled, &#8220;HOST&#8221; and &#8220;"
@@ -729,35 +804,35 @@ msgid ""
729
  "return &#8220;true&#8221;."
730
  msgstr ""
731
 
732
- #: admin/includes/tab-settings.php:1023
733
  msgid "DNS reverse lookup"
734
  msgstr ""
735
 
736
- #: admin/includes/tab-settings.php:1040
737
  msgid ""
738
  "It enables to simulate validation without deployment. The results can be "
739
  "found at &#8220;Public facing pages&#8221; in Logs."
740
  msgstr ""
741
 
742
- #: admin/includes/tab-settings.php:1040
743
  msgid "Simulation mode"
744
  msgstr ""
745
 
746
- #: admin/includes/tab-settings.php:1059
747
  msgid "Geolocation API settings"
748
  msgstr ""
749
 
750
- #: admin/includes/tab-settings.php:1068
751
  msgid ""
752
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
753
  "selection and key settings</dfn>"
754
  msgstr ""
755
 
756
- #: admin/includes/tab-settings.php:1087
757
  msgid "Timeout for network API [sec]"
758
  msgstr ""
759
 
760
- #: admin/includes/tab-settings.php:1108
761
  #, php-format
762
  msgid ""
763
  "Can not find geolocation API libraries in <code>%s</code>. It seems to have "
@@ -772,87 +847,87 @@ msgid ""
772
  "troubles? | IP Geo Block\">this instruction</a>."
773
  msgstr ""
774
 
775
- #: admin/includes/tab-settings.php:1117
776
  msgid "Local database settings"
777
  msgstr ""
778
 
779
- #: admin/includes/tab-settings.php:1131
780
  msgid "database"
781
  msgstr ""
782
 
783
- #: admin/includes/tab-settings.php:1132
784
- #: classes/class-ip-geo-block-cron.php:345
785
  #, php-format
786
  msgid "Last update: %s"
787
  msgstr ""
788
 
789
- #: admin/includes/tab-settings.php:1141
790
  msgid "Auto updating (once a month)"
791
  msgstr ""
792
 
793
- #: admin/includes/tab-settings.php:1158
794
  msgid "Download database"
795
  msgstr ""
796
 
797
- #: admin/includes/tab-settings.php:1166
798
  msgid "Download now"
799
  msgstr ""
800
 
801
- #: admin/includes/tab-settings.php:1178
802
  msgid "Record settings"
803
  msgstr ""
804
 
805
- #: admin/includes/tab-settings.php:1187
806
  msgid "Record validation statistics"
807
  msgstr ""
808
 
809
- #: admin/includes/tab-settings.php:1203
810
  msgid "Record validation logs"
811
  msgstr ""
812
 
813
- #: admin/includes/tab-settings.php:1215
814
  msgid "Only when blocked"
815
  msgstr ""
816
 
817
- #: admin/includes/tab-settings.php:1216
818
  msgid "Only when passed"
819
  msgstr ""
820
 
821
- #: admin/includes/tab-settings.php:1217
822
  msgid "Unauthenticated user"
823
  msgstr ""
824
 
825
- #: admin/includes/tab-settings.php:1218
826
  msgid "Authenticated user"
827
  msgstr ""
828
 
829
- #: admin/includes/tab-settings.php:1219
830
  msgid "All of validation"
831
  msgstr ""
832
 
833
- #: admin/includes/tab-settings.php:1228
834
  msgid "Recording period of the logs (days)"
835
  msgstr ""
836
 
837
- #: admin/includes/tab-settings.php:1244
838
  msgid "Maximum length of logs for each target"
839
  msgstr ""
840
 
841
- #: admin/includes/tab-settings.php:1261
842
  msgid ""
843
  "<dfn title=\"e.g. action, comment, log, pwd, FILES\">$_POST keys to be "
844
  "recorded with their values in logs</dfn>"
845
  msgstr ""
846
 
847
- #: admin/includes/tab-settings.php:1279
848
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
849
  msgstr ""
850
 
851
- #: admin/includes/tab-settings.php:1297
852
  msgid "IP address cache settings"
853
  msgstr ""
854
 
855
- #: admin/includes/tab-settings.php:1306
856
  #, php-format
857
  msgid ""
858
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
@@ -860,131 +935,137 @@ msgid ""
860
  "\">Expiration time [sec]</dfn>"
861
  msgstr ""
862
 
863
- #: admin/includes/tab-settings.php:1322
864
  msgid "Garbage collection period [sec]"
865
  msgstr ""
866
 
867
- #: admin/includes/tab-settings.php:1339
868
  msgid "Number of entries to be displayed in cache"
869
  msgstr ""
870
 
871
- #: admin/includes/tab-settings.php:1358
872
  msgid "Submission settings"
873
  msgstr ""
874
 
875
- #: admin/includes/tab-settings.php:1370
876
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
877
  msgstr ""
878
 
879
- #: admin/includes/tab-settings.php:1370
880
  msgid "Message on comment form"
881
  msgstr ""
882
 
883
- #: admin/includes/tab-settings.php:1382
884
  msgid "None"
885
  msgstr ""
886
 
887
- #: admin/includes/tab-settings.php:1383
888
  msgid "Top"
889
  msgstr ""
890
 
891
- #: admin/includes/tab-settings.php:1384
892
  msgid "Bottom"
893
  msgstr ""
894
 
895
- #: admin/includes/tab-settings.php:1396
896
  msgid "Plugin settings"
897
  msgstr ""
898
 
899
- #: admin/includes/tab-settings.php:1405
 
 
 
 
 
 
900
  msgid "Remove all settings at uninstallation"
901
  msgstr ""
902
 
903
- #: admin/includes/tab-settings.php:1423
904
  msgid ""
905
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
906
  "dfn>"
907
  msgstr ""
908
 
909
- #: admin/includes/tab-settings.php:1437
910
  msgid ""
911
  "You need to click the &#8220;Save Changes&#8221; button for imported "
912
  "settings to take effect."
913
  msgstr ""
914
 
915
- #: admin/includes/tab-settings.php:1443
916
  msgid "Export / Import settings"
917
  msgstr ""
918
 
919
- #: admin/includes/tab-settings.php:1450
920
  msgid "Export settings"
921
  msgstr ""
922
 
923
- #: admin/includes/tab-settings.php:1451
924
  msgid "Import from the local file"
925
  msgstr ""
926
 
927
- #: admin/includes/tab-settings.php:1451
928
  msgid "Import settings"
929
  msgstr ""
930
 
931
- #: admin/includes/tab-settings.php:1460
932
  msgid "Import pre-defined settings"
933
  msgstr ""
934
 
935
- #: admin/includes/tab-settings.php:1467
936
  msgid ""
937
  "Import the default settings to revert to the &#8220;Right after "
938
  "installing&#8221; state"
939
  msgstr ""
940
 
941
- #: admin/includes/tab-settings.php:1467
942
  msgid "Default settings"
943
  msgstr ""
944
 
945
- #: admin/includes/tab-settings.php:1468
946
  msgid ""
947
  "Import the preferred settings mainly by enabling Zero-day Exploit Prevention "
948
  "for the &#8220;Back-end target settings&#8221;"
949
  msgstr ""
950
 
951
- #: admin/includes/tab-settings.php:1468
952
  msgid "Best for Back-end"
953
  msgstr ""
954
 
955
- #: admin/includes/tab-settings.php:1478
956
  msgid "Delete DB table for validation logs"
957
  msgstr ""
958
 
959
- #: admin/includes/tab-settings.php:1486
960
  msgid "Delete now"
961
  msgstr ""
962
 
963
- #: admin/includes/tab-settings.php:1494
964
  msgid "Create DB table for validation logs"
965
  msgstr ""
966
 
967
- #: admin/includes/tab-settings.php:1502
968
  msgid "Create now"
969
  msgstr ""
970
 
971
- #: admin/includes/tab-settings.php:1512
972
  msgid ""
973
  "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
974
- "forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
975
  "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
976
  "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
977
  msgstr ""
978
 
979
- #: admin/includes/tab-settings.php:1519
980
  msgid "Show PHP, WordPress, theme and plugins information."
981
  msgstr ""
982
 
983
- #: admin/includes/tab-settings.php:1519
984
  msgid "Show information"
985
  msgstr ""
986
 
987
- #: admin/includes/tab-settings.php:1535
988
  msgid ""
989
  "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
990
  "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
@@ -992,7 +1073,7 @@ msgid ""
992
  "\">The best practice for target settings</a>&#8221;."
993
  msgstr ""
994
 
995
- #: admin/includes/tab-settings.php:1536
996
  msgid ""
997
  "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
998
  "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
@@ -1001,18 +1082,18 @@ msgid ""
1001
  "\">Codex</a>."
1002
  msgstr ""
1003
 
1004
- #: admin/includes/tab-settings.php:1543
1005
  msgid ""
1006
  "While Maxmind and IP2Location will fetch the local database, others will "
1007
  "pass an IP address to the APIs via HTTP."
1008
  msgstr ""
1009
 
1010
- #: admin/includes/tab-settings.php:1544
1011
  msgid ""
1012
  "Please select the appropriate APIs to fit the privacy law in your country."
1013
  msgstr ""
1014
 
1015
- #: admin/includes/tab-settings.php:1551
1016
  msgid ""
1017
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1018
  "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
@@ -1020,7 +1101,7 @@ msgid ""
1020
  "cache plugin."
1021
  msgstr ""
1022
 
1023
- #: admin/includes/tab-settings.php:1552
1024
  msgid ""
1025
  "If you find any issues or have something to suggest, please feel free to "
1026
  "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
@@ -1028,108 +1109,121 @@ msgid ""
1028
  "\">support forum</a>."
1029
  msgstr ""
1030
 
1031
- #: admin/includes/tab-settings.php:1559
1032
  msgid ""
1033
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1034
  "ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
1035
  "Block\">Record settings and logs</a>&#8221; for details."
1036
  msgstr ""
1037
 
1038
- #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:186
1039
  msgid "Statistics of validation"
1040
  msgstr ""
1041
 
1042
- #: admin/includes/tab-statistics.php:33
1043
  msgid "Blocked"
1044
  msgstr ""
1045
 
1046
- #: admin/includes/tab-statistics.php:58
1047
  msgid "Blocked by countries"
1048
  msgstr ""
1049
 
1050
- #: admin/includes/tab-statistics.php:99
1051
  msgid "Blocked per day"
1052
  msgstr ""
1053
 
1054
- #: admin/includes/tab-statistics.php:115
1055
  msgid "Blocked by type of IP address"
1056
  msgstr ""
1057
 
1058
- #: admin/includes/tab-statistics.php:133
1059
  msgid "Name of API"
1060
  msgstr ""
1061
 
1062
- #: admin/includes/tab-statistics.php:134
1063
  msgid "Calls"
1064
  msgstr ""
1065
 
1066
- #: admin/includes/tab-statistics.php:135
1067
  msgid "Response [msec]"
1068
  msgstr ""
1069
 
1070
- #: admin/includes/tab-statistics.php:149
1071
  msgid "Average response time of each API"
1072
  msgstr ""
1073
 
1074
- #: admin/includes/tab-statistics.php:165
1075
  msgid "Clear statistics"
1076
  msgstr ""
1077
 
1078
- #: admin/includes/tab-statistics.php:212
 
 
 
 
1079
  msgid "Statistics in cache"
1080
  msgstr ""
1081
 
1082
- #: admin/includes/tab-statistics.php:220
1083
  msgid "Country code / Access"
1084
  msgstr ""
1085
 
1086
- #: admin/includes/tab-statistics.php:221
1087
  msgid "Elapsed [sec] / Calls"
1088
  msgstr ""
1089
 
1090
- #: admin/includes/tab-statistics.php:254
1091
  msgid "IP address in cache"
1092
  msgstr ""
1093
 
1094
- #: admin/includes/tab-statistics.php:269
1095
  msgid "Clear cache"
1096
  msgstr ""
1097
 
1098
- #: admin/includes/tab-statistics.php:288
1099
  msgid ""
1100
  "Current setting of [<strong>Record validation statistics</strong>] on "
1101
  "[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
1102
  msgstr ""
1103
 
1104
- #: admin/includes/tab-statistics.php:289
1105
  msgid ""
1106
  "Please set the proper condition to record and analyze the validation "
1107
  "statistics."
1108
  msgstr ""
1109
 
1110
- #: classes/class-ip-geo-block-apis.php:651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  msgid ""
1112
  "You need to select at least one IP geolocation service. Otherwise "
1113
  "<strong>you'll be blocked</strong> after the cache expires."
1114
  msgstr ""
1115
 
1116
- #: classes/class-ip-geo-block-cron.php:241
1117
  msgid "Your database file is up-to-date."
1118
  msgstr ""
1119
 
1120
- #: classes/class-ip-geo-block-cron.php:269
1121
- #: classes/class-ip-geo-block-cron.php:301
1122
- #, php-format
1123
- msgid "Unable to read %s. Please check the permission."
1124
- msgstr ""
1125
-
1126
- #: classes/class-ip-geo-block-cron.php:279
1127
- #: classes/class-ip-geo-block-cron.php:311
1128
  #, php-format
1129
- msgid "Can't lock %s. Please try again after a while."
1130
  msgstr ""
1131
 
1132
- #: classes/class-ip-geo-block-cron.php:323
1133
  msgid "gz or zip is not supported on your system."
1134
  msgstr ""
1135
 
@@ -1151,17 +1245,15 @@ msgid ""
1151
  "details."
1152
  msgstr ""
1153
 
1154
- #: classes/class-ip-geo-block-logs.php:149
1155
  #, php-format
1156
  msgid ""
1157
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1158
  "activate again."
1159
  msgstr ""
1160
 
1161
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:157
1162
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:186
1163
- #: wp-content/ip-geo-api/maxmind/class-maxmind.php:171
1164
- #: wp-content/ip-geo-api/maxmind/class-maxmind.php:200
1165
  msgid "Database file does not exist."
1166
  msgstr ""
1167
 
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: IP Geo Block 3.0.4.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
+ "POT-Creation-Date: 2017-09-24 16:25+0900\n"
8
+ "PO-Revision-Date: 2017-09-24 16:26+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
+ #: admin/class-ip-geo-block-admin.php:247
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
+ #: admin/class-ip-geo-block-admin.php:248
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
+ #: admin/class-ip-geo-block-admin.php:249
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
+ #: admin/class-ip-geo-block-admin.php:250
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
+ #: admin/class-ip-geo-block-admin.php:251
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
+ #: admin/class-ip-geo-block-admin.php:252
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
+ #: admin/class-ip-geo-block-admin.php:253
53
+ msgid "ajax for logged-in user"
54
+ msgstr ""
55
+
56
+ #: admin/class-ip-geo-block-admin.php:254
57
+ msgid "ajax for non logged-in user"
58
+ msgstr ""
59
+
60
+ #: admin/class-ip-geo-block-admin.php:255
61
  msgid "This feature is available with HTML5 compliant browsers."
62
  msgstr ""
63
 
64
+ #: admin/class-ip-geo-block-admin.php:268
65
  msgid "Contribute at GitHub"
66
  msgstr ""
67
 
68
+ #: admin/class-ip-geo-block-admin.php:285
69
+ #: admin/class-ip-geo-block-admin.php:588
70
+ #: admin/class-ip-geo-block-admin.php:606
71
  msgid "Settings"
72
  msgstr ""
73
 
74
+ #: admin/class-ip-geo-block-admin.php:377
75
+ #: admin/class-ip-geo-block-admin.php:378
76
+ #: admin/class-ip-geo-block-admin.php:388
77
+ #: admin/class-ip-geo-block-admin.php:389
78
  msgid "IP Geo Block"
79
  msgstr ""
80
 
81
+ #: admin/class-ip-geo-block-admin.php:420
82
  msgid "You need WordPress 3.7+."
83
  msgstr ""
84
 
85
+ #: admin/class-ip-geo-block-admin.php:426
86
  #, php-format
87
  msgid ""
88
  "Now downloading geolocation databases in background. After a little while, "
90
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
91
  msgstr ""
92
 
93
+ #: admin/class-ip-geo-block-admin.php:432
94
  #, php-format
95
  msgid ""
96
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
97
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
98
  msgstr ""
99
 
100
+ #: admin/class-ip-geo-block-admin.php:441
101
  msgid "Local database and matching rule have been updated."
102
  msgstr ""
103
 
104
+ #: admin/class-ip-geo-block-admin.php:452
105
  msgid ""
106
  "Once you logout, you will be unable to login again because the number of "
107
  "login attempts reaches the limit."
108
  msgstr ""
109
 
110
+ #: admin/class-ip-geo-block-admin.php:454
111
  #, php-format
112
  msgid ""
113
  "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
114
  "tab</a> to prevent locking yourself out."
115
  msgstr ""
116
 
117
+ #: admin/class-ip-geo-block-admin.php:464
118
  msgid ""
119
  "Once you logout, you will be unable to login again because your country code "
120
  "or IP address is in the blacklist."
121
  msgstr ""
122
 
123
+ #: admin/class-ip-geo-block-admin.php:465
124
  msgid ""
125
  "Once you logout, you will be unable to login again because your country code "
126
  "or IP address is not in the whitelist."
127
  msgstr ""
128
 
129
+ #: admin/class-ip-geo-block-admin.php:468
130
  #, php-format
131
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
132
  msgstr ""
133
 
134
+ #: admin/class-ip-geo-block-admin.php:479
135
  msgid ""
136
  "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
137
  "timing&#8221; is imcompatible with <strong>IP Geo Allow</strong>. Please "
138
  "select &#8220;init&#8221; action hook."
139
  msgstr ""
140
 
141
+ #: admin/class-ip-geo-block-admin.php:589 admin/includes/tab-network.php:38
142
  msgid "Statistics"
143
  msgstr ""
144
 
145
+ #: admin/class-ip-geo-block-admin.php:590 admin/includes/tab-network.php:39
146
  msgid "Logs"
147
  msgstr ""
148
 
149
+ #: admin/class-ip-geo-block-admin.php:591
150
  msgid "Search"
151
  msgstr ""
152
 
153
+ #: admin/class-ip-geo-block-admin.php:592
154
+ #: admin/class-ip-geo-block-admin.php:607
155
+ msgid "Sites"
156
+ msgstr ""
157
+
158
+ #: admin/class-ip-geo-block-admin.php:593
159
  msgid "Attribution"
160
  msgstr ""
161
 
162
+ #: admin/class-ip-geo-block-admin.php:617
163
+ msgid "Network"
164
+ msgstr ""
165
+
166
+ #: admin/class-ip-geo-block-admin.php:630
167
  msgid "Toggle all"
168
  msgstr ""
169
 
170
+ #: admin/class-ip-geo-block-admin.php:652
171
  msgid "Thanks for providing these great services for free."
172
  msgstr ""
173
 
174
+ #: admin/class-ip-geo-block-admin.php:653
175
  msgid ""
176
  "(Most browsers will redirect you to each site <a href=\"http://www."
177
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
178
  "when you click the link</a>.)"
179
  msgstr ""
180
 
181
+ #: admin/class-ip-geo-block-admin.php:658
182
  msgid "Back to top"
183
  msgstr ""
184
 
185
+ #: admin/class-ip-geo-block-admin.php:755
186
  msgid "Enable"
187
  msgstr ""
188
 
189
+ #: admin/class-ip-geo-block-admin.php:1147
190
+ #: admin/includes/class-admin-rewrite.php:169
191
+ #: classes/class-ip-geo-block-cron.php:273
192
+ #: classes/class-ip-geo-block-cron.php:305
193
+ #: classes/class-ip-geo-block-opts.php:401
194
  #, php-format
195
+ msgid "Unable to write <code>%s</code>. Please check the permission."
196
  msgstr ""
197
 
198
+ #: admin/class-ip-geo-block-admin.php:1177
199
+ msgid "Settings saved."
 
 
 
 
 
 
 
 
 
200
  msgstr ""
201
 
202
+ #: admin/includes/class-admin-ajax.php:69
203
  msgid "n/a"
204
  msgstr ""
205
 
206
+ #: admin/includes/class-admin-ajax.php:72 admin/includes/tab-settings.php:76
207
+ #: admin/includes/tab-settings.php:96
208
  msgid "UNKNOWN"
209
  msgstr ""
210
 
211
+ #: admin/includes/class-admin-ajax.php:255
212
  #, php-format
213
  msgid ""
214
  "illegal format at %s. Please delete the corresponding line and try again."
215
  msgstr ""
216
 
217
+ #: admin/includes/class-admin-rewrite.php:143
218
+ #: classes/class-ip-geo-block-cron.php:268
219
+ #: classes/class-ip-geo-block-cron.php:300
220
+ #, php-format
221
+ msgid "Unable to read <code>%s</code>. Please check the permission."
222
+ msgstr ""
223
+
224
+ #: admin/includes/class-admin-rewrite.php:144
225
+ #: admin/includes/class-admin-rewrite.php:170
226
+ #, php-format
227
+ msgid "Or please refer to %s to set it manually."
228
+ msgstr ""
229
+
230
+ #: admin/includes/class-admin-rewrite.php:208
231
+ #, php-format
232
+ msgid "&#8220;auto_prepend_file&#8221; already defined in %s."
233
+ msgstr ""
234
+
235
+ #: admin/includes/tab-accesslog.php:19 admin/includes/tab-accesslog.php:97
236
  msgid "Validation logs"
237
  msgstr ""
238
 
239
+ #: admin/includes/tab-accesslog.php:28
240
  msgid "Filter logs"
241
  msgstr ""
242
 
243
+ #: admin/includes/tab-accesslog.php:37
244
  msgid "Reset"
245
  msgstr ""
246
 
247
+ #: admin/includes/tab-accesslog.php:44 admin/includes/tab-statistics.php:188
248
  msgid "Clear logs"
249
  msgstr ""
250
 
251
+ #: admin/includes/tab-accesslog.php:52 admin/includes/tab-statistics.php:170
252
+ #: admin/includes/tab-statistics.php:196 admin/includes/tab-statistics.php:297
253
  msgid "Clear now"
254
  msgstr ""
255
 
256
+ #: admin/includes/tab-accesslog.php:60
257
  msgid "Export logs"
258
  msgstr ""
259
 
260
+ #: admin/includes/tab-accesslog.php:66 admin/includes/tab-settings.php:1441
261
  msgid "Export to the local file"
262
  msgstr ""
263
 
264
+ #: admin/includes/tab-accesslog.php:66
265
  msgid "Export csv"
266
  msgstr ""
267
 
268
+ #: admin/includes/tab-accesslog.php:72
269
  #, php-format
270
  msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
271
  msgstr ""
272
 
273
+ #: admin/includes/tab-accesslog.php:74 admin/includes/tab-settings.php:450
274
  msgid "Comment post"
275
  msgstr ""
276
 
277
+ #: admin/includes/tab-accesslog.php:75 admin/includes/tab-settings.php:451
278
  msgid "XML-RPC"
279
  msgstr ""
280
 
281
+ #: admin/includes/tab-accesslog.php:76 admin/includes/tab-settings.php:452
282
  msgid "Login form"
283
  msgstr ""
284
 
285
+ #: admin/includes/tab-accesslog.php:77 admin/includes/tab-settings.php:453
286
  msgid "Admin area"
287
  msgstr ""
288
 
289
+ #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:455
290
  msgid "public facing pages"
291
  msgstr ""
292
 
293
+ #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:455
294
  msgid "Public facing pages"
295
  msgstr ""
296
 
297
+ #: admin/includes/tab-accesslog.php:131
298
  msgid "Date"
299
  msgstr ""
300
 
301
+ #: admin/includes/tab-accesslog.php:132 admin/includes/tab-geolocation.php:67
302
+ #: admin/includes/tab-statistics.php:239
303
  msgid "IP address"
304
  msgstr ""
305
 
306
+ #: admin/includes/tab-accesslog.php:133
307
  msgid "Code"
308
  msgstr ""
309
 
310
+ #: admin/includes/tab-accesslog.php:134
311
  msgid "Result"
312
  msgstr ""
313
 
314
+ #: admin/includes/tab-accesslog.php:135
315
+ msgid "AS number"
316
+ msgstr ""
317
+
318
  #: admin/includes/tab-accesslog.php:136
319
  msgid "Request"
320
  msgstr ""
362
  msgid "Search now"
363
  msgstr ""
364
 
365
+ #: admin/includes/tab-settings.php:44
366
  msgid "Validation rule settings"
367
  msgstr ""
368
 
369
+ #: admin/includes/tab-settings.php:68
370
  msgid ""
371
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
372
  "code by referring &#8220;Scan country code&#8221;.\">Your IP address / "
373
  "Country</dfn>"
374
  msgstr ""
375
 
376
+ #: admin/includes/tab-settings.php:77 admin/includes/tab-settings.php:97
377
  msgid "Scan all the APIs you selected at Geolocation API settings"
378
  msgstr ""
379
 
380
+ #: admin/includes/tab-settings.php:77 admin/includes/tab-settings.php:97
381
  msgid "Scan country code"
382
  msgstr ""
383
 
384
+ #: admin/includes/tab-settings.php:88
385
  msgid ""
386
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
387
  "code by referring &#8220;Scan country code&#8221;.\">Server IP address / "
388
  "Country</dfn>"
389
  msgstr ""
390
 
391
+ #: admin/includes/tab-settings.php:105
392
  msgid "Whitelist"
393
  msgstr ""
394
 
395
+ #: admin/includes/tab-settings.php:106
396
  msgid "Blacklist"
397
  msgstr ""
398
 
399
+ #: admin/includes/tab-settings.php:110
400
  msgid ""
401
  "Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;."
402
  msgstr ""
403
 
404
+ #: admin/includes/tab-settings.php:111
405
  msgid ""
406
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
407
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
411
  "country code</dfn>"
412
  msgstr ""
413
 
414
+ #: admin/includes/tab-settings.php:112
415
  msgid ""
416
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
417
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
421
  "country code</dfn>"
422
  msgstr ""
423
 
424
+ #: admin/includes/tab-settings.php:116
425
  msgid "(comma separated)"
426
  msgstr ""
427
 
428
+ #: admin/includes/tab-settings.php:117
429
  msgid "(comma or RET separated)"
430
  msgstr ""
431
 
432
+ #: admin/includes/tab-settings.php:118
433
+ msgid "Toggle selection"
434
+ msgstr ""
435
+
436
+ #: admin/includes/tab-settings.php:125 admin/includes/tab-settings.php:763
437
  msgid "Matching rule"
438
  msgstr ""
439
 
440
+ #: admin/includes/tab-settings.php:137
441
  msgid ""
442
  "A request from which the country code or IP address is <strong>NOT</strong> "
443
  "in the whitelist will be blocked."
444
  msgstr ""
445
 
446
+ #: admin/includes/tab-settings.php:138
447
  msgid ""
448
  "A request from which the country code or IP address is in the blacklist will "
449
  "be blocked."
450
  msgstr ""
451
 
452
+ #: admin/includes/tab-settings.php:184
453
+ msgid ""
454
+ "<dfn title=\"It enables utilizing &#8220;AS number&#8221; in the &#8220;"
455
+ "Whitelist/Blacklist of extra IP addresses&#8221; to specify a group of IP "
456
+ "networks.\">Use Autonomous System Number</dfn>"
457
+ msgstr ""
458
+
459
+ #: admin/includes/tab-settings.php:195
460
+ #, php-format
461
+ msgid ""
462
+ "Some useful tools for investigating ASN are introduced in &#8220;%s&#8221;."
463
+ msgstr ""
464
+
465
+ #: admin/includes/tab-settings.php:204
466
  msgid ""
467
  "<dfn title=\"e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, "
468
+ "&#8220;69.46.36.0/27&#8221; for WordFence server or &#8220;AS32934&#8221; "
469
+ "for Facebook.\">Whitelist of extra IP addresses prior to country code</dfn>"
470
  msgstr ""
471
 
472
+ #: admin/includes/tab-settings.php:224
473
  msgid ""
474
  "<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
475
  "\">Blacklist of extra IP addresses prior to country code</dfn>"
476
  msgstr ""
477
 
478
+ #: admin/includes/tab-settings.php:245
479
  msgid ""
480
  "<dfn title=\"If your server is placed behind the proxy server or the load "
481
  "balancing server, you need to put the appropriate key such as &#8220;"
484
  "addresses</dfn>"
485
  msgstr ""
486
 
487
+ #: admin/includes/tab-settings.php:264
488
  msgid ""
489
  "<dfn title=\"It validates malicious signatures independently of &#8220;Block "
490
  "by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target "
495
  "restore.\"><span></span></a>)</nobr>"
496
  msgstr ""
497
 
498
+ #: admin/includes/tab-settings.php:278
499
  msgid ""
500
  "<dfn title=\"Select allowed MIME type.\">Whitelist of allowed MIME type</dfn>"
501
  msgstr ""
502
 
503
+ #: admin/includes/tab-settings.php:289
504
  msgid ""
505
  "<dfn title=\"Put forbidden file extensions.\">Blacklist of forbidden file "
506
  "extensions</dfn>"
507
  msgstr ""
508
 
509
+ #: admin/includes/tab-settings.php:293
510
+ msgid ""
511
+ "<dfn title=\"Specify the capabilities to be verified. Depending on the "
512
+ "particular type of uploader, certain capability may be required. Default is "
513
+ "&#8220;upload_files&#8221; for Administrator, Editor and Author. This "
514
+ "verification will be skipped if empty.\">Capabilities to be verified</dfn>"
515
+ msgstr ""
516
+
517
+ #: admin/includes/tab-settings.php:293
518
  msgid ""
519
+ "(&thinsp;See &#8220;<a rel=\"noreferrer\" href=\"https://codex.wordpress.org/"
520
+ "Roles_and_Capabilities\" title=\"Roles and Capabilities &laquo; WordPress "
521
+ "Codex\">Roles and Capabilities</a>&#8221;&thinsp;)"
 
 
522
  msgstr ""
523
 
524
+ #: admin/includes/tab-settings.php:300
525
+ msgid ""
526
+ "<dfn title=\"It restricts the file types on upload in order to block malware "
527
+ "and backdoor via both back-end and front-end. Please consider to select "
528
+ "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
529
+ "timing&#8221; so that other staff would not fetch the uploaded files before "
530
+ "this validation.\">Prevent malicious file uploading</dfn>"
531
+ msgstr ""
532
+
533
+ #: admin/includes/tab-settings.php:311 admin/includes/tab-settings.php:492
534
+ #: admin/includes/tab-settings.php:611 admin/includes/tab-settings.php:1186
535
  msgid "Disable"
536
  msgstr ""
537
 
538
+ #: admin/includes/tab-settings.php:312
539
+ msgid "Verify file extension and MIME type"
540
  msgstr ""
541
 
542
+ #: admin/includes/tab-settings.php:313
543
+ msgid "Verify file extension only"
544
  msgstr ""
545
 
546
+ #: admin/includes/tab-settings.php:323
547
  #, php-format
548
  msgid ""
549
  "<dfn title=\"You can put your original 403.php and so on into your theme "
550
  "directory.\">Response code</dfn> %s"
551
  msgstr ""
552
 
553
+ #: admin/includes/tab-settings.php:353 admin/includes/tab-settings.php:850
554
  msgid ""
555
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. If it is pointed "
556
  "to a public facing page, visitors would not be blocked on the page to "
559
  "\">Redirect URL</dfn>"
560
  msgstr ""
561
 
562
+ #: admin/includes/tab-settings.php:371 admin/includes/tab-settings.php:869
563
  msgid ""
564
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
565
  "message</dfn>"
566
  msgstr ""
567
 
568
+ #: admin/includes/tab-settings.php:388
569
  msgid ""
570
  "<dfn title=\"This is applied to &#8220;XML-RPC&#8221; and &#8220;Login "
571
  "form&#8221;. Lockout period is defined as expiration time at &#8220;Cache "
572
  "settings&#8221;.\">Max number of failed login attempts per IP address</dfn>"
573
  msgstr ""
574
 
575
+ #: admin/includes/tab-settings.php:416
576
  msgid "Select when to run the validation."
577
  msgstr ""
578
 
579
+ #: admin/includes/tab-settings.php:416
580
  msgid "Validation timing"
581
  msgstr ""
582
 
583
+ #: admin/includes/tab-settings.php:427
584
  msgid "&#8220;init&#8221; action hook"
585
  msgstr ""
586
 
587
+ #: admin/includes/tab-settings.php:428
588
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
589
  msgstr ""
590
 
591
+ #: admin/includes/tab-settings.php:431
592
  msgid ""
593
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
594
  "plugins."
595
  msgstr ""
596
 
597
+ #: admin/includes/tab-settings.php:432
598
  msgid ""
599
  "Validate at an earlier phase than other typical plugins. It can reduce load "
600
  "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
602
  "restrictions</a>."
603
  msgstr ""
604
 
605
+ #: admin/includes/tab-settings.php:442
606
  msgid "Back-end target settings"
607
  msgstr ""
608
 
609
+ #: admin/includes/tab-settings.php:448
610
  #, php-format
611
  msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
612
  msgstr ""
613
 
614
+ #: admin/includes/tab-settings.php:454
615
  msgid "Other areas"
616
  msgstr ""
617
 
618
+ #: admin/includes/tab-settings.php:473 admin/includes/tab-settings.php:493
619
+ #: admin/includes/tab-settings.php:526 admin/includes/tab-settings.php:532
620
+ #: admin/includes/tab-settings.php:751
621
  msgid "Block by country"
622
  msgstr ""
623
 
624
+ #: admin/includes/tab-settings.php:494
625
  msgid "Completely close"
626
  msgstr ""
627
 
628
+ #: admin/includes/tab-settings.php:527
629
  msgid ""
630
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
631
  "actions</dfn>"
632
  msgstr ""
633
 
634
+ #: admin/includes/tab-settings.php:533
635
  msgid "Prevent Zero-day Exploit"
636
  msgstr ""
637
 
638
+ #: admin/includes/tab-settings.php:537
639
  msgid ""
640
  "It will block a request related to the services for both public facing pages "
641
  "and the dashboard."
642
  msgstr ""
643
 
644
+ #: admin/includes/tab-settings.php:538
645
  msgid ""
646
  "Regardless of the country code, it will block a malicious request related to "
647
  "the services only for the dashboard."
648
  msgstr ""
649
 
650
+ #: admin/includes/tab-settings.php:564
651
+ msgid "admin post for logged-in user"
652
  msgstr ""
653
 
654
+ #: admin/includes/tab-settings.php:565
655
+ msgid "admin post for non logged-in user"
656
  msgstr ""
657
 
658
+ #: admin/includes/tab-settings.php:587
659
  msgid "Admin ajax/post"
660
  msgstr ""
661
 
662
+ #: admin/includes/tab-settings.php:600
663
  msgid ""
664
  "<dfn title=\"Specify the page name (&#8220;page=&hellip;&#8221;) or the "
665
  "action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking "
667
  "Prevent Zero-day Exploit&#8221; for logged-in user.\">Exceptions</dfn>"
668
  msgstr ""
669
 
670
+ #: admin/includes/tab-settings.php:600
671
+ msgid "Toggle with non logged-in user"
672
+ msgstr ""
673
+
674
+ #: admin/includes/tab-settings.php:605
675
  msgid "Candidate actions"
676
  msgstr ""
677
 
678
+ #: admin/includes/tab-settings.php:613
679
  #, php-format
680
  msgid ""
681
  "Regardless of the country code, it will block a malicious request to <code>"
682
  "%s&ctdot;/*.php</code>."
683
  msgstr ""
684
 
685
+ #: admin/includes/tab-settings.php:614
686
+ msgid ""
687
+ "<dfn title=\"Select the item which causes undesired blocking in order to "
688
+ "exclude from the validation target. Grayed item indicates &#8220;"
689
+ "INACTIVE&#8221;.\">Exceptions</dfn>"
690
+ msgstr ""
691
+
692
+ #: admin/includes/tab-settings.php:615
693
  #, php-format
694
  msgid ""
695
  "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
696
  "does not load WordPress core."
697
  msgstr ""
698
 
699
+ #: admin/includes/tab-settings.php:616
700
+ msgid "Sorry, but your server type is not supported."
 
 
 
701
  msgstr ""
702
 
703
+ #: admin/includes/tab-settings.php:653 admin/includes/tab-settings.php:703
704
  msgid "Force to load WP core"
705
  msgstr ""
706
 
707
+ #: admin/includes/tab-settings.php:658
708
  msgid "Plugins area"
709
  msgstr ""
710
 
711
+ #: admin/includes/tab-settings.php:708
712
  msgid "Themes area"
713
  msgstr ""
714
 
715
+ #: admin/includes/tab-settings.php:732
716
  msgid "Front-end target settings"
717
  msgstr ""
718
 
719
+ #: admin/includes/tab-settings.php:756
720
  msgid "Follow &#8220;Validation rule settings&#8221;"
721
  msgstr ""
722
 
723
+ #: admin/includes/tab-settings.php:818
724
  #, php-format
725
  msgid ""
726
  "<dfn title=\"You can configure a different response code from the Back-end. "
728
  "\">Response code</dfn> %s"
729
  msgstr ""
730
 
731
+ #: admin/includes/tab-settings.php:884
732
  msgid ""
733
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
734
  msgstr ""
735
 
736
+ #: admin/includes/tab-settings.php:896
737
  msgid ""
738
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
739
  "target.\">Post type</dfn>"
740
  msgstr ""
741
 
742
+ #: admin/includes/tab-settings.php:908
743
  msgid ""
744
  "<dfn title=\"Specify the individual category on a single page or archive "
745
  "page as a blocking target.\">Category</dfn>"
746
  msgstr ""
747
 
748
+ #: admin/includes/tab-settings.php:920
749
  msgid ""
750
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
751
  "a blocking target.\">Tag</dfn>"
752
  msgstr ""
753
 
754
+ #: admin/includes/tab-settings.php:935
755
  msgid "Specify the validation target on front-end."
756
  msgstr ""
757
 
758
+ #: admin/includes/tab-settings.php:935
759
  msgid "Validation target"
760
  msgstr ""
761
 
762
+ #: admin/includes/tab-settings.php:946
763
  msgid "All requests"
764
  msgstr ""
765
 
766
+ #: admin/includes/tab-settings.php:947
767
  msgid "Specify the targets"
768
  msgstr ""
769
 
770
+ #: admin/includes/tab-settings.php:950
771
  msgid ""
772
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
773
  "wp&#8221; action hook. It means that this feature would not be compatible "
774
  "with any page caching."
775
  msgstr ""
776
 
777
+ #: admin/includes/tab-settings.php:960
778
  msgid ""
779
  "A part of user agent string and a qualification connected with a separator "
780
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
784
  "qualification&#8221;."
785
  msgstr ""
786
 
787
+ #: admin/includes/tab-settings.php:960
788
  msgid "UA string and qualification"
789
  msgstr ""
790
 
791
+ #: admin/includes/tab-settings.php:979
792
  msgid "Specify the name of action that is invariably blocked."
793
  msgstr ""
794
 
795
+ #: admin/includes/tab-settings.php:979
796
  msgid "Excluded actions"
797
  msgstr ""
798
 
799
+ #: admin/includes/tab-settings.php:998
800
  msgid ""
801
  "It enables to verify the host by reverse DNS lookup which would spend some "
802
  "server resources. If it is disabled, &#8220;HOST&#8221; and &#8220;"
804
  "return &#8220;true&#8221;."
805
  msgstr ""
806
 
807
+ #: admin/includes/tab-settings.php:998
808
  msgid "DNS reverse lookup"
809
  msgstr ""
810
 
811
+ #: admin/includes/tab-settings.php:1015
812
  msgid ""
813
  "It enables to simulate validation without deployment. The results can be "
814
  "found at &#8220;Public facing pages&#8221; in Logs."
815
  msgstr ""
816
 
817
+ #: admin/includes/tab-settings.php:1015
818
  msgid "Simulation mode"
819
  msgstr ""
820
 
821
+ #: admin/includes/tab-settings.php:1033
822
  msgid "Geolocation API settings"
823
  msgstr ""
824
 
825
+ #: admin/includes/tab-settings.php:1042
826
  msgid ""
827
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
828
  "selection and key settings</dfn>"
829
  msgstr ""
830
 
831
+ #: admin/includes/tab-settings.php:1061
832
  msgid "Timeout for network API [sec]"
833
  msgstr ""
834
 
835
+ #: admin/includes/tab-settings.php:1082
836
  #, php-format
837
  msgid ""
838
  "Can not find geolocation API libraries in <code>%s</code>. It seems to have "
847
  "troubles? | IP Geo Block\">this instruction</a>."
848
  msgstr ""
849
 
850
+ #: admin/includes/tab-settings.php:1090
851
  msgid "Local database settings"
852
  msgstr ""
853
 
854
+ #: admin/includes/tab-settings.php:1104
855
  msgid "database"
856
  msgstr ""
857
 
858
+ #: admin/includes/tab-settings.php:1105
859
+ #: classes/class-ip-geo-block-cron.php:334
860
  #, php-format
861
  msgid "Last update: %s"
862
  msgstr ""
863
 
864
+ #: admin/includes/tab-settings.php:1114
865
  msgid "Auto updating (once a month)"
866
  msgstr ""
867
 
868
+ #: admin/includes/tab-settings.php:1131
869
  msgid "Download database"
870
  msgstr ""
871
 
872
+ #: admin/includes/tab-settings.php:1139
873
  msgid "Download now"
874
  msgstr ""
875
 
876
+ #: admin/includes/tab-settings.php:1150
877
  msgid "Record settings"
878
  msgstr ""
879
 
880
+ #: admin/includes/tab-settings.php:1159
881
  msgid "Record validation statistics"
882
  msgstr ""
883
 
884
+ #: admin/includes/tab-settings.php:1175
885
  msgid "Record validation logs"
886
  msgstr ""
887
 
888
+ #: admin/includes/tab-settings.php:1187
889
  msgid "Only when blocked"
890
  msgstr ""
891
 
892
+ #: admin/includes/tab-settings.php:1188
893
  msgid "Only when passed"
894
  msgstr ""
895
 
896
+ #: admin/includes/tab-settings.php:1189
897
  msgid "Unauthenticated user"
898
  msgstr ""
899
 
900
+ #: admin/includes/tab-settings.php:1190
901
  msgid "Authenticated user"
902
  msgstr ""
903
 
904
+ #: admin/includes/tab-settings.php:1191
905
  msgid "All of validation"
906
  msgstr ""
907
 
908
+ #: admin/includes/tab-settings.php:1200
909
  msgid "Recording period of the logs (days)"
910
  msgstr ""
911
 
912
+ #: admin/includes/tab-settings.php:1216
913
  msgid "Maximum length of logs for each target"
914
  msgstr ""
915
 
916
+ #: admin/includes/tab-settings.php:1233
917
  msgid ""
918
  "<dfn title=\"e.g. action, comment, log, pwd, FILES\">$_POST keys to be "
919
  "recorded with their values in logs</dfn>"
920
  msgstr ""
921
 
922
+ #: admin/includes/tab-settings.php:1251
923
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
924
  msgstr ""
925
 
926
+ #: admin/includes/tab-settings.php:1268
927
  msgid "IP address cache settings"
928
  msgstr ""
929
 
930
+ #: admin/includes/tab-settings.php:1277
931
  #, php-format
932
  msgid ""
933
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
935
  "\">Expiration time [sec]</dfn>"
936
  msgstr ""
937
 
938
+ #: admin/includes/tab-settings.php:1293
939
  msgid "Garbage collection period [sec]"
940
  msgstr ""
941
 
942
+ #: admin/includes/tab-settings.php:1310
943
  msgid "Number of entries to be displayed in cache"
944
  msgstr ""
945
 
946
+ #: admin/includes/tab-settings.php:1328
947
  msgid "Submission settings"
948
  msgstr ""
949
 
950
+ #: admin/includes/tab-settings.php:1340
951
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
952
  msgstr ""
953
 
954
+ #: admin/includes/tab-settings.php:1340
955
  msgid "Message on comment form"
956
  msgstr ""
957
 
958
+ #: admin/includes/tab-settings.php:1352
959
  msgid "None"
960
  msgstr ""
961
 
962
+ #: admin/includes/tab-settings.php:1353
963
  msgid "Top"
964
  msgstr ""
965
 
966
+ #: admin/includes/tab-settings.php:1354
967
  msgid "Bottom"
968
  msgstr ""
969
 
970
+ #: admin/includes/tab-settings.php:1365
971
  msgid "Plugin settings"
972
  msgstr ""
973
 
974
+ #: admin/includes/tab-settings.php:1378
975
+ msgid ""
976
+ "<dfn title=\"Synchronize all settings over the network wide.\">Network wide "
977
+ "settings</dfn>"
978
+ msgstr ""
979
+
980
+ #: admin/includes/tab-settings.php:1396
981
  msgid "Remove all settings at uninstallation"
982
  msgstr ""
983
 
984
+ #: admin/includes/tab-settings.php:1414
985
  msgid ""
986
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
987
  "dfn>"
988
  msgstr ""
989
 
990
+ #: admin/includes/tab-settings.php:1428
991
  msgid ""
992
  "You need to click the &#8220;Save Changes&#8221; button for imported "
993
  "settings to take effect."
994
  msgstr ""
995
 
996
+ #: admin/includes/tab-settings.php:1434
997
  msgid "Export / Import settings"
998
  msgstr ""
999
 
1000
+ #: admin/includes/tab-settings.php:1441
1001
  msgid "Export settings"
1002
  msgstr ""
1003
 
1004
+ #: admin/includes/tab-settings.php:1442
1005
  msgid "Import from the local file"
1006
  msgstr ""
1007
 
1008
+ #: admin/includes/tab-settings.php:1442
1009
  msgid "Import settings"
1010
  msgstr ""
1011
 
1012
+ #: admin/includes/tab-settings.php:1451
1013
  msgid "Import pre-defined settings"
1014
  msgstr ""
1015
 
1016
+ #: admin/includes/tab-settings.php:1458
1017
  msgid ""
1018
  "Import the default settings to revert to the &#8220;Right after "
1019
  "installing&#8221; state"
1020
  msgstr ""
1021
 
1022
+ #: admin/includes/tab-settings.php:1458
1023
  msgid "Default settings"
1024
  msgstr ""
1025
 
1026
+ #: admin/includes/tab-settings.php:1459
1027
  msgid ""
1028
  "Import the preferred settings mainly by enabling Zero-day Exploit Prevention "
1029
  "for the &#8220;Back-end target settings&#8221;"
1030
  msgstr ""
1031
 
1032
+ #: admin/includes/tab-settings.php:1459
1033
  msgid "Best for Back-end"
1034
  msgstr ""
1035
 
1036
+ #: admin/includes/tab-settings.php:1469
1037
  msgid "Delete DB table for validation logs"
1038
  msgstr ""
1039
 
1040
+ #: admin/includes/tab-settings.php:1477
1041
  msgid "Delete now"
1042
  msgstr ""
1043
 
1044
+ #: admin/includes/tab-settings.php:1485
1045
  msgid "Create DB table for validation logs"
1046
  msgstr ""
1047
 
1048
+ #: admin/includes/tab-settings.php:1493
1049
  msgid "Create now"
1050
  msgstr ""
1051
 
1052
+ #: admin/includes/tab-settings.php:1503
1053
  msgid ""
1054
  "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
1055
+ "forum.\">System information</dfn><br />[ <a rel=\"noreferrer\" href="
1056
  "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
1057
  "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
1058
  msgstr ""
1059
 
1060
+ #: admin/includes/tab-settings.php:1510
1061
  msgid "Show PHP, WordPress, theme and plugins information."
1062
  msgstr ""
1063
 
1064
+ #: admin/includes/tab-settings.php:1510
1065
  msgid "Show information"
1066
  msgstr ""
1067
 
1068
+ #: admin/includes/tab-settings.php:1526
1069
  msgid ""
1070
  "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
1071
  "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
1073
  "\">The best practice for target settings</a>&#8221;."
1074
  msgstr ""
1075
 
1076
+ #: admin/includes/tab-settings.php:1527
1077
  msgid ""
1078
  "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
1079
  "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
1082
  "\">Codex</a>."
1083
  msgstr ""
1084
 
1085
+ #: admin/includes/tab-settings.php:1534
1086
  msgid ""
1087
  "While Maxmind and IP2Location will fetch the local database, others will "
1088
  "pass an IP address to the APIs via HTTP."
1089
  msgstr ""
1090
 
1091
+ #: admin/includes/tab-settings.php:1535
1092
  msgid ""
1093
  "Please select the appropriate APIs to fit the privacy law in your country."
1094
  msgstr ""
1095
 
1096
+ #: admin/includes/tab-settings.php:1542
1097
  msgid ""
1098
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1099
  "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
1101
  "cache plugin."
1102
  msgstr ""
1103
 
1104
+ #: admin/includes/tab-settings.php:1543
1105
  msgid ""
1106
  "If you find any issues or have something to suggest, please feel free to "
1107
  "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
1109
  "\">support forum</a>."
1110
  msgstr ""
1111
 
1112
+ #: admin/includes/tab-settings.php:1550
1113
  msgid ""
1114
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1115
  "ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
1116
  "Block\">Record settings and logs</a>&#8221; for details."
1117
  msgstr ""
1118
 
1119
+ #: admin/includes/tab-statistics.php:21 admin/includes/tab-statistics.php:207
1120
  msgid "Statistics of validation"
1121
  msgstr ""
1122
 
1123
+ #: admin/includes/tab-statistics.php:30
1124
  msgid "Blocked"
1125
  msgstr ""
1126
 
1127
+ #: admin/includes/tab-statistics.php:55
1128
  msgid "Blocked by countries"
1129
  msgstr ""
1130
 
1131
+ #: admin/includes/tab-statistics.php:96
1132
  msgid "Blocked per day"
1133
  msgstr ""
1134
 
1135
+ #: admin/includes/tab-statistics.php:112
1136
  msgid "Blocked by type of IP address"
1137
  msgstr ""
1138
 
1139
+ #: admin/includes/tab-statistics.php:130
1140
  msgid "Name of API"
1141
  msgstr ""
1142
 
1143
+ #: admin/includes/tab-statistics.php:131
1144
  msgid "Calls"
1145
  msgstr ""
1146
 
1147
+ #: admin/includes/tab-statistics.php:132
1148
  msgid "Response [msec]"
1149
  msgstr ""
1150
 
1151
+ #: admin/includes/tab-statistics.php:146
1152
  msgid "Average response time of each API"
1153
  msgstr ""
1154
 
1155
+ #: admin/includes/tab-statistics.php:162
1156
  msgid "Clear statistics"
1157
  msgstr ""
1158
 
1159
+ #: admin/includes/tab-statistics.php:180
1160
+ msgid "Statistics in logs"
1161
+ msgstr ""
1162
+
1163
+ #: admin/includes/tab-statistics.php:232
1164
  msgid "Statistics in cache"
1165
  msgstr ""
1166
 
1167
+ #: admin/includes/tab-statistics.php:240
1168
  msgid "Country code / Access"
1169
  msgstr ""
1170
 
1171
+ #: admin/includes/tab-statistics.php:241
1172
  msgid "Elapsed [sec] / Calls"
1173
  msgstr ""
1174
 
1175
+ #: admin/includes/tab-statistics.php:274
1176
  msgid "IP address in cache"
1177
  msgstr ""
1178
 
1179
+ #: admin/includes/tab-statistics.php:289
1180
  msgid "Clear cache"
1181
  msgstr ""
1182
 
1183
+ #: admin/includes/tab-statistics.php:308
1184
  msgid ""
1185
  "Current setting of [<strong>Record validation statistics</strong>] on "
1186
  "[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
1187
  msgstr ""
1188
 
1189
+ #: admin/includes/tab-statistics.php:309
1190
  msgid ""
1191
  "Please set the proper condition to record and analyze the validation "
1192
  "statistics."
1193
  msgstr ""
1194
 
1195
+ #: admin/includes/tab-statistics.php:323
1196
+ msgid "Country (Top 10)"
1197
+ msgstr ""
1198
+
1199
+ #: admin/includes/tab-statistics.php:324
1200
+ msgid "AS number (Top 10)"
1201
+ msgstr ""
1202
+
1203
+ #: admin/includes/tab-statistics.php:325
1204
+ msgid "IP address (Top 10)"
1205
+ msgstr ""
1206
+
1207
+ #: admin/includes/tab-statistics.php:326
1208
+ msgid "Slug in back-end"
1209
+ msgstr ""
1210
+
1211
+ #: classes/class-ip-geo-block-apis.php:653
1212
  msgid ""
1213
  "You need to select at least one IP geolocation service. Otherwise "
1214
  "<strong>you'll be blocked</strong> after the cache expires."
1215
  msgstr ""
1216
 
1217
+ #: classes/class-ip-geo-block-cron.php:240
1218
  msgid "Your database file is up-to-date."
1219
  msgstr ""
1220
 
1221
+ #: classes/class-ip-geo-block-cron.php:278
 
 
 
 
 
 
 
1222
  #, php-format
1223
+ msgid "Can't lock <code>%s</code>. Please try again after a while."
1224
  msgstr ""
1225
 
1226
+ #: classes/class-ip-geo-block-cron.php:310
1227
  msgid "gz or zip is not supported on your system."
1228
  msgstr ""
1229
 
1245
  "details."
1246
  msgstr ""
1247
 
1248
+ #: classes/class-ip-geo-block-logs.php:165
1249
  #, php-format
1250
  msgid ""
1251
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1252
  "activate again."
1253
  msgstr ""
1254
 
1255
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:150
1256
+ #: wp-content/ip-geo-api/maxmind/class-maxmind.php:210
 
 
1257
  msgid "Database file does not exist."
1258
  msgstr ""
1259
 
languages/ip-geo-block.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: IP Geo Block 3.0.3.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
- "POT-Creation-Date: 2017-07-21 22:43+0900\n"
8
- "PO-Revision-Date: 2017-07-21 22:43+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -25,53 +25,64 @@ msgid ""
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
- #: admin/class-ip-geo-block-admin.php:227
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
- #: admin/class-ip-geo-block-admin.php:228
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
- #: admin/class-ip-geo-block-admin.php:229
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
- #: admin/class-ip-geo-block-admin.php:230
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
- #: admin/class-ip-geo-block-admin.php:231
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
- #: admin/class-ip-geo-block-admin.php:232
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
- #: admin/class-ip-geo-block-admin.php:233
 
 
 
 
 
 
 
 
53
  msgid "This feature is available with HTML5 compliant browsers."
54
  msgstr ""
55
 
56
- #: admin/class-ip-geo-block-admin.php:246
57
  msgid "Contribute at GitHub"
58
  msgstr ""
59
 
60
- #: admin/class-ip-geo-block-admin.php:263
61
- #: admin/class-ip-geo-block-admin.php:508
 
62
  msgid "Settings"
63
  msgstr ""
64
 
65
- #: admin/class-ip-geo-block-admin.php:318
66
- #: admin/class-ip-geo-block-admin.php:319
 
 
67
  msgid "IP Geo Block"
68
  msgstr ""
69
 
70
- #: admin/class-ip-geo-block-admin.php:340
71
  msgid "You need WordPress 3.7+."
72
  msgstr ""
73
 
74
- #: admin/class-ip-geo-block-admin.php:346
75
  #, php-format
76
  msgid ""
77
  "Now downloading geolocation databases in background. After a little while, "
@@ -79,207 +90,231 @@ msgid ""
79
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
80
  msgstr ""
81
 
82
- #: admin/class-ip-geo-block-admin.php:352
83
  #, php-format
84
  msgid ""
85
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
86
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
87
  msgstr ""
88
 
89
- #: admin/class-ip-geo-block-admin.php:361
90
  msgid "Local database and matching rule have been updated."
91
  msgstr ""
92
 
93
- #: admin/class-ip-geo-block-admin.php:372
94
  msgid ""
95
  "Once you logout, you will be unable to login again because the number of "
96
  "login attempts reaches the limit."
97
  msgstr ""
98
 
99
- #: admin/class-ip-geo-block-admin.php:374
100
  #, php-format
101
  msgid ""
102
  "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
103
  "tab</a> to prevent locking yourself out."
104
  msgstr ""
105
 
106
- #: admin/class-ip-geo-block-admin.php:384
107
  msgid ""
108
  "Once you logout, you will be unable to login again because your country code "
109
  "or IP address is in the blacklist."
110
  msgstr ""
111
 
112
- #: admin/class-ip-geo-block-admin.php:385
113
  msgid ""
114
  "Once you logout, you will be unable to login again because your country code "
115
  "or IP address is not in the whitelist."
116
  msgstr ""
117
 
118
- #: admin/class-ip-geo-block-admin.php:388
119
  #, php-format
120
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
121
  msgstr ""
122
 
123
- #: admin/class-ip-geo-block-admin.php:399
124
  msgid ""
125
  "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
126
  "timing&#8221; is imcompatible with <strong>IP Geo Allow</strong>. Please "
127
  "select &#8220;init&#8221; action hook."
128
  msgstr ""
129
 
130
- #: admin/class-ip-geo-block-admin.php:509
131
  msgid "Statistics"
132
  msgstr ""
133
 
134
- #: admin/class-ip-geo-block-admin.php:510
135
  msgid "Logs"
136
  msgstr ""
137
 
138
- #: admin/class-ip-geo-block-admin.php:511
139
  msgid "Search"
140
  msgstr ""
141
 
142
- #: admin/class-ip-geo-block-admin.php:512
 
 
 
 
 
143
  msgid "Attribution"
144
  msgstr ""
145
 
146
- #: admin/class-ip-geo-block-admin.php:522
 
 
 
 
147
  msgid "Toggle all"
148
  msgstr ""
149
 
150
- #: admin/class-ip-geo-block-admin.php:544
151
  msgid "Thanks for providing these great services for free."
152
  msgstr ""
153
 
154
- #: admin/class-ip-geo-block-admin.php:545
155
  msgid ""
156
  "(Most browsers will redirect you to each site <a href=\"http://www."
157
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
158
  "when you click the link</a>.)"
159
  msgstr ""
160
 
161
- #: admin/class-ip-geo-block-admin.php:550
162
  msgid "Back to top"
163
  msgstr ""
164
 
165
- #: admin/class-ip-geo-block-admin.php:646
166
  msgid "Enable"
167
  msgstr ""
168
 
169
- #: admin/class-ip-geo-block-admin.php:1030
170
- #: classes/class-ip-geo-block-cron.php:274
171
- #: classes/class-ip-geo-block-cron.php:306
 
 
172
  #, php-format
173
- msgid "Unable to write %s. Please check the permission."
174
  msgstr ""
175
 
176
- #: admin/class-ip-geo-block-admin.php:1031
177
- #, php-format
178
- msgid "Or please refer to %s to set it manually."
179
- msgid_plural "Or please refer to %s to set them manually."
180
- msgstr[0] ""
181
- msgstr[1] ""
182
-
183
- #: admin/class-ip-geo-block-admin.php:1041
184
- #: classes/class-ip-geo-block-opts.php:385
185
- #, php-format
186
- msgid "Unable to write <code>%s</code>. Please check the permission."
187
  msgstr ""
188
 
189
- #: admin/includes/class-admin-ajax.php:60
190
  msgid "n/a"
191
  msgstr ""
192
 
193
- #: admin/includes/class-admin-ajax.php:63 admin/includes/tab-settings.php:81
194
- #: admin/includes/tab-settings.php:101
195
  msgid "UNKNOWN"
196
  msgstr ""
197
 
198
- #: admin/includes/class-admin-ajax.php:244
199
  #, php-format
200
  msgid ""
201
  "illegal format at %s. Please delete the corresponding line and try again."
202
  msgstr ""
203
 
204
- #: admin/includes/tab-accesslog.php:20 admin/includes/tab-accesslog.php:99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  msgid "Validation logs"
206
  msgstr ""
207
 
208
- #: admin/includes/tab-accesslog.php:29
209
  msgid "Filter logs"
210
  msgstr ""
211
 
212
- #: admin/includes/tab-accesslog.php:38
213
  msgid "Reset"
214
  msgstr ""
215
 
216
- #: admin/includes/tab-accesslog.php:45
217
  msgid "Clear logs"
218
  msgstr ""
219
 
220
- #: admin/includes/tab-accesslog.php:53 admin/includes/tab-statistics.php:173
221
- #: admin/includes/tab-statistics.php:277
222
  msgid "Clear now"
223
  msgstr ""
224
 
225
- #: admin/includes/tab-accesslog.php:61
226
  msgid "Export logs"
227
  msgstr ""
228
 
229
- #: admin/includes/tab-accesslog.php:67 admin/includes/tab-settings.php:1450
230
  msgid "Export to the local file"
231
  msgstr ""
232
 
233
- #: admin/includes/tab-accesslog.php:67
234
  msgid "Export csv"
235
  msgstr ""
236
 
237
- #: admin/includes/tab-accesslog.php:73
238
  #, php-format
239
  msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
240
  msgstr ""
241
 
242
- #: admin/includes/tab-accesslog.php:75 admin/includes/tab-settings.php:453
243
  msgid "Comment post"
244
  msgstr ""
245
 
246
- #: admin/includes/tab-accesslog.php:76 admin/includes/tab-settings.php:454
247
  msgid "XML-RPC"
248
  msgstr ""
249
 
250
- #: admin/includes/tab-accesslog.php:77 admin/includes/tab-settings.php:455
251
  msgid "Login form"
252
  msgstr ""
253
 
254
- #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:456
255
  msgid "Admin area"
256
  msgstr ""
257
 
258
- #: admin/includes/tab-accesslog.php:79 admin/includes/tab-settings.php:458
259
  msgid "public facing pages"
260
  msgstr ""
261
 
262
- #: admin/includes/tab-accesslog.php:79 admin/includes/tab-settings.php:458
263
  msgid "Public facing pages"
264
  msgstr ""
265
 
266
- #: admin/includes/tab-accesslog.php:132
267
  msgid "Date"
268
  msgstr ""
269
 
270
- #: admin/includes/tab-accesslog.php:133 admin/includes/tab-geolocation.php:67
271
- #: admin/includes/tab-statistics.php:219
272
  msgid "IP address"
273
  msgstr ""
274
 
275
- #: admin/includes/tab-accesslog.php:134
276
  msgid "Code"
277
  msgstr ""
278
 
279
- #: admin/includes/tab-accesslog.php:135
280
  msgid "Result"
281
  msgstr ""
282
 
 
 
 
 
283
  #: admin/includes/tab-accesslog.php:136
284
  msgid "Request"
285
  msgstr ""
@@ -327,46 +362,46 @@ msgstr ""
327
  msgid "Search now"
328
  msgstr ""
329
 
330
- #: admin/includes/tab-settings.php:49
331
  msgid "Validation rule settings"
332
  msgstr ""
333
 
334
- #: admin/includes/tab-settings.php:73
335
  msgid ""
336
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
337
  "code by referring &#8220;Scan country code&#8221;.\">Your IP address / "
338
  "Country</dfn>"
339
  msgstr ""
340
 
341
- #: admin/includes/tab-settings.php:82 admin/includes/tab-settings.php:102
342
  msgid "Scan all the APIs you selected at Geolocation API settings"
343
  msgstr ""
344
 
345
- #: admin/includes/tab-settings.php:82 admin/includes/tab-settings.php:102
346
  msgid "Scan country code"
347
  msgstr ""
348
 
349
- #: admin/includes/tab-settings.php:93
350
  msgid ""
351
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
352
  "code by referring &#8220;Scan country code&#8221;.\">Server IP address / "
353
  "Country</dfn>"
354
  msgstr ""
355
 
356
- #: admin/includes/tab-settings.php:110
357
  msgid "Whitelist"
358
  msgstr ""
359
 
360
- #: admin/includes/tab-settings.php:111
361
  msgid "Blacklist"
362
  msgstr ""
363
 
364
- #: admin/includes/tab-settings.php:115
365
  msgid ""
366
  "Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;."
367
  msgstr ""
368
 
369
- #: admin/includes/tab-settings.php:116
370
  msgid ""
371
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
372
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
@@ -376,7 +411,7 @@ msgid ""
376
  "country code</dfn>"
377
  msgstr ""
378
 
379
- #: admin/includes/tab-settings.php:117
380
  msgid ""
381
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
382
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
@@ -386,44 +421,61 @@ msgid ""
386
  "country code</dfn>"
387
  msgstr ""
388
 
389
- #: admin/includes/tab-settings.php:121
390
  msgid "(comma separated)"
391
  msgstr ""
392
 
393
- #: admin/includes/tab-settings.php:122
394
  msgid "(comma or RET separated)"
395
  msgstr ""
396
 
397
- #: admin/includes/tab-settings.php:129 admin/includes/tab-settings.php:789
 
 
 
 
398
  msgid "Matching rule"
399
  msgstr ""
400
 
401
- #: admin/includes/tab-settings.php:141
402
  msgid ""
403
  "A request from which the country code or IP address is <strong>NOT</strong> "
404
  "in the whitelist will be blocked."
405
  msgstr ""
406
 
407
- #: admin/includes/tab-settings.php:142
408
  msgid ""
409
  "A request from which the country code or IP address is in the blacklist will "
410
  "be blocked."
411
  msgstr ""
412
 
413
- #: admin/includes/tab-settings.php:188
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  msgid ""
415
  "<dfn title=\"e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, "
416
- "&#8220;69.46.36.0/27&#8221; for WordFence server\">Whitelist of extra IP "
417
- "addresses prior to country code</dfn>"
418
  msgstr ""
419
 
420
- #: admin/includes/tab-settings.php:207
421
  msgid ""
422
  "<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
423
  "\">Blacklist of extra IP addresses prior to country code</dfn>"
424
  msgstr ""
425
 
426
- #: admin/includes/tab-settings.php:227
427
  msgid ""
428
  "<dfn title=\"If your server is placed behind the proxy server or the load "
429
  "balancing server, you need to put the appropriate key such as &#8220;"
@@ -432,7 +484,7 @@ msgid ""
432
  "addresses</dfn>"
433
  msgstr ""
434
 
435
- #: admin/includes/tab-settings.php:246
436
  msgid ""
437
  "<dfn title=\"It validates malicious signatures independently of &#8220;Block "
438
  "by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target "
@@ -443,47 +495,62 @@ msgid ""
443
  "restore.\"><span></span></a>)</nobr>"
444
  msgstr ""
445
 
446
- #: admin/includes/tab-settings.php:260
447
  msgid ""
448
  "<dfn title=\"Select allowed MIME type.\">Whitelist of allowed MIME type</dfn>"
449
  msgstr ""
450
 
451
- #: admin/includes/tab-settings.php:271
452
  msgid ""
453
  "<dfn title=\"Put forbidden file extensions.\">Blacklist of forbidden file "
454
  "extensions</dfn>"
455
  msgstr ""
456
 
457
- #: admin/includes/tab-settings.php:278
 
 
 
 
 
 
 
 
458
  msgid ""
459
- "<dfn title=\"It restricts the file types on upload to block malware and "
460
- "backdoor via both back-end and front-end. Please consider to select &#8220;"
461
- "mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation timing&#8221; "
462
- "so that other staff would not fetch uploaded files before this validation."
463
- "\">Prevent malicious file uploading</dfn>"
464
  msgstr ""
465
 
466
- #: admin/includes/tab-settings.php:289 admin/includes/tab-settings.php:495
467
- #: admin/includes/tab-settings.php:638 admin/includes/tab-settings.php:1214
 
 
 
 
 
 
 
 
 
468
  msgid "Disable"
469
  msgstr ""
470
 
471
- #: admin/includes/tab-settings.php:290
472
- msgid "Verify capability and MIME type"
473
  msgstr ""
474
 
475
- #: admin/includes/tab-settings.php:291
476
- msgid "Verify only file extension"
477
  msgstr ""
478
 
479
- #: admin/includes/tab-settings.php:326
480
  #, php-format
481
  msgid ""
482
  "<dfn title=\"You can put your original 403.php and so on into your theme "
483
  "directory.\">Response code</dfn> %s"
484
  msgstr ""
485
 
486
- #: admin/includes/tab-settings.php:356 admin/includes/tab-settings.php:876
487
  msgid ""
488
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. If it is pointed "
489
  "to a public facing page, visitors would not be blocked on the page to "
@@ -492,42 +559,42 @@ msgid ""
492
  "\">Redirect URL</dfn>"
493
  msgstr ""
494
 
495
- #: admin/includes/tab-settings.php:373 admin/includes/tab-settings.php:894
496
  msgid ""
497
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
498
  "message</dfn>"
499
  msgstr ""
500
 
501
- #: admin/includes/tab-settings.php:390
502
  msgid ""
503
  "<dfn title=\"This is applied to &#8220;XML-RPC&#8221; and &#8220;Login "
504
  "form&#8221;. Lockout period is defined as expiration time at &#8220;Cache "
505
  "settings&#8221;.\">Max number of failed login attempts per IP address</dfn>"
506
  msgstr ""
507
 
508
- #: admin/includes/tab-settings.php:418
509
  msgid "Select when to run the validation."
510
  msgstr ""
511
 
512
- #: admin/includes/tab-settings.php:418
513
  msgid "Validation timing"
514
  msgstr ""
515
 
516
- #: admin/includes/tab-settings.php:429
517
  msgid "&#8220;init&#8221; action hook"
518
  msgstr ""
519
 
520
- #: admin/includes/tab-settings.php:430
521
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
522
  msgstr ""
523
 
524
- #: admin/includes/tab-settings.php:433
525
  msgid ""
526
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
527
  "plugins."
528
  msgstr ""
529
 
530
- #: admin/includes/tab-settings.php:434
531
  msgid ""
532
  "Validate at an earlier phase than other typical plugins. It can reduce load "
533
  "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
@@ -535,64 +602,64 @@ msgid ""
535
  "restrictions</a>."
536
  msgstr ""
537
 
538
- #: admin/includes/tab-settings.php:445
539
  msgid "Back-end target settings"
540
  msgstr ""
541
 
542
- #: admin/includes/tab-settings.php:451
543
  #, php-format
544
  msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
545
  msgstr ""
546
 
547
- #: admin/includes/tab-settings.php:457
548
  msgid "Other areas"
549
  msgstr ""
550
 
551
- #: admin/includes/tab-settings.php:476 admin/includes/tab-settings.php:496
552
- #: admin/includes/tab-settings.php:529 admin/includes/tab-settings.php:535
553
- #: admin/includes/tab-settings.php:777
554
  msgid "Block by country"
555
  msgstr ""
556
 
557
- #: admin/includes/tab-settings.php:497
558
  msgid "Completely close"
559
  msgstr ""
560
 
561
- #: admin/includes/tab-settings.php:530
562
  msgid ""
563
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
564
  "actions</dfn>"
565
  msgstr ""
566
 
567
- #: admin/includes/tab-settings.php:536
568
  msgid "Prevent Zero-day Exploit"
569
  msgstr ""
570
 
571
- #: admin/includes/tab-settings.php:540
572
  msgid ""
573
  "It will block a request related to the services for both public facing pages "
574
  "and the dashboard."
575
  msgstr ""
576
 
577
- #: admin/includes/tab-settings.php:541
578
  msgid ""
579
  "Regardless of the country code, it will block a malicious request related to "
580
  "the services only for the dashboard."
581
  msgstr ""
582
 
583
- #: admin/includes/tab-settings.php:592
584
- msgid "for logged-in user"
585
  msgstr ""
586
 
587
- #: admin/includes/tab-settings.php:593
588
- msgid "for non logged-in user"
589
  msgstr ""
590
 
591
- #: admin/includes/tab-settings.php:614
592
  msgid "Admin ajax/post"
593
  msgstr ""
594
 
595
- #: admin/includes/tab-settings.php:627
596
  msgid ""
597
  "<dfn title=\"Specify the page name (&#8220;page=&hellip;&#8221;) or the "
598
  "action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking "
@@ -600,52 +667,60 @@ msgid ""
600
  "Prevent Zero-day Exploit&#8221; for logged-in user.\">Exceptions</dfn>"
601
  msgstr ""
602
 
603
- #: admin/includes/tab-settings.php:632
 
 
 
 
604
  msgid "Candidate actions"
605
  msgstr ""
606
 
607
- #: admin/includes/tab-settings.php:640
608
  #, php-format
609
  msgid ""
610
  "Regardless of the country code, it will block a malicious request to <code>"
611
  "%s&ctdot;/*.php</code>."
612
  msgstr ""
613
 
614
- #: admin/includes/tab-settings.php:641
 
 
 
 
 
 
 
615
  #, php-format
616
  msgid ""
617
  "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
618
  "does not load WordPress core."
619
  msgstr ""
620
 
621
- #: admin/includes/tab-settings.php:642
622
- msgid ""
623
- "<dfn title=\"Select the item which causes undesired blocking in order to "
624
- "exclude from the validation target. Grayed item indicates &#8220;"
625
- "INACTIVE&#8221;.\">Exceptions</dfn>"
626
  msgstr ""
627
 
628
- #: admin/includes/tab-settings.php:678 admin/includes/tab-settings.php:728
629
  msgid "Force to load WP core"
630
  msgstr ""
631
 
632
- #: admin/includes/tab-settings.php:683
633
  msgid "Plugins area"
634
  msgstr ""
635
 
636
- #: admin/includes/tab-settings.php:733
637
  msgid "Themes area"
638
  msgstr ""
639
 
640
- #: admin/includes/tab-settings.php:758
641
  msgid "Front-end target settings"
642
  msgstr ""
643
 
644
- #: admin/includes/tab-settings.php:782
645
  msgid "Follow &#8220;Validation rule settings&#8221;"
646
  msgstr ""
647
 
648
- #: admin/includes/tab-settings.php:844
649
  #, php-format
650
  msgid ""
651
  "<dfn title=\"You can configure a different response code from the Back-end. "
@@ -653,53 +728,53 @@ msgid ""
653
  "\">Response code</dfn> %s"
654
  msgstr ""
655
 
656
- #: admin/includes/tab-settings.php:909
657
  msgid ""
658
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
659
  msgstr ""
660
 
661
- #: admin/includes/tab-settings.php:921
662
  msgid ""
663
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
664
  "target.\">Post type</dfn>"
665
  msgstr ""
666
 
667
- #: admin/includes/tab-settings.php:933
668
  msgid ""
669
  "<dfn title=\"Specify the individual category on a single page or archive "
670
  "page as a blocking target.\">Category</dfn>"
671
  msgstr ""
672
 
673
- #: admin/includes/tab-settings.php:945
674
  msgid ""
675
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
676
  "a blocking target.\">Tag</dfn>"
677
  msgstr ""
678
 
679
- #: admin/includes/tab-settings.php:960
680
  msgid "Specify the validation target on front-end."
681
  msgstr ""
682
 
683
- #: admin/includes/tab-settings.php:960
684
  msgid "Validation target"
685
  msgstr ""
686
 
687
- #: admin/includes/tab-settings.php:971
688
  msgid "All requests"
689
  msgstr ""
690
 
691
- #: admin/includes/tab-settings.php:972
692
  msgid "Specify the targets"
693
  msgstr ""
694
 
695
- #: admin/includes/tab-settings.php:975
696
  msgid ""
697
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
698
  "wp&#8221; action hook. It means that this feature would not be compatible "
699
  "with any page caching."
700
  msgstr ""
701
 
702
- #: admin/includes/tab-settings.php:985
703
  msgid ""
704
  "A part of user agent string and a qualification connected with a separator "
705
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
@@ -709,19 +784,19 @@ msgid ""
709
  "qualification&#8221;."
710
  msgstr ""
711
 
712
- #: admin/includes/tab-settings.php:985
713
  msgid "UA string and qualification"
714
  msgstr ""
715
 
716
- #: admin/includes/tab-settings.php:1004
717
  msgid "Specify the name of action that is invariably blocked."
718
  msgstr ""
719
 
720
- #: admin/includes/tab-settings.php:1004
721
  msgid "Excluded actions"
722
  msgstr ""
723
 
724
- #: admin/includes/tab-settings.php:1023
725
  msgid ""
726
  "It enables to verify the host by reverse DNS lookup which would spend some "
727
  "server resources. If it is disabled, &#8220;HOST&#8221; and &#8220;"
@@ -729,35 +804,35 @@ msgid ""
729
  "return &#8220;true&#8221;."
730
  msgstr ""
731
 
732
- #: admin/includes/tab-settings.php:1023
733
  msgid "DNS reverse lookup"
734
  msgstr ""
735
 
736
- #: admin/includes/tab-settings.php:1040
737
  msgid ""
738
  "It enables to simulate validation without deployment. The results can be "
739
  "found at &#8220;Public facing pages&#8221; in Logs."
740
  msgstr ""
741
 
742
- #: admin/includes/tab-settings.php:1040
743
  msgid "Simulation mode"
744
  msgstr ""
745
 
746
- #: admin/includes/tab-settings.php:1059
747
  msgid "Geolocation API settings"
748
  msgstr ""
749
 
750
- #: admin/includes/tab-settings.php:1068
751
  msgid ""
752
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
753
  "selection and key settings</dfn>"
754
  msgstr ""
755
 
756
- #: admin/includes/tab-settings.php:1087
757
  msgid "Timeout for network API [sec]"
758
  msgstr ""
759
 
760
- #: admin/includes/tab-settings.php:1108
761
  #, php-format
762
  msgid ""
763
  "Can not find geolocation API libraries in <code>%s</code>. It seems to have "
@@ -772,87 +847,87 @@ msgid ""
772
  "troubles? | IP Geo Block\">this instruction</a>."
773
  msgstr ""
774
 
775
- #: admin/includes/tab-settings.php:1117
776
  msgid "Local database settings"
777
  msgstr ""
778
 
779
- #: admin/includes/tab-settings.php:1131
780
  msgid "database"
781
  msgstr ""
782
 
783
- #: admin/includes/tab-settings.php:1132
784
- #: classes/class-ip-geo-block-cron.php:345
785
  #, php-format
786
  msgid "Last update: %s"
787
  msgstr ""
788
 
789
- #: admin/includes/tab-settings.php:1141
790
  msgid "Auto updating (once a month)"
791
  msgstr ""
792
 
793
- #: admin/includes/tab-settings.php:1158
794
  msgid "Download database"
795
  msgstr ""
796
 
797
- #: admin/includes/tab-settings.php:1166
798
  msgid "Download now"
799
  msgstr ""
800
 
801
- #: admin/includes/tab-settings.php:1178
802
  msgid "Record settings"
803
  msgstr ""
804
 
805
- #: admin/includes/tab-settings.php:1187
806
  msgid "Record validation statistics"
807
  msgstr ""
808
 
809
- #: admin/includes/tab-settings.php:1203
810
  msgid "Record validation logs"
811
  msgstr ""
812
 
813
- #: admin/includes/tab-settings.php:1215
814
  msgid "Only when blocked"
815
  msgstr ""
816
 
817
- #: admin/includes/tab-settings.php:1216
818
  msgid "Only when passed"
819
  msgstr ""
820
 
821
- #: admin/includes/tab-settings.php:1217
822
  msgid "Unauthenticated user"
823
  msgstr ""
824
 
825
- #: admin/includes/tab-settings.php:1218
826
  msgid "Authenticated user"
827
  msgstr ""
828
 
829
- #: admin/includes/tab-settings.php:1219
830
  msgid "All of validation"
831
  msgstr ""
832
 
833
- #: admin/includes/tab-settings.php:1228
834
  msgid "Recording period of the logs (days)"
835
  msgstr ""
836
 
837
- #: admin/includes/tab-settings.php:1244
838
  msgid "Maximum length of logs for each target"
839
  msgstr ""
840
 
841
- #: admin/includes/tab-settings.php:1261
842
  msgid ""
843
  "<dfn title=\"e.g. action, comment, log, pwd, FILES\">$_POST keys to be "
844
  "recorded with their values in logs</dfn>"
845
  msgstr ""
846
 
847
- #: admin/includes/tab-settings.php:1279
848
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
849
  msgstr ""
850
 
851
- #: admin/includes/tab-settings.php:1297
852
  msgid "IP address cache settings"
853
  msgstr ""
854
 
855
- #: admin/includes/tab-settings.php:1306
856
  #, php-format
857
  msgid ""
858
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
@@ -860,131 +935,137 @@ msgid ""
860
  "\">Expiration time [sec]</dfn>"
861
  msgstr ""
862
 
863
- #: admin/includes/tab-settings.php:1322
864
  msgid "Garbage collection period [sec]"
865
  msgstr ""
866
 
867
- #: admin/includes/tab-settings.php:1339
868
  msgid "Number of entries to be displayed in cache"
869
  msgstr ""
870
 
871
- #: admin/includes/tab-settings.php:1358
872
  msgid "Submission settings"
873
  msgstr ""
874
 
875
- #: admin/includes/tab-settings.php:1370
876
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
877
  msgstr ""
878
 
879
- #: admin/includes/tab-settings.php:1370
880
  msgid "Message on comment form"
881
  msgstr ""
882
 
883
- #: admin/includes/tab-settings.php:1382
884
  msgid "None"
885
  msgstr ""
886
 
887
- #: admin/includes/tab-settings.php:1383
888
  msgid "Top"
889
  msgstr ""
890
 
891
- #: admin/includes/tab-settings.php:1384
892
  msgid "Bottom"
893
  msgstr ""
894
 
895
- #: admin/includes/tab-settings.php:1396
896
  msgid "Plugin settings"
897
  msgstr ""
898
 
899
- #: admin/includes/tab-settings.php:1405
 
 
 
 
 
 
900
  msgid "Remove all settings at uninstallation"
901
  msgstr ""
902
 
903
- #: admin/includes/tab-settings.php:1423
904
  msgid ""
905
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
906
  "dfn>"
907
  msgstr ""
908
 
909
- #: admin/includes/tab-settings.php:1437
910
  msgid ""
911
  "You need to click the &#8220;Save Changes&#8221; button for imported "
912
  "settings to take effect."
913
  msgstr ""
914
 
915
- #: admin/includes/tab-settings.php:1443
916
  msgid "Export / Import settings"
917
  msgstr ""
918
 
919
- #: admin/includes/tab-settings.php:1450
920
  msgid "Export settings"
921
  msgstr ""
922
 
923
- #: admin/includes/tab-settings.php:1451
924
  msgid "Import from the local file"
925
  msgstr ""
926
 
927
- #: admin/includes/tab-settings.php:1451
928
  msgid "Import settings"
929
  msgstr ""
930
 
931
- #: admin/includes/tab-settings.php:1460
932
  msgid "Import pre-defined settings"
933
  msgstr ""
934
 
935
- #: admin/includes/tab-settings.php:1467
936
  msgid ""
937
  "Import the default settings to revert to the &#8220;Right after "
938
  "installing&#8221; state"
939
  msgstr ""
940
 
941
- #: admin/includes/tab-settings.php:1467
942
  msgid "Default settings"
943
  msgstr ""
944
 
945
- #: admin/includes/tab-settings.php:1468
946
  msgid ""
947
  "Import the preferred settings mainly by enabling Zero-day Exploit Prevention "
948
  "for the &#8220;Back-end target settings&#8221;"
949
  msgstr ""
950
 
951
- #: admin/includes/tab-settings.php:1468
952
  msgid "Best for Back-end"
953
  msgstr ""
954
 
955
- #: admin/includes/tab-settings.php:1478
956
  msgid "Delete DB table for validation logs"
957
  msgstr ""
958
 
959
- #: admin/includes/tab-settings.php:1486
960
  msgid "Delete now"
961
  msgstr ""
962
 
963
- #: admin/includes/tab-settings.php:1494
964
  msgid "Create DB table for validation logs"
965
  msgstr ""
966
 
967
- #: admin/includes/tab-settings.php:1502
968
  msgid "Create now"
969
  msgstr ""
970
 
971
- #: admin/includes/tab-settings.php:1512
972
  msgid ""
973
  "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
974
- "forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
975
  "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
976
  "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
977
  msgstr ""
978
 
979
- #: admin/includes/tab-settings.php:1519
980
  msgid "Show PHP, WordPress, theme and plugins information."
981
  msgstr ""
982
 
983
- #: admin/includes/tab-settings.php:1519
984
  msgid "Show information"
985
  msgstr ""
986
 
987
- #: admin/includes/tab-settings.php:1535
988
  msgid ""
989
  "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
990
  "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
@@ -992,7 +1073,7 @@ msgid ""
992
  "\">The best practice for target settings</a>&#8221;."
993
  msgstr ""
994
 
995
- #: admin/includes/tab-settings.php:1536
996
  msgid ""
997
  "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
998
  "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
@@ -1001,18 +1082,18 @@ msgid ""
1001
  "\">Codex</a>."
1002
  msgstr ""
1003
 
1004
- #: admin/includes/tab-settings.php:1543
1005
  msgid ""
1006
  "While Maxmind and IP2Location will fetch the local database, others will "
1007
  "pass an IP address to the APIs via HTTP."
1008
  msgstr ""
1009
 
1010
- #: admin/includes/tab-settings.php:1544
1011
  msgid ""
1012
  "Please select the appropriate APIs to fit the privacy law in your country."
1013
  msgstr ""
1014
 
1015
- #: admin/includes/tab-settings.php:1551
1016
  msgid ""
1017
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1018
  "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
@@ -1020,7 +1101,7 @@ msgid ""
1020
  "cache plugin."
1021
  msgstr ""
1022
 
1023
- #: admin/includes/tab-settings.php:1552
1024
  msgid ""
1025
  "If you find any issues or have something to suggest, please feel free to "
1026
  "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
@@ -1028,108 +1109,121 @@ msgid ""
1028
  "\">support forum</a>."
1029
  msgstr ""
1030
 
1031
- #: admin/includes/tab-settings.php:1559
1032
  msgid ""
1033
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1034
  "ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
1035
  "Block\">Record settings and logs</a>&#8221; for details."
1036
  msgstr ""
1037
 
1038
- #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:186
1039
  msgid "Statistics of validation"
1040
  msgstr ""
1041
 
1042
- #: admin/includes/tab-statistics.php:33
1043
  msgid "Blocked"
1044
  msgstr ""
1045
 
1046
- #: admin/includes/tab-statistics.php:58
1047
  msgid "Blocked by countries"
1048
  msgstr ""
1049
 
1050
- #: admin/includes/tab-statistics.php:99
1051
  msgid "Blocked per day"
1052
  msgstr ""
1053
 
1054
- #: admin/includes/tab-statistics.php:115
1055
  msgid "Blocked by type of IP address"
1056
  msgstr ""
1057
 
1058
- #: admin/includes/tab-statistics.php:133
1059
  msgid "Name of API"
1060
  msgstr ""
1061
 
1062
- #: admin/includes/tab-statistics.php:134
1063
  msgid "Calls"
1064
  msgstr ""
1065
 
1066
- #: admin/includes/tab-statistics.php:135
1067
  msgid "Response [msec]"
1068
  msgstr ""
1069
 
1070
- #: admin/includes/tab-statistics.php:149
1071
  msgid "Average response time of each API"
1072
  msgstr ""
1073
 
1074
- #: admin/includes/tab-statistics.php:165
1075
  msgid "Clear statistics"
1076
  msgstr ""
1077
 
1078
- #: admin/includes/tab-statistics.php:212
 
 
 
 
1079
  msgid "Statistics in cache"
1080
  msgstr ""
1081
 
1082
- #: admin/includes/tab-statistics.php:220
1083
  msgid "Country code / Access"
1084
  msgstr ""
1085
 
1086
- #: admin/includes/tab-statistics.php:221
1087
  msgid "Elapsed [sec] / Calls"
1088
  msgstr ""
1089
 
1090
- #: admin/includes/tab-statistics.php:254
1091
  msgid "IP address in cache"
1092
  msgstr ""
1093
 
1094
- #: admin/includes/tab-statistics.php:269
1095
  msgid "Clear cache"
1096
  msgstr ""
1097
 
1098
- #: admin/includes/tab-statistics.php:288
1099
  msgid ""
1100
  "Current setting of [<strong>Record validation statistics</strong>] on "
1101
  "[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
1102
  msgstr ""
1103
 
1104
- #: admin/includes/tab-statistics.php:289
1105
  msgid ""
1106
  "Please set the proper condition to record and analyze the validation "
1107
  "statistics."
1108
  msgstr ""
1109
 
1110
- #: classes/class-ip-geo-block-apis.php:651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  msgid ""
1112
  "You need to select at least one IP geolocation service. Otherwise "
1113
  "<strong>you'll be blocked</strong> after the cache expires."
1114
  msgstr ""
1115
 
1116
- #: classes/class-ip-geo-block-cron.php:241
1117
  msgid "Your database file is up-to-date."
1118
  msgstr ""
1119
 
1120
- #: classes/class-ip-geo-block-cron.php:269
1121
- #: classes/class-ip-geo-block-cron.php:301
1122
- #, php-format
1123
- msgid "Unable to read %s. Please check the permission."
1124
- msgstr ""
1125
-
1126
- #: classes/class-ip-geo-block-cron.php:279
1127
- #: classes/class-ip-geo-block-cron.php:311
1128
  #, php-format
1129
- msgid "Can't lock %s. Please try again after a while."
1130
  msgstr ""
1131
 
1132
- #: classes/class-ip-geo-block-cron.php:323
1133
  msgid "gz or zip is not supported on your system."
1134
  msgstr ""
1135
 
@@ -1151,17 +1245,15 @@ msgid ""
1151
  "details."
1152
  msgstr ""
1153
 
1154
- #: classes/class-ip-geo-block-logs.php:149
1155
  #, php-format
1156
  msgid ""
1157
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1158
  "activate again."
1159
  msgstr ""
1160
 
1161
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:157
1162
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:186
1163
- #: wp-content/ip-geo-api/maxmind/class-maxmind.php:171
1164
- #: wp-content/ip-geo-api/maxmind/class-maxmind.php:200
1165
  msgid "Database file does not exist."
1166
  msgstr ""
1167
 
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: IP Geo Block 3.0.4.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
+ "POT-Creation-Date: 2017-09-24 16:25+0900\n"
8
+ "PO-Revision-Date: 2017-09-24 16:25+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
+ #: admin/class-ip-geo-block-admin.php:247
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
+ #: admin/class-ip-geo-block-admin.php:248
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
+ #: admin/class-ip-geo-block-admin.php:249
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
+ #: admin/class-ip-geo-block-admin.php:250
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
+ #: admin/class-ip-geo-block-admin.php:251
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
+ #: admin/class-ip-geo-block-admin.php:252
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
+ #: admin/class-ip-geo-block-admin.php:253
53
+ msgid "ajax for logged-in user"
54
+ msgstr ""
55
+
56
+ #: admin/class-ip-geo-block-admin.php:254
57
+ msgid "ajax for non logged-in user"
58
+ msgstr ""
59
+
60
+ #: admin/class-ip-geo-block-admin.php:255
61
  msgid "This feature is available with HTML5 compliant browsers."
62
  msgstr ""
63
 
64
+ #: admin/class-ip-geo-block-admin.php:268
65
  msgid "Contribute at GitHub"
66
  msgstr ""
67
 
68
+ #: admin/class-ip-geo-block-admin.php:285
69
+ #: admin/class-ip-geo-block-admin.php:588
70
+ #: admin/class-ip-geo-block-admin.php:606
71
  msgid "Settings"
72
  msgstr ""
73
 
74
+ #: admin/class-ip-geo-block-admin.php:377
75
+ #: admin/class-ip-geo-block-admin.php:378
76
+ #: admin/class-ip-geo-block-admin.php:388
77
+ #: admin/class-ip-geo-block-admin.php:389
78
  msgid "IP Geo Block"
79
  msgstr ""
80
 
81
+ #: admin/class-ip-geo-block-admin.php:420
82
  msgid "You need WordPress 3.7+."
83
  msgstr ""
84
 
85
+ #: admin/class-ip-geo-block-admin.php:426
86
  #, php-format
87
  msgid ""
88
  "Now downloading geolocation databases in background. After a little while, "
90
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
91
  msgstr ""
92
 
93
+ #: admin/class-ip-geo-block-admin.php:432
94
  #, php-format
95
  msgid ""
96
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
97
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
98
  msgstr ""
99
 
100
+ #: admin/class-ip-geo-block-admin.php:441
101
  msgid "Local database and matching rule have been updated."
102
  msgstr ""
103
 
104
+ #: admin/class-ip-geo-block-admin.php:452
105
  msgid ""
106
  "Once you logout, you will be unable to login again because the number of "
107
  "login attempts reaches the limit."
108
  msgstr ""
109
 
110
+ #: admin/class-ip-geo-block-admin.php:454
111
  #, php-format
112
  msgid ""
113
  "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
114
  "tab</a> to prevent locking yourself out."
115
  msgstr ""
116
 
117
+ #: admin/class-ip-geo-block-admin.php:464
118
  msgid ""
119
  "Once you logout, you will be unable to login again because your country code "
120
  "or IP address is in the blacklist."
121
  msgstr ""
122
 
123
+ #: admin/class-ip-geo-block-admin.php:465
124
  msgid ""
125
  "Once you logout, you will be unable to login again because your country code "
126
  "or IP address is not in the whitelist."
127
  msgstr ""
128
 
129
+ #: admin/class-ip-geo-block-admin.php:468
130
  #, php-format
131
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
132
  msgstr ""
133
 
134
+ #: admin/class-ip-geo-block-admin.php:479
135
  msgid ""
136
  "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
137
  "timing&#8221; is imcompatible with <strong>IP Geo Allow</strong>. Please "
138
  "select &#8220;init&#8221; action hook."
139
  msgstr ""
140
 
141
+ #: admin/class-ip-geo-block-admin.php:589 admin/includes/tab-network.php:38
142
  msgid "Statistics"
143
  msgstr ""
144
 
145
+ #: admin/class-ip-geo-block-admin.php:590 admin/includes/tab-network.php:39
146
  msgid "Logs"
147
  msgstr ""
148
 
149
+ #: admin/class-ip-geo-block-admin.php:591
150
  msgid "Search"
151
  msgstr ""
152
 
153
+ #: admin/class-ip-geo-block-admin.php:592
154
+ #: admin/class-ip-geo-block-admin.php:607
155
+ msgid "Sites"
156
+ msgstr ""
157
+
158
+ #: admin/class-ip-geo-block-admin.php:593
159
  msgid "Attribution"
160
  msgstr ""
161
 
162
+ #: admin/class-ip-geo-block-admin.php:617
163
+ msgid "Network"
164
+ msgstr ""
165
+
166
+ #: admin/class-ip-geo-block-admin.php:630
167
  msgid "Toggle all"
168
  msgstr ""
169
 
170
+ #: admin/class-ip-geo-block-admin.php:652
171
  msgid "Thanks for providing these great services for free."
172
  msgstr ""
173
 
174
+ #: admin/class-ip-geo-block-admin.php:653
175
  msgid ""
176
  "(Most browsers will redirect you to each site <a href=\"http://www."
177
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
178
  "when you click the link</a>.)"
179
  msgstr ""
180
 
181
+ #: admin/class-ip-geo-block-admin.php:658
182
  msgid "Back to top"
183
  msgstr ""
184
 
185
+ #: admin/class-ip-geo-block-admin.php:755
186
  msgid "Enable"
187
  msgstr ""
188
 
189
+ #: admin/class-ip-geo-block-admin.php:1147
190
+ #: admin/includes/class-admin-rewrite.php:169
191
+ #: classes/class-ip-geo-block-cron.php:273
192
+ #: classes/class-ip-geo-block-cron.php:305
193
+ #: classes/class-ip-geo-block-opts.php:401
194
  #, php-format
195
+ msgid "Unable to write <code>%s</code>. Please check the permission."
196
  msgstr ""
197
 
198
+ #: admin/class-ip-geo-block-admin.php:1177
199
+ msgid "Settings saved."
 
 
 
 
 
 
 
 
 
200
  msgstr ""
201
 
202
+ #: admin/includes/class-admin-ajax.php:69
203
  msgid "n/a"
204
  msgstr ""
205
 
206
+ #: admin/includes/class-admin-ajax.php:72 admin/includes/tab-settings.php:76
207
+ #: admin/includes/tab-settings.php:96
208
  msgid "UNKNOWN"
209
  msgstr ""
210
 
211
+ #: admin/includes/class-admin-ajax.php:255
212
  #, php-format
213
  msgid ""
214
  "illegal format at %s. Please delete the corresponding line and try again."
215
  msgstr ""
216
 
217
+ #: admin/includes/class-admin-rewrite.php:143
218
+ #: classes/class-ip-geo-block-cron.php:268
219
+ #: classes/class-ip-geo-block-cron.php:300
220
+ #, php-format
221
+ msgid "Unable to read <code>%s</code>. Please check the permission."
222
+ msgstr ""
223
+
224
+ #: admin/includes/class-admin-rewrite.php:144
225
+ #: admin/includes/class-admin-rewrite.php:170
226
+ #, php-format
227
+ msgid "Or please refer to %s to set it manually."
228
+ msgstr ""
229
+
230
+ #: admin/includes/class-admin-rewrite.php:208
231
+ #, php-format
232
+ msgid "&#8220;auto_prepend_file&#8221; already defined in %s."
233
+ msgstr ""
234
+
235
+ #: admin/includes/tab-accesslog.php:19 admin/includes/tab-accesslog.php:97
236
  msgid "Validation logs"
237
  msgstr ""
238
 
239
+ #: admin/includes/tab-accesslog.php:28
240
  msgid "Filter logs"
241
  msgstr ""
242
 
243
+ #: admin/includes/tab-accesslog.php:37
244
  msgid "Reset"
245
  msgstr ""
246
 
247
+ #: admin/includes/tab-accesslog.php:44 admin/includes/tab-statistics.php:188
248
  msgid "Clear logs"
249
  msgstr ""
250
 
251
+ #: admin/includes/tab-accesslog.php:52 admin/includes/tab-statistics.php:170
252
+ #: admin/includes/tab-statistics.php:196 admin/includes/tab-statistics.php:297
253
  msgid "Clear now"
254
  msgstr ""
255
 
256
+ #: admin/includes/tab-accesslog.php:60
257
  msgid "Export logs"
258
  msgstr ""
259
 
260
+ #: admin/includes/tab-accesslog.php:66 admin/includes/tab-settings.php:1441
261
  msgid "Export to the local file"
262
  msgstr ""
263
 
264
+ #: admin/includes/tab-accesslog.php:66
265
  msgid "Export csv"
266
  msgstr ""
267
 
268
+ #: admin/includes/tab-accesslog.php:72
269
  #, php-format
270
  msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
271
  msgstr ""
272
 
273
+ #: admin/includes/tab-accesslog.php:74 admin/includes/tab-settings.php:450
274
  msgid "Comment post"
275
  msgstr ""
276
 
277
+ #: admin/includes/tab-accesslog.php:75 admin/includes/tab-settings.php:451
278
  msgid "XML-RPC"
279
  msgstr ""
280
 
281
+ #: admin/includes/tab-accesslog.php:76 admin/includes/tab-settings.php:452
282
  msgid "Login form"
283
  msgstr ""
284
 
285
+ #: admin/includes/tab-accesslog.php:77 admin/includes/tab-settings.php:453
286
  msgid "Admin area"
287
  msgstr ""
288
 
289
+ #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:455
290
  msgid "public facing pages"
291
  msgstr ""
292
 
293
+ #: admin/includes/tab-accesslog.php:78 admin/includes/tab-settings.php:455
294
  msgid "Public facing pages"
295
  msgstr ""
296
 
297
+ #: admin/includes/tab-accesslog.php:131
298
  msgid "Date"
299
  msgstr ""
300
 
301
+ #: admin/includes/tab-accesslog.php:132 admin/includes/tab-geolocation.php:67
302
+ #: admin/includes/tab-statistics.php:239
303
  msgid "IP address"
304
  msgstr ""
305
 
306
+ #: admin/includes/tab-accesslog.php:133
307
  msgid "Code"
308
  msgstr ""
309
 
310
+ #: admin/includes/tab-accesslog.php:134
311
  msgid "Result"
312
  msgstr ""
313
 
314
+ #: admin/includes/tab-accesslog.php:135
315
+ msgid "AS number"
316
+ msgstr ""
317
+
318
  #: admin/includes/tab-accesslog.php:136
319
  msgid "Request"
320
  msgstr ""
362
  msgid "Search now"
363
  msgstr ""
364
 
365
+ #: admin/includes/tab-settings.php:44
366
  msgid "Validation rule settings"
367
  msgstr ""
368
 
369
+ #: admin/includes/tab-settings.php:68
370
  msgid ""
371
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
372
  "code by referring &#8220;Scan country code&#8221;.\">Your IP address / "
373
  "Country</dfn>"
374
  msgstr ""
375
 
376
+ #: admin/includes/tab-settings.php:77 admin/includes/tab-settings.php:97
377
  msgid "Scan all the APIs you selected at Geolocation API settings"
378
  msgstr ""
379
 
380
+ #: admin/includes/tab-settings.php:77 admin/includes/tab-settings.php:97
381
  msgid "Scan country code"
382
  msgstr ""
383
 
384
+ #: admin/includes/tab-settings.php:88
385
  msgid ""
386
  "<dfn title=\"You can confirm the appropriate Geolocation APIs and country "
387
  "code by referring &#8220;Scan country code&#8221;.\">Server IP address / "
388
  "Country</dfn>"
389
  msgstr ""
390
 
391
+ #: admin/includes/tab-settings.php:105
392
  msgid "Whitelist"
393
  msgstr ""
394
 
395
+ #: admin/includes/tab-settings.php:106
396
  msgid "Blacklist"
397
  msgstr ""
398
 
399
+ #: admin/includes/tab-settings.php:110
400
  msgid ""
401
  "Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;."
402
  msgstr ""
403
 
404
+ #: admin/includes/tab-settings.php:111
405
  msgid ""
406
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
407
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
411
  "country code</dfn>"
412
  msgstr ""
413
 
414
+ #: admin/includes/tab-settings.php:112
415
  msgid ""
416
  "<dfn title=\"&#8220;Block by country&#8221; will be bypassed in case of "
417
  "empty. The special code &#8220;XX&#8221; is assigned as private IP address "
421
  "country code</dfn>"
422
  msgstr ""
423
 
424
+ #: admin/includes/tab-settings.php:116
425
  msgid "(comma separated)"
426
  msgstr ""
427
 
428
+ #: admin/includes/tab-settings.php:117
429
  msgid "(comma or RET separated)"
430
  msgstr ""
431
 
432
+ #: admin/includes/tab-settings.php:118
433
+ msgid "Toggle selection"
434
+ msgstr ""
435
+
436
+ #: admin/includes/tab-settings.php:125 admin/includes/tab-settings.php:763
437
  msgid "Matching rule"
438
  msgstr ""
439
 
440
+ #: admin/includes/tab-settings.php:137
441
  msgid ""
442
  "A request from which the country code or IP address is <strong>NOT</strong> "
443
  "in the whitelist will be blocked."
444
  msgstr ""
445
 
446
+ #: admin/includes/tab-settings.php:138
447
  msgid ""
448
  "A request from which the country code or IP address is in the blacklist will "
449
  "be blocked."
450
  msgstr ""
451
 
452
+ #: admin/includes/tab-settings.php:184
453
+ msgid ""
454
+ "<dfn title=\"It enables utilizing &#8220;AS number&#8221; in the &#8220;"
455
+ "Whitelist/Blacklist of extra IP addresses&#8221; to specify a group of IP "
456
+ "networks.\">Use Autonomous System Number</dfn>"
457
+ msgstr ""
458
+
459
+ #: admin/includes/tab-settings.php:195
460
+ #, php-format
461
+ msgid ""
462
+ "Some useful tools for investigating ASN are introduced in &#8220;%s&#8221;."
463
+ msgstr ""
464
+
465
+ #: admin/includes/tab-settings.php:204
466
  msgid ""
467
  "<dfn title=\"e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, "
468
+ "&#8220;69.46.36.0/27&#8221; for WordFence server or &#8220;AS32934&#8221; "
469
+ "for Facebook.\">Whitelist of extra IP addresses prior to country code</dfn>"
470
  msgstr ""
471
 
472
+ #: admin/includes/tab-settings.php:224
473
  msgid ""
474
  "<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
475
  "\">Blacklist of extra IP addresses prior to country code</dfn>"
476
  msgstr ""
477
 
478
+ #: admin/includes/tab-settings.php:245
479
  msgid ""
480
  "<dfn title=\"If your server is placed behind the proxy server or the load "
481
  "balancing server, you need to put the appropriate key such as &#8220;"
484
  "addresses</dfn>"
485
  msgstr ""
486
 
487
+ #: admin/includes/tab-settings.php:264
488
  msgid ""
489
  "<dfn title=\"It validates malicious signatures independently of &#8220;Block "
490
  "by country&#8221; and &#8220;Prevent Zero-day Exploit&#8221; for the target "
495
  "restore.\"><span></span></a>)</nobr>"
496
  msgstr ""
497
 
498
+ #: admin/includes/tab-settings.php:278
499
  msgid ""
500
  "<dfn title=\"Select allowed MIME type.\">Whitelist of allowed MIME type</dfn>"
501
  msgstr ""
502
 
503
+ #: admin/includes/tab-settings.php:289
504
  msgid ""
505
  "<dfn title=\"Put forbidden file extensions.\">Blacklist of forbidden file "
506
  "extensions</dfn>"
507
  msgstr ""
508
 
509
+ #: admin/includes/tab-settings.php:293
510
+ msgid ""
511
+ "<dfn title=\"Specify the capabilities to be verified. Depending on the "
512
+ "particular type of uploader, certain capability may be required. Default is "
513
+ "&#8220;upload_files&#8221; for Administrator, Editor and Author. This "
514
+ "verification will be skipped if empty.\">Capabilities to be verified</dfn>"
515
+ msgstr ""
516
+
517
+ #: admin/includes/tab-settings.php:293
518
  msgid ""
519
+ "(&thinsp;See &#8220;<a rel=\"noreferrer\" href=\"https://codex.wordpress.org/"
520
+ "Roles_and_Capabilities\" title=\"Roles and Capabilities &laquo; WordPress "
521
+ "Codex\">Roles and Capabilities</a>&#8221;&thinsp;)"
 
 
522
  msgstr ""
523
 
524
+ #: admin/includes/tab-settings.php:300
525
+ msgid ""
526
+ "<dfn title=\"It restricts the file types on upload in order to block malware "
527
+ "and backdoor via both back-end and front-end. Please consider to select "
528
+ "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php) at &#8220;Validation "
529
+ "timing&#8221; so that other staff would not fetch the uploaded files before "
530
+ "this validation.\">Prevent malicious file uploading</dfn>"
531
+ msgstr ""
532
+
533
+ #: admin/includes/tab-settings.php:311 admin/includes/tab-settings.php:492
534
+ #: admin/includes/tab-settings.php:611 admin/includes/tab-settings.php:1186
535
  msgid "Disable"
536
  msgstr ""
537
 
538
+ #: admin/includes/tab-settings.php:312
539
+ msgid "Verify file extension and MIME type"
540
  msgstr ""
541
 
542
+ #: admin/includes/tab-settings.php:313
543
+ msgid "Verify file extension only"
544
  msgstr ""
545
 
546
+ #: admin/includes/tab-settings.php:323
547
  #, php-format
548
  msgid ""
549
  "<dfn title=\"You can put your original 403.php and so on into your theme "
550
  "directory.\">Response code</dfn> %s"
551
  msgstr ""
552
 
553
+ #: admin/includes/tab-settings.php:353 admin/includes/tab-settings.php:850
554
  msgid ""
555
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. If it is pointed "
556
  "to a public facing page, visitors would not be blocked on the page to "
559
  "\">Redirect URL</dfn>"
560
  msgstr ""
561
 
562
+ #: admin/includes/tab-settings.php:371 admin/includes/tab-settings.php:869
563
  msgid ""
564
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
565
  "message</dfn>"
566
  msgstr ""
567
 
568
+ #: admin/includes/tab-settings.php:388
569
  msgid ""
570
  "<dfn title=\"This is applied to &#8220;XML-RPC&#8221; and &#8220;Login "
571
  "form&#8221;. Lockout period is defined as expiration time at &#8220;Cache "
572
  "settings&#8221;.\">Max number of failed login attempts per IP address</dfn>"
573
  msgstr ""
574
 
575
+ #: admin/includes/tab-settings.php:416
576
  msgid "Select when to run the validation."
577
  msgstr ""
578
 
579
+ #: admin/includes/tab-settings.php:416
580
  msgid "Validation timing"
581
  msgstr ""
582
 
583
+ #: admin/includes/tab-settings.php:427
584
  msgid "&#8220;init&#8221; action hook"
585
  msgstr ""
586
 
587
+ #: admin/includes/tab-settings.php:428
588
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
589
  msgstr ""
590
 
591
+ #: admin/includes/tab-settings.php:431
592
  msgid ""
593
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
594
  "plugins."
595
  msgstr ""
596
 
597
+ #: admin/includes/tab-settings.php:432
598
  msgid ""
599
  "Validate at an earlier phase than other typical plugins. It can reduce load "
600
  "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
602
  "restrictions</a>."
603
  msgstr ""
604
 
605
+ #: admin/includes/tab-settings.php:442
606
  msgid "Back-end target settings"
607
  msgstr ""
608
 
609
+ #: admin/includes/tab-settings.php:448
610
  #, php-format
611
  msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
612
  msgstr ""
613
 
614
+ #: admin/includes/tab-settings.php:454
615
  msgid "Other areas"
616
  msgstr ""
617
 
618
+ #: admin/includes/tab-settings.php:473 admin/includes/tab-settings.php:493
619
+ #: admin/includes/tab-settings.php:526 admin/includes/tab-settings.php:532
620
+ #: admin/includes/tab-settings.php:751
621
  msgid "Block by country"
622
  msgstr ""
623
 
624
+ #: admin/includes/tab-settings.php:494
625
  msgid "Completely close"
626
  msgstr ""
627
 
628
+ #: admin/includes/tab-settings.php:527
629
  msgid ""
630
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
631
  "actions</dfn>"
632
  msgstr ""
633
 
634
+ #: admin/includes/tab-settings.php:533
635
  msgid "Prevent Zero-day Exploit"
636
  msgstr ""
637
 
638
+ #: admin/includes/tab-settings.php:537
639
  msgid ""
640
  "It will block a request related to the services for both public facing pages "
641
  "and the dashboard."
642
  msgstr ""
643
 
644
+ #: admin/includes/tab-settings.php:538
645
  msgid ""
646
  "Regardless of the country code, it will block a malicious request related to "
647
  "the services only for the dashboard."
648
  msgstr ""
649
 
650
+ #: admin/includes/tab-settings.php:564
651
+ msgid "admin post for logged-in user"
652
  msgstr ""
653
 
654
+ #: admin/includes/tab-settings.php:565
655
+ msgid "admin post for non logged-in user"
656
  msgstr ""
657
 
658
+ #: admin/includes/tab-settings.php:587
659
  msgid "Admin ajax/post"
660
  msgstr ""
661
 
662
+ #: admin/includes/tab-settings.php:600
663
  msgid ""
664
  "<dfn title=\"Specify the page name (&#8220;page=&hellip;&#8221;) or the "
665
  "action name (&#8220;action=&hellip;&#8221;) to prevent undesired blocking "
667
  "Prevent Zero-day Exploit&#8221; for logged-in user.\">Exceptions</dfn>"
668
  msgstr ""
669
 
670
+ #: admin/includes/tab-settings.php:600
671
+ msgid "Toggle with non logged-in user"
672
+ msgstr ""
673
+
674
+ #: admin/includes/tab-settings.php:605
675
  msgid "Candidate actions"
676
  msgstr ""
677
 
678
+ #: admin/includes/tab-settings.php:613
679
  #, php-format
680
  msgid ""
681
  "Regardless of the country code, it will block a malicious request to <code>"
682
  "%s&ctdot;/*.php</code>."
683
  msgstr ""
684
 
685
+ #: admin/includes/tab-settings.php:614
686
+ msgid ""
687
+ "<dfn title=\"Select the item which causes undesired blocking in order to "
688
+ "exclude from the validation target. Grayed item indicates &#8220;"
689
+ "INACTIVE&#8221;.\">Exceptions</dfn>"
690
+ msgstr ""
691
+
692
+ #: admin/includes/tab-settings.php:615
693
  #, php-format
694
  msgid ""
695
  "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
696
  "does not load WordPress core."
697
  msgstr ""
698
 
699
+ #: admin/includes/tab-settings.php:616
700
+ msgid "Sorry, but your server type is not supported."
 
 
 
701
  msgstr ""
702
 
703
+ #: admin/includes/tab-settings.php:653 admin/includes/tab-settings.php:703
704
  msgid "Force to load WP core"
705
  msgstr ""
706
 
707
+ #: admin/includes/tab-settings.php:658
708
  msgid "Plugins area"
709
  msgstr ""
710
 
711
+ #: admin/includes/tab-settings.php:708
712
  msgid "Themes area"
713
  msgstr ""
714
 
715
+ #: admin/includes/tab-settings.php:732
716
  msgid "Front-end target settings"
717
  msgstr ""
718
 
719
+ #: admin/includes/tab-settings.php:756
720
  msgid "Follow &#8220;Validation rule settings&#8221;"
721
  msgstr ""
722
 
723
+ #: admin/includes/tab-settings.php:818
724
  #, php-format
725
  msgid ""
726
  "<dfn title=\"You can configure a different response code from the Back-end. "
728
  "\">Response code</dfn> %s"
729
  msgstr ""
730
 
731
+ #: admin/includes/tab-settings.php:884
732
  msgid ""
733
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
734
  msgstr ""
735
 
736
+ #: admin/includes/tab-settings.php:896
737
  msgid ""
738
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
739
  "target.\">Post type</dfn>"
740
  msgstr ""
741
 
742
+ #: admin/includes/tab-settings.php:908
743
  msgid ""
744
  "<dfn title=\"Specify the individual category on a single page or archive "
745
  "page as a blocking target.\">Category</dfn>"
746
  msgstr ""
747
 
748
+ #: admin/includes/tab-settings.php:920
749
  msgid ""
750
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
751
  "a blocking target.\">Tag</dfn>"
752
  msgstr ""
753
 
754
+ #: admin/includes/tab-settings.php:935
755
  msgid "Specify the validation target on front-end."
756
  msgstr ""
757
 
758
+ #: admin/includes/tab-settings.php:935
759
  msgid "Validation target"
760
  msgstr ""
761
 
762
+ #: admin/includes/tab-settings.php:946
763
  msgid "All requests"
764
  msgstr ""
765
 
766
+ #: admin/includes/tab-settings.php:947
767
  msgid "Specify the targets"
768
  msgstr ""
769
 
770
+ #: admin/includes/tab-settings.php:950
771
  msgid ""
772
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
773
  "wp&#8221; action hook. It means that this feature would not be compatible "
774
  "with any page caching."
775
  msgstr ""
776
 
777
+ #: admin/includes/tab-settings.php:960
778
  msgid ""
779
  "A part of user agent string and a qualification connected with a separator "
780
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
784
  "qualification&#8221;."
785
  msgstr ""
786
 
787
+ #: admin/includes/tab-settings.php:960
788
  msgid "UA string and qualification"
789
  msgstr ""
790
 
791
+ #: admin/includes/tab-settings.php:979
792
  msgid "Specify the name of action that is invariably blocked."
793
  msgstr ""
794
 
795
+ #: admin/includes/tab-settings.php:979
796
  msgid "Excluded actions"
797
  msgstr ""
798
 
799
+ #: admin/includes/tab-settings.php:998
800
  msgid ""
801
  "It enables to verify the host by reverse DNS lookup which would spend some "
802
  "server resources. If it is disabled, &#8220;HOST&#8221; and &#8220;"
804
  "return &#8220;true&#8221;."
805
  msgstr ""
806
 
807
+ #: admin/includes/tab-settings.php:998
808
  msgid "DNS reverse lookup"
809
  msgstr ""
810
 
811
+ #: admin/includes/tab-settings.php:1015
812
  msgid ""
813
  "It enables to simulate validation without deployment. The results can be "
814
  "found at &#8220;Public facing pages&#8221; in Logs."
815
  msgstr ""
816
 
817
+ #: admin/includes/tab-settings.php:1015
818
  msgid "Simulation mode"
819
  msgstr ""
820
 
821
+ #: admin/includes/tab-settings.php:1033
822
  msgid "Geolocation API settings"
823
  msgstr ""
824
 
825
+ #: admin/includes/tab-settings.php:1042
826
  msgid ""
827
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
828
  "selection and key settings</dfn>"
829
  msgstr ""
830
 
831
+ #: admin/includes/tab-settings.php:1061
832
  msgid "Timeout for network API [sec]"
833
  msgstr ""
834
 
835
+ #: admin/includes/tab-settings.php:1082
836
  #, php-format
837
  msgid ""
838
  "Can not find geolocation API libraries in <code>%s</code>. It seems to have "
847
  "troubles? | IP Geo Block\">this instruction</a>."
848
  msgstr ""
849
 
850
+ #: admin/includes/tab-settings.php:1090
851
  msgid "Local database settings"
852
  msgstr ""
853
 
854
+ #: admin/includes/tab-settings.php:1104
855
  msgid "database"
856
  msgstr ""
857
 
858
+ #: admin/includes/tab-settings.php:1105
859
+ #: classes/class-ip-geo-block-cron.php:334
860
  #, php-format
861
  msgid "Last update: %s"
862
  msgstr ""
863
 
864
+ #: admin/includes/tab-settings.php:1114
865
  msgid "Auto updating (once a month)"
866
  msgstr ""
867
 
868
+ #: admin/includes/tab-settings.php:1131
869
  msgid "Download database"
870
  msgstr ""
871
 
872
+ #: admin/includes/tab-settings.php:1139
873
  msgid "Download now"
874
  msgstr ""
875
 
876
+ #: admin/includes/tab-settings.php:1150
877
  msgid "Record settings"
878
  msgstr ""
879
 
880
+ #: admin/includes/tab-settings.php:1159
881
  msgid "Record validation statistics"
882
  msgstr ""
883
 
884
+ #: admin/includes/tab-settings.php:1175
885
  msgid "Record validation logs"
886
  msgstr ""
887
 
888
+ #: admin/includes/tab-settings.php:1187
889
  msgid "Only when blocked"
890
  msgstr ""
891
 
892
+ #: admin/includes/tab-settings.php:1188
893
  msgid "Only when passed"
894
  msgstr ""
895
 
896
+ #: admin/includes/tab-settings.php:1189
897
  msgid "Unauthenticated user"
898
  msgstr ""
899
 
900
+ #: admin/includes/tab-settings.php:1190
901
  msgid "Authenticated user"
902
  msgstr ""
903
 
904
+ #: admin/includes/tab-settings.php:1191
905
  msgid "All of validation"
906
  msgstr ""
907
 
908
+ #: admin/includes/tab-settings.php:1200
909
  msgid "Recording period of the logs (days)"
910
  msgstr ""
911
 
912
+ #: admin/includes/tab-settings.php:1216
913
  msgid "Maximum length of logs for each target"
914
  msgstr ""
915
 
916
+ #: admin/includes/tab-settings.php:1233
917
  msgid ""
918
  "<dfn title=\"e.g. action, comment, log, pwd, FILES\">$_POST keys to be "
919
  "recorded with their values in logs</dfn>"
920
  msgstr ""
921
 
922
+ #: admin/includes/tab-settings.php:1251
923
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
924
  msgstr ""
925
 
926
+ #: admin/includes/tab-settings.php:1268
927
  msgid "IP address cache settings"
928
  msgstr ""
929
 
930
+ #: admin/includes/tab-settings.php:1277
931
  #, php-format
932
  msgid ""
933
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
935
  "\">Expiration time [sec]</dfn>"
936
  msgstr ""
937
 
938
+ #: admin/includes/tab-settings.php:1293
939
  msgid "Garbage collection period [sec]"
940
  msgstr ""
941
 
942
+ #: admin/includes/tab-settings.php:1310
943
  msgid "Number of entries to be displayed in cache"
944
  msgstr ""
945
 
946
+ #: admin/includes/tab-settings.php:1328
947
  msgid "Submission settings"
948
  msgstr ""
949
 
950
+ #: admin/includes/tab-settings.php:1340
951
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
952
  msgstr ""
953
 
954
+ #: admin/includes/tab-settings.php:1340
955
  msgid "Message on comment form"
956
  msgstr ""
957
 
958
+ #: admin/includes/tab-settings.php:1352
959
  msgid "None"
960
  msgstr ""
961
 
962
+ #: admin/includes/tab-settings.php:1353
963
  msgid "Top"
964
  msgstr ""
965
 
966
+ #: admin/includes/tab-settings.php:1354
967
  msgid "Bottom"
968
  msgstr ""
969
 
970
+ #: admin/includes/tab-settings.php:1365
971
  msgid "Plugin settings"
972
  msgstr ""
973
 
974
+ #: admin/includes/tab-settings.php:1378
975
+ msgid ""
976
+ "<dfn title=\"Synchronize all settings over the network wide.\">Network wide "
977
+ "settings</dfn>"
978
+ msgstr ""
979
+
980
+ #: admin/includes/tab-settings.php:1396
981
  msgid "Remove all settings at uninstallation"
982
  msgstr ""
983
 
984
+ #: admin/includes/tab-settings.php:1414
985
  msgid ""
986
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
987
  "dfn>"
988
  msgstr ""
989
 
990
+ #: admin/includes/tab-settings.php:1428
991
  msgid ""
992
  "You need to click the &#8220;Save Changes&#8221; button for imported "
993
  "settings to take effect."
994
  msgstr ""
995
 
996
+ #: admin/includes/tab-settings.php:1434
997
  msgid "Export / Import settings"
998
  msgstr ""
999
 
1000
+ #: admin/includes/tab-settings.php:1441
1001
  msgid "Export settings"
1002
  msgstr ""
1003
 
1004
+ #: admin/includes/tab-settings.php:1442
1005
  msgid "Import from the local file"
1006
  msgstr ""
1007
 
1008
+ #: admin/includes/tab-settings.php:1442
1009
  msgid "Import settings"
1010
  msgstr ""
1011
 
1012
+ #: admin/includes/tab-settings.php:1451
1013
  msgid "Import pre-defined settings"
1014
  msgstr ""
1015
 
1016
+ #: admin/includes/tab-settings.php:1458
1017
  msgid ""
1018
  "Import the default settings to revert to the &#8220;Right after "
1019
  "installing&#8221; state"
1020
  msgstr ""
1021
 
1022
+ #: admin/includes/tab-settings.php:1458
1023
  msgid "Default settings"
1024
  msgstr ""
1025
 
1026
+ #: admin/includes/tab-settings.php:1459
1027
  msgid ""
1028
  "Import the preferred settings mainly by enabling Zero-day Exploit Prevention "
1029
  "for the &#8220;Back-end target settings&#8221;"
1030
  msgstr ""
1031
 
1032
+ #: admin/includes/tab-settings.php:1459
1033
  msgid "Best for Back-end"
1034
  msgstr ""
1035
 
1036
+ #: admin/includes/tab-settings.php:1469
1037
  msgid "Delete DB table for validation logs"
1038
  msgstr ""
1039
 
1040
+ #: admin/includes/tab-settings.php:1477
1041
  msgid "Delete now"
1042
  msgstr ""
1043
 
1044
+ #: admin/includes/tab-settings.php:1485
1045
  msgid "Create DB table for validation logs"
1046
  msgstr ""
1047
 
1048
+ #: admin/includes/tab-settings.php:1493
1049
  msgid "Create now"
1050
  msgstr ""
1051
 
1052
+ #: admin/includes/tab-settings.php:1503
1053
  msgid ""
1054
  "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
1055
+ "forum.\">System information</dfn><br />[ <a rel=\"noreferrer\" href="
1056
  "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
1057
  "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
1058
  msgstr ""
1059
 
1060
+ #: admin/includes/tab-settings.php:1510
1061
  msgid "Show PHP, WordPress, theme and plugins information."
1062
  msgstr ""
1063
 
1064
+ #: admin/includes/tab-settings.php:1510
1065
  msgid "Show information"
1066
  msgstr ""
1067
 
1068
+ #: admin/includes/tab-settings.php:1526
1069
  msgid ""
1070
  "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
1071
  "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
1073
  "\">The best practice for target settings</a>&#8221;."
1074
  msgstr ""
1075
 
1076
+ #: admin/includes/tab-settings.php:1527
1077
  msgid ""
1078
  "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
1079
  "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
1082
  "\">Codex</a>."
1083
  msgstr ""
1084
 
1085
+ #: admin/includes/tab-settings.php:1534
1086
  msgid ""
1087
  "While Maxmind and IP2Location will fetch the local database, others will "
1088
  "pass an IP address to the APIs via HTTP."
1089
  msgstr ""
1090
 
1091
+ #: admin/includes/tab-settings.php:1535
1092
  msgid ""
1093
  "Please select the appropriate APIs to fit the privacy law in your country."
1094
  msgstr ""
1095
 
1096
+ #: admin/includes/tab-settings.php:1542
1097
  msgid ""
1098
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1099
  "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
1101
  "cache plugin."
1102
  msgstr ""
1103
 
1104
+ #: admin/includes/tab-settings.php:1543
1105
  msgid ""
1106
  "If you find any issues or have something to suggest, please feel free to "
1107
  "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
1109
  "\">support forum</a>."
1110
  msgstr ""
1111
 
1112
+ #: admin/includes/tab-settings.php:1550
1113
  msgid ""
1114
  "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1115
  "ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
1116
  "Block\">Record settings and logs</a>&#8221; for details."
1117
  msgstr ""
1118
 
1119
+ #: admin/includes/tab-statistics.php:21 admin/includes/tab-statistics.php:207
1120
  msgid "Statistics of validation"
1121
  msgstr ""
1122
 
1123
+ #: admin/includes/tab-statistics.php:30
1124
  msgid "Blocked"
1125
  msgstr ""
1126
 
1127
+ #: admin/includes/tab-statistics.php:55
1128
  msgid "Blocked by countries"
1129
  msgstr ""
1130
 
1131
+ #: admin/includes/tab-statistics.php:96
1132
  msgid "Blocked per day"
1133
  msgstr ""
1134
 
1135
+ #: admin/includes/tab-statistics.php:112
1136
  msgid "Blocked by type of IP address"
1137
  msgstr ""
1138
 
1139
+ #: admin/includes/tab-statistics.php:130
1140
  msgid "Name of API"
1141
  msgstr ""
1142
 
1143
+ #: admin/includes/tab-statistics.php:131
1144
  msgid "Calls"
1145
  msgstr ""
1146
 
1147
+ #: admin/includes/tab-statistics.php:132
1148
  msgid "Response [msec]"
1149
  msgstr ""
1150
 
1151
+ #: admin/includes/tab-statistics.php:146
1152
  msgid "Average response time of each API"
1153
  msgstr ""
1154
 
1155
+ #: admin/includes/tab-statistics.php:162
1156
  msgid "Clear statistics"
1157
  msgstr ""
1158
 
1159
+ #: admin/includes/tab-statistics.php:180
1160
+ msgid "Statistics in logs"
1161
+ msgstr ""
1162
+
1163
+ #: admin/includes/tab-statistics.php:232
1164
  msgid "Statistics in cache"
1165
  msgstr ""
1166
 
1167
+ #: admin/includes/tab-statistics.php:240
1168
  msgid "Country code / Access"
1169
  msgstr ""
1170
 
1171
+ #: admin/includes/tab-statistics.php:241
1172
  msgid "Elapsed [sec] / Calls"
1173
  msgstr ""
1174
 
1175
+ #: admin/includes/tab-statistics.php:274
1176
  msgid "IP address in cache"
1177
  msgstr ""
1178
 
1179
+ #: admin/includes/tab-statistics.php:289
1180
  msgid "Clear cache"
1181
  msgstr ""
1182
 
1183
+ #: admin/includes/tab-statistics.php:308
1184
  msgid ""
1185
  "Current setting of [<strong>Record validation statistics</strong>] on "
1186
  "[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
1187
  msgstr ""
1188
 
1189
+ #: admin/includes/tab-statistics.php:309
1190
  msgid ""
1191
  "Please set the proper condition to record and analyze the validation "
1192
  "statistics."
1193
  msgstr ""
1194
 
1195
+ #: admin/includes/tab-statistics.php:323
1196
+ msgid "Country (Top 10)"
1197
+ msgstr ""
1198
+
1199
+ #: admin/includes/tab-statistics.php:324
1200
+ msgid "AS number (Top 10)"
1201
+ msgstr ""
1202
+
1203
+ #: admin/includes/tab-statistics.php:325
1204
+ msgid "IP address (Top 10)"
1205
+ msgstr ""
1206
+
1207
+ #: admin/includes/tab-statistics.php:326
1208
+ msgid "Slug in back-end"
1209
+ msgstr ""
1210
+
1211
+ #: classes/class-ip-geo-block-apis.php:653
1212
  msgid ""
1213
  "You need to select at least one IP geolocation service. Otherwise "
1214
  "<strong>you'll be blocked</strong> after the cache expires."
1215
  msgstr ""
1216
 
1217
+ #: classes/class-ip-geo-block-cron.php:240
1218
  msgid "Your database file is up-to-date."
1219
  msgstr ""
1220
 
1221
+ #: classes/class-ip-geo-block-cron.php:278
 
 
 
 
 
 
 
1222
  #, php-format
1223
+ msgid "Can't lock <code>%s</code>. Please try again after a while."
1224
  msgstr ""
1225
 
1226
+ #: classes/class-ip-geo-block-cron.php:310
1227
  msgid "gz or zip is not supported on your system."
1228
  msgstr ""
1229
 
1245
  "details."
1246
  msgstr ""
1247
 
1248
+ #: classes/class-ip-geo-block-logs.php:165
1249
  #, php-format
1250
  msgid ""
1251
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1252
  "activate again."
1253
  msgstr ""
1254
 
1255
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:150
1256
+ #: wp-content/ip-geo-api/maxmind/class-maxmind.php:210
 
 
1257
  msgid "Database file does not exist."
1258
  msgstr ""
1259
 
samples.php CHANGED
@@ -374,7 +374,7 @@ function my_geolocation() {
374
  var_dump( $geolocation );
375
 
376
  if ( isset( $geolocation['errorMessage'] ) ) {
377
- echo 'error at getting geolocation'; // error handling
378
  }
379
  }
380
 
374
  var_dump( $geolocation );
375
 
376
  if ( isset( $geolocation['errorMessage'] ) ) {
377
+ echo 'error on getting geolocation'; // error handling
378
  }
379
  }
380
 
wp-content/ip-geo-api/drop-in-sample.php CHANGED
@@ -11,9 +11,7 @@
11
  * @see http://www.ipgeoblock.com/codex/#filter-hooks
12
  * @example Use `IP_Geo_Block::add_filter()` instead of `add_filter()`
13
  */
14
- if ( ! class_exists( 'IP_Geo_Block', FALSE ) ) {
15
- die;
16
- }
17
 
18
  /**
19
  * Enables some debug features on dashboard
11
  * @see http://www.ipgeoblock.com/codex/#filter-hooks
12
  * @example Use `IP_Geo_Block::add_filter()` instead of `add_filter()`
13
  */
14
+ class_exists( 'IP_Geo_Block', FALSE ) or die;
 
 
15
 
16
  /**
17
  * Enables some debug features on dashboard
wp-content/ip-geo-api/ip2location/class-ip2location.php CHANGED
@@ -2,13 +2,13 @@
2
  /**
3
  * IP Geo Block API class library for IP2Location
4
  *
5
- * @version 1.1.8
6
  * @author tokkonopapa <tokkonopapa@yahoo.com>
7
  * @license GPL-2.0+
8
  * @link http://www.ipgeoblock.com/
9
  * @copyright 2013-2017 tokkonopapa
10
  */
11
- if ( class_exists( 'IP_Geo_Block_API' ) ) :
12
 
13
  /**
14
  * URL and Path for IP2Location database
@@ -45,7 +45,7 @@ class IP_Geo_Block_API_IP2Location extends IP_Geo_Block_API {
45
  if ( ! extension_loaded('bcmath') )
46
  require_once( 'bcmath.php' );
47
 
48
- if ( ! class_exists( 'IP2Location' ) )
49
  require_once( 'IP2Location.php' );
50
 
51
  // setup database file and function
@@ -104,6 +104,7 @@ class IP_Geo_Block_API_IP2Location extends IP_Geo_Block_API {
104
  public function download( &$db, $args ) {
105
  $dir = $this->get_db_dir();
106
 
 
107
  if ( $dir !== dirname( $db['ipv4_path'] ) . '/' )
108
  $db['ipv4_path'] = $dir . IP_GEO_BLOCK_IP2LOC_IPV4_DAT;
109
 
@@ -117,6 +118,7 @@ class IP_Geo_Block_API_IP2Location extends IP_Geo_Block_API {
117
  $db['ipv4_last']
118
  );
119
 
 
120
  if ( $dir !== dirname( $db['ipv6_path'] ) . '/' )
121
  $db['ipv6_path'] = $dir . IP_GEO_BLOCK_IP2LOC_IPV6_DAT;
122
 
@@ -143,26 +145,24 @@ class IP_Geo_Block_API_IP2Location extends IP_Geo_Block_API {
143
  }
144
 
145
  public function add_settings_field( $field, $section, $option_slug, $option_name, $options, $callback, $str_path, $str_last ) {
 
146
  $dir = $this->get_db_dir();
 
147
 
148
- $path = apply_filters(
149
- IP_Geo_Block::PLUGIN_NAME . '-ip2location-path',
150
- empty( $options['IP2Location']['ipv4_path'] ) ?
151
- $dir . IP_GEO_BLOCK_IP2LOC_IPV4_DAT :
152
- $options['IP2Location']['ipv4_path']
153
- );
154
 
155
- $date = empty( $options['IP2Location']['ipv4_path'] ) ||
156
- ! @file_exists( $options['IP2Location']['ipv4_path'] ) ?
157
- __( 'Database file does not exist.', 'ip-geo-block' ) :
158
- sprintf(
159
- $str_last,
160
- IP_Geo_Block_Util::localdate( $options[ $field ]['ipv4_last'] )
161
- );
162
 
163
  add_settings_field(
164
  $option_name . $field . '_ipv4',
165
- "$field $str_path (<a rel='noreferrer' href='" . IP_GEO_BLOCK_IP2LOC_DOWNLOAD . "' title='" . IP_GEO_BLOCK_IP2LOC_IPV4_ZIP . "'>IPv4</a>)",
166
  $callback,
167
  $option_slug,
168
  $section,
@@ -177,21 +177,20 @@ class IP_Geo_Block_API_IP2Location extends IP_Geo_Block_API {
177
  )
178
  );
179
 
180
- $path = empty( $options['IP2Location']['ipv6_path'] ) ?
181
- $dir . IP_GEO_BLOCK_IP2LOC_IPV6_DAT :
182
- $options['IP2Location']['ipv6_path'];
 
 
183
 
184
- $date = empty( $options['IP2Location']['ipv6_path'] ) ||
185
- ! @file_exists( $options['IP2Location']['ipv6_path'] ) ?
186
- __( 'Database file does not exist.', 'ip-geo-block' ) :
187
- sprintf(
188
- $str_last,
189
- IP_Geo_Block_Util::localdate( $options[ $field ]['ipv6_last'] )
190
- );
191
 
192
  add_settings_field(
193
  $option_name . $field . '_ipv6',
194
- "$field $str_path (<a rel='noreferrer' href='" . IP_GEO_BLOCK_IP2LOC_DOWNLOAD . "' title='" . IP_GEO_BLOCK_IP2LOC_IPV6_ZIP . "'>IPv6</a>)",
195
  $callback,
196
  $option_slug,
197
  $section,
@@ -220,5 +219,4 @@ IP_Geo_Block_Provider::register_addon( array(
220
  ),
221
  ) );
222
 
223
- endif;
224
- ?>
2
  /**
3
  * IP Geo Block API class library for IP2Location
4
  *
5
+ * @version 1.1.9
6
  * @author tokkonopapa <tokkonopapa@yahoo.com>
7
  * @license GPL-2.0+
8
  * @link http://www.ipgeoblock.com/
9
  * @copyright 2013-2017 tokkonopapa
10
  */
11
+ if ( class_exists( 'IP_Geo_Block_API', FALSE ) ) :
12
 
13
  /**
14
  * URL and Path for IP2Location database
45
  if ( ! extension_loaded('bcmath') )
46
  require_once( 'bcmath.php' );
47
 
48
+ if ( ! class_exists( 'IP2Location', FALSE ) )
49
  require_once( 'IP2Location.php' );
50
 
51
  // setup database file and function
104
  public function download( &$db, $args ) {
105
  $dir = $this->get_db_dir();
106
 
107
+ // IPv4
108
  if ( $dir !== dirname( $db['ipv4_path'] ) . '/' )
109
  $db['ipv4_path'] = $dir . IP_GEO_BLOCK_IP2LOC_IPV4_DAT;
110
 
118
  $db['ipv4_last']
119
  );
120
 
121
+ // IPv6
122
  if ( $dir !== dirname( $db['ipv6_path'] ) . '/' )
123
  $db['ipv6_path'] = $dir . IP_GEO_BLOCK_IP2LOC_IPV6_DAT;
124
 
145
  }
146
 
147
  public function add_settings_field( $field, $section, $option_slug, $option_name, $options, $callback, $str_path, $str_last ) {
148
+ $db = $options[ $field ];
149
  $dir = $this->get_db_dir();
150
+ $msg = __( 'Database file does not exist.', 'ip-geo-block' );
151
 
152
+ // IPv4
153
+ if ( $db['ipv4_path'] )
154
+ $path = apply_filters( IP_Geo_Block::PLUGIN_NAME . '-ip2location-path', $db['ipv4_path'] );
155
+ else
156
+ $path = apply_filters( IP_Geo_Block::PLUGIN_NAME . '-ip2location-path', $dir . IP_GEO_BLOCK_IP2LOC_IPV4_DAT );
 
157
 
158
+ if ( @file_exists( $path ) )
159
+ $date = sprintf( $str_last, IP_Geo_Block_Util::localdate( $db['ipv4_last'] ) );
160
+ else
161
+ $date = $msg;
 
 
 
162
 
163
  add_settings_field(
164
  $option_name . $field . '_ipv4',
165
+ "$field $str_path<br />(<a rel='noreferrer' href='" . IP_GEO_BLOCK_IP2LOC_DOWNLOAD . "' title='" . IP_GEO_BLOCK_IP2LOC_IPV4_ZIP . "'>IPv4</a>)",
166
  $callback,
167
  $option_slug,
168
  $section,
177
  )
178
  );
179
 
180
+ // IPv6
181
+ if ( $db['ipv6_path'] )
182
+ $path = apply_filters( IP_Geo_Block::PLUGIN_NAME . '-ip2location-path', $db['ipv6_path'] );
183
+ else
184
+ $path = apply_filters( IP_Geo_Block::PLUGIN_NAME . '-ip2location-path', $dir . IP_GEO_BLOCK_IP2LOC_IPV6_DAT );
185
 
186
+ if ( @file_exists( $path ) )
187
+ $date = sprintf( $str_last, IP_Geo_Block_Util::localdate( $db['ipv6_last'] ) );
188
+ else
189
+ $date = $msg;
 
 
 
190
 
191
  add_settings_field(
192
  $option_name . $field . '_ipv6',
193
+ "$field $str_path<br />(<a rel='noreferrer' href='" . IP_GEO_BLOCK_IP2LOC_DOWNLOAD . "' title='" . IP_GEO_BLOCK_IP2LOC_IPV6_ZIP . "'>IPv6</a>)",
194
  $callback,
195
  $option_slug,
196
  $section,
219
  ),
220
  ) );
221
 
222
+ endif;
 
wp-content/ip-geo-api/maxmind/class-maxmind.php CHANGED
@@ -2,13 +2,13 @@
2
  /**
3
  * IP Geo Block API class library for Maxmind
4
  *
5
- * @version 1.1.8
6
  * @author tokkonopapa <tokkonopapa@yahoo.com>
7
  * @license GPL-2.0+
8
  * @link http://www.ipgeoblock.com/
9
  * @copyright 2013-2017 tokkonopapa
10
  */
11
- if ( class_exists( 'IP_Geo_Block_API' ) ) :
12
 
13
  /**
14
  * URL and Path for Maxmind GeoLite database
@@ -16,8 +16,14 @@ if ( class_exists( 'IP_Geo_Block_API' ) ) :
16
  */
17
  define( 'IP_GEO_BLOCK_MAXMIND_IPV4_DAT', 'GeoIP.dat' );
18
  define( 'IP_GEO_BLOCK_MAXMIND_IPV6_DAT', 'GeoIPv6.dat' );
 
 
 
19
  define( 'IP_GEO_BLOCK_MAXMIND_IPV4_ZIP', 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz' );
20
  define( 'IP_GEO_BLOCK_MAXMIND_IPV6_ZIP', 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz' );
 
 
 
21
  define( 'IP_GEO_BLOCK_MAXMIND_DOWNLOAD', 'http://dev.maxmind.com/geoip/legacy/geolite/' );
22
 
23
  /**
@@ -56,15 +62,15 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
56
 
57
  // setup database file and function
58
  if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
59
- $file = empty( $settings['Maxmind']['ipv4_path'] ) ?
60
- $this->get_db_dir() . IP_GEO_BLOCK_MAXMIND_IPV4_DAT :
61
- $settings['Maxmind']['ipv4_path'];
62
  }
63
 
64
  elseif ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
65
- $file = empty( $settings['Maxmind']['ipv6_path'] ) ?
66
- $this->get_db_dir() . IP_GEO_BLOCK_MAXMIND_IPV6_DAT :
67
- $settings['Maxmind']['ipv6_path'];
68
  }
69
 
70
  else {
@@ -85,13 +91,13 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
85
  break;
86
 
87
  case GEOIP_CITY_EDITION_REV1:
88
- if ( ! class_exists( 'geoiprecord' ) )
89
  require_once( 'geoipcity.inc' );
90
  $res = $this->location_city( geoip_record_by_addr( $geo, $ip ) );
91
  break;
92
 
93
  case GEOIP_CITY_EDITION_REV1_V6:
94
- if ( ! class_exists( 'geoiprecord' ) )
95
  require_once( 'geoipcity.inc' );
96
  $res = $this->location_city( geoip_record_by_addr_v6( $geo, $ip ) );
97
  break;
@@ -121,6 +127,7 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
121
  public function download( &$db, $args ) {
122
  $dir = $this->get_db_dir();
123
 
 
124
  if ( $dir !== dirname( $db['ipv4_path'] ) . '/' )
125
  $db['ipv4_path'] = $dir . IP_GEO_BLOCK_MAXMIND_IPV4_DAT;
126
 
@@ -134,6 +141,7 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
134
  $db['ipv4_last']
135
  );
136
 
 
137
  if ( $dir !== dirname( $db['ipv6_path'] ) . '/' )
138
  $db['ipv6_path'] = $dir . IP_GEO_BLOCK_MAXMIND_IPV6_DAT;
139
 
@@ -152,6 +160,43 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
152
  ! empty( $res['ipv4']['modified'] ) and $db['ipv4_last'] = $res['ipv4']['modified'];
153
  ! empty( $res['ipv6']['modified'] ) and $db['ipv6_last'] = $res['ipv6']['modified'];
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  return $res;
156
  }
157
 
@@ -160,23 +205,24 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
160
  }
161
 
162
  public function add_settings_field( $field, $section, $option_slug, $option_name, $options, $callback, $str_path, $str_last ) {
 
163
  $dir = $this->get_db_dir();
 
164
 
165
- $path = empty( $options['Maxmind']['ipv4_path'] ) ?
166
- $dir . IP_GEO_BLOCK_MAXMIND_IPV4_DAT :
167
- $options['Maxmind']['ipv4_path'];
 
 
168
 
169
- $date = empty( $options['Maxmind']['ipv4_path'] ) ||
170
- ! @file_exists( $options['Maxmind']['ipv4_path'] ) ?
171
- __( 'Database file does not exist.', 'ip-geo-block' ) :
172
- sprintf(
173
- $str_last,
174
- IP_Geo_Block_Util::localdate( $options[ $field ]['ipv4_last'] )
175
- );
176
 
177
  add_settings_field(
178
  $option_name . $field . '_ipv4',
179
- "$field $str_path (<a rel='noreferrer' href='" . IP_GEO_BLOCK_MAXMIND_DOWNLOAD . "' title='" . IP_GEO_BLOCK_MAXMIND_IPV4_ZIP . "'>IPv4</a>)",
180
  $callback,
181
  $option_slug,
182
  $section,
@@ -191,21 +237,20 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
191
  )
192
  );
193
 
194
- $path = empty( $options['Maxmind']['ipv4_path'] ) ?
195
- $dir . IP_GEO_BLOCK_MAXMIND_IPV4_DAT :
196
- $options['Maxmind']['ipv4_path'];
 
 
197
 
198
- $date = empty( $options['Maxmind']['ipv4_path'] ) ||
199
- ! @file_exists( $options['Maxmind']['ipv4_path'] ) ?
200
- __( 'Database file does not exist.', 'ip-geo-block' ) :
201
- sprintf(
202
- $str_last,
203
- IP_Geo_Block_Util::localdate( $options[ $field ]['ipv4_last'] )
204
- );
205
 
206
  add_settings_field(
207
  $option_name . $field . '_ipv6',
208
- "$field $str_path (<a rel='noreferrer' href='" . IP_GEO_BLOCK_MAXMIND_DOWNLOAD . "' title='" . IP_GEO_BLOCK_MAXMIND_IPV6_ZIP . "'>IPv6</a>)",
209
  $callback,
210
  $option_slug,
211
  $section,
@@ -219,6 +264,67 @@ class IP_Geo_Block_API_Maxmind extends IP_Geo_Block_API {
219
  'after' => '<br /><p id="ip-geo-block-' . $field . '-ipv6" style="margin-left: 0.2em">' . $date . '</p>',
220
  )
221
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  }
223
  }
224
 
@@ -234,5 +340,4 @@ IP_Geo_Block_Provider::register_addon( array(
234
  ),
235
  ) );
236
 
237
- endif;
238
- ?>
2
  /**
3
  * IP Geo Block API class library for Maxmind
4
  *
5
+ * @version 1.1.9
6
  * @author tokkonopapa <tokkonopapa@yahoo.com>
7
  * @license GPL-2.0+
8
  * @link http://www.ipgeoblock.com/
9
  * @copyright 2013-2017 tokkonopapa
10
  */
11
+ if ( class_exists( 'IP_Geo_Block_API', FALSE ) ) :
12
 
13
  /**
14
  * URL and Path for Maxmind GeoLite database
16
  */
17
  define( 'IP_GEO_BLOCK_MAXMIND_IPV4_DAT', 'GeoIP.dat' );
18
  define( 'IP_GEO_BLOCK_MAXMIND_IPV6_DAT', 'GeoIPv6.dat' );
19
+ define( 'IP_GEO_BLOCK_MAXMIND_ASN4_DAT', 'GeoIPASNum.dat' );
20
+ define( 'IP_GEO_BLOCK_MAXMIND_ASN6_DAT', 'GeoIPASNumv6.dat' );
21
+
22
  define( 'IP_GEO_BLOCK_MAXMIND_IPV4_ZIP', 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz' );
23
  define( 'IP_GEO_BLOCK_MAXMIND_IPV6_ZIP', 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz' );
24
+ define( 'IP_GEO_BLOCK_MAXMIND_ASN4_ZIP', 'http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz' );
25
+ define( 'IP_GEO_BLOCK_MAXMIND_ASN6_ZIP', 'http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz' );
26
+
27
  define( 'IP_GEO_BLOCK_MAXMIND_DOWNLOAD', 'http://dev.maxmind.com/geoip/legacy/geolite/' );
28
 
29
  /**
62
 
63
  // setup database file and function
64
  if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
65
+ $file = empty( $args['ASN'] ) ?
66
+ ( empty( $settings['Maxmind']['ipv4_path'] ) ? $this->get_db_dir() . IP_GEO_BLOCK_MAXMIND_IPV4_DAT : $settings['Maxmind']['ipv4_path'] ):
67
+ ( empty( $settings['Maxmind']['asn4_path'] ) ? $this->get_db_dir() . IP_GEO_BLOCK_MAXMIND_ASN4_DAT : $settings['Maxmind']['asn4_path'] );
68
  }
69
 
70
  elseif ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) ) {
71
+ $file = empty( $args['ASN'] ) ?
72
+ ( empty( $settings['Maxmind']['ipv6_path'] ) ? $this->get_db_dir() . IP_GEO_BLOCK_MAXMIND_IPV6_DAT : $settings['Maxmind']['ipv6_path'] ):
73
+ ( empty( $settings['Maxmind']['asn6_path'] ) ? $this->get_db_dir() . IP_GEO_BLOCK_MAXMIND_ASN6_DAT : $settings['Maxmind']['asn6_path'] );
74
  }
75
 
76
  else {
91
  break;
92
 
93
  case GEOIP_CITY_EDITION_REV1:
94
+ if ( ! class_exists( 'geoiprecord', FALSE ) )
95
  require_once( 'geoipcity.inc' );
96
  $res = $this->location_city( geoip_record_by_addr( $geo, $ip ) );
97
  break;
98
 
99
  case GEOIP_CITY_EDITION_REV1_V6:
100
+ if ( ! class_exists( 'geoiprecord', FALSE ) )
101
  require_once( 'geoipcity.inc' );
102
  $res = $this->location_city( geoip_record_by_addr_v6( $geo, $ip ) );
103
  break;
127
  public function download( &$db, $args ) {
128
  $dir = $this->get_db_dir();
129
 
130
+ // IPv4
131
  if ( $dir !== dirname( $db['ipv4_path'] ) . '/' )
132
  $db['ipv4_path'] = $dir . IP_GEO_BLOCK_MAXMIND_IPV4_DAT;
133
 
141
  $db['ipv4_last']
142
  );
143
 
144
+ // IPv6
145
  if ( $dir !== dirname( $db['ipv6_path'] ) . '/' )
146
  $db['ipv6_path'] = $dir . IP_GEO_BLOCK_MAXMIND_IPV6_DAT;
147
 
160
  ! empty( $res['ipv4']['modified'] ) and $db['ipv4_last'] = $res['ipv4']['modified'];
161
  ! empty( $res['ipv6']['modified'] ) and $db['ipv6_last'] = $res['ipv6']['modified'];
162
 
163
+ if ( $db['use_asn'] || ! empty( $db['asn4_path'] ) ) :
164
+
165
+ // ASN for IPv4
166
+ if ( $dir !== dirname( $db['asn4_path'] ) . '/' )
167
+ $db['asn4_path'] = $dir . IP_GEO_BLOCK_MAXMIND_ASN4_DAT;
168
+
169
+ $res['asn4'] = IP_Geo_Block_Util::download_zip(
170
+ apply_filters(
171
+ IP_Geo_Block::PLUGIN_NAME . '-maxmind-zip-asn4',
172
+ IP_GEO_BLOCK_MAXMIND_ASN4_ZIP
173
+ ),
174
+ $args,
175
+ $db['asn4_path'],
176
+ $db['asn4_last']
177
+ );
178
+
179
+ // ASN for IPv6
180
+ if ( $dir !== dirname( $db['asn6_path'] ) . '/' )
181
+ $db['asn6_path'] = $dir . IP_GEO_BLOCK_MAXMIND_ASN6_DAT;
182
+
183
+ $res['asn6'] = IP_Geo_Block_Util::download_zip(
184
+ apply_filters(
185
+ IP_Geo_Block::PLUGIN_NAME . '-maxmind-zip-asn6',
186
+ IP_GEO_BLOCK_MAXMIND_ASN6_ZIP
187
+ ),
188
+ $args,
189
+ $db['asn6_path'],
190
+ $db['asn6_last']
191
+ );
192
+
193
+ ! empty( $res['asn4']['filename'] ) and $db['asn4_path'] = $res['asn4']['filename'];
194
+ ! empty( $res['asn6']['filename'] ) and $db['asn6_path'] = $res['asn6']['filename'];
195
+ ! empty( $res['asn4']['modified'] ) and $db['asn4_last'] = $res['asn4']['modified'];
196
+ ! empty( $res['asn6']['modified'] ) and $db['asn6_last'] = $res['asn6']['modified'];
197
+
198
+ endif; // $db['use_asn'] || ! empty( $db['asn4_path'] )
199
+
200
  return $res;
201
  }
202
 
205
  }
206
 
207
  public function add_settings_field( $field, $section, $option_slug, $option_name, $options, $callback, $str_path, $str_last ) {
208
+ $db = $options[ $field ];
209
  $dir = $this->get_db_dir();
210
+ $msg = __( 'Database file does not exist.', 'ip-geo-block' );
211
 
212
+ // IPv4
213
+ if ( $db['ipv4_path'] )
214
+ $path = $db['ipv4_path'];
215
+ else
216
+ $path = $dir . IP_GEO_BLOCK_MAXMIND_IPV4_DAT;
217
 
218
+ if ( @file_exists( $path ) )
219
+ $date = sprintf( $str_last, IP_Geo_Block_Util::localdate( $db['ipv4_last'] ) );
220
+ else
221
+ $date = $msg;
 
 
 
222
 
223
  add_settings_field(
224
  $option_name . $field . '_ipv4',
225
+ "$field $str_path<br />(<a rel='noreferrer' href='" . IP_GEO_BLOCK_MAXMIND_DOWNLOAD . "' title='" . IP_GEO_BLOCK_MAXMIND_IPV4_ZIP . "'>IPv4</a>)",
226
  $callback,
227
  $option_slug,
228
  $section,
237
  )
238
  );
239
 
240
+ // IPv6
241
+ if ( $db['ipv6_path'] )
242
+ $path = $db['ipv6_path'];
243
+ else
244
+ $path = $dir . IP_GEO_BLOCK_MAXMIND_IPV6_DAT;
245
 
246
+ if ( @file_exists( $path ) )
247
+ $date = sprintf( $str_last, IP_Geo_Block_Util::localdate( $db['ipv6_last'] ) );
248
+ else
249
+ $date = $msg;
 
 
 
250
 
251
  add_settings_field(
252
  $option_name . $field . '_ipv6',
253
+ "$field $str_path<br />(<a rel='noreferrer' href='" . IP_GEO_BLOCK_MAXMIND_DOWNLOAD . "' title='" . IP_GEO_BLOCK_MAXMIND_IPV6_ZIP . "'>IPv6</a>)",
254
  $callback,
255
  $option_slug,
256
  $section,
264
  'after' => '<br /><p id="ip-geo-block-' . $field . '-ipv6" style="margin-left: 0.2em">' . $date . '</p>',
265
  )
266
  );
267
+
268
+ if ( $db['use_asn'] || ! empty( $db['asn4_path'] ) ) :
269
+
270
+ // ASN for IPv4
271
+ if ( $db['asn4_path'] )
272
+ $path = $db['asn4_path'];
273
+ else
274
+ $path = $dir . IP_GEO_BLOCK_MAXMIND_ASN4_DAT;
275
+
276
+ if ( @file_exists( $path ) )
277
+ $date = sprintf( $str_last, IP_Geo_Block_Util::localdate( $db['asn4_last'] ) );
278
+ else
279
+ $date = $msg;
280
+
281
+ add_settings_field(
282
+ $option_name . $field . '_asn4',
283
+ "$field $str_path<br />(<a rel='noreferrer' href='" . IP_GEO_BLOCK_MAXMIND_DOWNLOAD . "' title='" . IP_GEO_BLOCK_MAXMIND_ASN4_ZIP . "'>ASN for IPv4</a>)",
284
+ $callback,
285
+ $option_slug,
286
+ $section,
287
+ array(
288
+ 'type' => 'text',
289
+ 'option' => $option_name,
290
+ 'field' => $field,
291
+ 'sub-field' => 'asn4_path',
292
+ 'value' => $path,
293
+ 'disabled' => TRUE,
294
+ 'after' => '<br /><p id="ip-geo-block-' . $field . '-asn4" style="margin-left: 0.2em">' . $date . '</p>',
295
+ )
296
+ );
297
+
298
+ // ASN for IPv6
299
+ if ( $db['asn6_path'] )
300
+ $path = $db['asn6_path'];
301
+ else
302
+ $path = $dir . IP_GEO_BLOCK_MAXMIND_ASN6_DAT;
303
+
304
+ if ( @file_exists( $path ) )
305
+ $date = sprintf( $str_last, IP_Geo_Block_Util::localdate( $db['asn6_last'] ) );
306
+ else
307
+ $date = $msg;
308
+
309
+ add_settings_field(
310
+ $option_name . $field . '_asn6',
311
+ "$field $str_path<br />(<a rel='noreferrer' href='" . IP_GEO_BLOCK_MAXMIND_DOWNLOAD . "' title='" . IP_GEO_BLOCK_MAXMIND_ASN6_ZIP . "'>ASN for IPv6</a>)",
312
+ $callback,
313
+ $option_slug,
314
+ $section,
315
+ array(
316
+ 'type' => 'text',
317
+ 'option' => $option_name,
318
+ 'field' => $field,
319
+ 'sub-field' => 'asn6_path',
320
+ 'value' => $path,
321
+ 'disabled' => TRUE,
322
+ 'after' => '<br /><p id="ip-geo-block-' . $field . '-asn6" style="margin-left: 0.2em">' . $date . '</p>',
323
+ )
324
+ );
325
+
326
+ endif; // $db['use_asn'] || ! empty( $db['asn4_path'] )
327
+
328
  }
329
  }
330
 
340
  ),
341
  ) );
342
 
343
+ endif;