IP Geo Block - Version 2.2.9.1

Version Description

  • Bug fix: Blocking Wordfence scanning. (@)
  • Bug fix: Illegal elimination of colon in text field for IP address. (@)
  • Improved: Compatibility with PHP 7 that cause to feel relaxed. (@)
  • Improved: Avoid resetting whitelist on update by InfiniteWP. (@)
  • Trial feature: X-Robots-Tag HTTP header with noindex, nofollow for login page. (@)
Download this release

Release Info

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

Code changes from version 3.0.0 to 2.2.9.1

README.txt CHANGED
@@ -4,38 +4,46 @@ Donate link:
4
Tags: buddypress, bbPress, comment, pingback, trackback, spam, IP address, geo, geolocation, xmlrpc, login, wp-admin, admin, ajax, security, brute force, firewall, vulnerability
5
Requires at least: 3.7
6
Tested up to: 4.6.1
7
- Stable tag: 3.0.0
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
11
- It blocks spam posts, login attempts and malicious access to the back-end
12
- requested from the specific countries, and also prevents zero-day exploit.
13
14
== Description ==
15
16
- A considerable number of WordPress vulnerabilities in plugins and themes have
17
- been disclosed every month. You can easily find them at
18
- [WPScan Vulnerability Database](https://wpvulndb.com/ "WPScan Vulnerability Database")
19
- and
20
- [Exploits Database](https://www.exploit-db.com/ "Exploits Database by Offensive Security")
21
- for example. It means that many WordPress sites can be always exposed to the
22
- threats of being exploited caused by those vulnerabilities.
23
24
- This plugin protects your site against such threats of attack to the back-end
25
- of your site not only by blocking requests from undesired countries but also
26
- with the original feature 'Zero-day Exploit Prevention' (WP-ZEP).
27
28
- And it also blocks undesired requests to the login form (login attempt),
29
- comment form (spam and trackback) and XML-RPC (login attempt and pingback).
30
31
- Up to version 2.x, this plugin had been dedicated to protect the back-end of
32
- your site. From version 3.x, it becomes to be able to block access to your
33
- public facing pages, aka front-end. See
34
- [this analysis](http://www.ipgeoblock.com/codex/analysis-of-attack-vectors.html "Analysis of Attack Vectors | IP Geo Block")
35
- about protection performance against 50 samples of vulnerable plugins.
36
37
= Features =
38
39
* **Immigration control:**
40
Access to the basic and important entrances into the back-end such as
41
`wp-comments-post.php`, `xmlrpc.php`, `wp-login.php`, `wp-signup.php`,
@@ -48,15 +56,16 @@ about protection performance against 50 samples of vulnerable plugins.
48
(WP-ZEP) is simple but still smart and strong enough to block any malicious
49
accesses to `wp-admin/*.php`, `plugins/*.php` and `themes/*.php` even from
50
the permitted countries. It will protect your site against certain types of
51
- attack such as CSRF, LFI, SQLi, XSS and so on, **even if you have some in
52
- your site**. Find more details in
53
[FAQ](https://wordpress.org/plugins/ip-geo-block/faq/ "IP Geo Block - WordPress Plugins")
54
and
55
[this plugin's blog](http://www.ipgeoblock.com/article/how-wpzep-works.html "How does WP-ZEP prevent zero-day attack? | IP Geo Block").
56
57
* **Guard against login attempts:**
58
- In order to prevent hacking through the login form and XML-RPC by
59
- brute-force and the reverse-brute-force attacks, the number of login
60
attempts will be limited per IP address even from the permitted countries.
61
62
* **Protection of wp-config.php:**
@@ -66,9 +75,10 @@ about protection performance against 50 samples of vulnerable plugins.
66
67
* ** Minimize server load against brute-force attacks:**
68
You can configure this plugin as a
69
- [Must Use Plugins](https://codex.wordpress.org/Must_Use_Plugins "Must Use Plugins « WordPress Codex")
70
which would be loaded prior to regular plugins and can massively
71
- [reduce the load on server](http://www.ipgeoblock.com/codex/validation-timing.html "Validation timing | IP Geo Block").
72
And furthermore, a cache mechanism for the fetched IP addresses and country
73
code can help to reduce load on the server against the burst accesses with
74
a short period of time.
@@ -88,11 +98,15 @@ about protection performance against 50 samples of vulnerable plugins.
88
89
* **Multiple source of IP Geolocation databases:**
90
Free IP Geolocation database and REST APIs are installed into this plugin to
91
- get a country code from an IP address.
92
- [MaxMind](http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention")
93
GeoLite free databases and
94
- [IP2Location](http://www.ip2location.com/ "IP Address Geolocation to Identify Website Visitor's Geographical Location")
95
- LITE databases can be available in this plugin. Those will be downloaded
96
and updated (once a month) automatically.
97
98
* **Customizing response:**
@@ -109,9 +123,7 @@ about protection performance against 50 samples of vulnerable plugins.
109
This plugin is simple and lite enough to be able to cooperate with other
110
full spec security plugin such as
111
[Wordfence Security](https://wordpress.org/plugins/wordfence/ "WordPress › Wordfence Security « WordPress Plugins")
112
- (because country bloking is available only for premium users). See
113
- [this report](http://www.ipgeoblock.com/codex/page-speed-performance.html "Page speed performance | IP Geo Block")
114
- about page speed performance.
115
116
* **Extendability:**
117
"Settings minimum, Customizability maximum" is the basic concept of this
@@ -124,10 +136,10 @@ about protection performance against 50 samples of vulnerable plugins.
124
125
* **Self blocking prevention and easy rescue:**
126
Most of users do not prefer themselves to be blocked. This plugin prevents
127
- such a sad thing unless you force it. And futhermore, if such a situation
128
- occurs, you can
129
- [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")
130
- easily.
131
132
* **Clean uninstallation:**
133
Nothing is left in your precious mySQL database after uninstallation. So you
@@ -138,9 +150,9 @@ about protection performance against 50 samples of vulnerable plugins.
138
= Attribution =
139
140
This package includes GeoLite library distributed by MaxMind, available from
141
- [MaxMind](http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention"),
142
and also includes IP2Location open source libraries available from
143
- [IP2Location](http://www.ip2location.com "IP Address Geolocation to Identify Website Visitor's Geographical Location").
144
145
Also thanks for providing the following great services and REST APIs for free.
146
@@ -155,12 +167,12 @@ Also thanks for providing the following great services and REST APIs for free.
155
= Development =
156
157
Development of this plugin is promoted at
158
- [WordPress-IP-Geo-Block](https://github.com/tokkonopapa/WordPress-IP-Geo-Block "tokkonopapa/WordPress-IP-Geo-Block - GitHub")
159
- and class libraries to handle geo-location database are developed separately
160
- as "add-in"s at
161
- [WordPress-IP-Geo-API](https://github.com/tokkonopapa/WordPress-IP-Geo-API "tokkonopapa/WordPress-IP-Geo-API - GitHub").
162
All contributions will always be welcome. Or visit my
163
- [development blog](http://www.ipgeoblock.com/ "IP Geo Block").
164
165
== Installation ==
166
@@ -170,12 +182,6 @@ All contributions will always be welcome. Or visit my
170
2. Search for 'IP Geo Block'
171
3. Click 'Install Now'
172
4. Activate the plugin on the Plugin dashboard
173
- 5. Try 'Best practice' button for easy setup at the bottom of this plugin's
174
- setting page.
175
-
176
- Please refer to
177
- [the document](http://www.ipgeoblock.com/codex/ "Codex | IP Geo Block")
178
- or following descriptions for your best setup.
179
180
= Validation rule settings =
181
@@ -216,7 +222,7 @@ or following descriptions for your best setup.
216
Choose **"init" action hook** or **"mu-plugins" (ip-geo-block-mu.php)** to
217
specify the timing of validation.
218
219
- = Back-end target settings =
220
221
* **Comment post**
222
Validate post to `wp-comment-post.php`. Comment post and trackback will be
@@ -241,25 +247,6 @@ or following descriptions for your best setup.
241
* **Themes area**
242
Validate direct access to themes. Typically `wp-content/themes/…/*.php`.
243
244
- = Front-end target settings =
245
-
246
- * **Block by country**
247
- Enables validation of country code on public facing pages.
248
-
249
- * **Matching rule**
250
- Same as **Validation target settings** but can be set independently.
251
-
252
- * **Validation target**
253
- Specify the single and archive page by post type, category and tag as
254
- blocking target.
255
-
256
- * **UA string and qualification**
257
- Additional rules targeted at SEO which can specify acceptable requests
258
- based on user agent.
259
-
260
- * **Simulation mode**
261
- You can simulate the 'blocking on front-end' functionality before deploying.
262
-
263
= Geolocation API settings =
264
265
* **API selection and key settings**
@@ -294,12 +281,12 @@ or following descriptions for your best setup.
294
295
= Cache settings =
296
297
* **Expiration time [sec]**
298
Maximum time in sec to keep cache.
299
300
- * **Garbage collection period [sec]**
301
- Period of garbage collection to clean cache.
302
-
303
= Submission settings =
304
305
* **Text position on comment form**
@@ -322,10 +309,8 @@ it via FTP.
322
323
`/**
324
* Invalidate blocking behavior in case yourself is locked out.
325
- *
326
- * How to use: Activate the following code and upload this file via FTP.
327
- */
328
- /* -- EDIT THIS LINE AND ACTIVATE THE FOLLOWING FUNCTION -- */
329
function ip_geo_block_emergency( $validate ) {
330
$validate['result'] = 'passed';
331
return $validate;
@@ -337,7 +322,7 @@ add_filter( 'ip-geo-block-admin', 'ip_geo_block_emergency' );
337
Then "**Clear cache**" at "**Statistics**" tab on your dashborad. Remember
338
that you should upload the original one to deactivate above feature.
339
340
- [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")
341
can also help you.
342
343
= How can I fix "Unable to write" error? =
@@ -355,48 +340,6 @@ Please refer to
355
"[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')"
356
in order to fix this error.
357
358
- = Does this plugin works well with caching? =
359
-
360
- For the back-end protection, the answer is YES if you disable caching on
361
- back-end. But for the front-end, the answer depends on the caching method
362
- you are employing.
363
-
364
- Currently, the following cache plugins and configurations can be supported:
365
-
366
- - [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/ "WP Super Cache — WordPress Plugins")
367
- Select "**Use PHP to serve cache files**" and enable "**Late init**".
368
-
369
- - [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/ "W3 Total Cache — WordPress Plugins")
370
- Select "**Disk: Basic**" and enable "**Late initialization**" for page cache.
371
- "**Disk: Enhanced**" (where "**Late initialization**" is not available) in
372
- W3TC 0.9.5.1 seems to work good without any imcompatibility with this plugin.
373
-
374
- - [Vendi Cache](https://wordpress.org/plugins/vendi-cache/ "Vendi Cache — WordPress Plugins")
375
- This was formerly built in Wordfence. Select "**basic caching**" for
376
- Vendi Cache and **"mu-plugin" (ip-geo-block-mu.php)** for IP Geo Block.
377
-
378
- If your plugin serves page caching by `mod_rewrite` via `.htaccess`
379
- (e.g. WP Fastest Cache) or caching by `advanced-cache.php` drop-in
380
- (e.g. Comet Cache) or your hosting provider serves page caching at
381
- server side, "**Blocking on front-end**" might lead to generate
382
- inconsistent pages.
383
-
384
- For more details, please refer to some documents at
385
- "[Blocking on front-end](http://www.ipgeoblock.com/codex/#blocking-on-front-end 'Codex | IP Geo Block')".
386
-
387
- = How can I test this plugin works? =
388
-
389
- The easiest way is to use
390
- [free proxy browser addon](https://www.google.com/search?q=free+proxy+browser+addon "free proxy browser addon - Google Search").
391
- Another one is to use
392
- [http header browser addon](https://www.google.com/search?q=browser+add+on+modify+http+header "browser add on modify http header - Google Search").
393
- You can add an IP address to the `X-Forwarded-For` header to emulate the
394
- access behind the proxy. In this case, you should add `HTTP_X_FORWARDED_FOR`
395
- into the "**$_SERVER keys for extra IPs**" on "**Settings**" tab.
396
-
397
- See more details at
398
- "[How to test prevention of attacks](http://www.ipgeoblock.com/codex/#how-to-test-prevention-of-attacks 'Codex | IP Geo Block')".
399
-
400
= Do I have to turn on all the selection to enhance security? =
401
402
Yes. Roughly speaking, the strategy of this plugin has been constructed as
@@ -414,21 +357,35 @@ follows:
414
- **Bad signatures in query**
415
It blocks the request which has not been covered in the above three.
416
417
- Please try "**Best practice**" button at the bottom of this plugin's setting
418
- page for easy setup. And also see more details in
419
"[The best practice of target settings](http://www.ipgeoblock.com/codex/the-best-practice-of-target-settings.html 'The best practice of target settings | IP Geo Block')".
420
421
- = Does this plugin validate all the requests? =
422
423
Unfortunately, no. This plugin can't handle the requests that are not
424
parsed by WordPress. In other words, a standalone file (PHP, CGI or
425
something excutable) that is unrelated to WordPress can't be validated
426
- by this plugin even if it is in the WordPress install directory.
427
428
But there're exceptions: When you enable "**Force to load WP core**" for
429
**Plugins area** or **Themes area**, a standalone PHP file becomes to be
430
- able to be blocked. Sometimes this kind of file has some vulnerabilities.
431
- This function protects your site against such a case.
432
433
= Some admin function doesn't work when WP-ZEP is enabled. =
434
@@ -439,20 +396,43 @@ location object or meta tag for refresh).
439
Another is the case related to the content type. This plugin will only support
440
`application/x-www-form-urlencoded` and `multipart/form-data`.
441
442
- The last case is that a ajax/post request comes from not jQuery but flash or
443
something.
444
445
In those cases, this plugin should bypass WP-ZEP. So please find the unique
446
strings in the requested queries and add it into the safe query list via the
447
filter hook `ip-geo-block-bypass-admins`.
448
449
- If you can not figure out your troubles, please let me know your issues and
450
- the name of plugins you are using at support forum.
451
452
= Are there any other useful filter hooks? =
453
454
- Yes, you can find the list of all hooks and useful samples
455
- [here](http://www.ipgeoblock.com/codex/#filter-hooks "Codex | IP Geo Block").
456
457
== Other Notes ==
458
@@ -465,9 +445,15 @@ Yes, you can find the list of all hooks and useful samples
465
* 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"),
466
`rel=nofollow` attribute and value pair had no longer be added to relative
467
or same domain links within `comment_content`. This change prevents to block
468
- "Server Side Request Forgeries" (not Cross Site but a malicious link in the
469
comment field of own site).
470
471
== Screenshots ==
472
473
1. **IP Geo Plugin** - Settings.
@@ -478,21 +464,6 @@ Yes, you can find the list of all hooks and useful samples
478
479
== Changelog ==
480
481
- = 3.0.0 =
482
- * **New feature:** Add the function of blocking on front-end.
483
- * **New filter hook:** Add `ip-geo-block-public` to extend validation on
484
- front-end.
485
- * **Improvement:** Avoid conflict with "Open external links in a new window"
486
- plugin and some other reason to prevent duplicated window open. For more
487
- detail, see
488
- [this discussion at support forum](https://wordpress.org/support/topic/ip-geoblock-opens-2-windows-on-link-clicks-when-user-is-logged-in/ "Topic: IP Geoblock opens 2 windows on link clicks when user is logged in « WordPress.org Forums").
489
- * **Improvement:** Better compatibility with some plugins, themes and widgets.
490
- * **Improvement:** Deferred execution of SQL command to improve the response.
491
- * **Improvement:** Make the response compatible with WP original when it is
492
- requested by GET method.
493
- * See some details at
494
- [release 3.0.0](http://www.ipgeoblock.com/changelog/release-3.0.0.html "3.0.0 Release Note | IP Geo Block").
495
-
496
= 2.2.9.1 =
497
* **Bug fix:** Blocking Wordfence scanning.
498
([@](https://wordpress.org/support/topic/wordfence-conflict-2/ "WordFence Conflict"))
@@ -864,6 +835,68 @@ This is a maintenance release.
864
Malicious access can try to login only 5 times per IP address. This retry
865
counter can be reset to zero by `Clear statistics` on `Statistics` tab.
866
867
= 1.0.0 =
868
* Ready to release.
869
4
Tags: buddypress, bbPress, comment, pingback, trackback, spam, IP address, geo, geolocation, xmlrpc, login, wp-admin, admin, ajax, security, brute force, firewall, vulnerability
5
Requires at least: 3.7
6
Tested up to: 4.6.1
7
+ Stable tag: 2.2.9.1
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
11
+ It blocks any spams, login attempts and malicious access to the admin area
12
+ posted from the specific countries, and also prevents zero-day exploit.
13
14
== Description ==
15
16
+ There're some cases of a site being infected. The first one is the case that
17
+ contaminated files are uploaded via FTP or something. In this case, scaning
18
+ and verifing integrity of files in the site is needed to detect the infection.
19
20
+ The second one is cracking of the login username and password. In this case,
21
+ the rule of right is to strengthen the password.
22
23
+ The third one may be caused by malicious accesses to the core files. The major
24
+ issue in this case is that a plugin or theme in your site can potentially has
25
+ some vulnerability such as XSS, CSRF, SQLi, LFI and so on. For example, if a
26
+ plugin has Local File Inclusion (LFI) vulnerability, the attackers can easily
27
+ download the `wp-config.php` by simply hitting
28
+ [wp-admin/admin-ajax.php?action=show&file=../wp-config.php](http://blog.sucuri.net/2014/09/slider-revolution-plugin-critical-vulnerability-being-exploited.html "Slider Revolution Plugin Critical Vulnerability Being Exploited | Sucuri Blog")
29
+ on their browser instead of cracking username and password.
30
31
+ For these cases, the protection based on the IP address is not a perfect
32
+ solution for everyone. But for some site owners or some certain cases such
33
+ as 'zero-day attack', combination with the original feature 'Zero-day Exploit
34
+ Prevention' can reduce the risk of infection against the specific attacks.
35
+
36
+ That's why this plugin is here.
37
38
= Features =
39
40
+ This plugin will examine a country code based on the IP address. If a
41
+ comment, pingback or trackback comes from the specific country, it can be
42
+ blocked before Akismet validate it.
43
+
44
+ With the same mechanism, it fights against burst accesses by brute-force
45
+ and reverse-brute-force attacks to the login form and XML-RPC.
46
+
47
* **Immigration control:**
48
Access to the basic and important entrances into the back-end such as
49
`wp-comments-post.php`, `xmlrpc.php`, `wp-login.php`, `wp-signup.php`,
56
(WP-ZEP) is simple but still smart and strong enough to block any malicious
57
accesses to `wp-admin/*.php`, `plugins/*.php` and `themes/*.php` even from
58
the permitted countries. It will protect your site against certain types of
59
+ attack such as CSRF, LFI, SQLi, XSS and so on, **even if you have some
60
+ [vulnerable plugins or themes](https://wpvulndb.com/ "WPScan Vulnerability Database")
61
+ in your site**. Find more details in
62
[FAQ](https://wordpress.org/plugins/ip-geo-block/faq/ "IP Geo Block - WordPress Plugins")
63
and
64
[this plugin's blog](http://www.ipgeoblock.com/article/how-wpzep-works.html "How does WP-ZEP prevent zero-day attack? | IP Geo Block").
65
66
* **Guard against login attempts:**
67
+ In order to prevent the invasion through the login form and XML-RPC by
68
+ the brute-force and the reverse-brute-force attacks, the number of login
69
attempts will be limited per IP address even from the permitted countries.
70
71
* **Protection of wp-config.php:**
75
76
* ** Minimize server load against brute-force attacks:**
77
You can configure this plugin as a
78
+ [Must Use Plugins](https://codex.wordpress.org/Must_Use_Plugins "Must Use Plugins « WordPress Codex")
79
which would be loaded prior to regular plugins and can massively
80
+ [reduce the load on server](http://www.ipgeoblock.com/codex/validation-timing.html "Validation timing | IP Geo Block")
81
+ especially against brute-force attacks.
82
And furthermore, a cache mechanism for the fetched IP addresses and country
83
code can help to reduce load on the server against the burst accesses with
84
a short period of time.
98
99
* **Multiple source of IP Geolocation databases:**
100
Free IP Geolocation database and REST APIs are installed into this plugin to
101
+ get a country code from an IP address. There are two types of API which
102
+ support only IPv4 or both IPv4 and IPv6. This plugin will automatically
103
+ choose an appropriate API.
104
+
105
+ * **Database auto updater:**
106
+ [MaxMind](http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention")
107
GeoLite free databases and
108
+ [IP2Location](http://www.ip2location.com/ "IP Address Geolocation to Identify Website Visitor's Geographical Location")
109
+ LITE databases can be incorporated with this plugin. Those will be downloaded
110
and updated (once a month) automatically.
111
112
* **Customizing response:**
123
This plugin is simple and lite enough to be able to cooperate with other
124
full spec security plugin such as
125
[Wordfence Security](https://wordpress.org/plugins/wordfence/ "WordPress › Wordfence Security « WordPress Plugins")
126
+ (because the function of country bloking is available only for premium users).
127
128
* **Extendability:**
129
"Settings minimum, Customizability maximum" is the basic concept of this
136
137
* **Self blocking prevention and easy rescue:**
138
Most of users do not prefer themselves to be blocked. This plugin prevents
139
+ such a sad thing unless you force it.
140
+ ([release 2.1.4](http://www.ipgeoblock.com/changelog/release-2.1.4.html "2.1.4 Release Note"))
141
+ And futhermore, if such a situation occurs, you can rescue yourself easily.
142
+ ([release 2.1.3](http://www.ipgeoblock.com/changelog/release-2.1.3.html "2.1.3 Release Note"))
143
144
* **Clean uninstallation:**
145
Nothing is left in your precious mySQL database after uninstallation. So you
150
= Attribution =
151
152
This package includes GeoLite library distributed by MaxMind, available from
153
+ [MaxMind](http://www.maxmind.com "MaxMind - IP Geolocation and Online Fraud Prevention"),
154
and also includes IP2Location open source libraries available from
155
+ [IP2Location](http://www.ip2location.com "IP Address Geolocation to Identify Website Visitor's Geographical Location").
156
157
Also thanks for providing the following great services and REST APIs for free.
158
167
= Development =
168
169
Development of this plugin is promoted at
170
+ [WordPress-IP-Geo-Block](https://github.com/tokkonopapa/WordPress-IP-Geo-Block "tokkonopapa/WordPress-IP-Geo-Block - GitHub")
171
+ and class libraries to handle geo-location database for Maxmind and IP2Location
172
+ are developed separately as "add-in"s at
173
+ [WordPress-IP-Geo-API](https://github.com/tokkonopapa/WordPress-IP-Geo-API "tokkonopapa/WordPress-IP-Geo-API - GitHub").
174
All contributions will always be welcome. Or visit my
175
+ [development blog](http://www.ipgeoblock.com/ "IP Geo Block").
176
177
== Installation ==
178
182
2. Search for 'IP Geo Block'
183
3. Click 'Install Now'
184
4. Activate the plugin on the Plugin dashboard
185
186
= Validation rule settings =
187
222
Choose **"init" action hook** or **"mu-plugins" (ip-geo-block-mu.php)** to
223
specify the timing of validation.
224
225
+ = Validation target settings =
226
227
* **Comment post**
228
Validate post to `wp-comment-post.php`. Comment post and trackback will be
247
* **Themes area**
248
Validate direct access to themes. Typically `wp-content/themes/…/*.php`.
249
250
= Geolocation API settings =
251
252
* **API selection and key settings**
281
282
= Cache settings =
283
284
+ * **Number of entries**
285
+ Maximum number of IPs to be cached.
286
+
287
* **Expiration time [sec]**
288
Maximum time in sec to keep cache.
289
290
= Submission settings =
291
292
* **Text position on comment form**
309
310
`/**
311
* Invalidate blocking behavior in case yourself is locked out.
312
+ * @note: activate the following code and upload this file via FTP.
313
+ */ /* -- EDIT THIS LINE AND ACTIVATE THE FOLLOWING FUNCTION -- */
314
function ip_geo_block_emergency( $validate ) {
315
$validate['result'] = 'passed';
316
return $validate;
322
Then "**Clear cache**" at "**Statistics**" tab on your dashborad. Remember
323
that you should upload the original one to deactivate above feature.
324
325
+ [This release note](http://www.ipgeoblock.com/changelog/release-2.1.3.html "2.1.3 Release Note")
326
can also help you.
327
328
= How can I fix "Unable to write" error? =
340
"[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')"
341
in order to fix this error.
342
343
= Do I have to turn on all the selection to enhance security? =
344
345
Yes. Roughly speaking, the strategy of this plugin has been constructed as
357
- **Bad signatures in query**
358
It blocks the request which has not been covered in the above three.
359
360
+ See more details in
361
"[The best practice of target settings](http://www.ipgeoblock.com/codex/the-best-practice-of-target-settings.html 'The best practice of target settings | IP Geo Block')".
362
363
+ = Does this plugin validate all the requests to the server? =
364
365
Unfortunately, no. This plugin can't handle the requests that are not
366
parsed by WordPress. In other words, a standalone file (PHP, CGI or
367
something excutable) that is unrelated to WordPress can't be validated
368
+ by this plugin even if it is is in the WordPress install directory.
369
370
But there're exceptions: When you enable "**Force to load WP core**" for
371
**Plugins area** or **Themes area**, a standalone PHP file becomes to be
372
+ able to be blocked. Sometimes this kind of file in a plugin or theme has
373
+ vulnerability. This function is provided against such a case.
374
+
375
+ = How can I test this plugin works? =
376
+
377
+ The easiest way is to use
378
+ [free proxy browser addon](https://www.google.com/search?q=free+proxy+browser+addon "free proxy browser addon - Google Search").
379
+ Another one is to use
380
+ [http header browser addon](https://www.google.com/search?q=browser+add+on+modify+http+header "browser add on modify http header - Google Search").
381
+ You can add an IP address to the `X-Forwarded-For` header to emulate the
382
+ access behind the proxy. In this case, you should add `HTTP_X_FORWARDED_FOR`
383
+ into the "**$_SERVER keys for extra IPs**" on "**Settings**" tab.
384
+
385
+ See more details in
386
+ "[Using VPN browser addon](http://www.ipgeoblock.com/codex/using-vpn-browser-addon.html 'Using VPN browser addon | IP Geo Block')"
387
+ and
388
+ "[Using WordPress post simulator](http://www.ipgeoblock.com/codex/using-post-simulator.html 'Using WordPress post simulator | IP Geo Block')".
389
390
= Some admin function doesn't work when WP-ZEP is enabled. =
391
396
Another is the case related to the content type. This plugin will only support
397
`application/x-www-form-urlencoded` and `multipart/form-data`.
398
399
+ The other case is that a ajax/post request comes from not jQuery but flash or
400
something.
401
402
In those cases, this plugin should bypass WP-ZEP. So please find the unique
403
strings in the requested queries and add it into the safe query list via the
404
filter hook `ip-geo-block-bypass-admins`.
405
406
+ If you can not figure out your troubles, please let me know about the plugin
407
+ you are using at the support forum.
408
409
= Are there any other useful filter hooks? =
410
411
+ Yes, here is the list of all hooks to extend the feature of this plugin.
412
+
413
+ * `ip-geo-block-ip-addr` : IP address of accessor.
414
+ * `ip-geo-block-headers` : compose http request headers.
415
+ * `ip-geo-block-comment` : validate IP address at `wp-comments-post.php`.
416
+ * `ip-geo-block-xmlrpc` : validate IP address at `xmlrpc.php`.
417
+ * `ip-geo-block-login` : validate IP address at `wp-login.php`.
418
+ * `ip-geo-block-admin` : validate IP address at `wp-admin/*.php`.
419
+ * `ip-geo-block-extra-ips` : white/black list of extra IPs for prior validation.
420
+ * `ip-geo-block-xxxxxx-status` : http response status code for comment|xmlrpc|login|admin.
421
+ * `ip-geo-block-xxxxxx-reason` : http response reason for comment|xmlrpc|login|admin.
422
+ * `ip-geo-block-bypass-admins` : array of admin queries which should bypass WP-ZEP.
423
+ * `ip-geo-block-bypass-plugins` : array of plugin name which should bypass WP-ZEP.
424
+ * `ip-geo-block-bypass-themes` : array of theme name which should bypass WP-ZEP.
425
+ * `ip-geo-block-backup-dir` : full path where log files should be saved.
426
+ * `ip-geo-block-api-dir` : full path to the API class libraries and local DB files.
427
+ * `ip-geo-block-maxmind-dir` : full path where Maxmind GeoLite DB files should be saved.
428
+ * `ip-geo-block-maxmind-zip-ipv4` : url to Maxmind GeoLite DB zip file for IPv4.
429
+ * `ip-geo-block-maxmind-zip-ipv6` : url to Maxmind GeoLite DB zip file for IPv6.
430
+ * `ip-geo-block-ip2location-dir` : full path where IP2Location LITE DB files should be saved.
431
+ * `ip-geo-block-ip2location-path` : full path to IP2Location LITE DB file (IPv4).
432
+ * `ip-geo-block-record-logs` : change the condition of recording logs
433
+
434
+ For more details, see
435
+ [the documents](http://www.ipgeoblock.com/codex/ "Codex | IP Geo Block").
436
437
== Other Notes ==
438
445
* 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"),
446
`rel=nofollow` attribute and value pair had no longer be added to relative
447
or same domain links within `comment_content`. This change prevents to block
448
+ "Self Site Request Forgeries" (not Cross Site but a malicious link in the
449
comment field of own site).
450
451
+ * Wordfence makes an ajax request whose action is `wordfence_testAjax` using
452
+ `wp_remote_post()` and would receive 403 forbidden (it depends on your
453
+ configuration) when you enable "**Prevent Zero-day Exploit**" at "**Admin
454
+ ajax/post**". It does't affect its functionality because the response code
455
+ never be verified.
456
+
457
== Screenshots ==
458
459
1. **IP Geo Plugin** - Settings.
464
465
== Changelog ==
466
467
= 2.2.9.1 =
468
* **Bug fix:** Blocking Wordfence scanning.
469
([@](https://wordpress.org/support/topic/wordfence-conflict-2/ "WordFence Conflict"))
835
Malicious access can try to login only 5 times per IP address. This retry
836
counter can be reset to zero by `Clear statistics` on `Statistics` tab.
837
838
+ = 1.4.0 =
839
+ * **New feature:** Added a new class for recording the validation logs to
840
+ analyze posting pattern.
841
+ * Fixed an issue of not being set the own country code at first installation.
842
+ * Fixed an error which occurs when ip address is unknown.
843
+
844
+ = 1.3.1 =
845
+ * **New feature:** Added validation of trackback spam.
846
+ * Added `$_SERVER keys for extra IPs` into options to validate additional
847
+ IP addresses.
848
+ * Removed some redundant codes and corrected all PHP notices and warnings
849
+ which had been suppressed by WordPress.
850
+
851
+ = 1.3.0 =
852
+ * **New feature:** Added validation of pingback.ping through `xmlrpc.php` and
853
+ new option to validate all the IP addresses in HTTP_X_FORWARDED_FOR.
854
+ * **Fixed an issue:** Maxmind database file may be downloaded automatically
855
+ without deactivate/re-activate when upgrade is finished.
856
+ * This is the final version on 1.x. On next release, accesses to `login.php`
857
+ and admin area will be also validated for security purpose.
858
+
859
+ = 1.2.1 =
860
+ * **Fixed an issue:** Option table will be updated automatically without
861
+ deactivate/re-activate when this plugin is upgraded.
862
+ * **A little bit performance improvement:**
863
+ Less memory footprint at the time of downloading Maxmind database file.
864
+ Less sql queries when `Save statistics` is enabled.
865
+
866
+ = 1.2.0 =
867
+ * **New feature:** Added Maxmind GeoLite database auto downloader and updater.
868
+ * The filter hook `ip-geo-block-validate` was discontinued.
869
+ Instead of it, the new filter hook `ip-geo-block-comment` is introduced.
870
+ * **Performance improvement:** IP address is verified at an earlier stage
871
+ than before.
872
+ * **Others:** Fix a bug of handling cache, update status of some REST APIs.
873
+
874
+ = 1.1.1 =
875
+ * Fixed issue of default country code.
876
+ When activating this plugin for the first time, get the country code
877
+ from admin's IP address and set it into white list.
878
+ * Add number of calls in cache of IP address.
879
+
880
+ = 1.1.0 =
881
+ * Implement the cache mechanism to reduce load on the server.
882
+ * Better handling of errors on the search tab so as to facilitate the
883
+ analysis of the service problems.
884
+ * Fixed a bug of setting user agent strings in 1.0.2.
885
+ Now the user agent strings (`WordPress/3.9.2; http://example.com/`)
886
+ becomes to its own (`WordPress/3.9.2; ip-geo-block 1.1.0`).
887
+
888
+ = 1.0.3 =
889
+ * Temporarily stop setting user agent strings to supress a bug in 1.0.2.
890
+
891
+ = 1.0.2 =
892
+ * Update provider settings. Smart-IP.net was terminated, ipinfo.io is now
893
+ available for IPv6.
894
+ * Set the own user agent strings for `WP_Http`.
895
+
896
+ = 1.0.1 =
897
+ * Modify Plugin URL.
898
+ * Add `apply_filters()` to be able to change headers.
899
+
900
= 1.0.0 =
901
* Ready to release.
902
admin/class-ip-geo-block-admin.php CHANGED
@@ -157,15 +157,6 @@ class IP_Geo_Block_Admin {
157
'action' => 'ip_geo_block',
158
'url' => admin_url( 'admin-ajax.php' ),
159
'nonce' => IP_Geo_Block_Util::create_nonce( $this->get_ajax_action() ),
160
- 'msg' => array(
161
- __( 'Import settings ?', 'ip-geo-block' ),
162
- __( 'Create table ?', 'ip-geo-block' ),
163
- __( 'Delete table ?', 'ip-geo-block' ),
164
- __( 'Clear statistics ?', 'ip-geo-block' ),
165
- __( 'Clear cache ?', 'ip-geo-block' ),
166
- __( 'Clear logs ?', 'ip-geo-block' ),
167
- __( 'This feature is available with HTML5 compliant browsers.', 'ip-geo-block' ),
168
- ),
169
)
170
);
171
wp_enqueue_script( $handle );
@@ -217,7 +208,7 @@ class IP_Geo_Block_Admin {
217
/**
218
* Display global notice
219
*
220
- * Note: Sanitization should be done at the caller
221
*/
222
public function show_admin_notices() {
223
$key = IP_Geo_Block::PLUGIN_NAME . '-notice';
@@ -565,11 +556,11 @@ class IP_Geo_Block_Admin {
565
$default = IP_Geo_Block::get_default();
566
567
// checkboxes not on the form (added after 2.0.0, just in case)
568
- foreach ( array( 'anonymize', 'network_wide' ) as $key )
569
$output[ $key ] = 0;
570
571
// checkboxes not on the form
572
- foreach ( array( 'admin', 'ajax', 'plugins', 'themes', 'public' ) as $key )
573
$output['validation'][ $key ] = 0;
574
575
// restore the 'signature' that might be transformed to avoid self blocking
@@ -684,7 +675,7 @@ class IP_Geo_Block_Admin {
684
else {
685
$output[ $key ][ $sub ] = ( is_int( $default[ $key ][ $sub ] ) ?
686
(int)$input[ $key ][ $sub ] :
687
- IP_Geo_Block_Util::kses( trim( $input[ $key ][ $sub ] ), FALSE )
688
);
689
}
690
}
@@ -712,33 +703,12 @@ class IP_Geo_Block_Admin {
712
array_shift( $val );
713
$output['signature'] = preg_replace( $key, $val, trim( $output['signature'] ) );
714
715
- // 3.0.0 convert country code to upper case, remove redundant spaces
716
- $output['public']['ua_list'] = preg_replace( $key, $val, trim( $output['public']['ua_list'] ) );
717
- $output['public']['ua_list'] = preg_replace( '/([:#]) *([!]+) *([^ ]+) *([,\n]+)/', '$1$2$3$4', $output['public']['ua_list'] );
718
- $output['public']['ua_list'] = preg_replace_callback( '/[:#]\w+/', array( $this, 'strtoupper' ), $output['public']['ua_list'] );
719
-
720
// reject invalid signature which potentially blocks itself
721
$output['signature'] = implode( ',', $this->trim( $output['signature'] ) );
722
723
// 2.2.5 exception : convert associative array to simple array
724
- foreach ( array( 'plugins', 'themes' ) as $key ) {
725
$output['exception'][ $key ] = array_keys( $output['exception'][ $key ] );
726
- }
727
-
728
- // 3.0.0 public : convert country code to upper case
729
- foreach ( array( 'white_list', 'black_list' ) as $key ) {
730
- $output['public'][ $key ] = strtoupper( preg_replace( '/\s/', '', $output['public'][ $key ] ) );
731
- }
732
-
733
- // 3.0.0 exception : trim extra space and comma
734
- foreach ( array( 'admin', 'public', 'includes', 'uploads', 'languages' ) as $key ) {
735
- if ( empty( $output['exception'][ $key ] ) ) {
736
- $output['exception'][ $key ] = $default['exception'][ $key ];
737
- } else {
738
- $output['exception'][ $key ] = ( is_array( $output['exception'][ $key ] ) ?
739
- $output['exception'][ $key ] : $this->trim( $output['exception'][ $key ] ) );
740
- }
741
- }
742
743
return $output;
744
}
@@ -892,7 +862,7 @@ class IP_Geo_Block_Admin {
892
893
case 'clear-logs':
894
// Delete logs in MySQL DB
895
- $hook = array( 'comment', 'login', 'admin', 'xmlrpc', 'public' );
896
$which = in_array( $which, $hook ) ? $which : NULL;
897
IP_Geo_Block_Logs::clear_logs( $which );
898
$res = array(
157
'action' => 'ip_geo_block',
158
'url' => admin_url( 'admin-ajax.php' ),
159
'nonce' => IP_Geo_Block_Util::create_nonce( $this->get_ajax_action() ),
160
)
161
);
162
wp_enqueue_script( $handle );
208
/**
209
* Display global notice
210
*
211
+ * @notice: Sanitization should be done at the caller
212
*/
213
public function show_admin_notices() {
214
$key = IP_Geo_Block::PLUGIN_NAME . '-notice';
556
$default = IP_Geo_Block::get_default();
557
558
// checkboxes not on the form (added after 2.0.0, just in case)
559
+ foreach ( array( 'anonymize' ) as $key )
560
$output[ $key ] = 0;
561
562
// checkboxes not on the form
563
+ foreach ( array( 'admin', 'ajax', 'plugins', 'themes' ) as $key )
564
$output['validation'][ $key ] = 0;
565
566
// restore the 'signature' that might be transformed to avoid self blocking
675
else {
676
$output[ $key ][ $sub ] = ( is_int( $default[ $key ][ $sub ] ) ?
677
(int)$input[ $key ][ $sub ] :
678
+ IP_Geo_Block_Util::kses( preg_replace( '/[^-,:!*#+=\.\/\w\s]/', '', $input[ $key ][ $sub ] ), FALSE )
679
);
680
}
681
}
703
array_shift( $val );
704
$output['signature'] = preg_replace( $key, $val, trim( $output['signature'] ) );
705
706
// reject invalid signature which potentially blocks itself
707
$output['signature'] = implode( ',', $this->trim( $output['signature'] ) );
708
709
// 2.2.5 exception : convert associative array to simple array
710
+ foreach ( array( 'plugins', 'themes' ) as $key )
711
$output['exception'][ $key ] = array_keys( $output['exception'][ $key ] );
712
713
return $output;
714
}
862
863
case 'clear-logs':
864
// Delete logs in MySQL DB
865
+ $hook = array( 'comment', 'login', 'admin', 'xmlrpc' );
866
$which = in_array( $which, $hook ) ? $which : NULL;
867
IP_Geo_Block_Logs::clear_logs( $which );
868
$res = array(
admin/css/admin.css CHANGED
@@ -57,13 +57,13 @@ textarea.regular-text {
57
}
58
59
ul.ip_geo_block_settings_folding {
60
- margin: 0.5em 0;
61
}
62
ul.ip_geo_block_settings_folding ul {
63
margin-bottom: 0;
64
}
65
ul.ip_geo_block_settings_folding li:first-child {
66
- margin-top: 0.5em;
67
}
68
.folding-disable {
69
pointer-events: none;
@@ -74,10 +74,6 @@ ul.ip_geo_block_settings_folding li:first-child {
74
font-style:oblique !important;
75
}
76
77
- .ip-geo-block-hide {
78
- display: none;
79
- }
80
-
81
.ip-geo-block-sup {
82
margin-left: 0.2em;
83
display: inline-block;
@@ -301,10 +297,6 @@ table.ip-geo-block-table {
301
word-wrap: break-word;
302
word-break: break-all;
303
}
304
- input#ip_geo_block_settings_filter_logs {
305
- width: 16em;
306
- padding-top: 3px;
307
- }
308
309
/* Scan the country code */
310
#ip-geo-block-scan-code {
57
}
58
59
ul.ip_geo_block_settings_folding {
60
+ margin: 0.3em 0;
61
}
62
ul.ip_geo_block_settings_folding ul {
63
margin-bottom: 0;
64
}
65
ul.ip_geo_block_settings_folding li:first-child {
66
+ margin-top: 0.6em;
67
}
68
.folding-disable {
69
pointer-events: none;
74
font-style:oblique !important;
75
}
76
77
.ip-geo-block-sup {
78
margin-left: 0.2em;
79
display: inline-block;
297
word-wrap: break-word;
298
word-break: break-all;
299
}
300
301
/* Scan the country code */
302
#ip-geo-block-scan-code {
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}.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-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-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-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:.3em 0}ul.ip_geo_block_settings_folding ul{margin-bottom:0}ul.ip_geo_block_settings_folding li:first-child{margin-top:.6em}.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}.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}#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-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)}
admin/css/fonts/LICENSE DELETED
@@ -1,4 +0,0 @@
1
- Copyright 2012 Steven Usher & Brad Vincent
2
-
3
- Released under the MIT license
4
- You are free to use FooTable in commercial projects as long as this copyright header is left intact.
admin/css/footable.core.min.css CHANGED
@@ -1,10 +1 @@
1
- /*!
2
- * FooTable - Awesome Responsive Tables
3
- * Version : 2.0.3
4
- * http://fooplugins.com/plugins/footable-jquery/
5
- *
6
- * Copyright 2014 Steven Usher & Brad Vincent
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:#f7f7f7}
1
@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:#f7f7f7}
admin/includes/class-admin-ajax.php CHANGED
@@ -238,10 +238,8 @@ class IP_Geo_Block_Admin_Ajax {
238
'[extra_ips][white_list]',
239
'[extra_ips][black_list]',
240
'[signature]',
241
- '[login_fails]',
242
'[response_code]',
243
- '[response_msg]', // 3.0.0
244
- '[redirect_uri]', // 3.0.0
245
'[validation][timing]', // 2.2.9
246
'[validation][proxy]',
247
'[validation][comment]',
@@ -258,32 +256,10 @@ class IP_Geo_Block_Admin_Ajax {
258
'[validation][ajax][2]',
259
'[validation][plugins]',
260
'[validation][themes]',
261
- '[validation][includes]', // 3.0.0
262
- '[validation][uploads]', // 3.0.0
263
- '[validation][languages]', // 3.0.0
264
- '[validation][public]', // 3.0.0
265
'[rewrite][plugins]',
266
'[rewrite][themes]',
267
- '[rewrite][includes]', // 3.0.0
268
- '[rewrite][uploads]', // 3.0.0
269
- '[rewrite][languages]', // 3.0.0
270
'[exception][plugins][*]', // 2.2.5
271
'[exception][themes][*]', // 2.2.5
272
- '[exception][admin][$]', // 3.0.0
273
- '[exception][public][$]', // 3.0.0
274
- '[exception][includes][$]', // 3.0.0
275
- '[exception][uploads][$]', // 3.0.0
276
- '[exception][languages][$]', // 3.0.0
277
- '[public][matching_rule]', // 3.0.0
278
- '[public][white_list]', // 3.0.0
279
- '[public][black_list]', // 3.0.0
280
- '[public][target_rule]', // 3.0.0
281
- '[public][target_pages][$]', // 3.0.0
282
- '[public][target_posts][$]', // 3.0.0
283
- '[public][target_cates][$]', // 3.0.0
284
- '[public][target_tags][$]', // 3.0.0
285
- '[public][ua_list]', // 3.0.0
286
- '[public][simulate]', // 3.0.0
287
'[providers][Maxmind]',
288
'[providers][IP2Location]',
289
'[providers][freegeoip.net]',
@@ -301,14 +277,12 @@ class IP_Geo_Block_Admin_Ajax {
301
'[validation][postkey]',
302
'[update][auto]',
303
'[anonymize]',
304
- '[cache_time_gc]', // 3.0.0
305
'[cache_hold]',
306
'[cache_time]',
307
'[comment][pos]',
308
'[comment][msg]',
309
'[clean_uninstall]',
310
'[api_key][GoogleMap]', // 2.2.7
311
- '[network_wide]', // 3.0.0
312
);
313
$json = array();
314
$prfx = IP_Geo_Block::OPTION_NAME;
@@ -343,7 +317,7 @@ class IP_Geo_Block_Admin_Ajax {
343
foreach ( $input[ $m[1] ][ $m[2] ] as $val ) {
344
$json[ $prfx.'['.$m[1].']['.$m[2].']'.'['.$val.']' ] = 1;
345
}
346
- } elseif ( is_array( $input[ $m[1] ][ $m[2] ] ) ) {
347
$json[ $prfx.'['.$m[1].']['.$m[2].']' ] = implode( ',', $input[ $m[1] ][ $m[2] ] );
348
}
349
}
238
'[extra_ips][white_list]',
239
'[extra_ips][black_list]',
240
'[signature]',
241
'[response_code]',
242
+ '[login_fails]',
243
'[validation][timing]', // 2.2.9
244
'[validation][proxy]',
245
'[validation][comment]',
256
'[validation][ajax][2]',
257
'[validation][plugins]',
258
'[validation][themes]',
259
'[rewrite][plugins]',
260
'[rewrite][themes]',
261
'[exception][plugins][*]', // 2.2.5
262
'[exception][themes][*]', // 2.2.5
263
'[providers][Maxmind]',
264
'[providers][IP2Location]',
265
'[providers][freegeoip.net]',
277
'[validation][postkey]',
278
'[update][auto]',
279
'[anonymize]',
280
'[cache_hold]',
281
'[cache_time]',
282
'[comment][pos]',
283
'[comment][msg]',
284
'[clean_uninstall]',
285
'[api_key][GoogleMap]', // 2.2.7
286
);
287
$json = array();
288
$prfx = IP_Geo_Block::OPTION_NAME;
317
foreach ( $input[ $m[1] ][ $m[2] ] as $val ) {
318
$json[ $prfx.'['.$m[1].']['.$m[2].']'.'['.$val.']' ] = 1;
319
}
320
+ } else {
321
$json[ $prfx.'['.$m[1].']['.$m[2].']' ] = implode( ',', $input[ $m[1] ][ $m[2] ] );
322
}
323
}
admin/includes/tab-accesslog.php CHANGED
@@ -24,23 +24,6 @@ if ( $settings['validation']['reclogs'] ) :
24
$option_slug
25
);
26
27
- // footable filter
28
- $field = 'filter_logs';
29
- add_settings_field(
30
- $option_name.'_'.$field,
31
- __( 'Filter logs', 'ip-geo-block' ),
32
- array( $context, 'callback_field' ),
33
- $option_slug,
34
- $section,
35
- array(
36
- 'type' => 'text',
37
- 'option' => $option_name,
38
- 'field' => $field,
39
- 'value' => '',
40
- 'after' => '<a class="button button-secondary" id="ip-geo-block-reset-filter" title="' . __( 'Reset', 'ip-geo-block' ) . '" href="javascript:void(0)">'. __( 'Reset', 'ip-geo-block' ) . '</a>',
41
- )
42
- );
43
-
44
$field = 'clear_logs';
45
add_settings_field(
46
$option_name.'_'.$field,
@@ -112,12 +95,11 @@ endif;
112
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
113
'login' => sprintf( $dfn, 'wp-login.php', __( 'Login form', 'ip-geo-block' ) ),
114
'admin' => sprintf( $dfn, 'wp-admin/*.php', __( 'Admin area', 'ip-geo-block' ) ),
115
- 'public' => sprintf( $dfn, 'public facing pages', __( 'Pubic facing pages', 'ip-geo-block' ) ),
116
);
117
118
foreach ( $target as $key => $val ) {
119
echo '<h4>', $val, '</h4>', "\n";
120
- 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"><thead><tr>', "\n";
121
echo '<th data-type="numeric">', __( 'Date', 'ip-geo-block' ), '</th>', "\n";
122
echo '<th>', __( 'IP address', 'ip-geo-block' ), '</th>', "\n";
123
echo '<th>', __( 'Code', 'ip-geo-block' ), '</th>', "\n";
24
$option_slug
25
);
26
27
$field = 'clear_logs';
28
add_settings_field(
29
$option_name.'_'.$field,
95
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
96
'login' => sprintf( $dfn, 'wp-login.php', __( 'Login form', 'ip-geo-block' ) ),
97
'admin' => sprintf( $dfn, 'wp-admin/*.php', __( 'Admin area', 'ip-geo-block' ) ),
98
);
99
100
foreach ( $target as $key => $val ) {
101
echo '<h4>', $val, '</h4>', "\n";
102
+ echo '<table class="fixed ', IP_Geo_Block::PLUGIN_NAME, '-log" data-page-size="10" data-limit-navigation="5"><thead><tr>', "\n";
103
echo '<th data-type="numeric">', __( 'Date', 'ip-geo-block' ), '</th>', "\n";
104
echo '<th>', __( 'IP address', 'ip-geo-block' ), '</th>', "\n";
105
echo '<th>', __( 'Code', 'ip-geo-block' ), '</th>', "\n";
admin/includes/tab-settings.php CHANGED
@@ -247,54 +247,21 @@ class IP_Geo_Block_Admin_Tab {
247
'value' => $options[ $field ],
248
'list' => array(
249
200 => '200 OK',
250
301 => '301 Moved Permanently',
251
302 => '302 Found',
252
- 303 => '303 See Other',
253
307 => '307 Temporary Redirect',
254
400 => '400 Bad Request',
255
403 => '403 Forbidden',
256
404 => '404 Not Found',
257
406 => '406 Not Acceptable',
258
500 => '500 Internal Server Error',
259
503 => '503 Service Unavailable',
260
),
261
)
262
);
263
264
- // Redirect URI
265
- $field = 'redirect_uri';
266
- add_settings_field(
267
- $option_name.'_'.$field,
268
- __( '<dfn title="Specify the URL for response code 2xx and 3xx. Front-end URL on your site would not be blocked to prevent loop of redirection even when you enable [Front-end target settings]. Empty URL is altered to your home.">Redirect URL</dfn>', 'ip-geo-block' ),
269
- array( $context, 'callback_field' ),
270
- $option_slug,
271
- $section,
272
- array(
273
- 'class' => 'ip-geo-block-hide',
274
- 'type' => 'text',
275
- 'option' => $option_name,
276
- 'field' => $field,
277
- 'value' => $options[ $field ],
278
- )
279
- );
280
-
281
- // Response message
282
- $field = 'response_msg';
283
- add_settings_field(
284
- $option_name.'_'.$field,
285
- __( '<dfn title="Specify the message for response code 4xx and 5xx.">Response message</dfn>', 'ip-geo-block' ),
286
- array( $context, 'callback_field' ),
287
- $option_slug,
288
- $section,
289
- array(
290
- 'class' => 'ip-geo-block-hide',
291
- 'type' => 'text',
292
- 'option' => $option_name,
293
- 'field' => $field,
294
- 'value' => $options[ $field ],
295
- )
296
- );
297
-
298
// Max number of failed login attempts per IP address
299
$field = 'login_fails';
300
add_settings_field(
@@ -349,12 +316,12 @@ class IP_Geo_Block_Admin_Tab {
349
);
350
351
/*----------------------------------------*
352
- * Back-end target settings
353
*----------------------------------------*/
354
$section = $plugin_slug . '-validation-target';
355
add_settings_section(
356
$section,
357
- __( 'Back-end target settings', 'ip-geo-block' ),
358
array( __CLASS__, 'note_target' ),
359
$option_slug
360
);
@@ -366,8 +333,6 @@ class IP_Geo_Block_Admin_Tab {
366
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
367
'login' => sprintf( $dfn, 'wp-login.php', __( 'Login form', 'ip-geo-block' ) ),
368
'admin' => sprintf( $dfn, 'wp-admin/*.php', __( 'Admin area', 'ip-geo-block' ) ),
369
- 'others' => sprintf( $dfn, 'executable files', __( 'Other areas', 'ip-geo-block' ) ),
370
- 'public' => sprintf( $dfn, 'public facing pages', __( 'Pubic facing pages', 'ip-geo-block' ) ),
371
);
372
373
// Comment post
@@ -447,7 +412,6 @@ class IP_Geo_Block_Admin_Tab {
447
1 => __( 'Block by country', 'ip-geo-block' ),
448
2 => __( 'Prevent Zero-day Exploit', 'ip-geo-block' ),
449
);
450
-
451
$desc = array(
452
1 => __( 'It will block a request related to the services for both public facing pages and the dashboard.', 'ip-geo-block' ),
453
2 => __( 'Regardless of the country code, it will block a malicious request related to the services only for the dashboard.', 'ip-geo-block' ),
@@ -492,25 +456,6 @@ class IP_Geo_Block_Admin_Tab {
492
)
493
);
494
495
- if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
496
- // Excluded request for specific action or page to bypass WP-ZEP
497
- $key = 'admin';
498
- add_settings_field(
499
- $option_name.'_exception_'.$key,
500
- __( 'Exception for admin action and page', 'ip-geo-block' ),
501
- array( $context, 'callback_field' ),
502
- $option_slug,
503
- $section,
504
- array(
505
- 'type' => 'text',
506
- 'option' => $option_name,
507
- 'field' => 'exception',
508
- 'sub-field' => $key,
509
- 'value' => implode( ',', $options['exception'][ $key ] ),
510
- )
511
- );
512
- endif;
513
-
514
array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
515
$desc = array(
516
__( 'Regardless of the country code, it will block a malicious request to <code>%s&hellip;/*.php</code>.', 'ip-geo-block' ),
@@ -631,220 +576,6 @@ endif;
631
)
632
);
633
634
- /*----------------------------------------*
635
- * Front-end settings
636
- *----------------------------------------*/
637
- $section = $plugin_slug . '-public';
638
- add_settings_section(
639
- $section,
640
- __( 'Front-end target settings', 'ip-geo-block' ),
641
- array( __CLASS__, 'note_public' ),
642
- $option_slug
643
- );
644
-
645
- // Public facing pages
646
- $key = 'public';
647
- add_settings_field(
648
- $option_name.'_'.$field.'_'.$key,
649
- $target[ $key ],
650
- array( $context, 'callback_field' ),
651
- $option_slug,
652
- $section,
653
- array(
654
- 'type' => 'checkbox',
655
- 'option' => $option_name,
656
- 'field' => $field,
657
- 'sub-field' => $key,
658
- 'value' => $options[ $field ][ $key ],
659
- 'text' => __( 'Block by country', 'ip-geo-block' ),
660
- )
661
- );
662
-
663
- // Default for matching rule on front-end
664
- $rule[-1] = __( 'Follow &#8220;Validation rule settings&#8221;', 'ip-geo-block' );
665
-
666
- // Matching rule
667
- $field = 'public';
668
- $key = 'matching_rule';
669
- add_settings_field(
670
- $option_name.'_'.$field.'_'.$key,
671
- '<dfn title="' . $rule_desc[0] . '">' . __( 'Matching rule', 'ip-geo-block' ) . '</dfn>',
672
- array( $context, 'callback_field' ),
673
- $option_slug,
674
- $section,
675
- array(
676
- 'type' => 'select',
677
- 'option' => $option_name,
678
- 'field' => $field,
679
- 'sub-field' => $key,
680
- 'value' => $options[ $field ][ $key ],
681
- 'list' => $rule,
682
- )
683
- );
684
-
685
- // Country code for matching rule (ISO 3166-1 alpha-2)
686
- $key = 'white_list';
687
- add_settings_field(
688
- $option_name.'_'.$field.'_'.$key,
689
- $rule_desc[1],
690
- array( $context, 'callback_field' ),
691
- $option_slug,
692
- $section,
693
- array(
694
- 'type' => 'text',
695
- 'option' => $option_name,
696
- 'field' => $field,
697
- 'sub-field' => $key,
698
- 'value' => $options[ $field ][ $key ],
699
- 'after' => $comma[0],
700
- )
701
- );
702
-
703
- $key = 'black_list';
704
- add_settings_field(
705
- $option_name.'_'.$field.'_'.$key,
706
- $rule_desc[2],
707
- array( $context, 'callback_field' ),
708
- $option_slug,
709
- $section,
710
- array(
711
- 'type' => 'text',
712
- 'option' => $option_name,
713
- 'field' => $field,
714
- 'sub-field' => $key,
715
- 'value' => $options[ $field ][ $key ],
716
- 'after' => $comma[0],
717
- )
718
- );
719
-
720
- // List of page
721
- $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' ) . "<li style='display:none'><ul>\n";
722
- $tmp = get_pages();
723
- if ( ! empty( $tmp ) ) {
724
- foreach ( $tmp as $key ) {
725
- $val = esc_attr( $key->post_name );
726
- $exception .= '<li><input type="checkbox" id="ip_geo_block_settings_public_target_pages_' . $val . '" name="ip_geo_block_settings[public][target_pages][' . $val . ']" value="1"' . checked( isset( $options[ $field ]['target_pages'][ $val ] ), TRUE, FALSE ) . ' />';
727
- $exception .= '<label for="ip_geo_block_settings_public_target_pages_' . $val . '">' . esc_html( $key->post_title ) . '</label></li>' . "\n";
728
- }
729
- }
730
- $exception .= '</ul></li></ul>' . "\n";
731
-
732
- // List of post type
733
- $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' ) . "<li style='display:none'><ul>\n";
734
- $tmp = get_post_types( array( 'public' => TRUE ) );
735
- if ( ! empty( $tmp ) ) {
736
- foreach ( $tmp as $key ) {
737
- $val = esc_attr( $key );
738
- $exception .= '<li><input type="checkbox" id="ip_geo_block_settings_public_target_posts_' . $val . '" name="ip_geo_block_settings[public][target_posts][' . $val . ']" value="1"' . checked( isset( $options[ $field ]['target_posts'][ $val ] ), TRUE, FALSE ) . ' />';
739
- $exception .= '<label for="ip_geo_block_settings_public_target_posts_' . $val . '">' . esc_html( $key ) . '</label></li>' . "\n";
740
- }
741
- }
742
- $exception .= '</ul></li></ul>' . "\n";
743
-
744
- // List of category
745
- $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' ) . "<li style='display:none'><ul>\n";
746
- $tmp = get_categories( array( 'hide_empty' => FALSE ) );
747
- if ( ! empty( $tmp ) ) {
748
- foreach ( $tmp as $key ) {
749
- $val = esc_attr( $key->slug );
750
- $exception .= '<li><input type="checkbox" id="ip_geo_block_settings_public_target_cates_' . $val . '" name="ip_geo_block_settings[public][target_cates][' . $val . ']" value="1"' . checked( isset( $options[ $field ]['target_cates'][ $val ] ), TRUE, FALSE ) . ' />';
751
- $exception .= '<label for="ip_geo_block_settings_public_target_cates_' . $val . '">' . esc_html( $key->name ) . '</label></li>' . "\n";
752
- }
753
- }
754
- $exception .= '</ul></li></ul>' . "\n";
755
-
756
- // List of tag
757
- $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' ) . "<li style='display:none'><ul>\n";
758
- $tmp = get_tags( array( 'hide_empty' => FALSE ) );
759
- if ( ! empty( $tmp ) ) {
760
- foreach ( $tmp as $key ) {
761
- $val = esc_attr( $key->slug );
762
- $exception .= '<li><input type="checkbox" id="ip_geo_block_settings_public_target_tags_' . $val . '" name="ip_geo_block_settings[public][target_tags][' . $val . ']" value="1"' . checked( isset( $options[ $field ]['target_tags'][ $val ] ), TRUE, FALSE ) . ' />';
763
- $exception .= '<label for="ip_geo_block_settings_public_target_tags_' . $val . '">' . esc_html( $key->name ) . '</label></li>' . "\n";
764
- }
765
- }
766
- $exception .= '</ul></li></ul>' . "\n";
767
-
768
- // Validation target
769
- $key = 'target_rule';
770
- add_settings_field(
771
- $option_name.'_'.$field.'_'.$key,
772
- '<dfn title="' . __( 'Specify the validation target on front-end.', 'ip-geo-block' ) . '">' . __( 'Validation target', 'ip-geo-block' ) . '</dfn>',
773
- array( $context, 'callback_field' ),
774
- $option_slug,
775
- $section,
776
- array(
777
- 'type' => 'select',
778
- 'option' => $option_name,
779
- 'field' => $field,
780
- 'sub-field' => $key,
781
- 'value' => $options[ $field ][ $key ],
782
- 'list' => array(
783
- 0 => __( 'All requests', 'ip-geo-block' ),
784
- 1 => __( 'Specify the targets', 'ip-geo-block' ),
785
- ),
786
- 'desc' => array(
787
- 1 => __( "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;wp&#8221; action hook. It means that this feature would not be compatible with any page caching.", 'ip-geo-block' ),
788
- ),
789
- 'after' => '<div class="ip-geo-block-desc"></div>' . "\n" . $exception,
790
- )
791
- );
792
-
793
- // UA string and qualification
794
- $key = 'ua_list';
795
- add_settings_field(
796
- $option_name.'_'.$field.'_'.$key,
797
- '<dfn title="' . __( 'A part of user agent string and a qualification connected with a separator that indicates an applicable rule and can be &#8220;:&#8221; (pass) or &#8220;#&#8221; (block). A &#8220;qualification&#8221; can be &#8220;DNS&#8221;, &#8220;FEED&#8221;, country code or IP address with CIDR. A negative operator &#8220;!&#8221; can be placed just before a &#8220;qualification&#8221;.', 'ip-geo-block' ) . '">' . __( 'UA string and qualification', 'ip-geo-block' ) . '</dfn>',
798
- array( $context, 'callback_field' ),
799
- $option_slug,
800
- $section,
801
- array(
802
- 'type' => 'textarea',
803
- 'option' => $option_name,
804
- 'field' => $field,
805
- 'sub-field' => $key,
806
- 'value' => $options[ $field ][ $key ],
807
- 'after' => $comma[1],
808
- )
809
- );
810
-
811
- if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
812
- // Excluded action
813
- $key = 'exception';
814
- add_settings_field(
815
- $option_name.'_'.$key.'_'.$field,
816
- '<dfn title="' . __( 'Specify the name of action that is invariably blocked.', 'ip-geo-block' ) . '">' . __( 'Excluded actions', 'ip-geo-block' ) . '</dfn>',
817
- array( $context, 'callback_field' ),
818
- $option_slug,
819
- $section,
820
- array(
821
- 'type' => 'text',
822
- 'option' => $option_name,
823
- 'field' => $key,
824
- 'sub-field' => $field,
825
- 'value' => implode( ',', $options[ $key ][ $field ] ),
826
- 'after' => $comma[0],
827
- )
828
- );
829
- endif;
830
-
831
- // Simulation mode
832
- $key = 'simulate';
833
- add_settings_field(
834
- $option_name.'_'.$field.'_'.$key,
835
- '<dfn title="' . __( 'It enables to simulate validation without deployment. The results can be found at &#8220;Pubic facing pages&#8221; in Logs.', 'ip-geo-block' ) . '">' . __( 'Simulation mode', 'ip-geo-block' ) . '</dfn>',
836
- array( $context, 'callback_field' ),
837
- $option_slug,
838
- $section,
839
- array(
840
- 'type' => 'checkbox',
841
- 'option' => $option_name,
842
- 'field' => $field,
843
- 'sub-field' => $key,
844
- 'value' => $options[ $field ][ $key ],
845
- )
846
- );
847
-
848
/*----------------------------------------*
849
* Geolocation service settings
850
*----------------------------------------*/
@@ -1072,7 +803,7 @@ endif;
1072
$section = $plugin_slug . '-cache';
1073
add_settings_section(
1074
$section,
1075
- __( 'IP address cache settings', 'ip-geo-block' ),
1076
NULL,
1077
$option_slug
1078
);
@@ -1093,23 +824,6 @@ endif;
1093
)
1094
);
1095
1096
- // Garbage collection period [sec]
1097
- $field = 'cache_time_gc';
1098
- add_settings_field(
1099
- $option_name.'_'.$field,
1100
- __( 'Garbage collection period [sec]', 'ip-geo-block' ),
1101
- array( $context, 'callback_field' ),
1102
- $option_slug,
1103
- $section,
1104
- array(
1105
- 'type' => 'text',
1106
- 'option' => $option_name,
1107
- 'field' => $field,
1108
- 'value' => $options[ $field ],
1109
- )
1110
- );
1111
-
1112
- if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1113
// Number of entries
1114
$field = 'cache_hold';
1115
add_settings_field(
@@ -1125,7 +839,6 @@ if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1125
'value' => $options[ $field ],
1126
)
1127
);
1128
- endif;
1129
1130
/*----------------------------------------*
1131
* Submission settings
@@ -1195,7 +908,8 @@ endif;
1195
// Google Maps API key
1196
$field = 'api_key';
1197
$key = 'GoogleMap';
1198
- if ( 'default' !== $options[ $field ][ $key ] or defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ) {
1199
add_settings_field(
1200
$option_name.'_'.$field,
1201
__( '<dfn title="Valid key for Google Maps JavaScript API">Google Maps API key</dfn>', 'ip-geo-block' ),
@@ -1305,12 +1019,4 @@ endif;
1305
'</ul>', "\n";
1306
}
1307
1308
- public static function note_public() {
1309
- echo
1310
- '<ul class="ip-geo-block-note">', "\n",
1311
- '<li>', __( 'Please refer to the document &#8220;<a href="http://www.ipgeoblock.com/codex/#blocking-on-front-end" title="Codex | IP Geo Block" target=_blank>Blocking on front-end</a>&#8221; for details, including restrictions on cache plugin.', 'ip-geo-block' ), '</li>', "\n",
1312
- '<li>', __( 'If you find any issues or have something to suggest, please feel free to open an issue at <a class="ip-geo-block-link" href="http://wordpress.org/support/plugin/ip-geo-block" title="WordPress &#8250; Support &raquo; IP Geo Block" target=_blank>support forum</a>.', 'ip-geo-block' ), '</li>', "\n",
1313
- '</ul>', "\n";
1314
- }
1315
-
1316
}
247
'value' => $options[ $field ],
248
'list' => array(
249
200 => '200 OK',
250
+ 205 => '205 Reset Content',
251
301 => '301 Moved Permanently',
252
302 => '302 Found',
253
307 => '307 Temporary Redirect',
254
400 => '400 Bad Request',
255
403 => '403 Forbidden',
256
404 => '404 Not Found',
257
406 => '406 Not Acceptable',
258
+ 410 => '410 Gone',
259
500 => '500 Internal Server Error',
260
503 => '503 Service Unavailable',
261
),
262
)
263
);
264
265
// Max number of failed login attempts per IP address
266
$field = 'login_fails';
267
add_settings_field(
316
);
317
318
/*----------------------------------------*
319
+ * Validation target settings
320
*----------------------------------------*/
321
$section = $plugin_slug . '-validation-target';
322
add_settings_section(
323
$section,
324
+ __( 'Validation target settings', 'ip-geo-block' ),
325
array( __CLASS__, 'note_target' ),
326
$option_slug
327
);
333
'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
334
'login' => sprintf( $dfn, 'wp-login.php', __( 'Login form', 'ip-geo-block' ) ),
335
'admin' => sprintf( $dfn, 'wp-admin/*.php', __( 'Admin area', 'ip-geo-block' ) ),
336
);
337
338
// Comment post
412
1 => __( 'Block by country', 'ip-geo-block' ),
413
2 => __( 'Prevent Zero-day Exploit', 'ip-geo-block' ),
414
);
415
$desc = array(
416
1 => __( 'It will block a request related to the services for both public facing pages and the dashboard.', 'ip-geo-block' ),
417
2 => __( 'Regardless of the country code, it will block a malicious request related to the services only for the dashboard.', 'ip-geo-block' ),
456
)
457
);
458
459
array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
460
$desc = array(
461
__( 'Regardless of the country code, it will block a malicious request to <code>%s&hellip;/*.php</code>.', 'ip-geo-block' ),
576
)
577
);
578
579
/*----------------------------------------*
580
* Geolocation service settings
581
*----------------------------------------*/
803
$section = $plugin_slug . '-cache';
804
add_settings_section(
805
$section,
806
+ __( 'Cache settings', 'ip-geo-block' ),
807
NULL,
808
$option_slug
809
);
824
)
825
);
826
827
// Number of entries
828
$field = 'cache_hold';
829
add_settings_field(
839
'value' => $options[ $field ],
840
)
841
);
842
843
/*----------------------------------------*
844
* Submission settings
908
// Google Maps API key
909
$field = 'api_key';
910
$key = 'GoogleMap';
911
+ if ( 'default' !== $options[ $field ][ $key ] or
912
+ defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ) {
913
add_settings_field(
914
$option_name.'_'.$field,
915
__( '<dfn title="Valid key for Google Maps JavaScript API">Google Maps API key</dfn>', 'ip-geo-block' ),
1019
'</ul>', "\n";
1020
}
1021
1022
}
admin/includes/tab-statistics.php CHANGED
@@ -73,7 +73,7 @@ if ( $options['save_statistics'] ) :
73
$html = '<div id="'.$plugin_slug.'-chart-daily"><table id="'.$plugin_slug.'-targets">';
74
75
$prev = 0;
76
- $targets = array( 'comment', 'xmlrpc', 'login', 'admin', 'public' );
77
foreach ( $statistics['daystats'] as $key => $val ) {
78
while( $prev && $key - $prev > DAY_IN_SECONDS ) {
79
$prev += DAY_IN_SECONDS;
@@ -226,19 +226,21 @@ endif;
226
foreach ( $cache as $key => $val ) {
227
if ( $options['anonymize'] )
228
$key = preg_replace( '/\d{1,3}#x2F;', '***', $key );
229
- $html .= '<tr><td>' . esc_html( $key ) . '</td>';
230
- $html .= '<td>' . esc_html( $val['code'] ) . ' / ';
231
- $html .= '<small>' . esc_html( $val['hook'] ) . '</small></td>';
232
- $html .= '<td>' . ( $time - (int)$val['time'] ) . ' / ';
233
- $html .= $options['save_statistics'] ? (int)$val['call'] : '-';
234
- if ( $debug ) {
235
- $user = get_user_by( 'id', intval( $val['auth'] ) );
236
- $html .= ' ' . esc_html( $user ? $user->get( 'user_login' ) : '' );
237
- $html .= ' / fail:' . intval( $val['fail'] );
238
- }
239
- $html .= '</td></tr>';
240
- if ( ++$count >= $options['cache_hold'] )
241
- break;
242
}
243
}
244
73
$html = '<div id="'.$plugin_slug.'-chart-daily"><table id="'.$plugin_slug.'-targets">';
74
75
$prev = 0;
76
+ $targets = array( 'comment', 'xmlrpc', 'login', 'admin' );
77
foreach ( $statistics['daystats'] as $key => $val ) {
78
while( $prev && $key - $prev > DAY_IN_SECONDS ) {
79
$prev += DAY_IN_SECONDS;
226
foreach ( $cache as $key => $val ) {
227
if ( $options['anonymize'] )
228
$key = preg_replace( '/\d{1,3}#x2F;', '***', $key );
229
+ // if ( empty( $val['auth'] ) || $debug ) { // hide authenticated user
230
+ $html .= '<tr><td>' . esc_html( $key ) . '</td>';
231
+ $html .= '<td>' . esc_html( $val['code'] ) . ' / ';
232
+ $html .= '<small>' . esc_html( $val['hook'] ) . '</small></td>';
233
+ $html .= '<td>' . ( $time - (int)$val['time'] ) . ' / ';
234
+ $html .= $options['save_statistics'] ? (int)$val['call'] : '-';
235
+ if ( $debug ) {
236
+ $user = get_user_by( 'id', intval( $val['auth'] ) );
237
+ $html .= ' ' . esc_html( $user ? $user->get( 'user_login' ) : '' );
238
+ $html .= ' / fail:' . intval( $val['fail'] );
239
+ }
240
+ $html .= '</td></tr>';
241
+ if ( ++$count >= $options['cache_hold'] )
242
+ break;
243
+ // }
244
}
245
}
246
admin/js/admin.js CHANGED
@@ -47,11 +47,11 @@ var ip_geo_block_time = new Date();
47
}
48
49
function warning(status, msg) {
50
- window.alert(status ? sanitize(status + ': ' + msg) : msg);
51
}
52
53
function notice_html5() {
54
- warning(null, IP_GEO_BLOCK.msg[6]);
55
}
56
57
function redirect(page, tab) {
@@ -183,28 +183,11 @@ var ip_geo_block_time = new Date();
183
}
184
};
185
reader.onerror = function (event) {
186
- warning('Error', event.target.error.code);
187
};
188
reader.readAsText(file);
189
}
190
191
- // Enable / Disable at front-end target settings
192
- function set_front_end($this) {
193
- var field = ID('%', 'settings'),
194
- checked = $this.is(':checked'),
195
- select = $(ID('@', 'public_target_rule')),
196
- parent = $this.closest('tr').nextAll('tr');
197
-
198
- // Enable / Disable descendent items
199
- parent.find('[name^="' + field + '"]').prop('disabled', !checked);
200
-
201
- // Enable / Disable description
202
- parent.find(ID('.', 'desc')).css('opacity', checked ? 1.0 : 0.5);
203
-
204
- // Show / Hide validation target
205
- show_folding_list($this, select, field, '1' === select.val() ? true : false);
206
- }
207
-
208
/**
209
* jQuery deserialize plugin based on https://gist.github.com/nissuk/835256
210
*
@@ -250,9 +233,6 @@ var ip_geo_block_time = new Date();
250
$(ID('@', key)).trigger('change');
251
});
252
253
- // Public facing pages
254
- set_front_end($(ID('@', 'validation_public')));
255
-
256
// Additional edge case
257
var i = ID('%', 'settings[providers][IPInfoDB]');
258
$(ID('@', 'providers_IPInfoDB')).prop('checked', json[i] ? true : false);
@@ -311,7 +291,6 @@ var ip_geo_block_time = new Date();
311
self.dataLine.addColumn('number', 'xmlrpc');
312
self.dataLine.addColumn('number', 'login');
313
self.dataLine.addColumn('number', 'admin');
314
- self.dataLine.addColumn('number', 'public');
315
var i, j, k, m, n, cells, arr = [],
316
tr = $(ID('#', 'targets tr'));
317
for (m = tr.length, i = 0; i < m; i++) {
@@ -369,7 +348,7 @@ var ip_geo_block_time = new Date();
369
370
// Get tab number and check wpCookies in wp-includes/js/utils.js
371
var cookie = ('undefined' !== typeof wpCookies && wpCookies.getHash(ID('%', 'admin'))) || {},
372
- tabIndex = [0, 9, 10],
373
tabNo = /&tab=(\d)/.exec(window.location.href);
374
375
tabNo = Number(tabNo && tabNo[1]);
@@ -562,12 +541,6 @@ var ip_geo_block_time = new Date();
562
return false;
563
}).trigger('change');
564
565
- // Enable / Disable for Public facing pages
566
- $(ID('@', 'validation_public')).on('change', function (event) {
567
- set_front_end($(this));
568
- return false;
569
- }).trigger('change');
570
-
571
// Export / Import settings
572
add_hidden_form('validate');
573
@@ -624,7 +597,7 @@ var ip_geo_block_time = new Date();
624
625
// Import pre-defined settings
626
$(ID('#', 'default')).on('click', function (event) {
627
- confirm(IP_GEO_BLOCK.msg[0], function () {
628
ajax_post('pre-defined', {
629
cmd: 'import-default'
630
}, deserialize_json);
@@ -637,7 +610,7 @@ var ip_geo_block_time = new Date();
637
});
638
639
$(ID('#', 'preferred')).on('click', function (event) {
640
- confirm(IP_GEO_BLOCK.msg[0], function () {
641
ajax_post('pre-defined', {
642
cmd: 'import-preferred'
643
}, deserialize_json);
@@ -647,14 +620,14 @@ var ip_geo_block_time = new Date();
647
648
// Manipulate DB table for validation logs
649
$(ID('@', 'create_table')).on('click', function (event) {
650
- confirm(IP_GEO_BLOCK.msg[1], function () {
651
ajax_table('create-table');
652
});
653
return false;
654
});
655
656
$(ID('@', 'delete_table')).on('click', function (event) {
657
- confirm(IP_GEO_BLOCK.msg[2], function () {
658
ajax_table('delete-table');
659
});
660
return false;
@@ -680,24 +653,6 @@ var ip_geo_block_time = new Date();
680
return false;
681
});
682
683
- // Response message and Redirect URL
684
- $(ID('@', 'response_code')).on('change', function (event) {
685
- var res = parseInt($(this).val() / 100, 10),
686
- elm = $(this).closest('tr').nextAll('tr');
687
- if (res <= 3) { // 2xx, 3xx
688
- elm.each(function (index) {
689
- if (0 === index) { $(this).show(); } // redirect_uri
690
- else if (1 === index) { $(this).hide(); } // response_msg
691
- });
692
- }
693
- else { // 4xx, 5xx
694
- elm.each(function (index) {
695
- if (0 === index) { $(this).hide(); } // redirect_uri
696
- else if (1 === index) { $(this).show(); } // response_msg
697
- });
698
- }
699
- }).trigger('change');
700
-
701
// Submit
702
$('#submit').on('click', function (event) {
703
var elm = $(ID('@', 'signature')),
@@ -707,6 +662,7 @@ var ip_geo_block_time = new Date();
707
}
708
return true;
709
});
710
break;
711
712
/*----------------------------------------
@@ -725,7 +681,7 @@ var ip_geo_block_time = new Date();
725
726
// Statistics
727
$(ID('@', 'clear_statistics')).on('click', function (event) {
728
- confirm(IP_GEO_BLOCK.msg[3], function () {
729
ajax_clear('statistics', null);
730
});
731
return false;
@@ -733,7 +689,7 @@ var ip_geo_block_time = new Date();
733
734
// Statistics
735
$(ID('@', 'clear_cache')).on('click', function (event) {
736
- confirm(IP_GEO_BLOCK.msg[4], function () {
737
ajax_clear('cache', null);
738
});
739
return false;
@@ -895,15 +851,9 @@ var ip_geo_block_time = new Date();
895
});
896
}
897
898
- // Clear filter logs
899
- $(ID('#', 'reset-filter')).on('click', function (event) {
900
- $('.footable').trigger('footable_clear_filter');
901
- return false;
902
- });
903
-
904
// Validation logs
905
$(ID('@', 'clear_logs')).on('click', function (event) {
906
- confirm(IP_GEO_BLOCK.msg[5], function () {
907
ajax_clear('logs', null);
908
});
909
return false;
47
}
48
49
function warning(status, msg) {
50
+ window.alert(sanitize(status + ' ' + msg));
51
}
52
53
function notice_html5() {
54
+ warning('Notice:', 'This feature is available with HTML5 compliant browsers.');
55
}
56
57
function redirect(page, tab) {
183
}
184
};
185
reader.onerror = function (event) {
186
+ warning('Error: ', event.target.error.code);
187
};
188
reader.readAsText(file);
189
}
190
191
/**
192
* jQuery deserialize plugin based on https://gist.github.com/nissuk/835256
193
*
233
$(ID('@', key)).trigger('change');
234
});
235
236
// Additional edge case
237
var i = ID('%', 'settings[providers][IPInfoDB]');
238
$(ID('@', 'providers_IPInfoDB')).prop('checked', json[i] ? true : false);
291
self.dataLine.addColumn('number', 'xmlrpc');
292
self.dataLine.addColumn('number', 'login');
293
self.dataLine.addColumn('number', 'admin');
294
var i, j, k, m, n, cells, arr = [],
295
tr = $(ID('#', 'targets tr'));
296
for (m = tr.length, i = 0; i < m; i++) {
348
349
// Get tab number and check wpCookies in wp-includes/js/utils.js
350
var cookie = ('undefined' !== typeof wpCookies && wpCookies.getHash(ID('%', 'admin'))) || {},
351
+ tabIndex = [0, 8, 9],
352
tabNo = /&tab=(\d)/.exec(window.location.href);
353
354
tabNo = Number(tabNo && tabNo[1]);
541
return false;
542
}).trigger('change');
543
544
// Export / Import settings
545
add_hidden_form('validate');
546
597
598
// Import pre-defined settings
599
$(ID('#', 'default')).on('click', function (event) {
600
+ confirm('Import settings ?', function () {
601
ajax_post('pre-defined', {
602
cmd: 'import-default'
603
}, deserialize_json);
610
});
611
612
$(ID('#', 'preferred')).on('click', function (event) {
613
+ confirm('Import settings ?', function () {
614
ajax_post('pre-defined', {
615
cmd: 'import-preferred'
616
}, deserialize_json);
620
621
// Manipulate DB table for validation logs
622
$(ID('@', 'create_table')).on('click', function (event) {
623
+ confirm('Create table ?', function () {
624
ajax_table('create-table');
625
});
626
return false;
627
});
628
629
$(ID('@', 'delete_table')).on('click', function (event) {
630
+ confirm('Delete table ?', function () {
631
ajax_table('delete-table');
632
});
633
return false;
653
return false;
654
});
655
656
// Submit
657
$('#submit').on('click', function (event) {
658
var elm = $(ID('@', 'signature')),
662
}
663
return true;
664
});
665
+
666
break;
667
668
/*----------------------------------------
681
682
// Statistics
683
$(ID('@', 'clear_statistics')).on('click', function (event) {
684
+ confirm('Clear statistics ?', function () {
685
ajax_clear('statistics', null);
686
});
687
return false;
689
690
// Statistics
691
$(ID('@', 'clear_cache')).on('click', function (event) {
692
+ confirm('Clear cache ?', function () {
693
ajax_clear('cache', null);
694
});
695
return false;
851
});
852
}
853
854
// Validation logs
855
$(ID('@', 'clear_logs')).on('click', function (event) {
856
+ confirm('Clear logs ?', function () {
857
ajax_clear('logs', null);
858
});
859
return false;
admin/js/admin.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*
2
- Project: WordPress IP Geo Block
3
- Copyright (c) 2015-2016 tokkonopapa (tokkonopapa@yahoo.com)
4
- This software is released under the MIT License.
5
- */
6
- var ip_geo_block_time=new Date;(function(a,h,t){function b(a,b){var c={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_"};return b?c[a]+b:c.$+a}function d(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function u(c,l){l?a(b("#",c)).addClass(b("loading")):a(b("#",c)).removeClass(b("loading"))}function n(a,b){h.confirm(d(a))&&b()}function w(a,b){h.alert(a?d(a+": "+b):b)}function x(a,b){if(-1!==location.href.indexOf(a)){var c=d(a)+(b?"&"+d(b):"");"undefined"===typeof IP_GEO_BLOCK_ZEP?h.location.href=c:IP_GEO_BLOCK_ZEP.redirect(c)}}function m(b,l,f,p){b&&u(b,!0);l.action=IP_GEO_BLOCK.action;l.nonce=IP_GEO_BLOCK.nonce;a.post(IP_GEO_BLOCK.url,l).done(function(a,b,c){f(a)}).fail(function(a,b,c){w(b,a.responseText)}).always(function(){b&&(p?a.when.apply(a,p).then(function(){u(b,!1)}):u(b,!1))})}function y(a,b){m(a,{cmd:"clear-"+a,which:b},function(a){x(a.page,a.tab)})}function B(a){m(a,{cmd:a},function(a){x(a.page,a.tab)})}function z(c,l,f,p){var d=!1,d=d|(0===c.prop("type").indexOf("checkbox")&&c.is(":checked")),d=d|(0===c.prop("type").indexOf("select")&&"0"!==c.val());l.nextAll("."+f+"_folding").each(function(c,f){f=a(f);d&&p?f.removeClass("folding-disable"):(f.children("li").hide(),f.addClass("folding-disable"),f.removeClass(b("dropdown")).addClass(b("dropup")))})}function v(a){return String(a).replace(/[a-z]/gi,function(a){return String.fromCharCode(a.charCodeAt(0)+("n">a.toLowerCase()?13:-13))})}function F(a,b){var c=new FileReader;c.onload=function(a){b&&b(a.target.result)};c.onerror=function(a){w("Error",a.target.error.code)};c.readAsText(a)}function C(c){var d=b("%","settings"),f=c.is(":checked"),p=a(b("@","public_target_rule")),h=c.closest("tr").nextAll("tr");h.find('[name^="'+d+'"]').prop("disabled",!f);h.find(b(".","desc")).css("opacity",f?1:.5);z(c,p,d,"1"===p.val()?!0:!1)}function A(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,d){a(b("@",d)).trigger("change")});C(a(b("@","validation_public")));var d=b("%","settings[providers][IPInfoDB]");a(b("@","providers_IPInfoDB")).prop("checked",c[d]?!0:!1)}}function D(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,d){return this.each(function(){var c,d,l,h=this,k={};for(c in b)b.hasOwnProperty(c)&&(d=decodeURIComponent(c),l=decodeURIComponent(b[c]),d in k||(k[d]=[]),k[d].push(l));a.each(k,function(b,e){a('[name="'+b+'"]:input',h).val(e)})})};var E={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(t.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,d,f,h,m,n,k=[],r=a(b("#","targets tr"));h=r.length;for(c=0;c<h;c++)for(k[c]=[],n=r.eq(c).children(),m=n.length,d=0;d<m;d++)f=n.eq(d).text(),k[c].push(d?Number(f):new Date(f));self.dataLine.addRows(k)}self.viewLine||(self.viewLine=new google.visualization.LineChart(t.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(){ip_geo_block_time=new Date-ip_geo_block_time;var c="undefined"!==typeof wpCookies&&wpCookies.getHash(b("%","admin"))||{},l=[0,9,10],f=/&tab=(\d)/.exec(h.location.href),f=Number(f&&f[1]),p=a('<fieldset class="'+b("field")+'"></fieldset>'),u=a("<legend></legend>");a(".form-table").each(function(e){var g=a(this),q=g.prevAll("h2,h3:first"),d=q.nextUntil(g);g.wrap(p).parent().attr("id",b("settings-"+e)).data("ip-geo-block",e).prepend(q.wrap(u).parent());d.insertBefore(g);1>=f&&(e+=l[f],"undefined"===typeof c[e]||c[e]?q.addClass(b("dropdown")).parent().nextAll().show():q.addClass(b("dropup")).parent().nextAll().hide())});var t=function(){a(b("#","chart-countries")).length&&E.drawChart()};1>=f&&(a("form").on("click","h2,h3",function(e){e=a(this);var g=e.closest("fieldset").data("ip-geo-block");e.parent().nextAll().toggle();e.toggleClass(b("dropup")).toggleClass(b("dropdown"));"undefined"!==typeof wpCookies&&(c[g+l[f]]=e.hasClass(b("dropdown"))?"o":"",wpCookies.setHash(b("%","admin"),c,new Date(Date.now()+2592E6)));t();return!1}),a(b("#","toggle-sections")).on("click",function(e){var g,q=0,d=[b("dropdown"),b("dropup")];e=a(b(".","field")).find("h2,h3");e.each(function(b){q+=a(this).hasClass(d[0])});e.each(function(b){g=a(this);g.parent().nextAll().toggle(q?!1:!0);g.removeClass(d.join(" ")).addClass(q?d[1]:d[0]);c[b+l[f]]=q?"":"o"});"undefined"!==typeof wpCookies&&wpCookies.setHash(b("%","admin"),c,new Date(Date.now()+2592E6));t();return!1}));a(b("#","inhibit")).on("submit",function(){return!1});switch(f){case 0:a(b("#","scan-code")).on("click",function(e){var c=a(this).parent();m("scanning",{cmd:"scan-code"},function(a){c.children("ul").length||c.append('<ul id="'+b("code-list")+'"></ul>');c=c.children("ul").empty();var e,g;for(e in a)a.hasOwnProperty(e)&&(e=d(e),"string"===typeof a[e]?g=d(a[e]):(g=d(a[e].code),e='<abbr title="'+d(a[e].type)+'">'+e+"</abbr>"),c.append("<li>"+e+' : <span class="'+b("notice")+'">'+g+"</span></li>"));c.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(e){m("download",{cmd:"download"},function(e){var c,g,f;for(c in e)if(e.hasOwnProperty(c))for(g in f=e[c],f)f.hasOwnProperty(g)&&(g=d(g),f[g].filename&&a(b("@",c+"_"+g+"_path")).val(d(f[g].filename)),f[g].message&&a(b("#",c+"-"+g)).text(d(f[g].message)))});return!1});var k=b("%","settings");a(b("@","validation_login")).on("change",function(b){b=a(this);z(b,b,k,!0);return!1}).trigger("change");a('select[name^="'+k+'"]').on("change",function(e){e=a(this);var c,d=b(".","desc");e.next(d).empty();(c=e.children("option:selected").data("desc"))&&e.next(d).html(a.parseHTML(c));z(e,e,k,!0);return!1}).trigger("change");a(b("@","validation_public")).on("change",function(b){C(a(this));return!1}).trigger("change");D("validate");a(b("#","export")).on("click",function(e){if("undefined"===typeof JSON)return w(null,IP_GEO_BLOCK.msg[6]),!1;var c=k,d={};a.each(a(this).closest("form").serializeArray(),function(a,b){-1!==b.name.indexOf(c)&&(d[b.name]=b.value)});d[c+="[signature]"]=h.btoa(v(d[c]));a(b("#","export-data")).val(JSON.stringify(d));a(b("#","export-form")).trigger("submit");return!1});a(b("#","file-dialog")).on("change",function(a){if("undefined"===typeof FileReader)return w(null,IP_GEO_BLOCK.msg[6]),!1;var b;(a=a.target.files[0])&&F(a,function(a){a=JSON.parse(a);b=k+"[signature]";"undefined"!==typeof a[b]&&(a[b]=h.btoa(v(a[b])));m("export-import",{cmd:"validate",data:JSON.stringify(a)},A)});return!1});a(b("#","import")).on("click",function(c){a(b("#","file-dialog")).trigger("click");return!1});a(b("#","default")).on("click",function(a){n(IP_GEO_BLOCK.msg[0],function(){m("pre-defined",{cmd:"import-default"},A)});return!1});a(b("#","preferred")).on("click",function(a){n(IP_GEO_BLOCK.msg[0],function(){m("pre-defined",{cmd:"import-preferred"},A)});return!1});a(b("@","create_table")).on("click",function(a){n(IP_GEO_BLOCK.msg[1],function(){B("create-table")});return!1});a(b("@","delete_table")).on("click",function(a){n(IP_GEO_BLOCK.msg[2],function(){B("delete-table")});return!1});a("ul."+k+"_folding dfn").on("click",function(c){c=a(this).parent();c.children("li").toggle();c.toggleClass(b("dropup")).toggleClass(b("dropdown"));return!1});a(b("#","decode")).on("click",function(c){c=a(b("@","signature"));var e=c.val();-1===e.search(/,/)?c.val(v(h.atob(e))):c.val(h.btoa(v(e)));return!1});a(b("@","response_code")).on("change",function(b){b=parseInt(a(this).val()/100,10);var c=a(this).closest("tr").nextAll("tr");3>=b?c.each(function(b){0===b?a(this).show():1===b&&a(this).hide()}):c.each(function(b){0===b?a(this).hide():1===b&&a(this).show()})}).trigger("change");a("#submit").on("click",function(c){c=a(b("@","signature"));var e=c.val();-1!==e.search(/,/)&&c.val(h.btoa(v(e)));return!0});break;case 1:a(b("#","chart-countries")).length&&"object"===typeof google&&google.load("visualization","1",{packages:["corechart"],callback:function(){E.drawChart()}});a(b("@","clear_statistics")).on("click",function(a){n(IP_GEO_BLOCK.msg[3],function(){y("statistics",null)});return!1});a(b("@","clear_cache")).on("click",function(a){n(IP_GEO_BLOCK.msg[4],function(){y("cache",null)});return!1});break;case 2:a(h).on(b("gmap-error"),function(){m(null,{cmd:"gmap-error"},function(a){x(a.page,a.tab)})});var r=a(b("#","map"));"object"===typeof google?r.each(function(){a(this).GmapRS()}):r.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 e=a(b("#","whois")),f=a(b("@","ip_address")).val();f&&(e.hide().empty(),c=a.whois(f,function(c){var d,f="";for(d=0;d<c.length;d++)f+="<tr><td>"+c[d].name+"</td><td>"+c[d].value+"</td></tr>";e.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:f,which:a(b("@","service")).val()},function(a){var c,e="",g=d(a.latitude||"0"),h=d(a.longitude||"0"),k=a.latitude||a.longitude?8:2;for(c in a)a.hasOwnProperty(c)&&(c=d(c),e+='<li><span class="'+b("title")+'">'+c+' : </span><span class="'+b("result")+'">'+d(a[c])+"</span></li>");"object"===typeof google?r.GmapRS("addMarker",{latitude:g,longitude:h,title:f,content:"<ul>"+e+"</ul>",show:!0,zoom:k}):r.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")+'">'+d(f)+"</span></li>"+e+'</ul><iframe src="//maps.google.com/maps?q='+g+","+h+"&z="+k+'&output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')},[c]));return!1});a(b("@","ip_address")).val()&&a(b("@","get_location")).trigger("click");break;case 4:a(b(".","log")).hide().length&&m("logs",{cmd:"restore",which:null,time:ip_geo_block_time},function(c){for(var e in c)c.hasOwnProperty(e)&&(e=d(e),a(b("#","log-"+e)).html(c[e]));"function"===typeof a.fn.footable&&a(b(".","log")).fadeIn("slow").footable();a('tbody[id^="'+b("quot;,"log-")+'"]').on("click","a",function(b){h.open(h.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){n(IP_GEO_BLOCK.msg[5],function(){y("logs",null)});return!1}),D("export-logs"),a(b("#","export-logs")).on("click",function(c){a(b("#","export-form")).trigger("submit");return!1})}})})(jQuery,window,document);
1
+ /*!
2
+ * Project: WordPress IP Geo Block
3
+ * Copyright (c) 2015-2016 tokkonopapa (tokkonopapa@yahoo.com)
4
+ * This software is released under the MIT License.
5
+ */
6
+ var ip_geo_block_time=new Date;(function(b,h,u){function a(a,b){var c={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_"};return b?c[a]+b:c.$+a}function e(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function v(c,l){l?b(a("#",c)).addClass(a("loading")):b(a("#",c)).removeClass(a("loading"))}function n(a,b){h.confirm(e(a))&&b()}function A(){h.alert(e("Notice: This feature is available with HTML5 compliant browsers."))}function x(a,b){if(-1!==location.href.indexOf(a)){var c=e(a)+(b?"&"+e(b):"");"undefined"===typeof IP_GEO_BLOCK_ZEP?h.location.href=c:IP_GEO_BLOCK_ZEP.redirect(c)}}function m(a,l,f,r){a&&v(a,!0);l.action=IP_GEO_BLOCK.action;l.nonce=IP_GEO_BLOCK.nonce;b.post(IP_GEO_BLOCK.url,l).done(function(a,b,c){f(a)}).fail(function(a,b,c){h.alert(e(b+" "+a.responseText))}).always(function(){a&&(r?b.when.apply(b,r).then(function(){v(a,!1)}):v(a,!1))})}function y(a,b){m(a,{cmd:"clear-"+a,which:b},function(a){x(a.page,a.tab)})}function B(a){m(a,{cmd:a},function(a){x(a.page,a.tab)})}function C(c,l,f,r){var e=!1,e=e|(0===c.prop("type").indexOf("checkbox")&&c.is(":checked")),e=e|(0===c.prop("type").indexOf("select")&&"0"!==c.val());l.nextAll("."+f+"_folding").each(function(c,f){f=b(f);e&&r?f.removeClass("folding-disable"):(f.children("li").hide(),f.addClass("folding-disable"),f.removeClass(a("dropdown")).addClass(a("dropup")))})}function w(a){return String(a).replace(/[a-z]/gi,function(a){return String.fromCharCode(a.charCodeAt(0)+("n">a.toLowerCase()?13:-13))})}function F(a,b){var c=new FileReader;c.onload=function(a){b&&b(a.target.result)};c.onerror=function(a){h.alert(e("Error: "+a.target.error.code))};c.readAsText(a)}function z(c){if(c){"string"===typeof c&&(c=JSON.parse(c));b(a("#","import")).closest("form").deserialize(c);b.each(["matching_rule","validation_login","validation_plugins","validation_themes"],function(c,e){b(a("@",e)).trigger("change")});var e=a("%","settings[providers][IPInfoDB]");b(a("@","providers_IPInfoDB")).prop("checked",c[e]?!0:!1)}}function D(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,l,h=this,k={};for(c in a)a.hasOwnProperty(c)&&(e=decodeURIComponent(c),l=decodeURIComponent(a[c]),e in k||(k[e]=[]),k[e].push(l));b.each(k,function(a,d){b('[name="'+a+'"]:input',h).val(d)})})};var E={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;b(a("#","countries li")).each(function(){c=b(this).text().split(":");self.dataPie.addRow([c[0]||"",Number(c[1])])})}self.viewPie||(self.viewPie=new google.visualization.PieChart(u.getElementById(a("chart-countries"))));b(a("#","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");var c,e,f,h,m,n,k=[],q=b(a("#","targets tr"));h=q.length;for(c=0;c<h;c++)for(k[c]=[],n=q.eq(c).children(),m=n.length,e=0;e<m;e++)f=n.eq(e).text(),k[c].push(e?Number(f):new Date(f));self.dataLine.addRows(k)}self.viewLine||(self.viewLine=new google.visualization.LineChart(u.getElementById(a("chart-daily"))));if(c=b(a("#","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%"}})}};b(function(){ip_geo_block_time=new Date-ip_geo_block_time;var c="undefined"!==typeof wpCookies&&wpCookies.getHash(a("%","admin"))||{},l=[0,8,9],f=/&tab=(\d)/.exec(h.location.href),f=Number(f&&f[1]),r=b('<fieldset class="'+a("field")+'"></fieldset>'),v=b("<legend></legend>");b(".form-table").each(function(d){var g=b(this),p=g.prevAll("h2,h3:first"),t=p.nextUntil(g);g.wrap(r).parent().attr("id",a("settings-"+d)).data("ip-geo-block",d).prepend(p.wrap(v).parent());t.insertBefore(g);1>=f&&(d+=l[f],"undefined"===typeof c[d]||c[d]?p.addClass(a("dropdown")).parent().nextAll().show():p.addClass(a("dropup")).parent().nextAll().hide())});var u=function(){b(a("#","chart-countries")).length&&E.drawChart()};1>=f&&(b("form").on("click","h2,h3",function(d){d=b(this);var g=d.closest("fieldset").data("ip-geo-block");d.parent().nextAll().toggle();d.toggleClass(a("dropup")).toggleClass(a("dropdown"));"undefined"!==typeof wpCookies&&(c[g+l[f]]=d.hasClass(a("dropdown"))?"o":"",wpCookies.setHash(a("%","admin"),c,new Date(Date.now()+2592E6)));u();return!1}),b(a("#","toggle-sections")).on("click",function(d){var g,p=0,t=[a("dropdown"),a("dropup")];d=b(a(".","field")).find("h2,h3");d.each(function(a){p+=b(this).hasClass(t[0])});d.each(function(a){g=b(this);g.parent().nextAll().toggle(p?!1:!0);g.removeClass(t.join(" ")).addClass(p?t[1]:t[0]);c[a+l[f]]=p?"":"o"});"undefined"!==typeof wpCookies&&wpCookies.setHash(a("%","admin"),c,new Date(Date.now()+2592E6));u();return!1}));b(a("#","inhibit")).on("submit",function(){return!1});switch(f){case 0:b(a("#","scan-code")).on("click",function(d){var c=b(this).parent();m("scanning",{cmd:"scan-code"},function(b){c.children("ul").length||c.append('<ul id="'+a("code-list")+'"></ul>');c=c.children("ul").empty();var d,g;for(d in b)b.hasOwnProperty(d)&&(d=e(d),"string"===typeof b[d]?g=e(b[d]):(g=e(b[d].code),d='<abbr title="'+e(b[d].type)+'">'+d+"</abbr>"),c.append("<li>"+d+' : <span class="'+a("notice")+'">'+g+"</span></li>"));c.show("slow")});return!1});b(a("@","matching_rule")).on("change",function(){b(a("@","white_list")).closest("tr").toggle("0"===this.value);b(a("@","black_list")).closest("tr").toggle("1"===this.value);return!1}).trigger("change");b(a("@","public_matching_rule")).on("change",function(){b(a("@","public_white_list")).closest("tr").toggle("0"===this.value);b(a("@","public_black_list")).closest("tr").toggle("1"===this.value);return!1}).trigger("change");b(a("@","update")).on("click",function(d){m("download",{cmd:"download"},function(d){var c,g,f;for(c in d)if(d.hasOwnProperty(c))for(g in f=d[c],f)f.hasOwnProperty(g)&&(g=e(g),f[g].filename&&b(a("@",c+"_"+g+"_path")).val(e(f[g].filename)),f[g].message&&b(a("#",c+"-"+g)).text(e(f[g].message)))});return!1});var k=a("%","settings");b(a("@","validation_login")).on("change",function(a){a=b(this);C(a,a,k,!0);return!1}).trigger("change");b('select[name^="'+k+'"]').on("change",function(d){d=b(this);var c,e=a(".","desc");d.next(e).empty();(c=d.children("option:selected").data("desc"))&&d.next(e).html(b.parseHTML(c));C(d,d,k,!0);return!1}).trigger("change");D("validate");b(a("#","export")).on("click",function(d){if("undefined"===typeof JSON)return A(),!1;var c=k,e={};b.each(b(this).closest("form").serializeArray(),function(a,b){-1!==b.name.indexOf(c)&&(e[b.name]=b.value)});e[c+="[signature]"]=h.btoa(w(e[c]));b(a("#","export-data")).val(JSON.stringify(e));b(a("#","export-form")).trigger("submit");return!1});b(a("#","file-dialog")).on("change",function(a){if("undefined"===typeof FileReader)return A(),!1;var b;(a=a.target.files[0])&&F(a,function(a){a=JSON.parse(a);b=k+"[signature]";"undefined"!==typeof a[b]&&(a[b]=h.btoa(w(a[b])));m("export-import",{cmd:"validate",data:JSON.stringify(a)},z)});return!1});b(a("#","import")).on("click",function(c){b(a("#","file-dialog")).trigger("click");return!1});b(a("#","default")).on("click",function(a){n("Import settings ?",function(){m("pre-defined",{cmd:"import-default"},z)});return!1});b(a("#","preferred")).on("click",function(a){n("Import settings ?",function(){m("pre-defined",{cmd:"import-preferred"},z)});return!1});b(a("@","create_table")).on("click",function(a){n("Create table ?",function(){B("create-table")});return!1});b(a("@","delete_table")).on("click",function(a){n("Delete table ?",function(){B("delete-table")});return!1});b("ul."+k+"_folding dfn").on("click",function(c){c=b(this).parent();c.children("li").toggle();c.toggleClass(a("dropup")).toggleClass(a("dropdown"));return!1});b(a("#","decode")).on("click",function(c){c=b(a("@","signature"));var d=c.val();-1===d.search(/,/)?c.val(w(h.atob(d))):c.val(h.btoa(w(d)));return!1});b("#submit").on("click",function(c){c=b(a("@","signature"));var d=c.val();-1!==d.search(/,/)&&c.val(h.btoa(w(d)));return!0});break;case 1:b(a("#","chart-countries")).length&&"object"===typeof google&&google.load("visualization","1",{packages:["corechart"],callback:function(){E.drawChart()}});b(a("@","clear_statistics")).on("click",function(a){n("Clear statistics ?",function(){y("statistics",null)});return!1});b(a("@","clear_cache")).on("click",function(a){n("Clear cache ?",function(){y("cache",null)});return!1});break;case 2:b(h).on(a("gmap-error"),function(){m(null,{cmd:"gmap-error"},function(a){x(a.page,a.tab)})});var q=b(a("#","map"));"object"===typeof google?q.each(function(){b(this).GmapRS()}):q.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(a("@","get_location")).on("click",function(c){var d=b(a("#","whois")),f=b(a("@","ip_address")).val();f&&(d.hide().empty(),c=b.whois(f,function(c){var e,f="";for(e=0;e<c.length;e++)f+="<tr><td>"+c[e].name+"</td><td>"+c[e].value+"</td></tr>";d.html('<fieldset class="'+a("field")+'"><legend><h2 id="'+a("whois-title")+'" class="'+a("dropdown")+'">Whois</h2></legend><table class="'+a("table")+'">'+f+"</table><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})}),m("loading",{cmd:"search",ip:f,which:b(a("@","service")).val()},function(b){var c,d="",g=e(b.latitude||"0"),h=e(b.longitude||"0"),k=b.latitude||b.longitude?8:2;for(c in b)b.hasOwnProperty(c)&&(c=e(c),d+='<li><span class="'+a("title")+'">'+c+' : </span><span class="'+a("result")+'">'+e(b[c])+"</span></li>");"object"===typeof google?q.GmapRS("addMarker",{latitude:g,longitude:h,title:f,content:"<ul>"+d+"</ul>",show:!0,zoom:k}):q.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")+'">'+e(f)+"</span></li>"+d+'</ul><iframe src="//maps.google.com/maps?q='+g+","+h+"&z="+k+'&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")).trigger("click");break;case 4:b(a(".","log")).hide().length&&m("logs",{cmd:"restore",which:null,time:ip_geo_block_time},function(c){for(var d in c)c.hasOwnProperty(d)&&(d=e(d),b(a("#","log-"+d)).html(c[d]));"function"===typeof b.fn.footable&&b(a(".","log")).fadeIn("slow").footable();b('tbody[id^="'+a("quot;,"log-")+'"]').on("click","a",function(a){h.open(h.location.href.replace(/tab=\d/,"tab=2")+"&ip="+b(this).text().replace(/[^\w\.\:\*]/,""));return!1})}),b(a("@","clear_logs")).on("click",function(a){n("Clear logs ?",function(){y("logs",null)});return!1}),D("export-logs"),b(a("#","export-logs")).on("click",function(c){b(a("#","export-form")).trigger("submit");return!1})}})})(jQuery,window,document);
admin/js/authenticate.js CHANGED
@@ -188,7 +188,7 @@ var IP_GEO_BLOCK_ZEP = {
188
var theme_featured = function (data) {
189
var i = data.length;
190
while (i-- > 0) {
191
- if (data[i].indexOf('request%5Bbrowse%5D=ip-geo-block-auth') !== -1) {
192
data[i] = 'request%5Bbrowse%5D=featured'; // correct the parameter
193
break;
194
}
@@ -200,7 +200,7 @@ var IP_GEO_BLOCK_ZEP = {
200
var media_library = function (data) {
201
var i = data.length;
202
while (i-- > 0) {
203
- if (data[i].indexOf('query%5Bip-geo-block-auth-nonce%5D=') !== -1) {
204
delete data[i];
205
break;
206
}
@@ -340,13 +340,6 @@ var IP_GEO_BLOCK_ZEP = {
340
'<meta http-equiv="refresh" content="0; url=' + sanitize(this.href) + '" />'
341
);
342
w.document.close();
343
-
344
- // stop event propagation
345
- $this.removeAttr('target');
346
- $this.off('click');
347
- event.preventDefault();
348
- event.stopPropagation();
349
- event.stopImmediatePropagation();
350
return false;
351
}
352
});
@@ -374,14 +367,6 @@ var IP_GEO_BLOCK_ZEP = {
374
}
375
376
$(function () {
377
- // avoid conflict with "Open external links in a new window"
378
- $('a').each(function () {
379
- if(!this.hasAttribute('onClick')) {
380
- this.setAttribute('onClick', 'javascript:void(0);');
381
- }
382
- });
383
-
384
- // attach event to add nonce
385
attach_nonce();
386
IP_GEO_BLOCK_ZEP.init = true;
387
});
188
var theme_featured = function (data) {
189
var i = data.length;
190
while (i-- > 0) {
191
+ if (data[i].indexOf('request%5Bbrowse%5D=ip-geo-block-auth') === 0) {
192
data[i] = 'request%5Bbrowse%5D=featured'; // correct the parameter
193
break;
194
}
200
var media_library = function (data) {
201
var i = data.length;
202
while (i-- > 0) {
203
+ if (data[i].indexOf('query%5Bip-geo-block-auth-nonce%5D=' + IP_GEO_BLOCK_AUTH.nonce) === 0) {
204
delete data[i];
205
break;
206
}
340
'<meta http-equiv="refresh" content="0; url=' + sanitize(this.href) + '" />'
341
);
342
w.document.close();
343
return false;
344
}
345
});
367
}
368
369
$(function () {
370
attach_nonce();
371
IP_GEO_BLOCK_ZEP.init = true;
372
});
admin/js/authenticate.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*
2
- Project: WP-ZEP - Zero-day exploit Prevention for wp-admin
3
- Copyright (c) 2015-2016 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){-1!==location.href.indexOf(e)&&(this.nonce&&(e+=(0<=e.indexOf("?")?"&":"?")+this.auth+"="+this.nonce),window.location.href=e)}};(function(e,t){function u(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function g(a){a=decodeURIComponent(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 m(a){return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function h(a,b){"object"!==typeof a&&(a=g(a||location.href));for(var c=a.query?a.query.split("&"):[],d=c.length;0<d--;)if(0===c[d].indexOf(IP_GEO_BLOCK_ZEP.auth)){c.splice(d,1);break}c.push(IP_GEO_BLOCK_ZEP.auth+"="+m(b));a.query=c.join("&");return(a.scheme?a.scheme+":":"")+(a.relative+a.path)+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")}function k(a){a=g(a?a.toString().toLowerCase():location.pathname);var b,c=a,d=[];"object"!==typeof c&&(c=g(c));c=c.path;"/"!==c.charAt(0)&&(b=window.location.pathname,c=b.substring(0,b.lastIndexOf("/")+1)+c);c=c.split("/");""===c[c.length-1]&&(c.pop(),c[c.length-1]+="/");for(b in c)c.hasOwnProperty(b)&&"."!==c[b]&&(".."===c[b]?0<d.length&&d.pop():(1>d.length||""!==c[b])&&d.push(c[b]));b=d.join("/").replace(/\/\//g,"/");if(/https?/.test(a.scheme)||!a.scheme){if(a.authority&&a.authority!==location.host.toLowerCase())return-1;if((a.scheme||a.path||a.query)&&v.test(b))return 1}return 0}function n(a,b,c){var d=b.split(/\s+/);a.each(function(a){for(a=0;a<d.length;a++){var b=e.trim(d[a]).match(/[^\.]+/i)[0],f=e(this),l=b,b=c,f=e._data(f[0]).events[l],l=b?f.splice(f.delegateCount-1,1)[0]:f.pop();f.splice(b?0:f.delegateCount||0,0,l)}})}function p(){var a=IP_GEO_BLOCK_ZEP.nonce;if(a){var b=e("body");b.find("img").each(function(b){b=e(this).attr("src");1===k(b)&&e(this).attr("src",h(b,a))});b.onFirst("click","a",function(b){var c=e(this),d=c.attr("href"),f=c.attr("rel"),g="undefined"!==typeof d?k(d):0;if(1===g)c.attr("href",h(d,!f||0>f.indexOf("nofollow")?a:"nofollow"));else if(-1===g)return d=window.open(),d.document.write('<meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+u(this.href)+'" />'),d.document.close(),c.removeAttr("target"),c.off("click"),b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation(),!1});b.onFirst("submit","form",function(b){b=e(this);var c=b.attr("action");1===k(c)&&b.attr("action",h(c,a))});if("undefined"!==typeof _wpRevisionsSettings)for(var c=_wpRevisionsSettings.revisionData,d=c.length,b=0;b<d;b++)-1===c[b].restoreUrl.indexOf(IP_GEO_BLOCK_ZEP.auth)&&(_wpRevisionsSettings.revisionData[b].restoreUrl=h(c[b].restoreUrl,a))}}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|.*/)?quot;),q=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},r={"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":q,"network/theme-install.php":q};e(t).ajaxSend(function(a,b,c){if((a=IP_GEO_BLOCK_ZEP.nonce)&&1===k(c.url))if("undefined"!==typeof window.FormData&&c.data instanceof FormData)c.data.append(IP_GEO_BLOCK_ZEP.auth,a);else if(b=g(c.url),"undefined"===typeof c.data||b.query)c.url=h(b,a);else{b=c.data?c.data.split("&"):[];var d;d=location.pathname;d=d.replace(IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin,"");(d=r.hasOwnProperty(d)?r[d]:null)&&(b=d(b));b.push(IP_GEO_BLOCK_ZEP.auth+"="+m(a));c.data=b.join("&")}});"undefined"===typeof e.fn.onFirst&&(e.fn.onFirst=function(a,b){var c,d=e(this),f="string"===typeof b;e.fn.on.apply(d,arguments);if("object"===typeof a)for(c in a)a.hasOwnProperty(c)&&n(d,c,f);else"string"===typeof a&&n(d,a,f);return d});e(function(){e("a").each(function(){this.hasAttribute("onClick")||this.setAttribute("onClick","javascript:void(0);")});p();IP_GEO_BLOCK_ZEP.init=!0});e(window).on("error",function(){IP_GEO_BLOCK_ZEP.init||p()})})(jQuery,document);
1
+ /*!
2
+ * Project: WP-ZEP - Zero-day exploit Prevention for wp-admin
3
+ * Copyright (c) 2015-2016 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){-1!==location.href.indexOf(e)&&(this.nonce&&(e+=(0<=e.indexOf("?")?"&":"?")+this.auth+"="+this.nonce),window.location.href=e)}};(function(e,t){function u(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function h(a){a=decodeURIComponent(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 m(a){return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function g(a,b){"object"!==typeof a&&(a=h(a||location.href));for(var c=a.query?a.query.split("&"):[],d=c.length;0<d--;)if(0===c[d].indexOf(IP_GEO_BLOCK_ZEP.auth)){c.splice(d,1);break}c.push(IP_GEO_BLOCK_ZEP.auth+"="+m(b));a.query=c.join("&");return(a.scheme?a.scheme+":":"")+(a.relative+a.path)+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")}function k(a){a=h(a?a.toString().toLowerCase():location.pathname);var b,c=a,d=[];"object"!==typeof c&&(c=h(c));c=c.path;"/"!==c.charAt(0)&&(b=window.location.pathname,c=b.substring(0,b.lastIndexOf("/")+1)+c);c=c.split("/");""===c[c.length-1]&&(c.pop(),c[c.length-1]+="/");for(b in c)c.hasOwnProperty(b)&&"."!==c[b]&&(".."===c[b]?0<d.length&&d.pop():(1>d.length||""!==c[b])&&d.push(c[b]));b=d.join("/").replace(/\/\//g,"/");if(/https?/.test(a.scheme)||!a.scheme){if(a.authority&&a.authority!==location.host.toLowerCase())return-1;if((a.scheme||a.path||a.query)&&v.test(b))return 1}return 0}function n(a,b,c){var d=b.split(/\s+/);a.each(function(a){for(a=0;a<d.length;a++){var b=e.trim(d[a]).match(/[^\.]+/i)[0],f=e(this),l=b,b=c,f=e._data(f[0]).events[l],l=b?f.splice(f.delegateCount-1,1)[0]:f.pop();f.splice(b?0:f.delegateCount||0,0,l)}})}function p(){var a=IP_GEO_BLOCK_ZEP.nonce;if(a){var b=e("body");b.find("img").each(function(b){b=e(this).attr("src");1===k(b)&&e(this).attr("src",g(b,a))});b.onFirst("click","a",function(b){b=e(this);var c=b.attr("href"),d=b.attr("rel"),f="undefined"!==typeof c?k(c):0;if(1===f)b.attr("href",g(c,!d||0>d.indexOf("nofollow")?a:"nofollow"));else if(-1===f)return b=window.open(),b.document.write('<meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+u(this.href)+'" />'),b.document.close(),!1});b.onFirst("submit","form",function(b){b=e(this);var c=b.attr("action");1===k(c)&&b.attr("action",g(c,a))});if("undefined"!==typeof _wpRevisionsSettings)for(var c=_wpRevisionsSettings.revisionData,d=c.length,b=0;b<d;b++)-1===c[b].restoreUrl.indexOf(IP_GEO_BLOCK_ZEP.auth)&&(_wpRevisionsSettings.revisionData[b].restoreUrl=g(c[b].restoreUrl,a))}}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|.*/)?quot;),q=function(a){for(var b=a.length;0<b--;)if(0===a[b].indexOf("request%5Bbrowse%5D=ip-geo-block-auth")){a[b]="request%5Bbrowse%5D=featured";break}return a},r={"upload.php":function(a){for(var b=a.length;0<b--;)if(0===a[b].indexOf("query%5Bip-geo-block-auth-nonce%5D="+IP_GEO_BLOCK_AUTH.nonce)){delete a[b];break}return a},"theme-install.php":q,"network/theme-install.php":q};e(t).ajaxSend(function(a,b,c){if((a=IP_GEO_BLOCK_ZEP.nonce)&&1===k(c.url))if("undefined"!==typeof window.FormData&&c.data instanceof FormData)c.data.append(IP_GEO_BLOCK_ZEP.auth,a);else if(b=h(c.url),"undefined"===typeof c.data||b.query)c.url=g(b,a);else{b=c.data?c.data.split("&"):[];var d;d=location.pathname;d=d.replace(IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin,"");(d=r.hasOwnProperty(d)?r[d]:null)&&(b=d(b));b.push(IP_GEO_BLOCK_ZEP.auth+"="+m(a));c.data=b.join("&")}});"undefined"===typeof e.fn.onFirst&&(e.fn.onFirst=function(a,b){var c,d=e(this),f="string"===typeof b;e.fn.on.apply(d,arguments);if("object"===typeof a)for(c in a)a.hasOwnProperty(c)&&n(d,c,f);else"string"===typeof a&&n(d,a,f);return d});e(function(){p();IP_GEO_BLOCK_ZEP.init=!0});e(window).on("error",function(){IP_GEO_BLOCK_ZEP.init||p()})})(jQuery,document);
admin/js/footable.min.js CHANGED
@@ -3,6 +3,8 @@
3
* Version : 2.0.3
4
* http://fooplugins.com/plugins/footable-jquery/
5
*
6
* Copyright 2014 Steven Usher & Brad Vincent
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.
@@ -10,7 +12,7 @@
10
* Date: 11 Nov 2014
11
*
12
* This is a customized version for IP Geo Block.
13
- * footable.js + footable.paginate.js + footable.sort.js + footable.striping.js + footable.filter.js
14
* https://github.com/fooplugins/FooTable/issues/298
15
*/
16
(function(d,m,w){function t(){var d=this;d.id=null;d.busy=!1;d.start=function(g,h){d.busy||(d.stop(),d.id=setTimeout(function(){g();d.id=null;d.busy=!1},h),d.busy=!0)};d.stop=function(){null!==d.id&&(clearTimeout(d.id),d.id=null,d.busy=!1)}}function v(a,g,h){var b=this;b.id=h;b.table=a;b.options=g;b.breakpoints=[];b.breakpointNames="";b.columns={};b.plugins=m.footable.plugins.load(b);var l=b.options,e=l.classes,n=l.events,k=l.triggers,r=0;b.timers={resize:new t,register:function(c){b.timers[c]=new t;return b.timers[c]}};b.init=function(){var c=d(m),f=d(b.table);m.footable.plugins.init(b);if(f.hasClass(e.loaded))b.raise(n.alreadyInitialized);else{b.raise(n.initializing);f.addClass(e.loading);f.find(l.columnDataSelector).each(function(){var c=b.getColumnData(this);b.columns[c.index]=c});for(var a in l.breakpoints)b.breakpoints.push({name:a,width:l.breakpoints[a]}),b.breakpointNames+=a+" ";b.breakpoints.sort(function(b,c){return b.width-c.width});f.unbind(k.initialize).bind(k.initialize,function(){f.removeData("footable_info");f.data("breakpoint","");f.trigger(k.resize);f.removeClass(e.loading);f.addClass(e.loaded).addClass(e.main);b.raise(n.initialized)}).unbind(k.redraw).bind(k.redraw,function(){b.redraw()}).unbind(k.resize).bind(k.resize,function(){b.resize()}).unbind(k.expandFirstRow).bind(k.expandFirstRow,function(){f.find(l.toggleSelector).first().not("."+e.detailShow).trigger(k.toggleRow)}).unbind(k.expandAll).bind(k.expandAll,function(){f.find(l.toggleSelector).not("."+e.detailShow).trigger(k.toggleRow)}).unbind(k.collapseAll).bind(k.collapseAll,function(){f.find("."+e.detailShow).trigger(k.toggleRow)});f.trigger(k.initialize);c.bind("resize.footable",function(){b.timers.resize.stop();b.timers.resize.start(function(){b.raise(k.resize)},l.delay)})}};b.addRowToggle=function(){if(l.addRowToggle){var c=d(b.table);c.find("span."+e.toggle).remove();for(var f in b.columns){var a=b.columns[f];if(a.toggle){c=c.find("> tbody");a="> tr:not(."+e.detail+",."+e.disabled+") > td:nth-child("+(parseInt(a.index,10)+1)+"),> tr:not(."+e.detail+",."+e.disabled+") > th:nth-child("+(parseInt(a.index,10)+1)+")";c.find(a).not("."+e.detailCell).prepend(d(l.toggleHTMLElement).addClass(e.toggle));return}}c.find("> tbody > tr:not(."+e.detail+",."+e.disabled+") > td:first-child").add("> tbody > tr:not(."+e.detail+",."+e.disabled+") > th:first-child").not("."+e.detailCell).prepend(d(l.toggleHTMLElement).addClass(e.toggle))}};b.setColumnClasses=function(){var c=d(b.table),f;for(f in b.columns){var a=b.columns[f];if(null!==a.className){var q="",p=!0;d.each(a.matches,function(b,c){p||(q+=", ");q+="> tbody > tr:not(."+e.detail+") > td:nth-child("+(parseInt(c,10)+1)+")";p=!1});c.find(q).not("."+e.detailCell).addClass(a.className)}}};b.bindToggleSelectors=function(){var c=d(b.table);b.hasAnyBreakpointColumn()&&(c.find(l.toggleSelector).unbind(k.toggleRow).bind(k.toggleRow,function(c){c=d(this).is("tr")?d(this):d(this).parents("tr:first");b.toggleDetail(c)}),c.find(l.toggleSelector).unbind("click.footable").bind("click.footable",function(b){c.is(".breakpoint")&&d(b.target).is("td,th,."+e.toggle)&&d(this).trigger(k.toggleRow)}))};b.parse=function(b,f){return(l.parsers[f.type]||l.parsers.alpha)(b)};b.getColumnData=function(c){var f=d(c),a=f.data("hide"),e=f.index(),a=jQuery.map((a||"").split(","),function(b){return jQuery.trim(b)}),e={index:e,hide:{},type:f.data("type")||"alpha",name:f.data("name")||d.trim(f.text()),ignore:f.data("ignore")||!1,toggle:f.data("toggle")||!1,className:f.data("class")||null,matches:[],names:{},group:f.data("group")||null,groupName:null,isEditable:f.data("editable")};if(null!==e.group){var p=d(b.table).find('> thead > tr.footable-group-row > th[data-group="'+e.group+'"], > thead > tr.footable-group-row > td[data-group="'+e.group+'"]').first();e.groupName=b.parse(p,{type:"alpha"})}p=parseInt(f.prev().attr("colspan")||0,10);r+=1<p?p-1:0;var p=parseInt(f.attr("colspan")||0,10),g=e.index+r;if(1<p)for(var h=f.data("names"),h=(h||"").split(","),k=0;k<p;k++)e.matches.push(k+g),k<h.length&&(e.names[k+g]=h[k]);else e.matches.push(g);e.hide["default"]="all"===f.data("hide")||0<=d.inArray("default",a);var p=!1,m;for(m in l.breakpoints)e.hide[m]="all"===f.data("hide")||0<=d.inArray(m,a),p=p||e.hide[m];e.hasBreakpoint=p;return b.raise(n.columnData,{column:{data:e,th:c}}).column.data};b.getViewportWidth=function(){return window.innerWidth||(document.body?document.body.offsetWidth:0)};b.calculateWidth=function(b,f){if(jQuery.isFunction(l.calculateWidthOverride))return l.calculateWidthOverride(b,f);f.viewportWidth<f.width&&(f.width=f.viewportWidth);f.parentWidth<f.width&&(f.width=f.parentWidth);return f};b.hasBreakpointColumn=function(c){for(var f in b.columns)if(b.columns[f].hide[c]&&!b.columns[f].ignore)return!0;return!1};b.hasAnyBreakpointColumn=function(){for(var c in b.columns)if(b.columns[c].hasBreakpoint)return!0;return!1};b.resize=function(){var c=d(b.table);if(c.is(":visible"))if(b.hasAnyBreakpointColumn()){var f={width:c.width(),viewportWidth:b.getViewportWidth(),parentWidth:c.parent().width()},f=b.calculateWidth(c,f),a=c.data("footable_info");c.data("footable_info",f);b.raise(n.resizing,{old:a,info:f});if(!a||a&&a.width&&a.width!==f.width){for(var e=null,g,h=0;h<b.breakpoints.length;h++)if((g=b.breakpoints[h])&&g.width&&f.width<=g.width){e=g;break}e=null===e?"default":e.name;g=b.hasBreakpointColumn(e);h=c.data("breakpoint");c.data("breakpoint",e).removeClass("default breakpoint").removeClass(b.breakpointNames).addClass(e+(g?" breakpoint":""));e!==h&&(c.trigger(k.redraw),b.raise(n.breakpoint,{breakpoint:e,info:f}))}b.raise(n.resized,{old:a,info:f})}else c.trigger(k.redraw)};b.redraw=function(){b.addRowToggle();b.bindToggleSelectors();b.setColumnClasses();var c=d(b.table),f=c.data("breakpoint"),a=b.hasBreakpointColumn(f);c.find("> tbody > tr:not(."+e.detail+")").data("detail_created",!1).end().find("> thead > tr:last-child > th").each(function(){var a=b.columns[d(this).index()],g="",h=!0;d.each(a.matches,function(b,c){h||(g+=", ");var a=c+1;g+="> tbody > tr:not(."+e.detail+") > td:nth-child("+a+")";g+=", > tfoot > tr:not(."+e.detail+") > td:nth-child("+a+")";g+=", > colgroup > col:nth-child("+a+")";h=!1});var g=g+(', > thead > tr[data-group-row="true"] > th[data-group="'+a.group+'"]'),k=c.find(g).add(this);""!==f&&(!1===a.hide[f]?k.addClass("footable-visible").show():k.removeClass("footable-visible").hide());if(1===c.find("> thead > tr.footable-group-row").length){var k=c.find('> thead > tr:last-child > th[data-group="'+a.group+'"]:visible, > thead > tr:last-child > th[data-group="'+a.group+'"]:visible'),a=c.find('> thead > tr.footable-group-row > th[data-group="'+a.group+'"], > thead > tr.footable-group-row > td[data-group="'+a.group+'"]'),l=0;d.each(k,function(){l+=parseInt(d(this).attr("colspan")||1,10)});0<l?a.attr("colspan",l).show():a.hide()}}).end().find("> tbody > tr."+e.detailShow).each(function(){b.createOrUpdateDetailRow(this)});c.find("[data-bind-name]").each(function(){b.toggleInput(this)});c.find("> tbody > tr."+e.detailShow+":visible").each(function(){var b=d(this).next();b.hasClass(e.detail)&&(a?b.show():b.hide())});c.find("> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column").removeClass("footable-last-column");c.find("> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column").removeClass("footable-first-column");c.find("> thead > tr, > tbody > tr").find("> th.footable-visible:last, > td.footable-visible:last").addClass("footable-last-column").end().find("> th.footable-visible:first, > td.footable-visible:first").addClass("footable-first-column");b.raise(n.redrawn)};b.toggleDetail=function(c){c=c.jquery?c:d(c);var a=c.next();c.hasClass(e.detailShow)?(c.removeClass(e.detailShow),a.hasClass(e.detail)&&a.hide(),b.raise(n.rowCollapsed,{row:c[0]})):(b.createOrUpdateDetailRow(c[0]),c.addClass(e.detailShow).next().show(),b.raise(n.rowExpanded,{row:c[0]}))};b.removeRow=function(c){c=c.jquery?c:d(c);c.hasClass(e.detail)&&(c=c.prev());var a=c.next();!0===c.data("detail_created")&&a.remove();c.remove();b.raise(n.rowRemoved)};b.appendRow=function(c){c=c.jquery?c:d(c);d(b.table).find("tbody").append(c);b.redraw()};b.getColumnFromTdIndex=function(c){var a=null,e;for(e in b.columns)if(0<=d.inArray(c,b.columns[e].matches)){a=b.columns[e];break}return a};b.createOrUpdateDetailRow=function(c){c=d(c);var a=c.next(),g,h=[];if(!0===c.data("detail_created"))return!0;if(c.is(":hidden"))return!1;b.raise(n.rowDetailUpdating,{row:c,detail:a});c.find("> td:hidden").each(function(){var c=d(this).index(),a=b.getColumnFromTdIndex(c),f=a.name;if(!0===a.ignore)return!0;c in a.names&&(f=a.names[c]);var g=d(this).attr("data-bind-name");if(null!=g&&d(this).is(":empty")){var k=d("."+e.detailInnerValue+'[data-bind-value="'+g+'"]');d(this).html(d(k).contents().detach())}var l;!1!==a.isEditable&&(a.isEditable||0<d(this).find(":input").length)&&(null==g&&(g="bind-"+d.now()+"-"+c,d(this).attr("data-bind-name",g)),l=d(this).contents().detach());l||(l=d(this).contents().clone(!0,!0));h.push({name:f,value:b.parse(this,a),display:l,group:a.group,groupName:a.groupName,bindName:g});return!0});if(0===h.length)return!1;g=c.find("> td:visible").length;var k=a.hasClass(e.detail);k||(a=d('<tr class="'+e.detail+'"><td class="'+e.detailCell+'"><div class="'+e.detailInner+'"></div></td></tr>'),c.after(a));a.find("> td:first").attr("colspan",g);g=a.find("."+e.detailInner).empty();l.createDetail(g,h,l.createGroupedDetail,l.detailSeparator,e);c.data("detail_created",!0);b.raise(n.rowDetailUpdated,{row:c,detail:a});return!k};b.raise=function(a,e){!0===b.options.debug&&d.isFunction(b.options.log)&&b.options.log(a,"event");e=e||{};var g={ft:b};d.extend(!0,g,e);var h=d.Event(a,g);h.ft||d.extend(!0,h,g);d(b.table).trigger(h);return h};b.reset=function(){var a=d(b.table);a.removeData("footable_info").data("breakpoint","").removeClass(e.loading).removeClass(e.loaded);a.find(l.toggleSelector).unbind(k.toggleRow).unbind("click.footable");a.find("> tbody > tr").removeClass(e.detailShow);a.find("> tbody > tr."+e.detail).remove();b.raise(n.reset)};b.toggleInput=function(b){var a=d(b).attr("data-bind-name");null!=a&&(a=d("."+e.detailInnerValue+'[data-bind-value="'+a+'"]'),null!=a&&(d(b).is(":visible")?d(a).is(":empty")||d(b).html(d(a).contents().detach()):d(b).is(":empty")||d(a).html(d(b).contents().detach())))};b.init();return b}m.footable={options:{delay:100,breakpoints:{phone:480,tablet:1024},parsers:{alpha:function(a){return d(a).data("value")||d.trim(d(a).text())},numeric:function(a){a=d(a).data("value")||d(a).text().replace(/[^0-9.\-]/g,"");a=parseFloat(a);isNaN(a)&&(a=0);return a}},addRowToggle:!0,calculateWidthOverride:null,toggleSelector:" > tbody > tr:not(.footable-row-detail)",columnDataSelector:"> thead > tr:last-child > th, > thead > tr:last-child > td",detailSeparator:":",toggleHTMLElement:"<span />",createGroupedDetail:function(a){for(var d={_none:{name:null,data:[]}},h=0;h<a.length;h++){var b=a[h].group;null!==b?(b in d||(d[b]={name:a[h].groupName||a[h].group,data:[]}),d[b].data.push(a[h])):d._none.data.push(a[h])}return d},createDetail:function(a,g,h,b,l){g=h(g);for(var e in g)if(0!==g[e].data.length)for("_none"!==e&&a.append('<div class="'+l.detailInnerGroup+'">'+g[e].name+"</div>"),h=0;h<g[e].data.length;h++){var m=g[e].data[h].name?b:"";a.append(d("<div></div>").addClass(l.detailInnerRow).append(d("<div></div>").addClass(l.detailInnerName).append(g[e].data[h].name+m)).append(d("<div></div>").addClass(l.detailInnerValue).attr("data-bind-value",g[e].data[h].bindName).append(g[e].data[h].display)))}},classes:{main:"footable",loading:"footable-loading",loaded:"footable-loaded",toggle:"footable-toggle",disabled:"footable-disabled",detail:"footable-row-detail",detailCell:"footable-row-detail-cell",detailInner:"footable-row-detail-inner",detailInnerRow:"footable-row-detail-row",detailInnerGroup:"footable-row-detail-group",detailInnerName:"footable-row-detail-name",detailInnerValue:"footable-row-detail-value",detailShow:"footable-detail-show"},triggers:{initialize:"footable_initialize",resize:"footable_resize",redraw:"footable_redraw",toggleRow:"footable_toggle_row",expandFirstRow:"footable_expand_first_row",expandAll:"footable_expand_all",collapseAll:"footable_collapse_all"},events:{alreadyInitialized:"footable_already_initialized",initializing:"footable_initializing",initialized:"footable_initialized",resizing:"footable_resizing",resized:"footable_resized",redrawn:"footable_redrawn",breakpoint:"footable_breakpoint",columnData:"footable_column_data",rowDetailUpdating:"footable_row_detail_updating",rowDetailUpdated:"footable_row_detail_updated",rowCollapsed:"footable_row_collapsed",rowExpanded:"footable_row_expanded",rowRemoved:"footable_row_removed",reset:"footable_reset"},debug:!1,log:null},version:{major:0,minor:5,toString:function(){return m.footable.version.major+"."+m.footable.version.minor},parse:function(a){a=/(\d+)\.?(\d+)?\.?(\d+)?/.exec(a);return{major:parseInt(a[1],10)||0,minor:parseInt(a[2],10)||0,patch:parseInt(a[3],10)||0}}},plugins:{_validate:function(a){if(!d.isFunction(a))return!0===m.footable.options.debug&&console.error('Validation failed, expected type "function", received type "{0}".',typeof a),!1;a=new a;if("string"!==typeof a.name)return!0===m.footable.options.debug&&console.error('Validation failed, plugin does not implement a string property called "name".',a),!1;if(!d.isFunction(a.init))return!0===m.footable.options.debug&&console.error('Validation failed, plugin "'+a.name+'" does not implement a function called "init".',a),!1;!0===m.footable.options.debug&&console.log('Validation succeeded for plugin "'+a.name+'".',a);return!0},registered:[],register:function(a,g){m.footable.plugins._validate(a)&&(m.footable.plugins.registered.push(a),"object"===typeof g&&d.extend(!0,m.footable.options,g))},load:function(a){var d=[],h,b;for(b=0;b<m.footable.plugins.registered.length;b++)try{h=m.footable.plugins.registered[b],d.push(new h(a))}catch(l){!0===m.footable.options.debug&&console.error(l)}return d},init:function(a){for(var d=0;d<a.plugins.length;d++)try{a.plugins[d].init(a)}catch(h){!0===m.footable.options.debug&&console.error(h)}}}};var u=0;d.fn.footable=function(a){a=a||{};var g=d.extend(!0,{},m.footable.options,a);return this.each(function(){u++;var a=new v(this,g,u);d(this).data("footable",a)})}})(jQuery,window);
@@ -19,6 +21,4 @@
19
/* sort */
20
(function(t,e,undefined){function a(){var e=this;e.name="Footable Sortable",e.init=function(a){e.footable=a,a.options.sort===!0&&t(a.table).unbind(".sorting").bind({"footable_initialized.sorting":function(){var i,o,n=t(a.table),r=(n.find("> tbody"),a.options.classes.sort);if(n.data("sort")!==!1){n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").each(function(){var e=t(this),i=a.columns[e.index()];i.sort.ignore===!0||e.hasClass(r.sortable)||(e.addClass(r.sortable),t("<span />").addClass(r.indicator).appendTo(e))}),n.find("> thead > tr:last-child > th."+r.sortable+", > thead > tr:last-child > td."+r.sortable).unbind("click.footable").bind("click.footable",function(a){a.preventDefault(),o=t(this);var i=!o.hasClass(r.sorted);return e.doSort(o.index(),i),!1});var l=!1;for(var s in a.columns)if(i=a.columns[s],i.sort.initial){var d="descending"!==i.sort.initial;e.doSort(i.index,d);break}l&&a.bindToggleSelectors()}},"footable_redrawn.sorting":function(){var i=t(a.table),o=a.options.classes.sort;i.data("sorted")>=0&&i.find("> thead > tr:last-child > th").each(function(a){var i=t(this);return i.hasClass(o.sorted)||i.hasClass(o.descending)?(e.doSort(a),undefined):undefined})},"footable_column_data.sorting":function(e){var a=t(e.column.th);e.column.data.sort=e.column.data.sort||{},e.column.data.sort.initial=a.data("sort-initial")||!1,e.column.data.sort.ignore=a.data("sort-ignore")||!1,e.column.data.sort.selector=a.data("sort-selector")||null;var i=a.data("sort-match")||0;i>=e.column.data.matches.length&&(i=0),e.column.data.sort.match=e.column.data.matches[i]}}).data("footable-sort",e)},e.doSort=function(a,i){var o=e.footable;if(t(o.table).data("sort")!==!1){var n=t(o.table),r=n.find("> tbody"),l=o.columns[a],s=n.find("> thead > tr:last-child > th:eq("+a+")"),d=o.options.classes.sort,f=o.options.events.sort;if(i=i===undefined?s.hasClass(d.sorted):"toggle"===i?!s.hasClass(d.sorted):i,l.sort.ignore===!0)return!0;var u=o.raise(f.sorting,{column:l,direction:i?"ASC":"DESC"});u&&u.result===!1||(n.data("sorted",l.index),n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").not(s).removeClass(d.sorted+" "+d.descending),i===undefined&&(i=s.hasClass(d.sorted)),i?s.removeClass(d.descending).addClass(d.sorted):s.removeClass(d.sorted).addClass(d.descending),e.sort(o,r,l,i),o.bindToggleSelectors(),o.raise(f.sorted,{column:l,direction:i?"ASC":"DESC"}))}},e.rows=function(e,a,i){var o=[];return a.find("> tr").each(function(){var a=t(this),n=null;if(a.hasClass(e.options.classes.detail))return!0;a.next().hasClass(e.options.classes.detail)&&(n=a.next().get(0));var r={row:a,detail:n};return i!==undefined&&(r.value=e.parse(this.cells[i.sort.match],i)),o.push(r),!0}).detach(),o},e.sort=function(t,a,i,o){var n=e.rows(t,a,i),r=t.options.sorters[i.type]||t.options.sorters.alpha;n.sort(function(t,e){return o?r(t.value,e.value):r(e.value,t.value)});for(var l=0;n.length>l;l++)a.append(n[l].row),null!==n[l].detail&&a.append(n[l].detail)}}if(e.footable===undefined||null===e.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={sort:!0,sorters:{alpha:function(t,e){return"string"==typeof t&&(t=t.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),t===e?0:e>t?-1:1},numeric:function(t,e){return t-e}},classes:{sort:{sortable:"footable-sortable",sorted:"footable-sorted",descending:"footable-sorted-desc",indicator:"footable-sort-indicator"}},events:{sort:{sorting:"footable_sorting",sorted:"footable_sorted"}}};e.footable.plugins.register(a,i)})(jQuery,window);
21
/* striping */
22
- (function(t,e,undefined){function a(){var e=this;e.name="Footable Striping",e.init=function(a){e.footable=a,t(a.table).unbind("striping").bind({"footable_initialized.striping footable_row_removed.striping footable_redrawn.striping footable_sorted.striping footable_filtered.striping":function(){t(this).data("striping")!==!1&&e.setupStriping(a)}})},e.setupStriping=function(e){var a=0;t(e.table).find("> tbody > tr:not(.footable-row-detail)").each(function(){var i=t(this);i.removeClass(e.options.classes.striping.even).removeClass(e.options.classes.striping.odd),0===a%2?i.addClass(e.options.classes.striping.even):i.addClass(e.options.classes.striping.odd),a++})}}if(e.footable===undefined||null===e.foobox)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={striping:{enabled:!0},classes:{striping:{odd:"footable-odd",even:"footable-even"}}};e.footable.plugins.register(a,i)})(jQuery,window);
23
- /* filter */
24
- (function(t,e,undefined){function a(){var e=this;e.name="Footable Filter",e.init=function(a){if(e.footable=a,a.options.filter.enabled===!0){if(t(a.table).data("filter")===!1)return;a.timers.register("filter"),t(a.table).unbind(".filtering").bind({"footable_initialized.filtering":function(){var i=t(a.table),o={input:i.data("filter")||a.options.filter.input,timeout:i.data("filter-timeout")||a.options.filter.timeout,minimum:i.data("filter-minimum")||a.options.filter.minimum,disableEnter:i.data("filter-disable-enter")||a.options.filter.disableEnter};o.disableEnter&&t(o.input).keypress(function(t){return window.event?13!==window.event.keyCode:13!==t.which}),i.bind("footable_clear_filter",function(){t(o.input).val(""),e.clearFilter()}),i.bind("footable_filter",function(t,a){e.filter(a.filter)}),t(o.input).keyup(function(i){a.timers.filter.stop(),27===i.which&&t(o.input).val(""),a.timers.filter.start(function(){var a=t(o.input).val()||"";e.filter(a)},o.timeout)})},"footable_redrawn.filtering":function(){var i=t(a.table),o=i.data("filter-string");o&&e.filter(o)}}).data("footable-filter",e)}},e.filter=function(a){var i=e.footable,o=t(i.table),n=o.data("filter-minimum")||i.options.filter.minimum,r=!a,l=i.raise("footable_filtering",{filter:a,clear:r});if(!(l&&l.result===!1||l.filter&&n>l.filter.length))if(l.clear)e.clearFilter();else{var d=l.filter.split(" ");o.find("> tbody > tr").hide().addClass("footable-filtered");var s=o.find("> tbody > tr:not(.footable-row-detail)");t.each(d,function(t,e){e&&e.length>0&&(o.data("current-filter",e),s=s.filter(i.options.filter.filterFunction))}),s.each(function(){e.showRow(this,i),t(this).removeClass("footable-filtered")}),o.data("filter-string",l.filter),i.raise("footable_filtered",{filter:l.filter,clear:!1})}},e.clearFilter=function(){var a=e.footable,i=t(a.table);i.find("> tbody > tr:not(.footable-row-detail)").removeClass("footable-filtered").each(function(){e.showRow(this,a)}),i.removeData("filter-string"),a.raise("footable_filtered",{clear:!0})},e.showRow=function(e,a){var i=t(e),o=i.next(),n=t(a.table);i.is(":visible")||(n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(e)):i.show())}}if(e.footable===undefined||null===e.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={filter:{enabled:!0,input:".footable-filter",timeout:300,minimum:2,disableEnter:!1,filterFunction:function(){var e=t(this),a=e.parents("table:first"),i=a.data("current-filter").toUpperCase(),o=e.find("td").text();return a.data("filter-text-only")||e.find("td[data-value]").each(function(){o+=t(this).data("value")}),o.toUpperCase().indexOf(i)>=0}}};e.footable.plugins.register(a,i)})(jQuery,window);
3
* Version : 2.0.3
4
* http://fooplugins.com/plugins/footable-jquery/
5
*
6
+ * Requires jQuery - http://jquery.com/
7
+ *
8
* Copyright 2014 Steven Usher & Brad Vincent
9
* Released under the MIT license
10
* You are free to use FooTable in commercial projects as long as this copyright header is left intact.
12
* Date: 11 Nov 2014
13
*
14
* This is a customized version for IP Geo Block.
15
+ * footable.js + footable.paginate.js + footable.sort.js + footable.striping.js
16
* https://github.com/fooplugins/FooTable/issues/298
17
*/
18
(function(d,m,w){function t(){var d=this;d.id=null;d.busy=!1;d.start=function(g,h){d.busy||(d.stop(),d.id=setTimeout(function(){g();d.id=null;d.busy=!1},h),d.busy=!0)};d.stop=function(){null!==d.id&&(clearTimeout(d.id),d.id=null,d.busy=!1)}}function v(a,g,h){var b=this;b.id=h;b.table=a;b.options=g;b.breakpoints=[];b.breakpointNames="";b.columns={};b.plugins=m.footable.plugins.load(b);var l=b.options,e=l.classes,n=l.events,k=l.triggers,r=0;b.timers={resize:new t,register:function(c){b.timers[c]=new t;return b.timers[c]}};b.init=function(){var c=d(m),f=d(b.table);m.footable.plugins.init(b);if(f.hasClass(e.loaded))b.raise(n.alreadyInitialized);else{b.raise(n.initializing);f.addClass(e.loading);f.find(l.columnDataSelector).each(function(){var c=b.getColumnData(this);b.columns[c.index]=c});for(var a in l.breakpoints)b.breakpoints.push({name:a,width:l.breakpoints[a]}),b.breakpointNames+=a+" ";b.breakpoints.sort(function(b,c){return b.width-c.width});f.unbind(k.initialize).bind(k.initialize,function(){f.removeData("footable_info");f.data("breakpoint","");f.trigger(k.resize);f.removeClass(e.loading);f.addClass(e.loaded).addClass(e.main);b.raise(n.initialized)}).unbind(k.redraw).bind(k.redraw,function(){b.redraw()}).unbind(k.resize).bind(k.resize,function(){b.resize()}).unbind(k.expandFirstRow).bind(k.expandFirstRow,function(){f.find(l.toggleSelector).first().not("."+e.detailShow).trigger(k.toggleRow)}).unbind(k.expandAll).bind(k.expandAll,function(){f.find(l.toggleSelector).not("."+e.detailShow).trigger(k.toggleRow)}).unbind(k.collapseAll).bind(k.collapseAll,function(){f.find("."+e.detailShow).trigger(k.toggleRow)});f.trigger(k.initialize);c.bind("resize.footable",function(){b.timers.resize.stop();b.timers.resize.start(function(){b.raise(k.resize)},l.delay)})}};b.addRowToggle=function(){if(l.addRowToggle){var c=d(b.table);c.find("span."+e.toggle).remove();for(var f in b.columns){var a=b.columns[f];if(a.toggle){c=c.find("> tbody");a="> tr:not(."+e.detail+",."+e.disabled+") > td:nth-child("+(parseInt(a.index,10)+1)+"),> tr:not(."+e.detail+",."+e.disabled+") > th:nth-child("+(parseInt(a.index,10)+1)+")";c.find(a).not("."+e.detailCell).prepend(d(l.toggleHTMLElement).addClass(e.toggle));return}}c.find("> tbody > tr:not(."+e.detail+",."+e.disabled+") > td:first-child").add("> tbody > tr:not(."+e.detail+",."+e.disabled+") > th:first-child").not("."+e.detailCell).prepend(d(l.toggleHTMLElement).addClass(e.toggle))}};b.setColumnClasses=function(){var c=d(b.table),f;for(f in b.columns){var a=b.columns[f];if(null!==a.className){var q="",p=!0;d.each(a.matches,function(b,c){p||(q+=", ");q+="> tbody > tr:not(."+e.detail+") > td:nth-child("+(parseInt(c,10)+1)+")";p=!1});c.find(q).not("."+e.detailCell).addClass(a.className)}}};b.bindToggleSelectors=function(){var c=d(b.table);b.hasAnyBreakpointColumn()&&(c.find(l.toggleSelector).unbind(k.toggleRow).bind(k.toggleRow,function(c){c=d(this).is("tr")?d(this):d(this).parents("tr:first");b.toggleDetail(c)}),c.find(l.toggleSelector).unbind("click.footable").bind("click.footable",function(b){c.is(".breakpoint")&&d(b.target).is("td,th,."+e.toggle)&&d(this).trigger(k.toggleRow)}))};b.parse=function(b,f){return(l.parsers[f.type]||l.parsers.alpha)(b)};b.getColumnData=function(c){var f=d(c),a=f.data("hide"),e=f.index(),a=jQuery.map((a||"").split(","),function(b){return jQuery.trim(b)}),e={index:e,hide:{},type:f.data("type")||"alpha",name:f.data("name")||d.trim(f.text()),ignore:f.data("ignore")||!1,toggle:f.data("toggle")||!1,className:f.data("class")||null,matches:[],names:{},group:f.data("group")||null,groupName:null,isEditable:f.data("editable")};if(null!==e.group){var p=d(b.table).find('> thead > tr.footable-group-row > th[data-group="'+e.group+'"], > thead > tr.footable-group-row > td[data-group="'+e.group+'"]').first();e.groupName=b.parse(p,{type:"alpha"})}p=parseInt(f.prev().attr("colspan")||0,10);r+=1<p?p-1:0;var p=parseInt(f.attr("colspan")||0,10),g=e.index+r;if(1<p)for(var h=f.data("names"),h=(h||"").split(","),k=0;k<p;k++)e.matches.push(k+g),k<h.length&&(e.names[k+g]=h[k]);else e.matches.push(g);e.hide["default"]="all"===f.data("hide")||0<=d.inArray("default",a);var p=!1,m;for(m in l.breakpoints)e.hide[m]="all"===f.data("hide")||0<=d.inArray(m,a),p=p||e.hide[m];e.hasBreakpoint=p;return b.raise(n.columnData,{column:{data:e,th:c}}).column.data};b.getViewportWidth=function(){return window.innerWidth||(document.body?document.body.offsetWidth:0)};b.calculateWidth=function(b,f){if(jQuery.isFunction(l.calculateWidthOverride))return l.calculateWidthOverride(b,f);f.viewportWidth<f.width&&(f.width=f.viewportWidth);f.parentWidth<f.width&&(f.width=f.parentWidth);return f};b.hasBreakpointColumn=function(c){for(var f in b.columns)if(b.columns[f].hide[c]&&!b.columns[f].ignore)return!0;return!1};b.hasAnyBreakpointColumn=function(){for(var c in b.columns)if(b.columns[c].hasBreakpoint)return!0;return!1};b.resize=function(){var c=d(b.table);if(c.is(":visible"))if(b.hasAnyBreakpointColumn()){var f={width:c.width(),viewportWidth:b.getViewportWidth(),parentWidth:c.parent().width()},f=b.calculateWidth(c,f),a=c.data("footable_info");c.data("footable_info",f);b.raise(n.resizing,{old:a,info:f});if(!a||a&&a.width&&a.width!==f.width){for(var e=null,g,h=0;h<b.breakpoints.length;h++)if((g=b.breakpoints[h])&&g.width&&f.width<=g.width){e=g;break}e=null===e?"default":e.name;g=b.hasBreakpointColumn(e);h=c.data("breakpoint");c.data("breakpoint",e).removeClass("default breakpoint").removeClass(b.breakpointNames).addClass(e+(g?" breakpoint":""));e!==h&&(c.trigger(k.redraw),b.raise(n.breakpoint,{breakpoint:e,info:f}))}b.raise(n.resized,{old:a,info:f})}else c.trigger(k.redraw)};b.redraw=function(){b.addRowToggle();b.bindToggleSelectors();b.setColumnClasses();var c=d(b.table),f=c.data("breakpoint"),a=b.hasBreakpointColumn(f);c.find("> tbody > tr:not(."+e.detail+")").data("detail_created",!1).end().find("> thead > tr:last-child > th").each(function(){var a=b.columns[d(this).index()],g="",h=!0;d.each(a.matches,function(b,c){h||(g+=", ");var a=c+1;g+="> tbody > tr:not(."+e.detail+") > td:nth-child("+a+")";g+=", > tfoot > tr:not(."+e.detail+") > td:nth-child("+a+")";g+=", > colgroup > col:nth-child("+a+")";h=!1});var g=g+(', > thead > tr[data-group-row="true"] > th[data-group="'+a.group+'"]'),k=c.find(g).add(this);""!==f&&(!1===a.hide[f]?k.addClass("footable-visible").show():k.removeClass("footable-visible").hide());if(1===c.find("> thead > tr.footable-group-row").length){var k=c.find('> thead > tr:last-child > th[data-group="'+a.group+'"]:visible, > thead > tr:last-child > th[data-group="'+a.group+'"]:visible'),a=c.find('> thead > tr.footable-group-row > th[data-group="'+a.group+'"], > thead > tr.footable-group-row > td[data-group="'+a.group+'"]'),l=0;d.each(k,function(){l+=parseInt(d(this).attr("colspan")||1,10)});0<l?a.attr("colspan",l).show():a.hide()}}).end().find("> tbody > tr."+e.detailShow).each(function(){b.createOrUpdateDetailRow(this)});c.find("[data-bind-name]").each(function(){b.toggleInput(this)});c.find("> tbody > tr."+e.detailShow+":visible").each(function(){var b=d(this).next();b.hasClass(e.detail)&&(a?b.show():b.hide())});c.find("> thead > tr > th.footable-last-column, > tbody > tr > td.footable-last-column").removeClass("footable-last-column");c.find("> thead > tr > th.footable-first-column, > tbody > tr > td.footable-first-column").removeClass("footable-first-column");c.find("> thead > tr, > tbody > tr").find("> th.footable-visible:last, > td.footable-visible:last").addClass("footable-last-column").end().find("> th.footable-visible:first, > td.footable-visible:first").addClass("footable-first-column");b.raise(n.redrawn)};b.toggleDetail=function(c){c=c.jquery?c:d(c);var a=c.next();c.hasClass(e.detailShow)?(c.removeClass(e.detailShow),a.hasClass(e.detail)&&a.hide(),b.raise(n.rowCollapsed,{row:c[0]})):(b.createOrUpdateDetailRow(c[0]),c.addClass(e.detailShow).next().show(),b.raise(n.rowExpanded,{row:c[0]}))};b.removeRow=function(c){c=c.jquery?c:d(c);c.hasClass(e.detail)&&(c=c.prev());var a=c.next();!0===c.data("detail_created")&&a.remove();c.remove();b.raise(n.rowRemoved)};b.appendRow=function(c){c=c.jquery?c:d(c);d(b.table).find("tbody").append(c);b.redraw()};b.getColumnFromTdIndex=function(c){var a=null,e;for(e in b.columns)if(0<=d.inArray(c,b.columns[e].matches)){a=b.columns[e];break}return a};b.createOrUpdateDetailRow=function(c){c=d(c);var a=c.next(),g,h=[];if(!0===c.data("detail_created"))return!0;if(c.is(":hidden"))return!1;b.raise(n.rowDetailUpdating,{row:c,detail:a});c.find("> td:hidden").each(function(){var c=d(this).index(),a=b.getColumnFromTdIndex(c),f=a.name;if(!0===a.ignore)return!0;c in a.names&&(f=a.names[c]);var g=d(this).attr("data-bind-name");if(null!=g&&d(this).is(":empty")){var k=d("."+e.detailInnerValue+'[data-bind-value="'+g+'"]');d(this).html(d(k).contents().detach())}var l;!1!==a.isEditable&&(a.isEditable||0<d(this).find(":input").length)&&(null==g&&(g="bind-"+d.now()+"-"+c,d(this).attr("data-bind-name",g)),l=d(this).contents().detach());l||(l=d(this).contents().clone(!0,!0));h.push({name:f,value:b.parse(this,a),display:l,group:a.group,groupName:a.groupName,bindName:g});return!0});if(0===h.length)return!1;g=c.find("> td:visible").length;var k=a.hasClass(e.detail);k||(a=d('<tr class="'+e.detail+'"><td class="'+e.detailCell+'"><div class="'+e.detailInner+'"></div></td></tr>'),c.after(a));a.find("> td:first").attr("colspan",g);g=a.find("."+e.detailInner).empty();l.createDetail(g,h,l.createGroupedDetail,l.detailSeparator,e);c.data("detail_created",!0);b.raise(n.rowDetailUpdated,{row:c,detail:a});return!k};b.raise=function(a,e){!0===b.options.debug&&d.isFunction(b.options.log)&&b.options.log(a,"event");e=e||{};var g={ft:b};d.extend(!0,g,e);var h=d.Event(a,g);h.ft||d.extend(!0,h,g);d(b.table).trigger(h);return h};b.reset=function(){var a=d(b.table);a.removeData("footable_info").data("breakpoint","").removeClass(e.loading).removeClass(e.loaded);a.find(l.toggleSelector).unbind(k.toggleRow).unbind("click.footable");a.find("> tbody > tr").removeClass(e.detailShow);a.find("> tbody > tr."+e.detail).remove();b.raise(n.reset)};b.toggleInput=function(b){var a=d(b).attr("data-bind-name");null!=a&&(a=d("."+e.detailInnerValue+'[data-bind-value="'+a+'"]'),null!=a&&(d(b).is(":visible")?d(a).is(":empty")||d(b).html(d(a).contents().detach()):d(b).is(":empty")||d(a).html(d(b).contents().detach())))};b.init();return b}m.footable={options:{delay:100,breakpoints:{phone:480,tablet:1024},parsers:{alpha:function(a){return d(a).data("value")||d.trim(d(a).text())},numeric:function(a){a=d(a).data("value")||d(a).text().replace(/[^0-9.\-]/g,"");a=parseFloat(a);isNaN(a)&&(a=0);return a}},addRowToggle:!0,calculateWidthOverride:null,toggleSelector:" > tbody > tr:not(.footable-row-detail)",columnDataSelector:"> thead > tr:last-child > th, > thead > tr:last-child > td",detailSeparator:":",toggleHTMLElement:"<span />",createGroupedDetail:function(a){for(var d={_none:{name:null,data:[]}},h=0;h<a.length;h++){var b=a[h].group;null!==b?(b in d||(d[b]={name:a[h].groupName||a[h].group,data:[]}),d[b].data.push(a[h])):d._none.data.push(a[h])}return d},createDetail:function(a,g,h,b,l){g=h(g);for(var e in g)if(0!==g[e].data.length)for("_none"!==e&&a.append('<div class="'+l.detailInnerGroup+'">'+g[e].name+"</div>"),h=0;h<g[e].data.length;h++){var m=g[e].data[h].name?b:"";a.append(d("<div></div>").addClass(l.detailInnerRow).append(d("<div></div>").addClass(l.detailInnerName).append(g[e].data[h].name+m)).append(d("<div></div>").addClass(l.detailInnerValue).attr("data-bind-value",g[e].data[h].bindName).append(g[e].data[h].display)))}},classes:{main:"footable",loading:"footable-loading",loaded:"footable-loaded",toggle:"footable-toggle",disabled:"footable-disabled",detail:"footable-row-detail",detailCell:"footable-row-detail-cell",detailInner:"footable-row-detail-inner",detailInnerRow:"footable-row-detail-row",detailInnerGroup:"footable-row-detail-group",detailInnerName:"footable-row-detail-name",detailInnerValue:"footable-row-detail-value",detailShow:"footable-detail-show"},triggers:{initialize:"footable_initialize",resize:"footable_resize",redraw:"footable_redraw",toggleRow:"footable_toggle_row",expandFirstRow:"footable_expand_first_row",expandAll:"footable_expand_all",collapseAll:"footable_collapse_all"},events:{alreadyInitialized:"footable_already_initialized",initializing:"footable_initializing",initialized:"footable_initialized",resizing:"footable_resizing",resized:"footable_resized",redrawn:"footable_redrawn",breakpoint:"footable_breakpoint",columnData:"footable_column_data",rowDetailUpdating:"footable_row_detail_updating",rowDetailUpdated:"footable_row_detail_updated",rowCollapsed:"footable_row_collapsed",rowExpanded:"footable_row_expanded",rowRemoved:"footable_row_removed",reset:"footable_reset"},debug:!1,log:null},version:{major:0,minor:5,toString:function(){return m.footable.version.major+"."+m.footable.version.minor},parse:function(a){a=/(\d+)\.?(\d+)?\.?(\d+)?/.exec(a);return{major:parseInt(a[1],10)||0,minor:parseInt(a[2],10)||0,patch:parseInt(a[3],10)||0}}},plugins:{_validate:function(a){if(!d.isFunction(a))return!0===m.footable.options.debug&&console.error('Validation failed, expected type "function", received type "{0}".',typeof a),!1;a=new a;if("string"!==typeof a.name)return!0===m.footable.options.debug&&console.error('Validation failed, plugin does not implement a string property called "name".',a),!1;if(!d.isFunction(a.init))return!0===m.footable.options.debug&&console.error('Validation failed, plugin "'+a.name+'" does not implement a function called "init".',a),!1;!0===m.footable.options.debug&&console.log('Validation succeeded for plugin "'+a.name+'".',a);return!0},registered:[],register:function(a,g){m.footable.plugins._validate(a)&&(m.footable.plugins.registered.push(a),"object"===typeof g&&d.extend(!0,m.footable.options,g))},load:function(a){var d=[],h,b;for(b=0;b<m.footable.plugins.registered.length;b++)try{h=m.footable.plugins.registered[b],d.push(new h(a))}catch(l){!0===m.footable.options.debug&&console.error(l)}return d},init:function(a){for(var d=0;d<a.plugins.length;d++)try{a.plugins[d].init(a)}catch(h){!0===m.footable.options.debug&&console.error(h)}}}};var u=0;d.fn.footable=function(a){a=a||{};var g=d.extend(!0,{},m.footable.options,a);return this.each(function(){u++;var a=new v(this,g,u);d(this).data("footable",a)})}})(jQuery,window);
21
/* sort */
22
(function(t,e,undefined){function a(){var e=this;e.name="Footable Sortable",e.init=function(a){e.footable=a,a.options.sort===!0&&t(a.table).unbind(".sorting").bind({"footable_initialized.sorting":function(){var i,o,n=t(a.table),r=(n.find("> tbody"),a.options.classes.sort);if(n.data("sort")!==!1){n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").each(function(){var e=t(this),i=a.columns[e.index()];i.sort.ignore===!0||e.hasClass(r.sortable)||(e.addClass(r.sortable),t("<span />").addClass(r.indicator).appendTo(e))}),n.find("> thead > tr:last-child > th."+r.sortable+", > thead > tr:last-child > td."+r.sortable).unbind("click.footable").bind("click.footable",function(a){a.preventDefault(),o=t(this);var i=!o.hasClass(r.sorted);return e.doSort(o.index(),i),!1});var l=!1;for(var s in a.columns)if(i=a.columns[s],i.sort.initial){var d="descending"!==i.sort.initial;e.doSort(i.index,d);break}l&&a.bindToggleSelectors()}},"footable_redrawn.sorting":function(){var i=t(a.table),o=a.options.classes.sort;i.data("sorted")>=0&&i.find("> thead > tr:last-child > th").each(function(a){var i=t(this);return i.hasClass(o.sorted)||i.hasClass(o.descending)?(e.doSort(a),undefined):undefined})},"footable_column_data.sorting":function(e){var a=t(e.column.th);e.column.data.sort=e.column.data.sort||{},e.column.data.sort.initial=a.data("sort-initial")||!1,e.column.data.sort.ignore=a.data("sort-ignore")||!1,e.column.data.sort.selector=a.data("sort-selector")||null;var i=a.data("sort-match")||0;i>=e.column.data.matches.length&&(i=0),e.column.data.sort.match=e.column.data.matches[i]}}).data("footable-sort",e)},e.doSort=function(a,i){var o=e.footable;if(t(o.table).data("sort")!==!1){var n=t(o.table),r=n.find("> tbody"),l=o.columns[a],s=n.find("> thead > tr:last-child > th:eq("+a+")"),d=o.options.classes.sort,f=o.options.events.sort;if(i=i===undefined?s.hasClass(d.sorted):"toggle"===i?!s.hasClass(d.sorted):i,l.sort.ignore===!0)return!0;var u=o.raise(f.sorting,{column:l,direction:i?"ASC":"DESC"});u&&u.result===!1||(n.data("sorted",l.index),n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").not(s).removeClass(d.sorted+" "+d.descending),i===undefined&&(i=s.hasClass(d.sorted)),i?s.removeClass(d.descending).addClass(d.sorted):s.removeClass(d.sorted).addClass(d.descending),e.sort(o,r,l,i),o.bindToggleSelectors(),o.raise(f.sorted,{column:l,direction:i?"ASC":"DESC"}))}},e.rows=function(e,a,i){var o=[];return a.find("> tr").each(function(){var a=t(this),n=null;if(a.hasClass(e.options.classes.detail))return!0;a.next().hasClass(e.options.classes.detail)&&(n=a.next().get(0));var r={row:a,detail:n};return i!==undefined&&(r.value=e.parse(this.cells[i.sort.match],i)),o.push(r),!0}).detach(),o},e.sort=function(t,a,i,o){var n=e.rows(t,a,i),r=t.options.sorters[i.type]||t.options.sorters.alpha;n.sort(function(t,e){return o?r(t.value,e.value):r(e.value,t.value)});for(var l=0;n.length>l;l++)a.append(n[l].row),null!==n[l].detail&&a.append(n[l].detail)}}if(e.footable===undefined||null===e.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={sort:!0,sorters:{alpha:function(t,e){return"string"==typeof t&&(t=t.toLowerCase()),"string"==typeof e&&(e=e.toLowerCase()),t===e?0:e>t?-1:1},numeric:function(t,e){return t-e}},classes:{sort:{sortable:"footable-sortable",sorted:"footable-sorted",descending:"footable-sorted-desc",indicator:"footable-sort-indicator"}},events:{sort:{sorting:"footable_sorting",sorted:"footable_sorted"}}};e.footable.plugins.register(a,i)})(jQuery,window);
23
/* striping */
24
+ (function(t,e,undefined){function a(){var e=this;e.name="Footable Striping",e.init=function(a){e.footable=a,t(a.table).unbind("striping").bind({"footable_initialized.striping footable_row_removed.striping footable_redrawn.striping footable_sorted.striping footable_filtered.striping":function(){t(this).data("striping")!==!1&&e.setupStriping(a)}})},e.setupStriping=function(e){var a=0;t(e.table).find("> tbody > tr:not(.footable-row-detail)").each(function(){var i=t(this);i.removeClass(e.options.classes.striping.even).removeClass(e.options.classes.striping.odd),0===a%2?i.addClass(e.options.classes.striping.even):i.addClass(e.options.classes.striping.odd),a++})}}if(e.footable===undefined||null===e.foobox)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={striping:{enabled:!0},classes:{striping:{odd:"footable-odd",even:"footable-even"}}};e.footable.plugins.register(a,i)})(jQuery,window);
admin/js/gmap.js CHANGED
@@ -1,4 +1,4 @@
1
- /*!
2
* Project: GmapRS - google map for WordPress IP Geo Block
3
* Description: A really simple google map plugin based on jQuery-boilerplate.
4
* Version: 0.2.4
1
+ /**
2
* Project: GmapRS - google map for WordPress IP Geo Block
3
* Description: A really simple google map plugin based on jQuery-boilerplate.
4
* Version: 0.2.4
admin/js/gmap.min.js CHANGED
@@ -1,8 +1,8 @@
1
- /*
2
- Project: GmapRS - google map for WordPress IP Geo Block
3
- Description: A really simple google map plugin based on jQuery-boilerplate.
4
- Version: 0.2.4
5
- Copyright (c) 2013-2016 tokkonopapa (tokkonopapa@yahoo.com)
6
- This software is released under the MIT License.
7
- */
8
function gm_authFailure(){jQuery(window).trigger("ip-geo-block-gmap-error")}(function(f){f(function(d){var f={zoom:2,latitude:0,longitude:0},e=google.maps,g=function(a){this.o=d.extend({},f);this.q=[]};g.prototype={init:function(a){d.extend(this.o,a);this.c=new e.LatLng(this.o.latitude,this.o.longitude);this.m=new e.Map(this.e.get(0),{zoom:this.o.zoom,center:this.c,mapTypeId:e.MapTypeId.ROADMAP})},destroy:function(){this.deleteMarkers();this.e.data("plugin_GmapRS",null)},setCenter:function(){if(2<=arguments.length){var a=new e.LatLng(this.o.latitude=arguments[0],this.o.longitude=arguments[1]);delete this.c;this.c=a}this.m.setCenter(this.c);return this.e},setZoom:function(a){this.m.setZoom(a||this.o.zoom);return this.e},showMarker:function(a,c){var b=this.q[a];b&&b.w&&(!1===c?b.w.close():b.w.open(this.m,b.m))},addMarker:function(a){var c,b,d;c=new e.LatLng(a.latitude||this.o.latitude,a.longitude||this.o.longitude);b=new e.Marker({position:c,map:this.m,title:a.title||""});a.content&&(d=new e.InfoWindow({content:a.content}),e.event.addListener(b,"click",function(){d.open(b.getMap(),b)}));this.q.push({p:c,w:d,m:b});this.m.setCenter(c);this.m.setZoom(a.zoom);a.show&&this.showMarker(this.q.length-1);return this.e},deleteMarkers:function(){var a,c;for(a in this.q)this.q.hasOwnProperty(a)&&(c=this.q[a],c.m.setMap(null));this.q.length=0;return this.e}};d.fn.GmapRS=function(a){var c,b;this.data("plugin_GmapRS")instanceof g||this.data("plugin_GmapRS",new g(this));b=this.data("plugin_GmapRS");b.e=this;if("undefined"===typeof a||"object"===typeof a)"function"===typeof b.init&&b.init(a);else{if("string"===typeof a&&"function"===typeof b[a])return c=Array.prototype.slice.call(arguments,1),b[a].apply(b,c);d.error("Method "+a+" does not exist.GmapRS")}}})})(jQuery);
1
+ /**
2
+ * Project: GmapRS - google map for WordPress IP Geo Block
3
+ * Description: A really simple google map plugin based on jQuery-boilerplate.
4
+ * Version: 0.2.4
5
+ * Copyright (c) 2013-2016 tokkonopapa (tokkonopapa@yahoo.com)
6
+ * This software is released under the MIT License.
7
+ */
8
function gm_authFailure(){jQuery(window).trigger("ip-geo-block-gmap-error")}(function(f){f(function(d){var f={zoom:2,latitude:0,longitude:0},e=google.maps,g=function(a){this.o=d.extend({},f);this.q=[]};g.prototype={init:function(a){d.extend(this.o,a);this.c=new e.LatLng(this.o.latitude,this.o.longitude);this.m=new e.Map(this.e.get(0),{zoom:this.o.zoom,center:this.c,mapTypeId:e.MapTypeId.ROADMAP})},destroy:function(){this.deleteMarkers();this.e.data("plugin_GmapRS",null)},setCenter:function(){if(2<=arguments.length){var a=new e.LatLng(this.o.latitude=arguments[0],this.o.longitude=arguments[1]);delete this.c;this.c=a}this.m.setCenter(this.c);return this.e},setZoom:function(a){this.m.setZoom(a||this.o.zoom);return this.e},showMarker:function(a,c){var b=this.q[a];b&&b.w&&(!1===c?b.w.close():b.w.open(this.m,b.m))},addMarker:function(a){var c,b,d;c=new e.LatLng(a.latitude||this.o.latitude,a.longitude||this.o.longitude);b=new e.Marker({position:c,map:this.m,title:a.title||""});a.content&&(d=new e.InfoWindow({content:a.content}),e.event.addListener(b,"click",function(){d.open(b.getMap(),b)}));this.q.push({p:c,w:d,m:b});this.m.setCenter(c);this.m.setZoom(a.zoom);a.show&&this.showMarker(this.q.length-1);return this.e},deleteMarkers:function(){var a,c;for(a in this.q)this.q.hasOwnProperty(a)&&(c=this.q[a],c.m.setMap(null));this.q.length=0;return this.e}};d.fn.GmapRS=function(a){var c,b;this.data("plugin_GmapRS")instanceof g||this.data("plugin_GmapRS",new g(this));b=this.data("plugin_GmapRS");b.e=this;if("undefined"===typeof a||"object"===typeof a)"function"===typeof b.init&&b.init(a);else{if("string"===typeof a&&"function"===typeof b[a])return c=Array.prototype.slice.call(arguments,1),b[a].apply(b,c);d.error("Method "+a+" does not exist.GmapRS")}}})})(jQuery);
admin/js/whois.min.js CHANGED
@@ -1,8 +1,8 @@
1
- /*
2
- Project: whois.js - get whois infomation
3
- Description: A jQuery plugin to get whois infomation from RIPE NCC database.
4
- Version: 0.1
5
- Copyright (c) 2016 tokkonopapa (tokkonopapa@yahoo.com)
6
- This software is released under the MIT License.
7
- */
8
(function(g){g.extend({whois:function(l,e){function b(b){return b?b.toString().replace(/[&<>"']/g,function(b){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[b]}):""}var f=[];return g.ajax({url:'https://query.yahooapis.com/v1/public/yql?q=select * from xml where url="%URL%"&format=json&jsonCompat=new'.replace(/%URL%/,"https://rest.db.ripe.net/search%3fflags=no-filtering%26flags=resource%26query-string="+l),method:"GET",dataType:"json"}).done(function(c,d,e){function k(c,a){if(a&&"object"===typeof a)if(a.errormessage){var d=a.errormessage,e=d.text.split(/\n+/);f.push({name:b(d.severity),value:b(e[1].replace(/%s/,d.args.value))})}else a.href?(a.href=b(a.href),f.push({name:b(c),value:'<a href="'+a.href+'.json" target=_blank>'+a.href+"</a>"})):a.name&&a.value?(a.link?a.value='<a href="'+b(a.link.href)+'.json" target=_blank>'+b(a.value)+"</a>":"remarks"===a.name&&(a.value=b(a.value),a.value=a.value.replace(/(https?:\/\/[^\s]+)/gi,'<a href="$1" target=_blank>$1</a>')),f.push({name:b(a.name),value:a.value})):"primary-key"!==c&&g.each(a,function(a,b){k(a,b)})}var h;c=c.query.results;d=[];for(h in c)if(c.hasOwnProperty(h)){d=c[h];break}k(null,d)}).fail(function(c,d,e){f.push({name:b(d),value:b(e)})}).always(function(){f.push({name:"copyright",value:'<a href="https://apps.db.ripe.net/search/query.html" title="Database Query - RIPE Network Coordination Centre">RIPE NCC</a>'});e&&e(f)})}})})(jQuery);
1
+ /*!
2
+ * Project: whois.js - get whois infomation
3
+ * Description: A jQuery plugin to get whois infomation from RIPE NCC database.
4
+ * Version: 0.1
5
+ * Copyright (c) 2016 tokkonopapa (tokkonopapa@yahoo.com)
6
+ * This software is released under the MIT License.
7
+ */
8
(function(g){g.extend({whois:function(l,e){function b(b){return b?b.toString().replace(/[&<>"']/g,function(b){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[b]}):""}var f=[];return g.ajax({url:'https://query.yahooapis.com/v1/public/yql?q=select * from xml where url="%URL%"&format=json&jsonCompat=new'.replace(/%URL%/,"https://rest.db.ripe.net/search%3fflags=no-filtering%26flags=resource%26query-string="+l),method:"GET",dataType:"json"}).done(function(c,d,e){function k(c,a){if(a&&"object"===typeof a)if(a.errormessage){var d=a.errormessage,e=d.text.split(/\n+/);f.push({name:b(d.severity),value:b(e[1].replace(/%s/,d.args.value))})}else a.href?(a.href=b(a.href),f.push({name:b(c),value:'<a href="'+a.href+'.json" target=_blank>'+a.href+"</a>"})):a.name&&a.value?(a.link?a.value='<a href="'+b(a.link.href)+'.json" target=_blank>'+b(a.value)+"</a>":"remarks"===a.name&&(a.value=b(a.value),a.value=a.value.replace(/(https?:\/\/[^\s]+)/gi,'<a href="$1" target=_blank>$1</a>')),f.push({name:b(a.name),value:a.value})):"primary-key"!==c&&g.each(a,function(a,b){k(a,b)})}var h;c=c.query.results;d=[];for(h in c)if(c.hasOwnProperty(h)){d=c[h];break}k(null,d)}).fail(function(c,d,e){f.push({name:b(d),value:b(e)})}).always(function(){f.push({name:"copyright",value:'<a href="https://apps.db.ripe.net/search/query.html" title="Database Query - RIPE Network Coordination Centre">RIPE NCC</a>'});e&&e(f)})}})})(jQuery);
classes/class-ip-geo-block-actv.php CHANGED
@@ -10,11 +10,11 @@
10
*/
11
12
// Stuff for resources
13
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-util.php';
14
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
15
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-logs.php';
16
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-cron.php';
17
- require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
18
19
class IP_Geo_Block_Activate {
20
@@ -31,7 +31,6 @@ class IP_Geo_Block_Activate {
31
32
// kick off a cron job to download database immediately
33
IP_Geo_Block_Cron::start_update_db( $settings );
34
- IP_Geo_Block_Cron::start_cache_gc( $settings );
35
36
// activate rewrite rules
37
IP_Geo_Block_Admin_Rewrite::activate_rewrite_all( $settings['rewrite'] );
@@ -47,7 +46,7 @@ class IP_Geo_Block_Activate {
47
*/
48
public static function activate( $network_wide = FALSE ) {
49
if ( ! function_exists( 'is_plugin_active_for_network' ) )
50
- require_once ABSPATH . '/wp-admin/includes/plugin.php';
51
52
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
53
global $wpdb;
@@ -76,7 +75,6 @@ class IP_Geo_Block_Activate {
76
public static function deactivate( $network_wide = FALSE ) {
77
// cancel schedule
78
IP_Geo_Block_Cron::stop_update_db();
79
- IP_Geo_Block_Cron::stop_cache_gc();
80
81
// deactivate rewrite rules
82
IP_Geo_Block_Admin_Rewrite::deactivate_rewrite_all();
10
*/
11
12
// Stuff for resources
13
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-util.php' );
14
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php' );
15
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-logs.php' );
16
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-cron.php' );
17
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php' );
18
19
class IP_Geo_Block_Activate {
20
31
32
// kick off a cron job to download database immediately
33
IP_Geo_Block_Cron::start_update_db( $settings );
34
35
// activate rewrite rules
36
IP_Geo_Block_Admin_Rewrite::activate_rewrite_all( $settings['rewrite'] );
46
*/
47
public static function activate( $network_wide = FALSE ) {
48
if ( ! function_exists( 'is_plugin_active_for_network' ) )
49
+ require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
50
51
if ( is_plugin_active_for_network( IP_GEO_BLOCK_BASE ) ) {
52
global $wpdb;
75
public static function deactivate( $network_wide = FALSE ) {
76
// cancel schedule
77
IP_Geo_Block_Cron::stop_update_db();
78
79
// deactivate rewrite rules
80
IP_Geo_Block_Admin_Rewrite::deactivate_rewrite_all();
classes/class-ip-geo-block-apis.php CHANGED
@@ -446,53 +446,74 @@ class IP_Geo_Block_API_IPInfoDB extends IP_Geo_Block_API {
446
/**
447
* Class for Cache
448
*
449
* Input type : IP address (IPv4, IPv6)
450
* Output type : array
451
*/
452
class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
453
454
- // memory cache
455
- protected static $memcache = array();
456
-
457
public static function update_cache( $hook, $validate, $settings ) {
458
- $cache = self::get_cache( $ip = $validate['ip'] );
459
460
- if ( $cache ) {
461
- $fail = $cache['fail'] + (int)isset( $validate['fail'] );
462
- $call = $cache['call'] + (int)empty( $validate['fail'] );
463
} else { // if new cache then reset these values
464
$call = 1;
465
$fail = 0;
466
}
467
468
// update elements
469
- IP_Geo_Block_Logs::update_cache( $cache = array(
470
- 'time' => $_SERVER['REQUEST_TIME'],
471
- 'ip' => $ip,
472
'hook' => $hook,
473
'code' => $validate['code'],
474
'auth' => $validate['auth'], // get_current_user_id() > 0
475
'fail' => $validate['auth'] ? 0 : $fail,
476
'call' => $settings['save_statistics'] ? $call : 0,
477
'host' => isset( $validate['host'] ) ? $validate['host'] : NULL,
478
- ) );
479
480
- return self::$memcache[ $ip ] = $cache;
481
}
482
483
public static function clear_cache() {
484
- IP_Geo_Block_Logs::clear_cache();
485
}
486
487
public static function get_cache_all() {
488
- return IP_Geo_Block_Logs::restore_cache();
489
}
490
491
public static function get_cache( $ip ) {
492
- if ( ! empty( self::$memcache[ $ip ] ) )
493
- return self::$memcache[ $ip ];
494
- else
495
- return self::$memcache[ $ip ] = IP_Geo_Block_Logs::search_cache( $ip );
496
}
497
498
public function get_location( $ip, $args = array() ) {
@@ -682,7 +703,7 @@ if ( class_exists( 'IP_Geo_Block' ) ) {
682
$exclude = array( '.', '..' );
683
foreach ( $plugins as $plugin ) {
684
if ( ! in_array( $plugin, $exclude, TRUE ) && is_dir( $dir.$plugin ) ) {
685
- @include $dir.$plugin.'/class-'.$plugin.'.php';
686
}
687
}
688
}
446