Version Description
- Improvement: Some minor refactoring for the future release.
-
Improvement: Better throughput against attacks on admin area when
"mu-plugins" (ip-geo-block-mu.php)
is enable. - Improvement: Avoid annoying error message related to private IP address.
- Bug fix: Fix the issue of excessive blocking by bad signature.
-
Bug fix: Fix the issue of illegal usage of
switch_to_blog()
. See this notes on codex. - Bug fix: Fix the issue of illegal JSON format on "Export settings".
Download this release
Release Info
Developer | tokkonopapa |
Plugin | IP Geo Block |
Version | 3.0.3.4 |
Comparing to | |
See all releases |
Code changes from version 3.0.2.2 to 3.0.3.4
- README.txt +122 -62
- admin/class-ip-geo-block-admin.php +288 -98
- admin/css/admin.css +173 -39
- admin/css/admin.min.css +1 -1
- admin/css/footable.core.min.css +1 -1
- admin/includes/class-admin-ajax.php +71 -37
- admin/includes/class-admin-rewrite.php +14 -12
- admin/includes/tab-accesslog.php +43 -33
- admin/includes/tab-attribution.php +5 -6
- admin/includes/tab-geolocation.php +8 -6
- admin/includes/tab-settings.php +231 -44
- admin/includes/tab-statistics.php +29 -27
- admin/js/admin.js +463 -339
- admin/js/admin.min.js +1 -1
- admin/js/authenticate.js +108 -80
- admin/js/authenticate.min.js +1 -1
- admin/js/whois.js +11 -11
- classes/class-ip-geo-block-actv.php +34 -16
- classes/class-ip-geo-block-apis.php +2 -2
- classes/class-ip-geo-block-cron.php +76 -98
- classes/class-ip-geo-block-file.php +268 -0
- classes/class-ip-geo-block-logs.php +77 -67
- classes/class-ip-geo-block-opts.php +126 -50
- classes/class-ip-geo-block-util.php +316 -33
- classes/class-ip-geo-block.php +186 -118
- database/index.php +0 -1
- index.php +0 -1
- ip-geo-block.php +6 -8
- languages/ip-geo-block-ja.mo +0 -0
- languages/ip-geo-block-ja.po +420 -290
- languages/ip-geo-block.mo +0 -0
- languages/ip-geo-block.po +356 -264
- languages/ip-geo-block.pot +356 -264
- rewrite.php +16 -15
- samples.php +2 -7
- uninstall.php +3 -7
- wp-content/ip-geo-api/drop-in-sample.php +1 -1
- wp-content/ip-geo-api/index.php +0 -1
- wp-content/mu-plugins/ip-geo-block-mu.php +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.
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -12,13 +12,11 @@ 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")
|
16 |
|
17 |
-
This plugin protects your site against such threats of attack
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
Up to version 2.x, this plugin had been dedicated to protect the back-end of your site. From version 3.x, it becomes to be able to block access to your public facing pages, aka front-end. See [this analysis](http://www.ipgeoblock.com/codex/analysis-of-attack-vectors.html "Analysis of Attack Vectors | IP Geo Block") about protection performance against 50 samples of vulnerable plugins.
|
22 |
|
23 |
= Features =
|
24 |
|
@@ -26,45 +24,46 @@ Up to version 2.x, this plugin had been dedicated to protect the back-end of you
|
|
26 |
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.
|
27 |
|
28 |
* **Zero-day Exploit Prevention:**
|
29 |
-
|
30 |
|
31 |
* **Guard against login attempts:**
|
32 |
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.
|
33 |
|
34 |
-
* **Protection of wp-config.php:**
|
35 |
-
A malicious request to try to expose `wp-config.php` via vulnerable plugins or themes can be blocked. A numerous such attacks can be found in [this article](http://www.ipgeoblock.com/article/exposure-of-wp-config-php.html "Prevent exposure of wp-config.php").
|
36 |
-
|
37 |
* **Minimize server load against brute-force attacks:**
|
38 |
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").
|
39 |
-
|
|
|
|
|
40 |
|
41 |
* **Support of BuddyPress and bbPress:**
|
42 |
-
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/ "
|
43 |
|
44 |
* **Referrer suppressor for external links:**
|
45 |
-
When you click an external hyperlink on admin
|
46 |
|
47 |
* **Multiple source of IP Geolocation databases:**
|
48 |
-
|
|
|
49 |
|
50 |
* **Customizing response:**
|
51 |
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.
|
52 |
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.
|
53 |
|
54 |
* **Validation logs:**
|
55 |
-
|
56 |
|
57 |
* **Cooperation with full spec security plugin:**
|
58 |
-
This plugin is simple and lite enough to be able to cooperate with other full spec security plugin such as [Wordfence Security](https://wordpress.org/plugins/wordfence/ "
|
59 |
|
60 |
* **Extendability:**
|
61 |
-
|
|
|
62 |
|
63 |
* **Self blocking prevention and easy rescue:**
|
64 |
-
|
65 |
|
66 |
* **Clean uninstallation:**
|
67 |
-
Nothing is left in your precious mySQL database after uninstallation. So you can feel free to install and activate to make a trial of this plugin's functionality.
|
68 |
|
69 |
= Attribution =
|
70 |
|
@@ -116,6 +115,9 @@ or following descriptions for your best setup.
|
|
116 |
* **Bad signatures in query**
|
117 |
It validates malicious signatures independently of **Block by country** and **Prevent Zero-day Exploit** for the target **Admin area**, **Admin ajax/post**, **Plugins area** and **Themes area**. Typically, `/wp-config.php` and `/passwd`.
|
118 |
|
|
|
|
|
|
|
119 |
* **Response code**
|
120 |
Choose one of the [response code](http://tools.ietf.org/html/rfc2616#section-10 "RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1") to be sent when it blocks a comment.
|
121 |
The 2xx code will lead to your top page, the 3xx code will redirect to [Black Hole Server](http://blackhole.webpagetest.org/), the 4xx code will lead to WordPress error page, and the 5xx will pretend an server error.
|
@@ -160,6 +162,9 @@ or following descriptions for your best setup.
|
|
160 |
* **UA string and qualification**
|
161 |
Additional rules targeted at SEO which can specify acceptable requests based on user agent.
|
162 |
|
|
|
|
|
|
|
163 |
* **Simulation mode**
|
164 |
You can simulate the 'blocking on front-end' functionality before deploying.
|
165 |
|
@@ -211,49 +216,40 @@ or following descriptions for your best setup.
|
|
211 |
|
212 |
It works on multisite, but there's no network setting at this moment.
|
213 |
|
214 |
-
=
|
215 |
|
216 |
-
|
217 |
|
218 |
-
|
219 |
-
* Invalidate blocking behavior in case yourself is locked out.
|
220 |
-
*
|
221 |
-
* How to use: Activate the following code and upload this file via FTP.
|
222 |
-
*/
|
223 |
-
/* -- ADD `/` TO THE TOP OR END OF THIS LINE TO ACTIVATE THE FOLLOWINGS -- */
|
224 |
-
function ip_geo_block_emergency( $validate ) {
|
225 |
-
$validate['result'] = 'passed';
|
226 |
-
return $validate;
|
227 |
-
}
|
228 |
-
add_filter( 'ip-geo-block-login', 'ip_geo_block_emergency' );
|
229 |
-
add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency' );
|
230 |
-
// */`
|
231 |
|
232 |
-
|
233 |
|
234 |
-
|
235 |
|
236 |
-
|
237 |
|
238 |
-
[
|
|
|
239 |
|
240 |
-
|
|
|
241 |
|
242 |
-
|
|
|
243 |
|
244 |
-
|
245 |
|
246 |
-
|
247 |
|
248 |
-
|
249 |
|
250 |
-
|
251 |
|
252 |
-
|
253 |
|
254 |
-
=
|
255 |
|
256 |
-
|
257 |
|
258 |
For more detail, please refer to "[I still have access from blacklisted country.](http://www.ipgeoblock.com/codex/access-from-blacklisted-country.html 'I still have access from blacklisted country. | IP Geo Block')".
|
259 |
|
@@ -267,24 +263,31 @@ You can add an IP address to the `X-Forwarded-For` header to emulate the access
|
|
267 |
|
268 |
See more details at "[How to test prevention of attacks](http://www.ipgeoblock.com/codex/#how-to-test-prevention-of-attacks 'Codex | IP Geo Block')".
|
269 |
|
270 |
-
=
|
271 |
-
|
272 |
-
For the back-end protection, the answer is YES if you disable caching on back-end. But for the front-end, the answer depends on the caching method you are employing.
|
273 |
|
274 |
-
|
275 |
|
276 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
|
279 |
-
|
280 |
-
Select "**Disk: Basic**" and enable "**Late initialization**" for page cache. "**Disk: Enhanced**" (where "**Late initialization**" is not available) in W3TC 0.9.5.1 seems to work good without any imcompatibility with this plugin.
|
281 |
|
282 |
-
|
283 |
-
This was formerly built in Wordfence. Select "**basic caching**" for Vendi Cache and **"mu-plugin" (ip-geo-block-mu.php)** for IP Geo Block.
|
284 |
|
285 |
-
|
286 |
|
287 |
-
|
288 |
|
289 |
= Do I have to turn on all the selection to enhance security? =
|
290 |
|
@@ -302,7 +305,7 @@ Yes. Roughly speaking, the strategy of this plugin has been constructed as follo
|
|
302 |
- **Bad signatures in query**
|
303 |
It blocks the request which has not been covered in the above three.
|
304 |
|
305 |
-
Please try "**Best
|
306 |
|
307 |
= Does this plugin validate all the requests? =
|
308 |
|
@@ -310,12 +313,26 @@ Unfortunately, no. This plugin can't handle the requests that are not parsed by
|
|
310 |
|
311 |
But there're exceptions: When you enable "**Force to load WP core**" for **Plugins area** or **Themes area**, a standalone PHP file becomes to be able to be blocked. Sometimes this kind of file has some vulnerabilities. This function protects your site against such a case.
|
312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
== Other Notes ==
|
314 |
|
315 |
= Known issues =
|
316 |
|
317 |
* No image is shown after drag & drop a image in grid view at "Media Library". For more details, please refer to [this ticket at Github](https://github.com/tokkonopapa/WordPress-IP-Geo-Block/issues/2 "No image is shown after drag & drop a image in grid view at "Media Library". - Issue #2 - tokkonopapa/WordPress-IP-Geo-Block - GitHub").
|
318 |
-
* From [WordPress 4.5](https://make.wordpress.org/core/2016/03/09/comment-changes-in-wordpress-4-5/ "Comment Changes in WordPress 4.5 – Make WordPress Core"), `rel=nofollow`
|
319 |
|
320 |
== Screenshots ==
|
321 |
|
@@ -332,6 +349,49 @@ But there're exceptions: When you enable "**Force to load WP core**" for **Plugi
|
|
332 |
|
333 |
== Changelog ==
|
334 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
= 3.0.2.2 =
|
336 |
* **Improvement:** Change the behavior of "Referrer Suppressor" not to open a new window on public facing pages.
|
337 |
* **Improvement:** Improve some of the descriptions of help text.
|
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 |
|
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 |
|
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.
|
54 |
|
55 |
* **Cooperation with full spec security plugin:**
|
56 |
+
This plugin is simple and lite enough to be able to cooperate with other full spec security plugin such as [Wordfence Security](https://wordpress.org/plugins/wordfence/ "Wordfence Security — WordPress Plugins"). See [this report](http://www.ipgeoblock.com/codex/page-speed-performance.html "Page speed performance | IP Geo Block") about page speed performance.
|
57 |
|
58 |
* **Extendability:**
|
59 |
+
You can customize the behavior of this plugin via `add_filter()` with [pre-defined filter hook](http://www.ipgeoblock.com/codex/ "Codex | IP Geo Block"). See various use cases in [samples.php](https://github.com/tokkonopapa/WordPress-IP-Geo-Block/blob/master/ip-geo-block/samples.php "WordPress-IP-Geo-Block/samples.php at master - tokkonopapa/WordPress-IP-Geo-Block - GitHub") bundled within this package.
|
60 |
+
You can also get the extension [IP Geo Allow](https://github.com/ddur/WordPress-IP-Geo-Allow "GitHub - ddur/WordPress-IP-Geo-Allow: WordPress Plugin Exension for WordPress-IP-Geo-Block Plugin") by [Dragan](https://github.com/ddur "ddur (Dragan) - GitHub"). It makes admin screens strictly private with more flexible way than specifying IP addresses.
|
61 |
|
62 |
* **Self blocking prevention and easy rescue:**
|
63 |
+
Website owners do not prefer themselves to be blocked. This plugin prevents such a sad thing unless you force it. And futhermore, if such a situation occurs, you can [rescue yourself](http://www.ipgeoblock.com/codex/what-should-i-do-when-i-m-locked-out.html "What should I do when I'm locked out? | IP Geo Block") easily.
|
64 |
|
65 |
* **Clean uninstallation:**
|
66 |
+
Nothing is left in your precious mySQL database after uninstallation. So you can feel free to install and activate to make a trial of this plugin's functionality.
|
67 |
|
68 |
= Attribution =
|
69 |
|
115 |
* **Bad signatures in query**
|
116 |
It validates malicious signatures independently of **Block by country** and **Prevent Zero-day Exploit** for the target **Admin area**, **Admin ajax/post**, **Plugins area** and **Themes area**. Typically, `/wp-config.php` and `/passwd`.
|
117 |
|
118 |
+
* **Prevent malicious file uploading**
|
119 |
+
It restricts the file types on upload to block malware and backdoor via both back-end and front-end.
|
120 |
+
|
121 |
* **Response code**
|
122 |
Choose one of the [response code](http://tools.ietf.org/html/rfc2616#section-10 "RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1") to be sent when it blocks a comment.
|
123 |
The 2xx code will lead to your top page, the 3xx code will redirect to [Black Hole Server](http://blackhole.webpagetest.org/), the 4xx code will lead to WordPress error page, and the 5xx will pretend an server error.
|
162 |
* **UA string and qualification**
|
163 |
Additional rules targeted at SEO which can specify acceptable requests based on user agent.
|
164 |
|
165 |
+
* **DNS reverse lookup**
|
166 |
+
It enables to verify the host by reverse DNS lookup which would spend some server resources.
|
167 |
+
|
168 |
* **Simulation mode**
|
169 |
You can simulate the 'blocking on front-end' functionality before deploying.
|
170 |
|
216 |
|
217 |
It works on multisite, but there's no network setting at this moment.
|
218 |
|
219 |
+
= Does this plugin works well with caching? =
|
220 |
|
221 |
+
The short answer is **YES**, especially for the purpose of security e.g. blocking malicious access both on the back-end and on the front-end.
|
222 |
|
223 |
+
The long answer is as follows:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
|
225 |
+
For the back-end protection, both blocking malicious access and blocking by country works fine, if you disable caching on the back-end. As for the front-end, there are 2 scenarios.
|
226 |
|
227 |
+
The first one is the case that there's no cached page against a request to the specific page. In this scenario, this plugin responds a specific HTTP status code (including redirection) and defines the symbol `DONOTCACHEPAGE` when the request comes from blacklisted countries (or IPs). When the request comes from the whitelisted countries (or IPs), this plugin passes it to the caching plugin in order to generate a new cache.
|
228 |
|
229 |
+
The second scenario is the case that there's a cached page. In this case, the response depends on the caching method you are employing. Currently, the following plugins and configurations can be supported if you want to [restrict content by geo-blocking](https://en.wikipedia.org/wiki/Geo-blocking "Geo-blocking - Wikipedia"):
|
230 |
|
231 |
+
- [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/ "WP Super Cache — WordPress Plugins")
|
232 |
+
Select "**Use PHP to serve cache files**" and enable "**Late init**".
|
233 |
|
234 |
+
- [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/ "W3 Total Cache — WordPress Plugins")
|
235 |
+
Select "**Disk: Basic**" and enable "**Late initialization**" for page cache. "**Disk: Enhanced**" (where "**Late initialization**" is not available) in W3TC 0.9.5.1 seems to work good without any imcompatibility with this plugin.
|
236 |
|
237 |
+
- [Vendi Cache](https://wordpress.org/plugins/vendi-cache/ "Vendi Cache — WordPress Plugins")
|
238 |
+
This plugin was formerly built in Wordfence. Select "**basic caching**" for Vendi Cache and **"mu-plugin" (ip-geo-block-mu.php)** for IP Geo Block.
|
239 |
|
240 |
+
Other plugins adopting `mod_rewrite` (e.g. WP Fastest Cache) or `advanced-cache.php` [drop-in](https://make.wordpress.org/core/2016/08/13/global-overloading-in-advanced-cache-php/ "Global overloading in advanced-cache.php – Make WordPress Core") (e.g. Comet Cache) or other caching method at server side might serve a normal page.
|
241 |
|
242 |
+
Thus your site would have less risk against the exploiting via vulnerable plugins and themes.
|
243 |
|
244 |
+
For more details, please refer to some documents at "[Blocking on front-end](http://www.ipgeoblock.com/codex/#blocking-on-front-end 'Codex | IP Geo Block')".
|
245 |
|
246 |
+
= I still have access from blacklisted country. Does it work correctly? =
|
247 |
|
248 |
+
Absolutely, YES.
|
249 |
|
250 |
+
Sometimes, a Wordfence Security user would report this type of claim when he/she found some accesses in its Live traffic view. But please don't worry. Before WordPress runs, Wordfence cleverly filters out malicious requests to your site using <a href="http://php.net/manual/en/ini.core.php#ini.auto-prepend-file" title="PHP: Description of core php.ini directives - Manual">auto_prepend_file</a> directive to include PHP based Web Application Firewall. Then this plugin validates the rest of the requests that pass over Wordfence because those were not in WAF rules, especially you enables "**Prevent Zero-day Exploit**".
|
251 |
|
252 |
+
It would also possibly be caused by the accuracy of country code in the geolocation databases. Actually, there is a case that a same IP address has different country code.
|
253 |
|
254 |
For more detail, please refer to "[I still have access from blacklisted country.](http://www.ipgeoblock.com/codex/access-from-blacklisted-country.html 'I still have access from blacklisted country. | IP Geo Block')".
|
255 |
|
263 |
|
264 |
See more details at "[How to test prevention of attacks](http://www.ipgeoblock.com/codex/#how-to-test-prevention-of-attacks 'Codex | IP Geo Block')".
|
265 |
|
266 |
+
= I was locked down. What shall I do? =
|
|
|
|
|
267 |
|
268 |
+
You can find the "**Emergent Functionality**" code section near the bottom of `ip-geo-block.php`. This code block can be activated by replacing `/*` (opening multi-line comment) at the top of the line to `//` (single line comment), or `*` at the end of the line to `*/` (closing multi-line comment).
|
269 |
|
270 |
+
`/**
|
271 |
+
* Invalidate blocking behavior in case yourself is locked out.
|
272 |
+
*
|
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 |
|
288 |
+
Remember that you should upload the original one after re-configuration to deactivate this feature.
|
289 |
|
290 |
+
[This document](http://www.ipgeoblock.com/codex/what-should-i-do-when-i-m-locked-out.html "What should I do when I'm locked out? | IP Geo Block") can also help you.
|
291 |
|
292 |
= Do I have to turn on all the selection to enhance security? =
|
293 |
|
305 |
- **Bad signatures in query**
|
306 |
It blocks the request which has not been covered in the above three.
|
307 |
|
308 |
+
Please try "**Best for Back-end**" button at the bottom of this plugin's setting page for easy setup. And also see more details in "[The best practice of target settings](http://www.ipgeoblock.com/codex/the-best-practice-for-target-settings.html 'The best practice of target settings | IP Geo Block')".
|
309 |
|
310 |
= Does this plugin validate all the requests? =
|
311 |
|
313 |
|
314 |
But there're exceptions: When you enable "**Force to load WP core**" for **Plugins area** or **Themes area**, a standalone PHP file becomes to be able to be blocked. Sometimes this kind of file has some vulnerabilities. This function protects your site against such a case.
|
315 |
|
316 |
+
= How to resolve "Sorry, your request cannot be accepted."? =
|
317 |
+
|
318 |
+
If you encounter this message, please refer to [this document](http://www.ipgeoblock.com/codex/you-are-not-allowed-to-access.html "Why “Sorry, your request cannot be accepted” ? | IP Geo Block") to resolve your blocking issue.
|
319 |
+
|
320 |
+
If you can't solve your issue, please let me know about it on the [support forum](https://wordpress.org/support/plugin/ip-geo-block/ "View: Plugin Support « WordPress.org Forums"). Your logs in this plugin and "**Installation information**" at "**Plugin settings**" will be a great help to resolve the issue.
|
321 |
+
|
322 |
+
= How can I fix "Unable to write" error? =
|
323 |
+
|
324 |
+
When you enable "**Force to load WP core**" options, this plugin will try to configure `.htaccess` in your `/wp-content/plugins/` and `/wp-content/themes/` directory in order to protect your site against the malicous attacks to the [OMG plugins and themes](http://www.ipgeoblock.com/article/exposure-of-wp-config-php.html "Prevent exposure of wp-config.php | IP Geo Block").
|
325 |
+
|
326 |
+
But some servers doesn't give read / write permission against `.htaccess` to WordPress. In this case, you can configure `.htaccess` files by your own hand instead of enabling "**Force to load WP core**" options.
|
327 |
+
|
328 |
+
Please refer to "[How can I fix permission troubles?](http://www.ipgeoblock.com/codex/how-can-i-fix-permission-troubles.html 'How can I fix permission troubles? | IP Geo Block')" in order to fix this error.
|
329 |
+
|
330 |
== Other Notes ==
|
331 |
|
332 |
= Known issues =
|
333 |
|
334 |
* No image is shown after drag & drop a image in grid view at "Media Library". For more details, please refer to [this ticket at Github](https://github.com/tokkonopapa/WordPress-IP-Geo-Block/issues/2 "No image is shown after drag & drop a image in grid view at "Media Library". - Issue #2 - tokkonopapa/WordPress-IP-Geo-Block - GitHub").
|
335 |
+
* From [WordPress 4.5](https://make.wordpress.org/core/2016/03/09/comment-changes-in-wordpress-4-5/ "Comment Changes in WordPress 4.5 – Make WordPress Core"), `rel=nofollow` had no longer be attached to the links in `comment_content`. This change prevents to block "[Server Side Request Forgeries](https://www.owasp.org/index.php/Server_Side_Request_Forgery 'Server Side Request Forgery - OWASP')" (not Cross Site but a malicious internal link in the comment field).
|
336 |
|
337 |
== Screenshots ==
|
338 |
|
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.
|
355 |
+
* **Improvement:** Avoid annoying error message related to private IP address.
|
356 |
+
* **Bug fix:** Fix the issue of excessive blocking by bad signature.
|
357 |
+
* **Bug fix:** Fix the issue of illegal usage of `switch_to_blog()`. See [this notes on codex](https://codex.wordpress.org/Function_Reference/restore_current_blog#Notes "Function Reference/restore current blog « WordPress Codex").
|
358 |
+
* **Bug fix:** Fix the issue of illegal JSON format on "Export settings".
|
359 |
+
|
360 |
+
= 3.0.3.3 =
|
361 |
+
Thank you for your patience and understanding in frequent update.
|
362 |
+
|
363 |
+
* **Bug fix:** Fixed the issue of "Notice: Undefined variable" in WP cron. This bug caused frequent refreshing of IP address cache.
|
364 |
+
* **Bug fix:** Fixed the issue of "Fatal Error" in validating user authentication.
|
365 |
+
|
366 |
+
= 3.0.3.2 =
|
367 |
+
* **Bug fix:** Fixed the issue where nonce for WP-ZEP didn't match on front-end.
|
368 |
+
* **Bug fix:** Fixed the issue which deleted all expired cache on multisite.
|
369 |
+
|
370 |
+
= 3.0.3.1 =
|
371 |
+
This is a maintenance release addressing various internal improvement.
|
372 |
+
|
373 |
+
* **Bug fix:** Fixed an issue where deletion of the expired cache was not executed in subordinate blogs when this plugin was activated on the network wide.
|
374 |
+
* **Bug fix:** Some issues caused by IE10/11 on admin pages had been fixed.
|
375 |
+
* **Bug fix:** Turning off check boxes in "**API selection and key settings**" section now becomes to work.
|
376 |
+
* **Improvement:** Better validation performance for logged in user authentication.
|
377 |
+
* **Improvement:** Better rendering by CSS and JS for sections.
|
378 |
+
* **Improvement:** Better handling of click event for embedding a nonce.
|
379 |
+
* **Improvement:** Better handling of cookie for sections.
|
380 |
+
* **Improvement:** Better handling of server and private IP address.
|
381 |
+
* **Improvement:** Better compatibility with file operations using Filesystem API. FTP or SSH based operations are now supported only when [some symbols are defined in `wp-config.php`](https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants "Editing wp-config.php « WordPress Codex").
|
382 |
+
* **Improvement:** Better timing of upgrade check at activation phase instead of `init` action hook.
|
383 |
+
|
384 |
+
= 3.0.3 =
|
385 |
+
* **New feature:** New option "Prevent malicious upload" to restrict MIME types.
|
386 |
+
* **New feature:** New option "Response code" and "Response message" for front-end. This is useful not to violate your affiliate program.
|
387 |
+
* **Improvement:** New Option "DNS reverse lookup" to enable/disable.
|
388 |
+
* **Improvement:** Stop rendering by javascript on setting pages to reduce flash of unstyled content.
|
389 |
+
* **Improvement:** Better compatibility of WP-ZEP with some plugins (Wordfence, Imagify) that request ajax from server side.
|
390 |
+
* **Improvement:** Better handling of server and private IP address.
|
391 |
+
* **Bug fix:** Fix the bug of "Export/Import settings". **Please export json file again if you hold it as backup purpose** because some of settings data might be incompatible.
|
392 |
+
* **Bug fix:** Fix the bug of "Password Reset" caused by miss-spelling "resetpasss".
|
393 |
+
* See some details at [release 3.0.3](http://www.ipgeoblock.com/changelog/release-3.0.3.html "3.0.3 Release Note | IP Geo Block").
|
394 |
+
|
395 |
= 3.0.2.2 =
|
396 |
* **Improvement:** Change the behavior of "Referrer Suppressor" not to open a new window on public facing pages.
|
397 |
* **Improvement:** Improve some of the descriptions of help text.
|
admin/class-ip-geo-block-admin.php
CHANGED
@@ -12,15 +12,10 @@
|
|
12 |
class IP_Geo_Block_Admin {
|
13 |
|
14 |
/**
|
15 |
-
*
|
16 |
-
*
|
17 |
-
*/
|
18 |
-
protected static $instance = null;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Tab of the admin page.
|
22 |
*
|
23 |
*/
|
|
|
24 |
private $admin_tab = 0;
|
25 |
|
26 |
/**
|
@@ -28,22 +23,11 @@ class IP_Geo_Block_Admin {
|
|
28 |
* and adding a settings page and menu.
|
29 |
*/
|
30 |
private function __construct() {
|
31 |
-
// Load plugin text domain
|
32 |
-
add_action( 'init', array( $this, '
|
33 |
|
34 |
// Setup a nonce to validate authentication.
|
35 |
-
add_filter( 'wp_redirect', array( $this, '
|
36 |
-
|
37 |
-
// Add the options page and menu item.
|
38 |
-
add_action( 'admin_menu', array( $this, 'setup_admin_page' ) );
|
39 |
-
add_action( 'wp_ajax_ip_geo_block', array( $this, 'admin_ajax_callback' ) );
|
40 |
-
add_action( 'admin_post_ip_geo_block', array( $this, 'admin_ajax_callback' ) );
|
41 |
-
add_filter( 'wp_prepare_revision_for_js', array( $this, 'add_revision_nonce' ), 10, 3 );
|
42 |
-
|
43 |
-
// If multisite, then enque the authentication script for network admin
|
44 |
-
if ( is_multisite() ) {
|
45 |
-
add_action( 'network_admin_menu', 'IP_Geo_Block::enqueue_nonce' );
|
46 |
-
}
|
47 |
}
|
48 |
|
49 |
/**
|
@@ -55,21 +39,103 @@ class IP_Geo_Block_Admin {
|
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
-
* Load the plugin text domain for translation.
|
59 |
*
|
60 |
*/
|
61 |
-
public function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
load_plugin_textdomain( IP_Geo_Block::PLUGIN_NAME, FALSE, dirname( IP_GEO_BLOCK_BASE ) . '/languages/' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
* Add nonce when redirect into wp-admin area.
|
67 |
*
|
68 |
*/
|
69 |
-
public function
|
70 |
return IP_Geo_Block_Util::rebuild_nonce( $location, $status );
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
/**
|
74 |
* Get the action name of ajax for nonce
|
75 |
*
|
@@ -83,7 +149,7 @@ class IP_Geo_Block_Admin {
|
|
83 |
*
|
84 |
*/
|
85 |
public function enqueue_admin_assets() {
|
86 |
-
$footer =
|
87 |
$dependency = array( 'jquery' );
|
88 |
|
89 |
// css for option page
|
@@ -137,6 +203,7 @@ class IP_Geo_Block_Admin {
|
|
137 |
plugins_url( 'js/footable.min.js', __FILE__ ),
|
138 |
$dependency, IP_Geo_Block::VERSION, $footer
|
139 |
);
|
|
|
140 |
}
|
141 |
|
142 |
// js for IP Geo Block admin page
|
@@ -170,20 +237,6 @@ class IP_Geo_Block_Admin {
|
|
170 |
wp_enqueue_script( $handle );
|
171 |
}
|
172 |
|
173 |
-
/**
|
174 |
-
* Add nonce to revision @since 4.4.0
|
175 |
-
*
|
176 |
-
*/
|
177 |
-
public function add_revision_nonce( $revisions_data, $revision, $post ) {
|
178 |
-
$revisions_data['restoreUrl'] = add_query_arg(
|
179 |
-
$nonce = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce',
|
180 |
-
IP_Geo_Block_Util::create_nonce( $nonce ),
|
181 |
-
$revisions_data['restoreUrl']
|
182 |
-
);
|
183 |
-
|
184 |
-
return $revisions_data;
|
185 |
-
}
|
186 |
-
|
187 |
/**
|
188 |
* Add plugin meta links
|
189 |
*
|
@@ -256,7 +309,7 @@ class IP_Geo_Block_Admin {
|
|
256 |
*
|
257 |
*/
|
258 |
private function add_plugin_admin_menu() {
|
259 |
-
// Setup the tab number
|
260 |
$this->admin_tab = isset( $_GET['tab'] ) ? (int)$_GET['tab'] : 0;
|
261 |
$this->admin_tab = min( 4, max( 0, $this->admin_tab ) );
|
262 |
|
@@ -270,7 +323,7 @@ class IP_Geo_Block_Admin {
|
|
270 |
);
|
271 |
|
272 |
// If successful, load admin assets only on this page.
|
273 |
-
if ( $hook )
|
274 |
add_action( "load-$hook", array( $this, 'enqueue_admin_assets' ) );
|
275 |
}
|
276 |
|
@@ -279,13 +332,13 @@ class IP_Geo_Block_Admin {
|
|
279 |
*
|
280 |
*/
|
281 |
private function diagnose_admin_screen() {
|
|
|
|
|
|
|
282 |
// Check version and compatibility
|
283 |
if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
|
284 |
self::add_admin_notice( 'error', __( 'You need WordPress 3.7+.', 'ip-geo-block' ) );
|
285 |
|
286 |
-
$settings = IP_Geo_Block::get_option();
|
287 |
-
$adminurl = 'options-general.php';
|
288 |
-
|
289 |
// Check consistency of matching rule
|
290 |
if ( -1 === (int)$settings['matching_rule'] ) {
|
291 |
if ( FALSE !== get_transient( IP_Geo_Block::CRON_NAME ) ) {
|
@@ -333,17 +386,25 @@ class IP_Geo_Block_Admin {
|
|
333 |
) . ' ' .
|
334 |
sprintf(
|
335 |
__( 'Please check your <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
|
336 |
-
esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-
|
337 |
)
|
338 |
);
|
|
|
339 |
}
|
340 |
}
|
341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ) {
|
343 |
// Check creation of database table
|
344 |
if ( $settings['validation']['reclogs'] ) {
|
345 |
if ( ( $warn = IP_Geo_Block_Logs::diag_tables() ) &&
|
346 |
-
FALSE === IP_Geo_Block_Logs::create_tables() ) {
|
347 |
self::add_admin_notice( 'notice-warning', $warn );
|
348 |
}
|
349 |
}
|
@@ -355,11 +416,12 @@ class IP_Geo_Block_Admin {
|
|
355 |
*
|
356 |
*/
|
357 |
public function setup_admin_page() {
|
|
|
|
|
|
|
358 |
// Avoid multiple validation.
|
359 |
-
if ( 'POST' !== $_SERVER['REQUEST_METHOD'] )
|
360 |
$this->diagnose_admin_screen();
|
361 |
-
$this->add_plugin_admin_menu();
|
362 |
-
}
|
363 |
|
364 |
// Register settings page only if it is needed.
|
365 |
if ( ( isset( $_GET ['page' ] ) && IP_Geo_Block::PLUGIN_NAME === $_GET ['page' ] ) ||
|
@@ -369,15 +431,71 @@ class IP_Geo_Block_Admin {
|
|
369 |
|
370 |
// Add an action link pointing to the options page. @since 2.7
|
371 |
else {
|
372 |
-
add_filter( 'plugin_row_meta',
|
373 |
-
add_filter( 'plugin_action_links_' . IP_GEO_BLOCK_BASE, array( $this, 'add_action_links'
|
374 |
}
|
375 |
|
376 |
// Register scripts for admin.
|
377 |
-
add_action( 'admin_enqueue_scripts',
|
378 |
|
379 |
-
// Show admin notices at the place where it should be.
|
380 |
-
add_action( 'admin_notices',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
}
|
382 |
|
383 |
/**
|
@@ -401,13 +519,11 @@ class IP_Geo_Block_Admin {
|
|
401 |
echo '<a href="?page=', IP_Geo_Block::PLUGIN_NAME, '&tab=', $key, '" class="nav-tab', ($tab === $key ? ' nav-tab-active' : ''), '">', $val, '</a>';
|
402 |
} ?>
|
403 |
</h2>
|
404 |
-
<?php if ( 0 <= $tab && $tab <= 1 ) { ?>
|
405 |
<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>
|
406 |
-
<?php
|
407 |
-
<form method="post" action="options.php"<?php if ( 0 !== $tab ) echo " id=\"", IP_Geo_Block::PLUGIN_NAME, "-inhibit\""; ?>>
|
408 |
<?php
|
409 |
settings_fields( IP_Geo_Block::PLUGIN_NAME );
|
410 |
-
do_settings_sections( IP_Geo_Block::PLUGIN_NAME );
|
411 |
if ( 0 === $tab )
|
412 |
submit_button(); // @since 3.1
|
413 |
?>
|
@@ -417,28 +533,27 @@ class IP_Geo_Block_Admin {
|
|
417 |
<div id="ip-geo-block-map"></div>
|
418 |
<?php } elseif ( 3 === $tab ) {
|
419 |
// show attribution (higher priority order)
|
420 |
-
$providers = IP_Geo_Block_Provider::get_addons();
|
421 |
$tab = array();
|
422 |
-
foreach (
|
423 |
if ( $geo = IP_Geo_Block_API::get_instance( $provider, NULL ) ) {
|
424 |
$tab[] = $geo->get_attribution();
|
425 |
}
|
426 |
}
|
427 |
echo '<p>', implode( '<br />', $tab ), "</p>\n";
|
428 |
|
429 |
-
echo
|
430 |
echo __( '(Most browsers will redirect you to each site <a href="http://www.ipgeoblock.com/etc/referer.html" title="Referer Checker">without referrer when you click the link</a>.)', 'ip-geo-block' ), "</p>\n";
|
431 |
} ?>
|
432 |
<?php if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ) {
|
433 |
echo '<p>', get_num_queries(), ' queries. ', timer_stop(0), ' seconds. ', memory_get_usage(), " bytes.</p>\n";
|
434 |
} ?>
|
435 |
-
<p
|
436 |
</div>
|
437 |
<?php
|
438 |
}
|
439 |
|
440 |
/**
|
441 |
-
* Initializes the options page by registering the Sections
|
442 |
*
|
443 |
*/
|
444 |
private function register_settings_tab() {
|
@@ -451,12 +566,13 @@ class IP_Geo_Block_Admin {
|
|
451 |
);
|
452 |
|
453 |
require_once IP_GEO_BLOCK_PATH . $files[ $this->admin_tab ];
|
454 |
-
IP_Geo_Block_Admin_Tab::tab_setup( $this );
|
455 |
}
|
456 |
|
457 |
/**
|
458 |
* Function that fills the field with the desired inputs as part of the larger form.
|
459 |
* The 'id' and 'name' should match the $id given in the add_settings_field().
|
|
|
460 |
* @param array $args['value'] must be sanitized because it comes from external.
|
461 |
*/
|
462 |
public function callback_field( $args ) {
|
@@ -507,7 +623,7 @@ class IP_Geo_Block_Admin {
|
|
507 |
foreach ( $args['list'] as $key => $val ) { ?>
|
508 |
<li>
|
509 |
<input type="checkbox" id="<?php echo $id, $sub_id, '_', $key; ?>" name="<?php echo $name, $sub_name, '[', $key, ']'; ?>" value="<?php echo $key; ?>"<?php
|
510 |
-
checked( $key & $args['value'] ? TRUE : FALSE ); ?> />
|
511 |
<label for="<?php echo $id, $sub_id, '_', $key; ?>"><?php
|
512 |
if ( isset( $args['desc'][ $key ] ) )
|
513 |
echo '<dfn title="', $args['desc'][ $key ], '">', $val, '</dfn>';
|
@@ -524,22 +640,34 @@ class IP_Geo_Block_Admin {
|
|
524 |
<input type="checkbox" id="<?php echo $id, $sub_id; ?>" name="<?php echo $name, $sub_name; ?>" value="1"<?php
|
525 |
checked( esc_attr( $args['value'] ) );
|
526 |
disabled( ! empty( $args['disabled'] ), TRUE ); ?> />
|
527 |
-
<label for="<?php echo $id, $sub_id; ?>"><?php
|
|
|
|
|
|
|
|
|
528 |
<?php
|
529 |
break;
|
530 |
|
531 |
case 'select':
|
532 |
case 'select-text':
|
|
|
533 |
echo "\n<select id=\"${id}${sub_id}\" name=\"${name}${sub_name}\">\n";
|
534 |
foreach ( $args['list'] as $key => $val ) {
|
535 |
echo "\t<option value=\"$key\"", ( NULL === $val ? ' selected disabled' : selected( $args['value'], $key, FALSE ) );
|
536 |
-
if ( isset( $args['desc'][ $key ] ) )
|
537 |
-
echo
|
|
|
|
|
538 |
echo ">$val</option>\n";
|
539 |
}
|
540 |
echo "</select>\n";
|
|
|
|
|
|
|
|
|
541 |
if ( 'select' === $args['type'] )
|
542 |
break;
|
|
|
543 |
echo "<br />\n";
|
544 |
$sub_id = '_' . $args['txt-field']; // possible value of 'txt-field' is 'msg'
|
545 |
$sub_name = '[' . $args['txt-field'] . ']';
|
@@ -547,7 +675,8 @@ class IP_Geo_Block_Admin {
|
|
547 |
|
548 |
case 'text': ?>
|
549 |
<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'] ); ?>"
|
550 |
-
<?php disabled( ! empty( $args['disabled'] ), TRUE ); ?>
|
|
|
551 |
<?php
|
552 |
break; // disabled @since 3.0
|
553 |
|
@@ -583,20 +712,16 @@ class IP_Geo_Block_Admin {
|
|
583 |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/sanitize_option_$option
|
584 |
* @link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php
|
585 |
*/
|
586 |
-
public function
|
587 |
// setup base options
|
588 |
$output = IP_Geo_Block::get_option();
|
589 |
$default = IP_Geo_Block::get_default();
|
590 |
|
591 |
-
//
|
592 |
-
|
593 |
-
$output
|
594 |
-
|
595 |
-
|
596 |
-
// initialize checkboxes not in the form
|
597 |
-
foreach ( array( 'login', 'admin', 'ajax', 'plugins', 'themes', 'public' ) as $key ) {
|
598 |
-
$output['validation'][ $key ] = 0;
|
599 |
-
}
|
600 |
|
601 |
// restore the 'signature' that might be transformed to avoid self blocking
|
602 |
if ( isset( $input['signature'] ) && FALSE === strpos( $input['signature'], ',' ) )
|
@@ -662,6 +787,17 @@ class IP_Geo_Block_Admin {
|
|
662 |
) : '';
|
663 |
break;
|
664 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
665 |
default: // checkbox, select, text
|
666 |
// single field
|
667 |
if ( ! is_array( $default[ $key ] ) ) {
|
@@ -670,12 +806,16 @@ class IP_Geo_Block_Admin {
|
|
670 |
$output[ $key ] = ! empty( $input[ $key ] );
|
671 |
}
|
672 |
|
673 |
-
//
|
674 |
elseif ( isset( $input[ $key ] ) ) {
|
675 |
$output[ $key ] = is_int( $default[ $key ] ) ?
|
676 |
(int)$input[ $key ] :
|
677 |
IP_Geo_Block_Util::kses( trim( $input[ $key ] ), FALSE );
|
678 |
}
|
|
|
|
|
|
|
|
|
679 |
}
|
680 |
|
681 |
// sub field
|
@@ -696,7 +836,7 @@ class IP_Geo_Block_Admin {
|
|
696 |
array() : $input[ $key ][ $sub ];
|
697 |
}
|
698 |
|
699 |
-
//
|
700 |
elseif ( isset( $input[ $key ][ $sub ] ) ) {
|
701 |
// for checkboxes
|
702 |
if ( is_array( $input[ $key ][ $sub ] ) ) {
|
@@ -712,50 +852,96 @@ class IP_Geo_Block_Admin {
|
|
712 |
);
|
713 |
}
|
714 |
}
|
|
|
|
|
|
|
|
|
715 |
}
|
716 |
}
|
717 |
}
|
718 |
|
719 |
-
//----------------------------------------
|
720 |
// Check and format each setting data
|
721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
|
723 |
// sanitize proxy
|
724 |
$output['validation']['proxy'] = implode( ',', $this->trim(
|
725 |
preg_replace( '/[^\w,]/', '', strtoupper( $output['validation']['proxy'] ) )
|
726 |
) );
|
727 |
|
728 |
-
// sanitize and format ip address
|
729 |
$key = array( '/[^\w\n\.\/,:]/', '/([\s,])+/', '/(?:^,|,$)/' );
|
730 |
$val = array( '', '$1', '' );
|
731 |
$output['extra_ips']['white_list'] = preg_replace( $key, $val, trim( $output['extra_ips']['white_list'] ) );
|
732 |
$output['extra_ips']['black_list'] = preg_replace( $key, $val, trim( $output['extra_ips']['black_list'] ) );
|
733 |
|
734 |
-
// format
|
735 |
array_shift( $key );
|
736 |
array_shift( $val );
|
737 |
$output['signature'] = preg_replace( $key, $val, trim( $output['signature'] ) );
|
|
|
|
|
|
|
|
|
|
|
738 |
|
739 |
// 3.0.0 convert country code to upper case, remove redundant spaces
|
740 |
$output['public']['ua_list'] = preg_replace( $key, $val, trim( $output['public']['ua_list'] ) );
|
741 |
$output['public']['ua_list'] = preg_replace( '/([:#]) *([!]+) *([^ ]+) *([,\n]+)/', '$1$2$3$4', $output['public']['ua_list'] );
|
742 |
$output['public']['ua_list'] = preg_replace_callback( '/[:#]([\w:]+)/', array( $this, 'strtoupper' ), $output['public']['ua_list'] );
|
743 |
|
744 |
-
//
|
745 |
-
|
|
|
|
|
746 |
|
747 |
// 2.2.5 exception : convert associative array to simple array
|
748 |
foreach ( array( 'plugins', 'themes' ) as $key ) {
|
749 |
$output['exception'][ $key ] = array_keys( $output['exception'][ $key ] );
|
750 |
}
|
751 |
|
752 |
-
// 3.0.0
|
753 |
-
foreach ( array( '
|
754 |
-
$output['public'][ $key ] = strtoupper( preg_replace( '/\s/', '', $output['public'][ $key ] ) );
|
755 |
-
}
|
756 |
-
|
757 |
-
// 3.0.0 exception : trim extra space and comma
|
758 |
-
foreach ( array( 'admin', 'public', 'includes', 'uploads', 'languages' ) as $key ) {
|
759 |
if ( empty( $output['exception'][ $key ] ) ) {
|
760 |
$output['exception'][ $key ] = $default['exception'][ $key ];
|
761 |
} else {
|
@@ -774,13 +960,16 @@ class IP_Geo_Block_Admin {
|
|
774 |
|
775 |
// Trim extra space and comma avoiding invalid signature which potentially blocks itself
|
776 |
private function trim( $text ) {
|
|
|
|
|
777 |
$ret = array();
|
778 |
foreach ( explode( ',', $text ) as $val ) {
|
779 |
$val = trim( $val );
|
780 |
-
if ( $val && FALSE === stripos(
|
781 |
$ret[] = $val;
|
782 |
}
|
783 |
}
|
|
|
784 |
return $ret;
|
785 |
}
|
786 |
|
@@ -811,13 +1000,14 @@ class IP_Geo_Block_Admin {
|
|
811 |
/**
|
812 |
* Validate settings and configure some features.
|
813 |
*
|
|
|
814 |
*/
|
815 |
public function validate_settings( $input = array() ) {
|
816 |
// must check that the user has the required capability
|
817 |
$this->check_admin_post( FALSE );
|
818 |
|
819 |
// validate setting options
|
820 |
-
$options = $this->
|
821 |
|
822 |
// activate rewrite rules
|
823 |
require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
|
@@ -837,7 +1027,7 @@ class IP_Geo_Block_Admin {
|
|
837 |
}
|
838 |
|
839 |
self::add_admin_notice( 'error',
|
840 |
-
sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), implode( ', ', $file ) ) . '
|
841 |
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>' )
|
842 |
);
|
843 |
}
|
@@ -848,7 +1038,7 @@ class IP_Geo_Block_Admin {
|
|
848 |
if ( TRUE !== $file ) {
|
849 |
$options['validation']['timing'] = 0;
|
850 |
self::add_admin_notice( 'error', sprintf(
|
851 |
-
__( 'Unable to write
|
852 |
) );
|
853 |
}
|
854 |
|
12 |
class IP_Geo_Block_Admin {
|
13 |
|
14 |
/**
|
15 |
+
* Globals in this class
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
*
|
17 |
*/
|
18 |
+
private static $instance = NULL;
|
19 |
private $admin_tab = 0;
|
20 |
|
21 |
/**
|
23 |
* and adding a settings page and menu.
|
24 |
*/
|
25 |
private function __construct() {
|
26 |
+
// Load plugin text domain and add body class
|
27 |
+
add_action( 'init', array( $this, 'admin_init' ) );
|
28 |
|
29 |
// Setup a nonce to validate authentication.
|
30 |
+
add_filter( 'wp_redirect', array( $this, 'add_redirect_nonce' ), 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
/**
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
+
* Load the plugin text domain for translation and add body class.
|
43 |
*
|
44 |
*/
|
45 |
+
public function admin_init() {
|
46 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php'; // is_plugin_active_for_network() @since 3.0.0
|
47 |
+
|
48 |
+
// Add the options page and menu item.
|
49 |
+
add_action( 'admin_menu', array( $this, 'setup_admin_page' ) );
|
50 |
+
add_action( 'admin_post_ip_geo_block', array( $this, 'admin_ajax_callback' ) );
|
51 |
+
add_action( 'wp_ajax_ip_geo_block', array( $this, 'admin_ajax_callback' ) );
|
52 |
+
add_filter( 'wp_prepare_revision_for_js', array( $this, 'add_revision_nonce' ), 10, 3 );
|
53 |
+
|
54 |
+
// If multisite, then enque the authentication script for network admin
|
55 |
+
if ( is_multisite() ) {
|
56 |
+
add_action( 'network_admin_menu', array( $this, 'setup_admin_page' ) );
|
57 |
+
|
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.
|
64 |
load_plugin_textdomain( IP_Geo_Block::PLUGIN_NAME, FALSE, dirname( IP_GEO_BLOCK_BASE ) . '/languages/' );
|
65 |
+
|
66 |
+
// add webview class into body tag.
|
67 |
+
// https://stackoverflow.com/questions/37591279/detect-if-user-is-using-webview-for-android-ios-or-a-regular-browser
|
68 |
+
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) &&
|
69 |
+
( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile/' ) !== FALSE ) &&
|
70 |
+
( strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari/' ) === FALSE ) ) {
|
71 |
+
add_filter( 'admin_body_class', array( $this, 'add_webview_class' ) );
|
72 |
+
}
|
73 |
+
|
74 |
+
// for Android
|
75 |
+
elseif ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && $_SERVER['HTTP_X_REQUESTED_WITH'] === "com.company.app" ) {
|
76 |
+
add_filter( 'admin_body_class', array( $this, 'add_webview_class' ) );
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Add webview class into the body.
|
82 |
+
*
|
83 |
+
*/
|
84 |
+
public function add_webview_class( $classes ) {
|
85 |
+
return $classes . ($classes ? ' ' : '') . 'webview';
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
* Add nonce when redirect into wp-admin area.
|
90 |
*
|
91 |
*/
|
92 |
+
public function add_redirect_nonce( $location, $status ) {
|
93 |
return IP_Geo_Block_Util::rebuild_nonce( $location, $status );
|
94 |
}
|
95 |
|
96 |
+
/**
|
97 |
+
* Add nonce to revision @since 4.4.0
|
98 |
+
*
|
99 |
+
*/
|
100 |
+
public function add_revision_nonce( $revisions_data, $revision, $post ) {
|
101 |
+
$revisions_data['restoreUrl'] = add_query_arg(
|
102 |
+
$nonce = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce',
|
103 |
+
IP_Geo_Block_Util::create_nonce( $nonce ),
|
104 |
+
$revisions_data['restoreUrl']
|
105 |
+
);
|
106 |
+
|
107 |
+
return $revisions_data;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Do some procedures when a blog is created or deleted.
|
112 |
+
*
|
113 |
+
*/
|
114 |
+
public function create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
|
115 |
+
defined( 'IP_GEO_BLOCK_DEBUG' ) and IP_GEO_BLOCK_DEBUG and assert( 'is_main_site()', 'Not main blog.' );
|
116 |
+
|
117 |
+
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-actv.php';
|
118 |
+
|
119 |
+
// Get option of main blog.
|
120 |
+
$settings = IP_Geo_Block::get_option();
|
121 |
+
|
122 |
+
// Switch to the new blog and initialize.
|
123 |
+
switch_to_blog( $blog_id );
|
124 |
+
IP_Geo_Block_Activate::activate_blog();
|
125 |
+
|
126 |
+
// Copy option from main blog.
|
127 |
+
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) && $settings['network_wide'] )
|
128 |
+
update_option( IP_Geo_Block::OPTION_NAME, $settings );
|
129 |
+
|
130 |
+
// Restore the main blog.
|
131 |
+
restore_current_blog();
|
132 |
+
}
|
133 |
+
|
134 |
+
public function delete_blog( $blog_id, $drop ) {
|
135 |
+
if ( $drop )
|
136 |
+
IP_Geo_Block_Logs::delete_tables(); // blog is already switched to the target in wpmu_delete_blog()
|
137 |
+
}
|
138 |
+
|
139 |
/**
|
140 |
* Get the action name of ajax for nonce
|
141 |
*
|
149 |
*
|
150 |
*/
|
151 |
public function enqueue_admin_assets() {
|
152 |
+
$footer = TRUE;
|
153 |
$dependency = array( 'jquery' );
|
154 |
|
155 |
// css for option page
|
203 |
plugins_url( 'js/footable.min.js', __FILE__ ),
|
204 |
$dependency, IP_Geo_Block::VERSION, $footer
|
205 |
);
|
206 |
+
break;
|
207 |
}
|
208 |
|
209 |
// js for IP Geo Block admin page
|
237 |
wp_enqueue_script( $handle );
|
238 |
}
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
/**
|
241 |
* Add plugin meta links
|
242 |
*
|
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 |
|
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 |
|
332 |
*
|
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 )
|
340 |
self::add_admin_notice( 'error', __( 'You need WordPress 3.7+.', 'ip-geo-block' ) );
|
341 |
|
|
|
|
|
|
|
342 |
// Check consistency of matching rule
|
343 |
if ( -1 === (int)$settings['matching_rule'] ) {
|
344 |
if ( FALSE !== get_transient( IP_Geo_Block::CRON_NAME ) ) {
|
386 |
) . ' ' .
|
387 |
sprintf(
|
388 |
__( 'Please check your <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
|
389 |
+
esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-section-0'
|
390 |
)
|
391 |
);
|
392 |
+
break;
|
393 |
}
|
394 |
}
|
395 |
|
396 |
+
// Check activation of IP Geo Allow
|
397 |
+
if ( $settings['validation']['timing'] && is_plugin_active( 'ip-geo-allow/index.php' ) ) {
|
398 |
+
self::add_admin_notice( 'error',
|
399 |
+
__( '“mu-plugins” (ip-geo-block-mu.php) at “Validation timing” is imcompatible with <strong>IP Geo Allow</strong>. Please select “init” action hook.', 'ip-geo-block' )
|
400 |
+
);
|
401 |
+
}
|
402 |
+
|
403 |
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ) {
|
404 |
// Check creation of database table
|
405 |
if ( $settings['validation']['reclogs'] ) {
|
406 |
if ( ( $warn = IP_Geo_Block_Logs::diag_tables() ) &&
|
407 |
+
( FALSE === IP_Geo_Block_Logs::create_tables() ) ) {
|
408 |
self::add_admin_notice( 'notice-warning', $warn );
|
409 |
}
|
410 |
}
|
416 |
*
|
417 |
*/
|
418 |
public function setup_admin_page() {
|
419 |
+
// Register the administration menu.
|
420 |
+
$this->add_plugin_admin_menu();
|
421 |
+
|
422 |
// Avoid multiple validation.
|
423 |
+
if ( 'POST' !== $_SERVER['REQUEST_METHOD'] )
|
424 |
$this->diagnose_admin_screen();
|
|
|
|
|
425 |
|
426 |
// Register settings page only if it is needed.
|
427 |
if ( ( isset( $_GET ['page' ] ) && IP_Geo_Block::PLUGIN_NAME === $_GET ['page' ] ) ||
|
431 |
|
432 |
// Add an action link pointing to the options page. @since 2.7
|
433 |
else {
|
434 |
+
add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta_links' ), 10, 2 );
|
435 |
+
add_filter( 'plugin_action_links_' . IP_GEO_BLOCK_BASE, array( $this, 'add_action_links' ), 10, 1 );
|
436 |
}
|
437 |
|
438 |
// Register scripts for admin.
|
439 |
+
add_action( 'admin_enqueue_scripts', 'IP_Geo_Block::enqueue_nonce', 0 );
|
440 |
|
441 |
+
// Show admin notices at the place where it should be. @since 2.5.0
|
442 |
+
add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
|
443 |
+
add_action( 'network_admin_notices', array( $this, 'show_admin_notices' ) );
|
444 |
+
}
|
445 |
+
|
446 |
+
/**
|
447 |
+
* Get cookie that indicates open/close section
|
448 |
+
*
|
449 |
+
*/
|
450 |
+
public function get_cookie( $name ) {
|
451 |
+
$cookie = array();
|
452 |
+
if ( ! empty( $_COOKIE[ $name ] ) ) {
|
453 |
+
foreach ( explode( '&', $_COOKIE[ $name ] ) as $i => $v ) {
|
454 |
+
list( $i, $v ) = explode( '=', $v );
|
455 |
+
$cookie[ $i ] = str_split( $v );
|
456 |
+
}
|
457 |
+
}
|
458 |
+
return $cookie;
|
459 |
+
}
|
460 |
+
|
461 |
+
/**
|
462 |
+
* Prints out all settings sections added to a particular settings page
|
463 |
+
*
|
464 |
+
* wp-admin/includes/template.php @since 2.7.0
|
465 |
+
*/
|
466 |
+
private function do_settings_sections( $page, $tab ) {
|
467 |
+
global $wp_settings_sections, $wp_settings_fields;
|
468 |
+
|
469 |
+
if ( isset( $wp_settings_sections[ $page ] ) ) {
|
470 |
+
$index = 0; // index of fieldset
|
471 |
+
$cookie = $this->get_cookie( IP_Geo_Block::PLUGIN_NAME );
|
472 |
+
|
473 |
+
foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
|
474 |
+
// TRUE if open ('o') or FALSE if close ('x')
|
475 |
+
$stat = empty( $cookie[ $tab ][ $index ] ) || 'x' !== $cookie[ $tab ][ $index ];
|
476 |
+
|
477 |
+
echo '<fieldset id="', IP_Geo_Block::PLUGIN_NAME, '-section-', $index, '" class="', IP_Geo_Block::PLUGIN_NAME, '-field panel panel-default" data-section="', $index, '">', "\n",
|
478 |
+
'<legend class="panel-heading"><h3 class="', IP_Geo_Block::PLUGIN_NAME, ( $stat ? '-dropdown' : '-dropup' ), '">', $section['title'],
|
479 |
+
'</h3></legend>', "\n", '<div class="panel-body',
|
480 |
+
($stat ? ' ' . IP_Geo_Block::PLUGIN_NAME . '-border"' : '"'),
|
481 |
+
($stat || (4 === $tab && $index) ? '>' : ' style="display:none">'), "\n";
|
482 |
+
|
483 |
+
++$index;
|
484 |
+
|
485 |
+
if ( $section['callback'] )
|
486 |
+
call_user_func( $section['callback'], $section );
|
487 |
+
|
488 |
+
if ( isset( $wp_settings_fields,
|
489 |
+
$wp_settings_fields[ $page ],
|
490 |
+
$wp_settings_fields[ $page ][ $section['id'] ] ) ) {
|
491 |
+
echo '<table class="form-table">';
|
492 |
+
do_settings_fields( $page, $section['id'] );
|
493 |
+
echo "</table>\n";
|
494 |
+
}
|
495 |
+
|
496 |
+
echo "</div>\n</fieldset>\n";
|
497 |
+
}
|
498 |
+
}
|
499 |
}
|
500 |
|
501 |
/**
|
519 |
echo '<a href="?page=', IP_Geo_Block::PLUGIN_NAME, '&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 );
|
527 |
if ( 0 === $tab )
|
528 |
submit_button(); // @since 3.1
|
529 |
?>
|
533 |
<div id="ip-geo-block-map"></div>
|
534 |
<?php } elseif ( 3 === $tab ) {
|
535 |
// show attribution (higher priority order)
|
|
|
536 |
$tab = array();
|
537 |
+
foreach ( IP_Geo_Block_Provider::get_addons() as $provider ) {
|
538 |
if ( $geo = IP_Geo_Block_API::get_instance( $provider, NULL ) ) {
|
539 |
$tab[] = $geo->get_attribution();
|
540 |
}
|
541 |
}
|
542 |
echo '<p>', implode( '<br />', $tab ), "</p>\n";
|
543 |
|
544 |
+
echo '<p>', __( 'Thanks for providing these great services for free.', 'ip-geo-block' ), "<br />\n";
|
545 |
echo __( '(Most browsers will redirect you to each site <a href="http://www.ipgeoblock.com/etc/referer.html" title="Referer Checker">without referrer when you click the link</a>.)', 'ip-geo-block' ), "</p>\n";
|
546 |
} ?>
|
547 |
<?php if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ) {
|
548 |
echo '<p>', get_num_queries(), ' queries. ', timer_stop(0), ' seconds. ', memory_get_usage(), " bytes.</p>\n";
|
549 |
} ?>
|
550 |
+
<p id="ip-geo-block-back-to-top">[ <a href="#"><?php _e( 'Back to top', 'ip-geo-block' ); ?></a> ]</p>
|
551 |
</div>
|
552 |
<?php
|
553 |
}
|
554 |
|
555 |
/**
|
556 |
+
* Initializes the options page by registering the Sections and Fields.
|
557 |
*
|
558 |
*/
|
559 |
private function register_settings_tab() {
|
566 |
);
|
567 |
|
568 |
require_once IP_GEO_BLOCK_PATH . $files[ $this->admin_tab ];
|
569 |
+
IP_Geo_Block_Admin_Tab::tab_setup( $this, $this->admin_tab );
|
570 |
}
|
571 |
|
572 |
/**
|
573 |
* Function that fills the field with the desired inputs as part of the larger form.
|
574 |
* The 'id' and 'name' should match the $id given in the add_settings_field().
|
575 |
+
*
|
576 |
* @param array $args['value'] must be sanitized because it comes from external.
|
577 |
*/
|
578 |
public function callback_field( $args ) {
|
623 |
foreach ( $args['list'] as $key => $val ) { ?>
|
624 |
<li>
|
625 |
<input type="checkbox" id="<?php echo $id, $sub_id, '_', $key; ?>" name="<?php echo $name, $sub_name, '[', $key, ']'; ?>" value="<?php echo $key; ?>"<?php
|
626 |
+
checked( is_array( $args['value'] ) ? ! empty( $args['value'][ $key ] ) : ( $key & $args['value'] ? TRUE : FALSE ) ); ?> />
|
627 |
<label for="<?php echo $id, $sub_id, '_', $key; ?>"><?php
|
628 |
if ( isset( $args['desc'][ $key ] ) )
|
629 |
echo '<dfn title="', $args['desc'][ $key ], '">', $val, '</dfn>';
|
640 |
<input type="checkbox" id="<?php echo $id, $sub_id; ?>" name="<?php echo $name, $sub_name; ?>" value="1"<?php
|
641 |
checked( esc_attr( $args['value'] ) );
|
642 |
disabled( ! empty( $args['disabled'] ), TRUE ); ?> />
|
643 |
+
<label for="<?php echo $id, $sub_id; ?>"><?php
|
644 |
+
if ( isset( $args['text'] ) ) echo esc_attr( $args['text'] );
|
645 |
+
else if ( isset( $args['html'] ) ) echo $args['html'];
|
646 |
+
else _e( 'Enable', 'ip-geo-block' ); ?>
|
647 |
+
</label>
|
648 |
<?php
|
649 |
break;
|
650 |
|
651 |
case 'select':
|
652 |
case 'select-text':
|
653 |
+
$desc = '';
|
654 |
echo "\n<select id=\"${id}${sub_id}\" name=\"${name}${sub_name}\">\n";
|
655 |
foreach ( $args['list'] as $key => $val ) {
|
656 |
echo "\t<option value=\"$key\"", ( NULL === $val ? ' selected disabled' : selected( $args['value'], $key, FALSE ) );
|
657 |
+
if ( isset( $args['desc'][ $key ] ) ) {
|
658 |
+
echo ' data-desc="', $args['desc'][ $key ], '"';
|
659 |
+
$key === $args['value'] and $desc = $args['desc'][ $key ];
|
660 |
+
}
|
661 |
echo ">$val</option>\n";
|
662 |
}
|
663 |
echo "</select>\n";
|
664 |
+
|
665 |
+
if ( isset( $args['desc'] ) )
|
666 |
+
echo '<p class="ip-geo-block-desc">', $desc, "</p>\n";
|
667 |
+
|
668 |
if ( 'select' === $args['type'] )
|
669 |
break;
|
670 |
+
|
671 |
echo "<br />\n";
|
672 |
$sub_id = '_' . $args['txt-field']; // possible value of 'txt-field' is 'msg'
|
673 |
$sub_name = '[' . $args['txt-field'] . ']';
|
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 |
|
712 |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/sanitize_option_$option
|
713 |
* @link https://core.trac.wordpress.org/browser/trunk/src/wp-includes/formatting.php
|
714 |
*/
|
715 |
+
public function sanitize_options( $input ) {
|
716 |
// setup base options
|
717 |
$output = IP_Geo_Block::get_option();
|
718 |
$default = IP_Geo_Block::get_default();
|
719 |
|
720 |
+
// Integrate posted data into current settings because if can be a part of hole data
|
721 |
+
$input = array_replace_recursive(
|
722 |
+
$output = $this->preprocess_options( $output, $default ),
|
723 |
+
$input
|
724 |
+
);
|
|
|
|
|
|
|
|
|
725 |
|
726 |
// restore the 'signature' that might be transformed to avoid self blocking
|
727 |
if ( isset( $input['signature'] ) && FALSE === strpos( $input['signature'], ',' ) )
|
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
|
802 |
// single field
|
803 |
if ( ! is_array( $default[ $key ] ) ) {
|
806 |
$output[ $key ] = ! empty( $input[ $key ] );
|
807 |
}
|
808 |
|
809 |
+
// for implicit data
|
810 |
elseif ( isset( $input[ $key ] ) ) {
|
811 |
$output[ $key ] = is_int( $default[ $key ] ) ?
|
812 |
(int)$input[ $key ] :
|
813 |
IP_Geo_Block_Util::kses( trim( $input[ $key ] ), FALSE );
|
814 |
}
|
815 |
+
|
816 |
+
// otherwise keep as it is
|
817 |
+
else {
|
818 |
+
}
|
819 |
}
|
820 |
|
821 |
// sub field
|
836 |
array() : $input[ $key ][ $sub ];
|
837 |
}
|
838 |
|
839 |
+
// for implicit data
|
840 |
elseif ( isset( $input[ $key ][ $sub ] ) ) {
|
841 |
// for checkboxes
|
842 |
if ( is_array( $input[ $key ][ $sub ] ) ) {
|
852 |
);
|
853 |
}
|
854 |
}
|
855 |
+
|
856 |
+
// otherwise keep as it is
|
857 |
+
else {
|
858 |
+
}
|
859 |
}
|
860 |
}
|
861 |
}
|
862 |
|
|
|
863 |
// Check and format each setting data
|
864 |
+
return $this->postprocess_options( $output, $default );
|
865 |
+
}
|
866 |
+
|
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 |
+
|
874 |
+
// initialize checkboxes not in the form
|
875 |
+
foreach ( array( 'comment', 'login', 'admin', 'ajax', 'plugins', 'themes', 'public', 'mimetype' ) as $key ) {
|
876 |
+
$output['validation'][ $key ] = 0;
|
877 |
+
}
|
878 |
+
|
879 |
+
// initialize checkboxes not in the form
|
880 |
+
foreach ( array( 'plugins', 'themes', 'includes', 'uploads', 'languages' ) as $key ) {
|
881 |
+
$output['rewrite'][ $key ] = FALSE;
|
882 |
+
}
|
883 |
+
|
884 |
+
// initialize checkboxes not in the form
|
885 |
+
$output['mimetype']['white_list'] = array();
|
886 |
+
|
887 |
+
// keep disabled checkboxes not in the form
|
888 |
+
foreach ( array( 'admin', 'plugins', 'themes' ) as $key ) {
|
889 |
+
$output['exception'][ $key ] = array();
|
890 |
+
}
|
891 |
+
|
892 |
+
// keep disabled checkboxes not in the form
|
893 |
+
foreach ( array( 'target_pages', 'target_posts', 'target_cates', 'target_tags', 'simulate', 'dnslkup' ) as $key ) {
|
894 |
+
$output['public'][ $key ] = array();
|
895 |
+
}
|
896 |
+
|
897 |
+
return $output;
|
898 |
+
}
|
899 |
+
|
900 |
+
// Check and format each setting data
|
901 |
+
private function postprocess_options( $output, $default ) {
|
902 |
+
// normalize escaped char
|
903 |
+
$output ['response_msg'] = preg_replace( '/\\\\/', '', $output ['response_msg'] );
|
904 |
+
$output['public' ]['response_msg'] = preg_replace( '/\\\\/', '', $output['public' ]['response_msg'] );
|
905 |
+
$output['comment']['msg' ] = preg_replace( '/\\\\/', '', $output['comment']['msg' ] );
|
906 |
|
907 |
// sanitize proxy
|
908 |
$output['validation']['proxy'] = implode( ',', $this->trim(
|
909 |
preg_replace( '/[^\w,]/', '', strtoupper( $output['validation']['proxy'] ) )
|
910 |
) );
|
911 |
|
912 |
+
// sanitize and format ip address (text area)
|
913 |
$key = array( '/[^\w\n\.\/,:]/', '/([\s,])+/', '/(?:^,|,$)/' );
|
914 |
$val = array( '', '$1', '' );
|
915 |
$output['extra_ips']['white_list'] = preg_replace( $key, $val, trim( $output['extra_ips']['white_list'] ) );
|
916 |
$output['extra_ips']['black_list'] = preg_replace( $key, $val, trim( $output['extra_ips']['black_list'] ) );
|
917 |
|
918 |
+
// format and reject invalid words which potentially blocks itself (text area)
|
919 |
array_shift( $key );
|
920 |
array_shift( $val );
|
921 |
$output['signature'] = preg_replace( $key, $val, trim( $output['signature'] ) );
|
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'] ) );
|
930 |
$output['public']['ua_list'] = preg_replace( '/([:#]) *([!]+) *([^ ]+) *([,\n]+)/', '$1$2$3$4', $output['public']['ua_list'] );
|
931 |
$output['public']['ua_list'] = preg_replace_callback( '/[:#]([\w:]+)/', array( $this, 'strtoupper' ), $output['public']['ua_list'] );
|
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
|
939 |
foreach ( array( 'plugins', 'themes' ) as $key ) {
|
940 |
$output['exception'][ $key ] = array_keys( $output['exception'][ $key ] );
|
941 |
}
|
942 |
|
943 |
+
// 3.0.0 - 3.0.3 exception : trim extra space and comma
|
944 |
+
foreach ( array( 'admin', 'public', 'includes', 'uploads', 'languages', 'restapi' ) as $key ) {
|
|
|
|
|
|
|
|
|
|
|
945 |
if ( empty( $output['exception'][ $key ] ) ) {
|
946 |
$output['exception'][ $key ] = $default['exception'][ $key ];
|
947 |
} else {
|
960 |
|
961 |
// Trim extra space and comma avoiding invalid signature which potentially blocks itself
|
962 |
private function trim( $text ) {
|
963 |
+
$path = IP_Geo_Block::get_wp_path();
|
964 |
+
|
965 |
$ret = array();
|
966 |
foreach ( explode( ',', $text ) as $val ) {
|
967 |
$val = trim( $val );
|
968 |
+
if ( $val && FALSE === stripos( $path['admin'], $val ) ) {
|
969 |
$ret[] = $val;
|
970 |
}
|
971 |
}
|
972 |
+
|
973 |
return $ret;
|
974 |
}
|
975 |
|
1000 |
/**
|
1001 |
* Validate settings and configure some features.
|
1002 |
*
|
1003 |
+
* @note: This function is triggered when update_option() is executed.
|
1004 |
*/
|
1005 |
public function validate_settings( $input = array() ) {
|
1006 |
// must check that the user has the required capability
|
1007 |
$this->check_admin_post( FALSE );
|
1008 |
|
1009 |
// validate setting options
|
1010 |
+
$options = $this->sanitize_options( $input );
|
1011 |
|
1012 |
// activate rewrite rules
|
1013 |
require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
|
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 |
}
|
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 |
|
admin/css/admin.css
CHANGED
@@ -4,20 +4,74 @@ dfn {
|
|
4 |
border-bottom: 1px dotted #888;
|
5 |
}
|
6 |
|
7 |
-
/* legend and fieldset
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
fieldset.ip-geo-block-field {
|
12 |
-
|
13 |
-
|
14 |
-
margin: 1.35em 0 1.5em;
|
15 |
}
|
16 |
fieldset.ip-geo-block-field h2,
|
17 |
fieldset.ip-geo-block-field h3 {
|
18 |
padding: 0;
|
19 |
margin: 0;
|
|
|
|
|
|
|
|
|
20 |
}
|
|
|
21 |
fieldset.ip-geo-block-field .ip-geo-block-dropup,
|
22 |
fieldset.ip-geo-block-field .ip-geo-block-dropdown {
|
23 |
cursor: pointer;
|
@@ -49,20 +103,26 @@ fieldset.ip-geo-block-field ul.ip-geo-block-dropdown:before {
|
|
49 |
top: 0.45em;
|
50 |
}
|
51 |
fieldset.ip-geo-block-field .form-table {
|
52 |
-
margin: 0
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
textarea.regular-text {
|
56 |
width: 25em;
|
57 |
}
|
58 |
|
59 |
-
ul.
|
60 |
margin: 0.5em 0;
|
61 |
}
|
62 |
-
ul.
|
63 |
margin-bottom: 0;
|
64 |
}
|
65 |
-
ul.
|
66 |
margin-top: 0.5em;
|
67 |
}
|
68 |
.folding-disable {
|
@@ -74,6 +134,11 @@ ul.ip_geo_block_settings_folding li:first-child {
|
|
74 |
font-style:oblique !important;
|
75 |
}
|
76 |
|
|
|
|
|
|
|
|
|
|
|
77 |
ul#ip-geo-block-actions dfn {
|
78 |
border: none;
|
79 |
}
|
@@ -99,8 +164,8 @@ ul#ip-geo-block-actions span.dashicons {
|
|
99 |
}
|
100 |
|
101 |
ul.ip-geo-block-note {
|
102 |
-
|
103 |
-
|
104 |
}
|
105 |
ul.ip-geo-block-list {
|
106 |
margin-top: 0.25em;
|
@@ -109,11 +174,6 @@ ul.ip-geo-block-list {
|
|
109 |
ul.ip-geo-block-list label {
|
110 |
display: inline-block;
|
111 |
}
|
112 |
-
.ip-geo-block-desc {
|
113 |
-
display: inline-block;
|
114 |
-
margin-top: 0.25em;
|
115 |
-
margin-bottom: 0.25em;
|
116 |
-
}
|
117 |
@media screen and (min-width:782px) {
|
118 |
ul.ip-geo-block-list .code {
|
119 |
width: 15em;
|
@@ -133,6 +193,10 @@ ul.ip-geo-block-list label {
|
|
133 |
vertical-align: middle;
|
134 |
}
|
135 |
|
|
|
|
|
|
|
|
|
136 |
.ip-geo-block-notice {
|
137 |
color: #dd3d36;
|
138 |
}
|
@@ -187,19 +251,40 @@ table.ip-geo-block-statistics-table td {
|
|
187 |
word-wrap: break-word;
|
188 |
}
|
189 |
table.ip-geo-block-statistics-table tr:nth-child(even) {
|
190 |
-
background-color: #
|
191 |
}
|
192 |
table.ip-geo-block-statistics-table tr:nth-child(odd) {
|
193 |
}
|
194 |
table.ip-geo-block-table {
|
|
|
195 |
white-space: normal;
|
196 |
word-wrap: break-word;
|
197 |
word-break: break-all;
|
198 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
/* for footable */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
.ip-geo-block-log {
|
202 |
width: 100% !important;
|
|
|
203 |
}
|
204 |
.ip-geo-block-log * {
|
205 |
font-size: 13px !important;
|
@@ -209,9 +294,8 @@ table.ip-geo-block-table {
|
|
209 |
.ip-geo-block-log .pagination ul {
|
210 |
border-radius: 4px;
|
211 |
display: inline-block;
|
212 |
-
margin
|
213 |
-
|
214 |
-
padding-left: 0;
|
215 |
}
|
216 |
.ip-geo-block-log .pagination ul > li {
|
217 |
display: inline;
|
@@ -304,6 +388,7 @@ table.ip-geo-block-table {
|
|
304 |
}
|
305 |
.ip-geo-block-log > tbody > tr > td:first-child {
|
306 |
text-align: left;
|
|
|
307 |
}
|
308 |
.ip-geo-block-log .footable-row-detail-row,
|
309 |
.ip-geo-block-log .footable-row-detail-name,
|
@@ -331,31 +416,28 @@ input#ip_geo_block_settings_filter_logs {
|
|
331 |
}
|
332 |
|
333 |
/* for google chart */
|
334 |
-
#ip-geo-block-countries,
|
335 |
-
#ip-geo-block-targets {
|
336 |
-
display: none;
|
337 |
-
}
|
338 |
#ip-geo-block-chart-countries {
|
339 |
height: 200px;
|
340 |
}
|
341 |
#ip-geo-block-chart-daily {
|
342 |
height: 240px;
|
343 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
#ip_geo_block_settings_validation_plugins,
|
345 |
#ip_geo_block_settings_validation_themes {
|
346 |
-
margin-top: 0.
|
347 |
}
|
348 |
-
#
|
349 |
-
|
350 |
-
box-shadow: none;
|
351 |
}
|
352 |
-
#ip-geo-block-
|
|
|
353 |
box-shadow: none;
|
354 |
-
text-decoration: none;
|
355 |
-
}
|
356 |
-
#ip-geo-block-decode:active {
|
357 |
-
position: relative;
|
358 |
-
top: 1px;
|
359 |
}
|
360 |
#ip-geo-block-wp-info textarea {
|
361 |
margin-top: 0.5em;
|
@@ -365,20 +447,50 @@ input#ip_geo_block_settings_filter_logs {
|
|
365 |
word-break: normal;
|
366 |
white-space: pre;
|
367 |
}
|
368 |
-
#ip-geo-block-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
height: 16px;
|
370 |
width: 16px;
|
371 |
margin: 0;
|
372 |
border: none;
|
373 |
display: inline-block;
|
374 |
-
vertical-align:
|
375 |
background-size: 16px 16px;
|
376 |
background-position: center center;
|
377 |
background-repeat: no-repeat;
|
378 |
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);
|
379 |
}
|
380 |
/* https://developer.wordpress.org/resource/dashicons/ for WordPress 3.8
|
381 |
-
|
382 |
background: none;
|
383 |
content: "\f463";
|
384 |
display: inline-block;
|
@@ -391,4 +503,26 @@ input#ip_geo_block_settings_filter_logs {
|
|
391 |
-webkit-font-smoothing: antialiased;
|
392 |
-moz-osx-font-smoothing: grayscale;
|
393 |
}
|
394 |
-
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
border-bottom: 1px dotted #888;
|
5 |
}
|
6 |
|
7 |
+
/* style legend and fieldset as panel */
|
8 |
+
fieldset, legend {
|
9 |
+
padding: 0;
|
10 |
+
margin: 0;
|
11 |
+
border: 0;
|
12 |
+
-webkit-box-sizing: border-box;
|
13 |
+
-moz-box-sizing: border-box;
|
14 |
+
box-sizing: border-box;
|
15 |
+
}
|
16 |
+
fieldset {
|
17 |
+
min-width: 0;
|
18 |
+
}
|
19 |
+
legend {
|
20 |
+
display: block;
|
21 |
+
line-height: inherit;
|
22 |
+
width: 100%;
|
23 |
+
}
|
24 |
+
label {
|
25 |
+
display: inline-block;
|
26 |
+
max-width: 100%;
|
27 |
+
}
|
28 |
+
.panel {
|
29 |
+
border-color: gray;
|
30 |
+
border: 1px solid #e5e5e5;
|
31 |
+
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
32 |
+
-moz-box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
33 |
+
box-shadow: 0 1px 1px rgba(0,0,0,.04);
|
34 |
+
background: #f5f5f5;
|
35 |
+
}
|
36 |
+
.panel-heading {
|
37 |
+
float: left !important;
|
38 |
+
background: #fff;
|
39 |
}
|
40 |
+
.panel-default > .panel-heading {
|
41 |
+
border-color: inherit;
|
42 |
+
}
|
43 |
+
.panel-body {
|
44 |
+
width: 100%;
|
45 |
+
padding: 0 1em;
|
46 |
+
display: inline-block;
|
47 |
+
-webkit-box-sizing: border-box;
|
48 |
+
-moz-box-sizing: border-box;
|
49 |
+
box-sizing: border-box;
|
50 |
+
}
|
51 |
+
.panel-body:before,
|
52 |
+
.panel-body:after {
|
53 |
+
content: " ";
|
54 |
+
display: table;
|
55 |
+
}
|
56 |
+
.panel-body:after {
|
57 |
+
clear: both;
|
58 |
+
}
|
59 |
+
|
60 |
+
/* style legend and fieldset */
|
61 |
fieldset.ip-geo-block-field {
|
62 |
+
/* padding: 0 10px;*/
|
63 |
+
margin: 1em 0;
|
|
|
64 |
}
|
65 |
fieldset.ip-geo-block-field h2,
|
66 |
fieldset.ip-geo-block-field h3 {
|
67 |
padding: 0;
|
68 |
margin: 0;
|
69 |
+
font-size: 14px !important;
|
70 |
+
}
|
71 |
+
fieldset.ip-geo-block-field legend.panel-heading {
|
72 |
+
padding: 10px;
|
73 |
}
|
74 |
+
|
75 |
fieldset.ip-geo-block-field .ip-geo-block-dropup,
|
76 |
fieldset.ip-geo-block-field .ip-geo-block-dropdown {
|
77 |
cursor: pointer;
|
103 |
top: 0.45em;
|
104 |
}
|
105 |
fieldset.ip-geo-block-field .form-table {
|
106 |
+
margin: 0;
|
107 |
+
width: 100%;
|
108 |
+
}
|
109 |
+
fieldset.ip-geo-block-field .ip-geo-block-desc {
|
110 |
+
color: #666;
|
111 |
+
font-size: 13px;
|
112 |
+
/* font-style: italic;*/
|
113 |
}
|
114 |
|
115 |
textarea.regular-text {
|
116 |
width: 25em;
|
117 |
}
|
118 |
|
119 |
+
ul.ip-geo-block-settings-folding {
|
120 |
margin: 0.5em 0;
|
121 |
}
|
122 |
+
ul.ip-geo-block-settings-folding ul {
|
123 |
margin-bottom: 0;
|
124 |
}
|
125 |
+
ul.ip-geo-block-settings-folding li:first-child {
|
126 |
margin-top: 0.5em;
|
127 |
}
|
128 |
.folding-disable {
|
134 |
font-style:oblique !important;
|
135 |
}
|
136 |
|
137 |
+
ul.ip-geo-block-float li {
|
138 |
+
display: inline-block;
|
139 |
+
width: 18em;
|
140 |
+
}
|
141 |
+
|
142 |
ul#ip-geo-block-actions dfn {
|
143 |
border: none;
|
144 |
}
|
164 |
}
|
165 |
|
166 |
ul.ip-geo-block-note {
|
167 |
+
margin-top: 1em;
|
168 |
+
list-style: disc inside;
|
169 |
}
|
170 |
ul.ip-geo-block-list {
|
171 |
margin-top: 0.25em;
|
174 |
ul.ip-geo-block-list label {
|
175 |
display: inline-block;
|
176 |
}
|
|
|
|
|
|
|
|
|
|
|
177 |
@media screen and (min-width:782px) {
|
178 |
ul.ip-geo-block-list .code {
|
179 |
width: 15em;
|
193 |
vertical-align: middle;
|
194 |
}
|
195 |
|
196 |
+
.ip-geo-block-border {
|
197 |
+
border-top: inherit;
|
198 |
+
}
|
199 |
+
|
200 |
.ip-geo-block-notice {
|
201 |
color: #dd3d36;
|
202 |
}
|
251 |
word-wrap: break-word;
|
252 |
}
|
253 |
table.ip-geo-block-statistics-table tr:nth-child(even) {
|
254 |
+
background-color: #eee;
|
255 |
}
|
256 |
table.ip-geo-block-statistics-table tr:nth-child(odd) {
|
257 |
}
|
258 |
table.ip-geo-block-table {
|
259 |
+
margin: 1em 0;
|
260 |
white-space: normal;
|
261 |
word-wrap: break-word;
|
262 |
word-break: break-all;
|
263 |
}
|
264 |
+
table.ip-geo-block-table td:first-child {
|
265 |
+
min-width: 4.3em;
|
266 |
+
}
|
267 |
+
|
268 |
+
/* for whois */
|
269 |
+
@media screen and (max-width:782px) {
|
270 |
+
#ip-geo-block-whois .panel-body {
|
271 |
+
padding: 0 0.5em;
|
272 |
+
}
|
273 |
+
}
|
274 |
|
275 |
/* for footable */
|
276 |
+
#ip-geo-block-4 #ip-geo-block-section-1 .panel-body,
|
277 |
+
#ip-geo-block-4 #ip-geo-block-section-2 .panel-body,
|
278 |
+
#ip-geo-block-4 #ip-geo-block-section-3 .panel-body,
|
279 |
+
#ip-geo-block-4 #ip-geo-block-section-4 .panel-body,
|
280 |
+
#ip-geo-block-4 #ip-geo-block-section-5 .panel-body {
|
281 |
+
padding: 0;
|
282 |
+
display: table-cell;
|
283 |
+
/* border-collapse: collapse; *//* Bug of IE10, IE11 */
|
284 |
+
}
|
285 |
.ip-geo-block-log {
|
286 |
width: 100% !important;
|
287 |
+
margin: 0.5em 0;
|
288 |
}
|
289 |
.ip-geo-block-log * {
|
290 |
font-size: 13px !important;
|
294 |
.ip-geo-block-log .pagination ul {
|
295 |
border-radius: 4px;
|
296 |
display: inline-block;
|
297 |
+
margin: 0.5em 0 0 0;
|
298 |
+
padding: 0;
|
|
|
299 |
}
|
300 |
.ip-geo-block-log .pagination ul > li {
|
301 |
display: inline;
|
388 |
}
|
389 |
.ip-geo-block-log > tbody > tr > td:first-child {
|
390 |
text-align: left;
|
391 |
+
padding-left: 0.5em;
|
392 |
}
|
393 |
.ip-geo-block-log .footable-row-detail-row,
|
394 |
.ip-geo-block-log .footable-row-detail-name,
|
416 |
}
|
417 |
|
418 |
/* for google chart */
|
|
|
|
|
|
|
|
|
419 |
#ip-geo-block-chart-countries {
|
420 |
height: 200px;
|
421 |
}
|
422 |
#ip-geo-block-chart-daily {
|
423 |
height: 240px;
|
424 |
}
|
425 |
+
#ip_geo_block_settings_validation_mimetype + label {
|
426 |
+
padding-top: 0.25em;
|
427 |
+
}
|
428 |
+
#ip_geo_block_settings_validation_mimetype + label + ul {
|
429 |
+
margin-top: 0.7em;
|
430 |
+
}
|
431 |
#ip_geo_block_settings_validation_plugins,
|
432 |
#ip_geo_block_settings_validation_themes {
|
433 |
+
margin-top: 0.7em;
|
434 |
}
|
435 |
+
#ip_geo_block_settings_create_user {
|
436 |
+
margin-bottom: 0.5em;
|
|
|
437 |
}
|
438 |
+
#ip-geo-block-toggle-sections,
|
439 |
+
#ip-geo-block-back-to-top a {
|
440 |
box-shadow: none;
|
|
|
|
|
|
|
|
|
|
|
441 |
}
|
442 |
#ip-geo-block-wp-info textarea {
|
443 |
margin-top: 0.5em;
|
447 |
word-break: normal;
|
448 |
white-space: pre;
|
449 |
}
|
450 |
+
#ip-geo-block-preferred {
|
451 |
+
color: #fff;
|
452 |
+
background: #00838f !important;
|
453 |
+
border-color: #00707a !important;
|
454 |
+
text-shadow: none; /* for WordPress 3.7.21 */
|
455 |
+
}
|
456 |
+
#ip-geo-block-preferred:hover {
|
457 |
+
background-color: #00919e !important;
|
458 |
+
border-color: #00525a !important;
|
459 |
+
}
|
460 |
+
|
461 |
+
span.ip-geo-block-title-link {
|
462 |
+
font-size: 13px;
|
463 |
+
}
|
464 |
+
/*span.ip-geo-block-title-link a {
|
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;
|
484 |
border: none;
|
485 |
display: inline-block;
|
486 |
+
vertical-align: middle;
|
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;
|
495 |
content: "\f463";
|
496 |
display: inline-block;
|
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;
|
519 |
+
list-style-position: outside;
|
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 |
+
}
|
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-log .footable-row-detail-value,table.ip-geo-block-table{white-space:normal;word-wrap:break-word;word-break:break-all}#ip-geo-block-scan-code,.ip-geo-block-loading,.ip-geo-block-log *{vertical-align:middle}#ip-geo-block-cycle,.ip-geo-block-loading{background-size:16px 16px;background-position:center center;background-repeat:no-repeat}dfn{cursor:help;border-bottom:1px dotted #888}.form-table{margin:0 1em}fieldset.ip-geo-block-field{border:1px solid #ccc;padding:.35em .625em .75em 1em;margin:1.35em 0 1.5em}fieldset.ip-geo-block-field h2,fieldset.ip-geo-block-field h3{padding:0;margin:0}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:.5em 0 0}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}.ip-geo-block-desc,ul.ip-geo-block-list{margin-top:.25em;margin-bottom:.25em}.folding-disable{pointer-events:none;opacity:.5}.folding-inactive{opacity:.5;font-style:oblique!important}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-desc,.ip-geo-block-loading,.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{list-style:disc;margin-left:1em}@media screen and (min-width:782px){ul.ip-geo-block-list .code{width:15em}}.ip-geo-block-loading{background-image:url(data:image/gif;base64,R0lGODlhEAAQAPIGAAAAAMLCwkJCQpKSkmJiYoKCgv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgAGACwAAAAAEAAQAAADM2i63P4wyklrC0IEKgAQnAdOmGYFBLExwboQWcG2rlHEwTDQLUsUOd2mBxkUCgNKa+dIAAAh+QQJCgAGACwAAAIACgAOAAADLWgWIqHQCABEVLPe1R4MBOFFRFNsRUNsYDFewTC8iixvQ1EMyxjEvyBLODQkAAAh+QQJCgAGACwAAAAACgAOAAADLWi6IRJrCQCECoU0ag1xxeBARuEQ0UUU5DUM7fK+qTEUYR0EcM3Ev51uB7wAEwAh+QQJCgAGACwAAAAADgAKAAADLWi6URQrLiJEkSaM0eqrkLFtAVEEAgAIylAUQ5SuSqCFNZjhWG3zmB8wOJQkAAAh+QQJCgAGACwCAAAADgAKAAADK2hqMRMrLuekCnCU8gqBDCZ2glBcYkSUxIJJgQdaUVDOtAAAAr3oPN/llgAAIfkECQoABgAsBgAAAAoADgAAAytoEdauiz0Yx5BQFTvN2EMXWNgUFETZFIJQdERLiGgZtKohAIDQ7T0RrpEAACH5BAkKAAYALAYAAgAKAA4AAAMqaKoR+609Fie1K4zhZiibNRSg1XAQUXQPIQgE835voQgAIARqh+ummSUBACH5BAUKAAYALAIABgAOAAoAAAMsaLpsES2+F9mEddEgBFbBMGACAAiMOCrlGRBFWBQD2L0dYYjfUuQZEKynSAAAOw==);height:16px;width:16px;margin-left:1em;margin-top:.2em}.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:#f7f7f7}.ip-geo-block-log{width:100%!important}.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-bottom:0;margin-left:0;padding-left: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}.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}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-countries,#ip-geo-block-targets{display:none}#ip-geo-block-chart-countries{height:200px}#ip-geo-block-chart-daily{height:240px}#ip_geo_block_settings_validation_plugins,#ip_geo_block_settings_validation_themes{margin-top:.5em}#ip-geo-block-back-to-top,#ip-geo-block-toggle-sections{box-shadow:none}#ip-geo-block-decode{box-shadow:none;text-decoration:none}#ip-geo-block-decode:active{position:relative;top:1px}#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-cycle{height:16px;width:16px;margin:0;border:none;display:inline-block;vertical-align:text-bottom;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)}
|
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}
|
admin/css/footable.core.min.css
CHANGED
@@ -7,4 +7,4 @@
|
|
7 |
* Released under the MIT license
|
8 |
* You are free to use FooTable in commercial projects as long as this copyright header is left intact.
|
9 |
*/
|
10 |
-
@font-face{font-family:'footable';src:url('fonts/footable.eot');src:url('fonts/footable.eot?#iefix') format('embedded-opentype'),url('fonts/footable.woff') format('woff'),url('fonts/footable.ttf') format('truetype'),url('fonts/footable.svg#footable') format('svg');font-weight:normal;font-style:normal}@media screen and (-webkit-min-device-pixel-ratio:0){@font-face{font-family:'footable';src:url('fonts/footable.svg#footable') format('svg');font-weight:normal;font-style:normal}}.footable{width:100%}.footable.breakpoint>tbody>tr.footable-detail-show>td{border-bottom:0}.footable.breakpoint>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e001"}.footable.breakpoint>tbody>tr:hover:not(.footable-row-detail){cursor:pointer}.footable.breakpoint>tbody>tr>td.footable-cell-detail{background:#eee;border-top:0}.footable.breakpoint>tbody>tr>td>span.footable-toggle{display:inline-block;font-family:'footable';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;padding-right:5px;font-size:14px;color:#888}.footable.breakpoint>tbody>tr>td>span.footable-toggle:before{content:"\e000"}.footable.breakpoint.toggle-circle>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e005"}.footable.breakpoint.toggle-circle>tbody>tr>td>span.footable-toggle:before{content:"\e004"}.footable.breakpoint.toggle-circle-filled>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e003"}.footable.breakpoint.toggle-circle-filled>tbody>tr>td>span.footable-toggle:before{content:"\e002"}.footable.breakpoint.toggle-square>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e007"}.footable.breakpoint.toggle-square>tbody>tr>td>span.footable-toggle:before{content:"\e006"}.footable.breakpoint.toggle-square-filled>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e009"}.footable.breakpoint.toggle-square-filled>tbody>tr>td>span.footable-toggle:before{content:"\e008"}.footable.breakpoint.toggle-arrow>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e00f"}.footable.breakpoint.toggle-arrow>tbody>tr>td>span.footable-toggle:before{content:"\e011"}.footable.breakpoint.toggle-arrow-small>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e013"}.footable.breakpoint.toggle-arrow-small>tbody>tr>td>span.footable-toggle:before{content:"\e015"}.footable.breakpoint.toggle-arrow-circle>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e01b"}.footable.breakpoint.toggle-arrow-circle>tbody>tr>td>span.footable-toggle:before{content:"\e01d"}.footable.breakpoint.toggle-arrow-circle-filled>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e00b"}.footable.breakpoint.toggle-arrow-circle-filled>tbody>tr>td>span.footable-toggle:before{content:"\e00d"}.footable.breakpoint.toggle-arrow-tiny>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e01f"}.footable.breakpoint.toggle-arrow-tiny>tbody>tr>td>span.footable-toggle:before{content:"\e021"}.footable.breakpoint.toggle-arrow-alt>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e017"}.footable.breakpoint.toggle-arrow-alt>tbody>tr>td>span.footable-toggle:before{content:"\e019"}.footable.breakpoint.toggle-medium>tbody>tr>td>span.footable-toggle{font-size:18px}.footable.breakpoint.toggle-large>tbody>tr>td>span.footable-toggle{font-size:24px}.footable>thead>tr>th{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.footable>thead>tr>th.footable-sortable:hover{cursor:pointer}.footable>thead>tr>th.footable-sorted>span.footable-sort-indicator:before{content:"\e013"}.footable>thead>tr>th.footable-sorted-desc>span.footable-sort-indicator:before{content:"\e012"}.footable>thead>tr>th>span.footable-sort-indicator{display:inline-block;font-family:'footable';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;padding-left:5px}.footable>thead>tr>th>span.footable-sort-indicator:before{content:"\e022"}.footable>tfoot .pagination{margin:0}.footable.no-paging .hide-if-no-paging{display:none}.footable-row-detail-inner{display:table}.footable-row-detail-row{display:table-row;line-height:1.5em}.footable-row-detail-group{display:block;line-height:2em;font-size:1.2em;font-weight:bold}.footable-row-detail-name{display:table-cell;font-weight:bold;padding-right:.5em}.footable-row-detail-value{display:table-cell}.footable-odd{background-color:#
|
7 |
* Released under the MIT license
|
8 |
* You are free to use FooTable in commercial projects as long as this copyright header is left intact.
|
9 |
*/
|
10 |
+
@font-face{font-family:'footable';src:url('fonts/footable.eot');src:url('fonts/footable.eot?#iefix') format('embedded-opentype'),url('fonts/footable.woff') format('woff'),url('fonts/footable.ttf') format('truetype'),url('fonts/footable.svg#footable') format('svg');font-weight:normal;font-style:normal}@media screen and (-webkit-min-device-pixel-ratio:0){@font-face{font-family:'footable';src:url('fonts/footable.svg#footable') format('svg');font-weight:normal;font-style:normal}}.footable{width:100%}.footable.breakpoint>tbody>tr.footable-detail-show>td{border-bottom:0}.footable.breakpoint>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e001"}.footable.breakpoint>tbody>tr:hover:not(.footable-row-detail){cursor:pointer}.footable.breakpoint>tbody>tr>td.footable-cell-detail{background:#eee;border-top:0}.footable.breakpoint>tbody>tr>td>span.footable-toggle{display:inline-block;font-family:'footable';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;padding-right:5px;font-size:14px;color:#888}.footable.breakpoint>tbody>tr>td>span.footable-toggle:before{content:"\e000"}.footable.breakpoint.toggle-circle>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e005"}.footable.breakpoint.toggle-circle>tbody>tr>td>span.footable-toggle:before{content:"\e004"}.footable.breakpoint.toggle-circle-filled>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e003"}.footable.breakpoint.toggle-circle-filled>tbody>tr>td>span.footable-toggle:before{content:"\e002"}.footable.breakpoint.toggle-square>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e007"}.footable.breakpoint.toggle-square>tbody>tr>td>span.footable-toggle:before{content:"\e006"}.footable.breakpoint.toggle-square-filled>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e009"}.footable.breakpoint.toggle-square-filled>tbody>tr>td>span.footable-toggle:before{content:"\e008"}.footable.breakpoint.toggle-arrow>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e00f"}.footable.breakpoint.toggle-arrow>tbody>tr>td>span.footable-toggle:before{content:"\e011"}.footable.breakpoint.toggle-arrow-small>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e013"}.footable.breakpoint.toggle-arrow-small>tbody>tr>td>span.footable-toggle:before{content:"\e015"}.footable.breakpoint.toggle-arrow-circle>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e01b"}.footable.breakpoint.toggle-arrow-circle>tbody>tr>td>span.footable-toggle:before{content:"\e01d"}.footable.breakpoint.toggle-arrow-circle-filled>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e00b"}.footable.breakpoint.toggle-arrow-circle-filled>tbody>tr>td>span.footable-toggle:before{content:"\e00d"}.footable.breakpoint.toggle-arrow-tiny>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e01f"}.footable.breakpoint.toggle-arrow-tiny>tbody>tr>td>span.footable-toggle:before{content:"\e021"}.footable.breakpoint.toggle-arrow-alt>tbody>tr.footable-detail-show>td>span.footable-toggle:before{content:"\e017"}.footable.breakpoint.toggle-arrow-alt>tbody>tr>td>span.footable-toggle:before{content:"\e019"}.footable.breakpoint.toggle-medium>tbody>tr>td>span.footable-toggle{font-size:18px}.footable.breakpoint.toggle-large>tbody>tr>td>span.footable-toggle{font-size:24px}.footable>thead>tr>th{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.footable>thead>tr>th.footable-sortable:hover{cursor:pointer}.footable>thead>tr>th.footable-sorted>span.footable-sort-indicator:before{content:"\e013"}.footable>thead>tr>th.footable-sorted-desc>span.footable-sort-indicator:before{content:"\e012"}.footable>thead>tr>th>span.footable-sort-indicator{display:inline-block;font-family:'footable';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;padding-left:5px}.footable>thead>tr>th>span.footable-sort-indicator:before{content:"\e022"}.footable>tfoot .pagination{margin:0}.footable.no-paging .hide-if-no-paging{display:none}.footable-row-detail-inner{display:table}.footable-row-detail-row{display:table-row;line-height:1.5em}.footable-row-detail-group{display:block;line-height:2em;font-size:1.2em;font-weight:bold}.footable-row-detail-name{display:table-cell;font-weight:bold;padding-right:.5em}.footable-row-detail-value{display:table-cell}.footable-odd{background-color:#eee}
|
admin/includes/class-admin-ajax.php
CHANGED
@@ -162,26 +162,31 @@ class IP_Geo_Block_Admin_Ajax {
|
|
162 |
*/
|
163 |
static public function validate_settings( $parent ) {
|
164 |
// restore escaped characters (see wp_magic_quotes() in wp-includes/load.php)
|
165 |
-
$json =
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
169 |
);
|
170 |
|
171 |
-
if ( NULL ===
|
172 |
wp_die( 'Illegal JSON format.', '', array( 'response' => 500, 'back_link' => TRUE ) ); // @Since 2.0.4
|
173 |
|
174 |
// Convert json to setting data
|
175 |
-
$
|
|
|
176 |
|
177 |
// Integrate posted data into current settings because if can be a part of hole data
|
178 |
-
|
179 |
-
|
|
|
|
|
180 |
|
181 |
// Validate options and convert to json
|
182 |
-
$
|
183 |
-
$
|
184 |
-
$json = self::json_unsafe_encode( $data );
|
185 |
|
186 |
mbstring_binary_safe_encoding(); // @since 3.7.0
|
187 |
$length = strlen( $json );
|
@@ -203,33 +208,42 @@ class IP_Geo_Block_Admin_Ajax {
|
|
203 |
*
|
204 |
*/
|
205 |
static private function json_to_settings( $input ) {
|
206 |
-
$settings = array();
|
207 |
$prfx = IP_Geo_Block::OPTION_NAME;
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
|
220 |
-
|
221 |
-
|
222 |
-
if ( empty( $settings[ $m[1] ][ $m[2] ] ) )
|
223 |
-
$settings[ $m[1] ][ $m[2] ] = 0;
|
224 |
-
$settings[ $m[1] ][ $m[2] ] |= $val;
|
225 |
-
} else {
|
226 |
-
$settings[ $m[1] ][ $m[2] ][ $m[3] ] = $val;
|
227 |
}
|
228 |
-
break;
|
229 |
}
|
230 |
}
|
231 |
}
|
232 |
|
|
|
|
|
|
|
|
|
233 |
return $settings;
|
234 |
}
|
235 |
|
@@ -238,6 +252,7 @@ class IP_Geo_Block_Admin_Ajax {
|
|
238 |
*
|
239 |
*/
|
240 |
static public function settings_to_json( $input, $overwrite = TRUE ) {
|
|
|
241 |
$keys = array(
|
242 |
'[version]',
|
243 |
'[matching_rule]',
|
@@ -257,7 +272,7 @@ class IP_Geo_Block_Admin_Ajax {
|
|
257 |
'[validation][login]',
|
258 |
'[login_action][login]', // 2.2.8
|
259 |
'[login_action][register]', // 2.2.8
|
260 |
-
'[login_action][
|
261 |
'[login_action][lostpassword]', // 2.2.8
|
262 |
'[login_action][postpass]', // 2.2.8
|
263 |
'[validation][admin][1]',
|
@@ -270,6 +285,8 @@ class IP_Geo_Block_Admin_Ajax {
|
|
270 |
'[validation][uploads]', // 3.0.0
|
271 |
'[validation][languages]', // 3.0.0
|
272 |
'[validation][public]', // 3.0.0
|
|
|
|
|
273 |
'[rewrite][plugins]',
|
274 |
'[rewrite][themes]',
|
275 |
'[rewrite][includes]', // 3.0.0
|
@@ -282,6 +299,7 @@ class IP_Geo_Block_Admin_Ajax {
|
|
282 |
'[exception][includes][$]', // 3.0.0
|
283 |
'[exception][uploads][$]', // 3.0.0
|
284 |
'[exception][languages][$]', // 3.0.0
|
|
|
285 |
'[public][matching_rule]', // 3.0.0
|
286 |
'[public][white_list]', // 3.0.0
|
287 |
'[public][black_list]', // 3.0.0
|
@@ -292,6 +310,9 @@ class IP_Geo_Block_Admin_Ajax {
|
|
292 |
'[public][target_tags][$]', // 3.0.0
|
293 |
'[public][ua_list]', // 3.0.0
|
294 |
'[public][simulate]', // 3.0.0
|
|
|
|
|
|
|
295 |
'[providers][Maxmind]',
|
296 |
'[providers][IP2Location]',
|
297 |
'[providers][freegeoip.net]',
|
@@ -317,6 +338,9 @@ class IP_Geo_Block_Admin_Ajax {
|
|
317 |
'[clean_uninstall]',
|
318 |
'[api_key][GoogleMap]', // 2.2.7
|
319 |
'[network_wide]', // 3.0.0
|
|
|
|
|
|
|
320 |
);
|
321 |
$json = array();
|
322 |
$prfx = IP_Geo_Block::OPTION_NAME;
|
@@ -331,7 +355,13 @@ class IP_Geo_Block_Admin_Ajax {
|
|
331 |
break;
|
332 |
|
333 |
case 3:
|
334 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
$json[ $prfx.'['.$m[1].']['.$m[2].']' ] = (
|
336 |
isset( $input[ $m[1] ][ $m[2] ] ) &&
|
337 |
'@' !== $input[ $m[1] ][ $m[2] ] ?
|
@@ -347,11 +377,15 @@ class IP_Geo_Block_Admin_Ajax {
|
|
347 |
strval( $input[ $m[1] ][ $m[2] ] ) & (int)$m[3];
|
348 |
}
|
349 |
elseif ( isset( $input[ $m[1] ][ $m[2] ] ) ) {
|
350 |
-
if ( '*' === $m[3] ) {
|
351 |
foreach ( $input[ $m[1] ][ $m[2] ] as $val ) {
|
352 |
-
$json[ $prfx.'['.$m[1].']['.$m[2].']'.'['.$val.']' ] = 1;
|
|
|
|
|
|
|
|
|
353 |
}
|
354 |
-
} elseif ( is_array( $input[ $m[1] ][ $m[2] ] ) ) {
|
355 |
$json[ $prfx.'['.$m[1].']['.$m[2].']' ] = implode( ',', $input[ $m[1] ][ $m[2] ] );
|
356 |
}
|
357 |
}
|
@@ -376,7 +410,7 @@ class IP_Geo_Block_Admin_Ajax {
|
|
376 |
'admin' => 3, // Validate on admin (1:country 2:ZEP)
|
377 |
'ajax' => 3, // Validate on ajax/post (1:country 2:ZEP)
|
378 |
'xmlrpc' => 1, // Validate on xmlrpc (1:country 2:close)
|
379 |
-
'postkey' => 'action,comment,log,pwd', // Keys in $_POST
|
380 |
'plugins' => 2, // Validate on wp-content/plugins
|
381 |
'themes' => 2, // Validate on wp-content/themes
|
382 |
'timing' => 1, // 0:init, 1:mu-plugins, 2:drop-in
|
@@ -447,7 +481,7 @@ class IP_Geo_Block_Admin_Ajax {
|
|
447 |
'WordPress:' => $GLOBALS['wp_version'],
|
448 |
'Multisite:' => is_multisite() ? 'yes' : 'no',
|
449 |
'Zlib:' => function_exists( 'gzopen' ) ? 'yes' : 'no',
|
450 |
-
'ZipArchive:' => class_exists( 'ZipArchive' ) ? 'yes' : 'no',
|
451 |
'BC Math:' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no'),
|
452 |
'mb_strcut:' => function_exists( 'mb_strcut' ) ? 'yes' : 'no',
|
453 |
'DNS lookup:' => ('8.8.8.8' !== $val ? 'available' : 'n/a') . sprintf( ' [%.1f msec]', $key * 1000.0 ),
|
162 |
*/
|
163 |
static public function validate_settings( $parent ) {
|
164 |
// restore escaped characters (see wp_magic_quotes() in wp-includes/load.php)
|
165 |
+
$json = json_decode(
|
166 |
+
str_replace(
|
167 |
+
array( '\\"', '\\\\', "\'" ),
|
168 |
+
array( '"', '\\', "'" ),
|
169 |
+
isset( $_POST['data'] ) ? $_POST['data'] : ''
|
170 |
+
),
|
171 |
+
TRUE
|
172 |
);
|
173 |
|
174 |
+
if ( NULL === $json )
|
175 |
wp_die( 'Illegal JSON format.', '', array( 'response' => 500, 'back_link' => TRUE ) ); // @Since 2.0.4
|
176 |
|
177 |
// Convert json to setting data
|
178 |
+
$input = self::json_to_settings( $json );
|
179 |
+
unset( $input['version'] );
|
180 |
|
181 |
// Integrate posted data into current settings because if can be a part of hole data
|
182 |
+
$input = array_replace_recursive(
|
183 |
+
$parent->preprocess_options( IP_Geo_Block::get_option(), IP_Geo_Block::get_default() ),
|
184 |
+
$input
|
185 |
+
);
|
186 |
|
187 |
// Validate options and convert to json
|
188 |
+
$output = $parent->sanitize_options( $input );
|
189 |
+
$json = self::json_unsafe_encode( self::settings_to_json( $output ) );
|
|
|
190 |
|
191 |
mbstring_binary_safe_encoding(); // @since 3.7.0
|
192 |
$length = strlen( $json );
|
208 |
*
|
209 |
*/
|
210 |
static private function json_to_settings( $input ) {
|
211 |
+
$settings = $m = array();
|
212 |
$prfx = IP_Geo_Block::OPTION_NAME;
|
213 |
|
214 |
+
try {
|
215 |
+
foreach ( $input as $key => $val ) {
|
216 |
+
if ( preg_match( "/${prfx}\[(.+?)\](?:\[(.+?)\](?:\[(.+?)\])?)?/", $key, $m ) ) {
|
217 |
+
switch ( count( $m ) ) {
|
218 |
+
case 2:
|
219 |
+
$settings[ $m[1] ] = $val;
|
220 |
+
break;
|
221 |
+
|
222 |
+
case 3:
|
223 |
+
$settings[ $m[1] ][ $m[2] ] = $val;
|
224 |
+
break;
|
225 |
+
|
226 |
+
case 4:
|
227 |
+
if ( is_numeric( $m[3] ) ) {
|
228 |
+
if ( empty( $settings[ $m[1] ][ $m[2] ] ) )
|
229 |
+
$settings[ $m[1] ][ $m[2] ] = 0;
|
230 |
+
$settings[ $m[1] ][ $m[2] ] |= $val;
|
231 |
+
} else { // [*]:checkbox
|
232 |
+
$settings[ $m[1] ][ $m[2] ][ $m[3] ] = $val;
|
233 |
+
}
|
234 |
+
break;
|
235 |
|
236 |
+
default:
|
237 |
+
throw new Exception();
|
|
|
|
|
|
|
|
|
|
|
238 |
}
|
|
|
239 |
}
|
240 |
}
|
241 |
}
|
242 |
|
243 |
+
catch ( Exception $e ) { // should be returned as ajax response
|
244 |
+
wp_die( sprintf( __( 'illegal format at %s. Please delete the corresponding line and try again.', 'ip-geo-block' ), print_r( @$m[0], TRUE ) ) );
|
245 |
+
}
|
246 |
+
|
247 |
return $settings;
|
248 |
}
|
249 |
|
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]',
|
272 |
'[validation][login]',
|
273 |
'[login_action][login]', // 2.2.8
|
274 |
'[login_action][register]', // 2.2.8
|
275 |
+
'[login_action][resetpass]', // 2.2.8
|
276 |
'[login_action][lostpassword]', // 2.2.8
|
277 |
'[login_action][postpass]', // 2.2.8
|
278 |
'[validation][admin][1]',
|
285 |
'[validation][uploads]', // 3.0.0
|
286 |
'[validation][languages]', // 3.0.0
|
287 |
'[validation][public]', // 3.0.0
|
288 |
+
'[validation][restapi]', // 3.0.3
|
289 |
+
'[validation][mimetype]', // 3.0.3
|
290 |
'[rewrite][plugins]',
|
291 |
'[rewrite][themes]',
|
292 |
'[rewrite][includes]', // 3.0.0
|
299 |
'[exception][includes][$]', // 3.0.0
|
300 |
'[exception][uploads][$]', // 3.0.0
|
301 |
'[exception][languages][$]', // 3.0.0
|
302 |
+
'[exception][restapi][$]', // 3.0.3
|
303 |
'[public][matching_rule]', // 3.0.0
|
304 |
'[public][white_list]', // 3.0.0
|
305 |
'[public][black_list]', // 3.0.0
|
310 |
'[public][target_tags][$]', // 3.0.0
|
311 |
'[public][ua_list]', // 3.0.0
|
312 |
'[public][simulate]', // 3.0.0
|
313 |
+
'[public][dnslkup]', // 3.0.3
|
314 |
+
'[public][response_code]', // 3.0.3
|
315 |
+
'[public][redirect_uri]', // 3.0.3
|
316 |
'[providers][Maxmind]',
|
317 |
'[providers][IP2Location]',
|
318 |
'[providers][freegeoip.net]',
|
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;
|
355 |
break;
|
356 |
|
357 |
case 3:
|
358 |
+
if ( '%' === $m[2] ) { // [%]:associative array
|
359 |
+
foreach ( isset( $input[ $m[1] ] ) ? $input[ $m[1] ] : array() as $key => $val ) {
|
360 |
+
$json[ $prfx.'['.$m[1].']['.$key.']' ] = $val;
|
361 |
+
}
|
362 |
+
break;
|
363 |
+
}
|
364 |
+
if ( isset( $input[ $m[1] ][ $m[2] ] ) || $overwrite ) {
|
365 |
$json[ $prfx.'['.$m[1].']['.$m[2].']' ] = (
|
366 |
isset( $input[ $m[1] ][ $m[2] ] ) &&
|
367 |
'@' !== $input[ $m[1] ][ $m[2] ] ?
|
377 |
strval( $input[ $m[1] ][ $m[2] ] ) & (int)$m[3];
|
378 |
}
|
379 |
elseif ( isset( $input[ $m[1] ][ $m[2] ] ) ) {
|
380 |
+
if ( '*' === $m[3] ) { // [*]:checkbox
|
381 |
foreach ( $input[ $m[1] ][ $m[2] ] as $val ) {
|
382 |
+
$json[ $prfx.'['.$m[1].']['.$m[2].']'.'['.$val.']' ] = '1';
|
383 |
+
}
|
384 |
+
} elseif ( '%' === $m[3] ) { // [%]:associative array
|
385 |
+
foreach ( $input[ $m[1] ][ $m[2] ] as $key => $val ) {
|
386 |
+
$json[ $prfx.'['.$m[1].']['.$m[2].']'.'['.$key.']' ] = $val;
|
387 |
}
|
388 |
+
} elseif ( is_array( $input[ $m[1] ][ $m[2] ] ) ) { // [$]:comma separated text to array
|
389 |
$json[ $prfx.'['.$m[1].']['.$m[2].']' ] = implode( ',', $input[ $m[1] ][ $m[2] ] );
|
390 |
}
|
391 |
}
|
410 |
'admin' => 3, // Validate on admin (1:country 2:ZEP)
|
411 |
'ajax' => 3, // Validate on ajax/post (1:country 2:ZEP)
|
412 |
'xmlrpc' => 1, // Validate on xmlrpc (1:country 2:close)
|
413 |
+
'postkey' => 'action,comment,log,pwd,FILES', // Keys in $_POST and $_FILES
|
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
|
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 ),
|
admin/includes/class-admin-rewrite.php
CHANGED
@@ -92,7 +92,7 @@ class IP_Geo_Block_Admin_Rewrite {
|
|
92 |
*/
|
93 |
private function find_rewrite_block( $content ) {
|
94 |
return preg_grep(
|
95 |
-
'/^\s
|
96 |
$content
|
97 |
);
|
98 |
}
|
@@ -126,23 +126,23 @@ class IP_Geo_Block_Admin_Rewrite {
|
|
126 |
* @return array contents of configuration file
|
127 |
*/
|
128 |
private function get_rewrite_rule( $which ) {
|
|
|
|
|
|
|
129 |
$file = $this->get_rewrite_file( $which );
|
130 |
-
$exist =
|
131 |
|
132 |
// check permission
|
133 |
if ( $exist ) {
|
134 |
-
if ( !
|
135 |
return FALSE;
|
136 |
} else {
|
137 |
-
if ( !
|
138 |
return FALSE;
|
139 |
}
|
140 |
|
141 |
-
// http://php.net/manual/en/function.file.php#refsect1-function.file-returnvalues
|
142 |
-
@ini_set( 'auto_detect_line_endings', TRUE );
|
143 |
-
|
144 |
// get file contents as an array
|
145 |
-
return $exist ?
|
146 |
}
|
147 |
|
148 |
/**
|
@@ -152,13 +152,16 @@ class IP_Geo_Block_Admin_Rewrite {
|
|
152 |
* @param array contents of configuration file
|
153 |
*/
|
154 |
private function put_rewrite_rule( $which, $content ) {
|
|
|
|
|
|
|
155 |
$file = $this->get_rewrite_file( $which );
|
156 |
-
if ( ! $file || FALSE ===
|
157 |
return FALSE;
|
158 |
|
159 |
// if content is empty then remove file
|
160 |
if ( empty( $content ) )
|
161 |
-
|
162 |
|
163 |
return TRUE;
|
164 |
}
|
@@ -203,8 +206,7 @@ class IP_Geo_Block_Admin_Rewrite {
|
|
203 |
reset( $block );
|
204 |
while (
|
205 |
( list( $key_end, $val_end ) = each( $block ) ) &&
|
206 |
-
( list( $key_begin, $val_begin ) = each( $block ) )
|
207 |
-
) {
|
208 |
array_splice( $content, $key_begin, $key_end - $key_begin + 1 );
|
209 |
}
|
210 |
}
|
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 |
}
|
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 |
/**
|
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 |
}
|
206 |
reset( $block );
|
207 |
while (
|
208 |
( list( $key_end, $val_end ) = each( $block ) ) &&
|
209 |
+
( list( $key_begin, $val_begin ) = each( $block ) ) ) {
|
|
|
210 |
array_splice( $content, $key_begin, $key_end - $key_begin + 1 );
|
211 |
}
|
212 |
}
|
admin/includes/tab-accesslog.php
CHANGED
@@ -1,17 +1,15 @@
|
|
1 |
<?php
|
2 |
class IP_Geo_Block_Admin_Tab {
|
3 |
|
4 |
-
public static function tab_setup( $context ) {
|
5 |
-
$
|
6 |
-
$option_name = IP_Geo_Block::OPTION_NAME;
|
7 |
-
$settings = IP_Geo_Block::get_option();
|
8 |
|
9 |
register_setting(
|
10 |
-
$option_slug,
|
11 |
-
$option_name
|
12 |
);
|
13 |
|
14 |
-
if ( $
|
15 |
|
16 |
/*----------------------------------------*
|
17 |
* Validation logs
|
@@ -20,7 +18,7 @@ if ( $settings['validation']['reclogs'] ) :
|
|
20 |
add_settings_section(
|
21 |
$section,
|
22 |
__( 'Validation logs', 'ip-geo-block' ),
|
23 |
-
|
24 |
$option_slug
|
25 |
);
|
26 |
|
@@ -71,6 +69,25 @@ if ( $settings['validation']['reclogs'] ) :
|
|
71 |
)
|
72 |
);
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
else:
|
75 |
|
76 |
/*----------------------------------------*
|
@@ -104,30 +121,24 @@ endif;
|
|
104 |
* Function that fills the section with the desired content.
|
105 |
*
|
106 |
*/
|
107 |
-
public static function list_accesslog()
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
);
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
echo '<th data-hide="phone,tablet">', __( 'Request', 'ip-geo-block' ), '</th>', "\n";
|
126 |
-
echo '<th data-hide="all">', __( 'User agent', 'ip-geo-block' ), '</th>', "\n";
|
127 |
-
echo '<th data-hide="all">', __( 'HTTP headers', 'ip-geo-block' ), '</th>', "\n";
|
128 |
-
echo '<th data-hide="all">', __( '$_POST data', 'ip-geo-block' ), '</th>', "\n";
|
129 |
-
echo '</tr></thead><tbody id="', IP_Geo_Block::PLUGIN_NAME, '-log-', $key, '">', "\n";
|
130 |
-
echo <<<EOT
|
131 |
</tbody>
|
132 |
<tfoot class="hide-if-no-paging">
|
133 |
<tr>
|
@@ -139,7 +150,6 @@ endif;
|
|
139 |
</table>
|
140 |
|
141 |
EOT;
|
142 |
-
}
|
143 |
}
|
144 |
|
145 |
public static function warn_accesslog() {
|
1 |
<?php
|
2 |
class IP_Geo_Block_Admin_Tab {
|
3 |
|
4 |
+
public static function tab_setup( $context, $tab ) {
|
5 |
+
$options = IP_Geo_Block::get_option();
|
|
|
|
|
6 |
|
7 |
register_setting(
|
8 |
+
$option_slug = IP_Geo_Block::PLUGIN_NAME,
|
9 |
+
$option_name = IP_Geo_Block::OPTION_NAME
|
10 |
);
|
11 |
|
12 |
+
if ( $options['validation']['reclogs'] ) :
|
13 |
|
14 |
/*----------------------------------------*
|
15 |
* Validation logs
|
18 |
add_settings_section(
|
19 |
$section,
|
20 |
__( 'Validation logs', 'ip-geo-block' ),
|
21 |
+
NULL,
|
22 |
$option_slug
|
23 |
);
|
24 |
|
69 |
)
|
70 |
);
|
71 |
|
72 |
+
// same as in tab-settings.php
|
73 |
+
$dfn = __( '<dfn title="Validation log of request to %s.">%s</dfn>', 'ip-geo-block' );
|
74 |
+
$target = array(
|
75 |
+
'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
|
76 |
+
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
|
77 |
+
'login' => sprintf( $dfn, 'wp-login.php', __( 'Login form', 'ip-geo-block' ) ),
|
78 |
+
'admin' => sprintf( $dfn, 'wp-admin/*.php', __( 'Admin area', 'ip-geo-block' ) ),
|
79 |
+
'public' => sprintf( $dfn, __( 'public facing pages', 'ip-geo-block' ), __( 'Public facing pages', 'ip-geo-block' ) ),
|
80 |
+
);
|
81 |
+
|
82 |
+
foreach ( $target as $key => $val ) {
|
83 |
+
add_settings_section(
|
84 |
+
$key,
|
85 |
+
$val,
|
86 |
+
array( __CLASS__, 'accesslog_' . $key ),
|
87 |
+
$option_slug
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
else:
|
92 |
|
93 |
/*----------------------------------------*
|
121 |
* Function that fills the section with the desired content.
|
122 |
*
|
123 |
*/
|
124 |
+
public static function accesslog_comment() { self::list_accesslog( 'comment' ); }
|
125 |
+
public static function accesslog_xmlrpc () { self::list_accesslog( 'xmlrpc' ); }
|
126 |
+
public static function accesslog_login () { self::list_accesslog( 'login' ); }
|
127 |
+
public static function accesslog_admin () { self::list_accesslog( 'admin' ); }
|
128 |
+
public static function accesslog_public () { self::list_accesslog( 'public' ); }
|
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";
|
140 |
+
echo '</tr></thead><tbody id="', IP_Geo_Block::PLUGIN_NAME, '-log-', $key, '">', "\n";
|
141 |
+
echo <<<EOT
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
</tbody>
|
143 |
<tfoot class="hide-if-no-paging">
|
144 |
<tr>
|
150 |
</table>
|
151 |
|
152 |
EOT;
|
|
|
153 |
}
|
154 |
|
155 |
public static function warn_accesslog() {
|
admin/includes/tab-attribution.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
<?php
|
2 |
class IP_Geo_Block_Admin_Tab {
|
3 |
|
4 |
-
public static function tab_setup( $context ) {
|
5 |
-
$option_slug = IP_Geo_Block::PLUGIN_NAME;
|
6 |
-
$option_name = IP_Geo_Block::OPTION_NAME;
|
7 |
|
8 |
register_setting(
|
9 |
-
$option_slug,
|
10 |
-
$option_name
|
11 |
);
|
12 |
|
13 |
$section = IP_Geo_Block::PLUGIN_NAME . '-attribution';
|
|
|
|
|
14 |
add_settings_section(
|
15 |
$section,
|
16 |
__( 'Attribution links', 'ip-geo-block' ),
|
@@ -18,7 +18,6 @@ class IP_Geo_Block_Admin_Tab {
|
|
18 |
$option_slug
|
19 |
);
|
20 |
|
21 |
-
$field = 'attribution';
|
22 |
$providers = IP_Geo_Block_Provider::get_providers( 'link' );
|
23 |
|
24 |
foreach ( $providers as $provider => $key ) {
|
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 . '-attribution';
|
12 |
+
$field = 'attribution';
|
13 |
+
|
14 |
add_settings_section(
|
15 |
$section,
|
16 |
__( 'Attribution links', 'ip-geo-block' ),
|
18 |
$option_slug
|
19 |
);
|
20 |
|
|
|
21 |
$providers = IP_Geo_Block_Provider::get_providers( 'link' );
|
22 |
|
23 |
foreach ( $providers as $provider => $key ) {
|
admin/includes/tab-geolocation.php
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
<?php
|
2 |
class IP_Geo_Block_Admin_Tab {
|
3 |
|
4 |
-
public static function tab_setup( $context ) {
|
5 |
-
$option_slug = IP_Geo_Block::PLUGIN_NAME;
|
6 |
-
$option_name = IP_Geo_Block::OPTION_NAME;
|
7 |
$options = IP_Geo_Block::get_option();
|
8 |
|
9 |
register_setting(
|
10 |
-
$option_slug,
|
11 |
-
$option_name
|
12 |
);
|
13 |
|
14 |
/*----------------------------------------*
|
@@ -33,6 +31,10 @@ class IP_Geo_Block_Admin_Tab {
|
|
33 |
}
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
36 |
$field = 'service';
|
37 |
$provider = array_keys( $providers );
|
38 |
add_settings_field(
|
@@ -45,7 +47,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
45 |
'type' => 'select',
|
46 |
'option' => $option_name,
|
47 |
'field' => $field,
|
48 |
-
'value' => $provider[
|
49 |
'list' => $list,
|
50 |
)
|
51 |
);
|
1 |
<?php
|
2 |
class IP_Geo_Block_Admin_Tab {
|
3 |
|
4 |
+
public static function tab_setup( $context, $tab ) {
|
|
|
|
|
5 |
$options = IP_Geo_Block::get_option();
|
6 |
|
7 |
register_setting(
|
8 |
+
$option_slug = IP_Geo_Block::PLUGIN_NAME,
|
9 |
+
$option_name = IP_Geo_Block::OPTION_NAME
|
10 |
);
|
11 |
|
12 |
/*----------------------------------------*
|
31 |
}
|
32 |
}
|
33 |
|
34 |
+
// get selected item
|
35 |
+
$cookie = $context->get_cookie( IP_Geo_Block::PLUGIN_NAME );
|
36 |
+
$cookie = empty( $cookie[ $tab ] ) ? 0 : (int)end( $cookie[ $tab ] );
|
37 |
+
|
38 |
$field = 'service';
|
39 |
$provider = array_keys( $providers );
|
40 |
add_settings_field(
|
47 |
'type' => 'select',
|
48 |
'option' => $option_name,
|
49 |
'field' => $field,
|
50 |
+
'value' => $provider[ $cookie ],
|
51 |
'list' => $list,
|
52 |
)
|
53 |
);
|
admin/includes/tab-settings.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! function_exists( 'get_plugins' ) )
|
|
7 |
|
8 |
class IP_Geo_Block_Admin_Tab {
|
9 |
|
10 |
-
public static function tab_setup( $context ) {
|
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'
|
@@ -64,8 +64,8 @@ class IP_Geo_Block_Admin_Tab {
|
|
64 |
* @param array $args Additional arguments that are passed to the $callback function.
|
65 |
*/
|
66 |
|
67 |
-
// Get the country code
|
68 |
-
$key = IP_Geo_Block::get_geolocation( IP_Geo_Block::get_ip_address() );
|
69 |
|
70 |
$field = 'ip_client';
|
71 |
add_settings_field(
|
@@ -83,6 +83,27 @@ class IP_Geo_Block_Admin_Tab {
|
|
83 |
)
|
84 |
);
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
// If the matching rule is not initialized, then add a caution
|
87 |
$rule = array(
|
88 |
-1 => NULL,
|
@@ -92,8 +113,8 @@ class IP_Geo_Block_Admin_Tab {
|
|
92 |
|
93 |
$rule_desc = array(
|
94 |
__( 'Please select either “Whitelist” or “Blacklist”.', 'ip-geo-block' ),
|
95 |
-
__( '<dfn title="“Block by country” will be bypassed in case of empty.
|
96 |
-
__( '<dfn title="“Block by country” will be bypassed in case of empty.
|
97 |
);
|
98 |
|
99 |
$comma = array(
|
@@ -121,7 +142,6 @@ class IP_Geo_Block_Admin_Tab {
|
|
121 |
1 => __( 'A request from which the country code or IP address is in the blacklist will be blocked.', 'ip-geo-block' ),
|
122 |
),
|
123 |
'before' => '<input type="hidden" name="ip_geo_block_settings[version]" value="' . esc_html( $options['version'] ) . '" />',
|
124 |
-
'after' => '<div class="ip-geo-block-desc"></div>',
|
125 |
)
|
126 |
);
|
127 |
|
@@ -139,6 +159,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
139 |
'field' => $field,
|
140 |
'value' => $options[ $field ],
|
141 |
'after' => $comma[0],
|
|
|
142 |
)
|
143 |
);
|
144 |
|
@@ -155,6 +176,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
155 |
'field' => $field,
|
156 |
'value' => $options[ $field ],
|
157 |
'after' => $comma[0],
|
|
|
158 |
)
|
159 |
);
|
160 |
|
@@ -202,7 +224,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
202 |
$key = 'proxy';
|
203 |
add_settings_field(
|
204 |
$option_name.'_'.$field.'_'.$key,
|
205 |
-
__( '<dfn title="
|
206 |
array( $context, 'callback_field' ),
|
207 |
$option_slug,
|
208 |
$section,
|
@@ -212,6 +234,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
212 |
'field' => $field,
|
213 |
'sub-field' => $key,
|
214 |
'value' => $options[ $field ][ $key ],
|
|
|
215 |
'after' => $comma[0],
|
216 |
)
|
217 |
);
|
@@ -220,7 +243,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
220 |
$field = 'signature';
|
221 |
add_settings_field(
|
222 |
$option_name.'_'.$field,
|
223 |
-
__( '<dfn title="It validates malicious signatures independently of “Block by country” and “Prevent Zero-day Exploit” for the target “Admin area”, “Admin ajax/post”, “Plugins area” and “Themes area”.">Bad signatures in query</dfn> <nobr>(<a
|
224 |
array( $context, 'callback_field' ),
|
225 |
$option_slug,
|
226 |
$section,
|
@@ -233,6 +256,69 @@ class IP_Geo_Block_Admin_Tab {
|
|
233 |
)
|
234 |
);
|
235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
// Response code (RFC 2616)
|
237 |
$field = 'response_code';
|
238 |
add_settings_field(
|
@@ -267,16 +353,16 @@ class IP_Geo_Block_Admin_Tab {
|
|
267 |
$field = 'redirect_uri';
|
268 |
add_settings_field(
|
269 |
$option_name.'_'.$field,
|
270 |
-
__( '<dfn title="Specify the URL for response code 2xx and 3xx.
|
271 |
array( $context, 'callback_field' ),
|
272 |
$option_slug,
|
273 |
$section,
|
274 |
array(
|
275 |
-
'class' => 'ip-geo-block-hide',
|
276 |
'type' => 'text',
|
277 |
'option' => $option_name,
|
278 |
'field' => $field,
|
279 |
'value' => $options[ $field ],
|
|
|
280 |
)
|
281 |
);
|
282 |
|
@@ -289,11 +375,11 @@ class IP_Geo_Block_Admin_Tab {
|
|
289 |
$option_slug,
|
290 |
$section,
|
291 |
array(
|
292 |
-
'class' => 'ip-geo-block-hide',
|
293 |
'type' => 'text',
|
294 |
'option' => $option_name,
|
295 |
'field' => $field,
|
296 |
'value' => $options[ $field ],
|
|
|
297 |
)
|
298 |
);
|
299 |
|
@@ -301,7 +387,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
301 |
$field = 'login_fails';
|
302 |
add_settings_field(
|
303 |
$option_name.'_'.$field,
|
304 |
-
__( '<dfn title="
|
305 |
array( $context, 'callback_field' ),
|
306 |
$option_slug,
|
307 |
$section,
|
@@ -347,7 +433,6 @@ class IP_Geo_Block_Admin_Tab {
|
|
347 |
0 => __( 'Validate at “init” action hook in the same manner as typical plugins.', 'ip-geo-block' ),
|
348 |
1 => __( 'Validate at an earlier phase than other typical plugins. It can reduce load on server but has <a rel=\'noreferrer\' href=\'http://www.ipgeoblock.com/codex/validation-timing.html\' title=\'Validation timing | IP Geo Block\'>some restrictions</a>.', 'ip-geo-block' ),
|
349 |
),
|
350 |
-
'after' => '<div class="ip-geo-block-desc"></div>',
|
351 |
)
|
352 |
);
|
353 |
|
@@ -417,7 +502,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
417 |
$desc = array(
|
418 |
'login' => __( 'Log in' ),
|
419 |
'register' => __( 'Register' ),
|
420 |
-
'
|
421 |
'lostpassword' => __( 'Lost Password' ),
|
422 |
'postpass' => __( 'Password protected' ),
|
423 |
);
|
@@ -442,7 +527,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
442 |
'sub-field' => $key,
|
443 |
'value' => $options[ $field ][ $key ],
|
444 |
'text' => __( 'Block by country', 'ip-geo-block' ),
|
445 |
-
'after' => '<ul class="
|
446 |
)
|
447 |
);
|
448 |
|
@@ -504,8 +589,8 @@ class IP_Geo_Block_Admin_Tab {
|
|
504 |
unset( $installed['ip_geo_block'] );
|
505 |
|
506 |
$tmp = array(
|
507 |
-
__( 'for logged-in
|
508 |
-
__( 'for non logged-in
|
509 |
);
|
510 |
|
511 |
foreach ( $installed as $key => $val ) {
|
@@ -519,9 +604,11 @@ class IP_Geo_Block_Admin_Tab {
|
|
519 |
. '</li>' . "\n";
|
520 |
}
|
521 |
|
|
|
|
|
522 |
// Admin ajax/post
|
523 |
$key = 'ajax';
|
524 |
-
$val = esc_html( substr(
|
525 |
add_settings_field(
|
526 |
$option_name.'_'.$field.'_'.$key,
|
527 |
sprintf( $dfn, $val.'admin-(ajax|post).php', __( 'Admin ajax/post', 'ip-geo-block' ) ),
|
@@ -536,9 +623,9 @@ class IP_Geo_Block_Admin_Tab {
|
|
536 |
'value' => $options[ $field ][ $key ],
|
537 |
'list' => $list,
|
538 |
'desc' => $desc,
|
539 |
-
'after' => '<ul class="
|
540 |
-
. __( '<dfn title="
|
541 |
-
.
|
542 |
. '<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"
|
543 |
. $comma[0]
|
544 |
. '</li><li><ul id="ip-geo-block-actions">'
|
@@ -550,7 +637,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
550 |
|
551 |
array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
|
552 |
$desc = array(
|
553 |
-
__( 'Regardless of the country code, it will block a malicious request to <code>%s&
|
554 |
__( 'It configures “%s” to validate a request to the PHP file which does not load WordPress core.', 'ip-geo-block' ),
|
555 |
__( '<dfn title="Select the item which causes undesired blocking in order to exclude from the validation target. Grayed item indicates “INACTIVE”.">Exceptions</dfn>', 'ip-geo-block' ),
|
556 |
);
|
@@ -581,7 +668,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
581 |
|
582 |
// Plugins area
|
583 |
$key = 'plugins';
|
584 |
-
$val = esc_html(
|
585 |
$tmp = '<input type="checkbox" id="ip_geo_block_settings_rewrite_' . $key
|
586 |
. '" name="ip_geo_block_settings[rewrite][' . $key . ']" '
|
587 |
. ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
|
@@ -608,10 +695,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
608 |
2 => sprintf( $desc[0], $val ),
|
609 |
),
|
610 |
'before' => $tmp,
|
611 |
-
'after' => '<
|
612 |
-
. '<ul class="ip_geo_block_settings_folding ip-geo-block-dropup">' . $desc[2] . "<li style='display:none'><ul>\n"
|
613 |
-
. $exception
|
614 |
-
. "</ul></li></ul>\n",
|
615 |
)
|
616 |
);
|
617 |
|
@@ -634,7 +718,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
634 |
|
635 |
// Themes area
|
636 |
$key = 'themes';
|
637 |
-
$val = esc_html(
|
638 |
$tmp = '<input type="checkbox" id="ip_geo_block_settings_rewrite_' . $key
|
639 |
. '" name="ip_geo_block_settings[rewrite][' . $key . ']" '
|
640 |
. ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
|
@@ -661,10 +745,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
661 |
2 => sprintf( $desc[0], $val ),
|
662 |
),
|
663 |
'before' => $tmp,
|
664 |
-
'after' => '<
|
665 |
-
. '<ul class="ip_geo_block_settings_folding ip-geo-block-dropup">' . $desc[2] . "<li style='display:none'><ul>\n"
|
666 |
-
. $exception
|
667 |
-
. "</ul></li></ul>\n",
|
668 |
)
|
669 |
);
|
670 |
|
@@ -734,6 +815,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
734 |
'sub-field' => $key,
|
735 |
'value' => $options[ $field ][ $key ],
|
736 |
'after' => $comma[0],
|
|
|
737 |
)
|
738 |
);
|
739 |
|
@@ -751,11 +833,80 @@ class IP_Geo_Block_Admin_Tab {
|
|
751 |
'sub-field' => $key,
|
752 |
'value' => $options[ $field ][ $key ],
|
753 |
'after' => $comma[0],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
754 |
)
|
755 |
);
|
756 |
|
757 |
// List of page
|
758 |
-
$exception = '<ul class="
|
759 |
$tmp = get_pages();
|
760 |
if ( ! empty( $tmp ) ) {
|
761 |
foreach ( $tmp as $key ) {
|
@@ -767,7 +918,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
767 |
$exception .= '</ul></li></ul>' . "\n";
|
768 |
|
769 |
// List of post type
|
770 |
-
$exception .= '<ul class="
|
771 |
$tmp = get_post_types( array( 'public' => TRUE ) );
|
772 |
if ( ! empty( $tmp ) ) {
|
773 |
foreach ( $tmp as $key ) {
|
@@ -779,7 +930,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
779 |
$exception .= '</ul></li></ul>' . "\n";
|
780 |
|
781 |
// List of category
|
782 |
-
$exception .= '<ul class="
|
783 |
$tmp = get_categories( array( 'hide_empty' => FALSE ) );
|
784 |
if ( ! empty( $tmp ) ) {
|
785 |
foreach ( $tmp as $key ) {
|
@@ -791,7 +942,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
791 |
$exception .= '</ul></li></ul>' . "\n";
|
792 |
|
793 |
// List of tag
|
794 |
-
$exception .= '<ul class="
|
795 |
$tmp = get_tags( array( 'hide_empty' => FALSE ) );
|
796 |
if ( ! empty( $tmp ) ) {
|
797 |
foreach ( $tmp as $key ) {
|
@@ -823,7 +974,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
823 |
'desc' => array(
|
824 |
1 => __( "Notice that “Validation timing” is deferred till “wp” action hook. It means that this feature would not be compatible with any page caching.", 'ip-geo-block' ),
|
825 |
),
|
826 |
-
'after' =>
|
827 |
)
|
828 |
);
|
829 |
|
@@ -865,6 +1016,23 @@ if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
|
|
865 |
);
|
866 |
endif;
|
867 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
868 |
// Simulation mode
|
869 |
$key = 'simulate';
|
870 |
add_settings_field(
|
@@ -911,15 +1079,33 @@ endif;
|
|
911 |
)
|
912 |
);
|
913 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
914 |
/*----------------------------------------*
|
915 |
* Local database settings
|
916 |
*----------------------------------------*/
|
917 |
-
//
|
918 |
$providers = IP_Geo_Block_Provider::get_addons();
|
919 |
if ( empty( $providers ) ) {
|
920 |
$context->add_admin_notice( 'error',
|
921 |
sprintf(
|
922 |
-
__( 'Can not find geolocation API libraries in <code>%s</code>. It seems to have failed downloading <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip" title="Download the contents of tokkonopapa/WordPress-IP-Geo-API as a zip file">ZIP file</a> from <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API" title="tokkonopapa/WordPress-IP-Geo-API - GitHub">WordPress-IP-Geo-API</a>. Please
|
923 |
apply_filters( 'ip-geo-block-api-dir', basename( WP_CONTENT_DIR ) )
|
924 |
)
|
925 |
);
|
@@ -933,7 +1119,6 @@ endif;
|
|
933 |
$option_slug
|
934 |
);
|
935 |
|
936 |
-
// Local DBs for each API
|
937 |
foreach ( $providers as $provider ) {
|
938 |
if ( $geo = IP_Geo_Block_API::get_instance( $provider, NULL ) ) {
|
939 |
$geo->add_settings_field(
|
@@ -1073,7 +1258,7 @@ endif;
|
|
1073 |
// $_POST keys to be recorded with their values in logs
|
1074 |
add_settings_field(
|
1075 |
$option_name.'_'.$field.'_postkey',
|
1076 |
-
__( '<dfn title="e.g. action, comment, log, pwd">$_POST keys to be recorded with their values in logs</dfn>', 'ip-geo-block' ),
|
1077 |
array( $context, 'callback_field' ),
|
1078 |
$option_slug,
|
1079 |
$section,
|
@@ -1279,8 +1464,8 @@ endif;
|
|
1279 |
array(
|
1280 |
'type' => 'none',
|
1281 |
'before' =>
|
1282 |
-
'<a class="button button-secondary" id="ip-geo-block-
|
1283 |
-
'<a class="button button-secondary" id="ip-geo-block-
|
1284 |
'after' => '<div id="ip-geo-block-pre-defined"></div>',
|
1285 |
)
|
1286 |
);
|
@@ -1339,8 +1524,10 @@ endif;
|
|
1339 |
}
|
1340 |
|
1341 |
/**
|
1342 |
-
* Subsidiary note
|
1343 |
*
|
|
|
|
|
1344 |
*/
|
1345 |
public static function note_target() {
|
1346 |
echo
|
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'
|
64 |
* @param array $args Additional arguments that are passed to the $callback function.
|
65 |
*/
|
66 |
|
67 |
+
// Get the country code of client
|
68 |
+
$key = IP_Geo_Block::get_geolocation( $val = IP_Geo_Block::get_ip_address() );
|
69 |
|
70 |
$field = 'ip_client';
|
71 |
add_settings_field(
|
83 |
)
|
84 |
);
|
85 |
|
86 |
+
if ( $key = IP_Geo_Block_Util::get_server_ip() && $key !== $val && ! IP_Geo_Block_Util::is_private_ip( $key ) ):
|
87 |
+
// Get the country code of server
|
88 |
+
$key = IP_Geo_Block::get_geolocation( $_SERVER['SERVER_ADDR'] );
|
89 |
+
|
90 |
+
$field = 'ip_server';
|
91 |
+
add_settings_field(
|
92 |
+
$option_name.'_'.$field,
|
93 |
+
__( '<dfn title="You can confirm the appropriate Geolocation APIs and country code by referring “Scan country code”.">Server IP address / Country</dfn>', 'ip-geo-block' ),
|
94 |
+
array( $context, 'callback_field' ),
|
95 |
+
$option_slug,
|
96 |
+
$section,
|
97 |
+
array(
|
98 |
+
'type' => 'html',
|
99 |
+
'option' => $option_name,
|
100 |
+
'field' => $field,
|
101 |
+
'value' => '<span class="ip-geo-block-ip-addr">' . esc_html( $key['ip'] . ' / ' . ( $key['code'] && isset( $key['provider'] ) ? $key['code'] . ' (' . $key['provider'] . ')' : __( 'UNKNOWN', 'ip-geo-block' ) ) ) . '</span>',
|
102 |
+
'after' => ' <a class="button button-secondary" id="ip-geo-block-scan-' . $field . '" title="' . __( 'Scan all the APIs you selected at Geolocation API settings', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Scan country code', 'ip-geo-block' ) . '</a><div id="ip-geo-block-scanning-' . $field . '"></div>',
|
103 |
+
)
|
104 |
+
);
|
105 |
+
endif;
|
106 |
+
|
107 |
// If the matching rule is not initialized, then add a caution
|
108 |
$rule = array(
|
109 |
-1 => NULL,
|
113 |
|
114 |
$rule_desc = array(
|
115 |
__( 'Please select either “Whitelist” or “Blacklist”.', 'ip-geo-block' ),
|
116 |
+
__( '<dfn title="“Block by country” will be bypassed in case of empty. The special code “XX” is assigned as private IP address including localhost. And “ZZ” is for unknown IP address (i.e. not in the geolocation databases). Please use “YY” if you need the code that does not correspond to any of the countries.">Whitelist of country code</dfn>', 'ip-geo-block' ) . '<br />(<a rel="noreferrer" href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" title="ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia">ISO 3166-1 alpha-2</a>)',
|
117 |
+
__( '<dfn title="“Block by country” will be bypassed in case of empty. The special code “XX” is assigned as private IP address including localhost. And “ZZ” is for unknown IP address (i.e. not in the geolocation databases). Please use “YY” if you need the code that does not correspond to any of the countries.">Blacklist of country code</dfn>', 'ip-geo-block' ) . '<br />(<a rel="noreferrer" href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" title="ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia">ISO 3166-1 alpha-2</a>)',
|
118 |
);
|
119 |
|
120 |
$comma = array(
|
142 |
1 => __( 'A request from which the country code or IP address is in the blacklist will be blocked.', 'ip-geo-block' ),
|
143 |
),
|
144 |
'before' => '<input type="hidden" name="ip_geo_block_settings[version]" value="' . esc_html( $options['version'] ) . '" />',
|
|
|
145 |
)
|
146 |
);
|
147 |
|
159 |
'field' => $field,
|
160 |
'value' => $options[ $field ],
|
161 |
'after' => $comma[0],
|
162 |
+
'class' => $options['matching_rule'] == 0 ? '' : 'ip-geo-block-hide',
|
163 |
)
|
164 |
);
|
165 |
|
176 |
'field' => $field,
|
177 |
'value' => $options[ $field ],
|
178 |
'after' => $comma[0],
|
179 |
+
'class' => $options['matching_rule'] == 1 ? '' : 'ip-geo-block-hide',
|
180 |
)
|
181 |
);
|
182 |
|
224 |
$key = 'proxy';
|
225 |
add_settings_field(
|
226 |
$option_name.'_'.$field.'_'.$key,
|
227 |
+
__( '<dfn title="If your server is placed behind the proxy server or the load balancing server, you need to put the appropriate key such as “HTTP_X_FORWARDED_FOR”, “HTTP_X_REAL_IP” or something like that to retrieve the client IP address.">$_SERVER keys to retrieve extra IP addresses</dfn>', 'ip-geo-block' ),
|
228 |
array( $context, 'callback_field' ),
|
229 |
$option_slug,
|
230 |
$section,
|
234 |
'field' => $field,
|
235 |
'sub-field' => $key,
|
236 |
'value' => $options[ $field ][ $key ],
|
237 |
+
'placeholder' => IP_Geo_Block_Util::get_proxy_var(),
|
238 |
'after' => $comma[0],
|
239 |
)
|
240 |
);
|
243 |
$field = 'signature';
|
244 |
add_settings_field(
|
245 |
$option_name.'_'.$field,
|
246 |
+
__( '<dfn title="It validates malicious signatures independently of “Block by country” and “Prevent Zero-day Exploit” for the target “Admin area”, “Admin ajax/post”, “Plugins area” and “Themes area”.">Bad signatures in query</dfn> <nobr>(<a class="ip-geo-block-cycle" id="ip-geo-block-decode" title="When you find ugly character string in the text area, please click to restore."><span></span></a>)</nobr>', 'ip-geo-block' ),
|
247 |
array( $context, 'callback_field' ),
|
248 |
$option_slug,
|
249 |
$section,
|
256 |
)
|
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 ) {
|
264 |
+
$key = esc_attr( $key );
|
265 |
+
$val = esc_attr( $val );
|
266 |
+
$list .= '<li><input type="checkbox" id="ip_geo_block_settings_mimetype_white_list' . $key . '" name="ip_geo_block_settings[mimetype][white_list][' . $key . ']" value="' . $val . '"' . checked( isset( $options['mimetype']['white_list'][ $key ] ), TRUE, FALSE ) . '><label for="ip_geo_block_settings_mimetype_white_list' . $key . '"><dfn title="' . $val . '">' . $key . '</dfn></label></li>' . "\n";
|
267 |
+
}
|
268 |
+
$list .= "</ul></li></ul>\n";
|
269 |
+
|
270 |
+
// Prevent malicious upload - black list of file extension
|
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 “mu-plugins” (ip-geo-block-mu.php) at “Validation timing” 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,
|
282 |
+
array(
|
283 |
+
'type' => 'select',
|
284 |
+
'option' => $option_name,
|
285 |
+
'field' => $field,
|
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(
|
353 |
$field = 'redirect_uri';
|
354 |
add_settings_field(
|
355 |
$option_name.'_'.$field,
|
356 |
+
__( '<dfn title="Specify the URL for response code 2xx and 3xx. If it is pointed to a public facing page, visitors would not be blocked on the page to prevent loop of redirection even when you enable [Block by country] in [Front-end target settings] section. Empty URL is altered to your home.">Redirect URL</dfn>', 'ip-geo-block' ),
|
357 |
array( $context, 'callback_field' ),
|
358 |
$option_slug,
|
359 |
$section,
|
360 |
array(
|
|
|
361 |
'type' => 'text',
|
362 |
'option' => $option_name,
|
363 |
'field' => $field,
|
364 |
'value' => $options[ $field ],
|
365 |
+
'class' => $options['response_code'] < 400 ? '' : 'ip-geo-block-hide',
|
366 |
)
|
367 |
);
|
368 |
|
375 |
$option_slug,
|
376 |
$section,
|
377 |
array(
|
|
|
378 |
'type' => 'text',
|
379 |
'option' => $option_name,
|
380 |
'field' => $field,
|
381 |
'value' => $options[ $field ],
|
382 |
+
'class' => $options['response_code'] >= 400 ? '' : 'ip-geo-block-hide',
|
383 |
)
|
384 |
);
|
385 |
|
387 |
$field = 'login_fails';
|
388 |
add_settings_field(
|
389 |
$option_name.'_'.$field,
|
390 |
+
__( '<dfn title="This is applied to “XML-RPC” and “Login form”. Lockout period is defined as expiration time at “Cache settings”.">Max number of failed login attempts per IP address</dfn>', 'ip-geo-block' ),
|
391 |
array( $context, 'callback_field' ),
|
392 |
$option_slug,
|
393 |
$section,
|
433 |
0 => __( 'Validate at “init” action hook in the same manner as typical plugins.', 'ip-geo-block' ),
|
434 |
1 => __( 'Validate at an earlier phase than other typical plugins. It can reduce load on server but has <a rel=\'noreferrer\' href=\'http://www.ipgeoblock.com/codex/validation-timing.html\' title=\'Validation timing | IP Geo Block\'>some restrictions</a>.', 'ip-geo-block' ),
|
435 |
),
|
|
|
436 |
)
|
437 |
);
|
438 |
|
502 |
$desc = array(
|
503 |
'login' => __( 'Log in' ),
|
504 |
'register' => __( 'Register' ),
|
505 |
+
'resetpass' => __( 'Password Reset' ),
|
506 |
'lostpassword' => __( 'Lost Password' ),
|
507 |
'postpass' => __( 'Password protected' ),
|
508 |
);
|
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 |
|
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 ) {
|
604 |
. '</li>' . "\n";
|
605 |
}
|
606 |
|
607 |
+
$path = IP_Geo_Block::get_wp_path();
|
608 |
+
|
609 |
// Admin ajax/post
|
610 |
$key = 'ajax';
|
611 |
+
$val = esc_html( substr( $path['admin'], 1 ) );
|
612 |
add_settings_field(
|
613 |
$option_name.'_'.$field.'_'.$key,
|
614 |
sprintf( $dfn, $val.'admin-(ajax|post).php', __( 'Admin ajax/post', 'ip-geo-block' ) ),
|
623 |
'value' => $options[ $field ][ $key ],
|
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 (“page=…”) or the action name (“action=…”) to prevent undesired blocking caused by “Block by country” for non logged-in user and “Prevent Zero-day Exploit” 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]
|
631 |
. '</li><li><ul id="ip-geo-block-actions">'
|
637 |
|
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⋯/*.php</code>.', 'ip-geo-block' ),
|
641 |
__( 'It configures “%s” 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 “INACTIVE”.">Exceptions</dfn>', 'ip-geo-block' ),
|
643 |
);
|
668 |
|
669 |
// Plugins area
|
670 |
$key = 'plugins';
|
671 |
+
$val = esc_html( $path[ $key ] );
|
672 |
$tmp = '<input type="checkbox" id="ip_geo_block_settings_rewrite_' . $key
|
673 |
. '" name="ip_geo_block_settings[rewrite][' . $key . ']" '
|
674 |
. ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
|
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 |
|
718 |
|
719 |
// Themes area
|
720 |
$key = 'themes';
|
721 |
+
$val = esc_html( $path[ $key ] );
|
722 |
$tmp = '<input type="checkbox" id="ip_geo_block_settings_rewrite_' . $key
|
723 |
. '" name="ip_geo_block_settings[rewrite][' . $key . ']" '
|
724 |
. ' value="1"' . checked( $options['rewrite'][ $key ], TRUE, FALSE )
|
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 |
|
815 |
'sub-field' => $key,
|
816 |
'value' => $options[ $field ][ $key ],
|
817 |
'after' => $comma[0],
|
818 |
+
'class' => $options[ $field ]['matching_rule'] == 0 ? '' : 'ip-geo-block-hide',
|
819 |
)
|
820 |
);
|
821 |
|
833 |
'sub-field' => $key,
|
834 |
'value' => $options[ $field ][ $key ],
|
835 |
'after' => $comma[0],
|
836 |
+
'class' => $options[ $field ]['matching_rule'] == 1 ? '' : 'ip-geo-block-hide',
|
837 |
+
)
|
838 |
+
);
|
839 |
+
|
840 |
+
// Response code (RFC 2616)
|
841 |
+
$key = 'response_code';
|
842 |
+
add_settings_field(
|
843 |
+
$option_name.'_'.$field.'_'.$key,
|
844 |
+
sprintf( __( '<dfn title="You can configure a different response code from the Back-end. This is useful to prevent violation against your affiliate program.">Response code</dfn> %s', 'ip-geo-block' ), '(<a rel="noreferrer" href="http://tools.ietf.org/html/rfc2616#section-10" title="RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1">RFC 2616</a>)' ),
|
845 |
+
array( $context, 'callback_field' ),
|
846 |
+
$option_slug,
|
847 |
+
$section,
|
848 |
+
array(
|
849 |
+
'type' => 'select',
|
850 |
+
'option' => $option_name,
|
851 |
+
'field' => $field,
|
852 |
+
'sub-field' => $key,
|
853 |
+
'value' => $options[ $field ][ $key ],
|
854 |
+
'list' => array(
|
855 |
+
200 => '200 OK',
|
856 |
+
301 => '301 Moved Permanently',
|
857 |
+
302 => '302 Found',
|
858 |
+
303 => '303 See Other',
|
859 |
+
307 => '307 Temporary Redirect',
|
860 |
+
400 => '400 Bad Request',
|
861 |
+
403 => '403 Forbidden',
|
862 |
+
404 => '404 Not Found',
|
863 |
+
406 => '406 Not Acceptable',
|
864 |
+
410 => '410 Gone',
|
865 |
+
500 => '500 Internal Server Error',
|
866 |
+
503 => '503 Service Unavailable',
|
867 |
+
),
|
868 |
+
'class' => $options[ $field ]['matching_rule'] == -1 ? 'ip-geo-block-hide' :'',
|
869 |
+
)
|
870 |
+
);
|
871 |
+
|
872 |
+
// Redirect URI
|
873 |
+
$key = 'redirect_uri';
|
874 |
+
add_settings_field(
|
875 |
+
$option_name.'_'.$field.'_'.$key,
|
876 |
+
__( '<dfn title="Specify the URL for response code 2xx and 3xx. If it is pointed to a public facing page, visitors would not be blocked on the page to prevent loop of redirection even when you enable [Block by country] in [Front-end target settings] section. Empty URL is altered to your home.">Redirect URL</dfn>', 'ip-geo-block' ),
|
877 |
+
array( $context, 'callback_field' ),
|
878 |
+
$option_slug,
|
879 |
+
$section,
|
880 |
+
array(
|
881 |
+
'type' => 'text',
|
882 |
+
'option' => $option_name,
|
883 |
+
'field' => $field,
|
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 |
+
|
890 |
+
// Response message
|
891 |
+
$key = 'response_msg';
|
892 |
+
add_settings_field(
|
893 |
+
$option_name.'_'.$field.'_'.$key,
|
894 |
+
__( '<dfn title="Specify the message for response code 4xx and 5xx.">Response message</dfn>', 'ip-geo-block' ),
|
895 |
+
array( $context, 'callback_field' ),
|
896 |
+
$option_slug,
|
897 |
+
$section,
|
898 |
+
array(
|
899 |
+
'type' => 'text',
|
900 |
+
'option' => $option_name,
|
901 |
+
'field' => $field,
|
902 |
+
'sub-field' => $key,
|
903 |
+
'value' => $options[ $field ][ $key ],
|
904 |
+
'class' => $options[ $field ]['matching_rule'] != -1 && $options[ $field ]['response_code'] >= 400 ? '' : 'ip-geo-block-hide',
|
905 |
)
|
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 |
$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 |
$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 |
$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 ) {
|
974 |
'desc' => array(
|
975 |
1 => __( "Notice that “Validation timing” is deferred till “wp” action hook. It means that this feature would not be compatible with any page caching.", 'ip-geo-block' ),
|
976 |
),
|
977 |
+
'after' => $exception,
|
978 |
)
|
979 |
);
|
980 |
|
1016 |
);
|
1017 |
endif;
|
1018 |
|
1019 |
+
// DNS reverse lookup
|
1020 |
+
$key = 'dnslkup';
|
1021 |
+
add_settings_field(
|
1022 |
+
$option_name.'_'.$field.'_'.$key,
|
1023 |
+
'<dfn title="' . __( 'It enables to verify the host by reverse DNS lookup which would spend some server resources. If it is disabled, “HOST” and “HOST=…”in “UA string and qualification” will always return “true”.', 'ip-geo-block' ) . '">' . __( 'DNS reverse lookup', 'ip-geo-block' ) . '</dfn>',
|
1024 |
+
array( $context, 'callback_field' ),
|
1025 |
+
$option_slug,
|
1026 |
+
$section,
|
1027 |
+
array(
|
1028 |
+
'type' => 'checkbox',
|
1029 |
+
'option' => $option_name,
|
1030 |
+
'field' => $field,
|
1031 |
+
'sub-field' => $key,
|
1032 |
+
'value' => $options[ $field ][ $key ],
|
1033 |
+
)
|
1034 |
+
);
|
1035 |
+
|
1036 |
// Simulation mode
|
1037 |
$key = 'simulate';
|
1038 |
add_settings_field(
|
1079 |
)
|
1080 |
);
|
1081 |
|
1082 |
+
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
|
1083 |
+
// Timeout for network API
|
1084 |
+
$field = 'timeout';
|
1085 |
+
add_settings_field(
|
1086 |
+
$option_name.'_'.$field,
|
1087 |
+
__( 'Timeout for network API [sec]', 'ip-geo-block' ),
|
1088 |
+
array( $context, 'callback_field' ),
|
1089 |
+
$option_slug,
|
1090 |
+
$section,
|
1091 |
+
array(
|
1092 |
+
'type' => 'text',
|
1093 |
+
'option' => $option_name,
|
1094 |
+
'field' => $field,
|
1095 |
+
'value' => $options[ $field ],
|
1096 |
+
)
|
1097 |
+
);
|
1098 |
+
endif;
|
1099 |
+
|
1100 |
/*----------------------------------------*
|
1101 |
* Local database settings
|
1102 |
*----------------------------------------*/
|
1103 |
+
// Local DBs for each API
|
1104 |
$providers = IP_Geo_Block_Provider::get_addons();
|
1105 |
if ( empty( $providers ) ) {
|
1106 |
$context->add_admin_notice( 'error',
|
1107 |
sprintf(
|
1108 |
+
__( 'Can not find geolocation API libraries in <code>%s</code>. It seems to have failed downloading <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip" title="Download the contents of tokkonopapa/WordPress-IP-Geo-API as a zip file">ZIP file</a> from <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API" title="tokkonopapa/WordPress-IP-Geo-API - GitHub">WordPress-IP-Geo-API</a>. Please install <code>ip-geo-api</code> with write permission according to <a rel="noreferrer" href="http://www.ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How can I fix permission troubles? | IP Geo Block">this instruction</a>.', 'ip-geo-block' ),
|
1109 |
apply_filters( 'ip-geo-block-api-dir', basename( WP_CONTENT_DIR ) )
|
1110 |
)
|
1111 |
);
|
1119 |
$option_slug
|
1120 |
);
|
1121 |
|
|
|
1122 |
foreach ( $providers as $provider ) {
|
1123 |
if ( $geo = IP_Geo_Block_API::get_instance( $provider, NULL ) ) {
|
1124 |
$geo->add_settings_field(
|
1258 |
// $_POST keys to be recorded with their values in logs
|
1259 |
add_settings_field(
|
1260 |
$option_name.'_'.$field.'_postkey',
|
1261 |
+
__( '<dfn title="e.g. action, comment, log, pwd, FILES">$_POST keys to be recorded with their values in logs</dfn>', 'ip-geo-block' ),
|
1262 |
array( $context, 'callback_field' ),
|
1263 |
$option_slug,
|
1264 |
$section,
|
1464 |
array(
|
1465 |
'type' => 'none',
|
1466 |
'before' =>
|
1467 |
+
'<a class="button button-secondary" id="ip-geo-block-default" title="' . __( 'Import the default settings to revert to the “Right after installing” state', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Default settings', 'ip-geo-block' ) . '</a> ' .
|
1468 |
+
'<a class="button button-secondary" id="ip-geo-block-preferred" title="' . __( 'Import the preferred settings mainly by enabling Zero-day Exploit Prevention for the “Back-end target settings”', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Best for Back-end', 'ip-geo-block' ) . '</a>',
|
1469 |
'after' => '<div id="ip-geo-block-pre-defined"></div>',
|
1470 |
)
|
1471 |
);
|
1524 |
}
|
1525 |
|
1526 |
/**
|
1527 |
+
* Subsidiary note for the sections
|
1528 |
*
|
1529 |
+
* @param array $section settings of section added to admin pages
|
1530 |
+
* @param bool $stat TRUE:open ('o') or FALSE:close ('x')
|
1531 |
*/
|
1532 |
public static function note_target() {
|
1533 |
echo
|
admin/includes/tab-statistics.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
class IP_Geo_Block_Admin_Tab {
|
3 |
|
4 |
-
public static function tab_setup( $context ) {
|
5 |
$plugin_slug = IP_Geo_Block::PLUGIN_NAME;
|
6 |
$option_slug = IP_Geo_Block::PLUGIN_NAME;
|
7 |
$option_name = IP_Geo_Block::OPTION_NAME;
|
@@ -16,7 +16,7 @@ class IP_Geo_Block_Admin_Tab {
|
|
16 |
if ( $options['save_statistics'] ) :
|
17 |
|
18 |
/*----------------------------------------*
|
19 |
-
* Statistics of
|
20 |
*----------------------------------------*/
|
21 |
$section = $plugin_slug . '-statistics';
|
22 |
add_settings_section(
|
@@ -38,22 +38,21 @@ if ( $options['save_statistics'] ) :
|
|
38 |
'type' => 'html',
|
39 |
'option' => $option_name,
|
40 |
'field' => $field,
|
41 |
-
'value' =>
|
42 |
)
|
43 |
);
|
44 |
|
45 |
// Blocked by countries
|
46 |
-
$
|
47 |
-
$html = '<div id="'.$plugin_slug.'-chart-countries"></div>';
|
48 |
-
$html .= '<ul id="'.$plugin_slug.'-countries" class="'.$option_slug.'-'.$field.'">';
|
49 |
|
50 |
arsort( $statistics['countries'] );
|
51 |
foreach ( $statistics['countries'] as $key => $val ) {
|
52 |
-
$
|
53 |
}
|
54 |
|
55 |
-
$html
|
56 |
|
|
|
57 |
add_settings_field(
|
58 |
$option_name.'_'.$field,
|
59 |
__( 'Blocked by countries', 'ip-geo-block' ),
|
@@ -68,30 +67,33 @@ if ( $options['save_statistics'] ) :
|
|
68 |
)
|
69 |
);
|
70 |
|
71 |
-
// Blocked
|
72 |
-
$
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
$prev = 0;
|
76 |
-
$
|
|
|
|
|
77 |
foreach ( $statistics['daystats'] as $key => $val ) {
|
78 |
-
while( $prev && $key - $prev > DAY_IN_SECONDS ) {
|
79 |
-
$prev += DAY_IN_SECONDS;
|
80 |
-
$html .= '<tr><td>' . IP_Geo_Block_Util::localdate( $prev, 'Y-m-d' ) . '</td>'; // must be ISO 8601 or RFC 2822
|
81 |
-
foreach ( $targets as $target ) {
|
82 |
-
$html .= '<td>0</td>';
|
83 |
-
}
|
84 |
}
|
85 |
-
$
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
}
|
90 |
-
$html .= '</tr>';
|
91 |
}
|
92 |
|
93 |
-
|
|
|
94 |
|
|
|
95 |
add_settings_field(
|
96 |
$option_name.'_'.$field,
|
97 |
__( 'Blocked per day', 'ip-geo-block' ),
|
@@ -202,12 +204,12 @@ else:
|
|
202 |
endif;
|
203 |
|
204 |
/*----------------------------------------*
|
205 |
-
* Statistics
|
206 |
*----------------------------------------*/
|
207 |
$section = $plugin_slug . '-cache';
|
208 |
add_settings_section(
|
209 |
$section,
|
210 |
-
__( 'Statistics
|
211 |
NULL, // array( $context, 'callback_cache_stat' ),
|
212 |
$option_slug
|
213 |
);
|
1 |
<?php
|
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;
|
16 |
if ( $options['save_statistics'] ) :
|
17 |
|
18 |
/*----------------------------------------*
|
19 |
+
* Statistics of validation
|
20 |
*----------------------------------------*/
|
21 |
$section = $plugin_slug . '-statistics';
|
22 |
add_settings_section(
|
38 |
'type' => 'html',
|
39 |
'option' => $option_name,
|
40 |
'field' => $field,
|
41 |
+
'value' => (int)$statistics[ $field ],
|
42 |
)
|
43 |
);
|
44 |
|
45 |
// Blocked by countries
|
46 |
+
$count = array();
|
|
|
|
|
47 |
|
48 |
arsort( $statistics['countries'] );
|
49 |
foreach ( $statistics['countries'] as $key => $val ) {
|
50 |
+
$count[] = array( esc_html( $key ), (int)$val );
|
51 |
}
|
52 |
|
53 |
+
$html = '<div id="' . $plugin_slug . '-chart-countries" data-' . $plugin_slug . '-chart-countries=\'' . json_encode( $count ) . '\'></div>';
|
54 |
|
55 |
+
$field = 'countries';
|
56 |
add_settings_field(
|
57 |
$option_name.'_'.$field,
|
58 |
__( 'Blocked by countries', 'ip-geo-block' ),
|
67 |
)
|
68 |
);
|
69 |
|
70 |
+
// Blocked hooks by date
|
71 |
+
$zero = array(
|
72 |
+
'comment' => 0,
|
73 |
+
'xmlrpc' => 0,
|
74 |
+
'login' => 0,
|
75 |
+
'admin' => 0,
|
76 |
+
'public' => 0,
|
77 |
+
);
|
78 |
|
79 |
$prev = 0;
|
80 |
+
$count = array();
|
81 |
+
|
82 |
+
// make array( `time`, `comment`, `xlmrpc`, `login`, `admin`, `public` )
|
83 |
foreach ( $statistics['daystats'] as $key => $val ) {
|
84 |
+
while ( $prev && $key - $prev > DAY_IN_SECONDS ) {
|
85 |
+
$count[] = array( $prev += DAY_IN_SECONDS, 0, 0, 0, 0, 0 );
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
+
$count[] = array_merge(
|
88 |
+
array( $prev = $key ),
|
89 |
+
array_values( array_merge( $zero, $val ) )
|
90 |
+
);
|
|
|
|
|
91 |
}
|
92 |
|
93 |
+
// embed array into data attribute as json
|
94 |
+
$html = '<div id="' . $plugin_slug . '-chart-daily" data-' . $plugin_slug . '-chart-daily=\'' . json_encode( $count ) . '\'></div>';
|
95 |
|
96 |
+
$field = 'daily';
|
97 |
add_settings_field(
|
98 |
$option_name.'_'.$field,
|
99 |
__( 'Blocked per day', 'ip-geo-block' ),
|
204 |
endif;
|
205 |
|
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
|
215 |
);
|
admin/js/admin.js
CHANGED
@@ -15,12 +15,13 @@ var ip_geo_block_time = new Date();
|
|
15 |
'#': '#ip-geo-block-',
|
16 |
'@': '#ip_geo_block_settings_',
|
17 |
'$': 'ip-geo-block-',
|
18 |
-
'%': 'ip_geo_block_'
|
|
|
19 |
};
|
20 |
return 'undefined' !== typeof id ? keys[selector] + id : keys.$ + selector;
|
21 |
}
|
22 |
|
23 |
-
function
|
24 |
return str ? str.toString().replace(/[&<>"']/g, function (match) {
|
25 |
return {
|
26 |
'&': '&',
|
@@ -41,13 +42,13 @@ var ip_geo_block_time = new Date();
|
|
41 |
}
|
42 |
|
43 |
function confirm(msg, callback) {
|
44 |
-
if (window.confirm(
|
45 |
callback();
|
46 |
}
|
47 |
}
|
48 |
|
49 |
function warning(status, msg) {
|
50 |
-
window.alert(status ?
|
51 |
}
|
52 |
|
53 |
function notice_html5() {
|
@@ -56,12 +57,7 @@ var ip_geo_block_time = new Date();
|
|
56 |
|
57 |
function redirect(page, tab) {
|
58 |
if (-1 !== location.href.indexOf(page)) {
|
59 |
-
|
60 |
-
if (typeof IP_GEO_BLOCK_ZEP === 'undefined') {
|
61 |
-
window.location.href = url;
|
62 |
-
} else {
|
63 |
-
IP_GEO_BLOCK_ZEP.redirect(url);
|
64 |
-
}
|
65 |
}
|
66 |
}
|
67 |
|
@@ -115,6 +111,12 @@ var ip_geo_block_time = new Date();
|
|
115 |
});
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
// Show/Hide description of WP-ZEP
|
119 |
function show_description(select) {
|
120 |
var data, desc = ID('.', 'desc');
|
@@ -130,19 +132,18 @@ var ip_geo_block_time = new Date();
|
|
130 |
if (stat) {
|
131 |
obj.removeClass('folding-disable');
|
132 |
} else {
|
133 |
-
obj.children('li').hide();
|
134 |
obj.addClass('folding-disable');
|
135 |
obj.removeClass(ID('dropdown')).addClass(ID('dropup'));
|
136 |
}
|
137 |
}
|
138 |
|
139 |
// Show/Hide folding list
|
140 |
-
function show_folding_list($this, element,
|
141 |
-
var stat =
|
142 |
-
|
143 |
-
stat |= (0 === $this.prop('type').indexOf('select' ) && '0' !== $this.val());
|
144 |
|
145 |
-
element.nextAll('.'
|
146 |
fold_elements($(obj), stat && mask);
|
147 |
});
|
148 |
}
|
@@ -198,19 +199,18 @@ var ip_geo_block_time = new Date();
|
|
198 |
|
199 |
// Enable / Disable at front-end target settings
|
200 |
function set_front_end($this) {
|
201 |
-
var
|
202 |
-
checked = $this.is(':checked'),
|
203 |
select = $(ID('@', 'public_target_rule')),
|
204 |
parent = $this.closest('tr').nextAll('tr');
|
205 |
|
206 |
// Enable / Disable descendent items
|
207 |
-
parent.find('[name^="' +
|
208 |
|
209 |
// Enable / Disable description
|
210 |
parent.find(ID('.', 'desc')).css('opacity', checked ? 1.0 : 0.5);
|
211 |
|
212 |
// Show / Hide validation target
|
213 |
-
show_folding_list($this, select,
|
214 |
}
|
215 |
|
216 |
/**
|
@@ -226,14 +226,17 @@ var ip_geo_block_time = new Date();
|
|
226 |
|
227 |
for (key in json) {
|
228 |
if(json.hasOwnProperty(key)) {
|
229 |
-
|
230 |
-
|
|
|
231 |
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
|
236 |
-
|
|
|
|
|
237 |
}
|
238 |
}
|
239 |
|
@@ -243,63 +246,63 @@ var ip_geo_block_time = new Date();
|
|
243 |
});
|
244 |
};
|
245 |
|
246 |
-
function deserialize_json(json) {
|
247 |
if (json) {
|
248 |
// Set fields on form
|
249 |
if ('string' === typeof json) {
|
250 |
json = JSON.parse(json);
|
251 |
}
|
252 |
|
|
|
|
|
|
|
|
|
|
|
253 |
// deserialize to the form
|
254 |
$(ID('#', 'import')).closest('form').deserialize(json);
|
255 |
|
256 |
-
//
|
257 |
-
|
258 |
-
|
259 |
-
|
|
|
|
|
|
|
|
|
260 |
|
261 |
// Public facing pages
|
262 |
set_front_end($(ID('@', 'validation_public')));
|
263 |
|
264 |
// Additional edge case
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
$(ID('@', 'exception_admin')).trigger('change');
|
270 |
}
|
271 |
}
|
272 |
|
273 |
// google chart
|
274 |
var chart = {
|
275 |
-
self: this,
|
276 |
-
drawChart: function () {
|
277 |
-
this.drawPie();
|
278 |
-
this.drawLine();
|
279 |
-
},
|
280 |
-
|
281 |
// Pie Chart
|
282 |
-
dataPie:
|
283 |
-
viewPie:
|
284 |
-
drawPie: function () {
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
$(
|
291 |
-
|
292 |
-
self.dataPie.addRow([value[0] || '', Number(value[1])]);
|
293 |
-
});
|
294 |
}
|
295 |
-
if (
|
296 |
-
|
297 |
-
document.getElementById(
|
298 |
);
|
299 |
}
|
300 |
-
if ($(
|
301 |
-
|
302 |
-
backgroundColor: '#f1f1f1',
|
303 |
chartArea: {
|
304 |
left: 0,
|
305 |
top: '5%',
|
@@ -312,86 +315,175 @@ var ip_geo_block_time = new Date();
|
|
312 |
},
|
313 |
|
314 |
// Line Chart
|
315 |
-
dataLine:
|
316 |
-
viewLine:
|
317 |
-
drawLine: function () {
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
for (n = cells.length, j = 0; j < n; j++) {
|
332 |
-
k = cells.eq(j).text();
|
333 |
-
arr[i].push(j ? Number(k) : new Date(k));
|
334 |
-
}
|
335 |
}
|
336 |
-
|
337 |
}
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
341 |
);
|
342 |
}
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
|
|
348 |
legend: { position: 'bottom' },
|
349 |
-
hAxis: { format: 'MM/dd' },
|
350 |
-
vAxis: { textPosition: (
|
351 |
chartArea: {
|
352 |
-
left: (
|
353 |
top: '5%',
|
354 |
width: '100%',
|
355 |
height: '75%'
|
356 |
}
|
357 |
});
|
358 |
}
|
359 |
-
}
|
360 |
};
|
361 |
|
362 |
// google chart
|
363 |
-
function
|
364 |
-
if (
|
365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
}
|
367 |
}
|
368 |
|
369 |
// Load / Save cookie using wpCookies in wp-includes/js/utils.js
|
370 |
-
function loadCookie(
|
371 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
373 |
|
374 |
// setHash( name, value, expires, path, domain, secure )
|
375 |
-
function saveCookie(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
if ('undefined' !== typeof wpCookies) {
|
377 |
-
|
378 |
-
wpCookies.setHash(
|
379 |
}
|
380 |
}
|
381 |
|
382 |
// Click event handler to show/hide form-table
|
383 |
-
function toggleSection(title,
|
384 |
-
var index = title.closest('fieldset').data('
|
|
|
385 |
|
386 |
// Show/Hide
|
387 |
-
title.parent().nextAll().toggle();
|
388 |
title.toggleClass(ID('dropup')).toggleClass(ID('dropdown'));
|
389 |
|
390 |
-
|
391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
|
393 |
// redraw google chart
|
394 |
-
drawChart();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
}
|
396 |
|
397 |
// form for export / import
|
@@ -411,74 +503,14 @@ var ip_geo_block_time = new Date();
|
|
411 |
}
|
412 |
|
413 |
$(function () {
|
414 |
-
//
|
415 |
-
var
|
416 |
-
legend = $('<legend></legend>'),
|
417 |
-
|
418 |
-
// Get tab number and cookie
|
419 |
-
tabNo = Number(IP_GEO_BLOCK.tab) || 0,
|
420 |
-
cookie = loadCookie(tabNo);
|
421 |
-
|
422 |
-
$('.form-table').each(function (index) {
|
423 |
-
var $this = $(this),
|
424 |
-
title = $this.prevAll('h2,h3:first'),
|
425 |
-
notes = title.nextUntil($this);
|
426 |
-
|
427 |
-
// Move title into the fieldset and wrap with legend
|
428 |
-
$this.wrap(fieldset).parent() // fieldset itself
|
429 |
-
.attr('id', ID('settings-' + index))
|
430 |
-
.data('ip-geo-block', index)
|
431 |
-
.prepend(title.wrap(legend).parent());
|
432 |
-
notes.insertBefore($this);
|
433 |
-
|
434 |
-
// Initialize show/hide form-table on tab 0, 1
|
435 |
-
if (tabNo <= 1) {
|
436 |
-
if ('undefined' === typeof cookie[index] || 'o' === cookie[index]) { // 'undefined', 'x' or 'o'
|
437 |
-
title.addClass(ID('dropdown')).parent().nextAll().show();
|
438 |
-
} else {
|
439 |
-
title.addClass(ID('dropup')).parent().nextAll().hide();
|
440 |
-
}
|
441 |
-
}
|
442 |
-
});
|
443 |
-
|
444 |
-
// Click event handler to show/hide form-table
|
445 |
-
if (tabNo <= 1) {
|
446 |
-
$('form').on('click', 'h2,h3', function (event) {
|
447 |
-
toggleSection($(this), tabNo, cookie);
|
448 |
-
return false;
|
449 |
-
});
|
450 |
|
451 |
-
|
452 |
-
|
453 |
-
var $this, n = 0,
|
454 |
-
id = [ID('dropdown'), ID('dropup')],
|
455 |
-
title = $(ID('.', 'field')).find('h2,h3');
|
456 |
-
|
457 |
-
title.each(function (i) {
|
458 |
-
n += $(this).hasClass(id[0]);
|
459 |
-
});
|
460 |
-
|
461 |
-
// update cookie
|
462 |
-
title.each(function (i) {
|
463 |
-
$this = $(this);
|
464 |
-
$this.parent().nextAll().toggle(n ? false : true);
|
465 |
-
$this.removeClass(id.join(' '))
|
466 |
-
.addClass(n ? id[1] : id[0]);
|
467 |
-
cookie[i] = n ? 'x' : 'o';
|
468 |
-
});
|
469 |
-
|
470 |
-
// Save cookie
|
471 |
-
saveCookie(tabNo, cookie);
|
472 |
-
|
473 |
-
// redraw google chart
|
474 |
-
drawChart();
|
475 |
-
|
476 |
-
return false;
|
477 |
-
});
|
478 |
-
}
|
479 |
|
480 |
// Inhibit to submit by return key
|
481 |
-
$(ID('
|
482 |
return false;
|
483 |
});
|
484 |
|
@@ -488,14 +520,21 @@ var ip_geo_block_time = new Date();
|
|
488 |
* Settings
|
489 |
*----------------------------------------*/
|
490 |
case 0:
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
// Scan your country code
|
492 |
-
$('[id^="' + ID('
|
493 |
var $this = $(this),
|
494 |
id = $this.attr('id'),
|
495 |
parent = $this.parent();
|
|
|
496 |
ajax_post(id.replace(/^.*(?:scan)/, 'scanning'), {
|
497 |
cmd: 'scan-code',
|
498 |
-
which: id.replace(ID('
|
499 |
}, function (data) {
|
500 |
if (!parent.children('ul').length) {
|
501 |
parent.append('<ul id="' + ID('code-list') + '"></ul>');
|
@@ -505,12 +544,12 @@ var ip_geo_block_time = new Date();
|
|
505 |
var key, val;
|
506 |
for (key in data) {
|
507 |
if (data.hasOwnProperty(key)) {
|
508 |
-
key =
|
509 |
if ('string' === typeof data[key]) {
|
510 |
-
val =
|
511 |
} else {
|
512 |
-
val =
|
513 |
-
key = '<abbr title="' +
|
514 |
}
|
515 |
parent.append('<li>' + key + ' : <span class="' + ID('notice') + '">' + val + '</span></li>');
|
516 |
}
|
@@ -523,17 +562,138 @@ var ip_geo_block_time = new Date();
|
|
523 |
|
524 |
// Matching rule
|
525 |
$(ID('@', 'matching_rule')).on('change', function () {
|
526 |
-
|
527 |
-
$(ID('@', '
|
|
|
528 |
return false;
|
529 |
-
}).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
530 |
|
531 |
-
|
532 |
-
|
533 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
534 |
return false;
|
535 |
-
})
|
536 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
// Update local database
|
538 |
$(ID('@', 'update')).on('click', function (event) {
|
539 |
ajax_post('download', {
|
@@ -545,12 +705,12 @@ var ip_geo_block_time = new Date();
|
|
545 |
data = res[api];
|
546 |
for (key in data) { // key: ipv4, ipv6
|
547 |
if (data.hasOwnProperty(key)) {
|
548 |
-
key =
|
549 |
if (data[key].filename) {
|
550 |
-
$(ID('@', api + '_' + key + '_path')).val(
|
551 |
}
|
552 |
if (data[key].message) {
|
553 |
-
$(ID('#', api + '-' + key)).text(
|
554 |
}
|
555 |
}
|
556 |
}
|
@@ -561,30 +721,9 @@ var ip_geo_block_time = new Date();
|
|
561 |
return false;
|
562 |
});
|
563 |
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
// Show/Hide folding list at Login form
|
568 |
-
$(ID('@', 'validation_login')).on('change', function (event) {
|
569 |
-
var $this = $(this);
|
570 |
-
show_folding_list($this, $this, name, true);
|
571 |
-
return false;
|
572 |
-
}).trigger('change');
|
573 |
-
|
574 |
-
// Show/Hide description
|
575 |
-
$('select[name^="' + name + '"]').on('change', function (event) {
|
576 |
-
var $this = $(this);
|
577 |
-
show_description($this);
|
578 |
-
show_folding_list($this, $this, name, true);
|
579 |
-
return false;
|
580 |
-
}).trigger('change');
|
581 |
-
|
582 |
-
// Enable / Disable for Public facing pages
|
583 |
-
$(ID('@', 'validation_public')).on('change', function (event) {
|
584 |
-
set_front_end($(this));
|
585 |
-
return false;
|
586 |
-
}).trigger('change');
|
587 |
-
|
588 |
// Export / Import settings
|
589 |
add_hidden_form('validate');
|
590 |
|
@@ -604,7 +743,7 @@ var ip_geo_block_time = new Date();
|
|
604 |
|
605 |
json[id += '[signature]'] = encode_str(json[id]);
|
606 |
$(ID('#', 'export-data')).val(JSON.stringify(json));
|
607 |
-
$(ID('#', 'export-form')).
|
608 |
|
609 |
return false;
|
610 |
});
|
@@ -627,7 +766,9 @@ var ip_geo_block_time = new Date();
|
|
627 |
ajax_post('export-import', {
|
628 |
cmd: 'validate',
|
629 |
data: JSON.stringify(data)
|
630 |
-
},
|
|
|
|
|
631 |
});
|
632 |
}
|
633 |
|
@@ -635,7 +776,7 @@ var ip_geo_block_time = new Date();
|
|
635 |
});
|
636 |
|
637 |
$(ID('#', 'import')).on('click', function (event) {
|
638 |
-
$(ID('#', 'file-dialog')).
|
639 |
return false;
|
640 |
});
|
641 |
|
@@ -644,11 +785,9 @@ var ip_geo_block_time = new Date();
|
|
644 |
confirm(IP_GEO_BLOCK.msg[0], function () {
|
645 |
ajax_post('pre-defined', {
|
646 |
cmd: 'import-default'
|
647 |
-
},
|
648 |
-
|
649 |
-
|
650 |
-
$('#submit').trigger('click');
|
651 |
-
});*/
|
652 |
});
|
653 |
return false;
|
654 |
});
|
@@ -657,7 +796,9 @@ var ip_geo_block_time = new Date();
|
|
657 |
confirm(IP_GEO_BLOCK.msg[0], function () {
|
658 |
ajax_post('pre-defined', {
|
659 |
cmd: 'import-preferred'
|
660 |
-
},
|
|
|
|
|
661 |
});
|
662 |
return false;
|
663 |
});
|
@@ -677,44 +818,6 @@ var ip_geo_block_time = new Date();
|
|
677 |
return false;
|
678 |
});
|
679 |
|
680 |
-
// Folding list
|
681 |
-
$('ul.' + name + '_folding>dfn').on('click', function (event) {
|
682 |
-
var $this = $(this).parent();
|
683 |
-
$this.children('li').toggle();
|
684 |
-
$this.toggleClass(ID('dropup')).toggleClass(ID('dropdown'));
|
685 |
-
return false;
|
686 |
-
});
|
687 |
-
|
688 |
-
// Decode
|
689 |
-
$(ID('#', 'decode')).on('click', function (event) {
|
690 |
-
var elm = $(ID('@', 'signature')),
|
691 |
-
str = elm.val();
|
692 |
-
if (str.search(/,/) === -1) {
|
693 |
-
elm.val(decode_str(str));
|
694 |
-
} else {
|
695 |
-
elm.val(encode_str(str));
|
696 |
-
}
|
697 |
-
return false;
|
698 |
-
});
|
699 |
-
|
700 |
-
// Response message and Redirect URL
|
701 |
-
$(ID('@', 'response_code')).on('change', function (event) {
|
702 |
-
var res = parseInt($(this).val() / 100, 10),
|
703 |
-
elm = $(this).closest('tr').nextAll('tr');
|
704 |
-
if (res <= 3) { // 2xx, 3xx
|
705 |
-
elm.each(function (index) {
|
706 |
-
if (0 === index) { $(this).show(); } // redirect_uri
|
707 |
-
else if (1 === index) { $(this).hide(); } // response_msg
|
708 |
-
});
|
709 |
-
}
|
710 |
-
else { // 4xx, 5xx
|
711 |
-
elm.each(function (index) {
|
712 |
-
if (0 === index) { $(this).hide(); } // redirect_uri
|
713 |
-
else if (1 === index) { $(this).show(); } // response_msg
|
714 |
-
});
|
715 |
-
}
|
716 |
-
}).trigger('change');
|
717 |
-
|
718 |
// Show WordPress installation info
|
719 |
$(ID('#', 'show-info')).on('click', function (event) {
|
720 |
$(ID('#', 'wp-info')).empty();
|
@@ -729,53 +832,52 @@ var ip_geo_block_time = new Date();
|
|
729 |
}
|
730 |
|
731 |
// response should be escaped at server side
|
732 |
-
$(ID('#', 'wp-info')).html('<textarea rows="' + res.length + '">' + /*
|
733 |
return false;
|
734 |
});
|
735 |
});
|
736 |
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
$
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
$this.prop('checked',true);
|
748 |
-
} else {
|
749 |
-
$this.prop('checked',false);
|
750 |
-
}
|
751 |
-
});
|
752 |
-
}).trigger('change');
|
753 |
-
|
754 |
-
// Candidate actions
|
755 |
-
$(ID('#', 'actions')).on('click', 'input', function (event) {
|
756 |
-
var i, $this = $(this),
|
757 |
-
action = $this.attr('id').replace(ID('%', ''), ''),
|
758 |
-
$admin = $(ID('@', 'exception_admin')),
|
759 |
-
actions = $.grep($admin.val().split(','), function (e){
|
760 |
-
return '' !== e.replace(/^\s+|\s+$/g, ''); // remove empty element
|
761 |
-
});
|
762 |
|
763 |
-
|
764 |
-
|
|
|
|
|
|
|
|
|
765 |
|
766 |
-
if (
|
767 |
-
|
768 |
} else {
|
769 |
-
|
770 |
}
|
771 |
|
772 |
-
|
773 |
});
|
774 |
|
775 |
-
//
|
776 |
-
|
777 |
-
|
778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
});
|
780 |
|
781 |
// Submit
|
@@ -794,14 +896,7 @@ var ip_geo_block_time = new Date();
|
|
794 |
*----------------------------------------*/
|
795 |
case 1:
|
796 |
// https://developers.google.com/loader/#Dynamic
|
797 |
-
|
798 |
-
google.load('visualization', '1', {
|
799 |
-
packages: ['corechart'],
|
800 |
-
callback: function () {
|
801 |
-
chart.drawChart();
|
802 |
-
}
|
803 |
-
});
|
804 |
-
}
|
805 |
|
806 |
// Statistics
|
807 |
$(ID('@', 'clear_statistics')).on('click', function (event) {
|
@@ -846,18 +941,24 @@ var ip_geo_block_time = new Date();
|
|
846 |
});
|
847 |
}
|
848 |
|
|
|
|
|
|
|
|
|
|
|
|
|
849 |
// Search Geolocation
|
850 |
$(ID('@', 'get_location')).on('click', function (event) {
|
851 |
-
var whois = $(ID('#', 'whois')),
|
852 |
ip = $(ID('@', 'ip_address')).val();
|
853 |
|
854 |
if (ip) {
|
855 |
whois.hide().empty();
|
856 |
|
857 |
// Get whois data
|
858 |
-
|
859 |
var i, str = '';
|
860 |
-
for (i = 0; i < data.length; i
|
861 |
str +=
|
862 |
'<tr>' +
|
863 |
'<td>' + data[i].name + '</td>' +
|
@@ -866,10 +967,10 @@ var ip_geo_block_time = new Date();
|
|
866 |
}
|
867 |
|
868 |
whois.html(
|
869 |
-
'<fieldset class="' + ID('field') + '">' +
|
870 |
-
'<legend><
|
871 |
-
'<table class="' + ID('table') + '">' + str + '</table>' +
|
872 |
-
'
|
873 |
).fadeIn('slow');
|
874 |
|
875 |
$(ID('#', 'whois-title')).on('click', function (event) {
|
@@ -887,17 +988,17 @@ var ip_geo_block_time = new Date();
|
|
887 |
which: $(ID('@', 'service')).val()
|
888 |
}, function (data) {
|
889 |
var key, info = '',
|
890 |
-
latitude
|
891 |
-
longitude =
|
892 |
zoom = (data.latitude || data.longitude) ? 8 : 2;
|
893 |
|
894 |
for (key in data) {
|
895 |
if (data.hasOwnProperty(key)) {
|
896 |
-
key =
|
897 |
info +=
|
898 |
'<li>' +
|
899 |
'<span class="' + ID('title' ) + '">' + key + ' : </span>' +
|
900 |
-
'<span class="' + ID('result') + '">' +
|
901 |
'</li>';
|
902 |
}
|
903 |
}
|
@@ -919,7 +1020,7 @@ var ip_geo_block_time = new Date();
|
|
919 |
'<ul style="margin-top:0; margin-left:1em;">' +
|
920 |
'<li>' +
|
921 |
'<span class="' + ID('title' ) + '">' + 'IP address' + ' : </span>' +
|
922 |
-
'<span class="' + ID('result') + '">' +
|
923 |
'</li>' +
|
924 |
info +
|
925 |
/*'<li>' +
|
@@ -939,7 +1040,7 @@ var ip_geo_block_time = new Date();
|
|
939 |
|
940 |
// Preset IP address
|
941 |
if ($(ID('@', 'ip_address')).val()) {
|
942 |
-
$(ID('@', 'get_location')).
|
943 |
}
|
944 |
break;
|
945 |
|
@@ -948,32 +1049,46 @@ var ip_geo_block_time = new Date();
|
|
948 |
*----------------------------------------*/
|
949 |
case 4:
|
950 |
// Kick-off footable
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
$(ID('#', 'log-' + key)).html(data[key]);
|
963 |
-
}
|
964 |
}
|
|
|
965 |
|
966 |
-
|
967 |
-
|
968 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
969 |
|
970 |
-
//
|
971 |
-
|
972 |
-
|
973 |
-
|
|
|
|
|
974 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
975 |
});
|
976 |
-
}
|
977 |
|
978 |
// Clear filter logs
|
979 |
$(ID('#', 'reset-filter')).on('click', function (event) {
|
@@ -994,10 +1109,19 @@ var ip_geo_block_time = new Date();
|
|
994 |
|
995 |
// Export logs
|
996 |
$(ID('#', 'export-logs')).on('click', function (event) {
|
997 |
-
$(ID('#', 'export-form')).
|
998 |
return false;
|
999 |
});
|
1000 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1001 |
}
|
1002 |
-
});
|
|
|
1003 |
}(jQuery, window, document));
|
15 |
'#': '#ip-geo-block-',
|
16 |
'@': '#ip_geo_block_settings_',
|
17 |
'$': 'ip-geo-block-',
|
18 |
+
'%': 'ip_geo_block_',
|
19 |
+
'!': 'ip_geo_block_settings_'
|
20 |
};
|
21 |
return 'undefined' !== typeof id ? keys[selector] + id : keys.$ + selector;
|
22 |
}
|
23 |
|
24 |
+
function escapeHTML(str) {
|
25 |
return str ? str.toString().replace(/[&<>"']/g, function (match) {
|
26 |
return {
|
27 |
'&': '&',
|
42 |
}
|
43 |
|
44 |
function confirm(msg, callback) {
|
45 |
+
if (window.confirm(escapeHTML(msg))) {
|
46 |
callback();
|
47 |
}
|
48 |
}
|
49 |
|
50 |
function warning(status, msg) {
|
51 |
+
window.alert(status ? escapeHTML(status + ': ' + msg) : escapeHTML(msg));
|
52 |
}
|
53 |
|
54 |
function notice_html5() {
|
57 |
|
58 |
function redirect(page, tab) {
|
59 |
if (-1 !== location.href.indexOf(page)) {
|
60 |
+
window.location = escapeHTML(page) + (tab ? '&' + escapeHTML(tab) : '');
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
}
|
63 |
|
111 |
});
|
112 |
}
|
113 |
|
114 |
+
// Prevent event propergation
|
115 |
+
function stopPropergation(event) {
|
116 |
+
event.stopImmediatePropagation();
|
117 |
+
return false;
|
118 |
+
}
|
119 |
+
|
120 |
// Show/Hide description of WP-ZEP
|
121 |
function show_description(select) {
|
122 |
var data, desc = ID('.', 'desc');
|
132 |
if (stat) {
|
133 |
obj.removeClass('folding-disable');
|
134 |
} else {
|
135 |
+
obj.children('li,a').hide();
|
136 |
obj.addClass('folding-disable');
|
137 |
obj.removeClass(ID('dropdown')).addClass(ID('dropup'));
|
138 |
}
|
139 |
}
|
140 |
|
141 |
// Show/Hide folding list
|
142 |
+
function show_folding_list($this, element, mask) {
|
143 |
+
var stat = (0 === $this.prop('type').indexOf('checkbox') && $this.is(':checked')) ||
|
144 |
+
(0 === $this.prop('type').indexOf('select' ) && '0' !== $this.val());
|
|
|
145 |
|
146 |
+
element.nextAll(ID('.', 'settings-folding')).each(function (i, obj) {
|
147 |
fold_elements($(obj), stat && mask);
|
148 |
});
|
149 |
}
|
199 |
|
200 |
// Enable / Disable at front-end target settings
|
201 |
function set_front_end($this) {
|
202 |
+
var checked = $this.is(':checked'),
|
|
|
203 |
select = $(ID('@', 'public_target_rule')),
|
204 |
parent = $this.closest('tr').nextAll('tr');
|
205 |
|
206 |
// Enable / Disable descendent items
|
207 |
+
parent.find('[name^="' + ID('%', 'settings') + '"]').prop('disabled', !checked);
|
208 |
|
209 |
// Enable / Disable description
|
210 |
parent.find(ID('.', 'desc')).css('opacity', checked ? 1.0 : 0.5);
|
211 |
|
212 |
// Show / Hide validation target
|
213 |
+
show_folding_list($this, select, '1' === select.val() ? true : false);
|
214 |
}
|
215 |
|
216 |
/**
|
226 |
|
227 |
for (key in json) {
|
228 |
if(json.hasOwnProperty(key)) {
|
229 |
+
try {
|
230 |
+
name = decodeURIComponent(key); // URIError: malformed URI sequence
|
231 |
+
value = decodeURIComponent(json[key]);
|
232 |
|
233 |
+
if (!data.hasOwnProperty(name)) { // !(name in data)
|
234 |
+
data[name] = [];
|
235 |
+
}
|
236 |
|
237 |
+
data[name].push(value);
|
238 |
+
} catch (e) {
|
239 |
+
}
|
240 |
}
|
241 |
}
|
242 |
|
246 |
});
|
247 |
};
|
248 |
|
249 |
+
function deserialize_json(json, clear) {
|
250 |
if (json) {
|
251 |
// Set fields on form
|
252 |
if ('string' === typeof json) {
|
253 |
json = JSON.parse(json);
|
254 |
}
|
255 |
|
256 |
+
// reset all checkboxes
|
257 |
+
if (clear) {
|
258 |
+
$('input[type="checkbox"]').prop('checked', false).change();
|
259 |
+
}
|
260 |
+
|
261 |
// deserialize to the form
|
262 |
$(ID('#', 'import')).closest('form').deserialize(json);
|
263 |
|
264 |
+
// update textfield, checkbox (Exceptions, Mimetype)
|
265 |
+
$(ID('@', 'exception_admin') + ',' + ID('@', 'validation_mimetype')).change();
|
266 |
+
|
267 |
+
// update selection
|
268 |
+
$('select[name*="' + ID('%', 'settings') + '"]').change();
|
269 |
+
|
270 |
+
// folding list at Login form
|
271 |
+
$(ID('@', 'validation_login')).change();
|
272 |
|
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]');
|
279 |
+
$(ID('@', 'providers_IPInfoDB')).prop('checked', json[clear] ? true : false);
|
280 |
+
}
|
|
|
281 |
}
|
282 |
}
|
283 |
|
284 |
// google chart
|
285 |
var chart = {
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
// Pie Chart
|
287 |
+
dataPie: [],
|
288 |
+
viewPie: [],
|
289 |
+
drawPie: function (id) {
|
290 |
+
var i, data;
|
291 |
+
if ('undefined' === typeof chart.dataPie[id]) {
|
292 |
+
i = chart.dataPie[id] = new google.visualization.DataTable();
|
293 |
+
i.addColumn('string', 'Country');
|
294 |
+
i.addColumn('number', 'Requests');
|
295 |
+
data = $.parseJSON($('#' + id).attr('data-' + id));
|
296 |
+
chart.dataPie[id].addRows(data);
|
|
|
|
|
297 |
}
|
298 |
+
if ('undefined' === typeof chart.viewPie[id]) {
|
299 |
+
chart.viewPie[id] = new google.visualization.PieChart(
|
300 |
+
document.getElementById(id)
|
301 |
);
|
302 |
}
|
303 |
+
if ($('#' + id).width()) {
|
304 |
+
chart.viewPie[id].draw(chart.dataPie[id], {
|
305 |
+
backgroundColor: { fill: 'transparent' }, // '#f1f1f1',
|
306 |
chartArea: {
|
307 |
left: 0,
|
308 |
top: '5%',
|
315 |
},
|
316 |
|
317 |
// Line Chart
|
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' );
|
325 |
+
i.addColumn('number', 'comment');
|
326 |
+
i.addColumn('number', 'xmlrpc' );
|
327 |
+
i.addColumn('number', 'login' );
|
328 |
+
i.addColumn('number', 'admin' );
|
329 |
+
i.addColumn('number', 'public' );
|
330 |
+
data = $.parseJSON($('#' + id).attr('data-' + id));
|
331 |
+
n = data.length;
|
332 |
+
for (i = 0; i < n; ++i) {
|
333 |
+
data[i][0] = new Date(data[i][0] * 1000); // [sec] to [msec]
|
|
|
|
|
|
|
|
|
334 |
}
|
335 |
+
chart.dataLine[id].addRows(data);
|
336 |
}
|
337 |
+
|
338 |
+
if ('undefined' === typeof chart.viewLine[id]) {
|
339 |
+
chart.viewLine[id] = new google.visualization.LineChart(
|
340 |
+
document.getElementById(id)
|
341 |
);
|
342 |
}
|
343 |
+
|
344 |
+
i = $('#' + id).width();
|
345 |
+
if (i) {
|
346 |
+
i = i > 320 ? true : false;
|
347 |
+
chart.viewLine[id].draw(chart.dataLine[id], {
|
348 |
+
backgroundColor: { fill: 'transparent' }, // '#f1f1f1',
|
349 |
legend: { position: 'bottom' },
|
350 |
+
hAxis: { format: 'MM/dd' + ('datetime' === datetype ? ' HH:mm' : '') },
|
351 |
+
vAxis: { textPosition: (i ? 'out' : 'in') },
|
352 |
chartArea: {
|
353 |
+
left: (i ? '10%' : 0),
|
354 |
top: '5%',
|
355 |
width: '100%',
|
356 |
height: '75%'
|
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'],
|
368 |
+
callback: function () {
|
369 |
+
drawChart(tabNo);
|
370 |
+
}
|
371 |
+
});
|
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')) || [];
|
389 |
+
|
390 |
+
for (i in cookie) {
|
391 |
+
if(cookie.hasOwnProperty(i)) {
|
392 |
+
cookie[i] = cookie[i].replace(/[^ox\d]/g, '').split(''); // string (ooo...) to array (n)
|
393 |
+
}
|
394 |
+
}
|
395 |
+
|
396 |
+
if ('undefined' === typeof cookie[tabNo]) {
|
397 |
+
cookie[tabNo] = [];
|
398 |
+
}
|
399 |
+
|
400 |
+
return cookie;
|
401 |
}
|
402 |
|
403 |
// setHash( name, value, expires, path, domain, secure )
|
404 |
+
function saveCookie(cookie) {
|
405 |
+
var j, n, c = [];
|
406 |
+
|
407 |
+
$.each(cookie, function(i, obj) {
|
408 |
+
c[i] = '';
|
409 |
+
if ('undefined' !== typeof obj) {
|
410 |
+
n = obj.length;
|
411 |
+
if (n) {
|
412 |
+
c[i] = (obj[0] || 'o');
|
413 |
+
for (j = 1; j < n; ++j) {
|
414 |
+
c[i] += (obj[j] || 'o');
|
415 |
+
}
|
416 |
+
}
|
417 |
+
}
|
418 |
+
});
|
419 |
+
|
420 |
if ('undefined' !== typeof wpCookies) {
|
421 |
+
j = 'undefined' !== typeof IP_GEO_BLOCK_AUTH ? IP_GEO_BLOCK_AUTH.home + IP_GEO_BLOCK_AUTH.admin : '';
|
422 |
+
wpCookies.setHash('ip-geo-block', c, new Date(Date.now() + 2592000000), j);
|
423 |
}
|
424 |
}
|
425 |
|
426 |
// Click event handler to show/hide form-table
|
427 |
+
function toggleSection(title, tabNo, cookie) {
|
428 |
+
var index = title.closest('fieldset').data('section'),
|
429 |
+
body = title.parent().nextAll('.panel-body').toggle(), border;
|
430 |
|
431 |
// Show/Hide
|
|
|
432 |
title.toggleClass(ID('dropup')).toggleClass(ID('dropdown'));
|
433 |
|
434 |
+
border = title.hasClass(ID('dropdown'));
|
435 |
+
if (border) {
|
436 |
+
body.addClass(ID('border'));
|
437 |
+
} else {
|
438 |
+
body.removeClass(ID('border'));
|
439 |
+
}
|
440 |
+
|
441 |
+
cookie[tabNo][index] = border ? 'o' : 'x';
|
442 |
+
saveCookie(cookie); // Save cookie
|
443 |
|
444 |
// redraw google chart
|
445 |
+
drawChart(tabNo);
|
446 |
+
}
|
447 |
+
|
448 |
+
function manageSection(tabNo) {
|
449 |
+
var cookie = loadCookie(tabNo);
|
450 |
+
|
451 |
+
// Click event handler to show/hide form-table
|
452 |
+
$('form').on('click', 'h2,h3', function (event) {
|
453 |
+
toggleSection($(this), tabNo, cookie);
|
454 |
+
return false;
|
455 |
+
});
|
456 |
+
|
457 |
+
// Toggle all
|
458 |
+
$(ID('#', 'toggle-sections')).on('click', function (event) {
|
459 |
+
var $this,
|
460 |
+
title = $(ID('.', 'field')).find('h2,h3'),
|
461 |
+
m = [ID('dropdown'), ID('dropup')],
|
462 |
+
n = title.filter('.' + m[0]).length;
|
463 |
+
|
464 |
+
// update cookie
|
465 |
+
title.each(function (i) {
|
466 |
+
$this = $(this);
|
467 |
+
$this.removeClass(m.join(' ')).addClass(n ? m[1] : m[0]);
|
468 |
+
$this = $this.parent().nextAll('.panel-body').toggle(n ? false : true);
|
469 |
+
if (n) {
|
470 |
+
$this.removeClass(ID('border'));
|
471 |
+
} else {
|
472 |
+
$this.addClass(ID('border'));
|
473 |
+
}
|
474 |
+
cookie[tabNo][i] = n ? 'x' : 'o';
|
475 |
+
});
|
476 |
+
|
477 |
+
// Save cookie
|
478 |
+
saveCookie(cookie);
|
479 |
+
|
480 |
+
// redraw google chart
|
481 |
+
drawChart(tabNo);
|
482 |
+
|
483 |
+
return false;
|
484 |
+
});
|
485 |
+
|
486 |
+
return cookie;
|
487 |
}
|
488 |
|
489 |
// form for export / import
|
503 |
}
|
504 |
|
505 |
$(function () {
|
506 |
+
// Get tab number
|
507 |
+
var tabNo = Number(IP_GEO_BLOCK.tab) || 0,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
|
509 |
+
// Attach event handler and manage cookie
|
510 |
+
cookie = manageSection(tabNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
|
512 |
// Inhibit to submit by return key
|
513 |
+
$(ID('.', 'inhibit')).on('submit', function () {
|
514 |
return false;
|
515 |
});
|
516 |
|
520 |
* Settings
|
521 |
*----------------------------------------*/
|
522 |
case 0:
|
523 |
+
// Name of base class
|
524 |
+
var name = ID('%', 'settings');
|
525 |
+
|
526 |
+
/*---------------------------
|
527 |
+
* Validation rule settings
|
528 |
+
*---------------------------*/
|
529 |
// Scan your country code
|
530 |
+
$('[id^="' + ID('scan-') + '"]').on('click', function (event) {
|
531 |
var $this = $(this),
|
532 |
id = $this.attr('id'),
|
533 |
parent = $this.parent();
|
534 |
+
|
535 |
ajax_post(id.replace(/^.*(?:scan)/, 'scanning'), {
|
536 |
cmd: 'scan-code',
|
537 |
+
which: id.replace(ID('scan-'), '')
|
538 |
}, function (data) {
|
539 |
if (!parent.children('ul').length) {
|
540 |
parent.append('<ul id="' + ID('code-list') + '"></ul>');
|
544 |
var key, val;
|
545 |
for (key in data) {
|
546 |
if (data.hasOwnProperty(key)) {
|
547 |
+
key = escapeHTML(key);
|
548 |
if ('string' === typeof data[key]) {
|
549 |
+
val = escapeHTML(data[key]);
|
550 |
} else {
|
551 |
+
val = escapeHTML(data[key].code);
|
552 |
+
key = '<abbr title="' + escapeHTML(data[key].type) + '">' + key + '</abbr>';
|
553 |
}
|
554 |
parent.append('<li>' + key + ' : <span class="' + ID('notice') + '">' + val + '</span></li>');
|
555 |
}
|
562 |
|
563 |
// Matching rule
|
564 |
$(ID('@', 'matching_rule')).on('change', function () {
|
565 |
+
var value = this.value;
|
566 |
+
$(ID('@', 'white_list')).closest('tr').toggle(value === '0');
|
567 |
+
$(ID('@', 'black_list')).closest('tr').toggle(value === '1');
|
568 |
return false;
|
569 |
+
}).change();
|
570 |
+
|
571 |
+
// Show/Hide folding list at prevent malicious upload
|
572 |
+
$(ID('@', 'validation_mimetype')).on('change', function (event) {
|
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();
|
580 |
+
|
581 |
+
// Response message and Redirect URL
|
582 |
+
$('select[name*="response_code"]').on('change', function (event) {
|
583 |
+
var $this = $(this),
|
584 |
+
res = parseInt($this.val() / 100, 10),
|
585 |
+
elm = $this.closest('tr').nextAll('tr');
|
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();
|
593 |
+
}
|
594 |
+
});
|
595 |
+
return stopPropergation(event);
|
596 |
+
}
|
597 |
+
}
|
598 |
|
599 |
+
if (res <= 3) { // 2xx, 3xx
|
600 |
+
elm.each(function (index) {
|
601 |
+
if (0 === index) { $(this).show(); } // redirect_uri
|
602 |
+
else if (1 === index) { $(this).hide(); } // response_msg
|
603 |
+
});
|
604 |
+
} else { // 4xx, 5xx
|
605 |
+
elm.each(function (index) {
|
606 |
+
if (0 === index) { $(this).hide(); } // redirect_uri
|
607 |
+
else if (1 === index) { $(this).show(); } // response_msg
|
608 |
+
});
|
609 |
+
}
|
610 |
+
return stopPropergation(event);
|
611 |
+
}).change();
|
612 |
+
|
613 |
+
// Decode
|
614 |
+
$(ID('#', 'decode')).on('click', function (event) {
|
615 |
+
var elm = $(ID('@', 'signature')),
|
616 |
+
str = elm.val();
|
617 |
+
if (str.search(/,/) === -1) {
|
618 |
+
elm.val(decode_str(str));
|
619 |
+
} else {
|
620 |
+
elm.val(encode_str(str));
|
621 |
+
}
|
622 |
return false;
|
623 |
+
});
|
624 |
|
625 |
+
/*---------------------------
|
626 |
+
* Back-end target settings
|
627 |
+
*---------------------------*/
|
628 |
+
// Show/Hide folding list at Login form
|
629 |
+
$(ID('@', 'validation_login')).on('change', function (event) {
|
630 |
+
var $this = $(this);
|
631 |
+
show_folding_list($this, $this, name, true);
|
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
|
678 |
+
*---------------------------*/
|
679 |
+
// Enable / Disable for Public facing pages
|
680 |
+
$(ID('@', 'validation_public')).on('change', function (event) {
|
681 |
+
set_front_end($(this));
|
682 |
+
return stopPropergation(event);
|
683 |
+
}).change();
|
684 |
+
|
685 |
+
// Matching rule on front-end
|
686 |
+
$(ID('@', 'public_matching_rule')).on('change', function (event) {
|
687 |
+
var value = this.value;
|
688 |
+
$(ID('@', 'public_white_list' )).closest('tr').toggle(value === '0');
|
689 |
+
$(ID('@', 'public_black_list' )).closest('tr').toggle(value === '1');
|
690 |
+
$(ID('@', 'public_response_code')).change().closest('tr').toggle(value !== '-1');
|
691 |
+
return stopPropergation(event);
|
692 |
+
}).change();
|
693 |
+
|
694 |
+
/*---------------------------
|
695 |
+
* Local database settings
|
696 |
+
*---------------------------*/
|
697 |
// Update local database
|
698 |
$(ID('@', 'update')).on('click', function (event) {
|
699 |
ajax_post('download', {
|
705 |
data = res[api];
|
706 |
for (key in data) { // key: ipv4, ipv6
|
707 |
if (data.hasOwnProperty(key)) {
|
708 |
+
key = escapeHTML(key);
|
709 |
if (data[key].filename) {
|
710 |
+
$(ID('@', api + '_' + key + '_path')).val(escapeHTML(data[key].filename));
|
711 |
}
|
712 |
if (data[key].message) {
|
713 |
+
$(ID('#', api + '-' + key)).text(escapeHTML(data[key].message));
|
714 |
}
|
715 |
}
|
716 |
}
|
721 |
return false;
|
722 |
});
|
723 |
|
724 |
+
/*---------------------------
|
725 |
+
* Plugin settings
|
726 |
+
*---------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
727 |
// Export / Import settings
|
728 |
add_hidden_form('validate');
|
729 |
|
743 |
|
744 |
json[id += '[signature]'] = encode_str(json[id]);
|
745 |
$(ID('#', 'export-data')).val(JSON.stringify(json));
|
746 |
+
$(ID('#', 'export-form')).submit();
|
747 |
|
748 |
return false;
|
749 |
});
|
766 |
ajax_post('export-import', {
|
767 |
cmd: 'validate',
|
768 |
data: JSON.stringify(data)
|
769 |
+
}, function (data) {
|
770 |
+
deserialize_json(data, true);
|
771 |
+
});
|
772 |
});
|
773 |
}
|
774 |
|
776 |
});
|
777 |
|
778 |
$(ID('#', 'import')).on('click', function (event) {
|
779 |
+
$(ID('#', 'file-dialog')).click();
|
780 |
return false;
|
781 |
});
|
782 |
|
785 |
confirm(IP_GEO_BLOCK.msg[0], function () {
|
786 |
ajax_post('pre-defined', {
|
787 |
cmd: 'import-default'
|
788 |
+
}, function (data) {
|
789 |
+
deserialize_json(data, true);
|
790 |
+
});
|
|
|
|
|
791 |
});
|
792 |
return false;
|
793 |
});
|
796 |
confirm(IP_GEO_BLOCK.msg[0], function () {
|
797 |
ajax_post('pre-defined', {
|
798 |
cmd: 'import-preferred'
|
799 |
+
}, function (data) {
|
800 |
+
deserialize_json(data, false);
|
801 |
+
});
|
802 |
});
|
803 |
return false;
|
804 |
});
|
818 |
return false;
|
819 |
});
|
820 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
// Show WordPress installation info
|
822 |
$(ID('#', 'show-info')).on('click', function (event) {
|
823 |
$(ID('#', 'wp-info')).empty();
|
832 |
}
|
833 |
|
834 |
// response should be escaped at server side
|
835 |
+
$(ID('#', 'wp-info')).html('<textarea rows="' + res.length + '">' + /*escapeHTML*/(res.join("\n")) + '</textarea>').find('textarea').select();
|
836 |
return false;
|
837 |
});
|
838 |
});
|
839 |
|
840 |
+
/*---------------------------
|
841 |
+
* Common event handler
|
842 |
+
*---------------------------*/
|
843 |
+
// Show/Hide description (this change event hander should be at the last)
|
844 |
+
$('select[name^="' + name + '"]').on('change', function (event) {
|
845 |
+
var $this = $(this);
|
846 |
+
show_description($this);
|
847 |
+
show_folding_list($this, $this, name, true);
|
848 |
+
return false;
|
849 |
+
}).change();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
867 |
+
// Folding list
|
868 |
+
$(ID('.', 'settings-folding>dfn')).on('click', function (event) {
|
869 |
+
var drop = ID('drop'),
|
870 |
+
$this = $(this).parent();
|
871 |
+
$this.children('li').toggle();
|
872 |
+
$this.toggleClass(drop + 'up').toggleClass(drop + 'down');
|
873 |
+
|
874 |
+
if ($this.hasClass(drop + 'down')) {
|
875 |
+
$this.children('a').show();
|
876 |
+
} else {
|
877 |
+
$this.children('a').hide();
|
878 |
+
}
|
879 |
+
|
880 |
+
return false;
|
881 |
});
|
882 |
|
883 |
// Submit
|
896 |
*----------------------------------------*/
|
897 |
case 1:
|
898 |
// https://developers.google.com/loader/#Dynamic
|
899 |
+
initChart(tabNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
900 |
|
901 |
// Statistics
|
902 |
$(ID('@', 'clear_statistics')).on('click', function (event) {
|
941 |
});
|
942 |
}
|
943 |
|
944 |
+
// Set selected provider to cookie
|
945 |
+
$('select[id^="' + ID('!', 'service') + '"]').on('change', function (event) {
|
946 |
+
cookie[tabNo][3] = $(this).prop('selectedIndex');
|
947 |
+
saveCookie(cookie); // Save cookie
|
948 |
+
}).change();
|
949 |
+
|
950 |
// Search Geolocation
|
951 |
$(ID('@', 'get_location')).on('click', function (event) {
|
952 |
+
var whois = $(ID('#', 'whois')), obj,
|
953 |
ip = $(ID('@', 'ip_address')).val();
|
954 |
|
955 |
if (ip) {
|
956 |
whois.hide().empty();
|
957 |
|
958 |
// Get whois data
|
959 |
+
obj = $.whois(ip, function (data) {
|
960 |
var i, str = '';
|
961 |
+
for (i = 0; i < data.length; ++i) {
|
962 |
str +=
|
963 |
'<tr>' +
|
964 |
'<td>' + data[i].name + '</td>' +
|
967 |
}
|
968 |
|
969 |
whois.html(
|
970 |
+
'<fieldset id="' + ID('section-1') + '" class="' + ID('field') + ' panel panel-default" data-section="1">' +
|
971 |
+
'<legend class="panel-heading"><h3 id="' + ID('whois-title') + '" class="' + ID('dropdown') + '">Whois</h3></legend>' +
|
972 |
+
'<div class="panel-body ' + ID('border') + '"><table class="' + ID('table') + '">' + str + '</table></div>' +
|
973 |
+
'</fieldset>'
|
974 |
).fadeIn('slow');
|
975 |
|
976 |
$(ID('#', 'whois-title')).on('click', function (event) {
|
988 |
which: $(ID('@', 'service')).val()
|
989 |
}, function (data) {
|
990 |
var key, info = '',
|
991 |
+
latitude = escapeHTML(data.latitude || '0'),
|
992 |
+
longitude = escapeHTML(data.longitude || '0'),
|
993 |
zoom = (data.latitude || data.longitude) ? 8 : 2;
|
994 |
|
995 |
for (key in data) {
|
996 |
if (data.hasOwnProperty(key)) {
|
997 |
+
key = escapeHTML(key);
|
998 |
info +=
|
999 |
'<li>' +
|
1000 |
'<span class="' + ID('title' ) + '">' + key + ' : </span>' +
|
1001 |
+
'<span class="' + ID('result') + '">' + escapeHTML(data[key]) + '</span>' +
|
1002 |
'</li>';
|
1003 |
}
|
1004 |
}
|
1020 |
'<ul style="margin-top:0; margin-left:1em;">' +
|
1021 |
'<li>' +
|
1022 |
'<span class="' + ID('title' ) + '">' + 'IP address' + ' : </span>' +
|
1023 |
+
'<span class="' + ID('result') + '">' + escapeHTML(ip) + '</span>' +
|
1024 |
'</li>' +
|
1025 |
info +
|
1026 |
/*'<li>' +
|
1040 |
|
1041 |
// Preset IP address
|
1042 |
if ($(ID('@', 'ip_address')).val()) {
|
1043 |
+
$(ID('@', 'get_location')).click();
|
1044 |
}
|
1045 |
break;
|
1046 |
|
1049 |
*----------------------------------------*/
|
1050 |
case 4:
|
1051 |
// Kick-off footable
|
1052 |
+
ajax_post('logs', {
|
1053 |
+
cmd: 'restore',
|
1054 |
+
which: null,
|
1055 |
+
time: new Date() - ip_geo_block_time
|
1056 |
+
}, function (data) {
|
1057 |
+
var key;
|
1058 |
+
for (key in data) {
|
1059 |
+
if (data.hasOwnProperty(key)) {
|
1060 |
+
key = escapeHTML(key); // data has been already sanitized
|
1061 |
+
// $(ID('#', 'log-' + key)).html($.parseHTML(data[key])); // jQuery 1.8+
|
1062 |
+
$(ID('#', 'log-' + key)).html(data[key]);
|
|
|
|
|
1063 |
}
|
1064 |
+
}
|
1065 |
|
1066 |
+
if (typeof $.fn.footable === 'function') {
|
1067 |
+
var logs = $(ID('.', 'log')),
|
1068 |
+
title = logs.parent().prevAll('legend').find('h2,h3');
|
1069 |
+
|
1070 |
+
// Once open section
|
1071 |
+
title.removeClass(ID('dropup')).addClass(ID('dropdown'));
|
1072 |
+
|
1073 |
+
// Then make footable
|
1074 |
+
logs.fadeIn('slow').footable();
|
1075 |
|
1076 |
+
// Finaly close section
|
1077 |
+
title.each(function (i, obj) {
|
1078 |
+
if ('x' === (cookie[tabNo][i+1] || 'o')) {
|
1079 |
+
cookie[tabNo][i+1] = 'o';
|
1080 |
+
$(obj).click();
|
1081 |
+
}
|
1082 |
});
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
// Jump to search tab with opening new window
|
1086 |
+
$('tbody[id^="' + ID('log-') + '"]').on('click', 'a', function (event) {
|
1087 |
+
key = window.location.pathname + window.location.search;
|
1088 |
+
window.open(key.replace(/tab=\d/, 'tab=2') + '&ip=' + $(this).text().replace(/[^\w\.\:\*]/, ''), '_blank');
|
1089 |
+
return false;
|
1090 |
});
|
1091 |
+
});
|
1092 |
|
1093 |
// Clear filter logs
|
1094 |
$(ID('#', 'reset-filter')).on('click', function (event) {
|
1109 |
|
1110 |
// Export logs
|
1111 |
$(ID('#', 'export-logs')).on('click', function (event) {
|
1112 |
+
$(ID('#', 'export-form')).submit();
|
1113 |
return false;
|
1114 |
});
|
1115 |
break;
|
1116 |
+
|
1117 |
+
/*----------------------------------------
|
1118 |
+
* Sites
|
1119 |
+
*----------------------------------------*/
|
1120 |
+
case 5:
|
1121 |
+
// https://developers.google.com/loader/#Dynamic
|
1122 |
+
initChart(tabNo);
|
1123 |
+
break;
|
1124 |
}
|
1125 |
+
}); // document.ready()
|
1126 |
+
|
1127 |
}(jQuery, window, document));
|
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(a,k,A){function b(a,b){var c={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_"};return"undefined"!==typeof b?c[a]+b:c.$+a}function f(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[a]}):""}function v(c,e){e?a(b("#",c)).addClass(b("loading")):a(b("#",c)).removeClass(b("loading"))}function p(a,b){k.confirm(f(a))&&b()}function t(a,b){k.alert(a?f(a+": "+b):f(b))}function w(a,b){if(-1!==location.href.indexOf(a)){var c=f(a)+(b?"&"+f(b):"");"undefined"===typeof IP_GEO_BLOCK_ZEP?k.location.href=c:IP_GEO_BLOCK_ZEP.redirect(c)}}function m(b,e,n,l){b&&v(b,!0);e.action=IP_GEO_BLOCK.action;e.nonce=IP_GEO_BLOCK.nonce;a.post(IP_GEO_BLOCK.url,e).done(function(a,b,d){n(a)}).fail(function(a,b,d){t(b,a.responseText)}).always(function(){b&&(l?a.when.apply(a,l).then(function(){v(b,!1)}):v(b,!1))})}function x(a,b){m(a,{cmd:"clear-"+a,which:b},function(a){w(a.page,a.tab)})}function B(a){m(a,{cmd:a},function(a){w(a.page,a.tab)})}function C(a,e){e?a.removeClass("folding-disable"):(a.children("li").hide(),a.addClass("folding-disable"),a.removeClass(b("dropdown")).addClass(b("dropup")))}function y(b,e,n,l){var c=!1,c=c|(0===b.prop("type").indexOf("checkbox")&&b.is(":checked")),c=c|(0===b.prop("type").indexOf("select")&&"0"!==b.val());e.nextAll("."+n+"_folding").each(function(b,d){C(a(d),c&&l)})}function D(c){var e=b("@","validation_ajax_");C(c.closest("ul").next(),a(e+"1").is(":checked")||a(e+"2").is(":checked"))}function r(a){return String(a).replace(/[a-z]/gi,function(a){return String.fromCharCode(a.charCodeAt(0)+("n">a.toLowerCase()?13:-13))})}function J(a,b){var c=new FileReader;c.onload=function(a){b&&b(a.target.result)};c.onerror=function(a){t("Error",a.target.error.code)};c.readAsText(a)}function E(c){var e=b("%","settings"),n=c.is(":checked"),l=a(b("@","public_target_rule")),f=c.closest("tr").nextAll("tr");f.find('[name^="'+e+'"]').prop("disabled",!n);f.find(b(".","desc")).css("opacity",n?1:.5);y(c,l,e,"1"===l.val()?!0:!1)}function z(c){if(c){"string"===typeof c&&(c=JSON.parse(c));a(b("#","import")).closest("form").deserialize(c);a.each(["matching_rule","validation_login","validation_plugins","validation_themes"],function(c,e){a(b("@",e)).trigger("change")});E(a(b("@","validation_public")));var e=b("%","settings[providers][IPInfoDB]");a(b("@","providers_IPInfoDB")).prop("checked",c[e]?!0:!1);a(b("@","exception_admin")).trigger("change")}}function F(){a(b("#","chart-countries")).length&&G.drawChart()}function H(a,e){if("undefined"!==typeof wpCookies){var c="undefined"!==typeof IP_GEO_BLOCK_AUTH?IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin:"";wpCookies.setHash(b("$",a),e,new Date(Date.now()+2592E6),c)}}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>')}a.fn.deserialize=function(b,e){return this.each(function(){var c,e=this,f={};for(c in b)if(b.hasOwnProperty(c)){var k=decodeURIComponent(c);var d=decodeURIComponent(b[c]);f.hasOwnProperty(k)||(f[k]=[]);f[k].push(d)}a.each(f,function(b,d){a('[name="'+b+'"]:input',e).val(d)})})};var G={self:this,drawChart:function(){this.drawPie();this.drawLine()},dataPie:null,viewPie:null,drawPie:function(){if(!self.dataPie){self.dataPie=new google.visualization.DataTable;self.dataPie.addColumn("string","Country");self.dataPie.addColumn("number","Requests");var c;a(b("#","countries li")).each(function(){c=a(this).text().split(":");self.dataPie.addRow([c[0]||"",Number(c[1])])})}self.viewPie||(self.viewPie=new google.visualization.PieChart(A.getElementById(b("chart-countries"))));a(b("#","chart-countries")).width()&&self.viewPie.draw(self.dataPie,{backgroundColor:"#f1f1f1",chartArea:{left:0,top:"5%",width:"100%",height:"90%"},sliceVisibilityThreshold:.015})},dataLine:null,viewLine:null,drawLine:function(){if(!self.dataLine){self.dataLine=new google.visualization.DataTable;self.dataLine.addColumn("date","Date");self.dataLine.addColumn("number","comment");self.dataLine.addColumn("number","xmlrpc");self.dataLine.addColumn("number","login");self.dataLine.addColumn("number","admin");self.dataLine.addColumn("number","public");var c,e,f=[],l=a(b("#","targets tr"));var k=l.length;for(c=0;c<k;c++){f[c]=[];var m=l.eq(c).children();var d=m.length;for(e=0;e<d;e++){var h=m.eq(e).text();f[c].push(e?Number(h):new Date(h))}}self.dataLine.addRows(f)}self.viewLine||(self.viewLine=new google.visualization.LineChart(A.getElementById(b("chart-daily"))));if(c=a(b("#","chart-daily")).width())c=320<c?!0:!1,self.viewLine.draw(self.dataLine,{backgroundColor:"#f1f1f1",legend:{position:"bottom"},hAxis:{format:"MM/dd"},vAxis:{textPosition:c?"out":"in"},chartArea:{left:c?"10%":0,top:"5%",width:"100%",height:"75%"}})}};a(function(){var c=a('<fieldset class="'+b("field")+'"></fieldset>'),e=a("<legend></legend>"),n=Number(IP_GEO_BLOCK.tab)||0,l="undefined"!==typeof wpCookies&&wpCookies.getHash(b("$",n))||{};a(".form-table").each(function(d){var h=a(this),g=h.prevAll("h2,h3:first"),K=g.nextUntil(h);h.wrap(c).parent().attr("id",b("settings-"+d)).data("ip-geo-block",d).prepend(g.wrap(e).parent());K.insertBefore(h);1>=n&&("undefined"===typeof l[d]||"o"===l[d]?g.addClass(b("dropdown")).parent().nextAll().show():g.addClass(b("dropup")).parent().nextAll().hide())});1>=n&&(a("form").on("click","h2,h3",function(d){d=a(this);var h=d.closest("fieldset").data("ip-geo-block");d.parent().nextAll().toggle();d.toggleClass(b("dropup")).toggleClass(b("dropdown"));l[h]=d.hasClass(b("dropdown"))?"o":"x";H(n,l);F();return!1}),a(b("#","toggle-sections")).on("click",function(d){var h,g=0,c=[b("dropdown"),b("dropup")];d=a(b(".","field")).find("h2,h3");d.each(function(b){g+=a(this).hasClass(c[0])});d.each(function(b){h=a(this);h.parent().nextAll().toggle(g?!1:!0);h.removeClass(c.join(" ")).addClass(g?c[1]:c[0]);l[b]=g?"x":"o"});H(n,l);F();return!1}));a(b("#","inhibit")).on("submit",function(){return!1});switch(n){case 0:a('[id^="'+b("$","scan-")+'"]').on("click",function(d){d=a(this);var c=d.attr("id"),g=d.parent();m(c.replace(/^.*(?:scan)/,"scanning"),{cmd:"scan-code",which:c.replace(b("$","scan-"),"")},function(a){g.children("ul").length||g.append('<ul id="'+b("code-list")+'"></ul>');g=g.children("ul").empty();for(d in a)if(a.hasOwnProperty(d)){var d=f(d);if("string"===typeof a[d])var c=f(a[d]);else c=f(a[d].code),d='<abbr title="'+f(a[d].type)+'">'+d+"</abbr>";g.append("<li>"+d+' : <span class="'+b("notice")+'">'+c+"</span></li>")}g.show("slow")});return!1});a(b("@","matching_rule")).on("change",function(){a(b("@","white_list")).closest("tr").toggle("0"===this.value);a(b("@","black_list")).closest("tr").toggle("1"===this.value);return!1}).trigger("change");a(b("@","public_matching_rule")).on("change",function(){a(b("@","public_white_list")).closest("tr").toggle("0"===this.value);a(b("@","public_black_list")).closest("tr").toggle("1"===this.value);return!1}).trigger("change");a(b("@","update")).on("click",function(d){m("download",{cmd:"download"},function(d){var c;for(c in d)if(d.hasOwnProperty(c)){var h=d[c];for(e in h)if(h.hasOwnProperty(e)){var e=f(e);h[e].filename&&a(b("@",c+"_"+e+"_path")).val(f(h[e].filename));h[e].message&&a(b("#",c+"-"+e)).text(f(h[e].message))}}});return!1});var q=b("%","settings");a(b("@","validation_login")).on("change",function(b){b=a(this);y(b,b,q,!0);return!1}).trigger("change");a('select[name^="'+q+'"]').on("change",function(d){d=a(this);var c,g=b(".","desc");d.next(g).empty();(c=d.children("option:selected").data("desc"))&&d.next(g).html(a.parseHTML(c));y(d,d,q,!0);return!1}).trigger("change");a(b("@","validation_public")).on("change",function(b){E(a(this));return!1}).trigger("change");I("validate");a(b("#","export")).on("click",function(d){if("undefined"===typeof JSON)return t(null,IP_GEO_BLOCK.msg[6]),!1;var c=q,g={};a.each(a(this).closest("form").serializeArray(),function(a,b){-1!==b.name.indexOf(c)&&(g[b.name]=b.value)});g[c+="[signature]"]=k.btoa(r(g[c]));a(b("#","export-data")).val(JSON.stringify(g));a(b("#","export-form")).trigger("submit");return!1});a(b("#","file-dialog")).on("change",function(a){if("undefined"===typeof FileReader)return t(null,IP_GEO_BLOCK.msg[6]),!1;var b;(a=a.target.files[0])&&J(a,function(a){a=JSON.parse(a);b=q+"[signature]";"undefined"!==typeof a[b]&&(a[b]=k.btoa(r(a[b])));m("export-import",{cmd:"validate",data:JSON.stringify(a)},z)});return!1});a(b("#","import")).on("click",function(d){a(b("#","file-dialog")).trigger("click");return!1});a(b("#","default")).on("click",function(a){p(IP_GEO_BLOCK.msg[0],function(){m("pre-defined",{cmd:"import-default"},z)});return!1});a(b("#","preferred")).on("click",function(a){p(IP_GEO_BLOCK.msg[0],function(){m("pre-defined",{cmd:"import-preferred"},z)});return!1});a(b("@","create_table")).on("click",function(a){p(IP_GEO_BLOCK.msg[1],function(){B("create-table")});return!1});a(b("@","delete_table")).on("click",function(a){p(IP_GEO_BLOCK.msg[2],function(){B("delete-table")});return!1});a("ul."+q+"_folding>dfn").on("click",function(d){d=a(this).parent();d.children("li").toggle();d.toggleClass(b("dropup")).toggleClass(b("dropdown"));return!1});a(b("#","decode")).on("click",function(d){d=a(b("@","signature"));var c=d.val();-1===c.search(/,/)?d.val(r(k.atob(c))):d.val(k.btoa(r(c)));return!1});a(b("@","response_code")).on("change",function(b){b=parseInt(a(this).val()/100,10);var d=a(this).closest("tr").nextAll("tr");3>=b?d.each(function(b){0===b?a(this).show():1===b&&a(this).hide()}):d.each(function(b){0===b?a(this).hide():1===b&&a(this).show()})}).trigger("change");a(b("#","show-info")).on("click",function(d){a(b("#","wp-info")).empty();m("wp-info",{cmd:"show-info"},function(d){var c,e=[];for(c in d)d.hasOwnProperty(c)&&e.push("- "+c+" "+d[c]);a(b("#","wp-info")).html('<textarea rows="'+e.length+'">'+e.join("\n")+"</textarea>").find("textarea").select();return!1})});a(b("@","exception_admin")).on("change",function(d){var c=a.grep(a(this).val().split(","),function(a){return""!==a.replace(/^\s+|\s+$/g,"")});a(b("#","actions")).find("input").each(function(d,e){var h=a(this),g=h.attr("id").replace(b("%",""),"");-1!==a.inArray(g,c)?h.prop("checked",!0):h.prop("checked",!1)})}).trigger("change");a(b("#","actions")).on("click","input",function(d){var c=a(this).attr("id").replace(b("%",""),""),e=a(b("@","exception_admin")),f=a.grep(e.val().split(","),function(a){return""!==a.replace(/^\s+|\s+$/g,"")});d=a.inArray(c,f);-1===d?f.push(c):f.splice(d,1);e.val(f.join(",")).change()});D(a(b("@","validation_ajax_1")));a('input[id^="'+b("%","settings_validation_ajax_")+'"]').on("click",function(b){D(a(this))});a("#submit").on("click",function(c){c=a(b("@","signature"));var d=c.val();-1!==d.indexOf(",")&&c.val(k.btoa(r(d)));return!0});break;case 1:a(b("#","chart-countries")).length&&"object"===typeof google&&google.load("visualization","1",{packages:["corechart"],callback:function(){G.drawChart()}});a(b("@","clear_statistics")).on("click",function(a){p(IP_GEO_BLOCK.msg[3],function(){x("statistics",null)});return!1});a(b("@","clear_cache")).on("click",function(a){p(IP_GEO_BLOCK.msg[4],function(){x("cache",null)});return!1});break;case 2:a(k).on(b("gmap-error"),function(){m(null,{cmd:"gmap-error"},function(a){w(a.page,a.tab)})});var u=a(b("#","map"));"object"===typeof google?u.each(function(){a(this).GmapRS()}):u.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(b("@","get_location")).on("click",function(c){var d=a(b("#","whois")),e=a(b("@","ip_address")).val();e&&(d.hide().empty(),c=a.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 class="'+b("field")+'"><legend><h2 id="'+b("whois-title")+'" class="'+b("dropdown")+'">Whois</h2></legend><table class="'+b("table")+'">'+f+"</table><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:e,which:a(b("@","service")).val()},function(a){var c="",d=f(a.latitude||"0"),h=f(a.longitude||"0"),g=a.latitude||a.longitude?8:2;for(k in a)if(a.hasOwnProperty(k)){var k=f(k);c+='<li><span class="'+b("title")+'">'+k+' : </span><span class="'+b("result")+'">'+f(a[k])+"</span></li>"}"object"===typeof google?u.GmapRS("addMarker",{latitude:d,longitude:h,title:e,content:"<ul>"+c+"</ul>",show:!0,zoom:g}):u.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")+'">'+f(e)+"</span></li>"+c+'</ul><iframe src="//maps.google.com/maps?q='+d+","+h+"&z="+g+'&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")).trigger("click");break;case 4:a(b(".","log")).hide().length&&m("logs",{cmd:"restore",which:null,time:new Date-ip_geo_block_time},function(c){for(var d in c)c.hasOwnProperty(d)&&(d=f(d),a(b("#","log-"+d)).html(c[d]));"function"===typeof a.fn.footable&&a(b(".","log")).fadeIn("slow").footable();a('tbody[id^="'+b("$","log-")+'"]').on("click","a",function(b){k.open(k.location.href.replace(/tab=\d/,"tab=2")+"&ip="+a(this).text().replace(/[^\w\.\:\*]/,""));return!1})}),a(b("#","reset-filter")).on("click",function(b){a(".footable").trigger("footable_clear_filter");return!1}),a(b("@","clear_logs")).on("click",function(a){p(IP_GEO_BLOCK.msg[5],function(){x("logs",null)});return!1}),I("export-logs"),a(b("#","export-logs")).on("click",function(c){a(b("#","export-form")).trigger("submit");return!1})}})})(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(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{"&":"&","<":"<",">":">",'"':""","'":"'"}[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);
|
admin/js/authenticate.js
CHANGED
@@ -9,14 +9,17 @@ var IP_GEO_BLOCK_ZEP = {
|
|
9 |
init: false,
|
10 |
auth: 'ip-geo-block-auth-nonce',
|
11 |
nonce: IP_GEO_BLOCK_AUTH.nonce || '',
|
|
|
12 |
redirect: function (url) {
|
13 |
'use strict';
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
17 |
}
|
18 |
-
window.location.href = url;
|
19 |
}
|
|
|
20 |
}
|
21 |
};
|
22 |
|
@@ -188,8 +191,10 @@ var IP_GEO_BLOCK_ZEP = {
|
|
188 |
return 0; // internal not admin
|
189 |
}
|
190 |
|
|
|
|
|
191 |
// `theme-install.php` eats the query and set it to `request[browse]` as a parameter
|
192 |
-
|
193 |
var i = data.length;
|
194 |
while (i-- > 0) {
|
195 |
if (data[i].indexOf('request%5Bbrowse%5D=ip-geo-block-auth') !== -1) {
|
@@ -198,10 +203,10 @@ var IP_GEO_BLOCK_ZEP = {
|
|
198 |
}
|
199 |
}
|
200 |
return data;
|
201 |
-
}
|
202 |
|
203 |
// `upload.php` eats the query and set it to `query[ip-geo-block-auth-nonce]` as a parameter
|
204 |
-
|
205 |
var i = data.length;
|
206 |
while (i-- > 0) {
|
207 |
if (data[i].indexOf('query%5Bip-geo-block-auth-nonce%5D=') !== -1) {
|
@@ -210,10 +215,10 @@ var IP_GEO_BLOCK_ZEP = {
|
|
210 |
}
|
211 |
}
|
212 |
return data;
|
213 |
-
}
|
214 |
|
215 |
// list of excluded links
|
216 |
-
|
217 |
'upload.php': media_library,
|
218 |
'theme-install.php': theme_featured,
|
219 |
'network/theme-install.php': theme_featured
|
@@ -226,11 +231,9 @@ var IP_GEO_BLOCK_ZEP = {
|
|
226 |
}
|
227 |
|
228 |
// embed a nonce before an Ajax request is sent
|
229 |
-
|
230 |
-
var nonce = IP_GEO_BLOCK_ZEP.nonce;
|
231 |
-
|
232 |
// POST to async-upload.php causes an error in https://wordpress.org/plugins/mammoth-docx-converter/
|
233 |
-
if (
|
234 |
// multipart/form-data (XMLHttpRequest Level 2)
|
235 |
// IE10+, Firefox 4+, Safari 5+, Android 3+
|
236 |
if (typeof window.FormData !== 'undefined' && settings.data instanceof FormData) {
|
@@ -313,80 +316,80 @@ var IP_GEO_BLOCK_ZEP = {
|
|
313 |
return (is_admin(location.pathname) === 1 || location.search.indexOf(IP_GEO_BLOCK_ZEP.auth) >= 0);
|
314 |
}
|
315 |
|
316 |
-
function
|
317 |
-
|
318 |
-
|
319 |
-
var $body = $('body');
|
320 |
|
321 |
-
|
322 |
-
|
|
|
|
|
|
|
|
|
323 |
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
});
|
329 |
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
// if admin area (except in comment with nofollow) then add a nonce
|
338 |
-
if (admin === 1) {
|
339 |
-
$this.attr('href', add_query_nonce(
|
340 |
-
href, (!rel || rel.indexOf('nofollow') < 0) ? nonce : 'nofollow'
|
341 |
-
));
|
342 |
-
}
|
343 |
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
'<meta name="referrer" content="no-referrer" />' +
|
354 |
-
'<meta http-equiv="refresh" content="0; url=' + href + '" />' +
|
355 |
-
'<script>window.location.replace("' + href + '")</script></head></html>'
|
356 |
-
);
|
357 |
-
w.document.close();
|
358 |
-
|
359 |
-
// stop event propagation
|
360 |
-
event.stopImmediatePropagation();
|
361 |
-
|
362 |
-
// automatically call event.stopPropagation() and event.preventDefault()
|
363 |
return false;
|
364 |
}
|
365 |
-
});
|
366 |
|
367 |
-
|
368 |
-
|
369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
});
|
376 |
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
}
|
385 |
}
|
386 |
-
}
|
387 |
}
|
388 |
|
389 |
-
|
390 |
// avoid conflict with "Open external links in a new window"
|
391 |
if (is_back_end()) {
|
392 |
$('a').each(function () {
|
@@ -396,15 +399,40 @@ var IP_GEO_BLOCK_ZEP = {
|
|
396 |
});
|
397 |
}
|
398 |
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
// fallback on error
|
405 |
$(window).on('error', function () {
|
406 |
if (!IP_GEO_BLOCK_ZEP.init) {
|
407 |
-
|
408 |
}
|
409 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
}(jQuery, document));
|
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 |
|
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) {
|
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) {
|
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
|
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) {
|
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
|
|
|
322 |
|
323 |
+
elem.onFirst('click contextmenu', 'a', function (event) {
|
324 |
+
// attr() returns 'string' or 'undefined'
|
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));
|
356 |
+
href = href.split(';', 2).shift(); // avoid `url=...;url=javascript:...`
|
357 |
+
|
358 |
+
admin = window.open();
|
359 |
+
admin.document.write(
|
360 |
+
'<!DOCTYPE html><html><head>' +
|
361 |
+
'<meta name="referrer" content="never" />' +
|
362 |
+
'<meta name="referrer" content="no-referrer" />' +
|
363 |
+
'<meta http-equiv="refresh" content="0; url=' + href + '" />' +
|
364 |
+
($('body').hasClass('webview') ? '<script>window.location.replace("' + href + '")</script>' : '') +
|
365 |
+
'</head></html>'
|
366 |
+
);
|
367 |
+
admin.document.close();
|
368 |
+
|
369 |
+
// stop event propagation
|
370 |
+
event.stopImmediatePropagation();
|
371 |
+
|
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) {
|
382 |
+
var $this = $(this),
|
383 |
+
action = $this.attr('action'); // possibly 'undefined'
|
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 () {
|
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));
|
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||"",redirect:function(e){
|
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{'"':""","'":"'"}[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);
|
admin/js/whois.js
CHANGED
@@ -27,7 +27,7 @@
|
|
27 |
url = 'https://rest.db.ripe.net/search%3fflags=no-filtering%26flags=resource%26query-string=';
|
28 |
// app = 'https://apps.db.ripe.net/search/lookup.html?source=%SRC%&key=%KEY%&type=%TYPE%';
|
29 |
|
30 |
-
function
|
31 |
return str ? str.toString().replace(/[&<>"']/g, function (match) {
|
32 |
return {
|
33 |
'&': '&',
|
@@ -54,15 +54,15 @@
|
|
54 |
msg = err.text.split(/\n+/);
|
55 |
|
56 |
results.push({
|
57 |
-
name :
|
58 |
-
value:
|
59 |
});
|
60 |
}
|
61 |
|
62 |
else if (value.href) {
|
63 |
-
value.href =
|
64 |
results.push({
|
65 |
-
name :
|
66 |
value: '<a href="' + value.href + '.json" target=_blank>' + value.href + '</a>'
|
67 |
});
|
68 |
}
|
@@ -78,16 +78,16 @@
|
|
78 |
}*/
|
79 |
|
80 |
if (value.link) {
|
81 |
-
value.value = '<a href="' +
|
82 |
}
|
83 |
|
84 |
else if ('remarks' === value.name) {
|
85 |
-
value.value =
|
86 |
value.value = value.value.replace(/(https?:\/\/[^\s]+)/gi, '<a href="$1" target=_blank>$1</a>');
|
87 |
}
|
88 |
|
89 |
results.push({
|
90 |
-
name :
|
91 |
value: value.value
|
92 |
});
|
93 |
}
|
@@ -115,8 +115,8 @@
|
|
115 |
|
116 |
.fail(function (jqXHR, textStatus, errorThrown) {
|
117 |
results.push({
|
118 |
-
name :
|
119 |
-
value:
|
120 |
});
|
121 |
})
|
122 |
|
@@ -133,4 +133,4 @@
|
|
133 |
}
|
134 |
});
|
135 |
|
136 |
-
}
|
27 |
url = 'https://rest.db.ripe.net/search%3fflags=no-filtering%26flags=resource%26query-string=';
|
28 |
// app = 'https://apps.db.ripe.net/search/lookup.html?source=%SRC%&key=%KEY%&type=%TYPE%';
|
29 |
|
30 |
+
function escapeHTML(str) {
|
31 |
return str ? str.toString().replace(/[&<>"']/g, function (match) {
|
32 |
return {
|
33 |
'&': '&',
|
54 |
msg = err.text.split(/\n+/);
|
55 |
|
56 |
results.push({
|
57 |
+
name : escapeHTML(err.severity),
|
58 |
+
value: escapeHTML(msg[1].replace(/%s/, err.args.value))
|
59 |
});
|
60 |
}
|
61 |
|
62 |
else if (value.href) {
|
63 |
+
value.href = escapeHTML(value.href);
|
64 |
results.push({
|
65 |
+
name : escapeHTML(key),
|
66 |
value: '<a href="' + value.href + '.json" target=_blank>' + value.href + '</a>'
|
67 |
});
|
68 |
}
|
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) {
|
85 |
+
value.value = escapeHTML(value.value);
|
86 |
value.value = value.value.replace(/(https?:\/\/[^\s]+)/gi, '<a href="$1" target=_blank>$1</a>');
|
87 |
}
|
88 |
|
89 |
results.push({
|
90 |
+
name : escapeHTML(value.name),
|
91 |
value: value.value
|
92 |
});
|
93 |
}
|
115 |
|
116 |
.fail(function (jqXHR, textStatus, errorThrown) {
|
117 |
results.push({
|
118 |
+
name : escapeHTML(textStatus),
|
119 |
+
value: escapeHTML(errorThrown)
|
120 |
});
|
121 |
})
|
122 |
|
133 |
}
|
134 |
});
|
135 |
|
136 |
+
}(jQuery));
|
classes/class-ip-geo-block-actv.php
CHANGED
@@ -18,14 +18,8 @@ require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
|
|
18 |
|
19 |
class IP_Geo_Block_Activate {
|
20 |
|
21 |
-
// initialize logs then upgrade and return new options
|
22 |
-
private static function activate_blog() {
|
23 |
-
IP_Geo_Block_Logs::create_tables();
|
24 |
-
IP_Geo_Block_Opts::upgrade();
|
25 |
-
}
|
26 |
-
|
27 |
// initialize main blog
|
28 |
-
|
29 |
if ( current_user_can( 'manage_options' ) ) {
|
30 |
$settings = IP_Geo_Block::get_option();
|
31 |
|
@@ -41,25 +35,49 @@ class IP_Geo_Block_Activate {
|
|
41 |
}
|
42 |
}
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
/**
|
45 |
* Register options into database table when the plugin is activated.
|
46 |
-
*
|
47 |
*/
|
48 |
public static function activate( $network_wide = FALSE ) {
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
|
53 |
global $wpdb;
|
54 |
-
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM
|
55 |
-
|
|
|
|
|
56 |
|
57 |
foreach ( $blog_ids as $id ) {
|
58 |
switch_to_blog( $id );
|
59 |
-
self::activate_blog();
|
60 |
-
}
|
61 |
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
else {
|
18 |
|
19 |
class IP_Geo_Block_Activate {
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
// initialize main blog
|
22 |
+
private static function init_main_blog() {
|
23 |
if ( current_user_can( 'manage_options' ) ) {
|
24 |
$settings = IP_Geo_Block::get_option();
|
25 |
|
35 |
}
|
36 |
}
|
37 |
|
38 |
+
// initialize logs then upgrade and return new options
|
39 |
+
public static function activate_blog() {
|
40 |
+
IP_Geo_Block_Logs::create_tables();
|
41 |
+
IP_Geo_Block_Opts::upgrade();
|
42 |
+
}
|
43 |
+
|
44 |
/**
|
45 |
* Register options into database table when the plugin is activated.
|
46 |
+
* @link https://wordpress.stackexchange.com/questions/181141/how-to-run-an-activation-function-when-plugin-is-network-activated-on-multisite
|
47 |
*/
|
48 |
public static function activate( $network_wide = FALSE ) {
|
49 |
+
defined( 'IP_GEO_BLOCK_DEBUG' ) and IP_GEO_BLOCK_DEBUG and assert( 'is_main_site()', 'Not main blog.' );
|
50 |
+
|
51 |
+
if ( $network_wide ) {
|
52 |
+
// Update main blog first.
|
53 |
+
self::activate_blog();
|
54 |
+
|
55 |
+
// Get option of main blog.
|
56 |
+
$option = IP_Geo_Block::get_option();
|
57 |
|
|
|
58 |
global $wpdb;
|
59 |
+
$blog_ids = $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs` ORDER BY `blog_id` ASC" );
|
60 |
+
|
61 |
+
// Skip the main blog.
|
62 |
+
array_shift( $blog_ids );
|
63 |
|
64 |
foreach ( $blog_ids as $id ) {
|
65 |
switch_to_blog( $id );
|
|
|
|
|
66 |
|
67 |
+
if ( $option['network_wide'] ) {
|
68 |
+
// individual data
|
69 |
+
$opt = IP_Geo_Block::get_option();
|
70 |
+
$option['api_key']['GoogleMap'] = $opt['api_key']['GoogleMap'];
|
71 |
+
|
72 |
+
update_option( IP_Geo_Block::OPTION_NAME, $option );
|
73 |
+
}
|
74 |
+
|
75 |
+
else {
|
76 |
+
self::activate_blog();
|
77 |
+
}
|
78 |
+
|
79 |
+
restore_current_blog();
|
80 |
+
}
|
81 |
}
|
82 |
|
83 |
else {
|
classes/class-ip-geo-block-apis.php
CHANGED
@@ -169,7 +169,7 @@ abstract class IP_Geo_Block_API {
|
|
169 |
*/
|
170 |
public static function get_class_name( $provider ) {
|
171 |
$provider = 'IP_Geo_Block_API_' . preg_replace( '/[\W]/', '', $provider );
|
172 |
-
return class_exists( $provider ) ? $provider : NULL;
|
173 |
}
|
174 |
|
175 |
/**
|
@@ -659,7 +659,7 @@ class IP_Geo_Block_Provider {
|
|
659 |
* Load additional plugins
|
660 |
*
|
661 |
*/
|
662 |
-
if ( class_exists( 'IP_Geo_Block' ) ) {
|
663 |
|
664 |
// Get absolute path to the geo-location API
|
665 |
$dir = IP_Geo_Block::get_option();
|
169 |
*/
|
170 |
public static function get_class_name( $provider ) {
|
171 |
$provider = 'IP_Geo_Block_API_' . preg_replace( '/[\W]/', '', $provider );
|
172 |
+
return class_exists( $provider, FALSE ) ? $provider : NULL;
|
173 |
}
|
174 |
|
175 |
/**
|
659 |
* Load additional plugins
|
660 |
*
|
661 |
*/
|
662 |
+
if ( class_exists( 'IP_Geo_Block', FALSE ) ) {
|
663 |
|
664 |
// Get absolute path to the geo-location API
|
665 |
$dir = IP_Geo_Block::get_option();
|
classes/class-ip-geo-block-cron.php
CHANGED
@@ -44,52 +44,53 @@ class IP_Geo_Block_Cron {
|
|
44 |
* 1. Plugin is activated
|
45 |
* 2. WP Cron is kicked
|
46 |
* under the following condition:
|
47 |
-
* A.
|
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 |
|
|
|
|
|
|
|
54 |
// download database files (higher priority order)
|
55 |
foreach ( $providers = IP_Geo_Block_Provider::get_addons() as $provider ) {
|
56 |
-
if ( $geo = IP_Geo_Block_API::get_instance( $provider, $settings ) )
|
57 |
$res[ $provider ] = $geo->download( $settings[ $provider ], $args );
|
58 |
-
}
|
59 |
-
|
60 |
-
// re-schedule cron job
|
61 |
-
if ( ! empty( $providers ) )
|
62 |
-
self::schedule_cron_job( $settings['update'], $settings[ $providers[0] ], FALSE );
|
63 |
|
64 |
-
|
65 |
-
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
add_filter( IP_Geo_Block::PLUGIN_NAME . '-ip-addr', array( __CLASS__, 'extract_ip' ) );
|
70 |
|
71 |
-
|
72 |
-
|
|
|
|
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
}
|
87 |
|
88 |
-
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
return isset( $res ) ? $res : NULL;
|
@@ -100,14 +101,12 @@ class IP_Geo_Block_Cron {
|
|
100 |
*
|
101 |
*/
|
102 |
private static function update_settings( $src, $keys = array() ) {
|
103 |
-
|
104 |
-
require_once ABSPATH . '/wp-admin/includes/plugin.php';
|
105 |
|
106 |
-
// for multisite
|
107 |
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
|
108 |
global $wpdb;
|
109 |
-
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM
|
110 |
-
$current_blog_id = get_current_blog_id();
|
111 |
|
112 |
foreach ( $blog_ids as $id ) {
|
113 |
switch_to_blog( $id );
|
@@ -118,9 +117,8 @@ class IP_Geo_Block_Cron {
|
|
118 |
}
|
119 |
|
120 |
update_option( IP_Geo_Block::OPTION_NAME, $dst );
|
|
|
121 |
}
|
122 |
-
|
123 |
-
switch_to_blog( $current_blog_id );
|
124 |
}
|
125 |
|
126 |
// for single site
|
@@ -144,11 +142,11 @@ class IP_Geo_Block_Cron {
|
|
144 |
*
|
145 |
*/
|
146 |
public static function start_update_db( $settings ) {
|
147 |
-
|
148 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
149 |
|
150 |
// the status is still inactive when this plugin is activated on dashboard.
|
151 |
-
if ( ! is_plugin_active( IP_GEO_BLOCK_BASE )
|
|
|
152 |
set_transient( IP_Geo_Block::CRON_NAME, IP_Geo_Block::get_ip_address(), MINUTE_IN_SECONDS );
|
153 |
self::schedule_cron_job( $settings['update'], NULL, TRUE );
|
154 |
}
|
@@ -164,7 +162,24 @@ class IP_Geo_Block_Cron {
|
|
164 |
* Note: When the init action occurs in /wp-settings.php, wp_cron() runs.
|
165 |
*/
|
166 |
public static function exec_cache_gc( $settings ) {
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
self::stop_cache_gc();
|
169 |
self::start_cache_gc( $settings );
|
170 |
}
|
@@ -188,13 +203,12 @@ class IP_Geo_Block_Cron {
|
|
188 |
* @return array status message.
|
189 |
*/
|
190 |
public static function download_zip( $url, $args, $filename, $modified ) {
|
191 |
-
|
192 |
-
|
193 |
|
194 |
// if the name of src file is changed, then update the dst
|
195 |
-
if ( basename( $filename ) !== ( $base = pathinfo( $url, PATHINFO_FILENAME ) ) )
|
196 |
$filename = dirname( $filename ) . '/' . $base;
|
197 |
-
}
|
198 |
|
199 |
// check file
|
200 |
if ( ! file_exists( $filename ) )
|
@@ -273,40 +287,14 @@ class IP_Geo_Block_Cron {
|
|
273 |
}
|
274 |
}
|
275 |
|
276 |
-
elseif ( 'zip' === $args && class_exists( 'ZipArchive' ) ) {
|
277 |
-
// https://codex.wordpress.org/Function_Reference/unzip_file
|
278 |
-
WP_Filesystem();
|
279 |
$tmp = get_temp_dir(); // @since 2.5
|
280 |
-
$ret = unzip_file( $src, $tmp ); // @since 2.5
|
281 |
|
282 |
-
if ( is_wp_error( $ret ) )
|
283 |
-
/* try fallback instead of throwing error
|
284 |
throw new Exception(
|
285 |
$ret->get_error_code() . ' ' . $ret->get_error_message()
|
286 |
-
)
|
287 |
-
|
288 |
-
// https://wordpress.org/support/topic/deactivated-after-updte-why/#post-6994655
|
289 |
-
$zip = new ZipArchive;
|
290 |
-
if ( TRUE !== $zip->open( $src ) )
|
291 |
-
throw new Exception(
|
292 |
-
sprintf(
|
293 |
-
__( 'Unable to read %s. Please check permission.', 'ip-geo-block' ),
|
294 |
-
$src
|
295 |
-
)
|
296 |
-
);
|
297 |
-
|
298 |
-
if ( FALSE === @$zip->extractTo( $tmp ) ) {
|
299 |
-
$zip->close();
|
300 |
-
throw new Exception(
|
301 |
-
sprintf(
|
302 |
-
__( 'Unable to write %s. Please check permission.', 'ip-geo-block' ),
|
303 |
-
$tmp . basename( $filename )
|
304 |
-
)
|
305 |
-
);
|
306 |
-
}
|
307 |
-
|
308 |
-
$zip->close();
|
309 |
-
}
|
310 |
|
311 |
if ( FALSE === ( $gz = @fopen( $tmp .= basename( $filename ), 'r' ) ) )
|
312 |
throw new Exception(
|
@@ -334,37 +322,24 @@ class IP_Geo_Block_Cron {
|
|
334 |
else {
|
335 |
throw new Exception( __( 'gz or zip is not supported on your system.', 'ip-geo-block' ) );
|
336 |
}
|
337 |
-
|
338 |
-
if ( ! empty( $fp ) ) {
|
339 |
-
fflush( $fp ); // flush output before releasing the lock
|
340 |
-
flock ( $fp, LOCK_UN ); // release the lock
|
341 |
-
fclose( $fp );
|
342 |
-
}
|
343 |
-
|
344 |
-
! empty( $gz ) and gzclose( $gz );
|
345 |
-
! empty( $tmp ) && @is_file( $tmp ) and @unlink( $tmp );
|
346 |
-
! is_wp_error( $src ) && @is_file( $src ) and @unlink( $src );
|
347 |
}
|
348 |
|
349 |
// error handler
|
350 |
catch ( Exception $e ) {
|
351 |
-
|
352 |
-
|
353 |
-
flock ( $fp, LOCK_UN ); // release the lock
|
354 |
-
fclose( $fp );
|
355 |
-
}
|
356 |
-
|
357 |
-
! empty( $gz ) and gzclose( $gz );
|
358 |
-
! empty( $tmp ) && @is_file( $tmp ) and @unlink( $tmp );
|
359 |
-
! is_wp_error( $src ) && @is_file( $src ) and @unlink( $src );
|
360 |
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
);
|
365 |
}
|
366 |
|
367 |
-
|
|
|
|
|
|
|
|
|
368 |
'code' => $code,
|
369 |
'message' => sprintf(
|
370 |
__( 'Last update: %s', 'ip-geo-block' ),
|
@@ -372,6 +347,9 @@ class IP_Geo_Block_Cron {
|
|
372 |
),
|
373 |
'filename' => $filename,
|
374 |
'modified' => $modified,
|
|
|
|
|
|
|
375 |
);
|
376 |
}
|
377 |
|
44 |
* 1. Plugin is activated
|
45 |
* 2. WP Cron is kicked
|
46 |
* under the following condition:
|
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 |
|
54 |
+
// extract ip address from transient API to confirm the request source
|
55 |
+
add_filter( IP_Geo_Block::PLUGIN_NAME . '-ip-addr', array( __CLASS__, 'extract_ip' ) );
|
56 |
+
|
57 |
// download database files (higher priority order)
|
58 |
foreach ( $providers = IP_Geo_Block_Provider::get_addons() as $provider ) {
|
59 |
+
if ( $geo = IP_Geo_Block_API::get_instance( $provider, $settings ) ) {
|
60 |
$res[ $provider ] = $geo->download( $settings[ $provider ], $args );
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
// re-schedule cron job
|
63 |
+
self::schedule_cron_job( $settings['update'], $settings[ $provider ], FALSE );
|
64 |
|
65 |
+
// update option settings
|
66 |
+
self::update_settings( $settings, array( 'update', $provider ) );
|
|
|
67 |
|
68 |
+
// update matching rule immediately
|
69 |
+
if ( $immediate && FALSE !== ( $stat = get_transient( IP_Geo_Block::CRON_NAME ) ) && 'done' !== $stat ) {
|
70 |
+
$validate = IP_Geo_Block::get_geolocation( NULL, array( $provider ) );
|
71 |
+
$validate = IP_Geo_Block::validate_country( NULL, $validate, $settings );
|
72 |
|
73 |
+
// if blocking may happen then disable validation
|
74 |
+
if ( -1 !== (int)$settings['matching_rule'] && 'passed' !== $validate['result'] &&
|
75 |
+
( empty( $_SERVER['HTTP_X_REQUESTED_FROM'] ) || FALSE === strpos( $_SERVER['HTTP_X_REQUESTED_FROM'], 'InfiniteWP' ) ) ) {
|
76 |
+
$settings['matching_rule'] = -1;
|
77 |
+
}
|
78 |
|
79 |
+
// setup country code if it needs to be initialized
|
80 |
+
if ( -1 === (int)$settings['matching_rule'] && 'ZZ' !== $validate['code'] ) {
|
81 |
+
$settings['matching_rule'] = 0; // white list
|
82 |
|
83 |
+
if ( FALSE === strpos( $settings['white_list'], $validate['code'] ) )
|
84 |
+
$settings['white_list'] .= ( $settings['white_list'] ? ',' : '' ) . $validate['code'];
|
|
|
85 |
|
86 |
+
// update option settings
|
87 |
+
self::update_settings( $settings, array( 'matching_rule', 'white_list' ) );
|
88 |
|
89 |
+
// finished to update matching rule
|
90 |
+
set_transient( IP_Geo_Block::CRON_NAME, 'done', 5 * MINUTE_IN_SECONDS );
|
91 |
+
}
|
92 |
+
}
|
93 |
+
}
|
94 |
}
|
95 |
|
96 |
return isset( $res ) ? $res : NULL;
|
101 |
*
|
102 |
*/
|
103 |
private static function update_settings( $src, $keys = array() ) {
|
104 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
|
|
105 |
|
106 |
+
// for multisite (@since 3.0.0 in wp-admin/includes/plugin.php)
|
107 |
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
|
108 |
global $wpdb;
|
109 |
+
$blog_ids = $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" );
|
|
|
110 |
|
111 |
foreach ( $blog_ids as $id ) {
|
112 |
switch_to_blog( $id );
|
117 |
}
|
118 |
|
119 |
update_option( IP_Geo_Block::OPTION_NAME, $dst );
|
120 |
+
restore_current_blog();
|
121 |
}
|
|
|
|
|
122 |
}
|
123 |
|
124 |
// for single site
|
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 |
}
|
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';
|
166 |
+
|
167 |
+
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
|
168 |
+
global $wpdb;
|
169 |
+
$blog_ids = $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" );
|
170 |
+
|
171 |
+
foreach ( $blog_ids as $id ) {
|
172 |
+
switch_to_blog( $id );
|
173 |
+
IP_Geo_Block_Logs::delete_expired_cache( $settings['cache_time'] );
|
174 |
+
restore_current_blog();
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
// for single site
|
179 |
+
else {
|
180 |
+
IP_Geo_Block_Logs::delete_expired_cache( $settings['cache_time'] );
|
181 |
+
}
|
182 |
+
|
183 |
self::stop_cache_gc();
|
184 |
self::start_cache_gc( $settings );
|
185 |
}
|
203 |
* @return array status message.
|
204 |
*/
|
205 |
public static function download_zip( $url, $args, $filename, $modified ) {
|
206 |
+
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
|
207 |
+
$fs = IP_Geo_Block_FS::init( 'download_zip' );
|
208 |
|
209 |
// if the name of src file is changed, then update the dst
|
210 |
+
if ( basename( $filename ) !== ( $base = pathinfo( $url, PATHINFO_FILENAME ) ) )
|
211 |
$filename = dirname( $filename ) . '/' . $base;
|
|
|
212 |
|
213 |
// check file
|
214 |
if ( ! file_exists( $filename ) )
|
287 |
}
|
288 |
}
|
289 |
|
290 |
+
elseif ( 'zip' === $args && class_exists( 'ZipArchive', FALSE ) ) {
|
|
|
|
|
291 |
$tmp = get_temp_dir(); // @since 2.5
|
292 |
+
$ret = $fs->unzip_file( $src, $tmp ); // @since 2.5
|
293 |
|
294 |
+
if ( is_wp_error( $ret ) )
|
|
|
295 |
throw new Exception(
|
296 |
$ret->get_error_code() . ' ' . $ret->get_error_message()
|
297 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
|
299 |
if ( FALSE === ( $gz = @fopen( $tmp .= basename( $filename ), 'r' ) ) )
|
300 |
throw new Exception(
|
322 |
else {
|
323 |
throw new Exception( __( 'gz or zip is not supported on your system.', 'ip-geo-block' ) );
|
324 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
}
|
326 |
|
327 |
// error handler
|
328 |
catch ( Exception $e ) {
|
329 |
+
$err = new WP_Error( $e->getCode(), $e->getMessage() );
|
330 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
+
if ( ! empty( $fp ) ) {
|
333 |
+
fflush( $fp ); // flush output before releasing the lock
|
334 |
+
flock ( $fp, LOCK_UN ); // release the lock
|
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' ),
|
347 |
),
|
348 |
'filename' => $filename,
|
349 |
'modified' => $modified,
|
350 |
+
) : array(
|
351 |
+
'code' => $err->get_error_code(),
|
352 |
+
'message' => $err->get_error_message(),
|
353 |
);
|
354 |
}
|
355 |
|
classes/class-ip-geo-block-file.php
ADDED
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* IP Geo Block - Filesystem
|
4 |
+
*
|
5 |
+
* @package IP_Geo_Block
|
6 |
+
* @author tokkonopapa <tokkonopapa@yahoo.com>
|
7 |
+
* @license GPL-2.0+
|
8 |
+
* @link http://www.ipgeoblock.com/
|
9 |
+
* @link https://codex.wordpress.org/Filesystem_API
|
10 |
+
* @copyright 2017 tokkonopapa
|
11 |
+
*/
|
12 |
+
|
13 |
+
class IP_Geo_Block_FS {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Private variables of this class.
|
17 |
+
*
|
18 |
+
*/
|
19 |
+
private static $instance = NULL;
|
20 |
+
private static $method = 'direct';
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Create an instance of this class.
|
24 |
+
*
|
25 |
+
*/
|
26 |
+
private static function get_instance() {
|
27 |
+
return self::$instance ? self::$instance : ( self::$instance = new self );
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Initialize and return instance of this class.
|
32 |
+
*
|
33 |
+
*/
|
34 |
+
public static function init( $msg = NULL ) {
|
35 |
+
require_once ABSPATH . 'wp-admin/includes/template.php'; // for submit_button() in request_filesystem_credentials()
|
36 |
+
require_once ABSPATH . 'wp-admin/includes/file.php'; // for get_filesystem_method(), request_filesystem_credentials()
|
37 |
+
global $wp_filesystem;
|
38 |
+
|
39 |
+
// check already assigned by WP_Filesystem()
|
40 |
+
if ( empty( $wp_filesystem ) ) {
|
41 |
+
if (0) {
|
42 |
+
// https://codex.wordpress.org/Filesystem_API#Tips_and_Tricks
|
43 |
+
if ( 'direct' === ( self::$method = get_filesystem_method() ) ) { // @since 2.5.0
|
44 |
+
// request_filesystem_credentials() can be run without any issues and don't need to worry about passing in a URL
|
45 |
+
$creds = request_filesystem_credentials( admin_url(), '', FALSE, FALSE, NULL ); // @since 2.5.0
|
46 |
+
|
47 |
+
// initialize the API @since 2.5.0
|
48 |
+
WP_Filesystem( $creds );
|
49 |
+
}
|
50 |
+
|
51 |
+
elseif ( class_exists( 'IP_Geo_Block_Admin', FALSE ) ) {
|
52 |
+
IP_Geo_Block_Admin::add_admin_notice(
|
53 |
+
'error',
|
54 |
+
sprintf( __( 'This plugin does not support method “%s” for FTP or SSH based file operations. Please refer to <a href="https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants" title="Editing wp-config.php « WordPress Codex">this document</a> for more details.', 'ip-geo-block' ), self::$method )
|
55 |
+
);
|
56 |
+
}
|
57 |
+
} else {
|
58 |
+
// Determines the method on the filesystem.
|
59 |
+
self::$method = get_filesystem_method();
|
60 |
+
|
61 |
+
if ( FALSE !== ( $creds = request_filesystem_credentials( admin_url(), '', FALSE, FALSE, NULL ) ) ) {
|
62 |
+
WP_Filesystem( $creds );
|
63 |
+
}
|
64 |
+
|
65 |
+
elseif ( class_exists( 'IP_Geo_Block_Admin', FALSE ) ) {
|
66 |
+
IP_Geo_Block_Admin::add_admin_notice(
|
67 |
+
'error',
|
68 |
+
__( 'You should define some constants in your <code>wp-config.php</code> for FTP or SSH based file operations. Please refer to <a href="https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants" title="Editing wp-config.php « WordPress Codex">this document</a> for more details.', 'ip-geo-block' )
|
69 |
+
);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
return self::get_instance();
|
75 |
+
}
|
76 |
+
|
77 |
+
// Add slash at the end of string.
|
78 |
+
private function slashit( $string ) {
|
79 |
+
return rtrim( $string, '/\\' ) . '/';
|
80 |
+
}
|
81 |
+
|
82 |
+
// Get absolute path.
|
83 |
+
private function absolute_path( $file ) {
|
84 |
+
if ( 'direct' !== self::$method ) {
|
85 |
+
global $wp_filesystem;
|
86 |
+
$path = str_replace( ABSPATH, $wp_filesystem->abspath(), dirname( $file ) );
|
87 |
+
$file = $this->slashit( $path ) . basename( $file );
|
88 |
+
}
|
89 |
+
|
90 |
+
return $file;
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Check if a file or directory exists.
|
95 |
+
*
|
96 |
+
* @param string $file Path to file/directory.
|
97 |
+
* @return bool Whether $file exists or not.
|
98 |
+
*/
|
99 |
+
public function exists( $file ) {
|
100 |
+
global $wp_filesystem;
|
101 |
+
if ( empty( $wp_filesystem ) )
|
102 |
+
return FALSE;
|
103 |
+
|
104 |
+
return $wp_filesystem->exists( $this->absolute_path( $file ) );
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Validate if path is file
|
109 |
+
*
|
110 |
+
* @param string $path
|
111 |
+
* @return bool
|
112 |
+
*/
|
113 |
+
public function is_file( $path ) {
|
114 |
+
global $wp_filesystem;
|
115 |
+
if ( empty( $wp_filesystem ) )
|
116 |
+
return FALSE;
|
117 |
+
|
118 |
+
return $wp_filesystem->is_file( $this->absolute_path( $path ) );
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Validate if path is directory
|
123 |
+
*
|
124 |
+
* @param string $path
|
125 |
+
* @return bool
|
126 |
+
*/
|
127 |
+
public function is_dir( $path ) {
|
128 |
+
global $wp_filesystem;
|
129 |
+
if ( empty( $wp_filesystem ) )
|
130 |
+
return FALSE;
|
131 |
+
|
132 |
+
return $wp_filesystem->is_dir( $this->absolute_path( $path ) );
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Check if a file is readable.
|
137 |
+
*
|
138 |
+
* @param string $file Path to file.
|
139 |
+
* @return bool Whether $file is readable.
|
140 |
+
*/
|
141 |
+
public function is_readable( $file ) {
|
142 |
+
global $wp_filesystem;
|
143 |
+
if ( empty( $wp_filesystem ) )
|
144 |
+
return FALSE;
|
145 |
+
|
146 |
+
return $wp_filesystem->is_readable( $this->absolute_path( $file ) );
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Check if a file or directory is writable.
|
151 |
+
*
|
152 |
+
* @param string $file Path to file.
|
153 |
+
* @return bool Whether $file is writable.
|
154 |
+
*/
|
155 |
+
public function is_writable( $file ) {
|
156 |
+
global $wp_filesystem;
|
157 |
+
if ( empty( $wp_filesystem ) )
|
158 |
+
return FALSE;
|
159 |
+
|
160 |
+
return $wp_filesystem->is_writable( $this->absolute_path( $file ) );
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Make a directory
|
165 |
+
*
|
166 |
+
* @param string $path
|
167 |
+
* @param mixed $chmod
|
168 |
+
* @param mixed $chown
|
169 |
+
* @param mixed $chgrp
|
170 |
+
* @return bool
|
171 |
+
*/
|
172 |
+
public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
|
173 |
+
global $wp_filesystem;
|
174 |
+
if ( empty( $wp_filesystem ) )
|
175 |
+
return FALSE;
|
176 |
+
|
177 |
+
return $wp_filesystem->mkdir( $this->absolute_path( $path ), $chmod, $chown, $chgrp );
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Delete a file or directory.
|
182 |
+
*
|
183 |
+
* @param string $file Path to the file.
|
184 |
+
* @param bool $recursive If set True changes file group recursively.
|
185 |
+
* @param bool $type Type of resource. 'f' for file, 'd' for directory.
|
186 |
+
* @return bool True if the file or directory was deleted, false on failure.
|
187 |
+
*/
|
188 |
+
public function delete( $file, $recursive = FALSE, $type = FALSE ) {
|
189 |
+
global $wp_filesystem;
|
190 |
+
if ( empty( $wp_filesystem ) )
|
191 |
+
return FALSE;
|
192 |
+
|
193 |
+
return $wp_filesystem->delete( $this->absolute_path( $file ), $recursive, $type );
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Copy a file.
|
198 |
+
*
|
199 |
+
* @param string $src
|
200 |
+
* @param string $dst
|
201 |
+
* @param bool $overwrite
|
202 |
+
* @param int $mode
|
203 |
+
* @return bool
|
204 |
+
*/
|
205 |
+
public function copy( $src, $dst, $overwrite = FALSE, $mode = FALSE ) {
|
206 |
+
global $wp_filesystem;
|
207 |
+
if ( empty( $wp_filesystem ) )
|
208 |
+
return FALSE;
|
209 |
+
|
210 |
+
return $wp_filesystem->copy(
|
211 |
+
$this->absolute_path( $src ),
|
212 |
+
$this->absolute_path( $dst ),
|
213 |
+
$overwrite, $mode
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Write a string to a file with an exclusive lock.
|
219 |
+
*
|
220 |
+
* @param string $file Remote path to the file where to write the data.
|
221 |
+
* @param string $contents The data to write.
|
222 |
+
* @param int $mode The file permissions as octal number, usually 0644. Default false.
|
223 |
+
* @return bool
|
224 |
+
*/
|
225 |
+
public function put_contents( $file, $contents, $mode = FALSE ) {
|
226 |
+
global $wp_filesystem;
|
227 |
+
if ( empty( $wp_filesystem ) )
|
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;
|
244 |
+
if ( empty( $wp_filesystem ) )
|
245 |
+
return array();
|
246 |
+
|
247 |
+
// http://php.net/manual/en/function.file.php#refsect1-function.file-returnvalues
|
248 |
+
@ini_set( 'auto_detect_line_endings', TRUE );
|
249 |
+
|
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 |
+
/**
|
258 |
+
* Unzips a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.
|
259 |
+
*
|
260 |
+
* @param string $src Full path and filename of zip archive.
|
261 |
+
* @param string $dst Full path on the filesystem to extract archive to.
|
262 |
+
* @return WP_Error on failure, True on success
|
263 |
+
*/
|
264 |
+
public function unzip_file( $src, $dst ) {
|
265 |
+
return unzip_file( $src, $this->absolute_path( $dst ) );
|
266 |
+
}
|
267 |
+
|
268 |
+
}
|
classes/class-ip-geo-block-logs.php
CHANGED
@@ -332,8 +332,7 @@ class IP_Geo_Block_Logs {
|
|
332 |
* These data must be sanitized before rendering
|
333 |
*/
|
334 |
private static function get_user_agent() {
|
335 |
-
return isset( $_SERVER['HTTP_USER_AGENT'] ) ?
|
336 |
-
self::truncate_utf8( $_SERVER['HTTP_USER_AGENT'] ) : '';
|
337 |
}
|
338 |
|
339 |
private static function get_http_headers() {
|
@@ -357,9 +356,7 @@ class IP_Geo_Block_Logs {
|
|
357 |
$headers[] = $key . '=' . $_SERVER[ $key ];
|
358 |
}
|
359 |
|
360 |
-
return self::truncate_utf8(
|
361 |
-
implode( ',', $headers ), NULL, '', IP_GEO_BLOCK_MAX_STR_LEN
|
362 |
-
);
|
363 |
}
|
364 |
|
365 |
private static function get_post_data( $hook, $validate, $settings ) {
|
@@ -369,7 +366,7 @@ class IP_Geo_Block_Logs {
|
|
369 |
// XML-RPC
|
370 |
if ( 'xmlrpc' === $hook ) {
|
371 |
$posts = self::truncate_utf8(
|
372 |
-
file_get_contents( 'php://input' ), '!\s*([<>])\s*!', '$1'
|
373 |
);
|
374 |
|
375 |
// mask the password
|
@@ -378,70 +375,64 @@ class IP_Geo_Block_Logs {
|
|
378 |
strpos( $matches[1][1], home_url() ) !== 0 ) { // except pingback
|
379 |
$posts = str_replace( $matches[1][1], '***', $posts );
|
380 |
}
|
381 |
-
|
382 |
-
|
383 |
-
if ( $mask_pwd && 'wp.' === substr( $xml->methodName, 0, 3 ) ) {
|
384 |
-
$xml->params->param[1]->value->string = '***';
|
385 |
-
}
|
386 |
-
$posts = self::truncate_utf8( wp_json_encode( $xml ), '/["\\\\]/' );
|
387 |
-
} else {
|
388 |
-
$posts = 'xml parse error: malformed xml';
|
389 |
-
}*/
|
390 |
}
|
391 |
|
392 |
// post data
|
393 |
else {
|
394 |
-
$keys
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
|
|
|
|
400 |
}
|
401 |
|
402 |
-
//
|
403 |
-
$posts
|
404 |
-
|
405 |
-
|
|
|
|
|
|
|
|
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
|
412 |
-
|
|
|
413 |
}
|
414 |
|
415 |
/**
|
416 |
* Backup the validation log to text files
|
417 |
*
|
418 |
-
* Note: $path should not be within the public_html.
|
419 |
*/
|
420 |
private static function backup_logs( $hook, $validate, $method, $agent, $heads, $posts, $path ) {
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
str_replace( ',', '‚', $agent ), // , --> ‚
|
440 |
-
str_replace( ',', '‚', $heads ), // , --> ‚
|
441 |
-
str_replace( ',', '‚', $posts ) // , --> ‚
|
442 |
-
);
|
443 |
-
|
444 |
-
fclose( $fp );
|
445 |
}
|
446 |
|
447 |
/**
|
@@ -465,6 +456,10 @@ class IP_Geo_Block_Logs {
|
|
465 |
$posts = self::get_post_data( $hook, $validate, $settings );
|
466 |
$method = $_SERVER['REQUEST_METHOD'] . '[' . $_SERVER['SERVER_PORT'] . ']:' . $_SERVER['REQUEST_URI'];
|
467 |
|
|
|
|
|
|
|
|
|
468 |
// anonymize ip address
|
469 |
if ( ! empty( $settings['anonymize'] ) )
|
470 |
$validate['ip'] = preg_replace( '/\d{1,3}$/', '***', $validate['ip'] );
|
@@ -557,7 +552,7 @@ class IP_Geo_Block_Logs {
|
|
557 |
$stat['providers'][ $provider ] = array( 'count' => 0, 'time' => 0.0 );
|
558 |
|
559 |
$stat['providers'][ $provider ]['count']++; // undefined in auth_fail()
|
560 |
-
$stat['providers'][ $provider ]['time' ] += (float)
|
561 |
|
562 |
if ( 'passed' !== $validate['result'] ) {
|
563 |
// Blocked by type of IP address
|
@@ -566,14 +561,14 @@ class IP_Geo_Block_Logs {
|
|
566 |
elseif ( filter_var( $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) )
|
567 |
++$stat['IPv6'];
|
568 |
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
}
|
573 |
|
574 |
-
if ( count( $stat['daystats'] ) > max( 30, min( 365, (int)
|
575 |
-
reset( $stat['daystats'] );
|
576 |
-
unset( $stat['daystats'][ key( $stat['daystats'] ) ] );
|
577 |
}
|
578 |
|
579 |
// Record statistics.
|
@@ -617,8 +612,9 @@ class IP_Geo_Block_Logs {
|
|
617 |
}
|
618 |
|
619 |
// sort by 'time'
|
620 |
-
foreach ( $cache as $key => $val )
|
621 |
$hash[ $key ] = $val['time'];
|
|
|
622 |
|
623 |
array_multisort( $hash, SORT_DESC, $cache );
|
624 |
|
@@ -665,9 +661,23 @@ class IP_Geo_Block_Logs {
|
|
665 |
$table = $wpdb->prefix . IP_Geo_Block::CACHE_NAME;
|
666 |
|
667 |
$sql = $wpdb->prepare(
|
668 |
-
"DELETE FROM `$table` WHERE `time` < %d",
|
669 |
-
|
670 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
|
672 |
return $result;
|
673 |
}
|
@@ -679,7 +689,7 @@ class IP_Geo_Block_Logs {
|
|
679 |
private static function error( $line ) {
|
680 |
global $wpdb;
|
681 |
if ( $wpdb->last_error ) {
|
682 |
-
if ( class_exists( 'IP_Geo_Block_Admin' ) )
|
683 |
IP_Geo_Block_Admin::add_admin_notice( 'error', __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
|
684 |
|
685 |
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG )
|
332 |
* These data must be sanitized before rendering
|
333 |
*/
|
334 |
private static function get_user_agent() {
|
335 |
+
return isset( $_SERVER['HTTP_USER_AGENT'] ) ? self::truncate_utf8( $_SERVER['HTTP_USER_AGENT'] ) : '';
|
|
|
336 |
}
|
337 |
|
338 |
private static function get_http_headers() {
|
356 |
$headers[] = $key . '=' . $_SERVER[ $key ];
|
357 |
}
|
358 |
|
359 |
+
return self::truncate_utf8( implode( ',', $headers ) );
|
|
|
|
|
360 |
}
|
361 |
|
362 |
private static function get_post_data( $hook, $validate, $settings ) {
|
366 |
// XML-RPC
|
367 |
if ( 'xmlrpc' === $hook ) {
|
368 |
$posts = self::truncate_utf8(
|
369 |
+
file_get_contents( 'php://input' ), '!\s*([<>])\s*!', '$1'
|
370 |
);
|
371 |
|
372 |
// mask the password
|
375 |
strpos( $matches[1][1], home_url() ) !== 0 ) { // except pingback
|
376 |
$posts = str_replace( $matches[1][1], '***', $posts );
|
377 |
}
|
378 |
+
|
379 |
+
return $posts;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
}
|
381 |
|
382 |
// post data
|
383 |
else {
|
384 |
+
$keys = explode( ',', $settings['validation']['postkey'] );
|
385 |
+
$data = array();
|
386 |
+
$posts = $_POST;
|
387 |
+
|
388 |
+
// uploading files
|
389 |
+
if ( ! empty( $_FILES ) ) {
|
390 |
+
$posts['FILES'] = str_replace( PHP_EOL, ' ', print_r( $_FILES, TRUE ) );
|
391 |
+
! in_array( 'FILES', $keys, TRUE ) and $keys[] = 'FILES';
|
392 |
}
|
393 |
|
394 |
+
// mask the password
|
395 |
+
if ( ! empty( $posts['pwd'] ) && $mask_pwd )
|
396 |
+
$posts['pwd'] = '***';
|
397 |
+
|
398 |
+
// primaly: $_POST keys
|
399 |
+
foreach ( $keys as $key ) {
|
400 |
+
array_key_exists( $key, $posts ) and $data[] = $key . '=' . $posts[ $key ];
|
401 |
+
}
|
402 |
|
403 |
+
// secondary: rest of the keys in $_POST
|
404 |
+
foreach ( array_keys( $_POST ) as $key ) {
|
405 |
+
! in_array( $key, $keys, TRUE ) and $data[] = $key;
|
406 |
+
}
|
407 |
|
408 |
+
return self::truncate_utf8( implode( ',', $data ), '/\s+/', ' ' );
|
409 |
+
}
|
410 |
}
|
411 |
|
412 |
/**
|
413 |
* Backup the validation log to text files
|
414 |
*
|
415 |
+
* Note: $path should be absolute to the directory and should not be within the public_html.
|
416 |
*/
|
417 |
private static function backup_logs( $hook, $validate, $method, $agent, $heads, $posts, $path ) {
|
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'],
|
427 |
+
$validate['result'],
|
428 |
+
$method,
|
429 |
+
str_replace( ',', '‚', $agent ), // , --> ‚
|
430 |
+
str_replace( ',', '‚', $heads ), // , --> ‚
|
431 |
+
str_replace( ',', '‚', $posts ) // , --> ‚
|
432 |
+
),
|
433 |
+
FILE_APPEND | LOCK_EX
|
434 |
+
);
|
435 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
}
|
437 |
|
438 |
/**
|
456 |
$posts = self::get_post_data( $hook, $validate, $settings );
|
457 |
$method = $_SERVER['REQUEST_METHOD'] . '[' . $_SERVER['SERVER_PORT'] . ']:' . $_SERVER['REQUEST_URI'];
|
458 |
|
459 |
+
// mark if malicious upload exists
|
460 |
+
if ( isset( $validate['upload'] ) )
|
461 |
+
$validate['result'] .= '*';
|
462 |
+
|
463 |
// anonymize ip address
|
464 |
if ( ! empty( $settings['anonymize'] ) )
|
465 |
$validate['ip'] = preg_replace( '/\d{1,3}$/', '***', $validate['ip'] );
|
552 |
$stat['providers'][ $provider ] = array( 'count' => 0, 'time' => 0.0 );
|
553 |
|
554 |
$stat['providers'][ $provider ]['count']++; // undefined in auth_fail()
|
555 |
+
$stat['providers'][ $provider ]['time' ] += (float)( isset( $validate['time'] ) ? $validate['time'] : 0 );
|
556 |
|
557 |
if ( 'passed' !== $validate['result'] ) {
|
558 |
// Blocked by type of IP address
|
561 |
elseif ( filter_var( $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) )
|
562 |
++$stat['IPv6'];
|
563 |
|
564 |
+
++$stat['blocked' ];
|
565 |
+
@++$stat['countries'][ $validate['code'] ];
|
566 |
+
@++$stat['daystats' ][ mktime( 0, 0, 0 ) ][ $hook ];
|
567 |
}
|
568 |
|
569 |
+
if ( count( $stat['daystats'] ) > max( 30, min( 365, (int)$settings['validation']['recdays'] ) ) ) {
|
570 |
+
reset( $stat['daystats'] ); // pointer to the top
|
571 |
+
unset( $stat['daystats'][ key( $stat['daystats'] ) ] ); // unset at the top
|
572 |
}
|
573 |
|
574 |
// Record statistics.
|
612 |
}
|
613 |
|
614 |
// sort by 'time'
|
615 |
+
foreach ( $cache as $key => $val ) {
|
616 |
$hash[ $key ] = $val['time'];
|
617 |
+
}
|
618 |
|
619 |
array_multisort( $hash, SORT_DESC, $cache );
|
620 |
|
661 |
$table = $wpdb->prefix . IP_Geo_Block::CACHE_NAME;
|
662 |
|
663 |
$sql = $wpdb->prepare(
|
664 |
+
"DELETE FROM `$table` WHERE `time` < %d", $_SERVER['REQUEST_TIME'] - $cache_time
|
665 |
+
) and $result = ( FALSE !== $wpdb->query( $sql ) ) or self::error( __LINE__ );
|
666 |
+
|
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 |
}
|
689 |
private static function error( $line ) {
|
690 |
global $wpdb;
|
691 |
if ( $wpdb->last_error ) {
|
692 |
+
if ( class_exists( 'IP_Geo_Block_Admin', FALSE ) )
|
693 |
IP_Geo_Block_Admin::add_admin_notice( 'error', __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
|
694 |
|
695 |
if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG )
|
classes/class-ip-geo-block-opts.php
CHANGED
@@ -26,7 +26,7 @@ class IP_Geo_Block_Opts {
|
|
26 |
'matching_rule' => -1, // -1:neither, 0:white list, 1:black list
|
27 |
'white_list' => NULL, // Comma separeted country code
|
28 |
'black_list' => 'ZZ', // Comma separeted country code
|
29 |
-
'timeout' =>
|
30 |
'response_code' => 403, // Response code
|
31 |
'save_statistics' => TRUE, // Record validation statistics
|
32 |
'clean_uninstall' => FALSE, // Remove all savings from DB
|
@@ -45,7 +45,7 @@ class IP_Geo_Block_Opts {
|
|
45 |
'xmlrpc' => 1, // Validate on xmlrpc (1:country 2:close)
|
46 |
'proxy' => NULL, // $_SERVER variables for IPs
|
47 |
'reclogs' => 1, // 1:blocked 2:passed 3:unauth 4:auth 5:all
|
48 |
-
'postkey' =>
|
49 |
// since version 1.3.1
|
50 |
'maxlogs' => 100, // Max number of rows of log
|
51 |
'backup' => NULL, // Absolute path to directory for backup logs
|
@@ -60,6 +60,9 @@ class IP_Geo_Block_Opts {
|
|
60 |
'uploads' => 3, // for UPLOADS/uploads
|
61 |
'languages' => 3, // for WP_CONTENT_DIR/language
|
62 |
'public' => 0, // Validate on public facing pages
|
|
|
|
|
|
|
63 |
),
|
64 |
'update' => array( // Updating IP address DB
|
65 |
'auto' => TRUE, // Auto updating of DB file
|
@@ -79,7 +82,6 @@ class IP_Geo_Block_Opts {
|
|
79 |
'plugins' => FALSE, // for wp-content/plugins
|
80 |
'themes' => FALSE, // for wp-content/themes
|
81 |
// since version 3.0.0
|
82 |
-
'public' => FALSE, // for public facing pages
|
83 |
'includes' => FALSE, // for wp-includes/
|
84 |
'uploads' => FALSE, // for UPLOADS/uploads
|
85 |
'languages' => FALSE, // for wp-content/language
|
@@ -115,6 +117,8 @@ class IP_Geo_Block_Opts {
|
|
115 |
'includes' => array(), // for wp-includes/
|
116 |
'uploads' => array(), // for UPLOADS/uploads
|
117 |
'languages' => array(), // for wp-content/language
|
|
|
|
|
118 |
),
|
119 |
// since version 2.2.7
|
120 |
'api_key' => array( // API key
|
@@ -124,26 +128,37 @@ class IP_Geo_Block_Opts {
|
|
124 |
'login_action' => array( // Actions for wp-login.php
|
125 |
'login' => TRUE,
|
126 |
'register' => TRUE,
|
127 |
-
'
|
128 |
'lostpassword' => TRUE,
|
129 |
'postpass' => TRUE,
|
130 |
),
|
131 |
// since version 3.0.0
|
132 |
'response_msg' => 'Sorry, your request cannot be accepted.', // message on blocking
|
133 |
'redirect_uri' => 'http://blackhole.webpagetest.org/', // redirection on blocking
|
134 |
-
'network_wide' => FALSE,
|
135 |
'public' => array(
|
136 |
-
'matching_rule' => -1,
|
137 |
-
'white_list' => NULL,
|
138 |
-
'black_list' => 'ZZ',
|
139 |
-
'target_rule' => 0,
|
140 |
'target_pages' => array(), // blocking target of pages
|
141 |
'target_posts' => array(), // blocking target of post types
|
142 |
'target_cates' => array(), // blocking target of categories
|
143 |
'target_tags' => array(), // blocking target of tags
|
144 |
-
'ua_list' => "Google:HOST,bot:HOST,slurp:HOST\nspider:HOST,archive:HOST,*:FEED\
|
145 |
'simulate' => FALSE, // just simulate, never block
|
|
|
|
|
|
|
|
|
|
|
146 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
);
|
148 |
|
149 |
/**
|
@@ -151,12 +166,50 @@ class IP_Geo_Block_Opts {
|
|
151 |
*
|
152 |
*/
|
153 |
public static function get_default() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
return self::$option_table;
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
* Upgrade option table
|
159 |
-
*
|
160 |
*/
|
161 |
public static function upgrade() {
|
162 |
$default = self::get_default();
|
@@ -279,12 +332,32 @@ class IP_Geo_Block_Opts {
|
|
279 |
if ( version_compare( $version, '3.0.1' ) < 0 )
|
280 |
delete_transient( IP_Geo_Block::CACHE_NAME ); // @since 2.8
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
// save package version number
|
283 |
$settings['version'] = IP_Geo_Block::VERSION;
|
284 |
}
|
285 |
|
286 |
// install addons for IP Geolocation database API ver. 1.1.8
|
287 |
-
|
|
|
288 |
$settings['api_dir'] = self::install_api( $settings );
|
289 |
|
290 |
// update option table
|
@@ -298,27 +371,30 @@ class IP_Geo_Block_Opts {
|
|
298 |
* Install / Uninstall APIs
|
299 |
*
|
300 |
*/
|
301 |
-
|
302 |
$src = IP_GEO_BLOCK_PATH . 'wp-content/' . IP_Geo_Block::GEOAPI_NAME;
|
303 |
$dst = self::get_api_dir( $settings );
|
304 |
|
305 |
-
|
306 |
-
|
307 |
-
self::recurse_copy( $src, $dst )
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
312 |
|
313 |
-
|
|
|
314 |
}
|
315 |
|
316 |
return $dst;
|
317 |
}
|
318 |
|
319 |
public static function delete_api( $settings ) {
|
320 |
-
|
321 |
-
|
|
|
322 |
}
|
323 |
|
324 |
private static function get_api_dir( $settings ) {
|
@@ -344,38 +420,31 @@ class IP_Geo_Block_Opts {
|
|
344 |
|
345 |
// http://php.net/manual/function.copy.php#91010
|
346 |
private static function recurse_copy( $src, $dst ) {
|
|
|
|
|
|
|
347 |
$src = IP_Geo_Block_Util::slashit( $src );
|
348 |
$dst = IP_Geo_Block_Util::slashit( $dst );
|
349 |
|
350 |
-
!
|
351 |
|
352 |
if ( $dir = @opendir( $src ) ) {
|
353 |
while( FALSE !== ( $file = readdir( $dir ) ) ) {
|
354 |
if ( '.' !== $file && '..' !== $file ) {
|
355 |
-
if (
|
356 |
-
self::recurse_copy( $src.$file, $dst.$file )
|
357 |
-
|
358 |
-
|
|
|
|
|
|
|
359 |
}
|
360 |
}
|
361 |
|
362 |
closedir( $dir );
|
363 |
}
|
364 |
-
}
|
365 |
-
|
366 |
-
// http://php.net/manual/function.rmdir.php#110489
|
367 |
-
private static function recurse_rmdir( $dir ) {
|
368 |
-
$dir = IP_Geo_Block_Util::slashit( $dir );
|
369 |
-
$files = array_diff( @scandir( $dir ), array( '.', '..' ) );
|
370 |
|
371 |
-
|
372 |
-
if ( is_dir( $dir.$file ) )
|
373 |
-
self::recurse_rmdir( $dir.$file );
|
374 |
-
else
|
375 |
-
@unlink( $dir.$file );
|
376 |
-
}
|
377 |
-
|
378 |
-
return @rmdir( $dir );
|
379 |
}
|
380 |
|
381 |
/**
|
@@ -383,10 +452,14 @@ class IP_Geo_Block_Opts {
|
|
383 |
*
|
384 |
*/
|
385 |
private static function remove_mu_plugin() {
|
386 |
-
if ( file_exists( $src = WPMU_PLUGIN_DIR . '/ip-geo-block-mu.php' ) )
|
387 |
-
|
388 |
-
|
389 |
-
|
|
|
|
|
|
|
|
|
390 |
}
|
391 |
|
392 |
public static function get_validation_timing() {
|
@@ -404,11 +477,14 @@ class IP_Geo_Block_Opts {
|
|
404 |
$src = IP_GEO_BLOCK_PATH . 'wp-content/mu-plugins/ip-geo-block-mu.php';
|
405 |
$dst = WPMU_PLUGIN_DIR . '/ip-geo-block-mu.php';
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
|
|
|
|
|
|
|
410 |
|
411 |
-
if ( !
|
412 |
return $dst;
|
413 |
}
|
414 |
break;
|
26 |
'matching_rule' => -1, // -1:neither, 0:white list, 1:black list
|
27 |
'white_list' => NULL, // Comma separeted country code
|
28 |
'black_list' => 'ZZ', // Comma separeted country code
|
29 |
+
'timeout' => 6, // Timeout in second
|
30 |
'response_code' => 403, // Response code
|
31 |
'save_statistics' => TRUE, // Record validation statistics
|
32 |
'clean_uninstall' => FALSE, // Remove all savings from DB
|
45 |
'xmlrpc' => 1, // Validate on xmlrpc (1:country 2:close)
|
46 |
'proxy' => NULL, // $_SERVER variables for IPs
|
47 |
'reclogs' => 1, // 1:blocked 2:passed 3:unauth 4:auth 5:all
|
48 |
+
'postkey' => 'action,comment,log,pwd,FILES', // Keys in $_POST, $_FILES
|
49 |
// since version 1.3.1
|
50 |
'maxlogs' => 100, // Max number of rows of log
|
51 |
'backup' => NULL, // Absolute path to directory for backup logs
|
60 |
'uploads' => 3, // for UPLOADS/uploads
|
61 |
'languages' => 3, // for WP_CONTENT_DIR/language
|
62 |
'public' => 0, // Validate on public facing pages
|
63 |
+
// since version 3.0.3
|
64 |
+
'restapi' => 3, // for get_rest_url()
|
65 |
+
'mimetype' => 0, // 0:disable, 1:white_list, 2:black_list
|
66 |
),
|
67 |
'update' => array( // Updating IP address DB
|
68 |
'auto' => TRUE, // Auto updating of DB file
|
82 |
'plugins' => FALSE, // for wp-content/plugins
|
83 |
'themes' => FALSE, // for wp-content/themes
|
84 |
// since version 3.0.0
|
|
|
85 |
'includes' => FALSE, // for wp-includes/
|
86 |
'uploads' => FALSE, // for UPLOADS/uploads
|
87 |
'languages' => FALSE, // for wp-content/language
|
117 |
'includes' => array(), // for wp-includes/
|
118 |
'uploads' => array(), // for UPLOADS/uploads
|
119 |
'languages' => array(), // for wp-content/language
|
120 |
+
// since version 3.0.3
|
121 |
+
'restapi' => array(), // for get_rest_url()
|
122 |
),
|
123 |
// since version 2.2.7
|
124 |
'api_key' => array( // API key
|
128 |
'login_action' => array( // Actions for wp-login.php
|
129 |
'login' => TRUE,
|
130 |
'register' => TRUE,
|
131 |
+
'resetpass' => TRUE,
|
132 |
'lostpassword' => TRUE,
|
133 |
'postpass' => TRUE,
|
134 |
),
|
135 |
// since version 3.0.0
|
136 |
'response_msg' => 'Sorry, your request cannot be accepted.', // message on blocking
|
137 |
'redirect_uri' => 'http://blackhole.webpagetest.org/', // redirection on blocking
|
138 |
+
'network_wide' => FALSE, // settings page on network dashboard
|
139 |
'public' => array(
|
140 |
+
'matching_rule' => -1, // -1:follow, 0:white list, 1:black list
|
141 |
+
'white_list' => NULL, // Comma separeted country code
|
142 |
+
'black_list' => 'ZZ', // Comma separeted country code
|
143 |
+
'target_rule' => 0, // 0:all requests, 1:specify the target
|
144 |
'target_pages' => array(), // blocking target of pages
|
145 |
'target_posts' => array(), // blocking target of post types
|
146 |
'target_cates' => array(), // blocking target of categories
|
147 |
'target_tags' => array(), // blocking target of tags
|
148 |
+
'ua_list' => "Google:HOST,bot:HOST,slurp:HOST\nspider:HOST,archive:HOST,*:FEED\nembed.ly:HOST,Twitterbot:US,Facebot:US",
|
149 |
'simulate' => FALSE, // just simulate, never block
|
150 |
+
// since version 3.0.3
|
151 |
+
'dnslkup' => FALSE, // use DNS reverse lookup
|
152 |
+
'response_code' => 307, // better for AdSense
|
153 |
+
'redirect_uri' => NULL, // home
|
154 |
+
'response_msg' => 'Sorry, your request cannot be accepted.', // message on blocking
|
155 |
),
|
156 |
+
// since version 3.0.3
|
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 |
);
|
163 |
|
164 |
/**
|
166 |
*
|
167 |
*/
|
168 |
public static function get_default() {
|
169 |
+
// https://developer.wordpress.org/reference/functions/wp_get_mime_types/
|
170 |
+
// https://codex.wordpress.org/Uploading_Files#About_Uploading_Files_on_Dashboard
|
171 |
+
self::$option_table['mimetype']['white_list'] = array(
|
172 |
+
// Image formats.
|
173 |
+
'jpg|jpeg|jpe' => 'image/jpeg',
|
174 |
+
'gif' => 'image/gif',
|
175 |
+
'png' => 'image/png',
|
176 |
+
'ico' => 'image/x-icon',
|
177 |
+
|
178 |
+
// Video formats.
|
179 |
+
'wmv' => 'video/x-ms-wmv',
|
180 |
+
'avi' => 'video/avi',
|
181 |
+
'mov|qt' => 'video/quicktime',
|
182 |
+
'mpeg|mpg|mpe' => 'video/mpeg',
|
183 |
+
'mp4|m4v' => 'video/mp4',
|
184 |
+
'ogv' => 'video/ogg',
|
185 |
+
'3gp|3gpp' => 'video/3gpp',
|
186 |
+
'3g2|3gp2' => 'video/3gpp2',
|
187 |
+
|
188 |
+
// Audio formats.
|
189 |
+
'mp3|m4a|m4b' => 'audio/mpeg',
|
190 |
+
'wav' => 'audio/wav',
|
191 |
+
'ogg|oga' => 'audio/ogg',
|
192 |
+
|
193 |
+
// Misc application formats.
|
194 |
+
'pdf' => 'application/pdf',
|
195 |
+
'psd' => 'application/octet-stream',
|
196 |
+
|
197 |
+
// MS Office formats.
|
198 |
+
'doc' => 'application/msword',
|
199 |
+
'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
|
200 |
+
'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
|
201 |
+
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
202 |
+
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
203 |
+
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
204 |
+
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
|
205 |
+
'odt' => 'application/vnd.oasis.opendocument.text',
|
206 |
+
);
|
207 |
return self::$option_table;
|
208 |
}
|
209 |
|
210 |
/**
|
211 |
* Upgrade option table
|
212 |
+
* @since 3.0.3.1 This should be executed in admin context
|
213 |
*/
|
214 |
public static function upgrade() {
|
215 |
$default = self::get_default();
|
332 |
if ( version_compare( $version, '3.0.1' ) < 0 )
|
333 |
delete_transient( IP_Geo_Block::CACHE_NAME ); // @since 2.8
|
334 |
|
335 |
+
if ( version_compare( $version, '3.0.3' ) < 0 ) {
|
336 |
+
$settings['exception' ]['restapi' ] = $default['exception' ]['restapi' ];
|
337 |
+
$settings['validation' ]['restapi' ] = $default['validation']['restapi' ];
|
338 |
+
$settings['validation' ]['mimetype' ] = $default['validation']['mimetype' ];
|
339 |
+
$settings['public' ]['redirect_uri' ] = $default['public' ]['redirect_uri' ];
|
340 |
+
$settings['public' ]['response_msg' ] = $default['public' ]['response_msg' ];
|
341 |
+
$settings['public' ]['response_code'] = $default['public' ]['response_code'];
|
342 |
+
$settings['public' ]['dnslkup' ] = TRUE;
|
343 |
+
$settings['public' ]['ua_list' ] = str_replace( '*:HOST=embed.ly', 'embed.ly:HOST', $settings['public']['ua_list'] );
|
344 |
+
$settings['login_action']['resetpass' ] = @$settings['login_action']['resetpasss'];
|
345 |
+
$settings['mimetype' ] = $default['mimetype'];
|
346 |
+
$settings['others' ] = $default['others' ];
|
347 |
+
unset(
|
348 |
+
$settings['rewrite' ]['public' ], // unused @3.0.0
|
349 |
+
$settings['rewrite' ]['content' ], // unused @3.0.0
|
350 |
+
$settings['login_action']['resetpasss'] // mis-spelled
|
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
|
371 |
* Install / Uninstall APIs
|
372 |
*
|
373 |
*/
|
374 |
+
private static function install_api( $settings ) {
|
375 |
$src = IP_GEO_BLOCK_PATH . 'wp-content/' . IP_Geo_Block::GEOAPI_NAME;
|
376 |
$dst = self::get_api_dir( $settings );
|
377 |
|
378 |
+
if ( $src !== $dst ) {
|
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 |
+
}
|
389 |
}
|
390 |
|
391 |
return $dst;
|
392 |
}
|
393 |
|
394 |
public static function delete_api( $settings ) {
|
395 |
+
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
|
396 |
+
$fs = IP_Geo_Block_FS::init( 'delete_api' );
|
397 |
+
return $fs->delete( self::get_api_dir( $settings ), TRUE ); // $recursive = true
|
398 |
}
|
399 |
|
400 |
private static function get_api_dir( $settings ) {
|
420 |
|
421 |
// http://php.net/manual/function.copy.php#91010
|
422 |
private static function recurse_copy( $src, $dst ) {
|
423 |
+
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
|
424 |
+
$fs = IP_Geo_Block_FS::init( 'recurse_copy' );
|
425 |
+
|
426 |
$src = IP_Geo_Block_Util::slashit( $src );
|
427 |
$dst = IP_Geo_Block_Util::slashit( $dst );
|
428 |
|
429 |
+
! $fs->is_dir( $dst ) and $fs->mkdir( $dst );
|
430 |
|
431 |
if ( $dir = @opendir( $src ) ) {
|
432 |
while( FALSE !== ( $file = readdir( $dir ) ) ) {
|
433 |
if ( '.' !== $file && '..' !== $file ) {
|
434 |
+
if ( $fs->is_dir( $src.$file ) ) {
|
435 |
+
if ( FALSE === self::recurse_copy( $src.$file, $dst.$file ) )
|
436 |
+
return FALSE;
|
437 |
+
} else {
|
438 |
+
if ( FALSE === $fs->copy( $src.$file, $dst.$file, TRUE ) )
|
439 |
+
return FALSE;
|
440 |
+
}
|
441 |
}
|
442 |
}
|
443 |
|
444 |
closedir( $dir );
|
445 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
|
447 |
+
return TRUE;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
}
|
449 |
|
450 |
/**
|
452 |
*
|
453 |
*/
|
454 |
private static function remove_mu_plugin() {
|
455 |
+
if ( file_exists( $src = WPMU_PLUGIN_DIR . '/ip-geo-block-mu.php' ) ) {
|
456 |
+
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
|
457 |
+
$fs = IP_Geo_Block_FS::init( 'remove_mu_plugin' );
|
458 |
+
|
459 |
+
return $fs->delete( $src ) ? TRUE : $src;
|
460 |
+
}
|
461 |
+
|
462 |
+
return TRUE;
|
463 |
}
|
464 |
|
465 |
public static function get_validation_timing() {
|
477 |
$src = IP_GEO_BLOCK_PATH . 'wp-content/mu-plugins/ip-geo-block-mu.php';
|
478 |
$dst = WPMU_PLUGIN_DIR . '/ip-geo-block-mu.php';
|
479 |
|
480 |
+
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-file.php';
|
481 |
+
$fs = IP_Geo_Block_FS::init( 'setup_validation_timing' );
|
482 |
+
|
483 |
+
if ( ! $fs->is_file( $dst ) ) {
|
484 |
+
if ( ! $fs->is_dir( WPMU_PLUGIN_DIR ) && ! $fs->mkdir( WPMU_PLUGIN_DIR ) )
|
485 |
+
return $dst;
|
486 |
|
487 |
+
if ( ! $fs->copy( $src, $dst, TRUE ) )
|
488 |
return $dst;
|
489 |
}
|
490 |
break;
|
classes/class-ip-geo-block-util.php
CHANGED
@@ -42,6 +42,9 @@ class IP_Geo_Block_Util {
|
|
42 |
*
|
43 |
*/
|
44 |
public static function compare_url( $a, $b ) {
|
|
|
|
|
|
|
45 |
if ( ! ( $a = @parse_url( $a ) ) ) return FALSE;
|
46 |
if ( ! ( $b = @parse_url( $b ) ) ) return FALSE;
|
47 |
|
@@ -111,7 +114,7 @@ class IP_Geo_Block_Util {
|
|
111 |
if ( $nonce = self::retrieve_nonce( $key = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce' ) ) {
|
112 |
$location = esc_url_raw( add_query_arg(
|
113 |
array(
|
114 |
-
$key =>
|
115 |
$key => $nonce // add again
|
116 |
),
|
117 |
$location
|
@@ -169,8 +172,14 @@ class IP_Geo_Block_Util {
|
|
169 |
* Get hash of given string for nonce.
|
170 |
* @source wp-includes/pluggable.php
|
171 |
*/
|
172 |
-
private static function hash_nonce( $data ) {
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
|
176 |
/**
|
@@ -182,30 +191,138 @@ class IP_Geo_Block_Util {
|
|
182 |
private static function get_session_token() {
|
183 |
// Arrogating logged_in cookie never cause the privilege escalation.
|
184 |
$cookie = self::parse_auth_cookie( 'logged_in' );
|
185 |
-
return ! empty( $cookie['token'] ) ? $cookie['token'] :
|
186 |
}
|
187 |
|
188 |
/**
|
189 |
* WP alternative function for mu-plugins
|
190 |
*
|
191 |
* Parse a cookie into its components. It assumes the key including $scheme.
|
192 |
-
* @source wp-includes/pluggable.php
|
193 |
*/
|
194 |
-
private static function parse_auth_cookie( $scheme ) {
|
195 |
-
static $
|
196 |
-
|
197 |
-
if (
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
|
208 |
-
return $
|
209 |
}
|
210 |
|
211 |
/**
|
@@ -296,12 +413,12 @@ class IP_Geo_Block_Util {
|
|
296 |
| \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3
|
297 |
| [\xF1-\xF3][\x80-\xBF]{3}
|
298 |
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
299 |
-
){1,40}
|
300 |
)/x';
|
301 |
$location = preg_replace_callback( $regex, array( __CLASS__, 'sanitize_utf8_in_redirect' ), $location );
|
302 |
$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location );
|
303 |
$location = self::kses_no_null( $location ); // wp-includes/kses.php
|
304 |
-
|
305 |
// remove %0d and %0a from location
|
306 |
$strip = array( '%0d', '%0a', '%0D', '%0A' );
|
307 |
return self::deep_replace( $strip, $location ); // wp-includes/formatting.php
|
@@ -322,8 +439,7 @@ class IP_Geo_Block_Util {
|
|
322 |
if ( ! self::is_IIS() && PHP_SAPI != 'cgi-fcgi' )
|
323 |
status_header( $status ); // This causes problems on IIS and some FastCGI setups
|
324 |
|
325 |
-
header( "Location: $location",
|
326 |
-
|
327 |
return TRUE;
|
328 |
}
|
329 |
|
@@ -436,7 +552,7 @@ class IP_Geo_Block_Util {
|
|
436 |
*/
|
437 |
public static function is_user_logged_in() {
|
438 |
// possibly logged in but should be verified after 'init' hook is fired.
|
439 |
-
return did_action( 'init' ) ? is_user_logged_in() : (
|
440 |
}
|
441 |
|
442 |
/**
|
@@ -446,22 +562,86 @@ class IP_Geo_Block_Util {
|
|
446 |
* @source wp-includes/user.php
|
447 |
*/
|
448 |
public static function get_current_user_id() {
|
449 |
-
static $
|
450 |
|
451 |
-
if (
|
452 |
-
$
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
if ( 0 === strpos( $key, 'wp-settings-' ) ) {
|
457 |
-
$uid = substr( $key, strrpos( $key, '-' ) + 1 ); // get numerical characters
|
458 |
-
break;
|
459 |
-
}
|
460 |
}
|
461 |
}
|
462 |
}
|
463 |
|
464 |
-
return $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
465 |
}
|
466 |
|
467 |
/**
|
@@ -509,6 +689,14 @@ class IP_Geo_Block_Util {
|
|
509 |
return $subject;
|
510 |
}
|
511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
/**
|
513 |
* Whether the server software is IIS or something else
|
514 |
*
|
@@ -524,14 +712,109 @@ class IP_Geo_Block_Util {
|
|
524 |
return $_is_IIS;
|
525 |
}
|
526 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
/**
|
528 |
* Check the IP address is private or not
|
529 |
*
|
530 |
* @link https://en.wikipedia.org/wiki/Localhost
|
531 |
* @link https://en.wikipedia.org/wiki/Private_network
|
|
|
|
|
|
|
|
|
|
|
|
|
532 |
*/
|
533 |
public static function is_private_ip( $ip ) {
|
534 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
}
|
536 |
|
537 |
}
|
42 |
*
|
43 |
*/
|
44 |
public static function compare_url( $a, $b ) {
|
45 |
+
if ( 'GET' !== $_SERVER['REQUEST_METHOD'] && 'HEAD' !== $_SERVER['REQUEST_METHOD'] )
|
46 |
+
return FALSE; // POST, PUT, DELETE
|
47 |
+
|
48 |
if ( ! ( $a = @parse_url( $a ) ) ) return FALSE;
|
49 |
if ( ! ( $b = @parse_url( $b ) ) ) return FALSE;
|
50 |
|
114 |
if ( $nonce = self::retrieve_nonce( $key = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce' ) ) {
|
115 |
$location = esc_url_raw( add_query_arg(
|
116 |
array(
|
117 |
+
$key => FALSE, // delete onece
|
118 |
$key => $nonce // add again
|
119 |
),
|
120 |
$location
|
172 |
* Get hash of given string for nonce.
|
173 |
* @source wp-includes/pluggable.php
|
174 |
*/
|
175 |
+
private static function hash_nonce( $data, $scheme = 'nonce' ) {
|
176 |
+
$salt = array(
|
177 |
+
'auth' => AUTH_KEY . AUTH_SALT,
|
178 |
+
'secure_auth' => SECURE_AUTH_KEY . SECURE_AUTH_SALT,
|
179 |
+
'logged_in' => LOGGED_IN_KEY . LOGGED_IN_SALT,
|
180 |
+
'nonce' => NONCE_KEY . NONCE_SALT,
|
181 |
+
);
|
182 |
+
return self::hash_hmac( 'md5', $data, apply_filters( 'salt', $salt[ $scheme ], $scheme ) );
|
183 |
}
|
184 |
|
185 |
/**
|
191 |
private static function get_session_token() {
|
192 |
// Arrogating logged_in cookie never cause the privilege escalation.
|
193 |
$cookie = self::parse_auth_cookie( 'logged_in' );
|
194 |
+
return ! empty( $cookie['token'] ) ? $cookie['token'] : NONCE_KEY . NONCE_SALT;
|
195 |
}
|
196 |
|
197 |
/**
|
198 |
* WP alternative function for mu-plugins
|
199 |
*
|
200 |
* Parse a cookie into its components. It assumes the key including $scheme.
|
201 |
+
* @source wp-includes/pluggable.php
|
202 |
*/
|
203 |
+
private static function parse_auth_cookie( $scheme = 'logged_in' ) {
|
204 |
+
static $cache_cookie = NULL;
|
205 |
+
|
206 |
+
if ( NULL === $cache_cookie ) {
|
207 |
+
$cache_cookie = FALSE;
|
208 |
+
|
209 |
+
// @since 3.0.0 wp_cookie_constants() in wp-includes/default-constants.php
|
210 |
+
if ( ! defined( 'COOKIEHASH' ) )
|
211 |
+
wp_cookie_constants();
|
212 |
+
|
213 |
+
switch ( $scheme ) {
|
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;
|
226 |
+
$scheme = 'secure_auth';
|
227 |
+
} else {
|
228 |
+
$cookie_name = AUTH_COOKIE;
|
229 |
+
$scheme = 'auth';
|
230 |
}
|
231 |
}
|
232 |
+
|
233 |
+
if ( empty( $_COOKIE[ $cookie_name ] ) )
|
234 |
+
return FALSE;
|
235 |
+
|
236 |
+
$cookie = $_COOKIE[ $cookie_name ];
|
237 |
+
|
238 |
+
if ( count( $cookie_elements = explode( '|', $cookie ) ) !== 4 )
|
239 |
+
return FALSE;
|
240 |
+
|
241 |
+
list( $username, $expiration, $token, $hmac ) = $cookie_elements;
|
242 |
+
$cache_cookie = compact( 'username', 'expiration', 'token', 'hmac', 'scheme' );
|
243 |
+
}
|
244 |
+
|
245 |
+
return $cache_cookie;
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* WP alternative function for mu-plugins
|
250 |
+
*
|
251 |
+
* Retrieve user info by a given field
|
252 |
+
* @source wp-includes/pluggable.php @since 2.8.0
|
253 |
+
*/
|
254 |
+
private static function get_user_by( $field, $value ) {
|
255 |
+
$userdata = WP_User::get_data_by( $field, $value ); // wp-includes/class-wp-user.php @since 2.0.0
|
256 |
+
|
257 |
+
if ( ! $userdata )
|
258 |
+
return FALSE;
|
259 |
+
|
260 |
+
$user = new WP_User;
|
261 |
+
$user->init( $userdata );
|
262 |
+
|
263 |
+
return $user;
|
264 |
+
}
|
265 |
+
|
266 |
+
/**
|
267 |
+
* WP alternative function for mu-plugins
|
268 |
+
*
|
269 |
+
* Filters whether the current request is a WordPress Ajax request.
|
270 |
+
* @source wp-includes/load.php @since 4.7.0
|
271 |
+
*/
|
272 |
+
public static function doing_ajax() {
|
273 |
+
return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
|
274 |
+
}
|
275 |
+
|
276 |
+
/**
|
277 |
+
* WP alternative function for mu-plugins
|
278 |
+
*
|
279 |
+
* Validates authentication cookie.
|
280 |
+
* @source wp-includes/pluggable.php
|
281 |
+
*/
|
282 |
+
public static function validate_auth_cookie( $scheme = 'logged_in' ) {
|
283 |
+
static $cache_uid = NULL;
|
284 |
+
|
285 |
+
if ( NULL === $cache_uid ) {
|
286 |
+
$cache_uid = FALSE;
|
287 |
+
|
288 |
+
if ( ! ( $cookie = self::parse_auth_cookie( $scheme ) ) )
|
289 |
+
return FALSE;
|
290 |
+
|
291 |
+
$scheme = $cookie['scheme'];
|
292 |
+
$username = $cookie['username'];
|
293 |
+
$hmac = $cookie['hmac'];
|
294 |
+
$token = $cookie['token'];
|
295 |
+
$expired = $expiration = $cookie['expiration'];
|
296 |
+
|
297 |
+
// Allow a grace period for POST and Ajax requests
|
298 |
+
if ( self::doing_ajax() || 'POST' === $_SERVER['REQUEST_METHOD'] )
|
299 |
+
$expired += HOUR_IN_SECONDS;
|
300 |
+
|
301 |
+
// Quick check to see if an honest cookie has expired
|
302 |
+
if ( $expired < time() )
|
303 |
+
return FALSE;
|
304 |
+
|
305 |
+
if ( ! ( $user = self::get_user_by( 'login', $username ) ) ) // wp-includes/pluggable.php @since 2.8.0
|
306 |
+
return FALSE;
|
307 |
+
|
308 |
+
$pass_frag = substr( $user->user_pass, 8, 4 );
|
309 |
+
$key = self::hash_nonce( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme );
|
310 |
+
|
311 |
+
// If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
|
312 |
+
$algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
|
313 |
+
$hash = self::hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key );
|
314 |
+
|
315 |
+
if ( ! self::hash_equals( $hash, $hmac ) )
|
316 |
+
return FALSE;
|
317 |
+
|
318 |
+
$manager = WP_Session_Tokens::get_instance( $user->ID ); // wp-includes/class-wp-session-tokens.php @since 4.0.0
|
319 |
+
if ( ! $manager->verify( $token ) )
|
320 |
+
return FALSE;
|
321 |
+
|
322 |
+
$cache_uid = $user->ID;
|
323 |
}
|
324 |
|
325 |
+
return $cache_uid;
|
326 |
}
|
327 |
|
328 |
/**
|
413 |
| \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3
|
414 |
| [\xF1-\xF3][\x80-\xBF]{3}
|
415 |
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
416 |
+
){1,40} # ...one or more times
|
417 |
)/x';
|
418 |
$location = preg_replace_callback( $regex, array( __CLASS__, 'sanitize_utf8_in_redirect' ), $location );
|
419 |
$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location );
|
420 |
$location = self::kses_no_null( $location ); // wp-includes/kses.php
|
421 |
+
|
422 |
// remove %0d and %0a from location
|
423 |
$strip = array( '%0d', '%0a', '%0D', '%0A' );
|
424 |
return self::deep_replace( $strip, $location ); // wp-includes/formatting.php
|
439 |
if ( ! self::is_IIS() && PHP_SAPI != 'cgi-fcgi' )
|
440 |
status_header( $status ); // This causes problems on IIS and some FastCGI setups
|
441 |
|
442 |
+
header( "Location: $location", TRUE, $status );
|
|
|
443 |
return TRUE;
|
444 |
}
|
445 |
|
552 |
*/
|
553 |
public static function is_user_logged_in() {
|
554 |
// possibly logged in but should be verified after 'init' hook is fired.
|
555 |
+
return did_action( 'init' ) ? is_user_logged_in() : (bool)( class_exists( 'WP_Session_Tokens', FALSE ) ? self::validate_auth_cookie() : self::parse_auth_cookie() );
|
556 |
}
|
557 |
|
558 |
/**
|
562 |
* @source wp-includes/user.php
|
563 |
*/
|
564 |
public static function get_current_user_id() {
|
565 |
+
static $cache_uid = NULL;
|
566 |
|
567 |
+
if ( NULL === $cache_uid ) {
|
568 |
+
if ( ! ( $cache_uid = ( did_action( 'init' ) ? get_current_user_id() : 0 ) ) ) {
|
569 |
+
$keys = preg_grep( '/wp-settings-/', array_keys( isset( $_COOKIE ) ? $_COOKIE : array() ) );
|
570 |
+
if ( $val = array_shift( $keys ) ) {
|
571 |
+
$cache_uid = (int)substr( $val, strrpos( $val, '-' ) + 1 ); // get numerical characters
|
|
|
|
|
|
|
|
|
572 |
}
|
573 |
}
|
574 |
}
|
575 |
|
576 |
+
return $cache_uid;
|
577 |
+
}
|
578 |
+
|
579 |
+
/**
|
580 |
+
* WP alternative function current_user_can() for mu-plugins
|
581 |
+
*
|
582 |
+
* Whether the current user has a specific capability.
|
583 |
+
* @source wp-includes/capabilities.php
|
584 |
+
*/
|
585 |
+
public static function current_user_can( $capability ) {
|
586 |
+
// possibly logged in but should be verified after 'init' hook is fired.
|
587 |
+
return did_action( 'init' ) ? current_user_can( $capability ) : (bool)( class_exists( 'WP_Session_Tokens', FALSE ) ? self::validate_auth_cookie() : self::parse_auth_cookie() );
|
588 |
+
}
|
589 |
+
|
590 |
+
/**
|
591 |
+
* WP alternative function get_allowed_mime_types() for mu-plugins
|
592 |
+
*
|
593 |
+
* Retrieve the file type from the file name.
|
594 |
+
* @source wp-includes/functions.php @since 2.0.4
|
595 |
+
*/
|
596 |
+
public static function get_allowed_mime_types( $user = null ) {
|
597 |
+
$type = wp_get_mime_types();
|
598 |
+
|
599 |
+
unset( $type['swf'], $type['exe'] );
|
600 |
+
if ( ! self::current_user_can( 'unfiltered_html' ) )
|
601 |
+
unset( $type['htm|html'] );
|
602 |
+
|
603 |
+
return apply_filters( 'upload_mimes', $type, $user );
|
604 |
+
}
|
605 |
+
|
606 |
+
/**
|
607 |
+
* WP alternative function wp_check_filetype_and_ext() for mu-plugins
|
608 |
+
*
|
609 |
+
* Attempt to determine the real file type of a file.
|
610 |
+
* @source wp-includes/functions.php @since 3.0.0
|
611 |
+
*/
|
612 |
+
public static function check_filetype_and_ext( $fileset, $mode, $mimeset ) {
|
613 |
+
$src = @$fileset['tmp_name'];
|
614 |
+
$dst = str_replace( "\0", '', urldecode( @$fileset['name'] ) );
|
615 |
+
|
616 |
+
// We can't do any further validation without a file to work with
|
617 |
+
if ( ! @file_exists( $src ) )
|
618 |
+
return TRUE;
|
619 |
+
|
620 |
+
// check extension at the tail in blacklist
|
621 |
+
if ( 2 === (int)$mode ) {
|
622 |
+
$type = pathinfo( $dst, PATHINFO_EXTENSION );
|
623 |
+
if ( $type && FALSE !== stripos( $mimeset['black_list'], $type ) ) {
|
624 |
+
return FALSE;
|
625 |
+
}
|
626 |
+
}
|
627 |
+
|
628 |
+
// check extension at the tail in whitelist
|
629 |
+
$type = wp_check_filetype( $dst, $mimeset['white_list'] );
|
630 |
+
if ( 1 === (int)$mode ) {
|
631 |
+
if ( ! $type['type'] ) {
|
632 |
+
return FALSE;
|
633 |
+
}
|
634 |
+
}
|
635 |
+
|
636 |
+
// check images using GD (it doesn't care about extension if it's a real image file)
|
637 |
+
if ( 0 === strpos( $type['type'], 'image/' ) && function_exists( 'getimagesize' ) ) {
|
638 |
+
$info = @getimagesize( $src ); // 0:width, 1:height, 2:type, 3:string
|
639 |
+
if ( ! $info || $info[0] > 9000 || $info[1] > 9000 ) { // max: EOS 5Ds
|
640 |
+
return FALSE;
|
641 |
+
}
|
642 |
+
}
|
643 |
+
|
644 |
+
return TRUE;
|
645 |
}
|
646 |
|
647 |
/**
|
689 |
return $subject;
|
690 |
}
|
691 |
|
692 |
+
/**
|
693 |
+
* Remove `HOST` and `HOST=...` from `UA and qualification`
|
694 |
+
*
|
695 |
+
*/
|
696 |
+
public static function mask_qualification( $ua_list ) {
|
697 |
+
return preg_replace( array( '/HOST[^,]*?/', '/\*[:#]!?\*,?/' ), array( '*', '' ), $ua_list );
|
698 |
+
}
|
699 |
+
|
700 |
/**
|
701 |
* Whether the server software is IIS or something else
|
702 |
*
|
712 |
return $_is_IIS;
|
713 |
}
|
714 |
|
715 |
+
/**
|
716 |
+
* Check proxy variable
|
717 |
+
*
|
718 |
+
*/
|
719 |
+
public static function get_proxy_var() {
|
720 |
+
foreach ( array( 'HTTP_X_FORWARDED_FOR', 'HTTP_CF_CONNECTING_IP', 'HTTP_X_REAL_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED' ) as $var ) {
|
721 |
+
if ( isset( $_SERVER[ $var ] ) ) {
|
722 |
+
return $var;
|
723 |
+
}
|
724 |
+
}
|
725 |
+
|
726 |
+
return NULL;
|
727 |
+
}
|
728 |
+
|
729 |
+
/**
|
730 |
+
* Pick up all the IPs in HTTP_X_FORWARDED_FOR, HTTP_CLIENT_IP and etc.
|
731 |
+
*
|
732 |
+
* @param array $ips array of candidate IP addresses
|
733 |
+
* @param string $vars comma separated keys in $_SERVER for http header ('HTTP_...')
|
734 |
+
* @return array $ips array of candidate IP addresses
|
735 |
+
*/
|
736 |
+
public static function retrieve_ips( $ips = array(), $vars = NULL ) {
|
737 |
+
foreach ( explode( ',', $vars ) as $var ) {
|
738 |
+
if ( isset( $_SERVER[ $var ] ) ) {
|
739 |
+
foreach ( explode( ',', $_SERVER[ $var ] ) as $ip ) {
|
740 |
+
if ( ! in_array( $ip = trim( $ip ), $ips, TRUE ) && ! self::is_private_ip( $ip ) ) {
|
741 |
+
array_unshift( $ips, $ip );
|
742 |
+
}
|
743 |
+
}
|
744 |
+
}
|
745 |
+
}
|
746 |
+
|
747 |
+
return $ips;
|
748 |
+
}
|
749 |
+
|
750 |
+
/**
|
751 |
+
* Get client IP address
|
752 |
+
*
|
753 |
+
* @param string $vars comma separated keys in $_SERVER for http header ('HTTP_...')
|
754 |
+
* @return string $ip IP address
|
755 |
+
* @link http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/x-forwarded-headers.html
|
756 |
+
* @link https://github.com/zendframework/zend-http/blob/master/src/PhpEnvironment/RemoteAddress.php
|
757 |
+
*/
|
758 |
+
public static function get_client_ip( $vars = NULL ) {
|
759 |
+
foreach ( explode( ',', $vars ) as $var ) {
|
760 |
+
if ( isset( $_SERVER[ $var ] ) ) {
|
761 |
+
$ips = array_map( 'trim', explode( ',', $_SERVER[ $var ] ) );
|
762 |
+
while ( $var = array_pop( $ips ) ) {
|
763 |
+
if ( ! self::is_private_ip( $var ) ) {
|
764 |
+
return $var;
|
765 |
+
}
|
766 |
+
}
|
767 |
+
}
|
768 |
+
}
|
769 |
+
|
770 |
+
return isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';
|
771 |
+
}
|
772 |
+
|
773 |
+
/**
|
774 |
+
* Check the client IP address behind the VPN proxy
|
775 |
+
*
|
776 |
+
*/
|
777 |
+
public static function get_proxy_ip( $ip ) {
|
778 |
+
// Chrome datasaver
|
779 |
+
if ( isset( $_SERVER['HTTP_VIA'], $_SERVER['HTTP_FORWARDED'] ) && FALSE !== strpos( $_SERVER['HTTP_VIA'], 'Chrome-Compression-Proxy' ) ) {
|
780 |
+
// require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
|
781 |
+
// if ( FALSE !== strpos( 'google', IP_Geo_Block_Lkup::gethostbyaddr( $ip ) ) )
|
782 |
+
$proxy = preg_replace( '/^for=.*?([a-f\d\.:]+).*$/', '$1', $_SERVER['HTTP_FORWARDED'] );
|
783 |
+
}
|
784 |
+
|
785 |
+
// Puffin browser
|
786 |
+
elseif ( isset( $_SERVER['HTTP_X_PUFFIN_UA'], $_SERVER['HTTP_USER_AGENT'] ) && FALSE !== strpos( $_SERVER['HTTP_USER_AGENT'], 'Puffin' ) ) {
|
787 |
+
$proxy = trim( end( $proxy = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) ); // or trim( $proxy[0] )
|
788 |
+
}
|
789 |
+
|
790 |
+
return empty( $proxy ) ? $ip : $proxy;
|
791 |
+
}
|
792 |
+
|
793 |
/**
|
794 |
* Check the IP address is private or not
|
795 |
*
|
796 |
* @link https://en.wikipedia.org/wiki/Localhost
|
797 |
* @link https://en.wikipedia.org/wiki/Private_network
|
798 |
+
* @link https://en.wikipedia.org/wiki/Reserved_IP_addresses
|
799 |
+
*
|
800 |
+
* 10.0.0.0/8 reserved for Private-Use Networks [RFC1918]
|
801 |
+
* 127.0.0.0/8 reserved for Loopback [RFC1122]
|
802 |
+
* 172.16.0.0/12 reserved for Private-Use Networks [RFC1918]
|
803 |
+
* 192.168.0.0/16 reserved for Private-Use Networks [RFC1918]
|
804 |
*/
|
805 |
public static function is_private_ip( $ip ) {
|
806 |
+
// http://php.net/manual/en/filter.filters.flags.php
|
807 |
+
return ! filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE );
|
808 |
+
}
|
809 |
+
|
810 |
+
/**
|
811 |
+
* Get IP address of the host server
|
812 |
+
*
|
813 |
+
* @link http://php.net/manual/en/reserved.variables.server.php#88418
|
814 |
+
*/
|
815 |
+
public static function get_server_ip() {
|
816 |
+
return isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : ( (int)self::is_IIS() >= 7 ?
|
817 |
+
( isset( $_SERVER['LOCAL_ADDR' ] ) ? $_SERVER['LOCAL_ADDR' ] : NULL ) : NULL );
|
818 |
}
|
819 |
|
820 |
}
|
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.
|
19 |
const GEOAPI_NAME = 'ip-geo-api';
|
20 |
const PLUGIN_NAME = 'ip-geo-block';
|
21 |
const OPTION_NAME = 'ip_geo_block_settings';
|
@@ -23,17 +23,15 @@ class IP_Geo_Block {
|
|
23 |
const CRON_NAME = 'ip_geo_block_cron';
|
24 |
|
25 |
/**
|
26 |
-
*
|
27 |
*
|
28 |
*/
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
public static $wp_path;
|
33 |
private $pagenow = NULL;
|
34 |
private $request_uri = NULL;
|
35 |
private $target_type = NULL;
|
36 |
-
private $remote_addr = NULL;
|
37 |
|
38 |
/**
|
39 |
* Initialize the plugin
|
@@ -46,20 +44,12 @@ class IP_Geo_Block {
|
|
46 |
$validate = $settings['validation'];
|
47 |
$loader = new IP_Geo_Block_Loader();
|
48 |
|
|
|
|
|
|
|
49 |
// include drop in if it exists
|
50 |
file_exists( $key = IP_Geo_Block_Util::unslashit( $settings['api_dir'] ) . '/drop-in.php' ) and include( $key );
|
51 |
|
52 |
-
// Garbage collection for IP address cache
|
53 |
-
add_action( self::CACHE_NAME, array( $this, 'exec_cache_gc' ) );
|
54 |
-
|
55 |
-
// the action hook which will be fired by cron job
|
56 |
-
if ( $settings['update']['auto'] )
|
57 |
-
add_action( self::CRON_NAME, array( $this, 'update_database' ) );
|
58 |
-
|
59 |
-
// check the package version and upgrade if needed (activation hook never fire on upgrade)
|
60 |
-
if ( version_compare( $settings['version'], self::VERSION ) < 0 || $settings['matching_rule'] < 0 )
|
61 |
-
$loader->add_action( 'init', 'ip_geo_block_activate', $priority );
|
62 |
-
|
63 |
// normalize requested uri and page
|
64 |
$key = preg_replace( array( '!\.+/!', '!//+!' ), '/', $_SERVER['REQUEST_URI'] );
|
65 |
$this->request_uri = @parse_url( $key, PHP_URL_PATH ) or $this->request_uri = $key;
|
@@ -112,48 +102,71 @@ class IP_Geo_Block {
|
|
112 |
|
113 |
else {
|
114 |
// public facing pages
|
115 |
-
if ( $validate['public'] /* && 'index.php' === $this->pagenow */ )
|
116 |
$loader->add_action( 'init', array( $this, 'validate_public' ), $priority );
|
117 |
|
118 |
-
//
|
119 |
-
|
120 |
-
$key = ( 1 === (int)$settings['comment']['pos'] ? '_top' : '' );
|
121 |
-
add_action( 'comment_form' . $key, array( $this, 'comment_form_message' ) );
|
122 |
-
}
|
123 |
-
|
124 |
-
if ( $validate['comment'] ) {
|
125 |
-
add_action( 'pre_comment_on_post', array( $this, 'validate_comment' ), $priority ); // wp-comments-post.php @since 2.8.0
|
126 |
-
add_action( 'pre_trackback_post', array( $this, 'validate_comment' ), $priority ); // wp-trackback.php @since 4.7.0
|
127 |
-
add_filter( 'preprocess_comment', array( $this, 'validate_comment' ), $priority ); // wp-includes/comment.php @since 1.5.0
|
128 |
-
|
129 |
-
// bbPress: prevent creating topic/relpy and rendering form
|
130 |
-
add_action( 'bbp_post_request_bbp-new-topic', array( $this, 'validate_comment' ), $priority );
|
131 |
-
add_action( 'bbp_post_request_bbp-new-reply', array( $this, 'validate_comment' ), $priority );
|
132 |
-
add_filter( 'bbp_current_user_can_access_create_topic_form', array( $this, 'validate_front' ), $priority );
|
133 |
-
add_filter( 'bbp_current_user_can_access_create_reply_form', array( $this, 'validate_front' ), $priority );
|
134 |
-
}
|
135 |
-
|
136 |
-
if ( $validate['login'] ) {
|
137 |
-
// for hide/rename wp-login.php, BuddyPress: prevent registration and rendering form
|
138 |
-
add_action( 'login_init', array( $this, 'validate_login' ), $priority );
|
139 |
-
|
140 |
-
// only when block on front-end is disabled
|
141 |
-
if ( ! $validate['public'] ) {
|
142 |
-
add_action( 'bp_core_screen_signup', array( $this, 'validate_login' ), $priority );
|
143 |
-
add_action( 'bp_signup_pre_validate', array( $this, 'validate_login' ), $priority );
|
144 |
-
}
|
145 |
-
}
|
146 |
}
|
147 |
|
148 |
// force to change the redirect URL on logout to remove nonce, embed a nonce into pages
|
149 |
-
add_filter( 'wp_redirect',
|
150 |
-
|
151 |
|
152 |
// Run the loader to execute all of the hooks with WordPress.
|
153 |
$loader->run( $this );
|
154 |
unset( $loader );
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
/**
|
158 |
* I/F for registering custom fileter
|
159 |
*
|
@@ -184,6 +197,33 @@ class IP_Geo_Block {
|
|
184 |
return FALSE !== ( $option = get_option( self::OPTION_NAME ) ) ? $option : self::get_default();
|
185 |
}
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
/**
|
188 |
* Register and enqueue a nonce with a specific JavaScript.
|
189 |
*
|
@@ -195,23 +235,26 @@ class IP_Geo_Block {
|
|
195 |
! defined( 'IP_GEO_BLOCK_DEBUG' ) || ! IP_GEO_BLOCK_DEBUG ?
|
196 |
'admin/js/authenticate.min.js' : 'admin/js/authenticate.js', IP_GEO_BLOCK_BASE
|
197 |
);
|
198 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
wp_enqueue_script( $handle, $script, array( 'jquery' ), self::VERSION );
|
200 |
-
wp_localize_script( $handle, 'IP_GEO_BLOCK_AUTH', $
|
201 |
}
|
202 |
}
|
203 |
|
204 |
-
/**
|
205 |
-
* Remove the redirecting URL on logout not to be blocked by WP-ZEP.
|
206 |
-
*
|
207 |
-
*/
|
208 |
-
public function logout_redirect( $uri ) {
|
209 |
-
if ( isset( $_REQUEST['action'] ) && 'logout' === $_REQUEST['action'] && FALSE !== stripos( $uri, self::$wp_path['admin'] ) )
|
210 |
-
return esc_url_raw( add_query_arg( array( 'loggedout' => 'true' ), wp_login_url() ) );
|
211 |
-
else
|
212 |
-
return $uri;
|
213 |
-
}
|
214 |
-
|
215 |
/**
|
216 |
* Setup the http header.
|
217 |
*
|
@@ -229,7 +272,7 @@ class IP_Geo_Block {
|
|
229 |
*
|
230 |
*/
|
231 |
public static function get_ip_address() {
|
232 |
-
return apply_filters( self::PLUGIN_NAME . '-ip-addr',
|
233 |
}
|
234 |
|
235 |
/**
|
@@ -282,7 +325,7 @@ class IP_Geo_Block {
|
|
282 |
private static function _get_geolocation( $ip, $settings, $providers, $callback = 'get_country' ) {
|
283 |
// check loop back / private address
|
284 |
if ( IP_Geo_Block_Util::is_private_ip( $ip ) )
|
285 |
-
return self::make_validation( $ip, array( 'time' => 0, 'provider' => '
|
286 |
|
287 |
// set arguments for wp_remote_get()
|
288 |
$args = self::get_request_headers( $settings );
|
@@ -331,8 +374,7 @@ class IP_Geo_Block {
|
|
331 |
require_once ABSPATH . WPINC . '/functions.php'; // for get_status_header_desc() @since 2.3.0
|
332 |
|
333 |
// prevent caching (WP Super Cache, W3TC, Wordfence, Comet Cache)
|
334 |
-
|
335 |
-
define( 'DONOTCACHEPAGE', TRUE );
|
336 |
|
337 |
$code = (int )apply_filters( self::PLUGIN_NAME . '-'.$hook.'-status', $settings['response_code'] );
|
338 |
$mesg = (string)apply_filters( self::PLUGIN_NAME . '-'.$hook.'-reason', $settings['response_msg' ] ? $settings['response_msg'] : get_status_header_desc( $code ) );
|
@@ -355,8 +397,12 @@ class IP_Geo_Block {
|
|
355 |
exit;
|
356 |
|
357 |
case 3: // 3xx Redirection (HTTP header injection should be avoided)
|
358 |
-
|
359 |
-
|
|
|
|
|
|
|
|
|
360 |
|
361 |
default: // 4xx Client Error, 5xx Server Error
|
362 |
status_header( $code ); // @since 2.0.0
|
@@ -392,34 +438,23 @@ class IP_Geo_Block {
|
|
392 |
*/
|
393 |
public function validate_ip( $hook, $settings, $block = TRUE, $die = TRUE, $auth = TRUE ) {
|
394 |
// set IP address to be validated
|
395 |
-
$ips = array( self::get_ip_address() );
|
396 |
-
|
397 |
-
// pick up all the IPs in HTTP_X_FORWARDED_FOR, HTTP_CLIENT_IP and etc.
|
398 |
-
foreach ( explode( ',', $settings['validation']['proxy'] ) as $var ) {
|
399 |
-
if ( isset( $_SERVER[ $var ] ) ) {
|
400 |
-
foreach ( explode( ',', $_SERVER[ $var ] ) as $ip ) {
|
401 |
-
if ( ! in_array( $ip = trim( $ip ), $ips, TRUE ) && filter_var( $ip, FILTER_VALIDATE_IP ) ) {
|
402 |
-
array_unshift( $ips, $ip );
|
403 |
-
}
|
404 |
-
}
|
405 |
-
}
|
406 |
-
}
|
407 |
|
408 |
// register auxiliary validation functions
|
409 |
-
// priority high 4 close_xmlrpc
|
410 |
-
// 5 check_nonce
|
411 |
-
// 6 check_signature
|
412 |
// 7 check_auth
|
413 |
// 8 check_fail
|
414 |
-
// 9 check_ips_black
|
415 |
-
// 9 check_ips_white
|
416 |
// priority low 10 validate_country
|
417 |
$var = self::PLUGIN_NAME . '-' . $hook;
|
|
|
|
|
|
|
418 |
$settings['extra_ips'] = apply_filters( self::PLUGIN_NAME . '-extra-ips', $settings['extra_ips'], $hook );
|
419 |
$settings['extra_ips']['black_list'] and add_filter( $var, array( $this, 'check_ips_black' ), 9, 2 );
|
420 |
$settings['extra_ips']['white_list'] and add_filter( $var, array( $this, 'check_ips_white' ), 9, 2 );
|
421 |
-
$settings['login_fails'] >= 0 and add_filter( $var, array( $this, 'check_fail' ), 8, 2 );
|
422 |
-
$auth and add_filter( $var, array( $this, 'check_auth' ), 7, 2 );
|
423 |
|
424 |
// make valid provider name list
|
425 |
$providers = IP_Geo_Block_Provider::get_valid_providers( $settings['providers'] );
|
@@ -432,8 +467,8 @@ class IP_Geo_Block {
|
|
432 |
// 'code' => $code, /* country code or reason of rejection */
|
433 |
// 'result' => $result, /* 'passed', 'blocked' */
|
434 |
// );
|
435 |
-
foreach ( $ips as
|
436 |
-
$validate = self::_get_geolocation(
|
437 |
$validate = apply_filters( $var, $validate, $settings );
|
438 |
|
439 |
// if no 'result' then validate ip address by country
|
@@ -582,7 +617,7 @@ class IP_Geo_Block {
|
|
582 |
$list = array_merge(
|
583 |
apply_filters( self::PLUGIN_NAME . '-bypass-admins', array() ),
|
584 |
array( 'save-widget', 'wp-compression-test', 'upload-attachment', 'imgedit-preview', // in wp-admin js/widget.js, includes/template.php, async-upload.php
|
585 |
-
'
|
586 |
'jetpack', 'authorize', 'jetpack_modules', 'atd_settings', 'bulk-activate', 'bulk-deactivate', // jetpack page & action
|
587 |
)
|
588 |
);
|
@@ -601,7 +636,7 @@ class IP_Geo_Block {
|
|
601 |
}
|
602 |
|
603 |
// register validation of malicious signature (except in the comment and post)
|
604 |
-
if ( ! IP_Geo_Block_Util::is_user_logged_in()
|
605 |
add_filter( self::PLUGIN_NAME . '-admin', array( $this, 'check_signature' ), 6, 2 );
|
606 |
|
607 |
// validate country by IP address (1: Block by country)
|
@@ -614,10 +649,10 @@ class IP_Geo_Block {
|
|
614 |
*/
|
615 |
public function validate_direct() {
|
616 |
// analyze target in wp-includes, wp-content/(plugins|themes|language|uploads)
|
617 |
-
$path = preg_quote( self::$wp_path[ $type = $this->target_type ], '
|
618 |
$name = ( 'plugins' === $type || 'themes' === $type ? '[^\?\&\/]*' : '[^\?\&]*' );
|
619 |
|
620 |
-
preg_match( "
|
621 |
$name = empty( $name[2] ) ? $name[1] : $name[2];
|
622 |
|
623 |
// set validation rule by target (0: Bypass, 1: Block by country, 2: WP-ZEP)
|
@@ -648,7 +683,7 @@ class IP_Geo_Block {
|
|
648 |
$validate = $this->validate_ip( 'admin', $settings, 1 & $rule );
|
649 |
|
650 |
// if the validation is successful, execute the requested uri via rewrite.php
|
651 |
-
if ( class_exists( 'IP_Geo_Block_Rewrite' ) )
|
652 |
IP_Geo_Block_Rewrite::exec( $this, $validate, $settings );
|
653 |
}
|
654 |
|
@@ -658,8 +693,8 @@ class IP_Geo_Block {
|
|
658 |
*/
|
659 |
public function auth_fail( $something = NULL ) {
|
660 |
// Count up a number of fails when authentication is failed
|
661 |
-
if ( $cache = IP_Geo_Block_API_Cache::get_cache(
|
662 |
-
$validate = self::make_validation(
|
663 |
'code' => $cache['code'],
|
664 |
'fail' => TRUE,
|
665 |
'result' => 'failed',
|
@@ -716,10 +751,49 @@ class IP_Geo_Block {
|
|
716 |
|
717 |
foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $settings['signature'] ) as $sig ) {
|
718 |
$val = explode( ':', $sig, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
719 |
|
720 |
-
|
721 |
-
|
722 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
}
|
724 |
}
|
725 |
|
@@ -776,6 +850,13 @@ class IP_Geo_Block {
|
|
776 |
$settings = self::get_option();
|
777 |
$public = $settings['public'];
|
778 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
779 |
// avoid redirection loop
|
780 |
if ( $settings['response_code'] < 400 && IP_Geo_Block_Util::compare_url( $_SERVER['REQUEST_URI'], $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ) )
|
781 |
return; // do not block
|
@@ -790,31 +871,14 @@ class IP_Geo_Block {
|
|
790 |
add_filter( self::PLUGIN_NAME . '-public', array( $this, 'check_page' ), 10, 2 );
|
791 |
}
|
792 |
|
793 |
-
// replace "Validation rule settings"
|
794 |
-
if ( -1 !== (int)$public['matching_rule'] ) {
|
795 |
-
$settings['matching_rule'] = $public['matching_rule'];
|
796 |
-
$settings['white_list' ] = $public['white_list' ];
|
797 |
-
$settings['black_list' ] = $public['black_list' ];
|
798 |
-
}
|
799 |
-
|
800 |
// retrieve IP address of visitor via proxy services
|
801 |
-
add_filter( self::PLUGIN_NAME . '-ip-addr', array(
|
802 |
|
803 |
// validate undesired user agent
|
804 |
add_filter( self::PLUGIN_NAME . '-public', array( $this, 'check_bots' ), 6, 2 );
|
805 |
|
806 |
// validate country by IP address (block: true, die: false)
|
807 |
-
$this->validate_ip( 'public', $settings,
|
808 |
-
}
|
809 |
-
|
810 |
-
public function get_proxy_ip( $ip ) {
|
811 |
-
if ( isset( $_SERVER['HTTP_VIA'] ) && FALSE !== strpos( $_SERVER['HTTP_VIA'], 'Chrome-Compression-Proxy' ) && isset( $_SERVER['HTTP_FORWARDED'] ) ) {
|
812 |
-
// require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
|
813 |
-
// if ( FALSE !== strpos( 'google', IP_Geo_Block_Lkup::gethostbyaddr( $ip ) ) )
|
814 |
-
$proxy = preg_replace( '/^for=.*?([a-f\d\.:]+).*$/', '$1', $_SERVER['HTTP_FORWARDED'] );
|
815 |
-
}
|
816 |
-
|
817 |
-
return empty( $proxy ) ? $ip : $proxy;
|
818 |
}
|
819 |
|
820 |
public function check_page( $validate, $settings ) {
|
@@ -848,6 +912,10 @@ class IP_Geo_Block {
|
|
848 |
public function check_bots( $validate, $settings ) {
|
849 |
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
|
850 |
|
|
|
|
|
|
|
|
|
851 |
// get the name of host (from the cache if exists)
|
852 |
if ( empty( $validate['host'] ) && FALSE !== strpos( $settings['public']['ua_list'], 'HOST' ) )
|
853 |
$validate['host'] = IP_Geo_Block_Lkup::gethostbyaddr( $validate['ip'] );
|
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';
|
23 |
const CRON_NAME = 'ip_geo_block_cron';
|
24 |
|
25 |
/**
|
26 |
+
* Globals in this class
|
27 |
*
|
28 |
*/
|
29 |
+
private static $instance = NULL;
|
30 |
+
private static $remote_addr;
|
31 |
+
private static $wp_path;
|
|
|
32 |
private $pagenow = NULL;
|
33 |
private $request_uri = NULL;
|
34 |
private $target_type = NULL;
|
|
|
35 |
|
36 |
/**
|
37 |
* Initialize the plugin
|
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'] );
|
49 |
+
|
50 |
// include drop in if it exists
|
51 |
file_exists( $key = IP_Geo_Block_Util::unslashit( $settings['api_dir'] ) . '/drop-in.php' ) and include( $key );
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
// normalize requested uri and page
|
54 |
$key = preg_replace( array( '!\.+/!', '!//+!' ), '/', $_SERVER['REQUEST_URI'] );
|
55 |
$this->request_uri = @parse_url( $key, PHP_URL_PATH ) or $this->request_uri = $key;
|
102 |
|
103 |
else {
|
104 |
// public facing pages
|
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 |
/**
|
171 |
* I/F for registering custom fileter
|
172 |
*
|
197 |
return FALSE !== ( $option = get_option( self::OPTION_NAME ) ) ? $option : self::get_default();
|
198 |
}
|
199 |
|
200 |
+
// get the WordPress path of validation target
|
201 |
+
public static function get_wp_path() {
|
202 |
+
return self::$wp_path;
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Remove the redirecting URL on logout not to be blocked by WP-ZEP.
|
207 |
+
*
|
208 |
+
*/
|
209 |
+
public function logout_redirect( $uri ) {
|
210 |
+
if ( isset( $_REQUEST['action'] ) && 'logout' === $_REQUEST['action'] && FALSE !== stripos( $uri, self::$wp_path['admin'] ) )
|
211 |
+
return esc_url_raw( add_query_arg( array( 'loggedout' => 'true' ), wp_login_url() ) );
|
212 |
+
else
|
213 |
+
return $uri;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Add nonce into arguments used in an HTTP request.
|
218 |
+
*
|
219 |
+
*/
|
220 |
+
public function request_nonce( $args = array(), $url = '' ) {
|
221 |
+
if ( 0 === strpos( $url, admin_url() ) && empty( $args[ $handle = self::PLUGIN_NAME . '-auth-nonce' ] ) )
|
222 |
+
$args += array( $handle => IP_Geo_Block_Util::create_nonce( $handle ) );
|
223 |
+
|
224 |
+
return $args;
|
225 |
+
}
|
226 |
+
|
227 |
/**
|
228 |
* Register and enqueue a nonce with a specific JavaScript.
|
229 |
*
|
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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
/**
|
259 |
* Setup the http header.
|
260 |
*
|
272 |
*
|
273 |
*/
|
274 |
public static function get_ip_address() {
|
275 |
+
return apply_filters( self::PLUGIN_NAME . '-ip-addr', self::$remote_addr );
|
276 |
}
|
277 |
|
278 |
/**
|
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 );
|
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 ) );
|
397 |
exit;
|
398 |
|
399 |
case 3: // 3xx Redirection (HTTP header injection should be avoided)
|
400 |
+
if ( 'GET' === $_SERVER['REQUEST_METHOD'] || 'HEAD' === $_SERVER['REQUEST_METHOD'] ) {
|
401 |
+
IP_Geo_Block_Util::safe_redirect( esc_url_raw( $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ), $code ); // @since 2.8
|
402 |
+
exit;
|
403 |
+
} else {
|
404 |
+
$code = 403; // avoid redirection loop
|
405 |
+
}
|
406 |
|
407 |
default: // 4xx Client Error, 5xx Server Error
|
408 |
status_header( $code ); // @since 2.0.0
|
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 |
// '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
|
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 |
);
|
636 |
}
|
637 |
|
638 |
// register validation of malicious signature (except in the comment and post)
|
639 |
+
if ( ! IP_Geo_Block_Util::is_user_logged_in() && ! in_array( $this->pagenow, array( 'comment.php', 'post.php' ), TRUE ) )
|
640 |
add_filter( self::PLUGIN_NAME . '-admin', array( $this, 'check_signature' ), 6, 2 );
|
641 |
|
642 |
// validate country by IP address (1: Block by country)
|
649 |
*/
|
650 |
public function validate_direct() {
|
651 |
// analyze target in wp-includes, wp-content/(plugins|themes|language|uploads)
|
652 |
+
$path = preg_quote( self::$wp_path[ $type = $this->target_type ], '!' );
|
653 |
$name = ( 'plugins' === $type || 'themes' === $type ? '[^\?\&\/]*' : '[^\?\&]*' );
|
654 |
|
655 |
+
preg_match( "!($path)($name)!", $this->request_uri, $name );
|
656 |
$name = empty( $name[2] ) ? $name[1] : $name[2];
|
657 |
|
658 |
// set validation rule by target (0: Bypass, 1: Block by country, 2: WP-ZEP)
|
683 |
$validate = $this->validate_ip( 'admin', $settings, 1 & $rule );
|
684 |
|
685 |
// if the validation is successful, execute the requested uri via rewrite.php
|
686 |
+
if ( class_exists( 'IP_Geo_Block_Rewrite', FALSE ) )
|
687 |
IP_Geo_Block_Rewrite::exec( $this, $validate, $settings );
|
688 |
}
|
689 |
|
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',
|
751 |
|
752 |
foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $settings['signature'] ) as $sig ) {
|
753 |
$val = explode( ':', $sig, 2 );
|
754 |
+
$sig = trim( $val[0] );
|
755 |
+
|
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 |
+
}
|
766 |
+
|
767 |
+
return $validate;
|
768 |
+
}
|
769 |
|
770 |
+
/**
|
771 |
+
* Validate malicious file uploading. @since 3.0.3
|
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 |
|
850 |
$settings = self::get_option();
|
851 |
$public = $settings['public'];
|
852 |
|
853 |
+
// replace "Validation rule settings"
|
854 |
+
if ( $settings['validation']['public'] && -1 !== (int)$public['matching_rule'] ) {
|
855 |
+
foreach ( array( 'matching_rule', 'white_list', 'black_list', 'response_code', 'response_msg', 'redirect_uri' ) as $key ) {
|
856 |
+
$settings[ $key ] = $public[ $key ];
|
857 |
+
}
|
858 |
+
}
|
859 |
+
|
860 |
// avoid redirection loop
|
861 |
if ( $settings['response_code'] < 400 && IP_Geo_Block_Util::compare_url( $_SERVER['REQUEST_URI'], $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ) )
|
862 |
return; // do not block
|
871 |
add_filter( self::PLUGIN_NAME . '-public', array( $this, 'check_page' ), 10, 2 );
|
872 |
}
|
873 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
874 |
// retrieve IP address of visitor via proxy services
|
875 |
+
add_filter( self::PLUGIN_NAME . '-ip-addr', array( 'IP_Geo_Block_Util', 'get_proxy_ip' ), 20, 1 );
|
876 |
|
877 |
// validate undesired user agent
|
878 |
add_filter( self::PLUGIN_NAME . '-public', array( $this, 'check_bots' ), 6, 2 );
|
879 |
|
880 |
// validate country by IP address (block: true, die: false)
|
881 |
+
$this->validate_ip( 'public', $settings, 1 & $settings['validation']['public'], ! $public['simulate'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
882 |
}
|
883 |
|
884 |
public function check_page( $validate, $settings ) {
|
912 |
public function check_bots( $validate, $settings ) {
|
913 |
require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
|
914 |
|
915 |
+
// mask HOST if DNS lookup is false
|
916 |
+
if ( empty( $settings['public']['dnslkup'] ) )
|
917 |
+
$settings['public']['ua_list'] = IP_Geo_Block_Util::mask_qualification( $settings['public']['ua_list'] );
|
918 |
+
|
919 |
// get the name of host (from the cache if exists)
|
920 |
if ( empty( $validate['host'] ) && FALSE !== strpos( $settings['public']['ua_list'], 'HOST' ) )
|
921 |
$validate['host'] = IP_Geo_Block_Lkup::gethostbyaddr( $validate['ip'] );
|
database/index.php
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
<?php
|
2 |
// Silence is golden.
|
3 |
-
?>
|
1 |
<?php
|
2 |
// Silence is golden.
|
|
index.php
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
<?php
|
2 |
// Silence is golden.
|
3 |
-
?>
|
1 |
<?php
|
2 |
// Silence is golden.
|
|
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.
|
17 |
* Author: tokkonopapa
|
18 |
* Author URI: http://www.ipgeoblock.com/
|
19 |
* Text Domain: ip-geo-block
|
@@ -23,11 +23,9 @@
|
|
23 |
*/
|
24 |
|
25 |
// If this file is called directly, abort.
|
26 |
-
|
27 |
-
die;
|
28 |
-
}
|
29 |
|
30 |
-
if ( ! class_exists( 'IP_Geo_Block' ) ):
|
31 |
|
32 |
/*----------------------------------------------------------------------------*
|
33 |
* Global definition
|
@@ -85,8 +83,6 @@ if ( is_admin() ) {
|
|
85 |
add_action( 'plugins_loaded', array( 'IP_Geo_Block_Admin', 'get_instance' ) );
|
86 |
}
|
87 |
|
88 |
-
endif; // ! class_exists( 'IP_Geo_Block' )
|
89 |
-
|
90 |
/*----------------------------------------------------------------------------*
|
91 |
* Emergent Functionality
|
92 |
*----------------------------------------------------------------------------*/
|
@@ -103,4 +99,6 @@ function ip_geo_block_emergency( $validate ) {
|
|
103 |
}
|
104 |
add_filter( 'ip-geo-block-login', 'ip_geo_block_emergency' );
|
105 |
add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency' );
|
106 |
-
// */
|
|
|
|
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
|
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 |
|
30 |
/*----------------------------------------------------------------------------*
|
31 |
* Global definition
|
83 |
add_action( 'plugins_loaded', array( 'IP_Geo_Block_Admin', 'get_instance' ) );
|
84 |
}
|
85 |
|
|
|
|
|
86 |
/*----------------------------------------------------------------------------*
|
87 |
* Emergent Functionality
|
88 |
*----------------------------------------------------------------------------*/
|
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 )
|
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.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
|
7 |
-
"POT-Creation-Date: 2017-
|
8 |
-
"PO-Revision-Date: 2017-
|
9 |
"Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
|
10 |
"Language-Team: \n"
|
11 |
"MIME-Version: 1.0\n"
|
@@ -27,53 +27,53 @@ msgstr ""
|
|
27 |
"自国以外から投稿されるスパム、ログインフォーム、さらにゼロデイ攻撃を含む管理"
|
28 |
"領域への悪意あるアクセスからサイトを守ります。"
|
29 |
|
30 |
-
#: admin/class-ip-geo-block-admin.php:
|
31 |
msgid "Import settings ?"
|
32 |
msgstr "設定をインポートしますか?"
|
33 |
|
34 |
-
#: admin/class-ip-geo-block-admin.php:
|
35 |
msgid "Create table ?"
|
36 |
msgstr "テーブルを作成しますか?"
|
37 |
|
38 |
-
#: admin/class-ip-geo-block-admin.php:
|
39 |
msgid "Delete table ?"
|
40 |
msgstr "テーブルを削除しますか?"
|
41 |
|
42 |
-
#: admin/class-ip-geo-block-admin.php:
|
43 |
msgid "Clear statistics ?"
|
44 |
msgstr "統計をクリアしますか?"
|
45 |
|
46 |
-
#: admin/class-ip-geo-block-admin.php:
|
47 |
msgid "Clear cache ?"
|
48 |
msgstr "キャッシュをクリアしますか?"
|
49 |
|
50 |
-
#: admin/class-ip-geo-block-admin.php:
|
51 |
msgid "Clear logs ?"
|
52 |
msgstr "ログをクリアしますか?"
|
53 |
|
54 |
-
#: admin/class-ip-geo-block-admin.php:
|
55 |
msgid "This feature is available with HTML5 compliant browsers."
|
56 |
msgstr "HTML5準拠のブラウザでのみ機能します。"
|
57 |
|
58 |
-
#: admin/class-ip-geo-block-admin.php:
|
59 |
msgid "Contribute at GitHub"
|
60 |
msgstr "開発に参加"
|
61 |
|
62 |
-
#: admin/class-ip-geo-block-admin.php:
|
63 |
-
#: admin/class-ip-geo-block-admin.php:
|
64 |
msgid "Settings"
|
65 |
msgstr "設定"
|
66 |
|
67 |
-
#: admin/class-ip-geo-block-admin.php:
|
68 |
-
#: admin/class-ip-geo-block-admin.php:
|
69 |
msgid "IP Geo Block"
|
70 |
msgstr "IP Geo Block"
|
71 |
|
72 |
-
#: admin/class-ip-geo-block-admin.php:
|
73 |
msgid "You need WordPress 3.7+."
|
74 |
msgstr "WordPress 3.7 以上が必要です。"
|
75 |
|
76 |
-
#: admin/class-ip-geo-block-admin.php:
|
77 |
#, php-format
|
78 |
msgid ""
|
79 |
"Now downloading geolocation databases in background. After a little while, "
|
@@ -84,7 +84,7 @@ msgstr ""
|
|
84 |
"いた後、あなたの国コードと「<strong>マッチング規則</strong>」を「<a href=\"%s"
|
85 |
"\">検証ルールの設定</a>」で確認して下さい。"
|
86 |
|
87 |
-
#: admin/class-ip-geo-block-admin.php:
|
88 |
#, php-format
|
89 |
msgid ""
|
90 |
"The “<strong>Matching rule</strong>” is not set properly. Please "
|
@@ -93,11 +93,11 @@ msgstr ""
|
|
93 |
"「<strong>マッチング規則</strong>」が正しく設定されていません。「<a href=\"%s"
|
94 |
"\">検証ルールの設定</a>」を確認して下さい。"
|
95 |
|
96 |
-
#: admin/class-ip-geo-block-admin.php:
|
97 |
msgid "Local database and matching rule have been updated."
|
98 |
msgstr "ローカル・データベースとマッチング規則を更新しました。"
|
99 |
|
100 |
-
#: admin/class-ip-geo-block-admin.php:
|
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 +105,7 @@ msgstr ""
|
|
105 |
"あなたのIPアドレスのログイン試行可能回数がリミットに達したため、ログアウトす"
|
106 |
"ると再びログインする事が出来なくなります。"
|
107 |
|
108 |
-
#: admin/class-ip-geo-block-admin.php:
|
109 |
#, php-format
|
110 |
msgid ""
|
111 |
"Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
|
@@ -114,7 +114,7 @@ msgstr ""
|
|
114 |
"<a href=\"%s\">「統計」タブ</a>の \"<strong>キャッシュのクリア</strong>\" を"
|
115 |
"実行し、ロックアウトを回避してください。"
|
116 |
|
117 |
-
#: admin/class-ip-geo-block-admin.php:
|
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 +122,7 @@ msgstr ""
|
|
122 |
"あなたの国コードまたはIPアドレスがブラックリストに含まれているため、ログアウ"
|
123 |
"トすると再びログインする事が出来なくなります。"
|
124 |
|
125 |
-
#: admin/class-ip-geo-block-admin.php:
|
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,36 +130,46 @@ msgstr ""
|
|
130 |
"あなたの国コードまたはIPアドレスがホワイトリストに含まれていないため、ログア"
|
131 |
"ウトすると再びログインする事が出来なくなります。"
|
132 |
|
133 |
-
#: admin/class-ip-geo-block-admin.php:
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
msgid "Statistics"
|
140 |
msgstr "統計"
|
141 |
|
142 |
-
#: admin/class-ip-geo-block-admin.php:
|
143 |
msgid "Logs"
|
144 |
msgstr "ログ"
|
145 |
|
146 |
-
#: admin/class-ip-geo-block-admin.php:
|
147 |
msgid "Search"
|
148 |
msgstr "検索"
|
149 |
|
150 |
-
#: admin/class-ip-geo-block-admin.php:
|
151 |
msgid "Attribution"
|
152 |
msgstr "リンク"
|
153 |
|
154 |
-
#: admin/class-ip-geo-block-admin.php:
|
155 |
msgid "Toggle all"
|
156 |
msgstr "全てを開閉"
|
157 |
|
158 |
-
#: admin/class-ip-geo-block-admin.php:
|
159 |
msgid "Thanks for providing these great services for free."
|
160 |
msgstr "これらのすばらしいサービスの提供元に、敬意と感謝の意を表します!"
|
161 |
|
162 |
-
#: admin/class-ip-geo-block-admin.php:
|
163 |
msgid ""
|
164 |
"(Most browsers will redirect you to each site <a href=\"http://www."
|
165 |
"ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
|
@@ -169,134 +179,145 @@ msgstr ""
|
|
169 |
"html\" title=\"Referer Checker\">参照元を残さずにリンク先にリダイレクトできま"
|
170 |
"す</a>。)"
|
171 |
|
172 |
-
#: admin/class-ip-geo-block-admin.php:
|
173 |
msgid "Back to top"
|
174 |
msgstr "トップに戻る"
|
175 |
|
176 |
-
#: admin/class-ip-geo-block-admin.php:
|
177 |
msgid "Enable"
|
178 |
msgstr "有効"
|
179 |
|
180 |
-
#: admin/class-ip-geo-block-admin.php:
|
181 |
-
#:
|
182 |
-
#: classes/class-ip-geo-block-cron.php:
|
183 |
-
#: classes/class-ip-geo-block-cron.php:318
|
184 |
-
#: classes/class-ip-geo-block-opts.php:311
|
185 |
#, php-format
|
186 |
msgid "Unable to write %s. Please check the permission."
|
187 |
msgstr "%s に書き込めません。パーミッションを確認して下さい。"
|
188 |
|
189 |
-
#: admin/class-ip-geo-block-admin.php:
|
190 |
#, php-format
|
191 |
msgid "Or please refer to %s to set it manually."
|
192 |
msgid_plural "Or please refer to %s to set them manually."
|
193 |
msgstr[0] "あるいは %s を参照し、手動で設定して下さい。"
|
194 |
msgstr[1] "あるいは %s を参照し、手動で設定して下さい。"
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
#: admin/includes/class-admin-ajax.php:60
|
197 |
msgid "n/a"
|
198 |
msgstr "n/a"
|
199 |
|
200 |
#: admin/includes/class-admin-ajax.php:63 admin/includes/tab-settings.php:81
|
|
|
201 |
msgid "UNKNOWN"
|
202 |
msgstr "不明"
|
203 |
|
204 |
-
#: admin/includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
msgid "Validation logs"
|
206 |
msgstr "検証のログ"
|
207 |
|
208 |
-
#: admin/includes/tab-accesslog.php:
|
209 |
msgid "Filter logs"
|
210 |
msgstr "ログをフィルタ"
|
211 |
|
212 |
-
#: admin/includes/tab-accesslog.php:
|
213 |
msgid "Reset"
|
214 |
msgstr "リセット"
|
215 |
|
216 |
-
#: admin/includes/tab-accesslog.php:
|
217 |
msgid "Clear logs"
|
218 |
msgstr "ログのクリア"
|
219 |
|
220 |
-
#: admin/includes/tab-accesslog.php:
|
221 |
-
#: admin/includes/tab-statistics.php:
|
222 |
msgid "Clear now"
|
223 |
msgstr "今すぐクリア"
|
224 |
|
225 |
-
#: admin/includes/tab-accesslog.php:
|
226 |
msgid "Export logs"
|
227 |
msgstr "ログをエクスポート"
|
228 |
|
229 |
-
#: admin/includes/tab-accesslog.php:
|
230 |
msgid "Export to the local file"
|
231 |
msgstr "ローカル・ファイルにエクスポートする"
|
232 |
|
233 |
-
#: admin/includes/tab-accesslog.php:
|
234 |
msgid "Export csv"
|
235 |
msgstr "CSVをエクスポート"
|
236 |
|
237 |
-
#: admin/includes/tab-accesslog.php:
|
238 |
#, php-format
|
239 |
msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
|
240 |
msgstr "<dfn title=\"%s に対するリクエストの検証ログです。\">%s</dfn>"
|
241 |
|
242 |
-
#: admin/includes/tab-accesslog.php:
|
243 |
msgid "Comment post"
|
244 |
msgstr "コメント投稿"
|
245 |
|
246 |
-
#: admin/includes/tab-accesslog.php:
|
247 |
msgid "XML-RPC"
|
248 |
msgstr "XML-RPC"
|
249 |
|
250 |
-
#: admin/includes/tab-accesslog.php:
|
251 |
msgid "Login form"
|
252 |
msgstr "ログイン・フォーム"
|
253 |
|
254 |
-
#: admin/includes/tab-accesslog.php:
|
255 |
msgid "Admin area"
|
256 |
msgstr "管理領域"
|
257 |
|
258 |
-
#: admin/includes/tab-accesslog.php:
|
259 |
msgid "public facing pages"
|
260 |
msgstr "一般公開ページ"
|
261 |
|
262 |
-
#: admin/includes/tab-accesslog.php:
|
263 |
msgid "Public facing pages"
|
264 |
msgstr "一般公開ページ"
|
265 |
|
266 |
-
#: admin/includes/tab-accesslog.php:
|
267 |
msgid "Date"
|
268 |
msgstr "日時"
|
269 |
|
270 |
-
#: admin/includes/tab-accesslog.php:
|
271 |
-
#: admin/includes/tab-statistics.php:
|
272 |
msgid "IP address"
|
273 |
msgstr "IPアドレス"
|
274 |
|
275 |
-
#: admin/includes/tab-accesslog.php:
|
276 |
msgid "Code"
|
277 |
msgstr "国"
|
278 |
|
279 |
-
#: admin/includes/tab-accesslog.php:
|
280 |
msgid "Result"
|
281 |
msgstr "判定"
|
282 |
|
283 |
-
#: admin/includes/tab-accesslog.php:
|
284 |
msgid "Request"
|
285 |
msgstr "リクエスト"
|
286 |
|
287 |
-
#: admin/includes/tab-accesslog.php:
|
288 |
msgid "User agent"
|
289 |
msgstr "ユーザーエージェント"
|
290 |
|
291 |
-
#: admin/includes/tab-accesslog.php:
|
292 |
msgid "HTTP headers"
|
293 |
msgstr "HTTPヘッダ"
|
294 |
|
295 |
-
#: admin/includes/tab-accesslog.php:
|
296 |
msgid "$_POST data"
|
297 |
msgstr "$_POSTデータ"
|
298 |
|
299 |
-
#: admin/includes/tab-accesslog.php:
|
300 |
msgid ""
|
301 |
"Current selection of [<strong>Record validation logs</strong>] on "
|
302 |
"[<strong>Settings</strong>] tab is [<strong>Disable</strong>]."
|
@@ -304,7 +325,7 @@ msgstr ""
|
|
304 |
"現在[<strong>設定</strong>]タブの[<strong>検証のログを記録</strong>]は"
|
305 |
"[<strong>無効</strong>]が選択されています。"
|
306 |
|
307 |
-
#: admin/includes/tab-accesslog.php:
|
308 |
msgid ""
|
309 |
"Please select the proper condition to record and analyze the validation logs."
|
310 |
msgstr "検証のログを記録し分析するためには、適切な条件を選択して下さい。"
|
@@ -313,19 +334,19 @@ msgstr "検証のログを記録し分析するためには、適切な条件を
|
|
313 |
msgid "Attribution links"
|
314 |
msgstr "APIサービスの提供元"
|
315 |
|
316 |
-
#: admin/includes/tab-geolocation.php:
|
317 |
msgid "Search IP address geolocation"
|
318 |
msgstr "IPアドレスの位置情報を検索"
|
319 |
|
320 |
-
#: admin/includes/tab-geolocation.php:
|
321 |
msgid "Geolocation service"
|
322 |
msgstr "位置情報サービス"
|
323 |
|
324 |
-
#: admin/includes/tab-geolocation.php:
|
325 |
msgid "Find geolocation"
|
326 |
msgstr "位置情報の検索"
|
327 |
|
328 |
-
#: admin/includes/tab-geolocation.php:
|
329 |
msgid "Search now"
|
330 |
msgstr "今すぐ検索"
|
331 |
|
@@ -342,59 +363,79 @@ msgstr ""
|
|
342 |
"<dfn title=\"「国コードを検索する」を参照し、適切な位置情報APIと国コードを設"
|
343 |
"定して下さい。\">あなたのIPアドレス / 国コード</dfn>"
|
344 |
|
345 |
-
#: admin/includes/tab-settings.php:82
|
346 |
msgid "Scan all the APIs you selected at Geolocation API settings"
|
347 |
msgstr "選択された位置情報APIを検索します"
|
348 |
|
349 |
-
#: admin/includes/tab-settings.php:82
|
350 |
msgid "Scan country code"
|
351 |
msgstr "国コードを検索する"
|
352 |
|
353 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
msgid "Whitelist"
|
355 |
msgstr "ホワイトリスト"
|
356 |
|
357 |
-
#: admin/includes/tab-settings.php:
|
358 |
msgid "Blacklist"
|
359 |
msgstr "ブラックリスト"
|
360 |
|
361 |
-
#: admin/includes/tab-settings.php:
|
362 |
msgid ""
|
363 |
"Please select either “Whitelist” or “Blacklist”."
|
364 |
msgstr "「ホワイトリスト」または「ブラックリスト」のいずれかを選択して下さい。"
|
365 |
|
366 |
-
#: admin/includes/tab-settings.php:
|
367 |
msgid ""
|
368 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
369 |
-
"empty.
|
370 |
-
"
|
|
|
|
|
|
|
371 |
msgstr ""
|
372 |
-
"<dfn title=\"
|
373 |
-
"
|
374 |
-
"
|
|
|
|
|
375 |
|
376 |
-
#: admin/includes/tab-settings.php:
|
377 |
msgid ""
|
378 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
379 |
-
"empty.
|
380 |
-
"
|
|
|
|
|
|
|
381 |
msgstr ""
|
382 |
-
"<dfn title=\"
|
383 |
-
"
|
|
|
|
|
|
|
384 |
|
385 |
-
#: admin/includes/tab-settings.php:
|
386 |
msgid "(comma separated)"
|
387 |
msgstr "(カンマ区切り)"
|
388 |
|
389 |
-
#: admin/includes/tab-settings.php:
|
390 |
msgid "(comma or RET separated)"
|
391 |
msgstr "(カンマ、または改行区切り)"
|
392 |
|
393 |
-
#: admin/includes/tab-settings.php:
|
394 |
msgid "Matching rule"
|
395 |
msgstr "マッチング規則"
|
396 |
|
397 |
-
#: admin/includes/tab-settings.php:
|
398 |
msgid ""
|
399 |
"A request from which the country code or IP address is <strong>NOT</strong> "
|
400 |
"in the whitelist will be blocked."
|
@@ -402,7 +443,7 @@ msgstr ""
|
|
402 |
"国コードまたはIPアドレスがホワイトリストに<strong>含まれていない</strong>リク"
|
403 |
"エストを遮断します。"
|
404 |
|
405 |
-
#: admin/includes/tab-settings.php:
|
406 |
msgid ""
|
407 |
"A request from which the country code or IP address is in the blacklist will "
|
408 |
"be blocked."
|
@@ -410,7 +451,7 @@ msgstr ""
|
|
410 |
"国コードまたはIPアドレスがブラックリストに<strong>含まれている</strong>リクエ"
|
411 |
"ストを遮断します。"
|
412 |
|
413 |
-
#: admin/includes/tab-settings.php:
|
414 |
msgid ""
|
415 |
"<dfn title=\"e.g. “192.0.64.0/18” for Jetpack server, "
|
416 |
"“69.46.36.0/27” for WordFence server\">Whitelist of extra IP "
|
@@ -419,7 +460,7 @@ msgstr ""
|
|
419 |
"<dfn title=\"例)192.0.64.0/18(Jetpackサーバー)、69.46.36.0/27(WordFence"
|
420 |
"サーバー)\">国コードに優先して検証するIPアドレスのホワイトリスト</dfn>"
|
421 |
|
422 |
-
#: admin/includes/tab-settings.php:
|
423 |
msgid ""
|
424 |
"<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
|
425 |
"\">Blacklist of extra IP addresses prior to country code</dfn>"
|
@@ -427,32 +468,82 @@ msgstr ""
|
|
427 |
"<dfn title=\"サーバー・レベルのアクセス制御の使用をお勧めします(例:."
|
428 |
"htaccess)。\">国コードに優先して検証するIPアドレスのブラックリスト</dfn>"
|
429 |
|
430 |
-
#: admin/includes/tab-settings.php:
|
431 |
msgid ""
|
432 |
-
"<dfn title=\"
|
|
|
|
|
|
|
433 |
"addresses</dfn>"
|
434 |
msgstr ""
|
435 |
-
"<dfn title=\"
|
436 |
-
"
|
|
|
|
|
|
|
437 |
|
438 |
-
#: admin/includes/tab-settings.php:
|
439 |
msgid ""
|
440 |
"<dfn title=\"It validates malicious signatures independently of “Block "
|
441 |
"by country” and “Prevent Zero-day Exploit” for the target "
|
442 |
"“Admin area”, “Admin ajax/post”, “Plugins "
|
443 |
"area” and “Themes area”.\">Bad signatures in query</dfn> "
|
444 |
-
"<nobr>(<a
|
445 |
"\"When you find ugly character string in the text area, please click to "
|
446 |
-
"restore.\"><span
|
447 |
msgstr ""
|
448 |
"<dfn title=\"「国コードで遮断」および「ゼロデイ攻撃を遮断」とは独立に、「管理"
|
449 |
"領域」、「管理領域 ajax/post」、「プラグイン領域」、「テーマ領域」をターゲッ"
|
450 |
"トとした悪意のあるシグネチャを検証します。\">悪意のあるシグネチャ</dfn> "
|
451 |
-
"<nobr>(<a
|
452 |
"字化けした場合、クリックして復元して下さい。\"><span id=\"ip-geo-block-cycle"
|
453 |
"\"></span></a>)</nobr>"
|
454 |
|
455 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
#, php-format
|
457 |
msgid ""
|
458 |
"<dfn title=\"You can put your original 403.php and so on into your theme "
|
@@ -461,11 +552,12 @@ msgstr ""
|
|
461 |
"<dfn title=\"テーマ・ディレクトリには 403.php など、独自のファ"
|
462 |
"イルを設置する事が出来ます。\">レスポンス・コード</dfn> %s"
|
463 |
|
464 |
-
#: admin/includes/tab-settings.php:
|
465 |
msgid ""
|
466 |
-
"<dfn title=\"Specify the URL for response code 2xx and 3xx.
|
467 |
-
"
|
468 |
-
"
|
|
|
469 |
"\">Redirect URL</dfn>"
|
470 |
msgstr ""
|
471 |
"<dfn title=\"レスポンス・コード 2xx 、3xx 用のリダイレク"
|
@@ -474,7 +566,7 @@ msgstr ""
|
|
474 |
"ります。空欄の場合、サイトのホームが使用されます。\">リダイレクト先 "
|
475 |
"URL</dfn>"
|
476 |
|
477 |
-
#: admin/includes/tab-settings.php:
|
478 |
msgid ""
|
479 |
"<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
|
480 |
"message</dfn>"
|
@@ -482,33 +574,33 @@ msgstr ""
|
|
482 |
"<dfn title=\"レスポンス・コード 4xx、5xx 用のメッセージを指定し"
|
483 |
"ます。\">レスポンス・メッセージ</dfn>"
|
484 |
|
485 |
-
#: admin/includes/tab-settings.php:
|
486 |
msgid ""
|
487 |
-
"<dfn title=\"
|
488 |
-
"Lockout period is defined as expiration time at “Cache
|
489 |
-
"
|
490 |
msgstr ""
|
491 |
"<dfn title=\"「XML-RPC」と「ログイン・フォーム」に適用されます。ロックアウト"
|
492 |
"時間は「キャッシュの設定」の「有効時間」で定義されます。\">IPアドレス当たりの"
|
493 |
"ログイン試行可能回数</dfn>"
|
494 |
|
495 |
-
#: admin/includes/tab-settings.php:
|
496 |
msgid "Select when to run the validation."
|
497 |
msgstr "検証を実行するタイミングを選択します。"
|
498 |
|
499 |
-
#: admin/includes/tab-settings.php:
|
500 |
msgid "Validation timing"
|
501 |
msgstr "検証のタイミング"
|
502 |
|
503 |
-
#: admin/includes/tab-settings.php:
|
504 |
msgid "“init” action hook"
|
505 |
msgstr "“init” アクション・フック"
|
506 |
|
507 |
-
#: admin/includes/tab-settings.php:
|
508 |
msgid "“mu-plugins” (ip-geo-block-mu.php)"
|
509 |
msgstr "“mu-plugins” (ip-geo-block-mu.php)"
|
510 |
|
511 |
-
#: admin/includes/tab-settings.php:
|
512 |
msgid ""
|
513 |
"Validate at “init” action hook in the same manner as typical "
|
514 |
"plugins."
|
@@ -516,7 +608,7 @@ msgstr ""
|
|
516 |
"標準的な他のプラグインと同様、init アクション・フックのタイミングで検証を実行"
|
517 |
"します。"
|
518 |
|
519 |
-
#: admin/includes/tab-settings.php:
|
520 |
msgid ""
|
521 |
"Validate at an earlier phase than other typical plugins. It can reduce load "
|
522 |
"on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
|
@@ -528,53 +620,48 @@ msgstr ""
|
|
528 |
"com/codex/validation-timing.html' title='Validation timing | IP Geo Block'>幾"
|
529 |
"つかの制限事項</a> が生じます。"
|
530 |
|
531 |
-
#: admin/includes/tab-settings.php:
|
532 |
msgid "Back-end target settings"
|
533 |
msgstr "バックエンドの設定"
|
534 |
|
535 |
-
#: admin/includes/tab-settings.php:
|
536 |
#, php-format
|
537 |
msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
|
538 |
msgstr "<dfn title=\"%s へのリクエストを検証します。\">%s</dfn>"
|
539 |
|
540 |
-
#: admin/includes/tab-settings.php:
|
541 |
msgid "Other areas"
|
542 |
msgstr "その他のディレクトリ"
|
543 |
|
544 |
-
#: admin/includes/tab-settings.php:
|
545 |
-
#: admin/includes/tab-settings.php:
|
546 |
-
#: admin/includes/tab-settings.php:
|
547 |
msgid "Block by country"
|
548 |
msgstr "国コードで遮断"
|
549 |
|
550 |
-
#: admin/includes/tab-settings.php:
|
551 |
-
#: admin/includes/tab-settings.php:1029
|
552 |
-
msgid "Disable"
|
553 |
-
msgstr "無効"
|
554 |
-
|
555 |
-
#: admin/includes/tab-settings.php:412
|
556 |
msgid "Completely close"
|
557 |
msgstr "完全に閉鎖"
|
558 |
|
559 |
-
#: admin/includes/tab-settings.php:
|
560 |
msgid ""
|
561 |
"<dfn title=\"Specify the individual action as a blocking target.\">Target "
|
562 |
"actions</dfn>"
|
563 |
msgstr ""
|
564 |
"<dfn title=\"遮断対象とするアクションを指定します。\">対象アクション</dfn>"
|
565 |
|
566 |
-
#: admin/includes/tab-settings.php:
|
567 |
msgid "Prevent Zero-day Exploit"
|
568 |
msgstr "ゼロデイ攻撃を遮断"
|
569 |
|
570 |
-
#: admin/includes/tab-settings.php:
|
571 |
msgid ""
|
572 |
"It will block a request related to the services for both public facing pages "
|
573 |
"and the dashboard."
|
574 |
msgstr ""
|
575 |
"一般公開ページとダッシュボード向けサービスに関連するリクエストを遮断します。"
|
576 |
|
577 |
-
#: admin/includes/tab-settings.php:
|
578 |
msgid ""
|
579 |
"Regardless of the country code, it will block a malicious request related to "
|
580 |
"the services only for the dashboard."
|
@@ -582,51 +669,44 @@ msgstr ""
|
|
582 |
"国コードに拘らず、ダッシュボード向けサービスだけに関連する悪意のあるリクエス"
|
583 |
"トを遮断します。"
|
584 |
|
585 |
-
#: admin/includes/tab-settings.php:
|
586 |
-
msgid "for logged-in
|
587 |
msgstr "ログインユーザー用"
|
588 |
|
589 |
-
#: admin/includes/tab-settings.php:
|
590 |
-
msgid "for non logged-in
|
591 |
msgstr "一般訪問者用"
|
592 |
|
593 |
-
#: admin/includes/tab-settings.php:
|
594 |
msgid "Admin ajax/post"
|
595 |
msgstr "管理領域 ajax/post"
|
596 |
|
597 |
-
#: admin/includes/tab-settings.php:
|
598 |
msgid ""
|
599 |
-
"<dfn title=\"
|
600 |
-
"
|
601 |
-
"country” for non logged-in
|
602 |
-
"
|
603 |
-
"in “page=…”) or action name (“…” in "
|
604 |
-
"“action=…”), which would be implemented with a non "
|
605 |
-
"WordPress standard way, into the field to specify the request.\">Exceptions</"
|
606 |
-
"dfn>"
|
607 |
msgstr ""
|
608 |
-
"<dfn title=\"
|
609 |
-
"
|
610 |
-
"
|
611 |
-
"
|
612 |
-
"“…” 部分)かアクション名(“action=…” "
|
613 |
-
"の “…” 部分)をテキストで指定してください。\">除外する項目"
|
614 |
-
"</dfn>"
|
615 |
|
616 |
-
#: admin/includes/tab-settings.php:
|
617 |
msgid "Candidate actions"
|
618 |
msgstr "候補アクション"
|
619 |
|
620 |
-
#: admin/includes/tab-settings.php:
|
621 |
#, php-format
|
622 |
msgid ""
|
623 |
"Regardless of the country code, it will block a malicious request to <code>"
|
624 |
-
"%s&
|
625 |
msgstr ""
|
626 |
"国コードに拘らず、<code>%s…/*.php</code>への悪意のあるリクエストを遮断"
|
627 |
"します。"
|
628 |
|
629 |
-
#: admin/includes/tab-settings.php:
|
630 |
#, php-format
|
631 |
msgid ""
|
632 |
"It configures “%s” to validate a request to the PHP file which "
|
@@ -635,42 +715,53 @@ msgstr ""
|
|
635 |
"WordPressコアを読み込まないPHPファイルへのリクエストを検証対象とするため"
|
636 |
"に、%s を設定します。"
|
637 |
|
638 |
-
#: admin/includes/tab-settings.php:
|
639 |
msgid ""
|
640 |
"<dfn title=\"Select the item which causes undesired blocking in order to "
|
641 |
"exclude from the validation target. Grayed item indicates “"
|
642 |
"INACTIVE”.\">Exceptions</dfn>"
|
643 |
msgstr ""
|
644 |
-
"<dfn title=\"
|
645 |
-
"
|
646 |
-
"
|
647 |
|
648 |
-
#: admin/includes/tab-settings.php:
|
649 |
msgid "Force to load WP core"
|
650 |
msgstr "WPコアの読み込みを強制"
|
651 |
|
652 |
-
#: admin/includes/tab-settings.php:
|
653 |
msgid "Plugins area"
|
654 |
msgstr "プラグイン領域"
|
655 |
|
656 |
-
#: admin/includes/tab-settings.php:
|
657 |
msgid "Themes area"
|
658 |
msgstr "テーマ領域"
|
659 |
|
660 |
-
#: admin/includes/tab-settings.php:
|
661 |
msgid "Front-end target settings"
|
662 |
msgstr "フロントエンドの設定"
|
663 |
|
664 |
-
#: admin/includes/tab-settings.php:
|
665 |
msgid "Follow “Validation rule settings”"
|
666 |
msgstr "「検証ルールの設定」に従う"
|
667 |
|
668 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
msgid ""
|
670 |
"<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
|
671 |
msgstr "<dfn title=\"特定のページを遮断対象に指定します。\">ページ</dfn>"
|
672 |
|
673 |
-
#: admin/includes/tab-settings.php:
|
674 |
msgid ""
|
675 |
"<dfn title=\"Specify the individual post type on a single page as a blocking "
|
676 |
"target.\">Post type</dfn>"
|
@@ -678,7 +769,7 @@ msgstr ""
|
|
678 |
"<dfn title=\"特定の投稿タイプのシングルページを遮断対象に指定します。\">投稿"
|
679 |
"タイプ</dfn>"
|
680 |
|
681 |
-
#: admin/includes/tab-settings.php:
|
682 |
msgid ""
|
683 |
"<dfn title=\"Specify the individual category on a single page or archive "
|
684 |
"page as a blocking target.\">Category</dfn>"
|
@@ -686,7 +777,7 @@ msgstr ""
|
|
686 |
"<dfn title=\"特定のカテゴリを含むシングルページかアーカイブページを遮断対象に"
|
687 |
"指定します。\">カテゴリ</dfn>"
|
688 |
|
689 |
-
#: admin/includes/tab-settings.php:
|
690 |
msgid ""
|
691 |
"<dfn title=\"Specify the individual tag on a single page or archive page as "
|
692 |
"a blocking target.\">Tag</dfn>"
|
@@ -694,23 +785,23 @@ msgstr ""
|
|
694 |
"<dfn title=\"特定のタグを含むシングルページかアーカイブページを遮断対象に指定"
|
695 |
"します。\">タグ</dfn>"
|
696 |
|
697 |
-
#: admin/includes/tab-settings.php:
|
698 |
msgid "Specify the validation target on front-end."
|
699 |
-
msgstr "
|
700 |
|
701 |
-
#: admin/includes/tab-settings.php:
|
702 |
msgid "Validation target"
|
703 |
msgstr "検証対象"
|
704 |
|
705 |
-
#: admin/includes/tab-settings.php:
|
706 |
msgid "All requests"
|
707 |
msgstr "全てのリクエスト"
|
708 |
|
709 |
-
#: admin/includes/tab-settings.php:
|
710 |
msgid "Specify the targets"
|
711 |
msgstr "ターゲットを指定"
|
712 |
|
713 |
-
#: admin/includes/tab-settings.php:
|
714 |
msgid ""
|
715 |
"Notice that “Validation timing” is deferred till “"
|
716 |
"wp” action hook. It means that this feature would not be compatible "
|
@@ -719,7 +810,7 @@ msgstr ""
|
|
719 |
"「検証のタイミング」が “wp” アクション・フックまで遅延されます。"
|
720 |
"これにより、ページ・キャッシュとの互換性がなくなることに注意してください。"
|
721 |
|
722 |
-
#: admin/includes/tab-settings.php:
|
723 |
msgid ""
|
724 |
"A part of user agent string and a qualification connected with a separator "
|
725 |
"that indicates an applicable rule and can be “:” (pass) or "
|
@@ -733,19 +824,34 @@ msgstr ""
|
|
733 |
"国コード、または IPアドレス(CIDR記法)が使えます。また否定を表す記号"
|
734 |
"「!」を「条件」の直前に配置する事が出来ます。"
|
735 |
|
736 |
-
#: admin/includes/tab-settings.php:
|
737 |
msgid "UA string and qualification"
|
738 |
msgstr "ユーザーエージェント文字列と条件"
|
739 |
|
740 |
-
#: admin/includes/tab-settings.php:
|
741 |
msgid "Specify the name of action that is invariably blocked."
|
742 |
msgstr "遮断されるアクション名を指定します。"
|
743 |
|
744 |
-
#: admin/includes/tab-settings.php:
|
745 |
msgid "Excluded actions"
|
746 |
msgstr "除外するアクション"
|
747 |
|
748 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
749 |
msgid ""
|
750 |
"It enables to simulate validation without deployment. The results can be "
|
751 |
"found at “Public facing pages” in Logs."
|
@@ -753,15 +859,15 @@ msgstr ""
|
|
753 |
"機能を有効にする事なくリクエストの検証をシミュレートします。結果はログで確認"
|
754 |
"する事が出来ます。"
|
755 |
|
756 |
-
#: admin/includes/tab-settings.php:
|
757 |
msgid "Simulation mode"
|
758 |
msgstr "シミュレーション・モード"
|
759 |
|
760 |
-
#: admin/includes/tab-settings.php:
|
761 |
msgid "Geolocation API settings"
|
762 |
msgstr "位置情報APIの設定"
|
763 |
|
764 |
-
#: admin/includes/tab-settings.php:
|
765 |
msgid ""
|
766 |
"<dfn title=\"Cache and local database are scanned at the top priority.\">API "
|
767 |
"selection and key settings</dfn>"
|
@@ -769,7 +875,11 @@ msgstr ""
|
|
769 |
"<dfn title=\"キャッシュとローカルのデータベースが最優先で検索されます。\">API"
|
770 |
"の選択とキーの設定</dfn>"
|
771 |
|
772 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
773 |
#, php-format
|
774 |
msgid ""
|
775 |
"Can not find geolocation API libraries in <code>%s</code>. It seems to have "
|
@@ -778,10 +888,10 @@ msgid ""
|
|
778 |
"contents of tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> "
|
779 |
"from <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-"
|
780 |
"IP-Geo-API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-"
|
781 |
-
"IP-Geo-API</a>. Please
|
782 |
-
"ipgeoblock.com/codex/
|
783 |
-
"fix
|
784 |
-
"
|
785 |
msgstr ""
|
786 |
"<code>%s</code> に位置情報APIライブラリが見つかりません。<a rel=\"noreferrer"
|
787 |
"\" href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API\" title="
|
@@ -794,88 +904,89 @@ msgstr ""
|
|
794 |
"IP Geo Block\">FAQ</a> を参照し、適切な書き込み権限と共に <code>ip-geo-api</"
|
795 |
"code> をインストールしてください。"
|
796 |
|
797 |
-
#: admin/includes/tab-settings.php:
|
798 |
msgid "Local database settings"
|
799 |
msgstr "ローカル・データベースの設定"
|
800 |
|
801 |
-
#: admin/includes/tab-settings.php:
|
802 |
msgid "database"
|
803 |
msgstr "ファイル"
|
804 |
|
805 |
-
#: admin/includes/tab-settings.php:
|
|
|
806 |
#, php-format
|
807 |
msgid "Last update: %s"
|
808 |
msgstr "最終更新:%s"
|
809 |
|
810 |
-
#: admin/includes/tab-settings.php:
|
811 |
msgid "Auto updating (once a month)"
|
812 |
msgstr "自動更新(月1回)"
|
813 |
|
814 |
-
#: admin/includes/tab-settings.php:
|
815 |
msgid "Download database"
|
816 |
msgstr "データベースのダウンロード"
|
817 |
|
818 |
-
#: admin/includes/tab-settings.php:
|
819 |
msgid "Download now"
|
820 |
msgstr "今すぐダウンロード"
|
821 |
|
822 |
-
#: admin/includes/tab-settings.php:
|
823 |
msgid "Record settings"
|
824 |
msgstr "記録の設定"
|
825 |
|
826 |
-
#: admin/includes/tab-settings.php:
|
827 |
msgid "Record validation statistics"
|
828 |
msgstr "検証の統計を記録"
|
829 |
|
830 |
-
#: admin/includes/tab-settings.php:
|
831 |
msgid "Record validation logs"
|
832 |
msgstr "検証のログを記録"
|
833 |
|
834 |
-
#: admin/includes/tab-settings.php:
|
835 |
msgid "Only when blocked"
|
836 |
msgstr "遮断時に記録"
|
837 |
|
838 |
-
#: admin/includes/tab-settings.php:
|
839 |
msgid "Only when passed"
|
840 |
msgstr "通過時に記録"
|
841 |
|
842 |
-
#: admin/includes/tab-settings.php:
|
843 |
msgid "Unauthenticated user"
|
844 |
msgstr "未認証ユーザーを記録"
|
845 |
|
846 |
-
#: admin/includes/tab-settings.php:
|
847 |
msgid "Authenticated user"
|
848 |
msgstr "認証済ユーザーを記録"
|
849 |
|
850 |
-
#: admin/includes/tab-settings.php:
|
851 |
msgid "All of validation"
|
852 |
msgstr "すべての検証を記録"
|
853 |
|
854 |
-
#: admin/includes/tab-settings.php:
|
855 |
msgid "Recording period of the logs (days)"
|
856 |
msgstr "ログの記録期間(日)"
|
857 |
|
858 |
-
#: admin/includes/tab-settings.php:
|
859 |
msgid "Maximum length of logs for each target"
|
860 |
msgstr "ログの記録最大数"
|
861 |
|
862 |
-
#: admin/includes/tab-settings.php:
|
863 |
msgid ""
|
864 |
-
"<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be
|
865 |
-
"with their values in logs</dfn>"
|
866 |
msgstr ""
|
867 |
-
"<dfn title=\"例)action, comment, log, pwd\"
|
868 |
-
"
|
869 |
|
870 |
-
#: admin/includes/tab-settings.php:
|
871 |
msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
|
872 |
msgstr "<dfn title=\"例)123.456.789.***\">IPアドレスを匿名化する</dfn>"
|
873 |
|
874 |
-
#: admin/includes/tab-settings.php:
|
875 |
msgid "IP address cache settings"
|
876 |
msgstr "IPアドレスのキャッシュ設定"
|
877 |
|
878 |
-
#: admin/includes/tab-settings.php:
|
879 |
#, php-format
|
880 |
msgid ""
|
881 |
"<dfn title=\"If user authentication fails consecutively %d times, subsequent "
|
@@ -885,47 +996,47 @@ msgstr ""
|
|
885 |
"<dfn title=\"ユーザ認証が連続%d回失敗した場合も、以降のログインがこの期間だけ"
|
886 |
"(ガベージコレクション周期を含む)禁止されます。\">有効時間 [sec]</dfn>"
|
887 |
|
888 |
-
#: admin/includes/tab-settings.php:
|
889 |
msgid "Garbage collection period [sec]"
|
890 |
msgstr "ガベージコレクション周期 [秒]"
|
891 |
|
892 |
-
#: admin/includes/tab-settings.php:
|
893 |
msgid "Number of entries to be displayed in cache"
|
894 |
msgstr "「キャッシュ中のIPアドレス」に表示する最大数"
|
895 |
|
896 |
-
#: admin/includes/tab-settings.php:
|
897 |
msgid "Submission settings"
|
898 |
msgstr "投稿時の設定"
|
899 |
|
900 |
-
#: admin/includes/tab-settings.php:
|
901 |
msgid "The whole will be wrapped by <p> tag. Allowed tags: "
|
902 |
msgstr "全体が<p>タグで囲われます。使用可能タグ:"
|
903 |
|
904 |
-
#: admin/includes/tab-settings.php:
|
905 |
msgid "Message on comment form"
|
906 |
msgstr "投稿フォーム上のメッセージ"
|
907 |
|
908 |
-
#: admin/includes/tab-settings.php:
|
909 |
msgid "None"
|
910 |
msgstr "なし"
|
911 |
|
912 |
-
#: admin/includes/tab-settings.php:
|
913 |
msgid "Top"
|
914 |
msgstr "上部"
|
915 |
|
916 |
-
#: admin/includes/tab-settings.php:
|
917 |
msgid "Bottom"
|
918 |
msgstr "下部"
|
919 |
|
920 |
-
#: admin/includes/tab-settings.php:
|
921 |
msgid "Plugin settings"
|
922 |
msgstr "プラグインの設定"
|
923 |
|
924 |
-
#: admin/includes/tab-settings.php:
|
925 |
msgid "Remove all settings at uninstallation"
|
926 |
msgstr "アンインストール時に全設定を削除"
|
927 |
|
928 |
-
#: admin/includes/tab-settings.php:
|
929 |
msgid ""
|
930 |
"<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
|
931 |
"dfn>"
|
@@ -933,7 +1044,7 @@ msgstr ""
|
|
933 |
"<dfn title=\"Google Maps JavaScript API に有効なキー\">Google Maps API キー</"
|
934 |
"dfn>"
|
935 |
|
936 |
-
#: admin/includes/tab-settings.php:
|
937 |
msgid ""
|
938 |
"You need to click the “Save Changes” button for imported "
|
939 |
"settings to take effect."
|
@@ -941,63 +1052,65 @@ msgstr ""
|
|
941 |
"インポートされた設定を有効にするには、「変更を保存」ボタンをクリックする必要"
|
942 |
"があります。"
|
943 |
|
944 |
-
#: admin/includes/tab-settings.php:
|
945 |
msgid "Export / Import settings"
|
946 |
msgstr "設定のエクスポート、インポート"
|
947 |
|
948 |
-
#: admin/includes/tab-settings.php:
|
949 |
msgid "Export settings"
|
950 |
msgstr "エクスポート"
|
951 |
|
952 |
-
#: admin/includes/tab-settings.php:
|
953 |
msgid "Import from the local file"
|
954 |
msgstr "ローカル・ファイルからインポートします"
|
955 |
|
956 |
-
#: admin/includes/tab-settings.php:
|
957 |
msgid "Import settings"
|
958 |
msgstr "インポート"
|
959 |
|
960 |
-
#: admin/includes/tab-settings.php:
|
961 |
msgid "Import pre-defined settings"
|
962 |
msgstr "プリセットのインポート"
|
963 |
|
964 |
-
#: admin/includes/tab-settings.php:
|
965 |
-
msgid ""
|
966 |
-
"Import the preferred settings mainly for the “Back-end target "
|
967 |
-
"settings”"
|
968 |
-
msgstr "主に「バックエンドの設定」に関する推奨の設定値をインポートします"
|
969 |
-
|
970 |
-
#: admin/includes/tab-settings.php:1282
|
971 |
-
msgid "Best settings"
|
972 |
-
msgstr "ベストな設定"
|
973 |
-
|
974 |
-
#: admin/includes/tab-settings.php:1283
|
975 |
msgid ""
|
976 |
"Import the default settings to revert to the “Right after "
|
977 |
"installing” state"
|
978 |
msgstr "インストール直後の状態に戻すための設定値をインポートします"
|
979 |
|
980 |
-
#: admin/includes/tab-settings.php:
|
981 |
msgid "Default settings"
|
982 |
msgstr "初期設定"
|
983 |
|
984 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
985 |
msgid "Delete DB table for validation logs"
|
986 |
msgstr "検証のログ用データベース・テーブルの削除"
|
987 |
|
988 |
-
#: admin/includes/tab-settings.php:
|
989 |
msgid "Delete now"
|
990 |
msgstr "今すぐ削除"
|
991 |
|
992 |
-
#: admin/includes/tab-settings.php:
|
993 |
msgid "Create DB table for validation logs"
|
994 |
msgstr "検証のログ用データベース・テーブルの作成"
|
995 |
|
996 |
-
#: admin/includes/tab-settings.php:
|
997 |
msgid "Create now"
|
998 |
msgstr "今すぐ作成"
|
999 |
|
1000 |
-
#: admin/includes/tab-settings.php:
|
1001 |
msgid ""
|
1002 |
"<dfn title=\"Please copy & paste when submitting your issue to support "
|
1003 |
"forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
|
@@ -1009,15 +1122,15 @@ msgstr ""
|
|
1009 |
"org/support/plugin/ip-geo-block\" title=\"WordPress › Support » "
|
1010 |
"IP Geo Block\">サポートフォーラム</a> ]"
|
1011 |
|
1012 |
-
#: admin/includes/tab-settings.php:
|
1013 |
msgid "Show PHP, WordPress, theme and plugins information."
|
1014 |
msgstr "PHP、WordPress、テーマ、プラグインの情報を表示します。"
|
1015 |
|
1016 |
-
#: admin/includes/tab-settings.php:
|
1017 |
msgid "Show information"
|
1018 |
msgstr "情報を表示"
|
1019 |
|
1020 |
-
#: admin/includes/tab-settings.php:
|
1021 |
msgid ""
|
1022 |
"To enhance the protection ability, please refer to “<a rel=\"noreferrer"
|
1023 |
"\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
|
@@ -1029,7 +1142,7 @@ msgstr ""
|
|
1029 |
"\" title=\"The best practice for target settings | IP Geo Block\">The best "
|
1030 |
"practice fortarget settings</a>“ を参照してください。"
|
1031 |
|
1032 |
-
#: admin/includes/tab-settings.php:
|
1033 |
msgid ""
|
1034 |
"If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
|
1035 |
"\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
|
@@ -1043,7 +1156,7 @@ msgstr ""
|
|
1043 |
"com/codex/#faq\" title=\"Codex | IP Geo Block\">Codex</a> の FAQ を参照してく"
|
1044 |
"ださい。"
|
1045 |
|
1046 |
-
#: admin/includes/tab-settings.php:
|
1047 |
msgid ""
|
1048 |
"While Maxmind and IP2Location will fetch the local database, others will "
|
1049 |
"pass an IP address to the APIs via HTTP."
|
@@ -1051,12 +1164,12 @@ msgstr ""
|
|
1051 |
"MaxmindとIP2Locationはローカルのデータベースを検索しますが、他はHTTPを介して"
|
1052 |
"APIにIPアドレスを渡します。"
|
1053 |
|
1054 |
-
#: admin/includes/tab-settings.php:
|
1055 |
msgid ""
|
1056 |
"Please select the appropriate APIs to fit the privacy law in your country."
|
1057 |
msgstr "自国のプライバシー関連法規に合わせ、適切なAPIを選択して下さい。"
|
1058 |
|
1059 |
-
#: admin/includes/tab-settings.php:
|
1060 |
msgid ""
|
1061 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
1062 |
"ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
|
@@ -1068,7 +1181,7 @@ msgstr ""
|
|
1068 |
"end\" title=\"Codex | IP Geo Block\">Blocking on front-end</a>” を参照"
|
1069 |
"してください。"
|
1070 |
|
1071 |
-
#: admin/includes/tab-settings.php:
|
1072 |
msgid ""
|
1073 |
"If you find any issues or have something to suggest, please feel free to "
|
1074 |
"open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
|
@@ -1080,7 +1193,7 @@ msgstr ""
|
|
1080 |
"› Support » IP Geo Block\">サポートフォーラム</a> に投稿をお願い"
|
1081 |
"します。"
|
1082 |
|
1083 |
-
#: admin/includes/tab-settings.php:
|
1084 |
msgid ""
|
1085 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
1086 |
"ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
|
@@ -1090,7 +1203,7 @@ msgstr ""
|
|
1090 |
"record-settings-and-logs.html\" title=\"Codex | IP Geo Block\">Record "
|
1091 |
"settings and logs</a>” を参照ください。"
|
1092 |
|
1093 |
-
#: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:
|
1094 |
msgid "Statistics of validation"
|
1095 |
msgstr "検証の統計"
|
1096 |
|
@@ -1098,59 +1211,59 @@ msgstr "検証の統計"
|
|
1098 |
msgid "Blocked"
|
1099 |
msgstr "全遮断数"
|
1100 |
|
1101 |
-
#: admin/includes/tab-statistics.php:
|
1102 |
msgid "Blocked by countries"
|
1103 |
msgstr "国別遮断数"
|
1104 |
|
1105 |
-
#: admin/includes/tab-statistics.php:
|
1106 |
msgid "Blocked per day"
|
1107 |
msgstr "1日あたりの遮断数"
|
1108 |
|
1109 |
-
#: admin/includes/tab-statistics.php:
|
1110 |
msgid "Blocked by type of IP address"
|
1111 |
msgstr "遮断したIPアドレスのタイプ"
|
1112 |
|
1113 |
-
#: admin/includes/tab-statistics.php:
|
1114 |
msgid "Name of API"
|
1115 |
msgstr "API名"
|
1116 |
|
1117 |
-
#: admin/includes/tab-statistics.php:
|
1118 |
msgid "Calls"
|
1119 |
msgstr "リクエスト回数"
|
1120 |
|
1121 |
-
#: admin/includes/tab-statistics.php:
|
1122 |
msgid "Response [msec]"
|
1123 |
msgstr "応答時間 [msec]"
|
1124 |
|
1125 |
-
#: admin/includes/tab-statistics.php:
|
1126 |
msgid "Average response time of each API"
|
1127 |
msgstr "API毎の平均応答時間"
|
1128 |
|
1129 |
-
#: admin/includes/tab-statistics.php:
|
1130 |
msgid "Clear statistics"
|
1131 |
msgstr "統計のクリア"
|
1132 |
|
1133 |
-
#: admin/includes/tab-statistics.php:
|
1134 |
-
msgid "Statistics
|
1135 |
msgstr "キャッシュの統計"
|
1136 |
|
1137 |
-
#: admin/includes/tab-statistics.php:
|
1138 |
msgid "Country code / Access"
|
1139 |
msgstr "国コード / アクセス先"
|
1140 |
|
1141 |
-
#: admin/includes/tab-statistics.php:
|
1142 |
msgid "Elapsed [sec] / Calls"
|
1143 |
msgstr "経過時間 [sec] / 回数"
|
1144 |
|
1145 |
-
#: admin/includes/tab-statistics.php:
|
1146 |
msgid "IP address in cache"
|
1147 |
msgstr "キャッシュ中のIPアドレス"
|
1148 |
|
1149 |
-
#: admin/includes/tab-statistics.php:
|
1150 |
msgid "Clear cache"
|
1151 |
msgstr "キャッシュのクリア"
|
1152 |
|
1153 |
-
#: admin/includes/tab-statistics.php:
|
1154 |
msgid ""
|
1155 |
"Current setting of [<strong>Record validation statistics</strong>] on "
|
1156 |
"[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
|
@@ -1158,7 +1271,7 @@ msgstr ""
|
|
1158 |
"現在[<strong>設定</strong>]タブの[<strong>検証の統計を記録</strong>]は"
|
1159 |
"[<strong>有効</strong>]が選択されていません。"
|
1160 |
|
1161 |
-
#: admin/includes/tab-statistics.php:
|
1162 |
msgid ""
|
1163 |
"Please set the proper condition to record and analyze the validation "
|
1164 |
"statistics."
|
@@ -1172,35 +1285,52 @@ msgstr ""
|
|
1172 |
"少なくとも1つ以上の位置情報サービスを選択して下さい。未選択の場合、キャッシュ"
|
1173 |
"の有効期限切れと共にロックアウトされます。"
|
1174 |
|
1175 |
-
#: classes/class-ip-geo-block-cron.php:
|
1176 |
msgid "Your database file is up-to-date."
|
1177 |
msgstr "データベース・ファイルは最新です。"
|
1178 |
|
1179 |
-
#: classes/class-ip-geo-block-cron.php:
|
1180 |
-
#: classes/class-ip-geo-block-cron.php:
|
1181 |
#, php-format
|
1182 |
msgid "Unable to read %s. Please check the permission."
|
1183 |
msgstr "%s が読めません。パーミッションを確認して下さい。"
|
1184 |
|
1185 |
-
#: classes/class-ip-geo-block-cron.php:
|
1186 |
-
#: classes/class-ip-geo-block-cron.php:
|
1187 |
#, php-format
|
1188 |
msgid "Can't lock %s. Please try again after a while."
|
1189 |
msgstr "%s をロックできません。パーミッションを確認して下さい。"
|
1190 |
|
1191 |
-
#: classes/class-ip-geo-block-cron.php:
|
1192 |
-
|
1193 |
-
|
1194 |
-
msgstr "%sを読み込むことが出来ません。パーミションをチェックしてください。"
|
1195 |
|
1196 |
-
#: classes/class-ip-geo-block-
|
1197 |
#, php-format
|
1198 |
-
msgid "
|
1199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1200 |
|
1201 |
-
#: classes/class-ip-geo-block-
|
1202 |
-
msgid "
|
1203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1204 |
|
1205 |
#: classes/class-ip-geo-block-logs.php:149
|
1206 |
#, php-format
|
@@ -1218,7 +1348,7 @@ msgstr ""
|
|
1218 |
msgid "Database file does not exist."
|
1219 |
msgstr "データベース・ファイルが見つかりません。"
|
1220 |
|
1221 |
-
#: wp-content/mu-plugins/ip-geo-block-mu.php:
|
1222 |
#, php-format
|
1223 |
msgid ""
|
1224 |
"Can't find IP Geo Block in your plugins directory. Please remove <code>%s</"
|
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 |
"自国以外から投稿されるスパム、ログインフォーム、さらにゼロデイ攻撃を含む管理"
|
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 以上が必要です。"
|
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 |
"いた後、あなたの国コードと「<strong>マッチング規則</strong>」を「<a href=\"%s"
|
85 |
"\">検証ルールの設定</a>」で確認して下さい。"
|
86 |
|
87 |
+
#: admin/class-ip-geo-block-admin.php:352
|
88 |
#, php-format
|
89 |
msgid ""
|
90 |
"The “<strong>Matching rule</strong>” is not set properly. Please "
|
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 |
"あなたの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 |
"<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 |
"あなたの国コードまたは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 |
"あなたの国コードまたは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 |
+
"“mu-plugins” (ip-geo-block-mu.php) at “Validation "
|
141 |
+
"timing” is imcompatible with <strong>IP Geo Allow</strong>. Please "
|
142 |
+
"select “init” action hook."
|
143 |
+
msgstr ""
|
144 |
+
"「検証のタイミング」に「“mu-plugins” (ip-geo-block-mu.php)」が選"
|
145 |
+
"択されていますが、<strong>IP Geo Allow</strong> と互換性がありません。"
|
146 |
+
"「“init” アクション・フック」を選択してください。"
|
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 |
"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 "リクエスト"
|
307 |
|
308 |
+
#: admin/includes/tab-accesslog.php:137
|
309 |
msgid "User agent"
|
310 |
msgstr "ユーザーエージェント"
|
311 |
|
312 |
+
#: admin/includes/tab-accesslog.php:138
|
313 |
msgid "HTTP headers"
|
314 |
msgstr "HTTPヘッダ"
|
315 |
|
316 |
+
#: admin/includes/tab-accesslog.php:139
|
317 |
msgid "$_POST data"
|
318 |
msgstr "$_POSTデータ"
|
319 |
|
320 |
+
#: admin/includes/tab-accesslog.php:156
|
321 |
msgid ""
|
322 |
"Current selection of [<strong>Record validation logs</strong>] on "
|
323 |
"[<strong>Settings</strong>] tab is [<strong>Disable</strong>]."
|
325 |
"現在[<strong>設定</strong>]タブの[<strong>検証のログを記録</strong>]は"
|
326 |
"[<strong>無効</strong>]が選択されています。"
|
327 |
|
328 |
+
#: admin/includes/tab-accesslog.php:157
|
329 |
msgid ""
|
330 |
"Please select the proper condition to record and analyze the validation logs."
|
331 |
msgstr "検証のログを記録し分析するためには、適切な条件を選択して下さい。"
|
334 |
msgid "Attribution links"
|
335 |
msgstr "APIサービスの提供元"
|
336 |
|
337 |
+
#: admin/includes/tab-geolocation.php:18
|
338 |
msgid "Search IP address geolocation"
|
339 |
msgstr "IPアドレスの位置情報を検索"
|
340 |
|
341 |
+
#: admin/includes/tab-geolocation.php:42
|
342 |
msgid "Geolocation service"
|
343 |
msgstr "位置情報サービス"
|
344 |
|
345 |
+
#: admin/includes/tab-geolocation.php:82
|
346 |
msgid "Find geolocation"
|
347 |
msgstr "位置情報の検索"
|
348 |
|
349 |
+
#: admin/includes/tab-geolocation.php:90
|
350 |
msgid "Search now"
|
351 |
msgstr "今すぐ検索"
|
352 |
|
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 “Scan country code”.\">Server IP address / "
|
378 |
+
"Country</dfn>"
|
379 |
+
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 “Whitelist” or “Blacklist”."
|
394 |
msgstr "「ホワイトリスト」または「ブラックリスト」のいずれかを選択して下さい。"
|
395 |
|
396 |
+
#: admin/includes/tab-settings.php:116
|
397 |
msgid ""
|
398 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
399 |
+
"empty. The special code “XX” is assigned as private IP address "
|
400 |
+
"including localhost. And “ZZ” is for unknown IP address (i.e. "
|
401 |
+
"not in the geolocation databases). Please use “YY” if you need "
|
402 |
+
"the code that does not correspond to any of the countries.\">Whitelist of "
|
403 |
+
"country code</dfn>"
|
404 |
msgstr ""
|
405 |
+
"<dfn title=\"空欄の場合、「国コードで遮断」はバイパスされます。特別なコード"
|
406 |
+
"「XX」は、localhost を含むプライベート・アドレスに割り当てられ、また"
|
407 |
+
"「ZZ」は不明(位置情報データベースに未登録)を表します。どの国にもマッチさせ"
|
408 |
+
"ないことが必要な場合には、「YY」を指定してください。\">国コードのホワイトリス"
|
409 |
+
"ト</dfn>"
|
410 |
|
411 |
+
#: admin/includes/tab-settings.php:117
|
412 |
msgid ""
|
413 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
414 |
+
"empty. The special code “XX” is assigned as private IP address "
|
415 |
+
"including localhost. And “ZZ” is for unknown IP address (i.e. "
|
416 |
+
"not in the geolocation databases). Please use “YY” if you need "
|
417 |
+
"the code that does not correspond to any of the countries.\">Blacklist of "
|
418 |
+
"country code</dfn>"
|
419 |
msgstr ""
|
420 |
+
"<dfn title=\"空欄の場合、「国コードで遮断」はバイパスされます。特別なコード"
|
421 |
+
"「XX」は、localhost を含むプライベート・アドレスに割り当てられ、また"
|
422 |
+
"「ZZ」は不明(位置情報データベースに未登録)を表します。どの国にもマッチさせ"
|
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 |
"国コードまたは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 |
"国コードまたはIPアドレスがブラックリストに<strong>含まれている</strong>リクエ"
|
452 |
"ストを遮断します。"
|
453 |
|
454 |
+
#: admin/includes/tab-settings.php:188
|
455 |
msgid ""
|
456 |
"<dfn title=\"e.g. “192.0.64.0/18” for Jetpack server, "
|
457 |
"“69.46.36.0/27” for WordFence server\">Whitelist of extra IP "
|
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 |
"<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 “"
|
475 |
+
"HTTP_X_FORWARDED_FOR”, “HTTP_X_REAL_IP” or something like "
|
476 |
+
"that to retrieve the client IP address.\">$_SERVER keys to retrieve extra IP "
|
477 |
"addresses</dfn>"
|
478 |
msgstr ""
|
479 |
+
"<dfn title=\"あなたのサーバーがプロキシー・サーバーやロード・バランサーの背後"
|
480 |
+
"に位置する場合には、クライアントのIPアドレスを抽出するために"
|
481 |
+
"「HTTP_X_FORWARDED_FOR」や「HTTP_X_REAL_IP」など、$_SERVER の適切な"
|
482 |
+
"キーを指定してください。\">IPアドレスを追加抽出する $_SERVER の"
|
483 |
+
"キー</dfn>"
|
484 |
|
485 |
+
#: admin/includes/tab-settings.php:246
|
486 |
msgid ""
|
487 |
"<dfn title=\"It validates malicious signatures independently of “Block "
|
488 |
"by country” and “Prevent Zero-day Exploit” for the target "
|
489 |
"“Admin area”, “Admin ajax/post”, “Plugins "
|
490 |
"area” and “Themes area”.\">Bad signatures in query</dfn> "
|
491 |
+
"<nobr>(<a class=\"ip-geo-block-cycle\" id=\"ip-geo-block-decode\" title="
|
492 |
"\"When you find ugly character string in the text area, please click to "
|
493 |
+
"restore.\"><span></span></a>)</nobr>"
|
494 |
msgstr ""
|
495 |
"<dfn title=\"「国コードで遮断」および「ゼロデイ攻撃を遮断」とは独立に、「管理"
|
496 |
"領域」、「管理領域 ajax/post」、「プラグイン領域」、「テーマ領域」をターゲッ"
|
497 |
"トとした悪意のあるシグネチャを検証します。\">悪意のあるシグネチャ</dfn> "
|
498 |
+
"<nobr>(<a class=\"ip-geo-block-cycle\" id=\"ip-geo-block-decode\" title=\"文"
|
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=\"許可する MIME タイプを指定します。\">許可する"
|
507 |
+
" MIME タイプのホワイトリスト</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>"
|
513 |
+
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 “"
|
521 |
+
"mu-plugins” (ip-geo-block-mu.php) at “Validation timing” "
|
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 |
+
"由するマルウェアやバックドアのアップロードを遮断します。他のプラグインやテー"
|
527 |
+
"マに先んじて確実に遮断するために、「検証のタイミング」を「“mu-"
|
528 |
+
"plugins” (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=\"権限、および拡張子と MIME タイプの整合性を検証しま"
|
540 |
+
"す。\">権限と MIME タイプを検証</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 |
"<dfn title=\"テーマ・ディレクトリには 403.php など、独自のファ"
|
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 "
|
559 |
+
"prevent loop of redirection even when you enable [Block by country] in "
|
560 |
+
"[Front-end target settings] section. Empty URL is altered to your home."
|
561 |
"\">Redirect URL</dfn>"
|
562 |
msgstr ""
|
563 |
"<dfn title=\"レスポンス・コード 2xx 、3xx 用のリダイレク"
|
566 |
"ります。空欄の場合、サイトのホームが使用されます。\">リダイレクト先 "
|
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 |
"<dfn title=\"レスポンス・コード 4xx、5xx 用のメッセージを指定し"
|
575 |
"ます。\">レスポンス・メッセージ</dfn>"
|
576 |
|
577 |
+
#: admin/includes/tab-settings.php:390
|
578 |
msgid ""
|
579 |
+
"<dfn title=\"This is applied to “XML-RPC” and “Login "
|
580 |
+
"form”. Lockout period is defined as expiration time at “Cache "
|
581 |
+
"settings”.\">Max number of failed login attempts per IP address</dfn>"
|
582 |
msgstr ""
|
583 |
"<dfn title=\"「XML-RPC」と「ログイン・フォーム」に適用されます。ロックアウト"
|
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 "“init” action hook"
|
597 |
msgstr "“init” アクション・フック"
|
598 |
|
599 |
+
#: admin/includes/tab-settings.php:430
|
600 |
msgid "“mu-plugins” (ip-geo-block-mu.php)"
|
601 |
msgstr "“mu-plugins” (ip-geo-block-mu.php)"
|
602 |
|
603 |
+
#: admin/includes/tab-settings.php:433
|
604 |
msgid ""
|
605 |
"Validate at “init” action hook in the same manner as typical "
|
606 |
"plugins."
|
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 |
"com/codex/validation-timing.html' title='Validation timing | IP Geo Block'>幾"
|
621 |
"つかの制限事項</a> が生じます。"
|
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 |
"国コードに拘らず、ダッシュボード向けサービスだけに関連する悪意のあるリクエス"
|
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 "管理領域 ajax/post"
|
683 |
|
684 |
+
#: admin/includes/tab-settings.php:627
|
685 |
msgid ""
|
686 |
+
"<dfn title=\"Specify the page name (“page=…”) or the "
|
687 |
+
"action name (“action=…”) to prevent undesired blocking "
|
688 |
+
"caused by “Block by country” for non logged-in user and “"
|
689 |
+
"Prevent Zero-day Exploit” for logged-in user.\">Exceptions</dfn>"
|
|
|
|
|
|
|
|
|
690 |
msgstr ""
|
691 |
+
"<dfn title=\"「国コードで遮断」または「ゼロデイ攻撃を遮断」が、それぞれ一般訪"
|
692 |
+
"問者、ログインユーザーを意図せず遮断する場合、検証対象から除外するリクエスト"
|
693 |
+
"を特定するために、ページ名(“…”)、またはアクション名"
|
694 |
+
"(“…”)を指定してください。\">除外する項目</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>"
|
704 |
+
"%s⋯/*.php</code>."
|
705 |
msgstr ""
|
706 |
"国コードに拘らず、<code>%s…/*.php</code>への悪意のあるリクエストを遮断"
|
707 |
"します。"
|
708 |
|
709 |
+
#: admin/includes/tab-settings.php:641
|
710 |
#, php-format
|
711 |
msgid ""
|
712 |
"It configures “%s” to validate a request to the PHP file which "
|
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 “"
|
722 |
"INACTIVE”.\">Exceptions</dfn>"
|
723 |
msgstr ""
|
724 |
+
"<dfn title=\"意図しない遮断の原因となる項目を選択し、検証対象から除外します。"
|
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 “Validation rule settings”"
|
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. "
|
752 |
+
"This is useful to prevent violation against your affiliate program."
|
753 |
+
"\">Response code</dfn> %s"
|
754 |
+
msgstr ""
|
755 |
+
"<dfn title=\"バックエンドと異なるレスポンス・コードを設定できます。これは、ア"
|
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 |
"<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 |
"<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 |
"<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 “Validation timing” is deferred till “"
|
807 |
"wp” action hook. It means that this feature would not be compatible "
|
810 |
"「検証のタイミング」が “wp” アクション・フックまで遅延されます。"
|
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 “:” (pass) or "
|
824 |
"国コード、または 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, “HOST” and “"
|
843 |
+
"HOST=…”in “UA string and qualification” will always "
|
844 |
+
"return “true”."
|
845 |
+
msgstr ""
|
846 |
+
"DNS 逆引きによりホストを検証します(幾らかのサーバー・リソースを消費し"
|
847 |
+
"ます)。無効にした場合、「ユーザーエージェント文字列と条件」中の「HOST」、"
|
848 |
+
"「HOST=…」は常に真となります。"
|
849 |
+
|
850 |
+
#: admin/includes/tab-settings.php:1023
|
851 |
+
msgid "DNS reverse lookup"
|
852 |
+
msgstr "DNS 逆引き"
|
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 “Public facing pages” in Logs."
|
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 |
"<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 "
|
888 |
"contents of tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> "
|
889 |
"from <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-"
|
890 |
"IP-Geo-API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-"
|
891 |
+
"IP-Geo-API</a>. Please install <code>ip-geo-api</code> with write permission "
|
892 |
+
"according to <a rel=\"noreferrer\" href=\"http://www.ipgeoblock.com/codex/"
|
893 |
+
"how-to-fix-permission-troubles.html\" title=\"How can I fix permission "
|
894 |
+
"troubles? | IP Geo Block\">this instruction</a>."
|
895 |
msgstr ""
|
896 |
"<code>%s</code> に位置情報APIライブラリが見つかりません。<a rel=\"noreferrer"
|
897 |
"\" href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API\" title="
|
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>"
|
977 |
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 |
"<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 <p> tag. Allowed tags: "
|
1013 |
msgstr "全体が<p>タグで囲われます。使用可能タグ:"
|
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 |
"<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 “Save Changes” button for imported "
|
1050 |
"settings to take effect."
|
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 “Right after "
|
1078 |
"installing” 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 “Back-end target settings”"
|
1089 |
+
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 & paste when submitting your issue to support "
|
1116 |
"forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
|
1122 |
"org/support/plugin/ip-geo-block\" title=\"WordPress › Support » "
|
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 “<a rel=\"noreferrer"
|
1136 |
"\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
|
1142 |
"\" title=\"The best practice for target settings | IP Geo Block\">The best "
|
1143 |
"practice fortarget settings</a>“ を参照してください。"
|
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 |
"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 |
"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 “<a rel=\"noreferrer\" href=\"http://www."
|
1175 |
"ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
|
1181 |
"end\" title=\"Codex | IP Geo Block\">Blocking on front-end</a>” を参照"
|
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 |
"› Support » IP Geo Block\">サポートフォーラム</a> に投稿をお願い"
|
1194 |
"します。"
|
1195 |
|
1196 |
+
#: admin/includes/tab-settings.php:1559
|
1197 |
msgid ""
|
1198 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
1199 |
"ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
|
1203 |
"record-settings-and-logs.html\" title=\"Codex | IP Geo Block\">Record "
|
1204 |
"settings and logs</a>” を参照ください。"
|
1205 |
|
1206 |
+
#: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:186
|
1207 |
msgid "Statistics of validation"
|
1208 |
msgstr "検証の統計"
|
1209 |
|
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 |
"現在[<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."
|
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 |
|
1308 |
+
#: classes/class-ip-geo-block-file.php:54
|
1309 |
#, php-format
|
1310 |
+
msgid ""
|
1311 |
+
"This plugin does not support method “%s” for FTP or SSH based "
|
1312 |
+
"file operations. Please refer to <a href=\"https://codex.wordpress.org/"
|
1313 |
+
"Editing_wp-config.php#WordPress_Upgrade_Constants\" title=\"Editing wp-"
|
1314 |
+
"config.php « WordPress Codex\">this document</a> for more details."
|
1315 |
+
msgstr ""
|
1316 |
+
"本プラグインは、メソッド「%s」による FTP あるいは SSH を使ったファイル操作を"
|
1317 |
+
"サポートしていません。詳しくは、<a href=\"https://codex.wordpress.org/"
|
1318 |
+
"Editing_wp-config.php#WordPress_Upgrade_Constants\" title=\"Editing wp-"
|
1319 |
+
"config.php « WordPress Codex\">このドキュメント</a>を参照してください。"
|
1320 |
|
1321 |
+
#: classes/class-ip-geo-block-file.php:68
|
1322 |
+
msgid ""
|
1323 |
+
"You should define some constants in your <code>wp-config.php</code> for FTP "
|
1324 |
+
"or SSH based file operations. Please refer to <a href=\"https://codex."
|
1325 |
+
"wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants\" title="
|
1326 |
+
"\"Editing wp-config.php « WordPress Codex\">this document</a> for more "
|
1327 |
+
"details."
|
1328 |
+
msgstr ""
|
1329 |
+
"本プラグインでは、FTP あるいは SSH を使ったファイル操作を有効にするためには、"
|
1330 |
+
"<code>wp-config.php</code> に幾つかの定義が必要です。詳しくは、<a href="
|
1331 |
+
"\"https://codex.wordpress.org/Editing_wp-config."
|
1332 |
+
"php#WordPress_Upgrade_Constants\" title=\"Editing wp-config.php « "
|
1333 |
+
"WordPress Codex\">このドキュメント</a>を参照してください。"
|
1334 |
|
1335 |
#: classes/class-ip-geo-block-logs.php:149
|
1336 |
#, php-format
|
1348 |
msgid "Database file does not exist."
|
1349 |
msgstr "データベース・ファイルが見つかりません。"
|
1350 |
|
1351 |
+
#: wp-content/mu-plugins/ip-geo-block-mu.php:70
|
1352 |
#, php-format
|
1353 |
msgid ""
|
1354 |
"Can't find IP Geo Block in your plugins directory. Please remove <code>%s</"
|
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.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
|
7 |
-
"POT-Creation-Date: 2017-
|
8 |
-
"PO-Revision-Date: 2017-
|
9 |
"Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
|
10 |
"Language-Team: \n"
|
11 |
"MIME-Version: 1.0\n"
|
@@ -25,53 +25,53 @@ msgid ""
|
|
25 |
"posted from outside your nation, and also prevents zero-day exploit."
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: admin/class-ip-geo-block-admin.php:
|
29 |
msgid "Import settings ?"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: admin/class-ip-geo-block-admin.php:
|
33 |
msgid "Create table ?"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: admin/class-ip-geo-block-admin.php:
|
37 |
msgid "Delete table ?"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: admin/class-ip-geo-block-admin.php:
|
41 |
msgid "Clear statistics ?"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: admin/class-ip-geo-block-admin.php:
|
45 |
msgid "Clear cache ?"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: admin/class-ip-geo-block-admin.php:
|
49 |
msgid "Clear logs ?"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: admin/class-ip-geo-block-admin.php:
|
53 |
msgid "This feature is available with HTML5 compliant browsers."
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: admin/class-ip-geo-block-admin.php:
|
57 |
msgid "Contribute at GitHub"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: admin/class-ip-geo-block-admin.php:
|
61 |
-
#: admin/class-ip-geo-block-admin.php:
|
62 |
msgid "Settings"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: admin/class-ip-geo-block-admin.php:
|
66 |
-
#: admin/class-ip-geo-block-admin.php:
|
67 |
msgid "IP Geo Block"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: admin/class-ip-geo-block-admin.php:
|
71 |
msgid "You need WordPress 3.7+."
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: admin/class-ip-geo-block-admin.php:
|
75 |
#, php-format
|
76 |
msgid ""
|
77 |
"Now downloading geolocation databases in background. After a little while, "
|
@@ -79,212 +79,230 @@ msgid ""
|
|
79 |
"strong>” at <a href=\"%s\">Validation rule settings</a>."
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: admin/class-ip-geo-block-admin.php:
|
83 |
#, php-format
|
84 |
msgid ""
|
85 |
"The “<strong>Matching rule</strong>” 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:
|
90 |
msgid "Local database and matching rule have been updated."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: admin/class-ip-geo-block-admin.php:
|
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:
|
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:
|
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:
|
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:
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
msgid "Statistics"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: admin/class-ip-geo-block-admin.php:
|
128 |
msgid "Logs"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: admin/class-ip-geo-block-admin.php:
|
132 |
msgid "Search"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: admin/class-ip-geo-block-admin.php:
|
136 |
msgid "Attribution"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: admin/class-ip-geo-block-admin.php:
|
140 |
msgid "Toggle all"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: admin/class-ip-geo-block-admin.php:
|
144 |
msgid "Thanks for providing these great services for free."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: admin/class-ip-geo-block-admin.php:
|
148 |
msgid ""
|
149 |
"(Most browsers will redirect you to each site <a href=\"http://www."
|
150 |
"ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
|
151 |
"when you click the link</a>.)"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: admin/class-ip-geo-block-admin.php:
|
155 |
msgid "Back to top"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: admin/class-ip-geo-block-admin.php:
|
159 |
msgid "Enable"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: admin/class-ip-geo-block-admin.php:
|
163 |
-
#:
|
164 |
-
#: classes/class-ip-geo-block-cron.php:
|
165 |
-
#: classes/class-ip-geo-block-cron.php:318
|
166 |
-
#: classes/class-ip-geo-block-opts.php:311
|
167 |
#, php-format
|
168 |
msgid "Unable to write %s. Please check the permission."
|
169 |
msgstr ""
|
170 |
|
171 |
-
#: admin/class-ip-geo-block-admin.php:
|
172 |
#, php-format
|
173 |
msgid "Or please refer to %s to set it manually."
|
174 |
msgid_plural "Or please refer to %s to set them manually."
|
175 |
msgstr[0] ""
|
176 |
msgstr[1] ""
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
#: admin/includes/class-admin-ajax.php:60
|
179 |
msgid "n/a"
|
180 |
msgstr ""
|
181 |
|
182 |
#: admin/includes/class-admin-ajax.php:63 admin/includes/tab-settings.php:81
|
|
|
183 |
msgid "UNKNOWN"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: admin/includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
msgid "Validation logs"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: admin/includes/tab-accesslog.php:
|
191 |
msgid "Filter logs"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: admin/includes/tab-accesslog.php:
|
195 |
msgid "Reset"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: admin/includes/tab-accesslog.php:
|
199 |
msgid "Clear logs"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: admin/includes/tab-accesslog.php:
|
203 |
-
#: admin/includes/tab-statistics.php:
|
204 |
msgid "Clear now"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: admin/includes/tab-accesslog.php:
|
208 |
msgid "Export logs"
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: admin/includes/tab-accesslog.php:
|
212 |
msgid "Export to the local file"
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: admin/includes/tab-accesslog.php:
|
216 |
msgid "Export csv"
|
217 |
msgstr ""
|
218 |
|
219 |
-
#: admin/includes/tab-accesslog.php:
|
220 |
#, php-format
|
221 |
msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: admin/includes/tab-accesslog.php:
|
225 |
msgid "Comment post"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: admin/includes/tab-accesslog.php:
|
229 |
msgid "XML-RPC"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: admin/includes/tab-accesslog.php:
|
233 |
msgid "Login form"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: admin/includes/tab-accesslog.php:
|
237 |
msgid "Admin area"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: admin/includes/tab-accesslog.php:
|
241 |
msgid "public facing pages"
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: admin/includes/tab-accesslog.php:
|
245 |
msgid "Public facing pages"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: admin/includes/tab-accesslog.php:
|
249 |
msgid "Date"
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: admin/includes/tab-accesslog.php:
|
253 |
-
#: admin/includes/tab-statistics.php:
|
254 |
msgid "IP address"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: admin/includes/tab-accesslog.php:
|
258 |
msgid "Code"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: admin/includes/tab-accesslog.php:
|
262 |
msgid "Result"
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: admin/includes/tab-accesslog.php:
|
266 |
msgid "Request"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: admin/includes/tab-accesslog.php:
|
270 |
msgid "User agent"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: admin/includes/tab-accesslog.php:
|
274 |
msgid "HTTP headers"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: admin/includes/tab-accesslog.php:
|
278 |
msgid "$_POST data"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: admin/includes/tab-accesslog.php:
|
282 |
msgid ""
|
283 |
"Current selection of [<strong>Record validation logs</strong>] on "
|
284 |
"[<strong>Settings</strong>] tab is [<strong>Disable</strong>]."
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: admin/includes/tab-accesslog.php:
|
288 |
msgid ""
|
289 |
"Please select the proper condition to record and analyze the validation logs."
|
290 |
msgstr ""
|
@@ -293,19 +311,19 @@ msgstr ""
|
|
293 |
msgid "Attribution links"
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: admin/includes/tab-geolocation.php:
|
297 |
msgid "Search IP address geolocation"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: admin/includes/tab-geolocation.php:
|
301 |
msgid "Geolocation service"
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: admin/includes/tab-geolocation.php:
|
305 |
msgid "Find geolocation"
|
306 |
msgstr ""
|
307 |
|
308 |
-
#: admin/includes/tab-geolocation.php:
|
309 |
msgid "Search now"
|
310 |
msgstr ""
|
311 |
|
@@ -320,146 +338,196 @@ msgid ""
|
|
320 |
"Country</dfn>"
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: admin/includes/tab-settings.php:82
|
324 |
msgid "Scan all the APIs you selected at Geolocation API settings"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: admin/includes/tab-settings.php:82
|
328 |
msgid "Scan country code"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
msgid "Whitelist"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: admin/includes/tab-settings.php:
|
336 |
msgid "Blacklist"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: admin/includes/tab-settings.php:
|
340 |
msgid ""
|
341 |
"Please select either “Whitelist” or “Blacklist”."
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: admin/includes/tab-settings.php:
|
345 |
msgid ""
|
346 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
347 |
-
"empty.
|
348 |
-
"
|
|
|
|
|
|
|
349 |
msgstr ""
|
350 |
|
351 |
-
#: admin/includes/tab-settings.php:
|
352 |
msgid ""
|
353 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
354 |
-
"empty.
|
355 |
-
"
|
|
|
|
|
|
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: admin/includes/tab-settings.php:
|
359 |
msgid "(comma separated)"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: admin/includes/tab-settings.php:
|
363 |
msgid "(comma or RET separated)"
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: admin/includes/tab-settings.php:
|
367 |
msgid "Matching rule"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: admin/includes/tab-settings.php:
|
371 |
msgid ""
|
372 |
"A request from which the country code or IP address is <strong>NOT</strong> "
|
373 |
"in the whitelist will be blocked."
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: admin/includes/tab-settings.php:
|
377 |
msgid ""
|
378 |
"A request from which the country code or IP address is in the blacklist will "
|
379 |
"be blocked."
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: admin/includes/tab-settings.php:
|
383 |
msgid ""
|
384 |
"<dfn title=\"e.g. “192.0.64.0/18” for Jetpack server, "
|
385 |
"“69.46.36.0/27” for WordFence server\">Whitelist of extra IP "
|
386 |
"addresses prior to country code</dfn>"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: admin/includes/tab-settings.php:
|
390 |
msgid ""
|
391 |
"<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
|
392 |
"\">Blacklist of extra IP addresses prior to country code</dfn>"
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: admin/includes/tab-settings.php:
|
396 |
msgid ""
|
397 |
-
"<dfn title=\"
|
|
|
|
|
|
|
398 |
"addresses</dfn>"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: admin/includes/tab-settings.php:
|
402 |
msgid ""
|
403 |
"<dfn title=\"It validates malicious signatures independently of “Block "
|
404 |
"by country” and “Prevent Zero-day Exploit” for the target "
|
405 |
"“Admin area”, “Admin ajax/post”, “Plugins "
|
406 |
"area” and “Themes area”.\">Bad signatures in query</dfn> "
|
407 |
-
"<nobr>(<a
|
408 |
"\"When you find ugly character string in the text area, please click to "
|
409 |
-
"restore.\"><span
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
#, php-format
|
414 |
msgid ""
|
415 |
"<dfn title=\"You can put your original 403.php and so on into your theme "
|
416 |
"directory.\">Response code</dfn> %s"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: admin/includes/tab-settings.php:
|
420 |
msgid ""
|
421 |
-
"<dfn title=\"Specify the URL for response code 2xx and 3xx.
|
422 |
-
"
|
423 |
-
"
|
|
|
424 |
"\">Redirect URL</dfn>"
|
425 |
msgstr ""
|
426 |
|
427 |
-
#: admin/includes/tab-settings.php:
|
428 |
msgid ""
|
429 |
"<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
|
430 |
"message</dfn>"
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: admin/includes/tab-settings.php:
|
434 |
msgid ""
|
435 |
-
"<dfn title=\"
|
436 |
-
"Lockout period is defined as expiration time at “Cache
|
437 |
-
"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: admin/includes/tab-settings.php:
|
441 |
msgid "Select when to run the validation."
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: admin/includes/tab-settings.php:
|
445 |
msgid "Validation timing"
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: admin/includes/tab-settings.php:
|
449 |
msgid "“init” action hook"
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: admin/includes/tab-settings.php:
|
453 |
msgid "“mu-plugins” (ip-geo-block-mu.php)"
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: admin/includes/tab-settings.php:
|
457 |
msgid ""
|
458 |
"Validate at “init” action hook in the same manner as typical "
|
459 |
"plugins."
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: admin/includes/tab-settings.php:
|
463 |
msgid ""
|
464 |
"Validate at an earlier phase than other typical plugins. It can reduce load "
|
465 |
"on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
|
@@ -467,172 +535,171 @@ msgid ""
|
|
467 |
"restrictions</a>."
|
468 |
msgstr ""
|
469 |
|
470 |
-
#: admin/includes/tab-settings.php:
|
471 |
msgid "Back-end target settings"
|
472 |
msgstr ""
|
473 |
|
474 |
-
#: admin/includes/tab-settings.php:
|
475 |
#, php-format
|
476 |
msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: admin/includes/tab-settings.php:
|
480 |
msgid "Other areas"
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: admin/includes/tab-settings.php:
|
484 |
-
#: admin/includes/tab-settings.php:
|
485 |
-
#: admin/includes/tab-settings.php:
|
486 |
msgid "Block by country"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: admin/includes/tab-settings.php:
|
490 |
-
#: admin/includes/tab-settings.php:1029
|
491 |
-
msgid "Disable"
|
492 |
-
msgstr ""
|
493 |
-
|
494 |
-
#: admin/includes/tab-settings.php:412
|
495 |
msgid "Completely close"
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: admin/includes/tab-settings.php:
|
499 |
msgid ""
|
500 |
"<dfn title=\"Specify the individual action as a blocking target.\">Target "
|
501 |
"actions</dfn>"
|
502 |
msgstr ""
|
503 |
|
504 |
-
#: admin/includes/tab-settings.php:
|
505 |
msgid "Prevent Zero-day Exploit"
|
506 |
msgstr ""
|
507 |
|
508 |
-
#: admin/includes/tab-settings.php:
|
509 |
msgid ""
|
510 |
"It will block a request related to the services for both public facing pages "
|
511 |
"and the dashboard."
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: admin/includes/tab-settings.php:
|
515 |
msgid ""
|
516 |
"Regardless of the country code, it will block a malicious request related to "
|
517 |
"the services only for the dashboard."
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: admin/includes/tab-settings.php:
|
521 |
-
msgid "for logged-in
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: admin/includes/tab-settings.php:
|
525 |
-
msgid "for non logged-in
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: admin/includes/tab-settings.php:
|
529 |
msgid "Admin ajax/post"
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: admin/includes/tab-settings.php:
|
533 |
msgid ""
|
534 |
-
"<dfn title=\"
|
535 |
-
"
|
536 |
-
"country” for non logged-in
|
537 |
-
"
|
538 |
-
"in “page=…”) or action name (“…” in "
|
539 |
-
"“action=…”), which would be implemented with a non "
|
540 |
-
"WordPress standard way, into the field to specify the request.\">Exceptions</"
|
541 |
-
"dfn>"
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: admin/includes/tab-settings.php:
|
545 |
msgid "Candidate actions"
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: admin/includes/tab-settings.php:
|
549 |
#, php-format
|
550 |
msgid ""
|
551 |
"Regardless of the country code, it will block a malicious request to <code>"
|
552 |
-
"%s&
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: admin/includes/tab-settings.php:
|
556 |
#, php-format
|
557 |
msgid ""
|
558 |
"It configures “%s” to validate a request to the PHP file which "
|
559 |
"does not load WordPress core."
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: admin/includes/tab-settings.php:
|
563 |
msgid ""
|
564 |
"<dfn title=\"Select the item which causes undesired blocking in order to "
|
565 |
"exclude from the validation target. Grayed item indicates “"
|
566 |
"INACTIVE”.\">Exceptions</dfn>"
|
567 |
msgstr ""
|
568 |
|
569 |
-
#: admin/includes/tab-settings.php:
|
570 |
msgid "Force to load WP core"
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: admin/includes/tab-settings.php:
|
574 |
msgid "Plugins area"
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: admin/includes/tab-settings.php:
|
578 |
msgid "Themes area"
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: admin/includes/tab-settings.php:
|
582 |
msgid "Front-end target settings"
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: admin/includes/tab-settings.php:
|
586 |
msgid "Follow “Validation rule settings”"
|
587 |
msgstr ""
|
588 |
|
589 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
msgid ""
|
591 |
"<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: admin/includes/tab-settings.php:
|
595 |
msgid ""
|
596 |
"<dfn title=\"Specify the individual post type on a single page as a blocking "
|
597 |
"target.\">Post type</dfn>"
|
598 |
msgstr ""
|
599 |
|
600 |
-
#: admin/includes/tab-settings.php:
|
601 |
msgid ""
|
602 |
"<dfn title=\"Specify the individual category on a single page or archive "
|
603 |
"page as a blocking target.\">Category</dfn>"
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: admin/includes/tab-settings.php:
|
607 |
msgid ""
|
608 |
"<dfn title=\"Specify the individual tag on a single page or archive page as "
|
609 |
"a blocking target.\">Tag</dfn>"
|
610 |
msgstr ""
|
611 |
|
612 |
-
#: admin/includes/tab-settings.php:
|
613 |
msgid "Specify the validation target on front-end."
|
614 |
msgstr ""
|
615 |
|
616 |
-
#: admin/includes/tab-settings.php:
|
617 |
msgid "Validation target"
|
618 |
msgstr ""
|
619 |
|
620 |
-
#: admin/includes/tab-settings.php:
|
621 |
msgid "All requests"
|
622 |
msgstr ""
|
623 |
|
624 |
-
#: admin/includes/tab-settings.php:
|
625 |
msgid "Specify the targets"
|
626 |
msgstr ""
|
627 |
|
628 |
-
#: admin/includes/tab-settings.php:
|
629 |
msgid ""
|
630 |
"Notice that “Validation timing” is deferred till “"
|
631 |
"wp” action hook. It means that this feature would not be compatible "
|
632 |
"with any page caching."
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: admin/includes/tab-settings.php:
|
636 |
msgid ""
|
637 |
"A part of user agent string and a qualification connected with a separator "
|
638 |
"that indicates an applicable rule and can be “:” (pass) or "
|
@@ -642,39 +709,55 @@ msgid ""
|
|
642 |
"qualification”."
|
643 |
msgstr ""
|
644 |
|
645 |
-
#: admin/includes/tab-settings.php:
|
646 |
msgid "UA string and qualification"
|
647 |
msgstr ""
|
648 |
|
649 |
-
#: admin/includes/tab-settings.php:
|
650 |
msgid "Specify the name of action that is invariably blocked."
|
651 |
msgstr ""
|
652 |
|
653 |
-
#: admin/includes/tab-settings.php:
|
654 |
msgid "Excluded actions"
|
655 |
msgstr ""
|
656 |
|
657 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
msgid ""
|
659 |
"It enables to simulate validation without deployment. The results can be "
|
660 |
"found at “Public facing pages” in Logs."
|
661 |
msgstr ""
|
662 |
|
663 |
-
#: admin/includes/tab-settings.php:
|
664 |
msgid "Simulation mode"
|
665 |
msgstr ""
|
666 |
|
667 |
-
#: admin/includes/tab-settings.php:
|
668 |
msgid "Geolocation API settings"
|
669 |
msgstr ""
|
670 |
|
671 |
-
#: admin/includes/tab-settings.php:
|
672 |
msgid ""
|
673 |
"<dfn title=\"Cache and local database are scanned at the top priority.\">API "
|
674 |
"selection and key settings</dfn>"
|
675 |
msgstr ""
|
676 |
|
677 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
678 |
#, php-format
|
679 |
msgid ""
|
680 |
"Can not find geolocation API libraries in <code>%s</code>. It seems to have "
|
@@ -683,92 +766,93 @@ msgid ""
|
|
683 |
"contents of tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> "
|
684 |
"from <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-"
|
685 |
"IP-Geo-API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-"
|
686 |
-
"IP-Geo-API</a>. Please
|
687 |
-
"ipgeoblock.com/codex/
|
688 |
-
"fix
|
689 |
-
"
|
690 |
msgstr ""
|
691 |
|
692 |
-
#: admin/includes/tab-settings.php:
|
693 |
msgid "Local database settings"
|
694 |
msgstr ""
|
695 |
|
696 |
-
#: admin/includes/tab-settings.php:
|
697 |
msgid "database"
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: admin/includes/tab-settings.php:
|
|
|
701 |
#, php-format
|
702 |
msgid "Last update: %s"
|
703 |
msgstr ""
|
704 |
|
705 |
-
#: admin/includes/tab-settings.php:
|
706 |
msgid "Auto updating (once a month)"
|
707 |
msgstr ""
|
708 |
|
709 |
-
#: admin/includes/tab-settings.php:
|
710 |
msgid "Download database"
|
711 |
msgstr ""
|
712 |
|
713 |
-
#: admin/includes/tab-settings.php:
|
714 |
msgid "Download now"
|
715 |
msgstr ""
|
716 |
|
717 |
-
#: admin/includes/tab-settings.php:
|
718 |
msgid "Record settings"
|
719 |
msgstr ""
|
720 |
|
721 |
-
#: admin/includes/tab-settings.php:
|
722 |
msgid "Record validation statistics"
|
723 |
msgstr ""
|
724 |
|
725 |
-
#: admin/includes/tab-settings.php:
|
726 |
msgid "Record validation logs"
|
727 |
msgstr ""
|
728 |
|
729 |
-
#: admin/includes/tab-settings.php:
|
730 |
msgid "Only when blocked"
|
731 |
msgstr ""
|
732 |
|
733 |
-
#: admin/includes/tab-settings.php:
|
734 |
msgid "Only when passed"
|
735 |
msgstr ""
|
736 |
|
737 |
-
#: admin/includes/tab-settings.php:
|
738 |
msgid "Unauthenticated user"
|
739 |
msgstr ""
|
740 |
|
741 |
-
#: admin/includes/tab-settings.php:
|
742 |
msgid "Authenticated user"
|
743 |
msgstr ""
|
744 |
|
745 |
-
#: admin/includes/tab-settings.php:
|
746 |
msgid "All of validation"
|
747 |
msgstr ""
|
748 |
|
749 |
-
#: admin/includes/tab-settings.php:
|
750 |
msgid "Recording period of the logs (days)"
|
751 |
msgstr ""
|
752 |
|
753 |
-
#: admin/includes/tab-settings.php:
|
754 |
msgid "Maximum length of logs for each target"
|
755 |
msgstr ""
|
756 |
|
757 |
-
#: admin/includes/tab-settings.php:
|
758 |
msgid ""
|
759 |
-
"<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be
|
760 |
-
"with their values in logs</dfn>"
|
761 |
msgstr ""
|
762 |
|
763 |
-
#: admin/includes/tab-settings.php:
|
764 |
msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: admin/includes/tab-settings.php:
|
768 |
msgid "IP address cache settings"
|
769 |
msgstr ""
|
770 |
|
771 |
-
#: admin/includes/tab-settings.php:
|
772 |
#, php-format
|
773 |
msgid ""
|
774 |
"<dfn title=\"If user authentication fails consecutively %d times, subsequent "
|
@@ -776,115 +860,115 @@ msgid ""
|
|
776 |
"\">Expiration time [sec]</dfn>"
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: admin/includes/tab-settings.php:
|
780 |
msgid "Garbage collection period [sec]"
|
781 |
msgstr ""
|
782 |
|
783 |
-
#: admin/includes/tab-settings.php:
|
784 |
msgid "Number of entries to be displayed in cache"
|
785 |
msgstr ""
|
786 |
|
787 |
-
#: admin/includes/tab-settings.php:
|
788 |
msgid "Submission settings"
|
789 |
msgstr ""
|
790 |
|
791 |
-
#: admin/includes/tab-settings.php:
|
792 |
msgid "The whole will be wrapped by <p> tag. Allowed tags: "
|
793 |
msgstr ""
|
794 |
|
795 |
-
#: admin/includes/tab-settings.php:
|
796 |
msgid "Message on comment form"
|
797 |
msgstr ""
|
798 |
|
799 |
-
#: admin/includes/tab-settings.php:
|
800 |
msgid "None"
|
801 |
msgstr ""
|
802 |
|
803 |
-
#: admin/includes/tab-settings.php:
|
804 |
msgid "Top"
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: admin/includes/tab-settings.php:
|
808 |
msgid "Bottom"
|
809 |
msgstr ""
|
810 |
|
811 |
-
#: admin/includes/tab-settings.php:
|
812 |
msgid "Plugin settings"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: admin/includes/tab-settings.php:
|
816 |
msgid "Remove all settings at uninstallation"
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: admin/includes/tab-settings.php:
|
820 |
msgid ""
|
821 |
"<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
|
822 |
"dfn>"
|
823 |
msgstr ""
|
824 |
|
825 |
-
#: admin/includes/tab-settings.php:
|
826 |
msgid ""
|
827 |
"You need to click the “Save Changes” button for imported "
|
828 |
"settings to take effect."
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: admin/includes/tab-settings.php:
|
832 |
msgid "Export / Import settings"
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: admin/includes/tab-settings.php:
|
836 |
msgid "Export settings"
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: admin/includes/tab-settings.php:
|
840 |
msgid "Import from the local file"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: admin/includes/tab-settings.php:
|
844 |
msgid "Import settings"
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: admin/includes/tab-settings.php:
|
848 |
msgid "Import pre-defined settings"
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: admin/includes/tab-settings.php:
|
852 |
msgid ""
|
853 |
-
"Import the
|
854 |
-
"
|
855 |
msgstr ""
|
856 |
|
857 |
-
#: admin/includes/tab-settings.php:
|
858 |
-
msgid "
|
859 |
msgstr ""
|
860 |
|
861 |
-
#: admin/includes/tab-settings.php:
|
862 |
msgid ""
|
863 |
-
"Import the
|
864 |
-
"
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: admin/includes/tab-settings.php:
|
868 |
-
msgid "
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: admin/includes/tab-settings.php:
|
872 |
msgid "Delete DB table for validation logs"
|
873 |
msgstr ""
|
874 |
|
875 |
-
#: admin/includes/tab-settings.php:
|
876 |
msgid "Delete now"
|
877 |
msgstr ""
|
878 |
|
879 |
-
#: admin/includes/tab-settings.php:
|
880 |
msgid "Create DB table for validation logs"
|
881 |
msgstr ""
|
882 |
|
883 |
-
#: admin/includes/tab-settings.php:
|
884 |
msgid "Create now"
|
885 |
msgstr ""
|
886 |
|
887 |
-
#: admin/includes/tab-settings.php:
|
888 |
msgid ""
|
889 |
"<dfn title=\"Please copy & paste when submitting your issue to support "
|
890 |
"forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
|
@@ -892,15 +976,15 @@ msgid ""
|
|
892 |
"› Support » IP Geo Block\">support forum</a> ]"
|
893 |
msgstr ""
|
894 |
|
895 |
-
#: admin/includes/tab-settings.php:
|
896 |
msgid "Show PHP, WordPress, theme and plugins information."
|
897 |
msgstr ""
|
898 |
|
899 |
-
#: admin/includes/tab-settings.php:
|
900 |
msgid "Show information"
|
901 |
msgstr ""
|
902 |
|
903 |
-
#: admin/includes/tab-settings.php:
|
904 |
msgid ""
|
905 |
"To enhance the protection ability, please refer to “<a rel=\"noreferrer"
|
906 |
"\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
|
@@ -908,7 +992,7 @@ msgid ""
|
|
908 |
"\">The best practice for target settings</a>”."
|
909 |
msgstr ""
|
910 |
|
911 |
-
#: admin/includes/tab-settings.php:
|
912 |
msgid ""
|
913 |
"If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
|
914 |
"\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
|
@@ -917,18 +1001,18 @@ msgid ""
|
|
917 |
"\">Codex</a>."
|
918 |
msgstr ""
|
919 |
|
920 |
-
#: admin/includes/tab-settings.php:
|
921 |
msgid ""
|
922 |
"While Maxmind and IP2Location will fetch the local database, others will "
|
923 |
"pass an IP address to the APIs via HTTP."
|
924 |
msgstr ""
|
925 |
|
926 |
-
#: admin/includes/tab-settings.php:
|
927 |
msgid ""
|
928 |
"Please select the appropriate APIs to fit the privacy law in your country."
|
929 |
msgstr ""
|
930 |
|
931 |
-
#: admin/includes/tab-settings.php:
|
932 |
msgid ""
|
933 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
934 |
"ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
|
@@ -936,7 +1020,7 @@ msgid ""
|
|
936 |
"cache plugin."
|
937 |
msgstr ""
|
938 |
|
939 |
-
#: admin/includes/tab-settings.php:
|
940 |
msgid ""
|
941 |
"If you find any issues or have something to suggest, please feel free to "
|
942 |
"open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
|
@@ -944,14 +1028,14 @@ msgid ""
|
|
944 |
"\">support forum</a>."
|
945 |
msgstr ""
|
946 |
|
947 |
-
#: admin/includes/tab-settings.php:
|
948 |
msgid ""
|
949 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
950 |
"ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
|
951 |
"Block\">Record settings and logs</a>” for details."
|
952 |
msgstr ""
|
953 |
|
954 |
-
#: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:
|
955 |
msgid "Statistics of validation"
|
956 |
msgstr ""
|
957 |
|
@@ -959,65 +1043,65 @@ msgstr ""
|
|
959 |
msgid "Blocked"
|
960 |
msgstr ""
|
961 |
|
962 |
-
#: admin/includes/tab-statistics.php:
|
963 |
msgid "Blocked by countries"
|
964 |
msgstr ""
|
965 |
|
966 |
-
#: admin/includes/tab-statistics.php:
|
967 |
msgid "Blocked per day"
|
968 |
msgstr ""
|
969 |
|
970 |
-
#: admin/includes/tab-statistics.php:
|
971 |
msgid "Blocked by type of IP address"
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: admin/includes/tab-statistics.php:
|
975 |
msgid "Name of API"
|
976 |
msgstr ""
|
977 |
|
978 |
-
#: admin/includes/tab-statistics.php:
|
979 |
msgid "Calls"
|
980 |
msgstr ""
|
981 |
|
982 |
-
#: admin/includes/tab-statistics.php:
|
983 |
msgid "Response [msec]"
|
984 |
msgstr ""
|
985 |
|
986 |
-
#: admin/includes/tab-statistics.php:
|
987 |
msgid "Average response time of each API"
|
988 |
msgstr ""
|
989 |
|
990 |
-
#: admin/includes/tab-statistics.php:
|
991 |
msgid "Clear statistics"
|
992 |
msgstr ""
|
993 |
|
994 |
-
#: admin/includes/tab-statistics.php:
|
995 |
-
msgid "Statistics
|
996 |
msgstr ""
|
997 |
|
998 |
-
#: admin/includes/tab-statistics.php:
|
999 |
msgid "Country code / Access"
|
1000 |
msgstr ""
|
1001 |
|
1002 |
-
#: admin/includes/tab-statistics.php:
|
1003 |
msgid "Elapsed [sec] / Calls"
|
1004 |
msgstr ""
|
1005 |
|
1006 |
-
#: admin/includes/tab-statistics.php:
|
1007 |
msgid "IP address in cache"
|
1008 |
msgstr ""
|
1009 |
|
1010 |
-
#: admin/includes/tab-statistics.php:
|
1011 |
msgid "Clear cache"
|
1012 |
msgstr ""
|
1013 |
|
1014 |
-
#: admin/includes/tab-statistics.php:
|
1015 |
msgid ""
|
1016 |
"Current setting of [<strong>Record validation statistics</strong>] on "
|
1017 |
"[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
|
1018 |
msgstr ""
|
1019 |
|
1020 |
-
#: admin/includes/tab-statistics.php:
|
1021 |
msgid ""
|
1022 |
"Please set the proper condition to record and analyze the validation "
|
1023 |
"statistics."
|
@@ -1029,34 +1113,42 @@ msgid ""
|
|
1029 |
"<strong>you'll be blocked</strong> after the cache expires."
|
1030 |
msgstr ""
|
1031 |
|
1032 |
-
#: classes/class-ip-geo-block-cron.php:
|
1033 |
msgid "Your database file is up-to-date."
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: classes/class-ip-geo-block-cron.php:
|
1037 |
-
#: classes/class-ip-geo-block-cron.php:
|
1038 |
#, php-format
|
1039 |
msgid "Unable to read %s. Please check the permission."
|
1040 |
msgstr ""
|
1041 |
|
1042 |
-
#: classes/class-ip-geo-block-cron.php:
|
1043 |
-
#: classes/class-ip-geo-block-cron.php:
|
1044 |
#, php-format
|
1045 |
msgid "Can't lock %s. Please try again after a while."
|
1046 |
msgstr ""
|
1047 |
|
1048 |
-
#: classes/class-ip-geo-block-cron.php:
|
1049 |
-
|
1050 |
-
msgid "Unable to read %s. Please check permission."
|
1051 |
msgstr ""
|
1052 |
|
1053 |
-
#: classes/class-ip-geo-block-
|
1054 |
#, php-format
|
1055 |
-
msgid "
|
|
|
|
|
|
|
|
|
1056 |
msgstr ""
|
1057 |
|
1058 |
-
#: classes/class-ip-geo-block-
|
1059 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
1060 |
msgstr ""
|
1061 |
|
1062 |
#: classes/class-ip-geo-block-logs.php:149
|
@@ -1073,7 +1165,7 @@ msgstr ""
|
|
1073 |
msgid "Database file does not exist."
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: wp-content/mu-plugins/ip-geo-block-mu.php:
|
1077 |
#, php-format
|
1078 |
msgid ""
|
1079 |
"Can't find IP Geo Block in your plugins directory. Please remove <code>%s</"
|
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 |
"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 |
"strong>” 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 “<strong>Matching rule</strong>” 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 |
+
"“mu-plugins” (ip-geo-block-mu.php) at “Validation "
|
126 |
+
"timing” is imcompatible with <strong>IP Geo Allow</strong>. Please "
|
127 |
+
"select “init” 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 ""
|
286 |
|
287 |
+
#: admin/includes/tab-accesslog.php:137
|
288 |
msgid "User agent"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: admin/includes/tab-accesslog.php:138
|
292 |
msgid "HTTP headers"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: admin/includes/tab-accesslog.php:139
|
296 |
msgid "$_POST data"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: admin/includes/tab-accesslog.php:156
|
300 |
msgid ""
|
301 |
"Current selection of [<strong>Record validation logs</strong>] on "
|
302 |
"[<strong>Settings</strong>] tab is [<strong>Disable</strong>]."
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: admin/includes/tab-accesslog.php:157
|
306 |
msgid ""
|
307 |
"Please select the proper condition to record and analyze the validation logs."
|
308 |
msgstr ""
|
311 |
msgid "Attribution links"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: admin/includes/tab-geolocation.php:18
|
315 |
msgid "Search IP address geolocation"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: admin/includes/tab-geolocation.php:42
|
319 |
msgid "Geolocation service"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: admin/includes/tab-geolocation.php:82
|
323 |
msgid "Find geolocation"
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: admin/includes/tab-geolocation.php:90
|
327 |
msgid "Search now"
|
328 |
msgstr ""
|
329 |
|
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 “Scan country code”.\">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 “Whitelist” or “Blacklist”."
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: admin/includes/tab-settings.php:116
|
370 |
msgid ""
|
371 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
372 |
+
"empty. The special code “XX” is assigned as private IP address "
|
373 |
+
"including localhost. And “ZZ” is for unknown IP address (i.e. "
|
374 |
+
"not in the geolocation databases). Please use “YY” if you need "
|
375 |
+
"the code that does not correspond to any of the countries.\">Whitelist of "
|
376 |
+
"country code</dfn>"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: admin/includes/tab-settings.php:117
|
380 |
msgid ""
|
381 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
382 |
+
"empty. The special code “XX” is assigned as private IP address "
|
383 |
+
"including localhost. And “ZZ” is for unknown IP address (i.e. "
|
384 |
+
"not in the geolocation databases). Please use “YY” if you need "
|
385 |
+
"the code that does not correspond to any of the countries.\">Blacklist of "
|
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. “192.0.64.0/18” for Jetpack server, "
|
416 |
"“69.46.36.0/27” 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 “"
|
430 |
+
"HTTP_X_FORWARDED_FOR”, “HTTP_X_REAL_IP” or something like "
|
431 |
+
"that to retrieve the client IP address.\">$_SERVER keys to retrieve extra IP "
|
432 |
"addresses</dfn>"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: admin/includes/tab-settings.php:246
|
436 |
msgid ""
|
437 |
"<dfn title=\"It validates malicious signatures independently of “Block "
|
438 |
"by country” and “Prevent Zero-day Exploit” for the target "
|
439 |
"“Admin area”, “Admin ajax/post”, “Plugins "
|
440 |
"area” and “Themes area”.\">Bad signatures in query</dfn> "
|
441 |
+
"<nobr>(<a class=\"ip-geo-block-cycle\" id=\"ip-geo-block-decode\" title="
|
442 |
"\"When you find ugly character string in the text area, please click to "
|
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 “"
|
461 |
+
"mu-plugins” (ip-geo-block-mu.php) at “Validation timing” "
|
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 "
|
490 |
+
"prevent loop of redirection even when you enable [Block by country] in "
|
491 |
+
"[Front-end target settings] section. Empty URL is altered to your home."
|
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 “XML-RPC” and “Login "
|
504 |
+
"form”. Lockout period is defined as expiration time at “Cache "
|
505 |
+
"settings”.\">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 "“init” action hook"
|
518 |
msgstr ""
|
519 |
|
520 |
+
#: admin/includes/tab-settings.php:430
|
521 |
msgid "“mu-plugins” (ip-geo-block-mu.php)"
|
522 |
msgstr ""
|
523 |
|
524 |
+
#: admin/includes/tab-settings.php:433
|
525 |
msgid ""
|
526 |
"Validate at “init” 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 |
"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 (“page=…”) or the "
|
598 |
+
"action name (“action=…”) to prevent undesired blocking "
|
599 |
+
"caused by “Block by country” for non logged-in user and “"
|
600 |
+
"Prevent Zero-day Exploit” 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⋯/*.php</code>."
|
612 |
msgstr ""
|
613 |
|
614 |
+
#: admin/includes/tab-settings.php:641
|
615 |
#, php-format
|
616 |
msgid ""
|
617 |
"It configures “%s” 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 “"
|
625 |
"INACTIVE”.\">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 “Validation rule settings”"
|
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. "
|
652 |
+
"This is useful to prevent violation against your affiliate program."
|
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 “Validation timing” is deferred till “"
|
698 |
"wp” 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 “:” (pass) or "
|
709 |
"qualification”."
|
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, “HOST” and “"
|
728 |
+
"HOST=…”in “UA string and qualification” will always "
|
729 |
+
"return “true”."
|
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 “Public facing pages” 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 "
|
766 |
"contents of tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> "
|
767 |
"from <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-"
|
768 |
"IP-Geo-API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-"
|
769 |
+
"IP-Geo-API</a>. Please install <code>ip-geo-api</code> with write permission "
|
770 |
+
"according to <a rel=\"noreferrer\" href=\"http://www.ipgeoblock.com/codex/"
|
771 |
+
"how-to-fix-permission-troubles.html\" title=\"How can I fix permission "
|
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 |
"\">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 <p> 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 “Save Changes” 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 “Right after "
|
938 |
+
"installing” 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 “Back-end target settings”"
|
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 & paste when submitting your issue to support "
|
974 |
"forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
|
976 |
"› Support » 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 “<a rel=\"noreferrer"
|
990 |
"\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
|
992 |
"\">The best practice for target settings</a>”."
|
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 |
"\">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 “<a rel=\"noreferrer\" href=\"http://www."
|
1018 |
"ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
|
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 |
"\">support forum</a>."
|
1029 |
msgstr ""
|
1030 |
|
1031 |
+
#: admin/includes/tab-settings.php:1559
|
1032 |
msgid ""
|
1033 |
"Please refer to the document “<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>” 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 |
|
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."
|
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 |
|
1136 |
+
#: classes/class-ip-geo-block-file.php:54
|
1137 |
#, php-format
|
1138 |
+
msgid ""
|
1139 |
+
"This plugin does not support method “%s” for FTP or SSH based "
|
1140 |
+
"file operations. Please refer to <a href=\"https://codex.wordpress.org/"
|
1141 |
+
"Editing_wp-config.php#WordPress_Upgrade_Constants\" title=\"Editing wp-"
|
1142 |
+
"config.php « WordPress Codex\">this document</a> for more details."
|
1143 |
msgstr ""
|
1144 |
|
1145 |
+
#: classes/class-ip-geo-block-file.php:68
|
1146 |
+
msgid ""
|
1147 |
+
"You should define some constants in your <code>wp-config.php</code> for FTP "
|
1148 |
+
"or SSH based file operations. Please refer to <a href=\"https://codex."
|
1149 |
+
"wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants\" title="
|
1150 |
+
"\"Editing wp-config.php « WordPress Codex\">this document</a> for more "
|
1151 |
+
"details."
|
1152 |
msgstr ""
|
1153 |
|
1154 |
#: classes/class-ip-geo-block-logs.php:149
|
1165 |
msgid "Database file does not exist."
|
1166 |
msgstr ""
|
1167 |
|
1168 |
+
#: wp-content/mu-plugins/ip-geo-block-mu.php:70
|
1169 |
#, php-format
|
1170 |
msgid ""
|
1171 |
"Can't find IP Geo Block in your plugins directory. Please remove <code>%s</"
|
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.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
|
7 |
-
"POT-Creation-Date: 2017-
|
8 |
-
"PO-Revision-Date: 2017-
|
9 |
"Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
|
10 |
"Language-Team: \n"
|
11 |
"MIME-Version: 1.0\n"
|
@@ -25,53 +25,53 @@ msgid ""
|
|
25 |
"posted from outside your nation, and also prevents zero-day exploit."
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: admin/class-ip-geo-block-admin.php:
|
29 |
msgid "Import settings ?"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: admin/class-ip-geo-block-admin.php:
|
33 |
msgid "Create table ?"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: admin/class-ip-geo-block-admin.php:
|
37 |
msgid "Delete table ?"
|
38 |
msgstr ""
|
39 |
|
40 |
-
#: admin/class-ip-geo-block-admin.php:
|
41 |
msgid "Clear statistics ?"
|
42 |
msgstr ""
|
43 |
|
44 |
-
#: admin/class-ip-geo-block-admin.php:
|
45 |
msgid "Clear cache ?"
|
46 |
msgstr ""
|
47 |
|
48 |
-
#: admin/class-ip-geo-block-admin.php:
|
49 |
msgid "Clear logs ?"
|
50 |
msgstr ""
|
51 |
|
52 |
-
#: admin/class-ip-geo-block-admin.php:
|
53 |
msgid "This feature is available with HTML5 compliant browsers."
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: admin/class-ip-geo-block-admin.php:
|
57 |
msgid "Contribute at GitHub"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: admin/class-ip-geo-block-admin.php:
|
61 |
-
#: admin/class-ip-geo-block-admin.php:
|
62 |
msgid "Settings"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: admin/class-ip-geo-block-admin.php:
|
66 |
-
#: admin/class-ip-geo-block-admin.php:
|
67 |
msgid "IP Geo Block"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: admin/class-ip-geo-block-admin.php:
|
71 |
msgid "You need WordPress 3.7+."
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: admin/class-ip-geo-block-admin.php:
|
75 |
#, php-format
|
76 |
msgid ""
|
77 |
"Now downloading geolocation databases in background. After a little while, "
|
@@ -79,212 +79,230 @@ msgid ""
|
|
79 |
"strong>” at <a href=\"%s\">Validation rule settings</a>."
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: admin/class-ip-geo-block-admin.php:
|
83 |
#, php-format
|
84 |
msgid ""
|
85 |
"The “<strong>Matching rule</strong>” 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:
|
90 |
msgid "Local database and matching rule have been updated."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: admin/class-ip-geo-block-admin.php:
|
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:
|
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:
|
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:
|
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:
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
msgid "Statistics"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: admin/class-ip-geo-block-admin.php:
|
128 |
msgid "Logs"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: admin/class-ip-geo-block-admin.php:
|
132 |
msgid "Search"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: admin/class-ip-geo-block-admin.php:
|
136 |
msgid "Attribution"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: admin/class-ip-geo-block-admin.php:
|
140 |
msgid "Toggle all"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: admin/class-ip-geo-block-admin.php:
|
144 |
msgid "Thanks for providing these great services for free."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: admin/class-ip-geo-block-admin.php:
|
148 |
msgid ""
|
149 |
"(Most browsers will redirect you to each site <a href=\"http://www."
|
150 |
"ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
|
151 |
"when you click the link</a>.)"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: admin/class-ip-geo-block-admin.php:
|
155 |
msgid "Back to top"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: admin/class-ip-geo-block-admin.php:
|
159 |
msgid "Enable"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: admin/class-ip-geo-block-admin.php:
|
163 |
-
#:
|
164 |
-
#: classes/class-ip-geo-block-cron.php:
|
165 |
-
#: classes/class-ip-geo-block-cron.php:318
|
166 |
-
#: classes/class-ip-geo-block-opts.php:311
|
167 |
#, php-format
|
168 |
msgid "Unable to write %s. Please check the permission."
|
169 |
msgstr ""
|
170 |
|
171 |
-
#: admin/class-ip-geo-block-admin.php:
|
172 |
#, php-format
|
173 |
msgid "Or please refer to %s to set it manually."
|
174 |
msgid_plural "Or please refer to %s to set them manually."
|
175 |
msgstr[0] ""
|
176 |
msgstr[1] ""
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
#: admin/includes/class-admin-ajax.php:60
|
179 |
msgid "n/a"
|
180 |
msgstr ""
|
181 |
|
182 |
#: admin/includes/class-admin-ajax.php:63 admin/includes/tab-settings.php:81
|
|
|
183 |
msgid "UNKNOWN"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: admin/includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
msgid "Validation logs"
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: admin/includes/tab-accesslog.php:
|
191 |
msgid "Filter logs"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: admin/includes/tab-accesslog.php:
|
195 |
msgid "Reset"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: admin/includes/tab-accesslog.php:
|
199 |
msgid "Clear logs"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: admin/includes/tab-accesslog.php:
|
203 |
-
#: admin/includes/tab-statistics.php:
|
204 |
msgid "Clear now"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: admin/includes/tab-accesslog.php:
|
208 |
msgid "Export logs"
|
209 |
msgstr ""
|
210 |
|
211 |
-
#: admin/includes/tab-accesslog.php:
|
212 |
msgid "Export to the local file"
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: admin/includes/tab-accesslog.php:
|
216 |
msgid "Export csv"
|
217 |
msgstr ""
|
218 |
|
219 |
-
#: admin/includes/tab-accesslog.php:
|
220 |
#, php-format
|
221 |
msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: admin/includes/tab-accesslog.php:
|
225 |
msgid "Comment post"
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: admin/includes/tab-accesslog.php:
|
229 |
msgid "XML-RPC"
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: admin/includes/tab-accesslog.php:
|
233 |
msgid "Login form"
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: admin/includes/tab-accesslog.php:
|
237 |
msgid "Admin area"
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: admin/includes/tab-accesslog.php:
|
241 |
msgid "public facing pages"
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: admin/includes/tab-accesslog.php:
|
245 |
msgid "Public facing pages"
|
246 |
msgstr ""
|
247 |
|
248 |
-
#: admin/includes/tab-accesslog.php:
|
249 |
msgid "Date"
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: admin/includes/tab-accesslog.php:
|
253 |
-
#: admin/includes/tab-statistics.php:
|
254 |
msgid "IP address"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: admin/includes/tab-accesslog.php:
|
258 |
msgid "Code"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: admin/includes/tab-accesslog.php:
|
262 |
msgid "Result"
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: admin/includes/tab-accesslog.php:
|
266 |
msgid "Request"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: admin/includes/tab-accesslog.php:
|
270 |
msgid "User agent"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: admin/includes/tab-accesslog.php:
|
274 |
msgid "HTTP headers"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: admin/includes/tab-accesslog.php:
|
278 |
msgid "$_POST data"
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: admin/includes/tab-accesslog.php:
|
282 |
msgid ""
|
283 |
"Current selection of [<strong>Record validation logs</strong>] on "
|
284 |
"[<strong>Settings</strong>] tab is [<strong>Disable</strong>]."
|
285 |
msgstr ""
|
286 |
|
287 |
-
#: admin/includes/tab-accesslog.php:
|
288 |
msgid ""
|
289 |
"Please select the proper condition to record and analyze the validation logs."
|
290 |
msgstr ""
|
@@ -293,19 +311,19 @@ msgstr ""
|
|
293 |
msgid "Attribution links"
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: admin/includes/tab-geolocation.php:
|
297 |
msgid "Search IP address geolocation"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: admin/includes/tab-geolocation.php:
|
301 |
msgid "Geolocation service"
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: admin/includes/tab-geolocation.php:
|
305 |
msgid "Find geolocation"
|
306 |
msgstr ""
|
307 |
|
308 |
-
#: admin/includes/tab-geolocation.php:
|
309 |
msgid "Search now"
|
310 |
msgstr ""
|
311 |
|
@@ -320,146 +338,196 @@ msgid ""
|
|
320 |
"Country</dfn>"
|
321 |
msgstr ""
|
322 |
|
323 |
-
#: admin/includes/tab-settings.php:82
|
324 |
msgid "Scan all the APIs you selected at Geolocation API settings"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: admin/includes/tab-settings.php:82
|
328 |
msgid "Scan country code"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
msgid "Whitelist"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#: admin/includes/tab-settings.php:
|
336 |
msgid "Blacklist"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: admin/includes/tab-settings.php:
|
340 |
msgid ""
|
341 |
"Please select either “Whitelist” or “Blacklist”."
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: admin/includes/tab-settings.php:
|
345 |
msgid ""
|
346 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
347 |
-
"empty.
|
348 |
-
"
|
|
|
|
|
|
|
349 |
msgstr ""
|
350 |
|
351 |
-
#: admin/includes/tab-settings.php:
|
352 |
msgid ""
|
353 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
354 |
-
"empty.
|
355 |
-
"
|
|
|
|
|
|
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: admin/includes/tab-settings.php:
|
359 |
msgid "(comma separated)"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: admin/includes/tab-settings.php:
|
363 |
msgid "(comma or RET separated)"
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: admin/includes/tab-settings.php:
|
367 |
msgid "Matching rule"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: admin/includes/tab-settings.php:
|
371 |
msgid ""
|
372 |
"A request from which the country code or IP address is <strong>NOT</strong> "
|
373 |
"in the whitelist will be blocked."
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: admin/includes/tab-settings.php:
|
377 |
msgid ""
|
378 |
"A request from which the country code or IP address is in the blacklist will "
|
379 |
"be blocked."
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: admin/includes/tab-settings.php:
|
383 |
msgid ""
|
384 |
"<dfn title=\"e.g. “192.0.64.0/18” for Jetpack server, "
|
385 |
"“69.46.36.0/27” for WordFence server\">Whitelist of extra IP "
|
386 |
"addresses prior to country code</dfn>"
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: admin/includes/tab-settings.php:
|
390 |
msgid ""
|
391 |
"<dfn title=\"Server level access control is recommended (e.g. .htaccess)."
|
392 |
"\">Blacklist of extra IP addresses prior to country code</dfn>"
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: admin/includes/tab-settings.php:
|
396 |
msgid ""
|
397 |
-
"<dfn title=\"
|
|
|
|
|
|
|
398 |
"addresses</dfn>"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: admin/includes/tab-settings.php:
|
402 |
msgid ""
|
403 |
"<dfn title=\"It validates malicious signatures independently of “Block "
|
404 |
"by country” and “Prevent Zero-day Exploit” for the target "
|
405 |
"“Admin area”, “Admin ajax/post”, “Plugins "
|
406 |
"area” and “Themes area”.\">Bad signatures in query</dfn> "
|
407 |
-
"<nobr>(<a
|
408 |
"\"When you find ugly character string in the text area, please click to "
|
409 |
-
"restore.\"><span
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
#, php-format
|
414 |
msgid ""
|
415 |
"<dfn title=\"You can put your original 403.php and so on into your theme "
|
416 |
"directory.\">Response code</dfn> %s"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: admin/includes/tab-settings.php:
|
420 |
msgid ""
|
421 |
-
"<dfn title=\"Specify the URL for response code 2xx and 3xx.
|
422 |
-
"
|
423 |
-
"
|
|
|
424 |
"\">Redirect URL</dfn>"
|
425 |
msgstr ""
|
426 |
|
427 |
-
#: admin/includes/tab-settings.php:
|
428 |
msgid ""
|
429 |
"<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
|
430 |
"message</dfn>"
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: admin/includes/tab-settings.php:
|
434 |
msgid ""
|
435 |
-
"<dfn title=\"
|
436 |
-
"Lockout period is defined as expiration time at “Cache
|
437 |
-
"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: admin/includes/tab-settings.php:
|
441 |
msgid "Select when to run the validation."
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: admin/includes/tab-settings.php:
|
445 |
msgid "Validation timing"
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: admin/includes/tab-settings.php:
|
449 |
msgid "“init” action hook"
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: admin/includes/tab-settings.php:
|
453 |
msgid "“mu-plugins” (ip-geo-block-mu.php)"
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: admin/includes/tab-settings.php:
|
457 |
msgid ""
|
458 |
"Validate at “init” action hook in the same manner as typical "
|
459 |
"plugins."
|
460 |
msgstr ""
|
461 |
|
462 |
-
#: admin/includes/tab-settings.php:
|
463 |
msgid ""
|
464 |
"Validate at an earlier phase than other typical plugins. It can reduce load "
|
465 |
"on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
|
@@ -467,172 +535,171 @@ msgid ""
|
|
467 |
"restrictions</a>."
|
468 |
msgstr ""
|
469 |
|
470 |
-
#: admin/includes/tab-settings.php:
|
471 |
msgid "Back-end target settings"
|
472 |
msgstr ""
|
473 |
|
474 |
-
#: admin/includes/tab-settings.php:
|
475 |
#, php-format
|
476 |
msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
|
477 |
msgstr ""
|
478 |
|
479 |
-
#: admin/includes/tab-settings.php:
|
480 |
msgid "Other areas"
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: admin/includes/tab-settings.php:
|
484 |
-
#: admin/includes/tab-settings.php:
|
485 |
-
#: admin/includes/tab-settings.php:
|
486 |
msgid "Block by country"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: admin/includes/tab-settings.php:
|
490 |
-
#: admin/includes/tab-settings.php:1029
|
491 |
-
msgid "Disable"
|
492 |
-
msgstr ""
|
493 |
-
|
494 |
-
#: admin/includes/tab-settings.php:412
|
495 |
msgid "Completely close"
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: admin/includes/tab-settings.php:
|
499 |
msgid ""
|
500 |
"<dfn title=\"Specify the individual action as a blocking target.\">Target "
|
501 |
"actions</dfn>"
|
502 |
msgstr ""
|
503 |
|
504 |
-
#: admin/includes/tab-settings.php:
|
505 |
msgid "Prevent Zero-day Exploit"
|
506 |
msgstr ""
|
507 |
|
508 |
-
#: admin/includes/tab-settings.php:
|
509 |
msgid ""
|
510 |
"It will block a request related to the services for both public facing pages "
|
511 |
"and the dashboard."
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: admin/includes/tab-settings.php:
|
515 |
msgid ""
|
516 |
"Regardless of the country code, it will block a malicious request related to "
|
517 |
"the services only for the dashboard."
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: admin/includes/tab-settings.php:
|
521 |
-
msgid "for logged-in
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: admin/includes/tab-settings.php:
|
525 |
-
msgid "for non logged-in
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: admin/includes/tab-settings.php:
|
529 |
msgid "Admin ajax/post"
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: admin/includes/tab-settings.php:
|
533 |
msgid ""
|
534 |
-
"<dfn title=\"
|
535 |
-
"
|
536 |
-
"country” for non logged-in
|
537 |
-
"
|
538 |
-
"in “page=…”) or action name (“…” in "
|
539 |
-
"“action=…”), which would be implemented with a non "
|
540 |
-
"WordPress standard way, into the field to specify the request.\">Exceptions</"
|
541 |
-
"dfn>"
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: admin/includes/tab-settings.php:
|
545 |
msgid "Candidate actions"
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: admin/includes/tab-settings.php:
|
549 |
#, php-format
|
550 |
msgid ""
|
551 |
"Regardless of the country code, it will block a malicious request to <code>"
|
552 |
-
"%s&
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: admin/includes/tab-settings.php:
|
556 |
#, php-format
|
557 |
msgid ""
|
558 |
"It configures “%s” to validate a request to the PHP file which "
|
559 |
"does not load WordPress core."
|
560 |
msgstr ""
|
561 |
|
562 |
-
#: admin/includes/tab-settings.php:
|
563 |
msgid ""
|
564 |
"<dfn title=\"Select the item which causes undesired blocking in order to "
|
565 |
"exclude from the validation target. Grayed item indicates “"
|
566 |
"INACTIVE”.\">Exceptions</dfn>"
|
567 |
msgstr ""
|
568 |
|
569 |
-
#: admin/includes/tab-settings.php:
|
570 |
msgid "Force to load WP core"
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: admin/includes/tab-settings.php:
|
574 |
msgid "Plugins area"
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: admin/includes/tab-settings.php:
|
578 |
msgid "Themes area"
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: admin/includes/tab-settings.php:
|
582 |
msgid "Front-end target settings"
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: admin/includes/tab-settings.php:
|
586 |
msgid "Follow “Validation rule settings”"
|
587 |
msgstr ""
|
588 |
|
589 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
msgid ""
|
591 |
"<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: admin/includes/tab-settings.php:
|
595 |
msgid ""
|
596 |
"<dfn title=\"Specify the individual post type on a single page as a blocking "
|
597 |
"target.\">Post type</dfn>"
|
598 |
msgstr ""
|
599 |
|
600 |
-
#: admin/includes/tab-settings.php:
|
601 |
msgid ""
|
602 |
"<dfn title=\"Specify the individual category on a single page or archive "
|
603 |
"page as a blocking target.\">Category</dfn>"
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: admin/includes/tab-settings.php:
|
607 |
msgid ""
|
608 |
"<dfn title=\"Specify the individual tag on a single page or archive page as "
|
609 |
"a blocking target.\">Tag</dfn>"
|
610 |
msgstr ""
|
611 |
|
612 |
-
#: admin/includes/tab-settings.php:
|
613 |
msgid "Specify the validation target on front-end."
|
614 |
msgstr ""
|
615 |
|
616 |
-
#: admin/includes/tab-settings.php:
|
617 |
msgid "Validation target"
|
618 |
msgstr ""
|
619 |
|
620 |
-
#: admin/includes/tab-settings.php:
|
621 |
msgid "All requests"
|
622 |
msgstr ""
|
623 |
|
624 |
-
#: admin/includes/tab-settings.php:
|
625 |
msgid "Specify the targets"
|
626 |
msgstr ""
|
627 |
|
628 |
-
#: admin/includes/tab-settings.php:
|
629 |
msgid ""
|
630 |
"Notice that “Validation timing” is deferred till “"
|
631 |
"wp” action hook. It means that this feature would not be compatible "
|
632 |
"with any page caching."
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: admin/includes/tab-settings.php:
|
636 |
msgid ""
|
637 |
"A part of user agent string and a qualification connected with a separator "
|
638 |
"that indicates an applicable rule and can be “:” (pass) or "
|
@@ -642,39 +709,55 @@ msgid ""
|
|
642 |
"qualification”."
|
643 |
msgstr ""
|
644 |
|
645 |
-
#: admin/includes/tab-settings.php:
|
646 |
msgid "UA string and qualification"
|
647 |
msgstr ""
|
648 |
|
649 |
-
#: admin/includes/tab-settings.php:
|
650 |
msgid "Specify the name of action that is invariably blocked."
|
651 |
msgstr ""
|
652 |
|
653 |
-
#: admin/includes/tab-settings.php:
|
654 |
msgid "Excluded actions"
|
655 |
msgstr ""
|
656 |
|
657 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
msgid ""
|
659 |
"It enables to simulate validation without deployment. The results can be "
|
660 |
"found at “Public facing pages” in Logs."
|
661 |
msgstr ""
|
662 |
|
663 |
-
#: admin/includes/tab-settings.php:
|
664 |
msgid "Simulation mode"
|
665 |
msgstr ""
|
666 |
|
667 |
-
#: admin/includes/tab-settings.php:
|
668 |
msgid "Geolocation API settings"
|
669 |
msgstr ""
|
670 |
|
671 |
-
#: admin/includes/tab-settings.php:
|
672 |
msgid ""
|
673 |
"<dfn title=\"Cache and local database are scanned at the top priority.\">API "
|
674 |
"selection and key settings</dfn>"
|
675 |
msgstr ""
|
676 |
|
677 |
-
#: admin/includes/tab-settings.php:
|
|
|
|
|
|
|
|
|
678 |
#, php-format
|
679 |
msgid ""
|
680 |
"Can not find geolocation API libraries in <code>%s</code>. It seems to have "
|
@@ -683,92 +766,93 @@ msgid ""
|
|
683 |
"contents of tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> "
|
684 |
"from <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-"
|
685 |
"IP-Geo-API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-"
|
686 |
-
"IP-Geo-API</a>. Please
|
687 |
-
"ipgeoblock.com/codex/
|
688 |
-
"fix
|
689 |
-
"
|
690 |
msgstr ""
|
691 |
|
692 |
-
#: admin/includes/tab-settings.php:
|
693 |
msgid "Local database settings"
|
694 |
msgstr ""
|
695 |
|
696 |
-
#: admin/includes/tab-settings.php:
|
697 |
msgid "database"
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: admin/includes/tab-settings.php:
|
|
|
701 |
#, php-format
|
702 |
msgid "Last update: %s"
|
703 |
msgstr ""
|
704 |
|
705 |
-
#: admin/includes/tab-settings.php:
|
706 |
msgid "Auto updating (once a month)"
|
707 |
msgstr ""
|
708 |
|
709 |
-
#: admin/includes/tab-settings.php:
|
710 |
msgid "Download database"
|
711 |
msgstr ""
|
712 |
|
713 |
-
#: admin/includes/tab-settings.php:
|
714 |
msgid "Download now"
|
715 |
msgstr ""
|
716 |
|
717 |
-
#: admin/includes/tab-settings.php:
|
718 |
msgid "Record settings"
|
719 |
msgstr ""
|
720 |
|
721 |
-
#: admin/includes/tab-settings.php:
|
722 |
msgid "Record validation statistics"
|
723 |
msgstr ""
|
724 |
|
725 |
-
#: admin/includes/tab-settings.php:
|
726 |
msgid "Record validation logs"
|
727 |
msgstr ""
|
728 |
|
729 |
-
#: admin/includes/tab-settings.php:
|
730 |
msgid "Only when blocked"
|
731 |
msgstr ""
|
732 |
|
733 |
-
#: admin/includes/tab-settings.php:
|
734 |
msgid "Only when passed"
|
735 |
msgstr ""
|
736 |
|
737 |
-
#: admin/includes/tab-settings.php:
|
738 |
msgid "Unauthenticated user"
|
739 |
msgstr ""
|
740 |
|
741 |
-
#: admin/includes/tab-settings.php:
|
742 |
msgid "Authenticated user"
|
743 |
msgstr ""
|
744 |
|
745 |
-
#: admin/includes/tab-settings.php:
|
746 |
msgid "All of validation"
|
747 |
msgstr ""
|
748 |
|
749 |
-
#: admin/includes/tab-settings.php:
|
750 |
msgid "Recording period of the logs (days)"
|
751 |
msgstr ""
|
752 |
|
753 |
-
#: admin/includes/tab-settings.php:
|
754 |
msgid "Maximum length of logs for each target"
|
755 |
msgstr ""
|
756 |
|
757 |
-
#: admin/includes/tab-settings.php:
|
758 |
msgid ""
|
759 |
-
"<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be
|
760 |
-
"with their values in logs</dfn>"
|
761 |
msgstr ""
|
762 |
|
763 |
-
#: admin/includes/tab-settings.php:
|
764 |
msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: admin/includes/tab-settings.php:
|
768 |
msgid "IP address cache settings"
|
769 |
msgstr ""
|
770 |
|
771 |
-
#: admin/includes/tab-settings.php:
|
772 |
#, php-format
|
773 |
msgid ""
|
774 |
"<dfn title=\"If user authentication fails consecutively %d times, subsequent "
|
@@ -776,115 +860,115 @@ msgid ""
|
|
776 |
"\">Expiration time [sec]</dfn>"
|
777 |
msgstr ""
|
778 |
|
779 |
-
#: admin/includes/tab-settings.php:
|
780 |
msgid "Garbage collection period [sec]"
|
781 |
msgstr ""
|
782 |
|
783 |
-
#: admin/includes/tab-settings.php:
|
784 |
msgid "Number of entries to be displayed in cache"
|
785 |
msgstr ""
|
786 |
|
787 |
-
#: admin/includes/tab-settings.php:
|
788 |
msgid "Submission settings"
|
789 |
msgstr ""
|
790 |
|
791 |
-
#: admin/includes/tab-settings.php:
|
792 |
msgid "The whole will be wrapped by <p> tag. Allowed tags: "
|
793 |
msgstr ""
|
794 |
|
795 |
-
#: admin/includes/tab-settings.php:
|
796 |
msgid "Message on comment form"
|
797 |
msgstr ""
|
798 |
|
799 |
-
#: admin/includes/tab-settings.php:
|
800 |
msgid "None"
|
801 |
msgstr ""
|
802 |
|
803 |
-
#: admin/includes/tab-settings.php:
|
804 |
msgid "Top"
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: admin/includes/tab-settings.php:
|
808 |
msgid "Bottom"
|
809 |
msgstr ""
|
810 |
|
811 |
-
#: admin/includes/tab-settings.php:
|
812 |
msgid "Plugin settings"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: admin/includes/tab-settings.php:
|
816 |
msgid "Remove all settings at uninstallation"
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: admin/includes/tab-settings.php:
|
820 |
msgid ""
|
821 |
"<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
|
822 |
"dfn>"
|
823 |
msgstr ""
|
824 |
|
825 |
-
#: admin/includes/tab-settings.php:
|
826 |
msgid ""
|
827 |
"You need to click the “Save Changes” button for imported "
|
828 |
"settings to take effect."
|
829 |
msgstr ""
|
830 |
|
831 |
-
#: admin/includes/tab-settings.php:
|
832 |
msgid "Export / Import settings"
|
833 |
msgstr ""
|
834 |
|
835 |
-
#: admin/includes/tab-settings.php:
|
836 |
msgid "Export settings"
|
837 |
msgstr ""
|
838 |
|
839 |
-
#: admin/includes/tab-settings.php:
|
840 |
msgid "Import from the local file"
|
841 |
msgstr ""
|
842 |
|
843 |
-
#: admin/includes/tab-settings.php:
|
844 |
msgid "Import settings"
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: admin/includes/tab-settings.php:
|
848 |
msgid "Import pre-defined settings"
|
849 |
msgstr ""
|
850 |
|
851 |
-
#: admin/includes/tab-settings.php:
|
852 |
msgid ""
|
853 |
-
"Import the
|
854 |
-
"
|
855 |
msgstr ""
|
856 |
|
857 |
-
#: admin/includes/tab-settings.php:
|
858 |
-
msgid "
|
859 |
msgstr ""
|
860 |
|
861 |
-
#: admin/includes/tab-settings.php:
|
862 |
msgid ""
|
863 |
-
"Import the
|
864 |
-
"
|
865 |
msgstr ""
|
866 |
|
867 |
-
#: admin/includes/tab-settings.php:
|
868 |
-
msgid "
|
869 |
msgstr ""
|
870 |
|
871 |
-
#: admin/includes/tab-settings.php:
|
872 |
msgid "Delete DB table for validation logs"
|
873 |
msgstr ""
|
874 |
|
875 |
-
#: admin/includes/tab-settings.php:
|
876 |
msgid "Delete now"
|
877 |
msgstr ""
|
878 |
|
879 |
-
#: admin/includes/tab-settings.php:
|
880 |
msgid "Create DB table for validation logs"
|
881 |
msgstr ""
|
882 |
|
883 |
-
#: admin/includes/tab-settings.php:
|
884 |
msgid "Create now"
|
885 |
msgstr ""
|
886 |
|
887 |
-
#: admin/includes/tab-settings.php:
|
888 |
msgid ""
|
889 |
"<dfn title=\"Please copy & paste when submitting your issue to support "
|
890 |
"forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
|
@@ -892,15 +976,15 @@ msgid ""
|
|
892 |
"› Support » IP Geo Block\">support forum</a> ]"
|
893 |
msgstr ""
|
894 |
|
895 |
-
#: admin/includes/tab-settings.php:
|
896 |
msgid "Show PHP, WordPress, theme and plugins information."
|
897 |
msgstr ""
|
898 |
|
899 |
-
#: admin/includes/tab-settings.php:
|
900 |
msgid "Show information"
|
901 |
msgstr ""
|
902 |
|
903 |
-
#: admin/includes/tab-settings.php:
|
904 |
msgid ""
|
905 |
"To enhance the protection ability, please refer to “<a rel=\"noreferrer"
|
906 |
"\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
|
@@ -908,7 +992,7 @@ msgid ""
|
|
908 |
"\">The best practice for target settings</a>”."
|
909 |
msgstr ""
|
910 |
|
911 |
-
#: admin/includes/tab-settings.php:
|
912 |
msgid ""
|
913 |
"If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
|
914 |
"\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
|
@@ -917,18 +1001,18 @@ msgid ""
|
|
917 |
"\">Codex</a>."
|
918 |
msgstr ""
|
919 |
|
920 |
-
#: admin/includes/tab-settings.php:
|
921 |
msgid ""
|
922 |
"While Maxmind and IP2Location will fetch the local database, others will "
|
923 |
"pass an IP address to the APIs via HTTP."
|
924 |
msgstr ""
|
925 |
|
926 |
-
#: admin/includes/tab-settings.php:
|
927 |
msgid ""
|
928 |
"Please select the appropriate APIs to fit the privacy law in your country."
|
929 |
msgstr ""
|
930 |
|
931 |
-
#: admin/includes/tab-settings.php:
|
932 |
msgid ""
|
933 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
934 |
"ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
|
@@ -936,7 +1020,7 @@ msgid ""
|
|
936 |
"cache plugin."
|
937 |
msgstr ""
|
938 |
|
939 |
-
#: admin/includes/tab-settings.php:
|
940 |
msgid ""
|
941 |
"If you find any issues or have something to suggest, please feel free to "
|
942 |
"open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
|
@@ -944,14 +1028,14 @@ msgid ""
|
|
944 |
"\">support forum</a>."
|
945 |
msgstr ""
|
946 |
|
947 |
-
#: admin/includes/tab-settings.php:
|
948 |
msgid ""
|
949 |
"Please refer to the document “<a rel=\"noreferrer\" href=\"http://www."
|
950 |
"ipgeoblock.com/codex/record-settings-and-logs.html\" title=\"Codex | IP Geo "
|
951 |
"Block\">Record settings and logs</a>” for details."
|
952 |
msgstr ""
|
953 |
|
954 |
-
#: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:
|
955 |
msgid "Statistics of validation"
|
956 |
msgstr ""
|
957 |
|
@@ -959,65 +1043,65 @@ msgstr ""
|
|
959 |
msgid "Blocked"
|
960 |
msgstr ""
|
961 |
|
962 |
-
#: admin/includes/tab-statistics.php:
|
963 |
msgid "Blocked by countries"
|
964 |
msgstr ""
|
965 |
|
966 |
-
#: admin/includes/tab-statistics.php:
|
967 |
msgid "Blocked per day"
|
968 |
msgstr ""
|
969 |
|
970 |
-
#: admin/includes/tab-statistics.php:
|
971 |
msgid "Blocked by type of IP address"
|
972 |
msgstr ""
|
973 |
|
974 |
-
#: admin/includes/tab-statistics.php:
|
975 |
msgid "Name of API"
|
976 |
msgstr ""
|
977 |
|
978 |
-
#: admin/includes/tab-statistics.php:
|
979 |
msgid "Calls"
|
980 |
msgstr ""
|
981 |
|
982 |
-
#: admin/includes/tab-statistics.php:
|
983 |
msgid "Response [msec]"
|
984 |
msgstr ""
|
985 |
|
986 |
-
#: admin/includes/tab-statistics.php:
|
987 |
msgid "Average response time of each API"
|
988 |
msgstr ""
|
989 |
|
990 |
-
#: admin/includes/tab-statistics.php:
|
991 |
msgid "Clear statistics"
|
992 |
msgstr ""
|
993 |
|
994 |
-
#: admin/includes/tab-statistics.php:
|
995 |
-
msgid "Statistics
|
996 |
msgstr ""
|
997 |
|
998 |
-
#: admin/includes/tab-statistics.php:
|
999 |
msgid "Country code / Access"
|
1000 |
msgstr ""
|
1001 |
|
1002 |
-
#: admin/includes/tab-statistics.php:
|
1003 |
msgid "Elapsed [sec] / Calls"
|
1004 |
msgstr ""
|
1005 |
|
1006 |
-
#: admin/includes/tab-statistics.php:
|
1007 |
msgid "IP address in cache"
|
1008 |
msgstr ""
|
1009 |
|
1010 |
-
#: admin/includes/tab-statistics.php:
|
1011 |
msgid "Clear cache"
|
1012 |
msgstr ""
|
1013 |
|
1014 |
-
#: admin/includes/tab-statistics.php:
|
1015 |
msgid ""
|
1016 |
"Current setting of [<strong>Record validation statistics</strong>] on "
|
1017 |
"[<strong>Settings</strong>] tab is not selected [<strong>Enable</strong>]."
|
1018 |
msgstr ""
|
1019 |
|
1020 |
-
#: admin/includes/tab-statistics.php:
|
1021 |
msgid ""
|
1022 |
"Please set the proper condition to record and analyze the validation "
|
1023 |
"statistics."
|
@@ -1029,34 +1113,42 @@ msgid ""
|
|
1029 |
"<strong>you'll be blocked</strong> after the cache expires."
|
1030 |
msgstr ""
|
1031 |
|
1032 |
-
#: classes/class-ip-geo-block-cron.php:
|
1033 |
msgid "Your database file is up-to-date."
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: classes/class-ip-geo-block-cron.php:
|
1037 |
-
#: classes/class-ip-geo-block-cron.php:
|
1038 |
#, php-format
|
1039 |
msgid "Unable to read %s. Please check the permission."
|
1040 |
msgstr ""
|
1041 |
|
1042 |
-
#: classes/class-ip-geo-block-cron.php:
|
1043 |
-
#: classes/class-ip-geo-block-cron.php:
|
1044 |
#, php-format
|
1045 |
msgid "Can't lock %s. Please try again after a while."
|
1046 |
msgstr ""
|
1047 |
|
1048 |
-
#: classes/class-ip-geo-block-cron.php:
|
1049 |
-
|
1050 |
-
msgid "Unable to read %s. Please check permission."
|
1051 |
msgstr ""
|
1052 |
|
1053 |
-
#: classes/class-ip-geo-block-
|
1054 |
#, php-format
|
1055 |
-
msgid "
|
|
|
|
|
|
|
|
|
1056 |
msgstr ""
|
1057 |
|
1058 |
-
#: classes/class-ip-geo-block-
|
1059 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
1060 |
msgstr ""
|
1061 |
|
1062 |
#: classes/class-ip-geo-block-logs.php:149
|
@@ -1073,7 +1165,7 @@ msgstr ""
|
|
1073 |
msgid "Database file does not exist."
|
1074 |
msgstr ""
|
1075 |
|
1076 |
-
#: wp-content/mu-plugins/ip-geo-block-mu.php:
|
1077 |
#, php-format
|
1078 |
msgid ""
|
1079 |
"Can't find IP Geo Block in your plugins directory. Please remove <code>%s</"
|
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 |
"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 |
"strong>” 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 “<strong>Matching rule</strong>” 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 |
+
"“mu-plugins” (ip-geo-block-mu.php) at “Validation "
|
126 |
+
"timing” is imcompatible with <strong>IP Geo Allow</strong>. Please "
|
127 |
+
"select “init” 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 ""
|
286 |
|
287 |
+
#: admin/includes/tab-accesslog.php:137
|
288 |
msgid "User agent"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: admin/includes/tab-accesslog.php:138
|
292 |
msgid "HTTP headers"
|
293 |
msgstr ""
|
294 |
|
295 |
+
#: admin/includes/tab-accesslog.php:139
|
296 |
msgid "$_POST data"
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: admin/includes/tab-accesslog.php:156
|
300 |
msgid ""
|
301 |
"Current selection of [<strong>Record validation logs</strong>] on "
|
302 |
"[<strong>Settings</strong>] tab is [<strong>Disable</strong>]."
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: admin/includes/tab-accesslog.php:157
|
306 |
msgid ""
|
307 |
"Please select the proper condition to record and analyze the validation logs."
|
308 |
msgstr ""
|
311 |
msgid "Attribution links"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: admin/includes/tab-geolocation.php:18
|
315 |
msgid "Search IP address geolocation"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: admin/includes/tab-geolocation.php:42
|
319 |
msgid "Geolocation service"
|
320 |
msgstr ""
|
321 |
|
322 |
+
#: admin/includes/tab-geolocation.php:82
|
323 |
msgid "Find geolocation"
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: admin/includes/tab-geolocation.php:90
|
327 |
msgid "Search now"
|
328 |
msgstr ""
|
329 |
|
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 “Scan country code”.\">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 “Whitelist” or “Blacklist”."
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: admin/includes/tab-settings.php:116
|
370 |
msgid ""
|
371 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
372 |
+
"empty. The special code “XX” is assigned as private IP address "
|
373 |
+
"including localhost. And “ZZ” is for unknown IP address (i.e. "
|
374 |
+
"not in the geolocation databases). Please use “YY” if you need "
|
375 |
+
"the code that does not correspond to any of the countries.\">Whitelist of "
|
376 |
+
"country code</dfn>"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: admin/includes/tab-settings.php:117
|
380 |
msgid ""
|
381 |
"<dfn title=\"“Block by country” will be bypassed in case of "
|
382 |
+
"empty. The special code “XX” is assigned as private IP address "
|
383 |
+
"including localhost. And “ZZ” is for unknown IP address (i.e. "
|
384 |
+
"not in the geolocation databases). Please use “YY” if you need "
|
385 |
+
"the code that does not correspond to any of the countries.\">Blacklist of "
|
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. “192.0.64.0/18” for Jetpack server, "
|
416 |
"“69.46.36.0/27” 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 “"
|
430 |
+
"HTTP_X_FORWARDED_FOR”, “HTTP_X_REAL_IP” or something like "
|
431 |
+
"that to retrieve the client IP address.\">$_SERVER keys to retrieve extra IP "
|
432 |
"addresses</dfn>"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: admin/includes/tab-settings.php:246
|
436 |
msgid ""
|
437 |
"<dfn title=\"It validates malicious signatures independently of “Block "
|
438 |
"by country” and “Prevent Zero-day Exploit” for the target "
|
439 |
"“Admin area”, “Admin ajax/post”, “Plugins "
|
440 |
"area” and “Themes area”.\">Bad signatures in query</dfn> "
|
441 |
+
"<nobr>(<a class=\"ip-geo-block-cycle\" id=\"ip-geo-block-decode\" title="
|
442 |
"\"When you find ugly character string in the text area, please click to "
|
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 “"
|
461 |
+
"mu-plugins” (ip-geo-block-mu.php) at “Validation timing” "
|
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 "
|
490 |
+
"prevent loop of redirection even when you enable [Block by country] in "
|
491 |
+
"[Front-end target settings] section. Empty URL is altered to your home."
|
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 “XML-RPC” and “Login "
|
504 |
+
"form”. Lockout period is defined as expiration time at “Cache "
|
505 |
+
"settings”.\">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 "“init” action hook"
|
518 |
msgstr ""
|
519 |
|
520 |
+
#: admin/includes/tab-settings.php:430
|
521 |
msgid "“mu-plugins” (ip-geo-block-mu.php)"
|
522 |
msgstr ""
|
523 |
|
524 |
+
#: admin/includes/tab-settings.php:433
|
525 |
msgid ""
|
526 |
"Validate at “init” 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 |
"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 (“page=…”) or the "
|
598 |
+
"action name (“action=…”) to prevent undesired blocking "
|
599 |
+
"caused by “Block by country” for non logged-in user and “"
|
600 |
+
"Prevent Zero-day Exploit” 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⋯/*.php</code>."
|
612 |
msgstr ""
|
613 |
|
614 |
+
#: admin/includes/tab-settings.php:641
|
615 |
#, php-format
|
616 |
msgid ""
|
617 |
"It configures “%s” 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 “"
|
625 |
"INACTIVE”.\">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 “Validation rule settings”"
|
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. "
|
652 |
+
"This is useful to prevent violation against your affiliate program."
|
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 “Validation timing” is deferred till “"
|
698 |
"wp” 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 “:” (pass) or "
|
709 |
"qualification”."
|
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, “HOST” and “"
|
728 |
+
"HOST=…”in “UA string and qualification” will always "
|
729 |
+
"return “true”."
|
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 “Public facing pages” 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 "
|
766 |
"contents of tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> "
|
767 |
"from <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-"
|
768 |
"IP-Geo-API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-"
|
769 |
+
"IP-Geo-API</a>. Please install <code>ip-geo-api</code> with write permission "
|
770 |
+
"according to <a rel=\"noreferrer\" href=\"http://www.ipgeoblock.com/codex/"
|
771 |
+
"how-to-fix-permission-troubles.html\" title=\"How can I fix permission "
|
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 |
"\">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 <p> 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 “Save Changes” 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 “Right after "
|
938 |
+
"installing” 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 “Back-end target settings”"
|
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 & paste when submitting your issue to support "
|
974 |
"forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
|
976 |
"› Support » 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 “<a rel=\"noreferrer"
|
990 |
"\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
|
992 |
"\">The best practice for target settings</a>”."
|
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 |
"\">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 “<a rel=\"noreferrer\" href=\"http://www."
|
1018 |
"ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
|
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 |
"\">support forum</a>."
|
1029 |
msgstr ""
|
1030 |
|
1031 |
+
#: admin/includes/tab-settings.php:1559
|
1032 |
msgid ""
|
1033 |
"Please refer to the document “<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>” 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 |
|
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."
|
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 |
|
1136 |
+
#: classes/class-ip-geo-block-file.php:54
|
1137 |
#, php-format
|
1138 |
+
msgid ""
|
1139 |
+
"This plugin does not support method “%s” for FTP or SSH based "
|
1140 |
+
"file operations. Please refer to <a href=\"https://codex.wordpress.org/"
|
1141 |
+
"Editing_wp-config.php#WordPress_Upgrade_Constants\" title=\"Editing wp-"
|
1142 |
+
"config.php « WordPress Codex\">this document</a> for more details."
|
1143 |
msgstr ""
|
1144 |
|
1145 |
+
#: classes/class-ip-geo-block-file.php:68
|
1146 |
+
msgid ""
|
1147 |
+
"You should define some constants in your <code>wp-config.php</code> for FTP "
|
1148 |
+
"or SSH based file operations. Please refer to <a href=\"https://codex."
|
1149 |
+
"wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants\" title="
|
1150 |
+
"\"Editing wp-config.php « WordPress Codex\">this document</a> for more "
|
1151 |
+
"details."
|
1152 |
msgstr ""
|
1153 |
|
1154 |
#: classes/class-ip-geo-block-logs.php:149
|
1165 |
msgid "Database file does not exist."
|
1166 |
msgstr ""
|
1167 |
|
1168 |
+
#: wp-content/mu-plugins/ip-geo-block-mu.php:70
|
1169 |
#, php-format
|
1170 |
msgid ""
|
1171 |
"Can't find IP Geo Block in your plugins directory. Please remove <code>%s</"
|
rewrite.php
CHANGED
@@ -31,7 +31,7 @@
|
|
31 |
* this includes the originally requested php file to excute it.
|
32 |
*/
|
33 |
|
34 |
-
if ( ! class_exists( 'IP_Geo_Block_Rewrite' ) ):
|
35 |
|
36 |
class IP_Geo_Block_Rewrite {
|
37 |
|
@@ -112,7 +112,8 @@ class IP_Geo_Block_Rewrite {
|
|
112 |
// @link http://community.sitepoint.com/t/-server-document-root-injection-vulnerability/5274
|
113 |
// @link http://www.securityfocus.com/archive/1/476274/100/0/threaded
|
114 |
// @link http://www.securityfocus.com/archive/1/476437/100/0/threaded
|
115 |
-
$root = ! empty( $_SERVER['DOCUMENT_ROOT'] ) ?
|
|
|
116 |
substr( $_SERVER['SCRIPT_FILENAME'], 0, -strlen( $_SERVER['SCRIPT_NAME'] ) );
|
117 |
|
118 |
// get absolute path of requested uri
|
@@ -160,7 +161,7 @@ require_once '../../../wp-load.php';
|
|
160 |
* is enable. But in case of disable, the requested uri should be executed indirectly
|
161 |
* as a fallback.
|
162 |
*/
|
163 |
-
if ( ! class_exists( 'IP_Geo_Block' ) )
|
164 |
require_once dirname( __FILE__ ) . '/ip-geo-block.php';
|
165 |
|
166 |
IP_Geo_Block_Rewrite::exec(
|
@@ -169,17 +170,17 @@ IP_Geo_Block_Rewrite::exec(
|
|
169 |
IP_Geo_Block::get_option()
|
170 |
);
|
171 |
|
172 |
-
endif; /* ! class_exists( 'IP_Geo_Block_Rewrite' ) */
|
173 |
|
174 |
/**
|
175 |
* Configuration samples of .htaccess for apache
|
176 |
*
|
177 |
-
* 1. `/
|
178 |
*
|
179 |
* # BEGIN IP Geo Block
|
180 |
* <IfModule mod_rewrite.c>
|
181 |
* RewriteEngine on
|
182 |
-
* RewriteBase /
|
183 |
* RewriteCond %{REQUEST_URI} !ip-geo-block/rewrite.php$
|
184 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
185 |
* </IfModule>
|
@@ -188,41 +189,41 @@ endif; /* ! class_exists( 'IP_Geo_Block_Rewrite' ) */
|
|
188 |
* # BEGIN IP Geo Block
|
189 |
* <IfModule mod_rewrite.c>
|
190 |
* RewriteEngine on
|
191 |
-
* RewriteBase /
|
192 |
* RewriteRule ^ip-geo-block/rewrite.php$ - [L]
|
193 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
194 |
* </IfModule>
|
195 |
* # END IP Geo Block
|
196 |
*
|
197 |
* # BEGIN IP Geo Block
|
198 |
-
* #
|
199 |
* <IfModule mod_rewrite.c>
|
200 |
* RewriteEngine on
|
201 |
-
* RewriteBase /
|
202 |
-
* RewriteCond %{REQUEST_URI} !ip-geo-block/rewrite.php$
|
203 |
* RewriteCond %{REQUEST_URI} !my-plugin/somthing.php$
|
204 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
205 |
* </IfModule>
|
206 |
* # END IP Geo Block
|
207 |
*
|
208 |
* # BEGIN IP Geo Block
|
209 |
-
* #
|
210 |
* <IfModule mod_rewrite.c>
|
211 |
* RewriteEngine on
|
212 |
-
* RewriteBase /
|
213 |
* RewriteRule ^ip-geo-block/rewrite.php$ - [L]
|
214 |
* RewriteRule ^my-plugin/something.php$ - [L]
|
215 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
216 |
* </IfModule>
|
217 |
* # END IP Geo Block
|
218 |
*
|
219 |
-
* 2. `/
|
220 |
*
|
221 |
* # BEGIN IP Geo Block
|
222 |
* <IfModule mod_rewrite.c>
|
223 |
* RewriteEngine on
|
224 |
-
* RewriteBase /
|
225 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
226 |
* </IfModule>
|
227 |
* # END IP Geo Block
|
228 |
-
*/
|
31 |
* this includes the originally requested php file to excute it.
|
32 |
*/
|
33 |
|
34 |
+
if ( ! class_exists( 'IP_Geo_Block_Rewrite', FALSE ) ):
|
35 |
|
36 |
class IP_Geo_Block_Rewrite {
|
37 |
|
112 |
// @link http://community.sitepoint.com/t/-server-document-root-injection-vulnerability/5274
|
113 |
// @link http://www.securityfocus.com/archive/1/476274/100/0/threaded
|
114 |
// @link http://www.securityfocus.com/archive/1/476437/100/0/threaded
|
115 |
+
$root = ! empty( $_SERVER['DOCUMENT_ROOT'] ) ?
|
116 |
+
$_SERVER['DOCUMENT_ROOT'] :
|
117 |
substr( $_SERVER['SCRIPT_FILENAME'], 0, -strlen( $_SERVER['SCRIPT_NAME'] ) );
|
118 |
|
119 |
// get absolute path of requested uri
|
161 |
* is enable. But in case of disable, the requested uri should be executed indirectly
|
162 |
* as a fallback.
|
163 |
*/
|
164 |
+
if ( ! class_exists( 'IP_Geo_Block', FALSE ) )
|
165 |
require_once dirname( __FILE__ ) . '/ip-geo-block.php';
|
166 |
|
167 |
IP_Geo_Block_Rewrite::exec(
|
170 |
IP_Geo_Block::get_option()
|
171 |
);
|
172 |
|
173 |
+
endif; /* ! class_exists( 'IP_Geo_Block_Rewrite', FALSE ) */
|
174 |
|
175 |
/**
|
176 |
* Configuration samples of .htaccess for apache
|
177 |
*
|
178 |
+
* 1. `/wp-content/plugins/.htaccess`
|
179 |
*
|
180 |
* # BEGIN IP Geo Block
|
181 |
* <IfModule mod_rewrite.c>
|
182 |
* RewriteEngine on
|
183 |
+
* RewriteBase /wp-content/plugins/ip-geo-block/
|
184 |
* RewriteCond %{REQUEST_URI} !ip-geo-block/rewrite.php$
|
185 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
186 |
* </IfModule>
|
189 |
* # BEGIN IP Geo Block
|
190 |
* <IfModule mod_rewrite.c>
|
191 |
* RewriteEngine on
|
192 |
+
* RewriteBase /wp-content/plugins/ip-geo-block/
|
193 |
* RewriteRule ^ip-geo-block/rewrite.php$ - [L]
|
194 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
195 |
* </IfModule>
|
196 |
* # END IP Geo Block
|
197 |
*
|
198 |
* # BEGIN IP Geo Block
|
199 |
+
* # except `my-plugin/somthing.php`
|
200 |
* <IfModule mod_rewrite.c>
|
201 |
* RewriteEngine on
|
202 |
+
* RewriteBase /wp-content/plugins/ip-geo-block/
|
203 |
+
* RewriteCond %{REQUEST_URI} !ip-geo-block/rewrite.php$
|
204 |
* RewriteCond %{REQUEST_URI} !my-plugin/somthing.php$
|
205 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
206 |
* </IfModule>
|
207 |
* # END IP Geo Block
|
208 |
*
|
209 |
* # BEGIN IP Geo Block
|
210 |
+
* # except `my-plugin/somthing.php`
|
211 |
* <IfModule mod_rewrite.c>
|
212 |
* RewriteEngine on
|
213 |
+
* RewriteBase /wp-content/plugins/ip-geo-block/
|
214 |
* RewriteRule ^ip-geo-block/rewrite.php$ - [L]
|
215 |
* RewriteRule ^my-plugin/something.php$ - [L]
|
216 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
217 |
* </IfModule>
|
218 |
* # END IP Geo Block
|
219 |
*
|
220 |
+
* 2. `/wp-content/themes/.htaccess`
|
221 |
*
|
222 |
* # BEGIN IP Geo Block
|
223 |
* <IfModule mod_rewrite.c>
|
224 |
* RewriteEngine on
|
225 |
+
* RewriteBase /wp-content/plugins/ip-geo-block/
|
226 |
* RewriteRule ^.*\.php$ rewrite.php [L]
|
227 |
* </IfModule>
|
228 |
* # END IP Geo Block
|
229 |
+
*/
|
samples.php
CHANGED
@@ -10,13 +10,12 @@
|
|
10 |
*/
|
11 |
/* Start loading wp-load.php */
|
12 |
if ( ! empty( $_GET['wp-load'] ) ) {
|
13 |
-
|
|
|
14 |
}
|
15 |
die( '0' );
|
16 |
/* End of loading wp-load.php */
|
17 |
|
18 |
-
if ( class_exists( 'IP_Geo_Block' ) ):
|
19 |
-
|
20 |
/**
|
21 |
* Example 1: Usage of 'ip-geo-block-ip-addr'
|
22 |
* Use case: Replace ip address for test purpose
|
@@ -404,7 +403,3 @@ function my_record_logs( $record, $hook, $validate ) {
|
|
404 |
}
|
405 |
|
406 |
add_filter( 'ip-geo-block-record-logs', 'my_record_logs', 10, 3 );
|
407 |
-
|
408 |
-
endif; /* class_exists( 'IP_Geo_Block' ) */
|
409 |
-
|
410 |
-
?>
|
10 |
*/
|
11 |
/* Start loading wp-load.php */
|
12 |
if ( ! empty( $_GET['wp-load'] ) ) {
|
13 |
+
$abspath = substr( __FILE__, 0, strpos( __FILE__, '/wp-content/' ) );
|
14 |
+
include_once $abspath . '/wp-load.php';
|
15 |
}
|
16 |
die( '0' );
|
17 |
/* End of loading wp-load.php */
|
18 |
|
|
|
|
|
19 |
/**
|
20 |
* Example 1: Usage of 'ip-geo-block-ip-addr'
|
21 |
* Use case: Replace ip address for test purpose
|
403 |
}
|
404 |
|
405 |
add_filter( 'ip-geo-block-record-logs', 'my_record_logs', 10, 3 );
|
|
|
|
|
|
|
|
uninstall.php
CHANGED
@@ -10,9 +10,7 @@
|
|
10 |
*/
|
11 |
|
12 |
// If uninstall not called from WordPress, then exit
|
13 |
-
|
14 |
-
die;
|
15 |
-
}
|
16 |
|
17 |
define( 'IP_GEO_BLOCK_PATH', plugin_dir_path( __FILE__ ) ); // @since 2.8
|
18 |
|
@@ -46,15 +44,13 @@ class IP_Geo_Block_Uninstall {
|
|
46 |
|
47 |
else {
|
48 |
global $wpdb;
|
49 |
-
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM
|
50 |
-
$current_blog_id = get_current_blog_id();
|
51 |
|
52 |
foreach ( $blog_ids as $id ) {
|
53 |
switch_to_blog( $id );
|
54 |
self::delete_blog_options();
|
|
|
55 |
}
|
56 |
-
|
57 |
-
switch_to_blog( $current_blog_id );
|
58 |
}
|
59 |
}
|
60 |
|
10 |
*/
|
11 |
|
12 |
// If uninstall not called from WordPress, then exit
|
13 |
+
defined( 'WP_UNINSTALL_PLUGIN' ) or die;
|
|
|
|
|
14 |
|
15 |
define( 'IP_GEO_BLOCK_PATH', plugin_dir_path( __FILE__ ) ); // @since 2.8
|
16 |
|
44 |
|
45 |
else {
|
46 |
global $wpdb;
|
47 |
+
$blog_ids = $wpdb->get_col( "SELECT `blog_id` FROM `$wpdb->blogs`" );
|
|
|
48 |
|
49 |
foreach ( $blog_ids as $id ) {
|
50 |
switch_to_blog( $id );
|
51 |
self::delete_blog_options();
|
52 |
+
restore_current_blog();
|
53 |
}
|
|
|
|
|
54 |
}
|
55 |
}
|
56 |
|
wp-content/ip-geo-api/drop-in-sample.php
CHANGED
@@ -11,7 +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' ) ) {
|
15 |
die;
|
16 |
}
|
17 |
|
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 |
|
wp-content/ip-geo-api/index.php
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
<?php
|
2 |
// Silence is golden.
|
3 |
-
?>
|
1 |
<?php
|
2 |
// Silence is golden.
|
|
wp-content/mu-plugins/ip-geo-block-mu.php
CHANGED
@@ -22,11 +22,9 @@
|
|
22 |
*/
|
23 |
|
24 |
// If this file is called directly, abort.
|
25 |
-
|
26 |
-
die;
|
27 |
-
}
|
28 |
|
29 |
-
if ( ! class_exists( 'IP_Geo_Block' ) ):
|
30 |
|
31 |
/*----------------------------------------------------------------------------*
|
32 |
* Detect plugin. For use on Front End only.
|
@@ -73,7 +71,7 @@ function ip_geo_block_mu_notice() {
|
|
73 |
__FILE__,
|
74 |
'<a href="https://wordpress.org/plugins/ip-geo-block/" title="IP Geo Block — WordPress Plugins">IP Geo Block</a>'
|
75 |
);
|
76 |
-
echo '
|
77 |
}
|
78 |
|
79 |
-
endif; // ! class_exists( 'IP_Geo_Block' )
|
22 |
*/
|
23 |
|
24 |
// If this file is called directly, abort.
|
25 |
+
defined( 'WPINC' ) or die;
|
|
|
|
|
26 |
|
27 |
+
if ( ! class_exists( 'IP_Geo_Block', FALSE ) ):
|
28 |
|
29 |
/*----------------------------------------------------------------------------*
|
30 |
* Detect plugin. For use on Front End only.
|
71 |
__FILE__,
|
72 |
'<a href="https://wordpress.org/plugins/ip-geo-block/" title="IP Geo Block — WordPress Plugins">IP Geo Block</a>'
|
73 |
);
|
74 |
+
echo '</p></div>' . "\n";
|
75 |
}
|
76 |
|
77 |
+
endif; // ! class_exists( 'IP_Geo_Block', FALSE )
|