IP Geo Block - Version 3.0.0

Version Description

  • New feature: Add the function of blocking on front-end.
  • New filter hook: Add ip-geo-block-public to extend validation on front-end.
  • Improvement: Avoid conflict with "Open external links in a new window" plugin and some other reason to prevent duplicated window open. For more detail, see this discussion at support forum.
  • Improvement: Better compatibility with some plugins, themes and widgets.
  • Improvement: Deferred execution of SQL command to improve the response.
  • Improvement: Make the response compatible with WP original when it is requested by GET method.
  • See some details at release 3.0.0.
Download this release

Release Info

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

Code changes from version 3.0.1.2 to 3.0.0

README.txt CHANGED
@@ -1,10 +1,10 @@
1
  === IP Geo Block ===
2
  Contributors: tokkonopapa
3
  Donate link:
4
- Tags: security, firewall, brute force, vulnerability, login, wp-admin, admin, ajax, xmlrpc, comment, pingback, trackback, spam, IP address, geo, geolocation, buddypress, bbPress
5
  Requires at least: 3.7
6
- Tested up to: 4.7.2
7
- Stable tag: 3.0.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -64,7 +64,7 @@ about protection performance against 50 samples of vulnerable plugins.
64
  or themes can be blocked. A numerous such attacks can be found in
65
  [this article](http://www.ipgeoblock.com/article/exposure-of-wp-config-php.html "Prevent exposure of wp-config.php").
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
@@ -170,7 +170,7 @@ 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 settings' button for easy setup at the bottom of this plugin's
174
  setting page.
175
 
176
  Please refer to
@@ -315,10 +315,6 @@ or following descriptions for your best setup.
315
 
316
  == Frequently Asked Questions ==
317
 
318
- = Does it support multisite? =
319
-
320
- It works on multisite, but there's no network setting at this moment.
321
-
322
  = I was locked down. What shall I do? =
323
 
324
  Activate the following codes at the bottom of `ip-geo-block.php` and upload
@@ -344,23 +340,6 @@ that you should upload the original one to deactivate above feature.
344
  [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")
345
  can also help you.
346
 
347
- = How to resolve "Sorry, your request cannot be accepted."? =
348
-
349
- If you encounter this message, please refer to
350
- [this document](http://www.ipgeoblock.com/codex/you-are-not-allowed-to-access.html "Why “You are not allowed to access this page” ? | IP Geo Block")
351
- to resolve your blocking issue.
352
-
353
- = Some admin function doesn't work. How to solve it? =
354
-
355
- This could be happened because of the same reason as the previous FAQ. Please
356
- follow the steps in
357
- [this document](http://www.ipgeoblock.com/codex/you-are-not-allowed-to-access.html "Why “You are not allowed to access this page” ? | IP Geo Block").
358
-
359
- If you can't solve your issue, please let me know about it on the
360
- [support forum](https://wordpress.org/support/plugin/ip-geo-block/ "View: Plugin Support « WordPress.org Forums").
361
- Your logs in this plugin and "**Installation information**" at "**Plugin
362
- settings**" will be a great help to resolve the issue.
363
-
364
  = How can I fix "Unable to write" error? =
365
 
366
  When you enable "**Force to load WP core**" options, this plugin will try to
@@ -373,7 +352,7 @@ to WordPress. In this case, you can configure these `.htaccess` files by your
373
  own hand instead of enabling "**Force to load WP core**" options.
374
 
375
  Please refer to
376
- "[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')"
377
  in order to fix this error.
378
 
379
  = Does this plugin works well with caching? =
@@ -435,9 +414,9 @@ follows:
435
  - **Bad signatures in query**
436
  It blocks the request which has not been covered in the above three.
437
 
438
- Please try "**Best settings**" button at the bottom of this plugin's setting
439
  page for easy setup. And also see more details in
440
- "[The best practice of target settings](http://www.ipgeoblock.com/codex/the-best-practice-for-target-settings.html 'The best practice of target settings | IP Geo Block')".
441
 
442
  = Does this plugin validate all the requests? =
443
 
@@ -451,6 +430,30 @@ But there're exceptions: When you enable "**Force to load WP core**" for
451
  able to be blocked. Sometimes this kind of file has some vulnerabilities.
452
  This function protects your site against such a case.
453
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  == Other Notes ==
455
 
456
  = Known issues =
@@ -475,37 +478,6 @@ This function protects your site against such a case.
475
 
476
  == Changelog ==
477
 
478
- = 3.0.1.2 =
479
- * **Bug fix:** Fix the blocking issue in some environments when upgrading from
480
- 2.2.9.1 to 3.0.0.
481
- * **Bug fix:** Fix the blocking issue at opening a new window via context menu
482
- on dashboard.
483
- * **Bug fix:** Fix the potential issue of 500 Internal error in cron job.
484
- * **Improvement:** Revive 410 Gone for response code.
485
- * **Improvement:** Prevent the issue of resetting matching rule and country
486
- code at upgrading.
487
-
488
- = 3.0.1.1 =
489
- * **Bug fix:** Fix the issue where **Login form** could not be disabled on
490
- **Back-end target settings**.
491
- * **Bug fix:** Fix the issue where trackback and pingback could not be blocked
492
- since 2.2.4.
493
- * **Improved:** Apply the action hook 'pre_trackback_post' that was introduced
494
- in WP 4.7.0.
495
- * **Improved:** Use 'safe_redirect()' instead of 'redirect()' for secured
496
- internal redirection. If you set an external url for **Redirect URL**, please
497
- use the filter hook 'allowed_redirect_hosts'.
498
- * **Improved:** Better compatibility with the plugin "Anti-Malware Security
499
- and Brute-Force Firewall".
500
-
501
- = 3.0.1 =
502
- * **Bug fix:** Add lock mechanism for local geolocation DBs to avoid potential
503
- fatal error.
504
- * **Improvement:** Add self blocking prevention potentially caused by login
505
- attempts with the same IP address of logged in user.
506
- * **New feature:** Add "**Installation information**" button to make it easy
507
- to submit an issue at support forum.
508
-
509
  = 3.0.0 =
510
  * **New feature:** Add the function of blocking on front-end.
511
  * **New filter hook:** Add `ip-geo-block-public` to extend validation on
1
  === IP Geo Block ===
2
  Contributors: tokkonopapa
3
  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
 
64
  or themes can be blocked. A numerous such attacks can be found in
65
  [this article](http://www.ipgeoblock.com/article/exposure-of-wp-config-php.html "Prevent exposure of wp-config.php").
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
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
315
 
316
  == Frequently Asked Questions ==
317
 
 
 
 
 
318
  = I was locked down. What shall I do? =
319
 
320
  Activate the following codes at the bottom of `ip-geo-block.php` and upload
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? =
344
 
345
  When you enable "**Force to load WP core**" options, this plugin will try to
352
  own hand instead of enabling "**Force to load WP core**" options.
353
 
354
  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? =
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
 
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
+
435
+ There are a few cases that WP-ZEP would not work. One is redirection at server
436
+ side (caused by PHP or `.htaccess`) and client side (caused by JavaScript
437
+ location object or meta tag for refresh).
438
+
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
 
459
  = Known issues =
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
admin/class-ip-geo-block-admin.php CHANGED
@@ -28,6 +28,9 @@ class IP_Geo_Block_Admin {
28
  * and adding a settings page and menu.
29
  */
30
  private function __construct() {
 
 
 
31
  // Load plugin text domain.
32
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
33
 
@@ -41,9 +44,8 @@ class IP_Geo_Block_Admin {
41
  add_filter( 'wp_prepare_revision_for_js', array( $this, 'add_revision_nonce' ), 10, 3 );
42
 
43
  // If multisite, then enque the authentication script for network admin
44
- if ( is_multisite() ) {
45
  add_action( 'network_admin_menu', 'IP_Geo_Block::enqueue_nonce' );
46
- }
47
  }
48
 
49
  /**
@@ -153,7 +155,6 @@ class IP_Geo_Block_Admin {
153
  'IP_GEO_BLOCK',
154
  array(
155
  'action' => 'ip_geo_block',
156
- 'tab' => $this->admin_tab,
157
  'url' => admin_url( 'admin-ajax.php' ),
158
  'nonce' => IP_Geo_Block_Util::create_nonce( $this->get_ajax_action() ),
159
  'msg' => array(
@@ -214,37 +215,24 @@ class IP_Geo_Block_Admin {
214
  }
215
 
216
  /**
217
- * Show global notice.
218
  *
 
219
  */
220
  public function show_admin_notices() {
221
  $key = IP_Geo_Block::PLUGIN_NAME . '-notice';
222
-
223
  if ( FALSE !== ( $notices = get_transient( $key ) ) ) {
224
  foreach ( $notices as $msg => $type ) {
225
- echo "\n", '<div class="notice is-dismissible ', esc_attr( $type ), '"><p>';
226
- if ( 'updated' === $type )
227
- echo '<strong>', IP_Geo_Block_Util::kses( $msg ), '</strong>';
228
- else
229
- echo '<strong>IP Geo Block:</strong> ', IP_Geo_Block_Util::kses( $msg );
230
- echo '</p></div>', "\n";
231
  }
232
  }
233
-
234
- // delete all admin noties
235
- delete_transient( $key );
236
  }
237
 
238
- /**
239
- * Add global notice.
240
- *
241
- */
242
  public static function add_admin_notice( $type, $msg ) {
243
  $key = IP_Geo_Block::PLUGIN_NAME . '-notice';
244
  if ( FALSE === ( $notices = get_transient( $key ) ) )
245
  $notices = array();
246
 
247
- // can't overwrite the existent notice
248
  if ( ! isset( $notices[ $msg ] ) ) {
249
  $notices[ $msg ] = $type;
250
  set_transient( $key, $notices, MINUTE_IN_SECONDS );
@@ -252,14 +240,18 @@ class IP_Geo_Block_Admin {
252
  }
253
 
254
  /**
255
- * Register the administration menu into the WordPress Dashboard menu.
256
  *
257
  */
258
- private function add_plugin_admin_menu() {
259
- // Setup the tab number
260
- $this->admin_tab = isset( $_GET['tab'] ) ? (int)$_GET['tab'] : 0;
261
- $this->admin_tab = min( 4, max( 0, $this->admin_tab ) );
262
 
 
 
 
 
 
263
  // Add a settings page for this plugin to the Settings menu.
264
  $hook = add_options_page(
265
  __( 'IP Geo Block', 'ip-geo-block' ),
@@ -279,25 +271,27 @@ class IP_Geo_Block_Admin {
279
  *
280
  */
281
  private function diagnose_admin_screen() {
 
 
 
282
  // Check version and compatibility
283
  if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
284
  self::add_admin_notice( 'error', __( 'You need WordPress 3.7+.', 'ip-geo-block' ) );
285
 
286
  $settings = IP_Geo_Block::get_option();
287
- $adminurl = 'options-general.php';
288
 
289
  // Check consistency of matching rule
290
  if ( -1 === (int)$settings['matching_rule'] ) {
291
  if ( FALSE !== get_transient( IP_Geo_Block::CRON_NAME ) ) {
292
  self::add_admin_notice( 'notice-warning', sprintf(
293
  __( 'Now downloading geolocation databases in background. After a little while, please check your country code and &#8220;<strong>Matching rule</strong>&#8221; at <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
294
- esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) )
295
  ) );
296
  }
297
  else {
298
  self::add_admin_notice( 'error', sprintf(
299
  __( 'The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please confirm it at <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
300
- esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) )
301
  ) );
302
  }
303
  }
@@ -305,27 +299,15 @@ class IP_Geo_Block_Admin {
305
  // Check to finish updating matching rule
306
  elseif ( 'done' === get_transient( IP_Geo_Block::CRON_NAME ) ) {
307
  delete_transient( IP_Geo_Block::CRON_NAME );
308
- self::add_admin_notice( 'updated ', __( 'Local database and matching rule have been updated.', 'ip-geo-block' ) );
309
  }
310
 
311
  // Check self blocking
312
  if ( 1 === (int)$settings['validation']['login'] ) {
313
  $instance = IP_Geo_Block::get_instance();
314
- $validate = $instance->validate_ip( 'login', $settings, TRUE, FALSE, FALSE ); // skip authentication check
315
 
316
- switch( $validate['result'] ) {
317
- case 'limited':
318
- self::add_admin_notice( 'error',
319
- __( 'Once you logout, you will be unable to login again because the number of login attempts reaches the limit.', 'ip-geo-block' ) . ' ' .
320
- sprintf(
321
- __( 'Please execute "<strong>Clear cache</strong>" on <a href="%s">Statistics tab</a> to prevent locking yourself out.', 'ip-geo-block' ),
322
- esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME, 'tab' => 1 ), $adminurl ) )
323
- )
324
- );
325
- break;
326
-
327
- case 'blocked':
328
- case 'extra':
329
  self::add_admin_notice( 'error',
330
  ( $settings['matching_rule'] ?
331
  __( 'Once you logout, you will be unable to login again because your country code or IP address is in the blacklist.', 'ip-geo-block' ) :
@@ -333,7 +315,7 @@ class IP_Geo_Block_Admin {
333
  ) .
334
  sprintf(
335
  __( 'Please check your <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
336
- esc_url( add_query_arg( array( 'page' => IP_Geo_Block::PLUGIN_NAME ), $adminurl ) ) . '#' . IP_Geo_Block::PLUGIN_NAME . '-settings-0'
337
  )
338
  );
339
  }
@@ -355,17 +337,13 @@ class IP_Geo_Block_Admin {
355
  *
356
  */
357
  public function setup_admin_page() {
358
- // Avoid multiple validation.
359
- if ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
360
- $this->diagnose_admin_screen();
361
- $this->add_plugin_admin_menu();
362
- }
363
 
364
- // Register settings page only if it is needed.
365
  if ( ( isset( $_GET ['page' ] ) && IP_Geo_Block::PLUGIN_NAME === $_GET ['page' ] ) ||
366
- ( isset( $_POST['option_page'] ) && IP_Geo_Block::PLUGIN_NAME === $_POST['option_page'] ) ) {
367
  $this->register_settings_tab();
368
- }
369
 
370
  // Add an action link pointing to the options page. @since 2.7
371
  else {
@@ -373,10 +351,8 @@ class IP_Geo_Block_Admin {
373
  add_filter( 'plugin_action_links_' . IP_GEO_BLOCK_BASE, array( $this, 'add_action_links' ), 10, 1 );
374
  }
375
 
376
- // Register scripts for admin.
377
  add_action( 'admin_enqueue_scripts', array( 'IP_Geo_Block', 'enqueue_nonce' ) );
378
-
379
- // Show admin notices at the place where it should be.
380
  add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
381
  }
382
 
@@ -385,7 +361,6 @@ class IP_Geo_Block_Admin {
385
  *
386
  */
387
  public function display_plugin_admin_page() {
388
- $tab = $this->admin_tab;
389
  $tabs = array(
390
  0 => __( 'Settings', 'ip-geo-block' ),
391
  1 => __( 'Statistics', 'ip-geo-block' ),
@@ -393,6 +368,7 @@ class IP_Geo_Block_Admin {
393
  2 => __( 'Search', 'ip-geo-block' ),
394
  3 => __( 'Attribution', 'ip-geo-block' ),
395
  );
 
396
  ?>
397
  <div class="wrap">
398
  <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
@@ -450,7 +426,7 @@ class IP_Geo_Block_Admin {
450
  3 => 'admin/includes/tab-attribution.php',
451
  );
452
 
453
- require_once IP_GEO_BLOCK_PATH . $files[ $this->admin_tab ];
454
  IP_Geo_Block_Admin_Tab::tab_setup( $this );
455
  }
456
 
@@ -573,7 +549,7 @@ class IP_Geo_Block_Admin {
573
  }
574
 
575
  /**
576
- * Sanitize options before saving them into DB.
577
  *
578
  * @param array $input The values to be validated.
579
  *
@@ -589,14 +565,12 @@ class IP_Geo_Block_Admin {
589
  $default = IP_Geo_Block::get_default();
590
 
591
  // checkboxes not on the form (added after 2.0.0, just in case)
592
- foreach ( array( 'anonymize', 'network_wide' ) as $key ) {
593
  $output[ $key ] = 0;
594
- }
595
 
596
  // checkboxes not on the form
597
- foreach ( array( 'login', 'admin', 'ajax', 'plugins', 'themes', 'public' ) as $key ) {
598
  $output['validation'][ $key ] = 0;
599
- }
600
 
601
  // restore the 'signature' that might be transformed to avoid self blocking
602
  if ( isset( $input['signature'] ) && FALSE === strpos( $input['signature'], ',' ) )
@@ -642,16 +616,18 @@ class IP_Geo_Block_Admin {
642
  }
643
 
644
  // Check providers setting
645
- if ( $error = IP_Geo_Block_Provider::diag_providers( $output[ $key ] ) )
646
- self::add_admin_notice( 'error', $error );
 
647
  break;
648
 
649
  case 'comment':
650
- if ( isset( $input[ $key ]['pos'] ) )
651
  $output[ $key ]['pos'] = (int)$input[ $key ]['pos'];
652
-
653
- if ( isset( $input[ $key ]['msg'] ) )
654
  $output[ $key ]['msg'] = IP_Geo_Block_Util::kses( $input[ $key ]['msg'] );
 
655
  break;
656
 
657
  case 'white_list':
@@ -788,28 +764,29 @@ class IP_Geo_Block_Admin {
788
  * Check admin post
789
  *
790
  */
791
- private function check_admin_post( $ajax = FALSE ) {
792
- if ( FALSE === $ajax ) {
793
- // a postfix '-options' is added at settings_fields().
794
- $nonce = check_admin_referer( IP_Geo_Block::PLUGIN_NAME . '-options' );
795
- } else {
796
- $nonce = IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( 'nonce' ), $this->get_ajax_action() );
 
797
  }
798
 
799
  $action = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce';
800
  $nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( $action ), $action );
801
 
802
- if ( ! $nonce || ( ! current_user_can( 'manage_options' ) ) ) {
803
  status_header( 403 );
804
  wp_die(
805
  __( 'You do not have sufficient permissions to access this page.' ), '',
806
- array( 'response' => 403, 'back_link' => TRUE )
807
  );
808
  }
809
  }
810
 
811
  /**
812
- * Validate settings and configure some features.
813
  *
814
  */
815
  public function validate_settings( $input = array() ) {
@@ -819,8 +796,10 @@ class IP_Geo_Block_Admin {
819
  // validate setting options
820
  $options = $this->validate_options( $input );
821
 
 
822
  // activate rewrite rules
823
- require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
 
824
  $stat = IP_Geo_Block_Admin_Rewrite::activate_rewrite_all( $options['rewrite'] );
825
 
826
  // check the status of rewrite rules
@@ -836,18 +815,20 @@ class IP_Geo_Block_Admin {
836
  $file[] = '<code>' . $dirs[ $key ] . '.htaccess</code>';
837
  }
838
 
839
- self::add_admin_notice( 'error',
840
  sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), implode( ', ', $file ) ) . '&nbsp;' .
841
  sprintf( _n( 'Or please refer to %s to set it manually.', 'Or please refer to %s to set them manually.', count( $file ), 'ip-geo-block' ), '<a href="http://ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How to fix permission troubles? | IP Geo Block">How to fix permission troubles?</a>' )
842
  );
843
  }
844
 
845
- // additional configuration
846
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
 
 
847
  $file = IP_Geo_Block_Opts::setup_validation_timing( $options );
848
  if ( TRUE !== $file ) {
849
  $options['validation']['timing'] = 0;
850
- self::add_admin_notice( 'error', sprintf(
851
  __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), $file
852
  ) );
853
  }
@@ -855,6 +836,9 @@ class IP_Geo_Block_Admin {
855
  // Force to finish update matching rule
856
  delete_transient( IP_Geo_Block::CRON_NAME );
857
 
 
 
 
858
  return $options;
859
  }
860
 
@@ -869,8 +853,6 @@ class IP_Geo_Block_Admin {
869
  // Check request origin, nonce, capability.
870
  $this->check_admin_post( TRUE );
871
 
872
- require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php';
873
-
874
  $which = isset( $_POST['which'] ) ? $_POST['which'] : NULL;
875
  switch ( isset( $_POST['cmd' ] ) ? $_POST['cmd' ] : NULL ) {
876
  case 'download':
@@ -880,11 +862,13 @@ class IP_Geo_Block_Admin {
880
 
881
  case 'search':
882
  // Get geolocation by IP
 
883
  $res = IP_Geo_Block_Admin_Ajax::search_ip( $which );
884
  break;
885
 
886
  case 'scan-code':
887
  // Fetch providers to get country code
 
888
  $res = IP_Geo_Block_Admin_Ajax::scan_country();
889
  break;
890
 
@@ -919,26 +903,31 @@ class IP_Geo_Block_Admin {
919
 
920
  case 'export-logs':
921
  // Export logs from MySQL DB
 
922
  IP_Geo_Block_Admin_Ajax::export_logs( $which );
923
  break;
924
 
925
  case 'restore':
926
  // Get logs from MySQL DB
 
927
  $res = IP_Geo_Block_Admin_Ajax::restore_logs( $which );
928
  break;
929
 
930
  case 'validate':
931
  // Validate settings
 
932
  IP_Geo_Block_Admin_Ajax::validate_settings( $this );
933
  break;
934
 
935
  case 'import-default':
936
  // Import initial settings
 
937
  $res = IP_Geo_Block_Admin_Ajax::settings_to_json( IP_Geo_Block::get_default() );
938
  break;
939
 
940
  case 'import-preferred':
941
  // Import preference
 
942
  $res = IP_Geo_Block_Admin_Ajax::preferred_to_json();
943
  break;
944
 
@@ -955,10 +944,6 @@ class IP_Geo_Block_Admin {
955
  }
956
  break;
957
 
958
- case 'show-info':
959
- $res = IP_Geo_Block_Admin_Ajax::get_wp_info();
960
- break;
961
-
962
  case 'create-table':
963
  case 'delete-table':
964
  // Need to define `IP_GEO_BLOCK_DEBUG` to true
@@ -970,7 +955,6 @@ class IP_Geo_Block_Admin {
970
  $res = array(
971
  'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
972
  );
973
- break;
974
  }
975
 
976
  if ( isset( $res ) ) // wp_send_json_{success,error}() @since 3.5.0
28
  * and adding a settings page and menu.
29
  */
30
  private function __construct() {
31
+ $this->admin_tab = isset( $_GET['tab'] ) ? (int)$_GET['tab'] : 0;
32
+ $this->admin_tab = min( 4, max( 0, $this->admin_tab ) );
33
+
34
  // Load plugin text domain.
35
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
36
 
44
  add_filter( 'wp_prepare_revision_for_js', array( $this, 'add_revision_nonce' ), 10, 3 );
45
 
46
  // If multisite, then enque the authentication script for network admin
47
+ if ( is_multisite() )
48
  add_action( 'network_admin_menu', 'IP_Geo_Block::enqueue_nonce' );
 
49
  }
50
 
51
  /**
155
  'IP_GEO_BLOCK',
156
  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
  'msg' => array(
215
  }
216
 
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';
 
224
  if ( FALSE !== ( $notices = get_transient( $key ) ) ) {
225
  foreach ( $notices as $msg => $type ) {
226
+ echo "\n<div class=\"notice is-dismissible ", esc_attr( $type ), "\"><p><strong>IP Geo Block:</strong> ", IP_Geo_Block_Util::kses( $msg ), "</p></div>\n";
 
 
 
 
 
227
  }
228
  }
 
 
 
229
  }
230
 
 
 
 
 
231
  public static function add_admin_notice( $type, $msg ) {
232
  $key = IP_Geo_Block::PLUGIN_NAME . '-notice';
233
  if ( FALSE === ( $notices = get_transient( $key ) ) )
234
  $notices = array();
235
 
 
236
  if ( ! isset( $notices[ $msg ] ) ) {
237
  $notices[ $msg ] = $type;
238
  set_transient( $key, $notices, MINUTE_IN_SECONDS );
240
  }
241
 
242
  /**
243
+ * Display local notice
244
  *
245
  */
246
+ private function show_setting_notice( $type, $msg ) {
247
+ add_settings_error( IP_Geo_Block::PLUGIN_NAME, IP_Geo_Block::OPTION_NAME, $msg, $type );
248
+ }
 
249
 
250
+ /**
251
+ * Register the administration menu into the WordPress Dashboard menu.
252
+ *
253
+ */
254
+ private function add_plugin_admin_page() {
255
  // Add a settings page for this plugin to the Settings menu.
256
  $hook = add_options_page(
257
  __( 'IP Geo Block', 'ip-geo-block' ),
271
  *
272
  */
273
  private function diagnose_admin_screen() {
274
+ // delete all admin noties
275
+ delete_transient( IP_Geo_Block::PLUGIN_NAME . '-notice' );
276
+
277
  // Check version and compatibility
278
  if ( version_compare( get_bloginfo( 'version' ), '3.7.0' ) < 0 )
279
  self::add_admin_notice( 'error', __( 'You need WordPress 3.7+.', 'ip-geo-block' ) );
280
 
281
  $settings = IP_Geo_Block::get_option();
 
282
 
283
  // Check consistency of matching rule
284
  if ( -1 === (int)$settings['matching_rule'] ) {
285
  if ( FALSE !== get_transient( IP_Geo_Block::CRON_NAME ) ) {
286
  self::add_admin_notice( 'notice-warning', sprintf(
287
  __( 'Now downloading geolocation databases in background. After a little while, please check your country code and &#8220;<strong>Matching rule</strong>&#8221; at <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
288
+ esc_url( admin_url( 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME ) )
289
  ) );
290
  }
291
  else {
292
  self::add_admin_notice( 'error', sprintf(
293
  __( 'The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please confirm it at <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
294
+ esc_url( admin_url( 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME ) )
295
  ) );
296
  }
297
  }
299
  // Check to finish updating matching rule
300
  elseif ( 'done' === get_transient( IP_Geo_Block::CRON_NAME ) ) {
301
  delete_transient( IP_Geo_Block::CRON_NAME );
302
+ self::add_admin_notice( 'updated', __( 'Local database and matching rule have been updated.', 'ip-geo-block' ) );
303
  }
304
 
305
  // Check self blocking
306
  if ( 1 === (int)$settings['validation']['login'] ) {
307
  $instance = IP_Geo_Block::get_instance();
308
+ $validate = $instance->validate_ip( 'login', $settings, TRUE, FALSE, FALSE );
309
 
310
+ if ( 'passed' !== $validate['result'] ) {
 
 
 
 
 
 
 
 
 
 
 
 
311
  self::add_admin_notice( 'error',
312
  ( $settings['matching_rule'] ?
313
  __( 'Once you logout, you will be unable to login again because your country code or IP address is in the blacklist.', 'ip-geo-block' ) :
315
  ) .
316
  sprintf(
317
  __( 'Please check your <a href="%s">Validation rule settings</a>.', 'ip-geo-block' ),
318
+ esc_url( admin_url( 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME . '#' . IP_Geo_Block::PLUGIN_NAME . '-settings-0' ) )
319
  )
320
  );
321
  }
337
  *
338
  */
339
  public function setup_admin_page() {
340
+ $this->diagnose_admin_screen();
341
+ $this->add_plugin_admin_page();
 
 
 
342
 
343
+ // Register settings page only if it is needed
344
  if ( ( isset( $_GET ['page' ] ) && IP_Geo_Block::PLUGIN_NAME === $_GET ['page' ] ) ||
345
+ ( isset( $_POST['option_page'] ) && IP_Geo_Block::PLUGIN_NAME === $_POST['option_page'] ) )
346
  $this->register_settings_tab();
 
347
 
348
  // Add an action link pointing to the options page. @since 2.7
349
  else {
351
  add_filter( 'plugin_action_links_' . IP_GEO_BLOCK_BASE, array( $this, 'add_action_links' ), 10, 1 );
352
  }
353
 
354
+ // Register scripts and admin notice
355
  add_action( 'admin_enqueue_scripts', array( 'IP_Geo_Block', 'enqueue_nonce' ) );
 
 
356
  add_action( 'admin_notices', array( $this, 'show_admin_notices' ) );
357
  }
358
 
361
  *
362
  */
363
  public function display_plugin_admin_page() {
 
364
  $tabs = array(
365
  0 => __( 'Settings', 'ip-geo-block' ),
366
  1 => __( 'Statistics', 'ip-geo-block' ),
368
  2 => __( 'Search', 'ip-geo-block' ),
369
  3 => __( 'Attribution', 'ip-geo-block' ),
370
  );
371
+ $tab = $this->admin_tab;
372
  ?>
373
  <div class="wrap">
374
  <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
426
  3 => 'admin/includes/tab-attribution.php',
427
  );
428
 
429
+ require_once( IP_GEO_BLOCK_PATH . $files[ $this->admin_tab ] );
430
  IP_Geo_Block_Admin_Tab::tab_setup( $this );
431
  }
432
 
549
  }
550
 
551
  /**
552
+ * A callback function that validates the option's value.
553
  *
554
  * @param array $input The values to be validated.
555
  *
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
576
  if ( isset( $input['signature'] ) && FALSE === strpos( $input['signature'], ',' ) )
616
  }
617
 
618
  // Check providers setting
619
+ if ( $error = IP_Geo_Block_Provider::diag_providers( $output[ $key ] ) ) {
620
+ $this->show_setting_notice( 'error', $error );
621
+ }
622
  break;
623
 
624
  case 'comment':
625
+ if ( isset( $input[ $key ]['pos'] ) ) {
626
  $output[ $key ]['pos'] = (int)$input[ $key ]['pos'];
627
+ }
628
+ if ( isset( $input[ $key ]['msg'] ) ) {
629
  $output[ $key ]['msg'] = IP_Geo_Block_Util::kses( $input[ $key ]['msg'] );
630
+ }
631
  break;
632
 
633
  case 'white_list':
764
  * Check admin post
765
  *
766
  */
767
+ private function check_admin_post( $ajax ) {
768
+ $nonce = TRUE;
769
+
770
+ if ( $ajax ) {
771
+ $action = $this->get_ajax_action();
772
+ $nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( 'nonce' ), $action );
773
+ // $nonce &= check_admin_referer( $this->get_ajax_action(), 'nonce' );
774
  }
775
 
776
  $action = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce';
777
  $nonce &= IP_Geo_Block_Util::verify_nonce( IP_Geo_Block_Util::retrieve_nonce( $action ), $action );
778
 
779
+ if ( ! current_user_can( 'manage_options' ) || ! $nonce ) {
780
  status_header( 403 );
781
  wp_die(
782
  __( 'You do not have sufficient permissions to access this page.' ), '',
783
+ array( 'response' => 403, 'back_link' => true )
784
  );
785
  }
786
  }
787
 
788
  /**
789
+ * Sanitize options before saving them into DB.
790
  *
791
  */
792
  public function validate_settings( $input = array() ) {
796
  // validate setting options
797
  $options = $this->validate_options( $input );
798
 
799
+ //----------------------------------------
800
  // activate rewrite rules
801
+ //----------------------------------------
802
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php' );
803
  $stat = IP_Geo_Block_Admin_Rewrite::activate_rewrite_all( $options['rewrite'] );
804
 
805
  // check the status of rewrite rules
815
  $file[] = '<code>' . $dirs[ $key ] . '.htaccess</code>';
816
  }
817
 
818
+ $this->show_setting_notice( 'error',
819
  sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), implode( ', ', $file ) ) . '&nbsp;' .
820
  sprintf( _n( 'Or please refer to %s to set it manually.', 'Or please refer to %s to set them manually.', count( $file ), 'ip-geo-block' ), '<a href="http://ipgeoblock.com/codex/how-to-fix-permission-troubles.html" title="How to fix permission troubles? | IP Geo Block">How to fix permission troubles?</a>' )
821
  );
822
  }
823
 
824
+ //----------------------------------------
825
+ // additional installation
826
+ //----------------------------------------
827
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php' );
828
  $file = IP_Geo_Block_Opts::setup_validation_timing( $options );
829
  if ( TRUE !== $file ) {
830
  $options['validation']['timing'] = 0;
831
+ $this->show_setting_notice( 'error', sprintf(
832
  __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), $file
833
  ) );
834
  }
836
  // Force to finish update matching rule
837
  delete_transient( IP_Geo_Block::CRON_NAME );
838
 
839
+ // register a settings error to be displayed to the user
840
+ $this->show_setting_notice( 'updated', __( 'Settings saved.' ) );
841
+
842
  return $options;
843
  }
844
 
853
  // Check request origin, nonce, capability.
854
  $this->check_admin_post( TRUE );
855
 
 
 
856
  $which = isset( $_POST['which'] ) ? $_POST['which'] : NULL;
857
  switch ( isset( $_POST['cmd' ] ) ? $_POST['cmd' ] : NULL ) {
858
  case 'download':
862
 
863
  case 'search':
864
  // Get geolocation by IP
865
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
866
  $res = IP_Geo_Block_Admin_Ajax::search_ip( $which );
867
  break;
868
 
869
  case 'scan-code':
870
  // Fetch providers to get country code
871
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
872
  $res = IP_Geo_Block_Admin_Ajax::scan_country();
873
  break;
874
 
903
 
904
  case 'export-logs':
905
  // Export logs from MySQL DB
906
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
907
  IP_Geo_Block_Admin_Ajax::export_logs( $which );
908
  break;
909
 
910
  case 'restore':
911
  // Get logs from MySQL DB
912
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
913
  $res = IP_Geo_Block_Admin_Ajax::restore_logs( $which );
914
  break;
915
 
916
  case 'validate':
917
  // Validate settings
918
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
919
  IP_Geo_Block_Admin_Ajax::validate_settings( $this );
920
  break;
921
 
922
  case 'import-default':
923
  // Import initial settings
924
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
925
  $res = IP_Geo_Block_Admin_Ajax::settings_to_json( IP_Geo_Block::get_default() );
926
  break;
927
 
928
  case 'import-preferred':
929
  // Import preference
930
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-ajax.php' );
931
  $res = IP_Geo_Block_Admin_Ajax::preferred_to_json();
932
  break;
933
 
944
  }
945
  break;
946
 
 
 
 
 
947
  case 'create-table':
948
  case 'delete-table':
949
  // Need to define `IP_GEO_BLOCK_DEBUG` to true
955
  $res = array(
956
  'page' => 'options-general.php?page=' . IP_Geo_Block::PLUGIN_NAME,
957
  );
 
958
  }
959
 
960
  if ( isset( $res ) ) // wp_send_json_{success,error}() @since 3.5.0
admin/css/admin.css CHANGED
@@ -342,14 +342,6 @@ input#ip_geo_block_settings_filter_logs {
342
  position: relative;
343
  top: 1px;
344
  }
345
- #ip-geo-block-wp-info textarea {
346
- margin-top: 0.5em;
347
- overflow: auto;
348
- width: 100%;
349
- word-wrap: normal;
350
- word-break: normal;
351
- white-space: pre;
352
- }
353
  #ip-geo-block-cycle {
354
  height: 16px;
355
  width: 16px;
342
  position: relative;
343
  top: 1px;
344
  }
 
 
 
 
 
 
 
 
345
  #ip-geo-block-cycle {
346
  height: 16px;
347
  width: 16px;
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-wp-info textarea{margin-top:.5em;overflow:auto;width:100%;word-wrap:normal;word-break:normal;white-space:pre}#ip-geo-block-cycle{height:16px;width:16px;margin:0;border:none;display:inline-block;vertical-align:text-bottom;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAh1BMVEUAda2otLp+rsSHprWHr8IBd7EpfKRGhaNajqeUqrRymKuKoq5yo7prlKgAcqoVe6w8gqQmgq5Tj6wIdqsVdKIshrEMea1Uhp+Anqw0hawDdq4gfKhljqE7hqoLdKYbgbM4jLQygKUGeK8CdawQd6gVeKcad6NKkrSerrZAj7UAc6sAc6rc3NySrVGQAAAALXRSTlP//////////////////////////////////////////////////////////wCl7wv9AAACOklEQVR4Ae2W15rzKgxF9xTZzhTX9B7S/gN6/9ebYqzzGZsw/S7LV3FZgCSIwD/kQ8FVcBU8xatZUczy8luC/ABNOn0DSHEsvyZ4PgLatNCYR3efFxyhTQ8g+qQgJxgv2JefERzJXATRh4LHOUwAHD4S7OGEztRJaN86hAUxtaNWDUf/bRdDBbQMWVDAO8jn89WUhag1MeyCAh6hHofyrliLgZKggDMYgzF3eVAwFq0uCZq5KY0TezjIHDDzC0qqmkwe2ctGDOQVLMkgu+F3/rGXwb4xIPcJ6P3JgkM8wFjmfcFAWfeKQywaAz33BJVuHsUcAt09gVbuLDThAJkdR687ggLmf4gDJLIGV7BydtB8yn3u+fbtuj/LS7G9wZAd1AKK+yxJ1x+aBmibTtgCcEHGHsh0wdbOgNLek4L7lI5BigY8nWuZUQ3qGEXes9JzOKGJztPaGtLslu3lIXJirdxCWkASHGDTMqg7V1DKPplygDG61YJukLHjEErGSXqCSos6xNSOgzP3BDmsQBcchNwkoV8oiNnPA78zIefUgCdJeGIfE7LmFWXsFTCFdzTJ/RlfEMRiSGnFXXbkC7AIeqcKDu4ynseozeouKJiSEYBDwkJyIC1nRUjgblkNWp/e/1vXc2gjoAoLksYgjrrFMi0oDgjEEIDij1scBXMJSH6DAj6RNl7o8MkuLak8Co15/Pk+MRmT0xilQJV/sdWNKg2kTaeroudvNNsDjmejYjSL+e6v2/2r4Cp4BXNajr0H7hRfAAAAAElFTkSuQmCC)}
1
  /* This stylesheet is used to style the admin option form of the plugin. */
2
+ .ip-geo-block-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)}
admin/includes/class-admin-ajax.php CHANGED
@@ -6,7 +6,7 @@ class IP_Geo_Block_Admin_Ajax {
6
  *
7
  */
8
  static public function search_ip( $which ) {
9
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php';
10
 
11
  // check format
12
  if ( filter_var( $ip = $_POST['ip'], FILTER_VALIDATE_IP ) ) {
@@ -420,67 +420,9 @@ class IP_Geo_Block_Admin_Ajax {
420
  // Fallback function for PHP 5.3 and under
421
  static private function convert_encoding( $matches ) {
422
  return mb_convert_encoding(
423
- pack( 'H*', str_replace( '\\u', '', $matches[0] ) ), 'UTF-8', 'UTF-16'
 
424
  );
425
  }
426
 
427
- static public function get_wp_info() {
428
- // PHP, WordPress
429
- $res = array();
430
- $res[] = array( 'PHP' => PHP_VERSION );
431
- $res[] = array( 'BC Math' => (extension_loaded('gmp') ? 'gmp ' : '') . (function_exists('bcadd') ? 'yes' : 'no') );
432
- $res[] = array( 'mb_strcut' => function_exists( 'mb_strcut' ) ? 'yes' : 'no' );
433
- $res[] = array( 'WordPress' => $GLOBALS['wp_version'] );
434
- $res[] = array( 'Multisite' => is_multisite() ? 'yes' : 'no' );
435
-
436
- // Child and parent themes
437
- $activated = wp_get_theme(); // @since 3.4.0
438
- $res[] = array( esc_html( $activated->get( 'Name' ) ) => esc_html( $activated->get( 'Version' ) ) );
439
-
440
- if ( $installed = $activated->get( 'Template' ) ) {
441
- $activated = wp_get_theme( $installed );
442
- $res[] = array( esc_html( $activated->get( 'Name' ) ) => esc_html( $activated->get( 'Version' ) ) );
443
- }
444
-
445
- // Plugins
446
- $installed = get_plugins(); // @since 1.5.0
447
- $activated = get_site_option( 'active_sitewide_plugins' ); // @since 2.8.0
448
- ! is_array( $activated ) and $activated = array();
449
- $activated = array_merge( $activated, array_fill_keys( get_option( 'active_plugins' ), TRUE ) );
450
-
451
- foreach ( $installed as $key => $val ) {
452
- if ( isset( $activated[ $key ] ) ) {
453
- $res[] = array(
454
- esc_html( $val['Name'] ) => esc_html( $val['Version'] )
455
- );
456
- }
457
- }
458
-
459
- // Logs (hook, time, ip, code, result, method, user_agent, headers, data)
460
- $installed = IP_Geo_Block_Logs::search_logs( IP_Geo_Block::get_ip_address() );
461
-
462
- foreach ( array_reverse( $installed ) as $val ) {
463
- // hide port and nonce
464
- $method = preg_replace( '/\[\d+\]/', '', $val['method'] );
465
- $method = preg_replace( '/(' . IP_Geo_Block::PLUGIN_NAME . '-auth-nonce)(?:=|%3D)([\w]+)/', '$1=...', $method );
466
-
467
- // add post data
468
- $query = array();
469
- foreach ( explode( ',', $val['data'] ) as $str ) {
470
- if ( FALSE !== strpos( $str, '=' ) )
471
- $query[] = $str;
472
- }
473
-
474
- if ( ! empty( $query ) )
475
- $method .= '(' . implode( ',', $query ) . ')';
476
-
477
- $res[] = array(
478
- esc_html( IP_Geo_Block_Util::localdate( $val['time'], 'Y-m-d H:i:s' ) ) =>
479
- esc_html( str_pad( $val['result'], 8 ) . $method )
480
- );
481
- }
482
-
483
- return $res;
484
- }
485
-
486
  }
6
  *
7
  */
8
  static public function search_ip( $which ) {
9
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-lkup.php' );
10
 
11
  // check format
12
  if ( filter_var( $ip = $_POST['ip'], FILTER_VALIDATE_IP ) ) {
420
  // Fallback function for PHP 5.3 and under
421
  static private function convert_encoding( $matches ) {
422
  return mb_convert_encoding(
423
+ pack( 'H*', str_replace( '\\u', '', $matches[0] ) ),
424
+ 'UTF-8', 'UTF-16'
425
  );
426
  }
427
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  }
admin/includes/tab-accesslog.php CHANGED
@@ -106,13 +106,13 @@ endif;
106
  */
107
  public static function list_accesslog() {
108
  // same as in tab-settings.php
109
- $dfn = __( '<dfn title="Validation log of request to %s.">%s</dfn>', 'ip-geo-block' );
110
  $target = array(
111
- 'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
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', 'ip-geo-block' ), __( 'Public facing pages', 'ip-geo-block' ) ),
116
  );
117
 
118
  foreach ( $target as $key => $val ) {
106
  */
107
  public static function list_accesslog() {
108
  // same as in tab-settings.php
109
+ $dfn = __( '<dfn title="Validate request to %s.">%s</dfn>', 'ip-geo-block' );
110
  $target = array(
111
+ 'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
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 ) {
admin/includes/tab-settings.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
- require_once IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php';
3
- require_once IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php';
4
 
5
  if ( ! function_exists( 'get_plugins' ) )
6
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
7
 
8
  class IP_Geo_Block_Admin_Tab {
9
 
@@ -91,8 +91,8 @@ class IP_Geo_Block_Admin_Tab {
91
 
92
  $rule_desc = array(
93
  __( 'Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;.', 'ip-geo-block' ),
94
- __( '<dfn title="&#8220;Block by country&#8221; will be bypassed in case of empty. All the countries will be blocked in case you put &#8220;XX&#8221; only.">Whitelist of country code</dfn>', 'ip-geo-block' ) . '<br />(<a rel="noreferrer" href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" title="ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia">ISO 3166-1 alpha-2</a>)',
95
- __( '<dfn title="&#8220;Block by country&#8221; will be bypassed in case of empty. Please consider to include &#8220;ZZ&#8221; which means UNKNOWN country.">Blacklist of country code</dfn>', 'ip-geo-block' ) . '<br />(<a rel="noreferrer" href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" title="ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia">ISO 3166-1 alpha-2</a>)',
96
  );
97
 
98
  $comma = array(
@@ -163,7 +163,7 @@ class IP_Geo_Block_Admin_Tab {
163
  add_settings_field(
164
  $option_name.'_'.$field.'_'.$key,
165
  __( '<dfn title="e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, &#8220;69.46.36.0/27&#8221; for WordFence server">Whitelist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
166
- ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia, the free encyclopedia">CIDR</a>)',
167
  array( $context, 'callback_field' ),
168
  $option_slug,
169
  $section,
@@ -182,7 +182,7 @@ class IP_Geo_Block_Admin_Tab {
182
  add_settings_field(
183
  $option_name.'_'.$field.'_'.$key,
184
  __( '<dfn title="Server level access control is recommended (e.g. .htaccess).">Blacklist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
185
- ' (<a rel="noreferrer" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia, the free encyclopedia">CIDR</a>)',
186
  array( $context, 'callback_field' ),
187
  $option_slug,
188
  $section,
@@ -236,7 +236,7 @@ class IP_Geo_Block_Admin_Tab {
236
  $field = 'response_code';
237
  add_settings_field(
238
  $option_name.'_'.$field,
239
- sprintf( __( '<dfn title="You can put your original 403.php and so on into your theme directory.">Response code</dfn> %s', 'ip-geo-block' ), '(<a rel="noreferrer" href="http://tools.ietf.org/html/rfc2616#section-10" title="RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1">RFC 2616</a>)' ),
240
  array( $context, 'callback_field' ),
241
  $option_slug,
242
  $section,
@@ -255,7 +255,6 @@ class IP_Geo_Block_Admin_Tab {
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
  ),
@@ -343,7 +342,7 @@ class IP_Geo_Block_Admin_Tab {
343
  ),
344
  'desc' => array(
345
  0 => __( 'Validate at &#8220;init&#8221; action hook in the same manner as typical plugins.', 'ip-geo-block' ),
346
- 1 => __( 'Validate at an earlier phase than other typical plugins. It can reduce load on server but has <a rel=\'noreferrer\' href=\'http://www.ipgeoblock.com/codex/validation-timing.html\' title=\'Validation timing | IP Geo Block\'>some restrictions</a>.', 'ip-geo-block' ),
347
  ),
348
  'after' => '<div class="ip-geo-block-desc"></div>',
349
  )
@@ -363,12 +362,12 @@ class IP_Geo_Block_Admin_Tab {
363
  // same as in tab-accesslog.php
364
  $dfn = __( '<dfn title="Validate request to %s.">%s</dfn>', 'ip-geo-block' );
365
  $target = array(
366
- 'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
367
- 'xmlrpc' => sprintf( $dfn, 'xmlrpc.php', __( 'XML-RPC', 'ip-geo-block' ) ),
368
- 'login' => sprintf( $dfn, 'wp-login.php', __( 'Login form', 'ip-geo-block' ) ),
369
- 'admin' => sprintf( $dfn, 'wp-admin/*.php', __( 'Admin area', 'ip-geo-block' ) ),
370
- 'others' => sprintf( $dfn, 'executable files', __( 'Other areas', 'ip-geo-block' ) ),
371
- 'public' => sprintf( $dfn, __( 'public facing pages', 'ip-geo-block' ), __( 'Public facing pages', 'ip-geo-block' ) ),
372
  );
373
 
374
  // Comment post
@@ -498,7 +497,7 @@ if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
498
  $key = 'admin';
499
  add_settings_field(
500
  $option_name.'_exception_'.$key,
501
- __( '<dfn title="Same effect as &#8220;ip-geo-block-bypass-admins&#8221; filter hook.">Exception for admin action and page</dfn>', 'ip-geo-block' ),
502
  array( $context, 'callback_field' ),
503
  $option_slug,
504
  $section,
@@ -508,7 +507,6 @@ if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
508
  'field' => 'exception',
509
  'sub-field' => $key,
510
  'value' => implode( ',', $options['exception'][ $key ] ),
511
- 'after' => $comma[0],
512
  )
513
  );
514
  endif;
@@ -516,7 +514,7 @@ endif;
516
  array_unshift( $list, __( 'Disable', 'ip-geo-block' ) );
517
  $desc = array(
518
  __( 'Regardless of the country code, it will block a malicious request to <code>%s&hellip;/*.php</code>.', 'ip-geo-block' ),
519
- __( 'It configures &#8220;%s&#8221; to validate a request to the PHP file which does not load WordPress core.', 'ip-geo-block' ),
520
  __( '<dfn title="Select the item which causes undesired blocking in order to exclude from the validation target. Grayed item indicates &#8220;INACTIVE&#8221;.">Exceptions</dfn>', 'ip-geo-block' ),
521
  );
522
 
@@ -834,7 +832,7 @@ endif;
834
  $key = 'simulate';
835
  add_settings_field(
836
  $option_name.'_'.$field.'_'.$key,
837
- '<dfn title="' . __( 'It enables to simulate validation without deployment. The results can be found at &#8220;Public facing pages&#8221; in Logs.', 'ip-geo-block' ) . '">' . __( 'Simulation mode', 'ip-geo-block' ) . '</dfn>',
838
  array( $context, 'callback_field' ),
839
  $option_slug,
840
  $section,
@@ -884,7 +882,7 @@ endif;
884
  if ( empty( $providers ) ) {
885
  $context->add_admin_notice( 'error',
886
  sprintf(
887
- __( 'Please download <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip" title="Download the contents of tokkonopapa/WordPress-IP-Geo-API as a zip file">ZIP file</a> from <a rel="noreferrer" href="https://github.com/tokkonopapa/WordPress-IP-Geo-API" title="tokkonopapa/WordPress-IP-Geo-API - GitHub">WordPress-IP-Geo-API</a> and upload <code>ip-geo-api</code> to <code>%s</code> with write permission.', 'ip-geo-block' ),
888
  apply_filters( 'ip-geo-block-api-dir', basename( WP_CONTENT_DIR ) )
889
  )
890
  );
@@ -1245,27 +1243,11 @@ endif;
1245
  'type' => 'none',
1246
  'before' =>
1247
  '<a class="button button-secondary" id="ip-geo-block-default" title="' . __( 'Import the default settings to revert to the &#8220;Right after installing&#8221; state', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Default settings', 'ip-geo-block' ) . '</a>&nbsp;' .
1248
- '<a class="button button-secondary" id="ip-geo-block-preferred" title="' . __( 'Import the preferred settings mainly for the &#8220;Validation target settings&#8221;', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Best settings', 'ip-geo-block' ) . '</a>',
1249
  'after' => '<div id="ip-geo-block-pre-defined"></div>',
1250
  )
1251
  );
1252
 
1253
- // Show WordPress installation info
1254
- $field = 'show-info';
1255
- add_settings_field(
1256
- $option_name.'_'.$field,
1257
- __( '<dfn title="Please copy &amp; paste when submitting your issue to support forum.">Installation information</dfn><br />[ <a rel="noreferrer" href="https://wordpress.org/support/plugin/ip-geo-block" title="WordPress &#8250; Support &raquo; IP Geo Block">support forum</a> ]', 'ip-geo-block' ),
1258
- array( $context, 'callback_field' ),
1259
- $option_slug,
1260
- $section,
1261
- array(
1262
- 'type' => 'none',
1263
- 'before' =>
1264
- '<a class="button button-secondary" id="ip-geo-block-show-info" title="' . __( 'Show PHP, WordPress, theme and plugins information.', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Show information', 'ip-geo-block' ) . '</a>&nbsp;',
1265
- 'after' => '<div id="ip-geo-block-wp-info"></div>',
1266
- )
1267
- );
1268
-
1269
  if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1270
  // Manipulate DB table for validation logs
1271
  $field = 'delete_table';
@@ -1310,8 +1292,8 @@ endif;
1310
  public static function note_target() {
1311
  echo
1312
  '<ul class="ip-geo-block-note">', "\n",
1313
- '<li>', __( 'To enhance the protection ability, please refer to &#8220;<a rel="noreferrer" href="http://www.ipgeoblock.com/codex/the-best-practice-for-target-settings.html" title="The best practice for target settings | IP Geo Block">The best practice for target settings</a>&#8221;.', 'ip-geo-block' ), '</li>', "\n",
1314
- '<li>', __( 'If you have any troubles with these, please check FAQ at <a rel="noreferrer" href="https://wordpress.org/plugins/ip-geo-block/faq/" title="IP Geo Block &mdash; WordPress Plugins">WordPress.org</a> and <a rel="noreferrer" href="http://www.ipgeoblock.com/codex/#faq" title="Codex | IP Geo Block">Codex</a>.', 'ip-geo-block' ), '</li>', "\n",
1315
  '</ul>', "\n";
1316
  }
1317
 
@@ -1326,8 +1308,8 @@ endif;
1326
  public static function note_public() {
1327
  echo
1328
  '<ul class="ip-geo-block-note">', "\n",
1329
- '<li>', __( 'Please refer to the document &#8220;<a rel="noreferrer" href="http://www.ipgeoblock.com/codex/#blocking-on-front-end" title="Codex | IP Geo Block">Blocking on front-end</a>&#8221; for details, including restrictions on cache plugin.', 'ip-geo-block' ), '</li>', "\n",
1330
- '<li>', __( 'If you find any issues or have something to suggest, please feel free to open an issue at <a rel="noreferrer" href="https://wordpress.org/support/plugin/ip-geo-block" title="WordPress &#8250; Support &raquo; IP Geo Block">support forum</a>.', 'ip-geo-block' ), '</li>', "\n",
1331
  '</ul>', "\n";
1332
  }
1333
 
1
  <?php
2
+ require_once( IP_GEO_BLOCK_PATH . 'classes/class-ip-geo-block-opts.php' );
3
+ require_once( IP_GEO_BLOCK_PATH . 'admin/includes/class-admin-rewrite.php' );
4
 
5
  if ( ! function_exists( 'get_plugins' ) )
6
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
7
 
8
  class IP_Geo_Block_Admin_Tab {
9
 
91
 
92
  $rule_desc = array(
93
  __( 'Please select either &#8220;Whitelist&#8221; or &#8220;Blacklist&#8221;.', 'ip-geo-block' ),
94
+ __( '<dfn title="&#8220;Block by country&#8221; will be bypassed in case of empty. All the countries will be blocked in case you put &#8220;XX&#8221; only.">Whitelist of country code</dfn>', 'ip-geo-block' ) . '<br/>(<a class="ip-geo-block-link" href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" title="ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia" target=_blank>ISO 3166-1 alpha-2</a>)',
95
+ __( '<dfn title="&#8220;Block by country&#8221; will be bypassed in case of empty. Please consider to include &#8220;ZZ&#8221; which means UNKNOWN country.">Blacklist of country code</dfn>', 'ip-geo-block' ) . '<br/>(<a class="ip-geo-block-link" href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements" title="ISO 3166-1 alpha-2 - Wikipedia, the free encyclopedia" target=_blank>ISO 3166-1 alpha-2</a>)',
96
  );
97
 
98
  $comma = array(
163
  add_settings_field(
164
  $option_name.'_'.$field.'_'.$key,
165
  __( '<dfn title="e.g. &#8220;192.0.64.0/18&#8221; for Jetpack server, &#8220;69.46.36.0/27&#8221; for WordFence server">Whitelist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
166
+ ' (<a class="ip-geo-block-link" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia, the free encyclopedia" target=_blank>CIDR</a>)',
167
  array( $context, 'callback_field' ),
168
  $option_slug,
169
  $section,
182
  add_settings_field(
183
  $option_name.'_'.$field.'_'.$key,
184
  __( '<dfn title="Server level access control is recommended (e.g. .htaccess).">Blacklist of extra IP addresses prior to country code</dfn>', 'ip-geo-block' ) .
185
+ ' (<a class="ip-geo-block-link" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing" title="Classless Inter-Domain Routing - Wikipedia, the free encyclopedia" target=_blank>CIDR</a>)',
186
  array( $context, 'callback_field' ),
187
  $option_slug,
188
  $section,
236
  $field = 'response_code';
237
  add_settings_field(
238
  $option_name.'_'.$field,
239
+ sprintf( __( '<dfn title="You can put your original 403.php and so on into your theme directory.">Response code</dfn> %s', 'ip-geo-block' ), '(<a class="ip-geo-block-link" href="http://tools.ietf.org/html/rfc2616#section-10" title="RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1" target=_blank>RFC 2616</a>)' ),
240
  array( $context, 'callback_field' ),
241
  $option_slug,
242
  $section,
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
  ),
342
  ),
343
  'desc' => array(
344
  0 => __( 'Validate at &#8220;init&#8221; action hook in the same manner as typical plugins.', 'ip-geo-block' ),
345
+ 1 => __( 'Validate at an earlier phase than other typical plugins. It can reduce load on server but has <a href=\'http://www.ipgeoblock.com/codex/validation-timing.html\' title=\'Validation timing | IP Geo Block\'>some restrictions</a>.', 'ip-geo-block' ),
346
  ),
347
  'after' => '<div class="ip-geo-block-desc"></div>',
348
  )
362
  // same as in tab-accesslog.php
363
  $dfn = __( '<dfn title="Validate request to %s.">%s</dfn>', 'ip-geo-block' );
364
  $target = array(
365
+ 'comment' => sprintf( $dfn, 'wp-comments-post.php', __( 'Comment post', 'ip-geo-block' ) ),
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
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,
507
  'field' => 'exception',
508
  'sub-field' => $key,
509
  'value' => implode( ',', $options['exception'][ $key ] ),
 
510
  )
511
  );
512
  endif;
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' ),
517
+ __( 'It configures &#8220%s&#8221 to validate a request to the PHP file which does not load WordPress core.', 'ip-geo-block' ),
518
  __( '<dfn title="Select the item which causes undesired blocking in order to exclude from the validation target. Grayed item indicates &#8220;INACTIVE&#8221;.">Exceptions</dfn>', 'ip-geo-block' ),
519
  );
520
 
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,
882
  if ( empty( $providers ) ) {
883
  $context->add_admin_notice( 'error',
884
  sprintf(
885
+ __( 'Please download <a href="https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip" title="Download the contents of tokkonopapa/WordPress-IP-Geo-API as a zip file">ZIP file</a> from <a href="https://github.com/tokkonopapa/WordPress-IP-Geo-API" title="tokkonopapa/WordPress-IP-Geo-API - GitHub">WordPress-IP-Geo-API</a> and upload <code>ip-geo-api</code> to <code>%s</code> with write permission.', 'ip-geo-block' ),
886
  apply_filters( 'ip-geo-block-api-dir', basename( WP_CONTENT_DIR ) )
887
  )
888
  );
1243
  'type' => 'none',
1244
  'before' =>
1245
  '<a class="button button-secondary" id="ip-geo-block-default" title="' . __( 'Import the default settings to revert to the &#8220;Right after installing&#8221; state', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Default settings', 'ip-geo-block' ) . '</a>&nbsp;' .
1246
+ '<a class="button button-secondary" id="ip-geo-block-preferred" title="' . __( 'Import the preferred settings mainly for the &#8220;Validation target settings&#8221;', 'ip-geo-block' ) . '" href="javascript:void(0)">' . __( 'Best practice', 'ip-geo-block' ) . '</a>',
1247
  'after' => '<div id="ip-geo-block-pre-defined"></div>',
1248
  )
1249
  );
1250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1251
  if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG ):
1252
  // Manipulate DB table for validation logs
1253
  $field = 'delete_table';
1292
  public static function note_target() {
1293
  echo
1294
  '<ul class="ip-geo-block-note">', "\n",
1295
+ '<li>', __( 'To enhance the protection ability, please refer to &#8220;<a href="http://www.ipgeoblock.com/codex/the-best-practice-of-target-settings.html" title="The best practice of target settings | IP Geo Block">The best practice of target settings</a>&#8221;.', 'ip-geo-block' ), '</li>', "\n",
1296
+ '<li>', __( 'If you have any troubles with these, please 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",
1297
  '</ul>', "\n";
1298
  }
1299
 
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
 
admin/js/admin.js CHANGED
@@ -17,7 +17,7 @@ var ip_geo_block_time = new Date();
17
  '$': 'ip-geo-block-',
18
  '%': 'ip_geo_block_'
19
  };
20
- return 'undefined' !== typeof id ? keys[selector] + id : keys.$ + selector;
21
  }
22
 
23
  function sanitize(str) {
@@ -47,7 +47,7 @@ var ip_geo_block_time = new Date();
47
  }
48
 
49
  function warning(status, msg) {
50
- window.alert(status ? sanitize(status + ': ' + msg) : sanitize(msg));
51
  }
52
 
53
  function notice_html5() {
@@ -348,42 +348,6 @@ var ip_geo_block_time = new Date();
348
  }
349
  };
350
 
351
- // google chart
352
- function drawChart() {
353
- if ($(ID('#', 'chart-countries')).length) {
354
- chart.drawChart();
355
- }
356
- }
357
-
358
- // Load / Save cookie using wpCookies in wp-includes/js/utils.js
359
- function loadCookie(id) {
360
- return ('undefined' !== typeof wpCookies && wpCookies.getHash(ID('$', id))) || {};
361
- }
362
-
363
- // setHash( name, value, expires, path, domain, secure )
364
- function saveCookie(id, cookie) {
365
- if ('undefined' !== typeof wpCookies) {
366
- var path = 'undefined' !== typeof IP_GEO_BLOCK_AUTH ? IP_GEO_BLOCK_AUTH.home + IP_GEO_BLOCK_AUTH.admin : '';
367
- wpCookies.setHash(ID('$', id), cookie, new Date(Date.now() + 2592000000), path);
368
- }
369
- }
370
-
371
- // Click event handler to show/hide form-table
372
- function toggleSection(title, id, cookie) {
373
- var index = title.closest('fieldset').data('ip-geo-block');
374
-
375
- // Show/Hide
376
- title.parent().nextAll().toggle();
377
- title.toggleClass(ID('dropup')).toggleClass(ID('dropdown'));
378
-
379
- cookie[index] = title.hasClass(ID('dropdown')) ? 'o' : 'x';
380
- saveCookie(id, cookie); // Save cookie
381
-
382
- // redraw google chart
383
- drawChart();
384
- }
385
-
386
- // form for export / import
387
  function add_hidden_form(cmd) {
388
  $('body').append(
389
  '<div style="display:none">' +
@@ -400,13 +364,19 @@ var ip_geo_block_time = new Date();
400
  }
401
 
402
  $(function () {
 
 
 
 
 
 
 
 
 
 
403
  // Make form style with fieldset and legend
404
  var fieldset = $('<fieldset class="' + ID('field') + '"></fieldset>'),
405
- legend = $('<legend></legend>'),
406
-
407
- // Get tab number and cookie
408
- tabNo = Number(IP_GEO_BLOCK.tab) || 0,
409
- cookie = loadCookie(tabNo);
410
 
411
  $('.form-table').each(function (index) {
412
  var $this = $(this),
@@ -422,7 +392,8 @@ var ip_geo_block_time = new Date();
422
 
423
  // Initialize show/hide form-table on tab 0, 1
424
  if (tabNo <= 1) {
425
- if ('undefined' === typeof cookie[index] || 'o' === cookie[index]) { // 'undefined', 'x' or 'o'
 
426
  title.addClass(ID('dropdown')).parent().nextAll().show();
427
  } else {
428
  title.addClass(ID('dropup')).parent().nextAll().hide();
@@ -430,10 +401,34 @@ var ip_geo_block_time = new Date();
430
  }
431
  });
432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  // Click event handler to show/hide form-table
434
  if (tabNo <= 1) {
435
  $('form').on('click', 'h2,h3', function (event) {
436
- toggleSection($(this), tabNo, cookie);
437
  return false;
438
  });
439
 
@@ -453,11 +448,13 @@ var ip_geo_block_time = new Date();
453
  $this.parent().nextAll().toggle(n ? false : true);
454
  $this.removeClass(id.join(' '))
455
  .addClass(n ? id[1] : id[0]);
456
- cookie[i] = n ? 'x' : 'o';
457
  });
458
 
459
  // Save cookie
460
- saveCookie(tabNo, cookie);
 
 
461
 
462
  // redraw google chart
463
  drawChart();
@@ -701,29 +698,6 @@ var ip_geo_block_time = new Date();
701
  }
702
  }).trigger('change');
703
 
704
- // Show WordPress installation info
705
- $(ID('#', 'show-info')).on('click', function (event) {
706
- $(ID('#', 'wp-info')).empty();
707
- ajax_post('wp-info', {
708
- cmd: 'show-info'
709
- }, function (data) {
710
- var key, val, res = [];
711
- for (key in data) {
712
- if (data.hasOwnProperty(key)) {
713
- for (val in data[key]) {
714
- if (data[key].hasOwnProperty(val)) {
715
- res.push('- ' + val + ' ' + data[key][val]);
716
- }
717
- }
718
- }
719
- }
720
-
721
- // response should be escaped at server side
722
- $(ID('#', 'wp-info')).html('<textarea rows="' + res.length + '">' + /*sanitize*/(res.join("\n")) + '</textarea>').find('textarea').select();
723
- return false;
724
- });
725
- });
726
-
727
  // Submit
728
  $('#submit').on('click', function (event) {
729
  var elm = $(ID('@', 'signature')),
@@ -898,7 +872,7 @@ var ip_geo_block_time = new Date();
898
  ajax_post('logs', {
899
  cmd: 'restore',
900
  which: null,
901
- time: new Date() - ip_geo_block_time
902
  }, function (data) {
903
  var key;
904
  for (key in data) {
@@ -938,7 +912,7 @@ var ip_geo_block_time = new Date();
938
  // Export / Import settings
939
  add_hidden_form('export-logs');
940
 
941
- // Export logs
942
  $(ID('#', 'export-logs')).on('click', function (event) {
943
  $(ID('#', 'export-form')).trigger('submit');
944
  return false;
17
  '$': 'ip-geo-block-',
18
  '%': 'ip_geo_block_'
19
  };
20
+ return id ? keys[selector] + id : keys.$ + selector;
21
  }
22
 
23
  function sanitize(str) {
47
  }
48
 
49
  function warning(status, msg) {
50
+ window.alert(status ? sanitize(status + ': ' + msg) : msg);
51
  }
52
 
53
  function notice_html5() {
348
  }
349
  };
350
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  function add_hidden_form(cmd) {
352
  $('body').append(
353
  '<div style="display:none">' +
364
  }
365
 
366
  $(function () {
367
+ // processing time for the browser's performance
368
+ ip_geo_block_time = new Date() - ip_geo_block_time;
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]);
376
+
377
  // Make form style with fieldset and legend
378
  var fieldset = $('<fieldset class="' + ID('field') + '"></fieldset>'),
379
+ legend = $('<legend></legend>');
 
 
 
 
380
 
381
  $('.form-table').each(function (index) {
382
  var $this = $(this),
392
 
393
  // Initialize show/hide form-table on tab 0, 1
394
  if (tabNo <= 1) {
395
+ index += tabIndex[tabNo];
396
+ if ('undefined' === typeof cookie[index] || cookie[index]) { // 'undefined' or 'o'
397
  title.addClass(ID('dropdown')).parent().nextAll().show();
398
  } else {
399
  title.addClass(ID('dropup')).parent().nextAll().hide();
401
  }
402
  });
403
 
404
+ var drawChart = function () {
405
+ if ($(ID('#', 'chart-countries')).length) {
406
+ chart.drawChart();
407
+ }
408
+ };
409
+
410
+ // Click event handler to show/hide form-table
411
+ var toggle_section = function (title) {
412
+ var index = title.closest('fieldset').data('ip-geo-block');
413
+
414
+ // Show/Hide
415
+ title.parent().nextAll().toggle();
416
+ title.toggleClass(ID('dropup')).toggleClass(ID('dropdown'));
417
+
418
+ // Save cookie
419
+ if ('undefined' !== typeof wpCookies) {
420
+ cookie[index + tabIndex[tabNo]] = title.hasClass(ID('dropdown')) ? 'o' : '';
421
+ wpCookies.setHash(ID('%', 'admin'), cookie, new Date(Date.now() + 2592000000));
422
+ }
423
+
424
+ // redraw google chart
425
+ drawChart();
426
+ };
427
+
428
  // Click event handler to show/hide form-table
429
  if (tabNo <= 1) {
430
  $('form').on('click', 'h2,h3', function (event) {
431
+ toggle_section($(this));
432
  return false;
433
  });
434
 
448
  $this.parent().nextAll().toggle(n ? false : true);
449
  $this.removeClass(id.join(' '))
450
  .addClass(n ? id[1] : id[0]);
451
+ cookie[i + tabIndex[tabNo]] = n ? '' : 'o';
452
  });
453
 
454
  // Save cookie
455
+ if ('undefined' !== typeof wpCookies) {
456
+ wpCookies.setHash(ID('%', 'admin'), cookie, new Date(Date.now() + 2592000000));
457
+ }
458
 
459
  // redraw google chart
460
  drawChart();
698
  }
699
  }).trigger('change');
700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  // Submit
702
  $('#submit').on('click', function (event) {
703
  var elm = $(ID('@', 'signature')),
872
  ajax_post('logs', {
873
  cmd: 'restore',
874
  which: null,
875
+ time: ip_geo_block_time
876
  }, function (data) {
877
  var key;
878
  for (key in data) {
912
  // Export / Import settings
913
  add_hidden_form('export-logs');
914
 
915
+ // Export settings
916
  $(ID('#', 'export-logs')).on('click', function (event) {
917
  $(ID('#', 'export-form')).trigger('submit');
918
  return false;
admin/js/admin.min.js CHANGED
@@ -3,4 +3,4 @@
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,l,C){function b(a,b){var c={".":".ip-geo-block-","#":"#ip-geo-block-","@":"#ip_geo_block_settings_",$:"ip-geo-block-","%":"ip_geo_block_"};return"undefined"!==typeof b?c[a]+b:c.$+a}function h(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function x(c,f){f?a(b("#",c)).addClass(b("loading")):a(b("#",c)).removeClass(b("loading"))}function q(a,b){l.confirm(h(a))&&b()}function v(a,b){l.alert(a?h(a+": "+b):h(b))}function y(a,b){if(-1!==location.href.indexOf(a)){var c=h(a)+(b?"&"+h(b):"");"undefined"===typeof IP_GEO_BLOCK_ZEP?l.location.href=c:IP_GEO_BLOCK_ZEP.redirect(c)}}function p(b,f,m,g){b&&x(b,!0);f.action=IP_GEO_BLOCK.action;f.nonce=IP_GEO_BLOCK.nonce;a.post(IP_GEO_BLOCK.url,f).done(function(a,b,d){m(a)}).fail(function(a,b,d){v(b,a.responseText)}).always(function(){b&&(g?a.when.apply(a,g).then(function(){x(b,!1)}):x(b,!1))})}function z(a,b){p(a,{cmd:"clear-"+a,which:b},function(a){y(a.page,a.tab)})}function D(a){p(a,{cmd:a},function(a){y(a.page,a.tab)})}function A(c,f,m,g){var k=!1,k=k|(0===c.prop("type").indexOf("checkbox")&&c.is(":checked")),k=k|(0===c.prop("type").indexOf("select")&&"0"!==c.val());f.nextAll("."+m+"_folding").each(function(c,d){d=a(d);k&&g?d.removeClass("folding-disable"):(d.children("li").hide(),d.addClass("folding-disable"),d.removeClass(b("dropdown")).addClass(b("dropup")))})}function u(a){return String(a).replace(/[a-z]/gi,function(a){return String.fromCharCode(a.charCodeAt(0)+("n">a.toLowerCase()?13:-13))})}function J(a,b){var c=new FileReader;c.onload=function(a){b&&b(a.target.result)};c.onerror=function(a){v("Error",a.target.error.code)};c.readAsText(a)}function E(c){var f=b("%","settings"),m=c.is(":checked"),g=a(b("@","public_target_rule")),k=c.closest("tr").nextAll("tr");k.find('[name^="'+f+'"]').prop("disabled",!m);k.find(b(".","desc")).css("opacity",m?1:.5);A(c,g,f,"1"===g.val()?!0:!1)}function B(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,g){a(b("@",g)).trigger("change")});E(a(b("@","validation_public")));var f=b("%","settings[providers][IPInfoDB]");a(b("@","providers_IPInfoDB")).prop("checked",c[f]?!0:!1)}}function F(){a(b("#","chart-countries")).length&&G.drawChart()}function H(a,f){if("undefined"!==typeof wpCookies){var c="undefined"!==typeof IP_GEO_BLOCK_AUTH?IP_GEO_BLOCK_AUTH.home+IP_GEO_BLOCK_AUTH.admin:"";wpCookies.setHash(b("$",a),f,new Date(Date.now()+2592E6),c)}}function I(c){a("body").append('<div style="display:none"><form method="POST" id="'+b("export-form")+'" action="'+IP_GEO_BLOCK.url.replace("ajax.php","post.php")+'"><input type="hidden" name="action" value="'+IP_GEO_BLOCK.action+'" /><input type="hidden" name="nonce" value="'+IP_GEO_BLOCK.nonce+'" /><input type="hidden" name="cmd" value="'+c+'" /><input type="hidden" name="data" value="" id="'+b("export-data")+'"/><input type="submit" value="submit" /></form><input type="file" name="settings" id="'+b("file-dialog")+'" /></div>')}a.fn.deserialize=function(b,f){return this.each(function(){var c,g,f,h=this,d={};for(c in b)b.hasOwnProperty(c)&&(g=decodeURIComponent(c),f=decodeURIComponent(b[c]),g in d||(d[g]=[]),d[g].push(f));a.each(d,function(b,d){a('[name="'+b+'"]:input',h).val(d)})})};var G={self:this,drawChart:function(){this.drawPie();this.drawLine()},dataPie:null,viewPie:null,drawPie:function(){if(!self.dataPie){self.dataPie=new google.visualization.DataTable;self.dataPie.addColumn("string","Country");self.dataPie.addColumn("number","Requests");var c;a(b("#","countries li")).each(function(){c=a(this).text().split(":");self.dataPie.addRow([c[0]||"",Number(c[1])])})}self.viewPie||(self.viewPie=new google.visualization.PieChart(C.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,f,h,g,k,l,d=[],e=a(b("#","targets tr"));g=e.length;for(c=0;c<g;c++)for(d[c]=[],l=e.eq(c).children(),k=l.length,f=0;f<k;f++)h=l.eq(f).text(),d[c].push(f?Number(h):new Date(h));self.dataLine.addRows(d)}self.viewLine||(self.viewLine=new google.visualization.LineChart(C.getElementById(b("chart-daily"))));if(c=a(b("#","chart-daily")).width())c=320<c?!0:!1,self.viewLine.draw(self.dataLine,{backgroundColor:"#f1f1f1",legend:{position:"bottom"},hAxis:{format:"MM/dd"},vAxis:{textPosition:c?"out":"in"},chartArea:{left:c?"10%":0,top:"5%",width:"100%",height:"75%"}})}};a(function(){var c=a('<fieldset class="'+b("field")+'"></fieldset>'),f=a("<legend></legend>"),m=Number(IP_GEO_BLOCK.tab)||0,g="undefined"!==typeof wpCookies&&wpCookies.getHash(b("$",m))||{};a(".form-table").each(function(d){var e=a(this),n=e.prevAll("h2,h3:first"),t=n.nextUntil(e);e.wrap(c).parent().attr("id",b("settings-"+d)).data("ip-geo-block",d).prepend(n.wrap(f).parent());t.insertBefore(e);1>=m&&("undefined"===typeof g[d]||"o"===g[d]?n.addClass(b("dropdown")).parent().nextAll().show():n.addClass(b("dropup")).parent().nextAll().hide())});1>=m&&(a("form").on("click","h2,h3",function(d){d=a(this);var e=d.closest("fieldset").data("ip-geo-block");d.parent().nextAll().toggle();d.toggleClass(b("dropup")).toggleClass(b("dropdown"));g[e]=d.hasClass(b("dropdown"))?"o":"x";H(m,g);F();return!1}),a(b("#","toggle-sections")).on("click",function(d){var e,c=0,t=[b("dropdown"),b("dropup")];d=a(b(".","field")).find("h2,h3");d.each(function(b){c+=a(this).hasClass(t[0])});d.each(function(b){e=a(this);e.parent().nextAll().toggle(c?!1:!0);e.removeClass(t.join(" ")).addClass(c?t[1]:t[0]);g[b]=c?"x":"o"});H(m,g);F();return!1}));a(b("#","inhibit")).on("submit",function(){return!1});switch(m){case 0:a(b("#","scan-code")).on("click",function(d){var c=a(this).parent();p("scanning",{cmd:"scan-code"},function(a){c.children("ul").length||c.append('<ul id="'+b("code-list")+'"></ul>');c=c.children("ul").empty();var d,e;for(d in a)a.hasOwnProperty(d)&&(d=h(d),"string"===typeof a[d]?e=h(a[d]):(e=h(a[d].code),d='<abbr title="'+h(a[d].type)+'">'+d+"</abbr>"),c.append("<li>"+d+' : <span class="'+b("notice")+'">'+e+"</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(d){p("download",{cmd:"download"},function(d){var c,e,r;for(c in d)if(d.hasOwnProperty(c))for(e in r=d[c],r)r.hasOwnProperty(e)&&(e=h(e),r[e].filename&&a(b("@",c+"_"+e+"_path")).val(h(r[e].filename)),r[e].message&&a(b("#",c+"-"+e)).text(h(r[e].message)))});return!1});var k=b("%","settings");a(b("@","validation_login")).on("change",function(b){b=a(this);A(b,b,k,!0);return!1}).trigger("change");a('select[name^="'+k+'"]').on("change",function(d){d=a(this);var c,n=b(".","desc");d.next(n).empty();(c=d.children("option:selected").data("desc"))&&d.next(n).html(a.parseHTML(c));A(d,d,k,!0);return!1}).trigger("change");a(b("@","validation_public")).on("change",function(b){E(a(this));return!1}).trigger("change");I("validate");a(b("#","export")).on("click",function(d){if("undefined"===typeof JSON)return v(null,IP_GEO_BLOCK.msg[6]),!1;var c=k,n={};a.each(a(this).closest("form").serializeArray(),function(a,b){-1!==b.name.indexOf(c)&&(n[b.name]=b.value)});n[c+="[signature]"]=l.btoa(u(n[c]));a(b("#","export-data")).val(JSON.stringify(n));a(b("#","export-form")).trigger("submit");return!1});a(b("#","file-dialog")).on("change",function(a){if("undefined"===typeof FileReader)return v(null,IP_GEO_BLOCK.msg[6]),!1;var b;(a=a.target.files[0])&&J(a,function(a){a=JSON.parse(a);b=k+"[signature]";"undefined"!==typeof a[b]&&(a[b]=l.btoa(u(a[b])));p("export-import",{cmd:"validate",data:JSON.stringify(a)},B)});return!1});a(b("#","import")).on("click",function(d){a(b("#","file-dialog")).trigger("click");return!1});a(b("#","default")).on("click",function(a){q(IP_GEO_BLOCK.msg[0],function(){p("pre-defined",{cmd:"import-default"},B)});return!1});a(b("#","preferred")).on("click",function(a){q(IP_GEO_BLOCK.msg[0],function(){p("pre-defined",{cmd:"import-preferred"},B)});return!1});a(b("@","create_table")).on("click",function(a){q(IP_GEO_BLOCK.msg[1],function(){D("create-table")});return!1});a(b("@","delete_table")).on("click",function(a){q(IP_GEO_BLOCK.msg[2],function(){D("delete-table")});return!1});a("ul."+k+"_folding dfn").on("click",function(d){d=a(this).parent();d.children("li").toggle();d.toggleClass(b("dropup")).toggleClass(b("dropdown"));return!1});a(b("#","decode")).on("click",function(d){d=a(b("@","signature"));var c=d.val();-1===c.search(/,/)?d.val(u(l.atob(c))):d.val(l.btoa(u(c)));return!1});a(b("@","response_code")).on("change",function(b){b=parseInt(a(this).val()/100,10);var d=a(this).closest("tr").nextAll("tr");3>=b?d.each(function(b){0===b?a(this).show():1===b&&a(this).hide()}):d.each(function(b){0===b?a(this).hide():1===b&&a(this).show()})}).trigger("change");a(b("#","show-info")).on("click",function(d){a(b("#","wp-info")).empty();p("wp-info",{cmd:"show-info"},function(d){var c,e,f=[];for(c in d)if(d.hasOwnProperty(c))for(e in d[c])d[c].hasOwnProperty(e)&&f.push("- "+e+" "+d[c][e]);a(b("#","wp-info")).html('<textarea rows="'+f.length+'">'+f.join("\n")+"</textarea>").find("textarea").select();return!1})});a("#submit").on("click",function(d){d=a(b("@","signature"));var c=d.val();-1!==c.search(/,/)&&d.val(l.btoa(u(c)));return!0});break;case 1:a(b("#","chart-countries")).length&&"object"===typeof google&&google.load("visualization","1",{packages:["corechart"],callback:function(){G.drawChart()}});a(b("@","clear_statistics")).on("click",function(a){q(IP_GEO_BLOCK.msg[3],function(){z("statistics",null)});return!1});a(b("@","clear_cache")).on("click",function(a){q(IP_GEO_BLOCK.msg[4],function(){z("cache",null)});return!1});break;case 2:a(l).on(b("gmap-error"),function(){p(null,{cmd:"gmap-error"},function(a){y(a.page,a.tab)})});var w=a(b("#","map"));"object"===typeof google?w.each(function(){a(this).GmapRS()}):w.each(function(){a(this).empty().html('<iframe src="//maps.google.com/maps?output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')});a(b("@","get_location")).on("click",function(c){var d=a(b("#","whois")),f=a(b("@","ip_address")).val();f&&(d.hide().empty(),c=a.whois(f,function(c){var e,f="";for(e=0;e<c.length;e++)f+="<tr><td>"+c[e].name+"</td><td>"+c[e].value+"</td></tr>";d.html('<fieldset 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})}),p("loading",{cmd:"search",ip:f,which:a(b("@","service")).val()},function(a){var c,d="",e=h(a.latitude||"0"),g=h(a.longitude||"0"),k=a.latitude||a.longitude?8:2;for(c in a)a.hasOwnProperty(c)&&(c=h(c),d+='<li><span class="'+b("title")+'">'+c+' : </span><span class="'+b("result")+'">'+h(a[c])+"</span></li>");"object"===typeof google?w.GmapRS("addMarker",{latitude:e,longitude:g,title:f,content:"<ul>"+d+"</ul>",show:!0,zoom:k}):w.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")+'">'+h(f)+"</span></li>"+d+'</ul><iframe src="//maps.google.com/maps?q='+e+","+g+"&z="+k+'&output=embed" frameborder="0" style="width:100%; height:400px; border:0" allowfullscreen></iframe>')},[c]));return!1});a(b("@","ip_address")).val()&&a(b("@","get_location")).trigger("click");break;case 4:a(b(".","log")).hide().length&&p("logs",{cmd:"restore",which:null,time:new Date-ip_geo_block_time},function(c){for(var d in c)c.hasOwnProperty(d)&&(d=h(d),a(b("#","log-"+d)).html(c[d]));"function"===typeof a.fn.footable&&a(b(".","log")).fadeIn("slow").footable();a('tbody[id^="'+b("$","log-")+'"]').on("click","a",function(b){l.open(l.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){q(IP_GEO_BLOCK.msg[5],function(){z("logs",null)});return!1}),I("export-logs"),a(b("#","export-logs")).on("click",function(c){a(b("#","export-form")).trigger("submit");return!1})}})})(jQuery,window,document);
3
  Copyright (c) 2015-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("$","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);
admin/js/authenticate.js CHANGED
@@ -38,8 +38,7 @@ var IP_GEO_BLOCK_ZEP = {
38
 
39
  // Parse a URL and return its components
40
  function parse_uri(uri) {
41
- // avoid malformed URI error when uri includes '%'
42
- uri = /*decodeURIComponent*/(uri ? uri.toString() : '');
43
 
44
  var m = uri.match(
45
  // https://tools.ietf.org/html/rfc3986#appendix-B
@@ -122,14 +121,14 @@ var IP_GEO_BLOCK_ZEP = {
122
  // returns the absloute path as a string
123
  return real.join('/').replace(/\/\//g, '/');
124
  }
125
- /*
126
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
127
  function encodeURIComponentRFC3986(str) {
128
  return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
129
  return '%' + c.charCodeAt(0).toString(16);
130
  });
131
  }
132
- */
133
  // append the nonce as query strings to the uri
134
  function add_query_nonce(uri, nonce) {
135
  if (typeof uri !== 'object') { // `string` or `undefined`
@@ -147,7 +146,7 @@ var IP_GEO_BLOCK_ZEP = {
147
  }
148
  }
149
 
150
- data.push(IP_GEO_BLOCK_ZEP.auth + '=' + encodeURIComponent(nonce));//RFC3986
151
  uri.query = data.join('&');
152
 
153
  return compose_uri(uri);
@@ -248,7 +247,7 @@ var IP_GEO_BLOCK_ZEP = {
248
  if (callback) {
249
  data = callback(data);
250
  }
251
- data.push(IP_GEO_BLOCK_ZEP.auth + '=' + encodeURIComponent(nonce));//RFC3986
252
  settings.data = data.join('&');
253
  }
254
  }
@@ -318,7 +317,7 @@ var IP_GEO_BLOCK_ZEP = {
318
  }
319
  });
320
 
321
- $body.onFirst('click contextmenu', 'a', function (event) {
322
  // attr() returns 'string' or 'undefined'
323
  var $this = $(this),
324
  href = $this.attr('href'),
@@ -344,7 +343,7 @@ var IP_GEO_BLOCK_ZEP = {
344
 
345
  // stop event propagation
346
  $this.removeAttr('target');
347
- $this.off('click contextmenu');
348
  event.preventDefault();
349
  event.stopPropagation();
350
  event.stopImmediatePropagation();
38
 
39
  // Parse a URL and return its components
40
  function parse_uri(uri) {
41
+ uri = decodeURIComponent(uri ? uri.toString() : '');
 
42
 
43
  var m = uri.match(
44
  // https://tools.ietf.org/html/rfc3986#appendix-B
121
  // returns the absloute path as a string
122
  return real.join('/').replace(/\/\//g, '/');
123
  }
124
+
125
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
126
  function encodeURIComponentRFC3986(str) {
127
  return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
128
  return '%' + c.charCodeAt(0).toString(16);
129
  });
130
  }
131
+
132
  // append the nonce as query strings to the uri
133
  function add_query_nonce(uri, nonce) {
134
  if (typeof uri !== 'object') { // `string` or `undefined`
146
  }
147
  }
148
 
149
+ data.push(IP_GEO_BLOCK_ZEP.auth + '=' + encodeURIComponentRFC3986(nonce));
150
  uri.query = data.join('&');
151
 
152
  return compose_uri(uri);
247
  if (callback) {
248
  data = callback(data);
249
  }
250
+ data.push(IP_GEO_BLOCK_ZEP.auth + '=' + encodeURIComponentRFC3986(nonce));
251
  settings.data = data.join('&');
252
  }
253
  }
317
  }
318
  });
319
 
320
+ $body.onFirst('click', 'a', function (event) {
321
  // attr() returns 'string' or 'undefined'
322
  var $this = $(this),
323
  href = $this.attr('href'),
343
 
344
  // stop event propagation
345
  $this.removeAttr('target');
346
+ $this.off('click');
347
  event.preventDefault();
348
  event.stopPropagation();
349
  event.stopImmediatePropagation();
admin/js/authenticate.min.js CHANGED
@@ -3,4 +3,4 @@
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,r){function t(a){return a?a.toString().replace(/[&<>"']/g,function(a){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[a]}):""}function g(a){a=a?a.toString():"";a=a.match(/^(?:([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return{scheme:a[1]||"",relative:a[2]||"",authority:a[3]||"",path:a[4]||"",query:a[5]||"",fragment:a[6]||""}}function h(a,b){"object"!==typeof a&&(a=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+"="+encodeURIComponent(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)&&u.test(b))return 1}return 0}function m(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 n(){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 contextmenu","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='+t(this.href)+'" />'),d.document.close(),c.removeAttr("target"),c.off("click contextmenu"),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 u=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|.*/)?$"),p=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},q={"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":p,"network/theme-install.php":p};e(r).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=q.hasOwnProperty(d)?q[d]:null)&&(b=d(b));b.push(IP_GEO_BLOCK_ZEP.auth+"="+encodeURIComponent(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)&&m(d,c,f);else"string"===typeof a&&m(d,a,f);return d});e(function(){e("a").each(function(){this.hasAttribute("onClick")||this.setAttribute("onClick","javascript:void(0);")});n();IP_GEO_BLOCK_ZEP.init=!0});e(window).on("error",function(){IP_GEO_BLOCK_ZEP.init||n()})})(jQuery,document);
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|.*/)?$"),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);
admin/js/footable.min.js CHANGED
@@ -3,8 +3,6 @@
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.
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.
classes/class-ip-geo-block-actv.php CHANGED
@@ -26,7 +26,7 @@ class IP_Geo_Block_Activate {
26
 
27
  // initialize main blog
28
  public static function init_main_blog() {
29
- if ( current_user_can( 'manage_options' ) ) {
30
  $settings = IP_Geo_Block::get_option();
31
 
32
  // kick off a cron job to download database immediately
@@ -66,9 +66,7 @@ class IP_Geo_Block_Activate {
66
  self::activate_blog();
67
  }
68
 
69
- // only after 'init' action hook for is_user_logged_in().
70
- if ( did_action( 'init' ) && is_user_logged_in() )
71
- self::init_main_blog(); // should be called with high priority
72
  }
73
 
74
  /**
26
 
27
  // initialize main blog
28
  public static function init_main_blog() {
29
+ if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
30
  $settings = IP_Geo_Block::get_option();
31
 
32
  // kick off a cron job to download database immediately
66
  self::activate_blog();
67
  }
68
 
69
+ self::init_main_blog(); // should be called with high priority
 
 
70
  }
71
 
72
  /**
classes/class-ip-geo-block-apis.php CHANGED
@@ -458,11 +458,11 @@ class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
458
  $cache = self::get_cache( $ip = $validate['ip'] );
459
 
460
  if ( $cache ) {
461
- $fail = $cache['fail'] + ( empty( $validate['fail'] ) ? 0 : 1 );
462
- $call = $cache['call'] + ( empty( $validate['fail'] ) ? 1 : 0 );
463
  } else { // if new cache then reset these values
464
- $fail = 0;
465
  $call = 1;
 
466
  }
467
 
468
  // update elements
@@ -472,7 +472,7 @@ class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
472
  'hook' => $hook,
473
  'code' => $validate['code'],
474
  'auth' => $validate['auth'], // get_current_user_id() > 0
475
- 'fail' => $fail, // $validate['auth'] ? 0 : $fail,
476
  'call' => $settings['save_statistics'] ? $call : 0,
477
  'host' => isset( $validate['host'] ) ? $validate['host'] : NULL,
478
  ) );
@@ -482,7 +482,6 @@ class IP_Geo_Block_API_Cache extends IP_Geo_Block_API {
482
 
483
  public static function clear_cache() {
484
  IP_Geo_Block_Logs::clear_cache();
485
- self::$memcache = array();
486
  }
487
 
488
  public static function get_cache_all() {
@@ -519,43 +518,43 @@ class IP_Geo_Block_Provider {
519
  'freegeoip.net' => array(
520
  'key' => NULL,
521
  'type' => 'IPv4, IPv6 / free',
522
- 'link' => '<a rel="noreferrer" href="http://freegeoip.net/" title="freegeoip.net: FREE IP Geolocation Web Service">http://freegeoip.net/</a>&nbsp;(IPv4, IPv6 / free)',
523
  ),
524
 
525
  'ipinfo.io' => array(
526
  'key' => NULL,
527
  'type' => 'IPv4, IPv6 / free',
528
- 'link' => '<a rel="noreferrer" href="http://ipinfo.io/" title="ip address information including geolocation, hostname and network details">http://ipinfo.io/</a>&nbsp;(IPv4, IPv6 / free)',
529
  ),
530
 
531
  'Nekudo' => array(
532
  'key' => NULL,
533
  'type' => 'IPv4, IPv6 / free',
534
- 'link' => '<a rel="noreferrer" href="http://geoip.nekudo.com/" title="geoip.nekudo.com | Free IP to geolocation API">http://geoip.nekudo.com/</a>&nbsp;(IPv4, IPv6 / free)',
535
  ),
536
 
537
  'Xhanch' => array(
538
  'key' => NULL,
539
  'type' => 'IPv4 / free',
540
- 'link' => '<a rel="noreferrer" href="http://xhanch.com/xhanch-api-ip-get-detail/" title="Xhanch API &#8211; IP Get Detail | Xhanch Studio">http://xhanch.com/</a>&nbsp;(IPv4 / free)',
541
  ),
542
 
543
  'GeoIPLookup' => array(
544
  'key' => NULL,
545
  'type' => 'IPv4, IPv6 / free',
546
- 'link' => '<a rel="noreferrer" href="http://geoiplookup.net/" title="What Is My IP Address | GeoIP Lookup">GeoIPLookup.net</a>&nbsp;(IPv4, IPv6 / free)',
547
  ),
548
 
549
  'ip-api.com' => array(
550
  'key' => FALSE,
551
  'type' => 'IPv4, IPv6 / free for non-commercial use',
552
- 'link' => '<a rel="noreferrer" href="http://ip-api.com/" title="IP-API.com - Free Geolocation API">http://ip-api.com/</a>&nbsp;(IPv4, IPv6 / free for non-commercial use)',
553
  ),
554
 
555
  'IPInfoDB' => array(
556
  'key' => '',
557
  'type' => 'IPv4, IPv6 / free for registered user',
558
- 'link' => '<a rel="noreferrer" href="http://ipinfodb.com/" title="IPInfoDB | Free IP Address Geolocation Tools">http://ipinfodb.com/</a>&nbsp;(IPv4, IPv6 / free for registered user)',
559
  ),
560
  );
561
 
@@ -648,7 +647,10 @@ class IP_Geo_Block_Provider {
648
  }
649
 
650
  if ( 0 === $field )
651
- return __( 'You need to select at least one IP geolocation service. Otherwise <strong>you\'ll be blocked</strong> after the cache expires.', 'ip-geo-block' );
 
 
 
652
 
653
  return NULL;
654
  }
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
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
  ) );
482
 
483
  public static function clear_cache() {
484
  IP_Geo_Block_Logs::clear_cache();
 
485
  }
486
 
487
  public static function get_cache_all() {
518
  'freegeoip.net' => array(
519
  'key' => NULL,
520
  'type' => 'IPv4, IPv6 / free',
521
+ 'link' => '<a class="ip-geo-block-link" href="http://freegeoip.net/" title="freegeoip.net: FREE IP Geolocation Web Service" rel=noreferrer target=_blank>http://freegeoip.net/</a>&nbsp;(IPv4, IPv6 / free)',
522
  ),
523
 
524
  'ipinfo.io' => array(
525
  'key' => NULL,
526
  'type' => 'IPv4, IPv6 / free',
527
+ 'link' => '<a class="ip-geo-block-link" href="http://ipinfo.io/" title="ip address information including geolocation, hostname and network details" rel=noreferrer target=_blank>http://ipinfo.io/</a>&nbsp;(IPv4, IPv6 / free)',
528
  ),
529
 
530
  'Nekudo' => array(
531
  'key' => NULL,
532
  'type' => 'IPv4, IPv6 / free',
533
+ 'link' => '<a class="ip-geo-block-link" href="http://geoip.nekudo.com/" title="geoip.nekudo.com | Free IP to geolocation API" rel=noreferrer target=_blank>http://geoip.nekudo.com/</a>&nbsp;(IPv4, IPv6 / free)',
534
  ),
535
 
536
  'Xhanch' => array(
537
  'key' => NULL,
538
  'type' => 'IPv4 / free',
539
+ 'link' => '<a class="ip-geo-block-link" href="http://xhanch.com/xhanch-api-ip-get-detail/" title="Xhanch API &#8211; IP Get Detail | Xhanch Studio" rel=noreferrer target=_blank>http://xhanch.com/</a>&nbsp;(IPv4 / free)',
540
  ),
541
 
542
  'GeoIPLookup' => array(
543
  'key' => NULL,
544
  'type' => 'IPv4, IPv6 / free',
545
+ 'link' => '<a class="ip-geo-block-link" href="http://geoiplookup.net/" title="What Is My IP Address | GeoIP Lookup" rel=noreferrer target=_blank>GeoIPLookup.net</a>&nbsp;(IPv4, IPv6 / free)',
546
  ),
547
 
548
  'ip-api.com' => array(
549
  'key' => FALSE,
550
  'type' => 'IPv4, IPv6 / free for non-commercial use',
551
+ 'link' => '<a class="ip-geo-block-link" href="http://ip-api.com/" title="IP-API.com - Free Geolocation API" rel=noreferrer target=_blank>http://ip-api.com/</a>&nbsp;(IPv4, IPv6 / free for non-commercial use)',
552
  ),
553
 
554
  'IPInfoDB' => array(
555
  'key' => '',
556
  'type' => 'IPv4, IPv6 / free for registered user',
557
+ 'link' => '<a class="ip-geo-block-link" href="http://ipinfodb.com/" title="IPInfoDB | Free IP Address Geolocation Tools" rel=noreferrer target=_blank>http://ipinfodb.com/</a>&nbsp;(IPv4, IPv6 / free for registered user)',
558
  ),
559
  );
560
 
647
  }
648
 
649
  if ( 0 === $field )
650
+ return __(
651
+ 'You need to select at least one IP geolocation service. Otherwise <strong>you\'ll be blocked</strong> after the cache expires.',
652
+ 'ip-geo-block'
653
+ );
654
 
655
  return NULL;
656
  }
classes/class-ip-geo-block-cron.php CHANGED
@@ -73,7 +73,7 @@ class IP_Geo_Block_Cron {
73
 
74
  // if blocking may happen then disable validation
75
  if ( -1 !== (int)$settings['matching_rule'] && 'passed' !== $validate['result'] &&
76
- ( empty( $_SERVER['HTTP_X_REQUESTED_FROM'] ) || FALSE === strpos( $_SERVER['HTTP_X_REQUESTED_FROM'], 'InfiniteWP' ) ) ) {
77
  $settings['matching_rule'] = -1;
78
  }
79
 
@@ -144,11 +144,7 @@ class IP_Geo_Block_Cron {
144
  *
145
  */
146
  public static function start_update_db( $settings ) {
147
- if ( ! function_exists( 'is_plugin_active' ) )
148
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
149
-
150
- // the status is still inactive when this plugin is activated on dashboard.
151
- if ( ! is_plugin_active( IP_GEO_BLOCK_BASE ) ) {
152
  set_transient( IP_Geo_Block::CRON_NAME, IP_Geo_Block::get_ip_address(), MINUTE_IN_SECONDS );
153
  self::schedule_cron_job( $settings['update'], NULL, TRUE );
154
  }
@@ -170,8 +166,9 @@ class IP_Geo_Block_Cron {
170
  }
171
 
172
  public static function start_cache_gc( $settings ) {
173
- if ( ! wp_next_scheduled( IP_Geo_Block::CACHE_NAME ) )
174
  wp_schedule_single_event( time() + $settings['cache_time_gc'], IP_Geo_Block::CACHE_NAME );
 
175
  }
176
 
177
  public static function stop_cache_gc() {
@@ -252,83 +249,50 @@ class IP_Geo_Block_Cron {
252
  if ( 'gz' === $args && function_exists( 'gzopen' ) ) {
253
  if ( FALSE === ( $gz = gzopen( $src, 'r' ) ) )
254
  throw new Exception(
255
- sprintf( __( 'Unable to read %s. Please check the permission.', 'ip-geo-block' ), $src )
256
- );
257
-
258
- if ( FALSE === ( $fp = @fopen( $filename, 'cb' ) ) )
259
- throw new Exception(
260
- sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), $filename )
261
  );
262
 
263
- if ( ! flock( $fp, LOCK_EX ) )
264
  throw new Exception(
265
- sprintf( __( 'Can\'t lock %s. Please try again after a while.', 'ip-geo-block' ), $filename )
 
 
 
266
  );
267
 
268
- ftruncate( $fp, 0 ); // truncate file
269
-
270
  // same block size in wp-includes/class-http.php
271
- while ( $data = gzread( $gz, 4096 ) ) {
272
  fwrite( $fp, $data, strlen( $data ) );
273
- }
 
 
274
  }
275
 
276
  elseif ( 'zip' === $args && class_exists( 'ZipArchive' ) ) {
277
  // https://codex.wordpress.org/Function_Reference/unzip_file
278
  WP_Filesystem();
279
- $tmp = get_temp_dir(); // @since 2.5
280
- $ret = unzip_file( $src, $tmp ); // @since 2.5
281
 
282
  if ( is_wp_error( $ret ) )
283
  throw new Exception(
284
  $ret->get_error_code() . ' ' . $ret->get_error_message()
285
  );
286
-
287
- if ( FALSE === ( $gz = @fopen( $tmp .= basename( $filename ), 'r' ) ) )
288
- throw new Exception(
289
- sprintf( __( 'Unable to read %s. Please check the permission.', 'ip-geo-block' ), $src )
290
- );
291
-
292
- if ( FALSE === ( $fp = @fopen( $filename, 'cb' ) ) )
293
- throw new Exception(
294
- sprintf( __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ), $filename )
295
- );
296
-
297
- if ( ! flock( $fp, LOCK_EX ) )
298
- throw new Exception(
299
- sprintf( __( 'Can\'t lock %s. Please try again after a while.', 'ip-geo-block' ), $filename )
300
- );
301
-
302
- ftruncate( $fp, 0 ); // truncate file
303
-
304
- // same block size in wp-includes/class-http.php
305
- while ( $data = fread( $gz, 4096 ) ) {
306
- fwrite( $fp, $data, strlen( $data ) );
307
- }
308
  }
309
 
310
- if ( ! empty( $fp ) ) {
311
- fflush( $fp ); // flush output before releasing the lock
312
- flock ( $fp, LOCK_UN ); // release the lock
313
- fclose( $fp );
314
- }
315
-
316
- ! empty( $gz ) and gzclose( $gz );
317
- ! empty( $tmp ) && @is_file( $tmp ) and @unlink( $tmp );
318
- ! is_wp_error( $src ) && @is_file( $src ) and @unlink( $src );
319
  }
320
 
321
  // error handler
322
  catch ( Exception $e ) {
323
- if ( ! empty( $fp ) ) {
324
- fflush( $fp ); // flush output before releasing the lock
325
- flock ( $fp, LOCK_UN ); // release the lock
326
- fclose( $fp );
327
  }
328
 
329
- ! empty( $gz ) and gzclose( $gz );
330
- ! empty( $tmp ) && @is_file( $tmp ) and @unlink( $tmp );
331
- ! is_wp_error( $src ) && @is_file( $src ) and @unlink( $src );
332
 
333
  return array(
334
  'code' => $e->getCode(),
73
 
74
  // if blocking may happen then disable validation
75
  if ( -1 !== (int)$settings['matching_rule'] && 'passed' !== $validate['result'] &&
76
+ FALSE === strpos( $_SERVER['HTTP_X_REQUESTED_FROM'], 'InfiniteWP' ) ) {
77
  $settings['matching_rule'] = -1;
78
  }
79
 
144
  *
145
  */
146
  public static function start_update_db( $settings ) {
147
+ if ( has_action( 'activate_' . IP_GEO_BLOCK_BASE ) ) {
 
 
 
 
148
  set_transient( IP_Geo_Block::CRON_NAME, IP_Geo_Block::get_ip_address(), MINUTE_IN_SECONDS );
149
  self::schedule_cron_job( $settings['update'], NULL, TRUE );
150
  }
166
  }
167
 
168
  public static function start_cache_gc( $settings ) {
169
+ if ( ! wp_next_scheduled( IP_Geo_Block::CACHE_NAME ) ) {
170
  wp_schedule_single_event( time() + $settings['cache_time_gc'], IP_Geo_Block::CACHE_NAME );
171
+ }
172
  }
173
 
174
  public static function stop_cache_gc() {
249
  if ( 'gz' === $args && function_exists( 'gzopen' ) ) {
250
  if ( FALSE === ( $gz = gzopen( $src, 'r' ) ) )
251
  throw new Exception(
252
+ sprintf(
253
+ __( 'Unable to read %s. Please check the permission.', 'ip-geo-block' ),
254
+ $src
255
+ )
 
 
256
  );
257
 
258
+ if ( FALSE === ( $fp = @fopen( $filename, 'wb' ) ) )
259
  throw new Exception(
260
+ sprintf(
261
+ __( 'Unable to write %s. Please check the permission.', 'ip-geo-block' ),
262
+ $filename
263
+ )
264
  );
265
 
 
 
266
  // same block size in wp-includes/class-http.php
267
+ while ( $data = gzread( $gz, 4096 ) )
268
  fwrite( $fp, $data, strlen( $data ) );
269
+
270
+ gzclose( $gz );
271
+ fclose ( $fp );
272
  }
273
 
274
  elseif ( 'zip' === $args && class_exists( 'ZipArchive' ) ) {
275
  // https://codex.wordpress.org/Function_Reference/unzip_file
276
  WP_Filesystem();
277
+ $ret = unzip_file( $src, dirname( $filename ) ); // @since 2.5
 
278
 
279
  if ( is_wp_error( $ret ) )
280
  throw new Exception(
281
  $ret->get_error_code() . ' ' . $ret->get_error_message()
282
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  }
284
 
285
+ @unlink( $src );
 
 
 
 
 
 
 
 
286
  }
287
 
288
  // error handler
289
  catch ( Exception $e ) {
290
+ if ( 'gz' === $args && function_exists( 'gzopen' ) ) {
291
+ ! empty( $gz ) and gzclose( $gz );
292
+ ! empty( $fp ) and fclose ( $fp );
 
293
  }
294
 
295
+ ! is_wp_error( $src ) and @unlink( $src );
 
 
296
 
297
  return array(
298
  'code' => $e->getCode(),
classes/class-ip-geo-block-load.php CHANGED
@@ -125,25 +125,11 @@ class IP_Geo_Block_Loader {
125
  */
126
  public function run() {
127
 
128
- /**
129
- * This part will be executed after loading this plugin.
130
- * Register all the rest of the action and filter hooks.
131
- */
132
- if ( IP_Geo_Block_Util::may_be_logged_in() ) {
133
- foreach ( $this->filters as $hook ) {
134
- add_filter( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );
135
- }
136
-
137
- foreach ( $this->actions as $hook ) {
138
- add_action( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );
139
- }
140
- }
141
-
142
  /**
143
  * This part will be executed at the very beginning of WordPress core.
144
  * Execute callbacks that are specified by the component with 'init'.
145
  */
146
- else {
147
  foreach ( $this->actions as $index => $hook ) {
148
  if ( in_array( $hook['hook'], array( 'init', 'wp_loaded' ) ) ) {
149
  // Execute callback directly
@@ -155,6 +141,20 @@ class IP_Geo_Block_Loader {
155
  }
156
  }
157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
 
160
  }
125
  */
126
  public function run() {
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  /**
129
  * This part will be executed at the very beginning of WordPress core.
130
  * Execute callbacks that are specified by the component with 'init'.
131
  */
132
+ if ( ! IP_Geo_Block_Util::may_be_logged_in() ) {
133
  foreach ( $this->actions as $index => $hook ) {
134
  if ( in_array( $hook['hook'], array( 'init', 'wp_loaded' ) ) ) {
135
  // Execute callback directly
141
  }
142
  }
143
 
144
+ /**
145
+ * This part will be executed after loading this plugin.
146
+ * Register all the rest of the action and filter hooks.
147
+ */
148
+ else {
149
+ foreach ( $this->filters as $hook ) {
150
+ add_filter( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );
151
+ }
152
+
153
+ foreach ( $this->actions as $hook ) {
154
+ add_action( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );
155
+ }
156
+ }
157
+
158
  }
159
 
160
  }
classes/class-ip-geo-block-logs.php CHANGED
@@ -29,6 +29,8 @@ class IP_Geo_Block_Logs {
29
  'daystats' => array(),
30
  );
31
 
 
 
32
  /**
33
  * Create
34
  *
@@ -59,10 +61,10 @@ class IP_Geo_Block_Logs {
59
  `user_agent` varchar(" . IP_GEO_BLOCK_MAX_STR_LEN . ") NULL,
60
  `headers` varchar(" . IP_GEO_BLOCK_MAX_TXT_LEN . ") NULL,
61
  `data` text NULL,
62
- PRIMARY KEY (`No`),
63
  KEY `time` (`time`),
64
  KEY `hook` (`hook`)
65
- ) CHARACTER SET $charset"
66
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
67
 
68
  // for statistics
@@ -70,8 +72,8 @@ class IP_Geo_Block_Logs {
70
  $result &= ( FALSE !== $wpdb->query( "CREATE TABLE IF NOT EXISTS `$table` (
71
  `No` tinyint(4) unsigned NOT NULL AUTO_INCREMENT,
72
  `data` longtext NULL,
73
- PRIMARY KEY (`No`)
74
- ) CHARACTER SET $charset"
75
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
76
 
77
  // Create 1 record if not exists
@@ -92,45 +94,25 @@ class IP_Geo_Block_Logs {
92
  `fail` int(10) unsigned NOT NULL DEFAULT 0,
93
  `call` int(10) unsigned NOT NULL DEFAULT 0,
94
  `host` tinytext NOT NULL,
95
- PRIMARY KEY (`No`),
96
- UNIQUE KEY (`ip`)
97
- ) CHARACTER SET $charset"
98
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
99
 
100
  return $result;
101
  }
102
 
103
- /**
104
- * Search table by specific IP address
105
- *
106
- */
107
- private static function search_table( $table, $ip, $type = FALSE ) {
108
- global $wpdb;
109
- $table = $wpdb->prefix . $table;
110
-
111
- $sql = $wpdb->prepare(
112
- "SELECT * FROM `$table` WHERE `ip` = '%s'", $ip
113
- ) and $result = $wpdb->get_results( $sql, ARRAY_A ) or self::error( __LINE__ );
114
-
115
- if ( ! $type )
116
- return ! empty( $result[0] ) ? $result[0] : NULL; // for cache
117
- else
118
- return ! empty( $result ) ? $result : array(); // for logs
119
- }
120
-
121
  /**
122
  * Delete
123
  *
124
  */
125
- public static function delete_tables( $which = 'all' ) {
126
  global $wpdb;
127
  $tables = array( self::TABLE_LOGS, self::TABLE_STAT, IP_Geo_Block::CACHE_NAME );
128
 
129
  foreach ( $tables as $table ) {
130
- if ( 'all' === $which || $table === $which ) {
131
- $table = $wpdb->prefix . $table;
132
- $wpdb->query( "DROP TABLE IF EXISTS `$table`" ) or self::error( __LINE__ );
133
- }
134
  }
135
  }
136
 
@@ -195,27 +177,35 @@ class IP_Geo_Block_Logs {
195
  * Record statistics data.
196
  *
197
  */
198
- public static function record_stat( $stat ) {
199
  global $wpdb;
200
  $table = $wpdb->prefix . self::TABLE_STAT;
201
 
202
- if ( ! is_array( $stat ) ) {
203
- $stat = self::$default;
204
  }
205
 
206
  $sql = $wpdb->prepare(
207
- "UPDATE `$table` SET `data` = '%s'", serialize( $stat )
208
- // "REPLACE INTO `$table` (`No`, `data`) VALUES (%d, %s)", 1, serialize( $stat )
209
- ) and $wpdb->query( $sql ) or self::error( __LINE__ );
210
  }
211
 
212
  /**
213
- * Limit the number of rows to send to the user agent according the processing time [msec]
214
  *
215
  */
216
  public static function limit_rows( $time ) {
 
217
  $options = IP_Geo_Block::get_option();
218
- return (int)( $options['validation']['maxlogs'] / ((int)$time < 50 ? 1 : 2) );
 
 
 
 
 
 
 
219
  }
220
 
221
  /**
@@ -368,11 +358,10 @@ class IP_Geo_Block_Logs {
368
 
369
  // XML-RPC
370
  if ( 'xmlrpc' === $hook ) {
 
371
  $posts = self::truncate_utf8(
372
  file_get_contents( 'php://input' ), '!\s*([<>])\s*!', '$1', IP_GEO_BLOCK_MAX_STR_LEN
373
  );
374
-
375
- // mask the password
376
  if ( $mask_pwd &&
377
  preg_match_all( '/<string>(\S*?)<\/string>/', $posts, $matches ) >= 2 &&
378
  strpos( $matches[1][1], home_url() ) !== 0 ) { // except pingback
@@ -485,7 +474,7 @@ class IP_Geo_Block_Logs {
485
  $sql = $wpdb->prepare(
486
  "DELETE FROM `$table` WHERE `hook` = '%s' ORDER BY `No` ASC LIMIT %d",
487
  $hook, $count - $rows + 1
488
- ) and $wpdb->query( $sql ) or self::error( __LINE__ );
489
  }
490
 
491
  // insert into DB
@@ -503,7 +492,7 @@ class IP_Geo_Block_Logs {
503
  $agent,
504
  $heads,
505
  $posts
506
- ) and $wpdb->query( $sql ) or self::error( __LINE__ );
507
 
508
  // backup logs to text files
509
  if ( $dir = apply_filters(
@@ -526,7 +515,10 @@ class IP_Geo_Block_Logs {
526
  global $wpdb;
527
  $table = $wpdb->prefix . self::TABLE_LOGS;
528
 
529
- $sql = "SELECT `hook`, `time`, `ip`, `code`, `result`, `method`, `user_agent`, `headers`, `data` FROM `$table`";
 
 
 
530
 
531
  if ( ! $hook )
532
  $sql .= " ORDER BY `hook`, `No` DESC";
@@ -536,48 +528,40 @@ class IP_Geo_Block_Logs {
536
  return $sql ? $wpdb->get_results( $sql, ARRAY_N ) : array();
537
  }
538
 
539
- /**
540
- * Search logs by specific IP address
541
- *
542
- */
543
- public static function search_logs( $ip ) {
544
- return self::search_table( self::TABLE_LOGS, $ip, TRUE );
545
- }
546
-
547
  /**
548
  * Update statistics.
549
  *
550
  */
551
  public static function update_stat( $hook, $validate, $settings ) {
552
  // Restore statistics.
553
- if ( $stat = self::restore_stat() ) {
554
 
555
  $provider = isset( $validate['provider'] ) ? $validate['provider'] : 'ZZ';
556
- if ( empty( $stat['providers'][ $provider ] ) )
557
- $stat['providers'][ $provider ] = array( 'count' => 0, 'time' => 0.0 );
558
 
559
- $stat['providers'][ $provider ]['count']++; // undefined in auth_fail()
560
- $stat['providers'][ $provider ]['time'] += (float)@$validate['time'];
561
 
562
  if ( 'passed' !== $validate['result'] ) {
563
  // Blocked by type of IP address
564
  if ( filter_var( $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) )
565
- $stat['IPv4']++;
566
  elseif ( filter_var( $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) )
567
- $stat['IPv6']++;
568
 
569
- @$stat['blocked' ]++;
570
- @$stat['countries'][ $validate['code'] ]++;
571
- @$stat['daystats' ][ mktime( 0, 0, 0 ) ][ $hook ]++;
572
  }
573
 
574
- if ( count( $stat['daystats'] ) > max( 30, min( 365, (int)@$settings['validation']['recdays'] ) ) ) {
575
- reset( $stat['daystats'] );
576
- unset( $stat['daystats'][ key( $stat['daystats'] ) ] );
577
  }
578
 
579
  // Record statistics.
580
- self::record_stat( $stat );
581
  }
582
  }
583
 
@@ -592,11 +576,18 @@ class IP_Geo_Block_Logs {
592
  }
593
 
594
  /**
595
- * Search cache by specific IP address
596
  *
597
  */
598
  public static function search_cache( $ip ) {
599
- return self::search_table( IP_Geo_Block::CACHE_NAME, $ip );
 
 
 
 
 
 
 
600
  }
601
 
602
  /**
@@ -609,7 +600,7 @@ class IP_Geo_Block_Logs {
609
  $result = $wpdb->get_results( "SELECT * FROM `$table`", ARRAY_A ) or self::error( __LINE__ );
610
 
611
  // transform DB to cache format
612
- $cache = $hash = array();
613
  foreach ( $result as $key => $val ) {
614
  $ip = $val['ip'];
615
  unset( $val['ip'] );
@@ -653,7 +644,7 @@ class IP_Geo_Block_Logs {
653
  $cache['fail'],
654
  $cache['call'],
655
  $cache['host']
656
- ) and $wpdb->query( $sql ) or self::error( __LINE__ );
657
  }
658
 
659
  /**
@@ -677,14 +668,33 @@ class IP_Geo_Block_Logs {
677
  *
678
  */
679
  private static function error( $line ) {
680
- global $wpdb;
681
- if ( $wpdb->last_error ) {
682
- if ( class_exists( 'IP_Geo_Block_Admin' ) )
683
  IP_Geo_Block_Admin::add_admin_notice( 'error', __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
684
-
685
- if ( defined( 'IP_GEO_BLOCK_DEBUG' ) && IP_GEO_BLOCK_DEBUG )
686
- error_log( __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
687
  }
688
  }
689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  }
29
  'daystats' => array(),
30
  );
31
 
32
+ private static $sqlist = array();
33
+
34
  /**
35
  * Create
36
  *
61
  `user_agent` varchar(" . IP_GEO_BLOCK_MAX_STR_LEN . ") NULL,
62
  `headers` varchar(" . IP_GEO_BLOCK_MAX_TXT_LEN . ") NULL,
63
  `data` text NULL,
64
+ PRIMARY KEY (`No`),
65
  KEY `time` (`time`),
66
  KEY `hook` (`hook`)
67
+ ) CHARACTER SET " . $charset
68
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
69
 
70
  // for statistics
72
  $result &= ( FALSE !== $wpdb->query( "CREATE TABLE IF NOT EXISTS `$table` (
73
  `No` tinyint(4) unsigned NOT NULL AUTO_INCREMENT,
74
  `data` longtext NULL,
75
+ PRIMARY KEY (`No`)
76
+ ) CHARACTER SET " . $charset
77
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
78
 
79
  // Create 1 record if not exists
94
  `fail` int(10) unsigned NOT NULL DEFAULT 0,
95
  `call` int(10) unsigned NOT NULL DEFAULT 0,
96
  `host` tinytext NOT NULL,
97
+ PRIMARY KEY (`No`),
98
+ UNIQUE (`ip`)
99
+ ) CHARACTER SET " . $charset
100
  ) ) or self::error( __LINE__ ); // utf8mb4 ENGINE=InnoDB or MyISAM
101
 
102
  return $result;
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * Delete
107
  *
108
  */
109
+ public static function delete_tables() {
110
  global $wpdb;
111
  $tables = array( self::TABLE_LOGS, self::TABLE_STAT, IP_Geo_Block::CACHE_NAME );
112
 
113
  foreach ( $tables as $table ) {
114
+ $table = $wpdb->prefix . $table;
115
+ $wpdb->query( "DROP TABLE IF EXISTS `$table`" ) or self::error( __LINE__ );
 
 
116
  }
117
  }
118
 
177
  * Record statistics data.
178
  *
179
  */
180
+ public static function record_stat( $statistics ) {
181
  global $wpdb;
182
  $table = $wpdb->prefix . self::TABLE_STAT;
183
 
184
+ if ( ! is_array( $statistics ) ) {
185
+ $statistics = self::$default;
186
  }
187
 
188
  $sql = $wpdb->prepare(
189
+ "UPDATE `$table` SET `data` = '%s'", serialize( $statistics )
190
+ // "REPLACE INTO `$table` (`No`, `data`) VALUES (%d, %s)", 1, serialize( $statistics )
191
+ ) and self::add_sql( 'stat', $sql ); // $data = $wpdb->query( $sql ) or self::error( __LINE__ );
192
  }
193
 
194
  /**
195
+ * Limit the number of rows to send to the user agent
196
  *
197
  */
198
  public static function limit_rows( $time ) {
199
+ $time = intval( $time );
200
  $options = IP_Geo_Block::get_option();
201
+
202
+ if ( $time < 90 /* msec */ )
203
+ return (int)$options['validation']['maxlogs'];
204
+
205
+ elseif ( $time < 200 /* msec */ )
206
+ return (int)($options['validation']['maxlogs'] / 2);
207
+
208
+ return (int)($options['validation']['maxlogs'] / 5);
209
  }
210
 
211
  /**
358
 
359
  // XML-RPC
360
  if ( 'xmlrpc' === $hook ) {
361
+ // mask the password
362
  $posts = self::truncate_utf8(
363
  file_get_contents( 'php://input' ), '!\s*([<>])\s*!', '$1', IP_GEO_BLOCK_MAX_STR_LEN
364
  );
 
 
365
  if ( $mask_pwd &&
366
  preg_match_all( '/<string>(\S*?)<\/string>/', $posts, $matches ) >= 2 &&
367
  strpos( $matches[1][1], home_url() ) !== 0 ) { // except pingback
474
  $sql = $wpdb->prepare(
475
  "DELETE FROM `$table` WHERE `hook` = '%s' ORDER BY `No` ASC LIMIT %d",
476
  $hook, $count - $rows + 1
477
+ ) and self::add_sql( 'logs', $sql ); // $wpdb->query( $sql ) or self::error( __LINE__ );
478
  }
479
 
480
  // insert into DB
492
  $agent,
493
  $heads,
494
  $posts
495
+ ) and self::add_sql( 'logs', $sql ); // $wpdb->query( $sql ) or self::error( __LINE__ );
496
 
497
  // backup logs to text files
498
  if ( $dir = apply_filters(
515
  global $wpdb;
516
  $table = $wpdb->prefix . self::TABLE_LOGS;
517
 
518
+ $sql = ( "SELECT
519
+ `hook`, `time`, `ip`, `code`, `result`, `method`, `user_agent`, `headers`, `data`
520
+ FROM `$table`"
521
+ );
522
 
523
  if ( ! $hook )
524
  $sql .= " ORDER BY `hook`, `No` DESC";
528
  return $sql ? $wpdb->get_results( $sql, ARRAY_N ) : array();
529
  }
530
 
 
 
 
 
 
 
 
 
531
  /**
532
  * Update statistics.
533
  *
534
  */
535
  public static function update_stat( $hook, $validate, $settings ) {
536
  // Restore statistics.
537
+ if ( $statistics = self::restore_stat() ) {
538
 
539
  $provider = isset( $validate['provider'] ) ? $validate['provider'] : 'ZZ';
540
+ if ( empty( $statistics['providers'][ $provider ] ) )
541
+ $statistics['providers'][ $provider ] = array( 'count' => 0, 'time' => 0.0 );
542
 
543
+ $statistics['providers'][ $provider ]['count']++; // undefined in auth_fail()
544
+ $statistics['providers'][ $provider ]['time'] += (float)@$validate['time'];
545
 
546
  if ( 'passed' !== $validate['result'] ) {
547
  // Blocked by type of IP address
548
  if ( filter_var( $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) )
549
+ $statistics['IPv4']++;
550
  elseif ( filter_var( $validate['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6 ) )
551
+ $statistics['IPv6']++;
552
 
553
+ @$statistics['blocked' ]++;
554
+ @$statistics['countries'][ $validate['code'] ]++;
555
+ @$statistics['daystats' ][ mktime( 0, 0, 0 ) ][ $hook ]++;
556
  }
557
 
558
+ if ( count( $statistics['daystats'] ) > max( 30, min( 365, (int)@$settings['validation']['recdays'] ) ) ) {
559
+ reset( $statistics['daystats'] );
560
+ unset( $statistics['daystats'][ key( $statistics['daystats'] ) ] );
561
  }
562
 
563
  // Record statistics.
564
+ self::record_stat( $statistics );
565
  }
566
  }
567
 
576
  }
577
 
578
  /**
579
+ * Search cache
580
  *
581
  */
582
  public static function search_cache( $ip ) {
583
+ global $wpdb;
584
+ $table = $wpdb->prefix . IP_Geo_Block::CACHE_NAME;
585
+
586
+ $sql = $wpdb->prepare(
587
+ "SELECT * FROM `$table` WHERE `ip` = '%s'", $ip
588
+ ) and $result = $wpdb->get_results( $sql, ARRAY_A ) or self::error( __LINE__ );
589
+
590
+ return ! empty( $result[0] ) ? $result[0] : NULL;
591
  }
592
 
593
  /**
600
  $result = $wpdb->get_results( "SELECT * FROM `$table`", ARRAY_A ) or self::error( __LINE__ );
601
 
602
  // transform DB to cache format
603
+ $cache = array();
604
  foreach ( $result as $key => $val ) {
605
  $ip = $val['ip'];
606
  unset( $val['ip'] );
644
  $cache['fail'],
645
  $cache['call'],
646
  $cache['host']
647
+ ) and self::add_sql( 'cache', $sql ); // $wpdb->query( $sql ) or self::error( __LINE__ );
648
  }
649
 
650
  /**
668
  *
669
  */
670
  private static function error( $line ) {
671
+ if ( class_exists( 'IP_Geo_Block_Admin' ) ) {
672
+ global $wpdb;
673
+ if ( $wpdb->last_error )
674
  IP_Geo_Block_Admin::add_admin_notice( 'error', __FILE__ . ' (' . $line . ') ' . $wpdb->last_error );
 
 
 
675
  }
676
  }
677
 
678
+ /**
679
+ * Stock SQL command for deferred execution.
680
+ *
681
+ */
682
+ private static function add_sql( $hook, $sql ) {
683
+ // global $wpdb; $wpdb->query( $sql ) or self::error( $hook );
684
+ self::$sqlist[ $hook ][] = $sql;
685
+ }
686
+
687
+ /**
688
+ * Deferred execution of SQL command at shutdown process.
689
+ *
690
+ */
691
+ public static function exec_sql() {
692
+ global $wpdb;
693
+
694
+ foreach ( self::$sqlist as $key => $val ) {
695
+ foreach ( $val as $sql ) {
696
+ $wpdb->query( $sql ) or self::error( $key );
697
+ }
698
+ }
699
+ }
700
  }
classes/class-ip-geo-block-opts.php CHANGED
@@ -38,7 +38,7 @@ class IP_Geo_Block_Opts {
38
  // since version 1.2, 1.3
39
  'login_fails' => 5, // Limited number of login attempts
40
  'validation' => array( // Action hook for validation
41
- 'comment' => FALSE, // Validate on comment post
42
  'login' => 1, // Validate on login
43
  'admin' => 1, // Validate on admin (1:country 2:ZEP)
44
  'ajax' => 0, // Validate on ajax/post (1:country 2:ZEP)
@@ -278,15 +278,12 @@ class IP_Geo_Block_Opts {
278
  $settings['exception']['admin'] = $default['exception']['admin'];
279
  }
280
 
281
- if ( version_compare( $version, '3.0.1' ) < 0 )
282
- delete_transient( IP_Geo_Block::CACHE_NAME ); // @since 2.8
283
-
284
  // save package version number
285
  $settings['version'] = IP_Geo_Block::VERSION;
286
  }
287
 
288
- // install addons for IP Geolocation database API @since 1.1.6
289
- if ( ! $settings['api_dir'] || version_compare( $version, '3.0.1' ) < 0 )
290
  $settings['api_dir'] = self::install_api( $settings );
291
 
292
  // update option table
38
  // since version 1.2, 1.3
39
  'login_fails' => 5, // Limited number of login attempts
40
  'validation' => array( // Action hook for validation
41
+ 'comment' => TRUE, // Validate on comment post
42
  'login' => 1, // Validate on login
43
  'admin' => 1, // Validate on admin (1:country 2:ZEP)
44
  'ajax' => 0, // Validate on ajax/post (1:country 2:ZEP)
278
  $settings['exception']['admin'] = $default['exception']['admin'];
279
  }
280
 
 
 
 
281
  // save package version number
282
  $settings['version'] = IP_Geo_Block::VERSION;
283
  }
284
 
285
+ // install addons for IP Geolocation database API
286
+ if ( ! $settings['api_dir'] || version_compare( $version, '2.2.9' ) < 0 )
287
  $settings['api_dir'] = self::install_api( $settings );
288
 
289
  // update option table
classes/class-ip-geo-block-util.php CHANGED
@@ -104,11 +104,13 @@ class IP_Geo_Block_Util {
104
  *
105
  */
106
  public static function rebuild_nonce( $location, $status = 302 ) {
107
- // check if the location is internal
108
- $host = parse_url( $location, PHP_URL_HOST );
109
- if ( ! $host || $host === parse_url( home_url(), PHP_URL_HOST ) ) {
110
- // it doesn't care about valid nonce or invalid nonce (must be sanitized)
111
- if ( $nonce = self::retrieve_nonce( $key = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce' ) ) {
 
 
112
  $location = esc_url_raw( add_query_arg(
113
  array(
114
  $key => false, // delete onece
@@ -129,7 +131,7 @@ class IP_Geo_Block_Util {
129
  * @source wp-includes/pluggable.php
130
  */
131
  public static function create_nonce( $action = -1 ) {
132
- $uid = self::get_current_user_id();
133
  $tok = self::get_session_token();
134
  $exp = self::nonce_tick();
135
 
@@ -143,7 +145,7 @@ class IP_Geo_Block_Util {
143
  * @source wp-includes/pluggable.php
144
  */
145
  public static function verify_nonce( $nonce, $action = -1 ) {
146
- $uid = self::get_current_user_id();
147
  $tok = self::get_session_token();
148
  $exp = self::nonce_tick();
149
 
@@ -182,7 +184,7 @@ class IP_Geo_Block_Util {
182
  private static function get_session_token() {
183
  // Arrogating logged_in cookie never cause the privilege escalation.
184
  $cookie = self::parse_auth_cookie( 'logged_in' );
185
- return ! empty( $cookie['token'] ) ? $cookie['token'] : AUTH_KEY . AUTH_SALT;
186
  }
187
 
188
  /**
@@ -223,7 +225,6 @@ class IP_Geo_Block_Util {
223
  *
224
  * Timing attack safe string comparison.
225
  * @source http://php.net/manual/en/function.hash-equals.php#115635
226
- * @see http://php.net/manual/en/language.operators.increment.php
227
  * @see wp-includes/compat.php
228
  */
229
  private static function hash_equals( $a, $b ) {
@@ -237,9 +238,8 @@ class IP_Geo_Block_Util {
237
  $exp = $a ^ $b; // length of both $a and $b are same
238
  $ret = 0;
239
 
240
- while ( --$i >= 0 ) {
241
  $ret |= ord( $exp[ $i ] );
242
- }
243
 
244
  return ! $ret;
245
  }
@@ -335,22 +335,6 @@ class IP_Geo_Block_Util {
335
  }
336
  }
337
 
338
- /**
339
- * WP alternative function of wp_redirect() for mu-plugins
340
- *
341
- * Performs a safe (local) redirect, using redirect().
342
- * @source wp-includes/pluggable.php
343
- */
344
- public static function safe_redirect( $location, $status = 302 ) {
345
- // Need to look at the URL the way it will end up in wp_redirect()
346
- $location = self::sanitize_redirect( $location );
347
-
348
- // Filters the redirect fallback URL for when the provided redirect is not safe (local).
349
- $location = self::validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
350
-
351
- self::redirect( $location, $status );
352
- }
353
-
354
  /**
355
  * WP alternative function of wp_validate_redirect() for mu-plugins
356
  *
@@ -390,7 +374,6 @@ class IP_Geo_Block_Util {
390
 
391
  // Filters the whitelist of hosts to redirect to.
392
  $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
393
- $allowed_hosts[] = 'blackhole.webpagetest.org';
394
 
395
  if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts ) && $lp['host'] != strtolower( $wpp['host'] ) ) )
396
  $location = $default;
@@ -442,29 +425,9 @@ class IP_Geo_Block_Util {
442
  return did_action( 'init' ) ? is_user_logged_in() : ( self::parse_auth_cookie( 'logged_in' ) ? TRUE : FALSE );
443
  }
444
 
445
- /**
446
- * WP alternative function of get_current_user_id() for mu-plugins
447
- *
448
- * Get the current user's ID.
449
- * @source wp-includes/user.php
450
- */
451
- public static function get_current_user_id() {
452
- static $uid = 0;
453
-
454
- if ( ! $uid ) {
455
- $uid = did_action( 'init' ) ? get_current_user_id() : 0;
456
-
457
- if ( ! $uid && isset( $_COOKIE ) ) {
458
- foreach ( array_keys( $_COOKIE ) as $key ) {
459
- if ( 0 === strpos( $key, 'wp-settings-' ) ) {
460
- $uid = substr( $key, strrpos( $key, '-' ) + 1 ); // get numerical characters
461
- break;
462
- }
463
- }
464
- }
465
- }
466
-
467
- return $uid;
468
  }
469
 
470
  /**
104
  *
105
  */
106
  public static function rebuild_nonce( $location, $status = 302 ) {
107
+ $key = IP_Geo_Block::PLUGIN_NAME . '-auth-nonce';
108
+
109
+ if ( $nonce = self::retrieve_nonce( $key ) ) { // must be sanitized
110
+ $host = parse_url( $location, PHP_URL_HOST );
111
+
112
+ // check if the location is internal
113
+ if ( ! $host || $host === parse_url( home_url(), PHP_URL_HOST ) ) {
114
  $location = esc_url_raw( add_query_arg(
115
  array(
116
  $key => false, // delete onece
131
  * @source wp-includes/pluggable.php
132
  */
133
  public static function create_nonce( $action = -1 ) {
134
+ $uid = self::get_current_user_id( FALSE );
135
  $tok = self::get_session_token();
136
  $exp = self::nonce_tick();
137
 
145
  * @source wp-includes/pluggable.php
146
  */
147
  public static function verify_nonce( $nonce, $action = -1 ) {
148
+ $uid = self::get_current_user_id( FALSE );
149
  $tok = self::get_session_token();
150
  $exp = self::nonce_tick();
151
 
184
  private static function get_session_token() {
185
  // Arrogating logged_in cookie never cause the privilege escalation.
186
  $cookie = self::parse_auth_cookie( 'logged_in' );
187
+ return ! empty( $cookie['token'] ) ? $cookie['token'] : '';
188
  }
189
 
190
  /**
225
  *
226
  * Timing attack safe string comparison.
227
  * @source http://php.net/manual/en/function.hash-equals.php#115635
 
228
  * @see wp-includes/compat.php
229
  */
230
  private static function hash_equals( $a, $b ) {
238
  $exp = $a ^ $b; // length of both $a and $b are same
239
  $ret = 0;
240
 
241
+ for ( $i -= 1; $i >= 0; $i-- )
242
  $ret |= ord( $exp[ $i ] );
 
243
 
244
  return ! $ret;
245
  }
335
  }
336
  }
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  /**
339
  * WP alternative function of wp_validate_redirect() for mu-plugins
340
  *
374
 
375
  // Filters the whitelist of hosts to redirect to.
376
  $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' );
 
377
 
378
  if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts ) && $lp['host'] != strtolower( $wpp['host'] ) ) )
379
  $location = $default;
425
  return did_action( 'init' ) ? is_user_logged_in() : ( self::parse_auth_cookie( 'logged_in' ) ? TRUE : FALSE );
426
  }
427
 
428
+ public static function get_current_user_id( $strict = TRUE ) {
429
+ // unavailale before 'init' hook.
430
+ return did_action( 'init' ) ? get_current_user_id() : ( $strict ? 0 : md5( $_SERVER['REMOTE_ADDR'], FALSE ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
  }
432
 
433
  /**
classes/class-ip-geo-block.php CHANGED
@@ -15,7 +15,7 @@ class IP_Geo_Block {
15
  * Unique identifier for this plugin.
16
  *
17
  */
18
- const VERSION = '3.0.1.2';
19
  const GEOAPI_NAME = 'ip-geo-api';
20
  const PLUGIN_NAME = 'ip-geo-block';
21
  const OPTION_NAME = 'ip_geo_block_settings';
@@ -30,6 +30,7 @@ class IP_Geo_Block {
30
 
31
  // Globals in this class
32
  public static $wp_path;
 
33
  private $pagenow = NULL;
34
  private $request_uri = NULL;
35
  private $target_type = NULL;
@@ -64,6 +65,7 @@ class IP_Geo_Block {
64
  $key = preg_replace( array( '!\.+/!', '!//+!' ), '/', $_SERVER['REQUEST_URI'] );
65
  $this->request_uri = @parse_url( $key, PHP_URL_PATH ) or $this->request_uri = $key;
66
  $this->pagenow = ! empty( $GLOBALS['pagenow'] ) ? $GLOBALS['pagenow'] : basename( $_SERVER['SCRIPT_NAME'] );
 
67
 
68
  // setup the content folders
69
  self::$wp_path = array( 'home' => IP_Geo_Block_Util::unslashit( parse_url( site_url(), PHP_URL_PATH ) ) ); // @since 2.6.0
@@ -104,12 +106,6 @@ class IP_Geo_Block {
104
  $loader->add_action( 'init', array( $this, 'validate_' . $list[ $this->pagenow ] ), $priority );
105
  }
106
 
107
- // alternative of trackback
108
- elseif ( 'POST' === $_SERVER['REQUEST_METHOD'] && 'trackback' === basename( $this->request_uri ) ) {
109
- if ( $validate['comment'] )
110
- $loader->add_action( 'init', array( $this, 'validate_comment' ), $priority );
111
- }
112
-
113
  else {
114
  // public facing pages
115
  if ( $validate['public'] /* && 'index.php' === $this->pagenow */ )
@@ -122,10 +118,6 @@ class IP_Geo_Block {
122
  }
123
 
124
  if ( $validate['comment'] ) {
125
- add_action( 'pre_comment_on_post', array( $this, 'validate_comment' ), $priority ); // wp-comments-post.php @since 2.8.0
126
- add_action( 'pre_trackback_post', array( $this, 'validate_comment' ), $priority ); // wp-trackback.php @since 4.7.0
127
- add_filter( 'preprocess_comment', array( $this, 'validate_comment' ), $priority ); // wp-includes/comment.php @since 1.5.0
128
-
129
  // bbPress: prevent creating topic/relpy and rendering form
130
  add_action( 'bbp_post_request_bbp-new-topic', array( $this, 'validate_comment' ), $priority );
131
  add_action( 'bbp_post_request_bbp-new-reply', array( $this, 'validate_comment' ), $priority );
@@ -206,7 +198,8 @@ class IP_Geo_Block {
206
  *
207
  */
208
  public function logout_redirect( $uri ) {
209
- if ( isset( $_REQUEST['action'] ) && 'logout' === $_REQUEST['action'] && FALSE !== stripos( $uri, self::$wp_path['admin'] ) )
 
210
  return esc_url_raw( add_query_arg( array( 'loggedout' => 'true' ), wp_login_url() ) );
211
  else
212
  return $uri;
@@ -322,7 +315,7 @@ class IP_Geo_Block {
322
  *
323
  */
324
  public function send_response( $hook, $settings ) {
325
- require_once ABSPATH . WPINC . '/functions.php'; // for get_status_header_desc() @since 2.3.0
326
 
327
  // prevent caching (WP Super Cache, W3TC, Wordfence, Comet Cache)
328
  if ( ! defined( 'DONOTCACHEPAGE' ) )
@@ -333,19 +326,19 @@ class IP_Geo_Block {
333
 
334
  nocache_headers(); // Set the headers to prevent caching for the different browsers.
335
 
336
- if ( defined( 'XMLRPC_REQUEST' ) && 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
337
  status_header( 405 );
338
  header( 'Content-Type: text/plain' );
339
  die( 'XML-RPC server accepts POST requests only.' );
340
  }
341
 
342
- switch ( (int)substr( (string)$code, 0, 1 ) ) {
343
  case 2: // 2xx Success (HTTP header injection should be avoided)
344
  header( 'Refresh: 0; url=' . esc_url_raw( $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ), TRUE, $code ); // @since 2.8
345
  exit;
346
 
347
  case 3: // 3xx Redirection (HTTP header injection should be avoided)
348
- IP_Geo_Block_Util::safe_redirect( esc_url_raw( $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ), $code ); // @since 2.8
349
  exit;
350
 
351
  default: // 4xx Client Error, 5xx Server Error
@@ -363,7 +356,7 @@ class IP_Geo_Block {
363
  FALSE !== ( @include get_stylesheet_directory() .'/'.$code.'.php' ) or // child theme
364
  FALSE !== ( @include get_template_directory() .'/'.$code.'.php' ) or // parent theme
365
  wp_die( // get_dashboard_url() @since 3.1.0
366
- IP_Geo_Block_Util::kses( $mesg ) . ( $hook ? "\n<p><a rel='nofollow' href='" . esc_url( get_dashboard_url() ) . "'>&laquo; " . __( 'Dashboard' ) . "</a></p>" : '' ),
367
  '', array( 'response' => $code, 'back_link' => ! $hook )
368
  );
369
  }
@@ -395,8 +388,8 @@ class IP_Geo_Block {
395
 
396
  // register auxiliary validation functions
397
  $var = self::PLUGIN_NAME . '-' . $hook;
398
- add_filter( $var, array( $this, 'check_fail' ), 9, 2 );
399
- $auth and add_filter( $var, array( $this, 'check_auth' ), 8, 2 );
400
  $settings['extra_ips'] = apply_filters( self::PLUGIN_NAME . '-extra-ips', $settings['extra_ips'], $hook );
401
  $settings['extra_ips']['white_list'] and add_filter( $var, array( $this, 'check_ips_white' ), 7, 2 );
402
  $settings['extra_ips']['black_list'] and add_filter( $var, array( $this, 'check_ips_black' ), 7, 2 );
@@ -456,12 +449,8 @@ class IP_Geo_Block {
456
  * Validate on comment.
457
  *
458
  */
459
- public function validate_comment( $comment = NULL ) {
460
- // check comment type if it comes form wp-includes/wp_new_comment()
461
- if ( ! is_array( $comment ) || in_array( $comment['comment_type'], array( 'trackback', 'pingback' ), TRUE ) )
462
- $this->validate_ip( 'comment', self::get_option() );
463
-
464
- return $comment;
465
  }
466
 
467
  public function validate_front( $can_access = TRUE ) {
@@ -547,12 +536,10 @@ class IP_Geo_Block {
547
  }
548
 
549
  // list of request for specific action or page to bypass WP-ZEP
550
- $list = array_merge(
551
- apply_filters( self::PLUGIN_NAME . '-bypass-admins', $settings['exception']['admin'] ),
552
- array( 'save-widget', 'wordfence_testAjax', 'wordfence_doScan', 'wp-compression-test', // wp-admin/includes/template.php
553
- 'upload-attachment', 'imgedit-preview', 'bp_avatar_upload', 'GOTMLS_logintime', // pluploader won't fire an event in "Media Library"
554
- 'jetpack', 'authorize', 'jetpack_modules', 'atd_settings', 'bulk-activate', 'bulk-deactivate', // jetpack page & action
555
- )
556
  );
557
 
558
  $in_action = in_array( $action, $list, TRUE );
@@ -627,27 +614,24 @@ class IP_Geo_Block {
627
  'provider' => 'Cache',
628
  ) );
629
 
630
- $settings = self::get_option();
631
-
632
- if ( $cache['fail'] > max( 0, (int)$settings['login_fails'] ) )
633
- $validate['result'] = 'limited';
634
-
635
  // validate xmlrpc system.multicall
636
- elseif ( defined( 'XMLRPC_REQUEST' ) && FALSE !== stripos( file_get_contents( 'php://input' ), 'system.multicall' ) )
637
  $validate['result'] = 'multi';
638
 
639
- $cache = IP_Geo_Block_API_Cache::update_cache( 'login', $validate, $settings ); // count up 'fail'
 
 
640
 
641
  // (1) blocked, (3) unauthenticated, (5) all
642
  if ( 1 & (int)$settings['validation']['reclogs'] )
643
- IP_Geo_Block_Logs::record_logs( 'login', $validate, $settings );
644
 
645
  // send response code to refuse immediately
646
- if ( 'failed' !== $validate['result'] ) {
647
  if ( $settings['save_statistics'] )
648
- IP_Geo_Block_Logs::update_stat( 'login', $validate, $settings );
649
 
650
- $this->send_response( 'login', $settings );
651
  }
652
  }
653
 
@@ -655,9 +639,15 @@ class IP_Geo_Block {
655
  }
656
 
657
  public function check_fail( $validate, $settings ) {
658
- // check if number of fails reaches the limit. can't overwrite existing result.
659
  $cache = IP_Geo_Block_API_Cache::get_cache( $validate['ip'] );
660
- return $cache && $cache['fail'] >= max( 0, (int)$settings['login_fails'] ) ? $validate + array( 'result' => 'limited' ) : $validate;
 
 
 
 
 
 
 
661
  }
662
 
663
  public function check_auth( $validate, $settings ) {
@@ -666,24 +656,34 @@ class IP_Geo_Block {
666
  }
667
 
668
  public function check_nonce( $validate, $settings ) {
669
- // should be passed when nonce is valid. can't overwrite existing result
670
- $nonce = IP_Geo_Block_Util::retrieve_nonce( $action = self::PLUGIN_NAME . '-auth-nonce' );
671
- return $validate + array( 'result' => IP_Geo_Block_Util::verify_nonce( $nonce, $action ) ? 'passed' : 'wp-zep' );
 
 
 
 
 
 
 
672
  }
673
 
674
  public function check_signature( $validate, $settings ) {
675
  $score = 0.0;
676
- $query = strtolower( urldecode( serialize( array_values( $_GET + $_POST ) ) ) );
677
 
678
  foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $settings['signature'] ) as $sig ) {
679
  $val = explode( ':', $sig, 2 );
680
 
681
- if ( ( $sig = trim( $val[0] ) ) && FALSE !== strpos( $query, $sig ) ) {
682
  if ( ( $score += ( empty( $val[1] ) ? 1.0 : (float)$val[1] ) ) > 0.99 )
683
  return $validate + array( 'result' => 'badsig' ); // can't overwrite existing result
684
  }
685
  }
686
 
 
 
 
 
687
  return $validate;
688
  }
689
 
15
  * Unique identifier for this plugin.
16
  *
17
  */
18
+ const VERSION = '3.0.0';
19
  const GEOAPI_NAME = 'ip-geo-api';
20
  const PLUGIN_NAME = 'ip-geo-block';
21
  const OPTION_NAME = 'ip_geo_block_settings';
30
 
31
  // Globals in this class
32
  public static $wp_path;
33
+ private $query = '';
34
  private $pagenow = NULL;
35
  private $request_uri = NULL;
36
  private $target_type = NULL;
65
  $key = preg_replace( array( '!\.+/!', '!//+!' ), '/', $_SERVER['REQUEST_URI'] );
66
  $this->request_uri = @parse_url( $key, PHP_URL_PATH ) or $this->request_uri = $key;
67
  $this->pagenow = ! empty( $GLOBALS['pagenow'] ) ? $GLOBALS['pagenow'] : basename( $_SERVER['SCRIPT_NAME'] );
68
+ $this->query = strtolower( urldecode( serialize( array_values( $_GET + $_POST ) ) ) );
69
 
70
  // setup the content folders
71
  self::$wp_path = array( 'home' => IP_Geo_Block_Util::unslashit( parse_url( site_url(), PHP_URL_PATH ) ) ); // @since 2.6.0
106
  $loader->add_action( 'init', array( $this, 'validate_' . $list[ $this->pagenow ] ), $priority );
107
  }
108
 
 
 
 
 
 
 
109
  else {
110
  // public facing pages
111
  if ( $validate['public'] /* && 'index.php' === $this->pagenow */ )
118
  }
119
 
120
  if ( $validate['comment'] ) {
 
 
 
 
121
  // bbPress: prevent creating topic/relpy and rendering form
122
  add_action( 'bbp_post_request_bbp-new-topic', array( $this, 'validate_comment' ), $priority );
123
  add_action( 'bbp_post_request_bbp-new-reply', array( $this, 'validate_comment' ), $priority );
198
  *
199
  */
200
  public function logout_redirect( $uri ) {
201
+ if ( FALSE !== stripos( $uri, self::$wp_path['admin'] ) &&
202
+ isset( $_REQUEST['action'] ) && 'logout' === $_REQUEST['action'] )
203
  return esc_url_raw( add_query_arg( array( 'loggedout' => 'true' ), wp_login_url() ) );
204
  else
205
  return $uri;
315
  *
316
  */
317
  public function send_response( $hook, $settings ) {
318
+ require_once ABSPATH . WPINC . '/functions.php';
319
 
320
  // prevent caching (WP Super Cache, W3TC, Wordfence, Comet Cache)
321
  if ( ! defined( 'DONOTCACHEPAGE' ) )
326
 
327
  nocache_headers(); // Set the headers to prevent caching for the different browsers.
328
 
329
+ if ( defined( 'XMLRPC_REQUEST' ) && isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
330
  status_header( 405 );
331
  header( 'Content-Type: text/plain' );
332
  die( 'XML-RPC server accepts POST requests only.' );
333
  }
334
 
335
+ switch ( (int)substr( $code, 0, 1 ) ) {
336
  case 2: // 2xx Success (HTTP header injection should be avoided)
337
  header( 'Refresh: 0; url=' . esc_url_raw( $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ), TRUE, $code ); // @since 2.8
338
  exit;
339
 
340
  case 3: // 3xx Redirection (HTTP header injection should be avoided)
341
+ IP_Geo_Block_Util::redirect( esc_url_raw( $settings['redirect_uri'] ? $settings['redirect_uri'] : home_url( '/' ) ), $code ); // @since 2.8
342
  exit;
343
 
344
  default: // 4xx Client Error, 5xx Server Error
356
  FALSE !== ( @include get_stylesheet_directory() .'/'.$code.'.php' ) or // child theme
357
  FALSE !== ( @include get_template_directory() .'/'.$code.'.php' ) or // parent theme
358
  wp_die( // get_dashboard_url() @since 3.1.0
359
+ IP_Geo_Block_Util::kses( $mesg ) . ( $hook ? "\n<p><a href='" . esc_url( get_dashboard_url() ) . "'>&laquo; " . __( 'Dashboard' ) . "</a></p>" : '' ),
360
  '', array( 'response' => $code, 'back_link' => ! $hook )
361
  );
362
  }
388
 
389
  // register auxiliary validation functions
390
  $var = self::PLUGIN_NAME . '-' . $hook;
391
+ $auth and add_filter( $var, array( $this, 'check_auth' ), 9, 2 );
392
+ $auth and add_filter( $var, array( $this, 'check_fail' ), 8, 2 );
393
  $settings['extra_ips'] = apply_filters( self::PLUGIN_NAME . '-extra-ips', $settings['extra_ips'], $hook );
394
  $settings['extra_ips']['white_list'] and add_filter( $var, array( $this, 'check_ips_white' ), 7, 2 );
395
  $settings['extra_ips']['black_list'] and add_filter( $var, array( $this, 'check_ips_black' ), 7, 2 );
449
  * Validate on comment.
450
  *
451
  */
452
+ public function validate_comment() {
453
+ $this->validate_ip( 'comment', self::get_option() );
 
 
 
 
454
  }
455
 
456
  public function validate_front( $can_access = TRUE ) {
536
  }
537
 
538
  // list of request for specific action or page to bypass WP-ZEP
539
+ $list = apply_filters( self::PLUGIN_NAME . '-bypass-admins', $settings['exception']['admin'] ) + array(
540
+ 'save-widget', 'wordfence_testAjax', 'wordfence_doScan', 'wp-compression-test', // wp-admin/includes/template.php
541
+ 'upload-attachment', 'imgedit-preview', 'bp_avatar_upload', // pluploader won't fire an event in "Media Library"
542
+ 'jetpack', 'authorize', 'jetpack_modules', 'atd_settings', 'bulk-activate', 'bulk-deactivate', // jetpack page & action
 
 
543
  );
544
 
545
  $in_action = in_array( $action, $list, TRUE );
614
  'provider' => 'Cache',
615
  ) );
616
 
 
 
 
 
 
617
  // validate xmlrpc system.multicall
618
+ if ( defined( 'XMLRPC_REQUEST' ) && FALSE !== stripos( file_get_contents( 'php://input' ), 'system.multicall' ) )
619
  $validate['result'] = 'multi';
620
 
621
+ $settings = self::get_option();
622
+ $cache = IP_Geo_Block_API_Cache::update_cache( $cache['hook'], $validate, $settings ); // count up 'fail'
623
+ $block = $cache['fail'] > max( 0, (int)$settings['login_fails'] ) || 'multi' === $validate['result'];
624
 
625
  // (1) blocked, (3) unauthenticated, (5) all
626
  if ( 1 & (int)$settings['validation']['reclogs'] )
627
+ IP_Geo_Block_Logs::record_logs( $cache['hook'], $validate, $settings, $block );
628
 
629
  // send response code to refuse immediately
630
+ if ( $block ) {
631
  if ( $settings['save_statistics'] )
632
+ IP_Geo_Block_Logs::update_stat( $cache['hook'], $validate, $settings );
633
 
634
+ $this->send_response( $cache['hook'], $settings );
635
  }
636
  }
637
 
639
  }
640
 
641
  public function check_fail( $validate, $settings ) {
 
642
  $cache = IP_Geo_Block_API_Cache::get_cache( $validate['ip'] );
643
+
644
+ // Check if number of fails reaches limit. Note this comparison needs '>='.
645
+ if ( $cache && $cache['fail'] >= max( 0, (int)$settings['login_fails'] ) ) {
646
+ if ( empty( $validate['result'] ) || 'passed' === $validate['result'] )
647
+ $validate['result'] = 'limited'; // can't overwrite existing result
648
+ }
649
+
650
+ return $validate;
651
  }
652
 
653
  public function check_auth( $validate, $settings ) {
656
  }
657
 
658
  public function check_nonce( $validate, $settings ) {
659
+ $action = self::PLUGIN_NAME . '-auth-nonce';
660
+ $nonce = IP_Geo_Block_Util::retrieve_nonce( $action );
661
+
662
+ if ( IP_Geo_Block_Util::verify_nonce( $nonce, $action ) )
663
+ $validate['result'] = 'passed'; // should be passed if nonce is ok
664
+
665
+ elseif ( empty( $validate['result'] ) || 'passed' === $validate['result'] )
666
+ $validate['result'] = 'wp-zep'; // can't overwrite existing result
667
+
668
+ return $validate;
669
  }
670
 
671
  public function check_signature( $validate, $settings ) {
672
  $score = 0.0;
 
673
 
674
  foreach ( IP_Geo_Block_Util::multiexplode( array( ",", "\n" ), $settings['signature'] ) as $sig ) {
675
  $val = explode( ':', $sig, 2 );
676
 
677
+ if ( ( $sig = trim( $val[0] ) ) && FALSE !== strpos( $this->query, $sig ) ) {
678
  if ( ( $score += ( empty( $val[1] ) ? 1.0 : (float)$val[1] ) ) > 0.99 )
679
  return $validate + array( 'result' => 'badsig' ); // can't overwrite existing result
680
  }
681
  }
682
 
683
+ // validate malicious tags
684
+ if ( preg_match( '!<(script|svg|iframe|object|applet)[^>]*>\W*\w+[^<]*<\\\\*/\1[^>]*>!', $this->query ) )
685
+ return $validate + array( 'result' => 'badtag' ); // can't overwrite existing result
686
+
687
  return $validate;
688
  }
689
 
ip-geo-block.php CHANGED
@@ -13,7 +13,7 @@
13
  * Plugin Name: IP Geo Block
14
  * Plugin URI: http://wordpress.org/plugins/ip-geo-block/
15
  * Description: It blocks any spams, login attempts and malicious access to the admin area posted from outside your nation, and also prevents zero-day exploit.
16
- * Version: 3.0.1.2
17
  * Author: tokkonopapa
18
  * Author URI: http://www.ipgeoblock.com/
19
  * Text Domain: ip-geo-block
@@ -70,6 +70,7 @@ register_deactivation_hook( __FILE__, 'ip_geo_block_deactivate' );
70
  * Instantiate class
71
  *
72
  */
 
73
  add_action( 'plugins_loaded', array( 'IP_Geo_Block', 'get_instance' ) );
74
 
75
  /*----------------------------------------------------------------------------*
13
  * Plugin Name: IP Geo Block
14
  * Plugin URI: http://wordpress.org/plugins/ip-geo-block/
15
  * Description: It blocks any spams, login attempts and malicious access to the admin area posted from outside your nation, and also prevents zero-day exploit.
16
+ * Version: 3.0.0
17
  * Author: tokkonopapa
18
  * Author URI: http://www.ipgeoblock.com/
19
  * Text Domain: ip-geo-block
70
  * Instantiate class
71
  *
72
  */
73
+ add_action( 'shutdown', array( 'IP_Geo_Block_Logs', 'exec_sql' ) );
74
  add_action( 'plugins_loaded', array( 'IP_Geo_Block', 'get_instance' ) );
75
 
76
  /*----------------------------------------------------------------------------*
languages/ip-geo-block-ja.mo CHANGED
Binary file
languages/ip-geo-block-ja.po CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: IP Geo Block 3.0.1.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
- "POT-Creation-Date: 2017-02-20 05:54+0900\n"
8
- "PO-Revision-Date: 2017-02-20 06:06+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -27,53 +27,53 @@ msgstr ""
27
  "自国以外から投稿されるスパム、ログインフォーム、さらにゼロデイ攻撃を含む管理"
28
  "領域への悪意あるアクセスからサイトを守ります。"
29
 
30
- #: admin/class-ip-geo-block-admin.php:160
31
  msgid "Import settings ?"
32
  msgstr "設定をインポートしますか?"
33
 
34
- #: admin/class-ip-geo-block-admin.php:161
35
  msgid "Create table ?"
36
  msgstr "テーブルを作成しますか?"
37
 
38
- #: admin/class-ip-geo-block-admin.php:162
39
  msgid "Delete table ?"
40
  msgstr "テーブルを削除しますか?"
41
 
42
- #: admin/class-ip-geo-block-admin.php:163
43
  msgid "Clear statistics ?"
44
  msgstr "統計をクリアしますか?"
45
 
46
- #: admin/class-ip-geo-block-admin.php:164
47
  msgid "Clear cache ?"
48
  msgstr "キャッシュをクリアしますか?"
49
 
50
- #: admin/class-ip-geo-block-admin.php:165
51
  msgid "Clear logs ?"
52
  msgstr "ログをクリアしますか?"
53
 
54
- #: admin/class-ip-geo-block-admin.php:166
55
  msgid "This feature is available with HTML5 compliant browsers."
56
  msgstr "HTML5準拠のブラウザでのみ機能します。"
57
 
58
- #: admin/class-ip-geo-block-admin.php:193
59
  msgid "Contribute at GitHub"
60
  msgstr "開発に参加"
61
 
62
- #: admin/class-ip-geo-block-admin.php:210
63
- #: admin/class-ip-geo-block-admin.php:390
64
  msgid "Settings"
65
  msgstr "設定"
66
 
67
- #: admin/class-ip-geo-block-admin.php:265
68
- #: admin/class-ip-geo-block-admin.php:266
69
  msgid "IP Geo Block"
70
  msgstr "IP Geo Block"
71
 
72
- #: admin/class-ip-geo-block-admin.php:284
73
  msgid "You need WordPress 3.7+."
74
  msgstr "WordPress 3.7&thinsp;以上が必要です。"
75
 
76
- #: admin/class-ip-geo-block-admin.php:293
77
  #, php-format
78
  msgid ""
79
  "Now downloading geolocation databases in background. After a little while, "
@@ -84,7 +84,7 @@ msgstr ""
84
  "いた後、あなたの国コードと「<strong>マッチング規則</strong>」を「<a href=\"%s"
85
  "\">検証ルールの設定</a>」で確認して下さい。"
86
 
87
- #: admin/class-ip-geo-block-admin.php:299
88
  #, php-format
89
  msgid ""
90
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
@@ -93,28 +93,11 @@ msgstr ""
93
  "「<strong>マッチング規則</strong>」が正しく設定されていません。「<a href=\"%s"
94
  "\">検証ルールの設定</a>」を確認して下さい。"
95
 
96
- #: admin/class-ip-geo-block-admin.php:308
97
  msgid "Local database and matching rule have been updated."
98
  msgstr "ローカル・データベースとマッチング規則を更新しました。"
99
 
100
- #: admin/class-ip-geo-block-admin.php:319
101
- msgid ""
102
- "Once you logout, you will be unable to login again because the number of "
103
- "login attempts reaches the limit."
104
- msgstr ""
105
- "あなたのIPアドレスのログイン試行可能回数がリミットに達したため、ログアウトす"
106
- "ると再びログインする事が出来なくなります。"
107
-
108
- #: admin/class-ip-geo-block-admin.php:321
109
- #, php-format
110
- msgid ""
111
- "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
112
- "tab</a> to prevent locking yourself out."
113
- msgstr ""
114
- "<a href=\"%s\">「統計」タブ</a>の \"<strong>キャッシュのクリア</strong>\" を"
115
- "実行し、ロックアウトを回避してください。"
116
-
117
- #: admin/class-ip-geo-block-admin.php:331
118
  msgid ""
119
  "Once you logout, you will be unable to login again because your country code "
120
  "or IP address is in the blacklist."
@@ -122,7 +105,7 @@ msgstr ""
122
  "あなたの国コードまたはIPアドレスがブラックリストに含まれているため、ログアウ"
123
  "トすると再びログインする事が出来なくなります。"
124
 
125
- #: admin/class-ip-geo-block-admin.php:332
126
  msgid ""
127
  "Once you logout, you will be unable to login again because your country code "
128
  "or IP address is not in the whitelist."
@@ -130,36 +113,36 @@ msgstr ""
130
  "あなたの国コードまたはIPアドレスがホワイトリストに含まれていないため、ログア"
131
  "ウトすると再びログインする事が出来なくなります。"
132
 
133
- #: admin/class-ip-geo-block-admin.php:335
134
  #, php-format
135
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
136
  msgstr "「<a href=\"%s\">検証ルールの設定</a>」を確認して下さい。"
137
 
138
- #: admin/class-ip-geo-block-admin.php:391
139
  msgid "Statistics"
140
  msgstr "統計"
141
 
142
- #: admin/class-ip-geo-block-admin.php:392
143
  msgid "Logs"
144
  msgstr "ログ"
145
 
146
- #: admin/class-ip-geo-block-admin.php:393
147
  msgid "Search"
148
  msgstr "検索"
149
 
150
- #: admin/class-ip-geo-block-admin.php:394
151
  msgid "Attribution"
152
  msgstr "リンク"
153
 
154
- #: admin/class-ip-geo-block-admin.php:405
155
  msgid "Toggle all"
156
  msgstr "全てを開閉"
157
 
158
- #: admin/class-ip-geo-block-admin.php:429
159
  msgid "Thanks for providing these great services for free."
160
  msgstr "これらのすばらしいサービスの提供元に、敬意と感謝の意を表します!"
161
 
162
- #: admin/class-ip-geo-block-admin.php:430
163
  msgid ""
164
  "(Most browsers will redirect you to each site <a href=\"http://www."
165
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
@@ -169,24 +152,23 @@ msgstr ""
169
  "html\" title=\"Referer Checker\">参照元を残さずにリンク先にリダイレクトできま"
170
  "す</a>。)"
171
 
172
- #: admin/class-ip-geo-block-admin.php:435
173
  msgid "Back to top"
174
  msgstr "トップに戻る"
175
 
176
- #: admin/class-ip-geo-block-admin.php:527
177
  msgid "Enable"
178
  msgstr "有効"
179
 
180
- #: admin/class-ip-geo-block-admin.php:840
181
- #: admin/class-ip-geo-block-admin.php:851
182
- #: classes/class-ip-geo-block-cron.php:260
183
- #: classes/class-ip-geo-block-cron.php:294
184
- #: classes/class-ip-geo-block-opts.php:313
185
  #, php-format
186
  msgid "Unable to write %s. Please check the permission."
187
  msgstr "%s に書き込めません。パーミッションを確認して下さい。"
188
 
189
- #: admin/class-ip-geo-block-admin.php:841
190
  #, php-format
191
  msgid "Or please refer to %s to set it manually."
192
  msgid_plural "Or please refer to %s to set them manually."
@@ -226,7 +208,7 @@ msgstr "今すぐクリア"
226
  msgid "Export logs"
227
  msgstr "ログをエクスポート"
228
 
229
- #: admin/includes/tab-accesslog.php:69 admin/includes/tab-settings.php:1230
230
  msgid "Export to the local file"
231
  msgstr "ローカル・ファイルにエクスポートする"
232
 
@@ -234,33 +216,29 @@ msgstr "ローカル・ファイルにエクスポートする"
234
  msgid "Export csv"
235
  msgstr "CSVをエクスポート"
236
 
237
- #: admin/includes/tab-accesslog.php:109
238
  #, php-format
239
- msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
240
- msgstr "<dfn title=\"%s に対するリクエストの検証ログです。\">%s</dfn>"
241
 
242
- #: admin/includes/tab-accesslog.php:111 admin/includes/tab-settings.php:366
243
  msgid "Comment post"
244
  msgstr "コメント投稿"
245
 
246
- #: admin/includes/tab-accesslog.php:112 admin/includes/tab-settings.php:367
247
  msgid "XML-RPC"
248
  msgstr "XML-RPC"
249
 
250
- #: admin/includes/tab-accesslog.php:113 admin/includes/tab-settings.php:368
251
  msgid "Login form"
252
  msgstr "ログイン・フォーム"
253
 
254
- #: admin/includes/tab-accesslog.php:114 admin/includes/tab-settings.php:369
255
  msgid "Admin area"
256
  msgstr "管理領域"
257
 
258
- #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:371
259
- msgid "public facing pages"
260
- msgstr "一般公開ページ"
261
-
262
- #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:371
263
- msgid "Public facing pages"
264
  msgstr "一般公開ページ"
265
 
266
  #: admin/includes/tab-accesslog.php:121
@@ -390,7 +368,7 @@ msgstr "(カンマ区切り)"
390
  msgid "(comma or RET separated)"
391
  msgstr "(カンマ、または改行区切り)"
392
 
393
- #: admin/includes/tab-settings.php:107 admin/includes/tab-settings.php:673
394
  msgid "Matching rule"
395
  msgstr "マッチング規則"
396
 
@@ -461,7 +439,7 @@ msgstr ""
461
  "<dfn title=\"テーマ・ディレクトリには&thinsp;403.php&thinsp;など、独自のファ"
462
  "イルを設置する事が出来ます。\">レスポンス・コード</dfn> %s"
463
 
464
- #: admin/includes/tab-settings.php:269
465
  msgid ""
466
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. Front-end URL on "
467
  "your site would not be blocked to prevent loop of redirection even when you "
@@ -474,7 +452,7 @@ msgstr ""
474
  "ります。空欄の場合、サイトのホームが使用されます。\">リダイレクト先&thinsp;"
475
  "URL</dfn>"
476
 
477
- #: admin/includes/tab-settings.php:286
478
  msgid ""
479
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
480
  "message</dfn>"
@@ -482,7 +460,7 @@ msgstr ""
482
  "<dfn title=\"レスポンス・コード&thinsp;4xx、5xx&thinsp;用のメッセージを指定し"
483
  "ます。\">レスポンス・メッセージ</dfn>"
484
 
485
- #: admin/includes/tab-settings.php:303
486
  msgid ""
487
  "<dfn title=\"Applied to &#8220;XML-RPC&#8221; and &#8220;Login form&#8221;. "
488
  "Lockout period is defined as expiration time at &#8220;Cache settings&#8221;."
@@ -492,23 +470,23 @@ msgstr ""
492
  "時間は「キャッシュの設定」の「有効時間」で定義されます。\">IPアドレス当たりの"
493
  "ログイン試行可能回数</dfn>"
494
 
495
- #: admin/includes/tab-settings.php:330
496
  msgid "Select when to run the validation."
497
  msgstr "検証を実行するタイミングを選択します。"
498
 
499
- #: admin/includes/tab-settings.php:330
500
  msgid "Validation timing"
501
  msgstr "検証のタイミング"
502
 
503
- #: admin/includes/tab-settings.php:341
504
  msgid "&#8220;init&#8221; action hook"
505
  msgstr "&#8220;init&#8221; アクション・フック"
506
 
507
- #: admin/includes/tab-settings.php:342
508
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
509
  msgstr "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
510
 
511
- #: admin/includes/tab-settings.php:345
512
  msgid ""
513
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
514
  "plugins."
@@ -516,65 +494,59 @@ msgstr ""
516
  "標準的な他のプラグインと同様、init アクション・フックのタイミングで検証を実行"
517
  "します。"
518
 
519
- #: admin/includes/tab-settings.php:346
520
  msgid ""
521
  "Validate at an earlier phase than other typical plugins. It can reduce load "
522
- "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
523
- "validation-timing.html' title='Validation timing | IP Geo Block'>some "
524
- "restrictions</a>."
525
  msgstr ""
526
  "標準的な他のプラグインより早いタイミングで検証を実行します。これによりサー"
527
- "バーの負荷は軽減されますが、<a rel='noreferrer' href='http://www.ipgeoblock."
528
- "com/codex/validation-timing.html' title='Validation timing | IP Geo Block'>幾"
529
- "つかの制限事項</a>&thinsp;が生じます。"
530
 
531
- #: admin/includes/tab-settings.php:358
532
  msgid "Back-end target settings"
533
  msgstr "バックエンドの設定"
534
 
535
- #: admin/includes/tab-settings.php:364
536
- #, php-format
537
- msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
538
- msgstr "<dfn title=\"%s へのリクエストを検証します。\">%s</dfn>"
539
-
540
- #: admin/includes/tab-settings.php:370
541
  msgid "Other areas"
542
  msgstr "その他のディレクトリ"
543
 
544
- #: admin/includes/tab-settings.php:389 admin/includes/tab-settings.php:409
545
- #: admin/includes/tab-settings.php:442 admin/includes/tab-settings.php:448
546
- #: admin/includes/tab-settings.php:661
547
  msgid "Block by country"
548
  msgstr "国コードで遮断"
549
 
550
- #: admin/includes/tab-settings.php:408 admin/includes/tab-settings.php:516
551
- #: admin/includes/tab-settings.php:994
552
  msgid "Disable"
553
  msgstr "無効"
554
 
555
- #: admin/includes/tab-settings.php:410
556
  msgid "Completely close"
557
  msgstr "完全に閉鎖"
558
 
559
- #: admin/includes/tab-settings.php:443
560
  msgid ""
561
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
562
  "actions</dfn>"
563
  msgstr ""
564
  "<dfn title=\"遮断対象とするアクションを指定します。\">対象アクション</dfn>"
565
 
566
- #: admin/includes/tab-settings.php:449
567
  msgid "Prevent Zero-day Exploit"
568
  msgstr "ゼロデイ攻撃を遮断"
569
 
570
- #: admin/includes/tab-settings.php:453
571
  msgid ""
572
  "It will block a request related to the services for both public facing pages "
573
  "and the dashboard."
574
  msgstr ""
575
  "一般公開ページとダッシュボード向けサービスに関連するリクエストを遮断します。"
576
 
577
- #: admin/includes/tab-settings.php:454
578
  msgid ""
579
  "Regardless of the country code, it will block a malicious request related to "
580
  "the services only for the dashboard."
@@ -582,19 +554,15 @@ msgstr ""
582
  "国コードに拘らず、ダッシュボード向けサービスだけに関連する悪意のあるリクエス"
583
  "トを遮断します。"
584
 
585
- #: admin/includes/tab-settings.php:481
586
  msgid "Admin ajax/post"
587
  msgstr "管理領域&thinsp;ajax/post"
588
 
589
- #: admin/includes/tab-settings.php:501
590
- msgid ""
591
- "<dfn title=\"Same effect as &#8220;ip-geo-block-bypass-admins&#8221; filter "
592
- "hook.\">Exception for admin action and page</dfn>"
593
- msgstr ""
594
- "<dfn title=\"&#8220;ip-geo-block-bypass-admins&#8221;フィルターフックと同じ効"
595
- "果を設定します。\">管理者用アクションとページの例外</dfn>"
596
 
597
- #: admin/includes/tab-settings.php:518
598
  #, php-format
599
  msgid ""
600
  "Regardless of the country code, it will block a malicious request to <code>"
@@ -603,51 +571,51 @@ msgstr ""
603
  "国コードに拘らず、<code>%s&hellip;/*.php</code>への悪意のあるリクエストを遮断"
604
  "します。"
605
 
606
- #: admin/includes/tab-settings.php:519
607
  #, php-format
608
  msgid ""
609
- "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
610
  "does not load WordPress core."
611
  msgstr ""
612
  "WordPressコアを読み込まないPHPファイルへのリクエストを検証対象とするため"
613
  "に、%s を設定します。"
614
 
615
- #: admin/includes/tab-settings.php:520
616
  msgid ""
617
  "<dfn title=\"Select the item which causes undesired blocking in order to "
618
  "exclude from the validation target. Grayed item indicates &#8220;"
619
  "INACTIVE&#8221;.\">Exceptions</dfn>"
620
  msgstr ""
621
  "<dfn title=\"望ましくない遮断の原因となる項目を選択し、検証対象から除外しま"
622
- "す。灰色で表示された項目は、「非アクティブ」であることを示しています。\">除外"
623
  "する項目</dfn>"
624
 
625
- #: admin/includes/tab-settings.php:556 admin/includes/tab-settings.php:609
626
  msgid "Force to load WP core"
627
  msgstr "WPコアの読み込みを強制"
628
 
629
- #: admin/includes/tab-settings.php:561
630
  msgid "Plugins area"
631
  msgstr "プラグイン領域"
632
 
633
- #: admin/includes/tab-settings.php:614
634
  msgid "Themes area"
635
  msgstr "テーマ領域"
636
 
637
- #: admin/includes/tab-settings.php:642
638
  msgid "Front-end target settings"
639
  msgstr "フロントエンドの設定"
640
 
641
- #: admin/includes/tab-settings.php:666
642
  msgid "Follow &#8220;Validation rule settings&#8221;"
643
  msgstr "「検証ルールの設定」に従う"
644
 
645
- #: admin/includes/tab-settings.php:723
646
  msgid ""
647
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
648
  msgstr "<dfn title=\"特定のページを遮断対象に指定します。\">ページ</dfn>"
649
 
650
- #: admin/includes/tab-settings.php:735
651
  msgid ""
652
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
653
  "target.\">Post type</dfn>"
@@ -655,7 +623,7 @@ msgstr ""
655
  "<dfn title=\"特定の投稿タイプのシングルページを遮断対象に指定します。\">投稿"
656
  "タイプ</dfn>"
657
 
658
- #: admin/includes/tab-settings.php:747
659
  msgid ""
660
  "<dfn title=\"Specify the individual category on a single page or archive "
661
  "page as a blocking target.\">Category</dfn>"
@@ -663,7 +631,7 @@ msgstr ""
663
  "<dfn title=\"特定のカテゴリを含むシングルページかアーカイブページを遮断対象に"
664
  "指定します。\">カテゴリ</dfn>"
665
 
666
- #: admin/includes/tab-settings.php:759
667
  msgid ""
668
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
669
  "a blocking target.\">Tag</dfn>"
@@ -671,23 +639,23 @@ msgstr ""
671
  "<dfn title=\"特定のタグを含むシングルページかアーカイブページを遮断対象に指定"
672
  "します。\">タグ</dfn>"
673
 
674
- #: admin/includes/tab-settings.php:774
675
  msgid "Specify the validation target on front-end."
676
  msgstr "フロント・エンドの検証対象を設定します。"
677
 
678
- #: admin/includes/tab-settings.php:774
679
  msgid "Validation target"
680
  msgstr "検証対象"
681
 
682
- #: admin/includes/tab-settings.php:785
683
  msgid "All requests"
684
  msgstr "全てのリクエスト"
685
 
686
- #: admin/includes/tab-settings.php:786
687
  msgid "Specify the targets"
688
  msgstr "ターゲットを指定"
689
 
690
- #: admin/includes/tab-settings.php:789
691
  msgid ""
692
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
693
  "wp&#8221; action hook. It means that this feature would not be compatible "
@@ -696,7 +664,7 @@ msgstr ""
696
  "「検証のタイミング」が &#8220;wp&#8221; アクション・フックまで遅延されます。"
697
  "これにより、ページ・キャッシュとの互換性がなくなることに注意してください。"
698
 
699
- #: admin/includes/tab-settings.php:799
700
  msgid ""
701
  "A part of user agent string and a qualification connected with a separator "
702
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
@@ -710,35 +678,35 @@ msgstr ""
710
  "国コード、または&nbsp;IPアドレス(CIDR記法)が使えます。また否定を表す記号"
711
  "「!」を「条件」の直前に配置する事が出来ます。"
712
 
713
- #: admin/includes/tab-settings.php:799
714
  msgid "UA string and qualification"
715
  msgstr "ユーザーエージェント文字列と条件"
716
 
717
- #: admin/includes/tab-settings.php:818
718
  msgid "Specify the name of action that is invariably blocked."
719
  msgstr "遮断されるアクション名を指定します。"
720
 
721
- #: admin/includes/tab-settings.php:818
722
  msgid "Excluded actions"
723
  msgstr "除外するアクション"
724
 
725
- #: admin/includes/tab-settings.php:837
726
  msgid ""
727
  "It enables to simulate validation without deployment. The results can be "
728
- "found at &#8220;Public facing pages&#8221; in Logs."
729
  msgstr ""
730
  "機能を有効にする事なくリクエストの検証をシミュレートします。結果はログで確認"
731
  "する事が出来ます。"
732
 
733
- #: admin/includes/tab-settings.php:837
734
  msgid "Simulation mode"
735
  msgstr "シミュレーション・モード"
736
 
737
- #: admin/includes/tab-settings.php:856
738
  msgid "Geolocation API settings"
739
  msgstr "位置情報APIの設定"
740
 
741
- #: admin/includes/tab-settings.php:865
742
  msgid ""
743
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
744
  "selection and key settings</dfn>"
@@ -746,90 +714,89 @@ msgstr ""
746
  "<dfn title=\"キャッシュとローカルのデータベースが最優先で検索されます。\">API"
747
  "の選択とキーの設定</dfn>"
748
 
749
- #: admin/includes/tab-settings.php:887
750
  #, php-format
751
  msgid ""
752
- "Please download <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/"
753
- "WordPress-IP-Geo-API/archive/master.zip\" title=\"Download the contents of "
754
- "tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> from <a rel="
755
- "\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API\" "
756
- "title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a> "
757
- "and upload <code>ip-geo-api</code> to <code>%s</code> with write permission."
758
  msgstr ""
759
- "<a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-"
760
- "API\" title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-IP-Geo-"
761
- "API</a>から<a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/"
762
- "WordPress-IP-Geo-API/archive/master.zip\" title=\"Download the contents of "
763
- "tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIPファイル</a>をダウンロー"
764
- "ドし、<code>ip-geo-api</code>を書き込み権限付きで<code>%s</code>にアップロー"
765
- "ドして下さい。"
766
-
767
- #: admin/includes/tab-settings.php:896
768
  msgid "Local database settings"
769
  msgstr "ローカル・データベースの設定"
770
 
771
- #: admin/includes/tab-settings.php:911
772
  msgid "database"
773
  msgstr "ファイル"
774
 
775
- #: admin/includes/tab-settings.php:912 classes/class-ip-geo-block-cron.php:342
776
  #, php-format
777
  msgid "Last update: %s"
778
  msgstr "最終更新:%s"
779
 
780
- #: admin/includes/tab-settings.php:921
781
  msgid "Auto updating (once a month)"
782
  msgstr "自動更新(月1回)"
783
 
784
- #: admin/includes/tab-settings.php:938
785
  msgid "Download database"
786
  msgstr "データベースのダウンロード"
787
 
788
- #: admin/includes/tab-settings.php:946
789
  msgid "Download now"
790
  msgstr "今すぐダウンロード"
791
 
792
- #: admin/includes/tab-settings.php:958
793
  msgid "Record settings"
794
  msgstr "記録の設定"
795
 
796
- #: admin/includes/tab-settings.php:967
797
  msgid "Record validation statistics"
798
  msgstr "検証の統計を記録"
799
 
800
- #: admin/includes/tab-settings.php:983
801
  msgid "Record validation logs"
802
  msgstr "検証のログを記録"
803
 
804
- #: admin/includes/tab-settings.php:995
805
  msgid "Only when blocked"
806
  msgstr "遮断時に記録"
807
 
808
- #: admin/includes/tab-settings.php:996
809
  msgid "Only when passed"
810
  msgstr "通過時に記録"
811
 
812
- #: admin/includes/tab-settings.php:997
813
  msgid "Unauthenticated user"
814
  msgstr "未認証ユーザーを記録"
815
 
816
- #: admin/includes/tab-settings.php:998
817
  msgid "Authenticated user"
818
  msgstr "認証済ユーザーを記録"
819
 
820
- #: admin/includes/tab-settings.php:999
821
  msgid "All of validation"
822
  msgstr "すべての検証を記録"
823
 
824
- #: admin/includes/tab-settings.php:1008
825
  msgid "Recording period of the logs (days)"
826
  msgstr "ログの記録期間(日)"
827
 
828
- #: admin/includes/tab-settings.php:1024
829
  msgid "Maximum length of logs for each target"
830
  msgstr "ログの記録最大数"
831
 
832
- #: admin/includes/tab-settings.php:1041
833
  msgid ""
834
  "<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be recorded "
835
  "with their values in logs</dfn>"
@@ -837,15 +804,15 @@ msgstr ""
837
  "<dfn title=\"例)action, comment, log, pwd\">ログに記録する際に内容を展開する"
838
  "$_POSTのキー</dfn>"
839
 
840
- #: admin/includes/tab-settings.php:1059
841
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
842
  msgstr "<dfn title=\"例)123.456.789.***\">IPアドレスを匿名化する</dfn>"
843
 
844
- #: admin/includes/tab-settings.php:1077
845
  msgid "IP address cache settings"
846
  msgstr "IPアドレスのキャッシュ設定"
847
 
848
- #: admin/includes/tab-settings.php:1086
849
  #, php-format
850
  msgid ""
851
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
@@ -855,47 +822,47 @@ msgstr ""
855
  "<dfn title=\"ユーザ認証が連続%d回失敗した場合も、以降のログインがこの期間だけ"
856
  "(ガベージコレクション周期を含む)禁止されます。\">有効時間 [sec]</dfn>"
857
 
858
- #: admin/includes/tab-settings.php:1102
859
  msgid "Garbage collection period [sec]"
860
  msgstr "ガベージコレクション周期 [秒]"
861
 
862
- #: admin/includes/tab-settings.php:1119
863
  msgid "Number of entries to be displayed in cache"
864
  msgstr "「キャッシュ中のIPアドレス」に表示する最大数"
865
 
866
- #: admin/includes/tab-settings.php:1138
867
  msgid "Submission settings"
868
  msgstr "投稿時の設定"
869
 
870
- #: admin/includes/tab-settings.php:1150
871
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
872
  msgstr "全体が&lt;p&gt;タグで囲われます。使用可能タグ:"
873
 
874
- #: admin/includes/tab-settings.php:1150
875
  msgid "Message on comment form"
876
  msgstr "投稿フォーム上のメッセージ"
877
 
878
- #: admin/includes/tab-settings.php:1162
879
  msgid "None"
880
  msgstr "なし"
881
 
882
- #: admin/includes/tab-settings.php:1163
883
  msgid "Top"
884
  msgstr "上部"
885
 
886
- #: admin/includes/tab-settings.php:1164
887
  msgid "Bottom"
888
  msgstr "下部"
889
 
890
- #: admin/includes/tab-settings.php:1176
891
  msgid "Plugin settings"
892
  msgstr "プラグインの設定"
893
 
894
- #: admin/includes/tab-settings.php:1185
895
  msgid "Remove all settings at uninstallation"
896
  msgstr "アンインストール時に全設定を削除"
897
 
898
- #: admin/includes/tab-settings.php:1203
899
  msgid ""
900
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
901
  "dfn>"
@@ -903,7 +870,7 @@ msgstr ""
903
  "<dfn title=\"Google Maps JavaScript API に有効なキー\">Google Maps API キー</"
904
  "dfn>"
905
 
906
- #: admin/includes/tab-settings.php:1217
907
  msgid ""
908
  "You need to click the &#8220;Save Changes&#8221; button for imported "
909
  "settings to take effect."
@@ -911,109 +878,87 @@ msgstr ""
911
  "インポートされた設定を有効にするには、「変更を保存」ボタンをクリックする必要"
912
  "があります。"
913
 
914
- #: admin/includes/tab-settings.php:1223
915
  msgid "Export / Import settings"
916
  msgstr "設定のエクスポート、インポート"
917
 
918
- #: admin/includes/tab-settings.php:1230
919
  msgid "Export settings"
920
  msgstr "エクスポート"
921
 
922
- #: admin/includes/tab-settings.php:1231
923
  msgid "Import from the local file"
924
  msgstr "ローカル・ファイルからインポートします"
925
 
926
- #: admin/includes/tab-settings.php:1231
927
  msgid "Import settings"
928
  msgstr "インポート"
929
 
930
- #: admin/includes/tab-settings.php:1240
931
  msgid "Import pre-defined settings"
932
  msgstr "プリセットのインポート"
933
 
934
- #: admin/includes/tab-settings.php:1247
935
  msgid ""
936
  "Import the default settings to revert to the &#8220;Right after "
937
  "installing&#8221; state"
938
  msgstr "インストール直後の状態に戻すための設定値をインポートします"
939
 
940
- #: admin/includes/tab-settings.php:1247
941
  msgid "Default settings"
942
  msgstr "初期設定"
943
 
944
- #: admin/includes/tab-settings.php:1248
945
  msgid ""
946
  "Import the preferred settings mainly for the &#8220;Validation target "
947
  "settings&#8221;"
948
  msgstr "主に「検証対象の設定」に関する推奨の設定値をインポートします"
949
 
950
- #: admin/includes/tab-settings.php:1248
951
- msgid "Best settings"
952
- msgstr "ベストな設定"
953
 
954
- #: admin/includes/tab-settings.php:1257
955
- msgid ""
956
- "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
957
- "forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
958
- "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
959
- "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
960
- msgstr ""
961
- "<dfn title=\"フォーラムに問題を投稿する際、コピーして張り付けてください。\">"
962
- "インストール情報</dfn><br />[ <a rel=\"noreferrer\" href=\"https://wordpress."
963
- "org/support/plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; "
964
- "IP Geo Block\">サポートフォーラム</a> ]"
965
-
966
- #: admin/includes/tab-settings.php:1264
967
- msgid "Show PHP, WordPress, theme and plugins information."
968
- msgstr "PHP、WordPress、テーマ、プラグインの情報を表示します。"
969
-
970
- #: admin/includes/tab-settings.php:1264
971
- msgid "Show information"
972
- msgstr "情報を表示"
973
-
974
- #: admin/includes/tab-settings.php:1274
975
  msgid "Delete DB table for validation logs"
976
  msgstr "検証のログ用データベース・テーブルの削除"
977
 
978
- #: admin/includes/tab-settings.php:1282
979
  msgid "Delete now"
980
  msgstr "今すぐ削除"
981
 
982
- #: admin/includes/tab-settings.php:1290
983
  msgid "Create DB table for validation logs"
984
  msgstr "検証のログ用データベース・テーブルの作成"
985
 
986
- #: admin/includes/tab-settings.php:1298
987
  msgid "Create now"
988
  msgstr "今すぐ作成"
989
 
990
- #: admin/includes/tab-settings.php:1313
991
  msgid ""
992
- "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
993
- "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
994
- "settings.html\" title=\"The best practice for target settings | IP Geo Block"
995
- "\">The best practice for target settings</a>&#8221;."
996
  msgstr ""
997
- "防御性能をより高めるための設定については、&#8220;<a rel=\"noreferrer\" href="
998
- "\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-settings.html"
999
- "\" title=\"The best practice for target settings | IP Geo Block\">The best "
1000
- "practice fortarget settings</a>&#8220;&thinsp;を参照してください。"
1001
 
1002
- #: admin/includes/tab-settings.php:1314
1003
  msgid ""
1004
- "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
1005
- "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
1006
- "Block &mdash; WordPress Plugins\">WordPress.org</a> and <a rel=\"noreferrer"
1007
- "\" href=\"http://www.ipgeoblock.com/codex/#faq\" title=\"Codex | IP Geo Block"
1008
- "\">Codex</a>."
1009
  msgstr ""
1010
- "何か問題が発生した場合は、<a rel=\"noreferrer\" href=\"https://wordpress.org/"
1011
- "plugins/ip-geo-block/faq/\" title=\"IP Geo Block &mdash; WordPress Plugins"
1012
- "\">WordPress.org</a> <a rel=\"noreferrer\" href=\"http://www.ipgeoblock."
1013
- "com/codex/#faq\" title=\"Codex | IP Geo Block\">Codex</a> の FAQ を参照してく"
1014
- "ださい。"
1015
 
1016
- #: admin/includes/tab-settings.php:1321
1017
  msgid ""
1018
  "While Maxmind and IP2Location will fetch the local database, others will "
1019
  "pass an IP address to the APIs via HTTP."
@@ -1021,34 +966,33 @@ msgstr ""
1021
  "MaxmindとIP2Locationはローカルのデータベースを検索しますが、他はHTTPを介して"
1022
  "APIにIPアドレスを渡します。"
1023
 
1024
- #: admin/includes/tab-settings.php:1322
1025
  msgid ""
1026
  "Please select the appropriate APIs to fit the privacy law in your country."
1027
  msgstr "自国のプライバシー関連法規に合わせ、適切なAPIを選択して下さい。"
1028
 
1029
- #: admin/includes/tab-settings.php:1329
1030
  msgid ""
1031
- "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
1032
- "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
1033
- "\">Blocking on front-end</a>&#8221; for details, including restrictions on "
1034
- "cache plugin."
1035
  msgstr ""
1036
- "キャッシュ・プラグインに関する制限事項を含め、詳しくはドキュメント &#8220;<a "
1037
- "rel=\"noreferrer\" href=\"http://www.ipgeoblock.com/codex/#blocking-on-front-"
1038
- "end\" title=\"Codex | IP Geo Block\">Blocking on front-end</a>&#8221; を参照"
1039
- "してください。"
1040
 
1041
- #: admin/includes/tab-settings.php:1330
1042
  msgid ""
1043
  "If you find any issues or have something to suggest, please feel free to "
1044
- "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
1045
- "plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP Geo Block"
1046
- "\">support forum</a>."
1047
  msgstr ""
1048
- "問題を発見したり改善の提案がある場合は、お気軽に <a rel=\"noreferrer\" href="
1049
- "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
1050
- "&#8250; Support &raquo; IP Geo Block\">サポートフォーラム</a> に投稿をお願い"
1051
- "します。"
1052
 
1053
  #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:184
1054
  msgid "Statistics of validation"
@@ -1132,33 +1076,26 @@ msgstr ""
1132
  "少なくとも1つ以上の位置情報サービスを選択して下さい。未選択の場合、キャッシュ"
1133
  "の有効期限切れと共にロックアウトされます。"
1134
 
1135
- #: classes/class-ip-geo-block-cron.php:227
1136
  msgid "Your database file is up-to-date."
1137
  msgstr "データベース・ファイルは最新です。"
1138
 
1139
- #: classes/class-ip-geo-block-cron.php:255
1140
- #: classes/class-ip-geo-block-cron.php:289
1141
  #, php-format
1142
  msgid "Unable to read %s. Please check the permission."
1143
- msgstr "%s が読めません。パーミッションを確認して下さい。"
1144
-
1145
- #: classes/class-ip-geo-block-cron.php:265
1146
- #: classes/class-ip-geo-block-cron.php:299
1147
- #, php-format
1148
- msgid "Can't lock %s. Please try again after a while."
1149
- msgstr "%s をロックできません。パーミッションを確認して下さい。"
1150
 
1151
- #: classes/class-ip-geo-block-logs.php:149
1152
  #, php-format
1153
  msgid ""
1154
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1155
  "activate again."
1156
  msgstr ""
1157
- "%s 用のテーブルが作成されていません。一旦このプラグインを無効化し、再度有効化"
1158
  "して下さい。"
1159
 
1160
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:147
1161
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:176
1162
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:149
1163
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:178
1164
  msgid "Database file does not exist."
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: IP Geo Block 3.0.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
+ "POT-Creation-Date: 2016-12-05 21:17+0900\n"
8
+ "PO-Revision-Date: 2016-12-05 21:23+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
27
  "自国以外から投稿されるスパム、ログインフォーム、さらにゼロデイ攻撃を含む管理"
28
  "領域への悪意あるアクセスからサイトを守ります。"
29
 
30
+ #: admin/class-ip-geo-block-admin.php:161
31
  msgid "Import settings ?"
32
  msgstr "設定をインポートしますか?"
33
 
34
+ #: admin/class-ip-geo-block-admin.php:162
35
  msgid "Create table ?"
36
  msgstr "テーブルを作成しますか?"
37
 
38
+ #: admin/class-ip-geo-block-admin.php:163
39
  msgid "Delete table ?"
40
  msgstr "テーブルを削除しますか?"
41
 
42
+ #: admin/class-ip-geo-block-admin.php:164
43
  msgid "Clear statistics ?"
44
  msgstr "統計をクリアしますか?"
45
 
46
+ #: admin/class-ip-geo-block-admin.php:165
47
  msgid "Clear cache ?"
48
  msgstr "キャッシュをクリアしますか?"
49
 
50
+ #: admin/class-ip-geo-block-admin.php:166
51
  msgid "Clear logs ?"
52
  msgstr "ログをクリアしますか?"
53
 
54
+ #: admin/class-ip-geo-block-admin.php:167
55
  msgid "This feature is available with HTML5 compliant browsers."
56
  msgstr "HTML5準拠のブラウザでのみ機能します。"
57
 
58
+ #: admin/class-ip-geo-block-admin.php:194
59
  msgid "Contribute at GitHub"
60
  msgstr "開発に参加"
61
 
62
+ #: admin/class-ip-geo-block-admin.php:211
63
+ #: admin/class-ip-geo-block-admin.php:365
64
  msgid "Settings"
65
  msgstr "設定"
66
 
67
+ #: admin/class-ip-geo-block-admin.php:257
68
+ #: admin/class-ip-geo-block-admin.php:258
69
  msgid "IP Geo Block"
70
  msgstr "IP Geo Block"
71
 
72
+ #: admin/class-ip-geo-block-admin.php:279
73
  msgid "You need WordPress 3.7+."
74
  msgstr "WordPress 3.7&thinsp;以上が必要です。"
75
 
76
+ #: admin/class-ip-geo-block-admin.php:287
77
  #, php-format
78
  msgid ""
79
  "Now downloading geolocation databases in background. After a little while, "
84
  "いた後、あなたの国コードと「<strong>マッチング規則</strong>」を「<a href=\"%s"
85
  "\">検証ルールの設定</a>」で確認して下さい。"
86
 
87
+ #: admin/class-ip-geo-block-admin.php:293
88
  #, php-format
89
  msgid ""
90
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
93
  "「<strong>マッチング規則</strong>」が正しく設定されていません。「<a href=\"%s"
94
  "\">検証ルールの設定</a>」を確認して下さい。"
95
 
96
+ #: admin/class-ip-geo-block-admin.php:302
97
  msgid "Local database and matching rule have been updated."
98
  msgstr "ローカル・データベースとマッチング規則を更新しました。"
99
 
100
+ #: admin/class-ip-geo-block-admin.php:313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  msgid ""
102
  "Once you logout, you will be unable to login again because your country code "
103
  "or IP address is in the blacklist."
105
  "あなたの国コードまたはIPアドレスがブラックリストに含まれているため、ログアウ"
106
  "トすると再びログインする事が出来なくなります。"
107
 
108
+ #: admin/class-ip-geo-block-admin.php:314
109
  msgid ""
110
  "Once you logout, you will be unable to login again because your country code "
111
  "or IP address is not in the whitelist."
113
  "あなたの国コードまたはIPアドレスがホワイトリストに含まれていないため、ログア"
114
  "ウトすると再びログインする事が出来なくなります。"
115
 
116
+ #: admin/class-ip-geo-block-admin.php:317
117
  #, php-format
118
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
119
  msgstr "「<a href=\"%s\">検証ルールの設定</a>」を確認して下さい。"
120
 
121
+ #: admin/class-ip-geo-block-admin.php:366
122
  msgid "Statistics"
123
  msgstr "統計"
124
 
125
+ #: admin/class-ip-geo-block-admin.php:367
126
  msgid "Logs"
127
  msgstr "ログ"
128
 
129
+ #: admin/class-ip-geo-block-admin.php:368
130
  msgid "Search"
131
  msgstr "検索"
132
 
133
+ #: admin/class-ip-geo-block-admin.php:369
134
  msgid "Attribution"
135
  msgstr "リンク"
136
 
137
+ #: admin/class-ip-geo-block-admin.php:381
138
  msgid "Toggle all"
139
  msgstr "全てを開閉"
140
 
141
+ #: admin/class-ip-geo-block-admin.php:405
142
  msgid "Thanks for providing these great services for free."
143
  msgstr "これらのすばらしいサービスの提供元に、敬意と感謝の意を表します!"
144
 
145
+ #: admin/class-ip-geo-block-admin.php:406
146
  msgid ""
147
  "(Most browsers will redirect you to each site <a href=\"http://www."
148
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
152
  "html\" title=\"Referer Checker\">参照元を残さずにリンク先にリダイレクトできま"
153
  "す</a>。)"
154
 
155
+ #: admin/class-ip-geo-block-admin.php:411
156
  msgid "Back to top"
157
  msgstr "トップに戻る"
158
 
159
+ #: admin/class-ip-geo-block-admin.php:503
160
  msgid "Enable"
161
  msgstr "有効"
162
 
163
+ #: admin/class-ip-geo-block-admin.php:819
164
+ #: admin/class-ip-geo-block-admin.php:832
165
+ #: classes/class-ip-geo-block-cron.php:261
166
+ #: classes/class-ip-geo-block-opts.php:310
 
167
  #, php-format
168
  msgid "Unable to write %s. Please check the permission."
169
  msgstr "%s に書き込めません。パーミッションを確認して下さい。"
170
 
171
+ #: admin/class-ip-geo-block-admin.php:820
172
  #, php-format
173
  msgid "Or please refer to %s to set it manually."
174
  msgid_plural "Or please refer to %s to set them manually."
208
  msgid "Export logs"
209
  msgstr "ログをエクスポート"
210
 
211
+ #: admin/includes/tab-accesslog.php:69 admin/includes/tab-settings.php:1228
212
  msgid "Export to the local file"
213
  msgstr "ローカル・ファイルにエクスポートする"
214
 
216
  msgid "Export csv"
217
  msgstr "CSVをエクスポート"
218
 
219
+ #: admin/includes/tab-accesslog.php:109 admin/includes/tab-settings.php:363
220
  #, php-format
221
+ msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
222
+ msgstr "<dfn title=\"%sへのリクエストを検証します。\">%s</dfn>"
223
 
224
+ #: admin/includes/tab-accesslog.php:111 admin/includes/tab-settings.php:365
225
  msgid "Comment post"
226
  msgstr "コメント投稿"
227
 
228
+ #: admin/includes/tab-accesslog.php:112 admin/includes/tab-settings.php:366
229
  msgid "XML-RPC"
230
  msgstr "XML-RPC"
231
 
232
+ #: admin/includes/tab-accesslog.php:113 admin/includes/tab-settings.php:367
233
  msgid "Login form"
234
  msgstr "ログイン・フォーム"
235
 
236
+ #: admin/includes/tab-accesslog.php:114 admin/includes/tab-settings.php:368
237
  msgid "Admin area"
238
  msgstr "管理領域"
239
 
240
+ #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:370
241
+ msgid "Pubic facing pages"
 
 
 
 
242
  msgstr "一般公開ページ"
243
 
244
  #: admin/includes/tab-accesslog.php:121
368
  msgid "(comma or RET separated)"
369
  msgstr "(カンマ、または改行区切り)"
370
 
371
+ #: admin/includes/tab-settings.php:107 admin/includes/tab-settings.php:671
372
  msgid "Matching rule"
373
  msgstr "マッチング規則"
374
 
439
  "<dfn title=\"テーマ・ディレクトリには&thinsp;403.php&thinsp;など、独自のファ"
440
  "イルを設置する事が出来ます。\">レスポンス・コード</dfn> %s"
441
 
442
+ #: admin/includes/tab-settings.php:268
443
  msgid ""
444
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. Front-end URL on "
445
  "your site would not be blocked to prevent loop of redirection even when you "
452
  "ります。空欄の場合、サイトのホームが使用されます。\">リダイレクト先&thinsp;"
453
  "URL</dfn>"
454
 
455
+ #: admin/includes/tab-settings.php:285
456
  msgid ""
457
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
458
  "message</dfn>"
460
  "<dfn title=\"レスポンス・コード&thinsp;4xx、5xx&thinsp;用のメッセージを指定し"
461
  "ます。\">レスポンス・メッセージ</dfn>"
462
 
463
+ #: admin/includes/tab-settings.php:302
464
  msgid ""
465
  "<dfn title=\"Applied to &#8220;XML-RPC&#8221; and &#8220;Login form&#8221;. "
466
  "Lockout period is defined as expiration time at &#8220;Cache settings&#8221;."
470
  "時間は「キャッシュの設定」の「有効時間」で定義されます。\">IPアドレス当たりの"
471
  "ログイン試行可能回数</dfn>"
472
 
473
+ #: admin/includes/tab-settings.php:329
474
  msgid "Select when to run the validation."
475
  msgstr "検証を実行するタイミングを選択します。"
476
 
477
+ #: admin/includes/tab-settings.php:329
478
  msgid "Validation timing"
479
  msgstr "検証のタイミング"
480
 
481
+ #: admin/includes/tab-settings.php:340
482
  msgid "&#8220;init&#8221; action hook"
483
  msgstr "&#8220;init&#8221; アクション・フック"
484
 
485
+ #: admin/includes/tab-settings.php:341
486
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
487
  msgstr "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
488
 
489
+ #: admin/includes/tab-settings.php:344
490
  msgid ""
491
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
492
  "plugins."
494
  "標準的な他のプラグインと同様、init アクション・フックのタイミングで検証を実行"
495
  "します。"
496
 
497
+ #: admin/includes/tab-settings.php:345
498
  msgid ""
499
  "Validate at an earlier phase than other typical plugins. It can reduce load "
500
+ "on server but has <a href='http://www.ipgeoblock.com/codex/validation-timing."
501
+ "html' title='Validation timing | IP Geo Block'>some restrictions</a>."
 
502
  msgstr ""
503
  "標準的な他のプラグインより早いタイミングで検証を実行します。これによりサー"
504
+ "バーの負荷は軽減されますが、<a href='http://www.ipgeoblock.com/codex/"
505
+ "validation-timing.html' title='Validation timing | IP Geo Block'>幾つかの制限"
506
+ "事項</a>が生じます。"
507
 
508
+ #: admin/includes/tab-settings.php:357
509
  msgid "Back-end target settings"
510
  msgstr "バックエンドの設定"
511
 
512
+ #: admin/includes/tab-settings.php:369
 
 
 
 
 
513
  msgid "Other areas"
514
  msgstr "その他のディレクトリ"
515
 
516
+ #: admin/includes/tab-settings.php:388 admin/includes/tab-settings.php:408
517
+ #: admin/includes/tab-settings.php:441 admin/includes/tab-settings.php:447
518
+ #: admin/includes/tab-settings.php:659
519
  msgid "Block by country"
520
  msgstr "国コードで遮断"
521
 
522
+ #: admin/includes/tab-settings.php:407 admin/includes/tab-settings.php:514
523
+ #: admin/includes/tab-settings.php:992
524
  msgid "Disable"
525
  msgstr "無効"
526
 
527
+ #: admin/includes/tab-settings.php:409
528
  msgid "Completely close"
529
  msgstr "完全に閉鎖"
530
 
531
+ #: admin/includes/tab-settings.php:442
532
  msgid ""
533
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
534
  "actions</dfn>"
535
  msgstr ""
536
  "<dfn title=\"遮断対象とするアクションを指定します。\">対象アクション</dfn>"
537
 
538
+ #: admin/includes/tab-settings.php:448
539
  msgid "Prevent Zero-day Exploit"
540
  msgstr "ゼロデイ攻撃を遮断"
541
 
542
+ #: admin/includes/tab-settings.php:452
543
  msgid ""
544
  "It will block a request related to the services for both public facing pages "
545
  "and the dashboard."
546
  msgstr ""
547
  "一般公開ページとダッシュボード向けサービスに関連するリクエストを遮断します。"
548
 
549
+ #: admin/includes/tab-settings.php:453
550
  msgid ""
551
  "Regardless of the country code, it will block a malicious request related to "
552
  "the services only for the dashboard."
554
  "国コードに拘らず、ダッシュボード向けサービスだけに関連する悪意のあるリクエス"
555
  "トを遮断します。"
556
 
557
+ #: admin/includes/tab-settings.php:480
558
  msgid "Admin ajax/post"
559
  msgstr "管理領域&thinsp;ajax/post"
560
 
561
+ #: admin/includes/tab-settings.php:500
562
+ msgid "Exception for admin action and page"
563
+ msgstr "管理者用アクションとページの例外"
 
 
 
 
564
 
565
+ #: admin/includes/tab-settings.php:516
566
  #, php-format
567
  msgid ""
568
  "Regardless of the country code, it will block a malicious request to <code>"
571
  "国コードに拘らず、<code>%s&hellip;/*.php</code>への悪意のあるリクエストを遮断"
572
  "します。"
573
 
574
+ #: admin/includes/tab-settings.php:517
575
  #, php-format
576
  msgid ""
577
+ "It configures &#8220%s&#8221 to validate a request to the PHP file which "
578
  "does not load WordPress core."
579
  msgstr ""
580
  "WordPressコアを読み込まないPHPファイルへのリクエストを検証対象とするため"
581
  "に、%s を設定します。"
582
 
583
+ #: admin/includes/tab-settings.php:518
584
  msgid ""
585
  "<dfn title=\"Select the item which causes undesired blocking in order to "
586
  "exclude from the validation target. Grayed item indicates &#8220;"
587
  "INACTIVE&#8221;.\">Exceptions</dfn>"
588
  msgstr ""
589
  "<dfn title=\"望ましくない遮断の原因となる項目を選択し、検証対象から除外しま"
590
+ "す。斜体で表示された項目は、「非アクティブ」であることを示しています。\">除外"
591
  "する項目</dfn>"
592
 
593
+ #: admin/includes/tab-settings.php:554 admin/includes/tab-settings.php:607
594
  msgid "Force to load WP core"
595
  msgstr "WPコアの読み込みを強制"
596
 
597
+ #: admin/includes/tab-settings.php:559
598
  msgid "Plugins area"
599
  msgstr "プラグイン領域"
600
 
601
+ #: admin/includes/tab-settings.php:612
602
  msgid "Themes area"
603
  msgstr "テーマ領域"
604
 
605
+ #: admin/includes/tab-settings.php:640
606
  msgid "Front-end target settings"
607
  msgstr "フロントエンドの設定"
608
 
609
+ #: admin/includes/tab-settings.php:664
610
  msgid "Follow &#8220;Validation rule settings&#8221;"
611
  msgstr "「検証ルールの設定」に従う"
612
 
613
+ #: admin/includes/tab-settings.php:721
614
  msgid ""
615
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
616
  msgstr "<dfn title=\"特定のページを遮断対象に指定します。\">ページ</dfn>"
617
 
618
+ #: admin/includes/tab-settings.php:733
619
  msgid ""
620
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
621
  "target.\">Post type</dfn>"
623
  "<dfn title=\"特定の投稿タイプのシングルページを遮断対象に指定します。\">投稿"
624
  "タイプ</dfn>"
625
 
626
+ #: admin/includes/tab-settings.php:745
627
  msgid ""
628
  "<dfn title=\"Specify the individual category on a single page or archive "
629
  "page as a blocking target.\">Category</dfn>"
631
  "<dfn title=\"特定のカテゴリを含むシングルページかアーカイブページを遮断対象に"
632
  "指定します。\">カテゴリ</dfn>"
633
 
634
+ #: admin/includes/tab-settings.php:757
635
  msgid ""
636
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
637
  "a blocking target.\">Tag</dfn>"
639
  "<dfn title=\"特定のタグを含むシングルページかアーカイブページを遮断対象に指定"
640
  "します。\">タグ</dfn>"
641
 
642
+ #: admin/includes/tab-settings.php:772
643
  msgid "Specify the validation target on front-end."
644
  msgstr "フロント・エンドの検証対象を設定します。"
645
 
646
+ #: admin/includes/tab-settings.php:772
647
  msgid "Validation target"
648
  msgstr "検証対象"
649
 
650
+ #: admin/includes/tab-settings.php:783
651
  msgid "All requests"
652
  msgstr "全てのリクエスト"
653
 
654
+ #: admin/includes/tab-settings.php:784
655
  msgid "Specify the targets"
656
  msgstr "ターゲットを指定"
657
 
658
+ #: admin/includes/tab-settings.php:787
659
  msgid ""
660
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
661
  "wp&#8221; action hook. It means that this feature would not be compatible "
664
  "「検証のタイミング」が &#8220;wp&#8221; アクション・フックまで遅延されます。"
665
  "これにより、ページ・キャッシュとの互換性がなくなることに注意してください。"
666
 
667
+ #: admin/includes/tab-settings.php:797
668
  msgid ""
669
  "A part of user agent string and a qualification connected with a separator "
670
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
678
  "国コード、または&nbsp;IPアドレス(CIDR記法)が使えます。また否定を表す記号"
679
  "「!」を「条件」の直前に配置する事が出来ます。"
680
 
681
+ #: admin/includes/tab-settings.php:797
682
  msgid "UA string and qualification"
683
  msgstr "ユーザーエージェント文字列と条件"
684
 
685
+ #: admin/includes/tab-settings.php:816
686
  msgid "Specify the name of action that is invariably blocked."
687
  msgstr "遮断されるアクション名を指定します。"
688
 
689
+ #: admin/includes/tab-settings.php:816
690
  msgid "Excluded actions"
691
  msgstr "除外するアクション"
692
 
693
+ #: admin/includes/tab-settings.php:835
694
  msgid ""
695
  "It enables to simulate validation without deployment. The results can be "
696
+ "found at &#8220;Pubic facing pages&#8221; in Logs."
697
  msgstr ""
698
  "機能を有効にする事なくリクエストの検証をシミュレートします。結果はログで確認"
699
  "する事が出来ます。"
700
 
701
+ #: admin/includes/tab-settings.php:835
702
  msgid "Simulation mode"
703
  msgstr "シミュレーション・モード"
704
 
705
+ #: admin/includes/tab-settings.php:854
706
  msgid "Geolocation API settings"
707
  msgstr "位置情報APIの設定"
708
 
709
+ #: admin/includes/tab-settings.php:863
710
  msgid ""
711
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
712
  "selection and key settings</dfn>"
714
  "<dfn title=\"キャッシュとローカルのデータベースが最優先で検索されます。\">API"
715
  "の選択とキーの設定</dfn>"
716
 
717
+ #: admin/includes/tab-settings.php:885
718
  #, php-format
719
  msgid ""
720
+ "Please download <a href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-"
721
+ "API/archive/master.zip\" title=\"Download the contents of tokkonopapa/"
722
+ "WordPress-IP-Geo-API as a zip file\">ZIP file</a> from <a href=\"https://"
723
+ "github.com/tokkonopapa/WordPress-IP-Geo-API\" title=\"tokkonopapa/WordPress-"
724
+ "IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a> and upload <code>ip-geo-api</"
725
+ "code> to <code>%s</code> with write permission."
726
  msgstr ""
727
+ "<a href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API\" title="
728
+ "\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a>から<a "
729
+ "href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API/archive/master.zip"
730
+ "\" title=\"Download the contents of tokkonopapa/WordPress-IP-Geo-API as a "
731
+ "zip file\">ZIPファイル</a>をダウンロードし、<code>ip-geo-api</code>を書き込み"
732
+ "権限付きで<code>%s</code>にアップロードして下さい。"
733
+
734
+ #: admin/includes/tab-settings.php:894
 
735
  msgid "Local database settings"
736
  msgstr "ローカル・データベースの設定"
737
 
738
+ #: admin/includes/tab-settings.php:909
739
  msgid "database"
740
  msgstr "ファイル"
741
 
742
+ #: admin/includes/tab-settings.php:910 classes/class-ip-geo-block-cron.php:306
743
  #, php-format
744
  msgid "Last update: %s"
745
  msgstr "最終更新:%s"
746
 
747
+ #: admin/includes/tab-settings.php:919
748
  msgid "Auto updating (once a month)"
749
  msgstr "自動更新(月1回)"
750
 
751
+ #: admin/includes/tab-settings.php:936
752
  msgid "Download database"
753
  msgstr "データベースのダウンロード"
754
 
755
+ #: admin/includes/tab-settings.php:944
756
  msgid "Download now"
757
  msgstr "今すぐダウンロード"
758
 
759
+ #: admin/includes/tab-settings.php:956
760
  msgid "Record settings"
761
  msgstr "記録の設定"
762
 
763
+ #: admin/includes/tab-settings.php:965
764
  msgid "Record validation statistics"
765
  msgstr "検証の統計を記録"
766
 
767
+ #: admin/includes/tab-settings.php:981
768
  msgid "Record validation logs"
769
  msgstr "検証のログを記録"
770
 
771
+ #: admin/includes/tab-settings.php:993
772
  msgid "Only when blocked"
773
  msgstr "遮断時に記録"
774
 
775
+ #: admin/includes/tab-settings.php:994
776
  msgid "Only when passed"
777
  msgstr "通過時に記録"
778
 
779
+ #: admin/includes/tab-settings.php:995
780
  msgid "Unauthenticated user"
781
  msgstr "未認証ユーザーを記録"
782
 
783
+ #: admin/includes/tab-settings.php:996
784
  msgid "Authenticated user"
785
  msgstr "認証済ユーザーを記録"
786
 
787
+ #: admin/includes/tab-settings.php:997
788
  msgid "All of validation"
789
  msgstr "すべての検証を記録"
790
 
791
+ #: admin/includes/tab-settings.php:1006
792
  msgid "Recording period of the logs (days)"
793
  msgstr "ログの記録期間(日)"
794
 
795
+ #: admin/includes/tab-settings.php:1022
796
  msgid "Maximum length of logs for each target"
797
  msgstr "ログの記録最大数"
798
 
799
+ #: admin/includes/tab-settings.php:1039
800
  msgid ""
801
  "<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be recorded "
802
  "with their values in logs</dfn>"
804
  "<dfn title=\"例)action, comment, log, pwd\">ログに記録する際に内容を展開する"
805
  "$_POSTのキー</dfn>"
806
 
807
+ #: admin/includes/tab-settings.php:1057
808
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
809
  msgstr "<dfn title=\"例)123.456.789.***\">IPアドレスを匿名化する</dfn>"
810
 
811
+ #: admin/includes/tab-settings.php:1075
812
  msgid "IP address cache settings"
813
  msgstr "IPアドレスのキャッシュ設定"
814
 
815
+ #: admin/includes/tab-settings.php:1084
816
  #, php-format
817
  msgid ""
818
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
822
  "<dfn title=\"ユーザ認証が連続%d回失敗した場合も、以降のログインがこの期間だけ"
823
  "(ガベージコレクション周期を含む)禁止されます。\">有効時間 [sec]</dfn>"
824
 
825
+ #: admin/includes/tab-settings.php:1100
826
  msgid "Garbage collection period [sec]"
827
  msgstr "ガベージコレクション周期 [秒]"
828
 
829
+ #: admin/includes/tab-settings.php:1117
830
  msgid "Number of entries to be displayed in cache"
831
  msgstr "「キャッシュ中のIPアドレス」に表示する最大数"
832
 
833
+ #: admin/includes/tab-settings.php:1136
834
  msgid "Submission settings"
835
  msgstr "投稿時の設定"
836
 
837
+ #: admin/includes/tab-settings.php:1148
838
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
839
  msgstr "全体が&lt;p&gt;タグで囲われます。使用可能タグ:"
840
 
841
+ #: admin/includes/tab-settings.php:1148
842
  msgid "Message on comment form"
843
  msgstr "投稿フォーム上のメッセージ"
844
 
845
+ #: admin/includes/tab-settings.php:1160
846
  msgid "None"
847
  msgstr "なし"
848
 
849
+ #: admin/includes/tab-settings.php:1161
850
  msgid "Top"
851
  msgstr "上部"
852
 
853
+ #: admin/includes/tab-settings.php:1162
854
  msgid "Bottom"
855
  msgstr "下部"
856
 
857
+ #: admin/includes/tab-settings.php:1174
858
  msgid "Plugin settings"
859
  msgstr "プラグインの設定"
860
 
861
+ #: admin/includes/tab-settings.php:1183
862
  msgid "Remove all settings at uninstallation"
863
  msgstr "アンインストール時に全設定を削除"
864
 
865
+ #: admin/includes/tab-settings.php:1201
866
  msgid ""
867
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
868
  "dfn>"
870
  "<dfn title=\"Google Maps JavaScript API に有効なキー\">Google Maps API キー</"
871
  "dfn>"
872
 
873
+ #: admin/includes/tab-settings.php:1215
874
  msgid ""
875
  "You need to click the &#8220;Save Changes&#8221; button for imported "
876
  "settings to take effect."
878
  "インポートされた設定を有効にするには、「変更を保存」ボタンをクリックする必要"
879
  "があります。"
880
 
881
+ #: admin/includes/tab-settings.php:1221
882
  msgid "Export / Import settings"
883
  msgstr "設定のエクスポート、インポート"
884
 
885
+ #: admin/includes/tab-settings.php:1228
886
  msgid "Export settings"
887
  msgstr "エクスポート"
888
 
889
+ #: admin/includes/tab-settings.php:1229
890
  msgid "Import from the local file"
891
  msgstr "ローカル・ファイルからインポートします"
892
 
893
+ #: admin/includes/tab-settings.php:1229
894
  msgid "Import settings"
895
  msgstr "インポート"
896
 
897
+ #: admin/includes/tab-settings.php:1238
898
  msgid "Import pre-defined settings"
899
  msgstr "プリセットのインポート"
900
 
901
+ #: admin/includes/tab-settings.php:1245
902
  msgid ""
903
  "Import the default settings to revert to the &#8220;Right after "
904
  "installing&#8221; state"
905
  msgstr "インストール直後の状態に戻すための設定値をインポートします"
906
 
907
+ #: admin/includes/tab-settings.php:1245
908
  msgid "Default settings"
909
  msgstr "初期設定"
910
 
911
+ #: admin/includes/tab-settings.php:1246
912
  msgid ""
913
  "Import the preferred settings mainly for the &#8220;Validation target "
914
  "settings&#8221;"
915
  msgstr "主に「検証対象の設定」に関する推奨の設定値をインポートします"
916
 
917
+ #: admin/includes/tab-settings.php:1246
918
+ msgid "Best practice"
919
+ msgstr "ベスト・プラクティス"
920
 
921
+ #: admin/includes/tab-settings.php:1256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
922
  msgid "Delete DB table for validation logs"
923
  msgstr "検証のログ用データベース・テーブルの削除"
924
 
925
+ #: admin/includes/tab-settings.php:1264
926
  msgid "Delete now"
927
  msgstr "今すぐ削除"
928
 
929
+ #: admin/includes/tab-settings.php:1272
930
  msgid "Create DB table for validation logs"
931
  msgstr "検証のログ用データベース・テーブルの作成"
932
 
933
+ #: admin/includes/tab-settings.php:1280
934
  msgid "Create now"
935
  msgstr "今すぐ作成"
936
 
937
+ #: admin/includes/tab-settings.php:1295
938
  msgid ""
939
+ "To enhance the protection ability, please refer to &#8220;<a href=\"http://"
940
+ "www.ipgeoblock.com/codex/the-best-practice-of-target-settings.html\" title="
941
+ "\"The best practice of target settings | IP Geo Block\">The best practice of "
942
+ "target settings</a>&#8221;."
943
  msgstr ""
944
+ "防御性能をより高めるための設定については、&#8220;<a href=\"http://www."
945
+ "ipgeoblock.com/codex/the-best-practice-of-target-settings.html\" title=\"The "
946
+ "best practice of target settings | IP Geo Block\">The best practice of "
947
+ "target settings</a>&#8220;&thinsp;を参照してください。"
948
 
949
+ #: admin/includes/tab-settings.php:1296
950
  msgid ""
951
+ "If you have any troubles with these, please open an issue at <a class=\"ip-"
952
+ "geo-block-link\" href=\"http://wordpress.org/support/plugin/ip-geo-block\" "
953
+ "title=\"WordPress &#8250; Support &raquo; IP Geo Block\" "
954
+ "target=_blank>support forum</a>."
 
955
  msgstr ""
956
+ "何か問題が発生した場合は、<a class=\"ip-geo-block-link\" href=\"http://"
957
+ "wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress &#8250; "
958
+ "Support &raquo; IP Geo Block\" target=_blank>サポート・フォーラム</a>へご報告"
959
+ "ください。"
 
960
 
961
+ #: admin/includes/tab-settings.php:1303
962
  msgid ""
963
  "While Maxmind and IP2Location will fetch the local database, others will "
964
  "pass an IP address to the APIs via HTTP."
966
  "MaxmindとIP2Locationはローカルのデータベースを検索しますが、他はHTTPを介して"
967
  "APIにIPアドレスを渡します。"
968
 
969
+ #: admin/includes/tab-settings.php:1304
970
  msgid ""
971
  "Please select the appropriate APIs to fit the privacy law in your country."
972
  msgstr "自国のプライバシー関連法規に合わせ、適切なAPIを選択して下さい。"
973
 
974
+ #: admin/includes/tab-settings.php:1311
975
  msgid ""
976
+ "Please refer to the document &#8220;<a href=\"http://www.ipgeoblock.com/"
977
+ "codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block\" "
978
+ "target=_blank>Blocking on front-end</a>&#8221; for details, including "
979
+ "restrictions on cache plugin."
980
  msgstr ""
981
+ "キャッシュ・プラグインに関する制限事項を含め、詳しくはドキュメント <a href="
982
+ "\"http://www.ipgeoblock.com/codex/#blocking-on-front-end\">Blocking on front-"
983
+ "end</a> を参照してください。"
 
984
 
985
+ #: admin/includes/tab-settings.php:1312
986
  msgid ""
987
  "If you find any issues or have something to suggest, please feel free to "
988
+ "open an issue at <a class=\"ip-geo-block-link\" href=\"http://wordpress.org/"
989
+ "support/plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP "
990
+ "Geo Block\" target=_blank>support forum</a>."
991
  msgstr ""
992
+ "問題を発見したり改善の提案がある場合は、お気軽に <a class=\"ip-geo-block-link"
993
+ "\" href=\"http://wordpress.org/support/plugin/ip-geo-block\" title="
994
+ "\"WordPress &#8250; Support &raquo; IP Geo Block\" target=_blank>サポート・"
995
+ "フォーラム</a> に投稿をお願いします。"
996
 
997
  #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:184
998
  msgid "Statistics of validation"
1076
  "少なくとも1つ以上の位置情報サービスを選択して下さい。未選択の場合、キャッシュ"
1077
  "の有効期限切れと共にロックアウトされます。"
1078
 
1079
+ #: classes/class-ip-geo-block-cron.php:224
1080
  msgid "Your database file is up-to-date."
1081
  msgstr "データベース・ファイルは最新です。"
1082
 
1083
+ #: classes/class-ip-geo-block-cron.php:253
 
1084
  #, php-format
1085
  msgid "Unable to read %s. Please check the permission."
1086
+ msgstr "%sが読めません。パーミッションを確認して下さい。"
 
 
 
 
 
 
1087
 
1088
+ #: classes/class-ip-geo-block-logs.php:131
1089
  #, php-format
1090
  msgid ""
1091
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1092
  "activate again."
1093
  msgstr ""
1094
+ "%s用のテーブルが作成されていません。一旦このプラグインを無効化し、再度有効化"
1095
  "して下さい。"
1096
 
1097
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:145
1098
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:174
1099
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:149
1100
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:178
1101
  msgid "Database file does not exist."
languages/ip-geo-block.mo CHANGED
Binary file
languages/ip-geo-block.po CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: IP Geo Block 3.0.1.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
- "POT-Creation-Date: 2017-02-20 05:54+0900\n"
8
- "PO-Revision-Date: 2017-02-20 05:56+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -25,53 +25,53 @@ msgid ""
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
- #: admin/class-ip-geo-block-admin.php:160
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
- #: admin/class-ip-geo-block-admin.php:161
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
- #: admin/class-ip-geo-block-admin.php:162
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
- #: admin/class-ip-geo-block-admin.php:163
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
- #: admin/class-ip-geo-block-admin.php:164
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
- #: admin/class-ip-geo-block-admin.php:165
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
- #: admin/class-ip-geo-block-admin.php:166
53
  msgid "This feature is available with HTML5 compliant browsers."
54
  msgstr ""
55
 
56
- #: admin/class-ip-geo-block-admin.php:193
57
  msgid "Contribute at GitHub"
58
  msgstr ""
59
 
60
- #: admin/class-ip-geo-block-admin.php:210
61
- #: admin/class-ip-geo-block-admin.php:390
62
  msgid "Settings"
63
  msgstr ""
64
 
65
- #: admin/class-ip-geo-block-admin.php:265
66
- #: admin/class-ip-geo-block-admin.php:266
67
  msgid "IP Geo Block"
68
  msgstr ""
69
 
70
- #: admin/class-ip-geo-block-admin.php:284
71
  msgid "You need WordPress 3.7+."
72
  msgstr ""
73
 
74
- #: admin/class-ip-geo-block-admin.php:293
75
  #, php-format
76
  msgid ""
77
  "Now downloading geolocation databases in background. After a little while, "
@@ -79,96 +79,82 @@ msgid ""
79
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
80
  msgstr ""
81
 
82
- #: admin/class-ip-geo-block-admin.php:299
83
  #, php-format
84
  msgid ""
85
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
86
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
87
  msgstr ""
88
 
89
- #: admin/class-ip-geo-block-admin.php:308
90
  msgid "Local database and matching rule have been updated."
91
  msgstr ""
92
 
93
- #: admin/class-ip-geo-block-admin.php:319
94
- msgid ""
95
- "Once you logout, you will be unable to login again because the number of "
96
- "login attempts reaches the limit."
97
- msgstr ""
98
-
99
- #: admin/class-ip-geo-block-admin.php:321
100
- #, php-format
101
- msgid ""
102
- "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
103
- "tab</a> to prevent locking yourself out."
104
- msgstr ""
105
-
106
- #: admin/class-ip-geo-block-admin.php:331
107
  msgid ""
108
  "Once you logout, you will be unable to login again because your country code "
109
  "or IP address is in the blacklist."
110
  msgstr ""
111
 
112
- #: admin/class-ip-geo-block-admin.php:332
113
  msgid ""
114
  "Once you logout, you will be unable to login again because your country code "
115
  "or IP address is not in the whitelist."
116
  msgstr ""
117
 
118
- #: admin/class-ip-geo-block-admin.php:335
119
  #, php-format
120
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
121
  msgstr ""
122
 
123
- #: admin/class-ip-geo-block-admin.php:391
124
  msgid "Statistics"
125
  msgstr ""
126
 
127
- #: admin/class-ip-geo-block-admin.php:392
128
  msgid "Logs"
129
  msgstr ""
130
 
131
- #: admin/class-ip-geo-block-admin.php:393
132
  msgid "Search"
133
  msgstr ""
134
 
135
- #: admin/class-ip-geo-block-admin.php:394
136
  msgid "Attribution"
137
  msgstr ""
138
 
139
- #: admin/class-ip-geo-block-admin.php:405
140
  msgid "Toggle all"
141
  msgstr ""
142
 
143
- #: admin/class-ip-geo-block-admin.php:429
144
  msgid "Thanks for providing these great services for free."
145
  msgstr ""
146
 
147
- #: admin/class-ip-geo-block-admin.php:430
148
  msgid ""
149
  "(Most browsers will redirect you to each site <a href=\"http://www."
150
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
151
  "when you click the link</a>.)"
152
  msgstr ""
153
 
154
- #: admin/class-ip-geo-block-admin.php:435
155
  msgid "Back to top"
156
  msgstr ""
157
 
158
- #: admin/class-ip-geo-block-admin.php:527
159
  msgid "Enable"
160
  msgstr ""
161
 
162
- #: admin/class-ip-geo-block-admin.php:840
163
- #: admin/class-ip-geo-block-admin.php:851
164
- #: classes/class-ip-geo-block-cron.php:260
165
- #: classes/class-ip-geo-block-cron.php:294
166
- #: classes/class-ip-geo-block-opts.php:313
167
  #, php-format
168
  msgid "Unable to write %s. Please check the permission."
169
  msgstr ""
170
 
171
- #: admin/class-ip-geo-block-admin.php:841
172
  #, php-format
173
  msgid "Or please refer to %s to set it manually."
174
  msgid_plural "Or please refer to %s to set them manually."
@@ -208,7 +194,7 @@ msgstr ""
208
  msgid "Export logs"
209
  msgstr ""
210
 
211
- #: admin/includes/tab-accesslog.php:69 admin/includes/tab-settings.php:1230
212
  msgid "Export to the local file"
213
  msgstr ""
214
 
@@ -216,33 +202,29 @@ msgstr ""
216
  msgid "Export csv"
217
  msgstr ""
218
 
219
- #: admin/includes/tab-accesslog.php:109
220
  #, php-format
221
- msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
222
  msgstr ""
223
 
224
- #: admin/includes/tab-accesslog.php:111 admin/includes/tab-settings.php:366
225
  msgid "Comment post"
226
  msgstr ""
227
 
228
- #: admin/includes/tab-accesslog.php:112 admin/includes/tab-settings.php:367
229
  msgid "XML-RPC"
230
  msgstr ""
231
 
232
- #: admin/includes/tab-accesslog.php:113 admin/includes/tab-settings.php:368
233
  msgid "Login form"
234
  msgstr ""
235
 
236
- #: admin/includes/tab-accesslog.php:114 admin/includes/tab-settings.php:369
237
  msgid "Admin area"
238
  msgstr ""
239
 
240
- #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:371
241
- msgid "public facing pages"
242
- msgstr ""
243
-
244
- #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:371
245
- msgid "Public facing pages"
246
  msgstr ""
247
 
248
  #: admin/includes/tab-accesslog.php:121
@@ -363,7 +345,7 @@ msgstr ""
363
  msgid "(comma or RET separated)"
364
  msgstr ""
365
 
366
- #: admin/includes/tab-settings.php:107 admin/includes/tab-settings.php:673
367
  msgid "Matching rule"
368
  msgstr ""
369
 
@@ -416,7 +398,7 @@ msgid ""
416
  "directory.\">Response code</dfn> %s"
417
  msgstr ""
418
 
419
- #: admin/includes/tab-settings.php:269
420
  msgid ""
421
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. Front-end URL on "
422
  "your site would not be blocked to prevent loop of redirection even when you "
@@ -424,197 +406,189 @@ msgid ""
424
  "\">Redirect URL</dfn>"
425
  msgstr ""
426
 
427
- #: admin/includes/tab-settings.php:286
428
  msgid ""
429
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
430
  "message</dfn>"
431
  msgstr ""
432
 
433
- #: admin/includes/tab-settings.php:303
434
  msgid ""
435
  "<dfn title=\"Applied to &#8220;XML-RPC&#8221; and &#8220;Login form&#8221;. "
436
  "Lockout period is defined as expiration time at &#8220;Cache settings&#8221;."
437
  "\">Max number of failed login attempts per IP address</dfn>"
438
  msgstr ""
439
 
440
- #: admin/includes/tab-settings.php:330
441
  msgid "Select when to run the validation."
442
  msgstr ""
443
 
444
- #: admin/includes/tab-settings.php:330
445
  msgid "Validation timing"
446
  msgstr ""
447
 
448
- #: admin/includes/tab-settings.php:341
449
  msgid "&#8220;init&#8221; action hook"
450
  msgstr ""
451
 
452
- #: admin/includes/tab-settings.php:342
453
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
454
  msgstr ""
455
 
456
- #: admin/includes/tab-settings.php:345
457
  msgid ""
458
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
459
  "plugins."
460
  msgstr ""
461
 
462
- #: admin/includes/tab-settings.php:346
463
  msgid ""
464
  "Validate at an earlier phase than other typical plugins. It can reduce load "
465
- "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
466
- "validation-timing.html' title='Validation timing | IP Geo Block'>some "
467
- "restrictions</a>."
468
  msgstr ""
469
 
470
- #: admin/includes/tab-settings.php:358
471
  msgid "Back-end target settings"
472
  msgstr ""
473
 
474
- #: admin/includes/tab-settings.php:364
475
- #, php-format
476
- msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
477
- msgstr ""
478
-
479
- #: admin/includes/tab-settings.php:370
480
  msgid "Other areas"
481
  msgstr ""
482
 
483
- #: admin/includes/tab-settings.php:389 admin/includes/tab-settings.php:409
484
- #: admin/includes/tab-settings.php:442 admin/includes/tab-settings.php:448
485
- #: admin/includes/tab-settings.php:661
486
  msgid "Block by country"
487
  msgstr ""
488
 
489
- #: admin/includes/tab-settings.php:408 admin/includes/tab-settings.php:516
490
- #: admin/includes/tab-settings.php:994
491
  msgid "Disable"
492
  msgstr ""
493
 
494
- #: admin/includes/tab-settings.php:410
495
  msgid "Completely close"
496
  msgstr ""
497
 
498
- #: admin/includes/tab-settings.php:443
499
  msgid ""
500
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
501
  "actions</dfn>"
502
  msgstr ""
503
 
504
- #: admin/includes/tab-settings.php:449
505
  msgid "Prevent Zero-day Exploit"
506
  msgstr ""
507
 
508
- #: admin/includes/tab-settings.php:453
509
  msgid ""
510
  "It will block a request related to the services for both public facing pages "
511
  "and the dashboard."
512
  msgstr ""
513
 
514
- #: admin/includes/tab-settings.php:454
515
  msgid ""
516
  "Regardless of the country code, it will block a malicious request related to "
517
  "the services only for the dashboard."
518
  msgstr ""
519
 
520
- #: admin/includes/tab-settings.php:481
521
  msgid "Admin ajax/post"
522
  msgstr ""
523
 
524
- #: admin/includes/tab-settings.php:501
525
- msgid ""
526
- "<dfn title=\"Same effect as &#8220;ip-geo-block-bypass-admins&#8221; filter "
527
- "hook.\">Exception for admin action and page</dfn>"
528
  msgstr ""
529
 
530
- #: admin/includes/tab-settings.php:518
531
  #, php-format
532
  msgid ""
533
  "Regardless of the country code, it will block a malicious request to <code>"
534
  "%s&hellip;/*.php</code>."
535
  msgstr ""
536
 
537
- #: admin/includes/tab-settings.php:519
538
  #, php-format
539
  msgid ""
540
- "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
541
  "does not load WordPress core."
542
  msgstr ""
543
 
544
- #: admin/includes/tab-settings.php:520
545
  msgid ""
546
  "<dfn title=\"Select the item which causes undesired blocking in order to "
547
  "exclude from the validation target. Grayed item indicates &#8220;"
548
  "INACTIVE&#8221;.\">Exceptions</dfn>"
549
  msgstr ""
550
 
551
- #: admin/includes/tab-settings.php:556 admin/includes/tab-settings.php:609
552
  msgid "Force to load WP core"
553
  msgstr ""
554
 
555
- #: admin/includes/tab-settings.php:561
556
  msgid "Plugins area"
557
  msgstr ""
558
 
559
- #: admin/includes/tab-settings.php:614
560
  msgid "Themes area"
561
  msgstr ""
562
 
563
- #: admin/includes/tab-settings.php:642
564
  msgid "Front-end target settings"
565
  msgstr ""
566
 
567
- #: admin/includes/tab-settings.php:666
568
  msgid "Follow &#8220;Validation rule settings&#8221;"
569
  msgstr ""
570
 
571
- #: admin/includes/tab-settings.php:723
572
  msgid ""
573
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
574
  msgstr ""
575
 
576
- #: admin/includes/tab-settings.php:735
577
  msgid ""
578
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
579
  "target.\">Post type</dfn>"
580
  msgstr ""
581
 
582
- #: admin/includes/tab-settings.php:747
583
  msgid ""
584
  "<dfn title=\"Specify the individual category on a single page or archive "
585
  "page as a blocking target.\">Category</dfn>"
586
  msgstr ""
587
 
588
- #: admin/includes/tab-settings.php:759
589
  msgid ""
590
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
591
  "a blocking target.\">Tag</dfn>"
592
  msgstr ""
593
 
594
- #: admin/includes/tab-settings.php:774
595
  msgid "Specify the validation target on front-end."
596
  msgstr ""
597
 
598
- #: admin/includes/tab-settings.php:774
599
  msgid "Validation target"
600
  msgstr ""
601
 
602
- #: admin/includes/tab-settings.php:785
603
  msgid "All requests"
604
  msgstr ""
605
 
606
- #: admin/includes/tab-settings.php:786
607
  msgid "Specify the targets"
608
  msgstr ""
609
 
610
- #: admin/includes/tab-settings.php:789
611
  msgid ""
612
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
613
  "wp&#8221; action hook. It means that this feature would not be compatible "
614
  "with any page caching."
615
  msgstr ""
616
 
617
- #: admin/includes/tab-settings.php:799
618
  msgid ""
619
  "A part of user agent string and a qualification connected with a separator "
620
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
@@ -624,129 +598,129 @@ msgid ""
624
  "qualification&#8221;."
625
  msgstr ""
626
 
627
- #: admin/includes/tab-settings.php:799
628
  msgid "UA string and qualification"
629
  msgstr ""
630
 
631
- #: admin/includes/tab-settings.php:818
632
  msgid "Specify the name of action that is invariably blocked."
633
  msgstr ""
634
 
635
- #: admin/includes/tab-settings.php:818
636
  msgid "Excluded actions"
637
  msgstr ""
638
 
639
- #: admin/includes/tab-settings.php:837
640
  msgid ""
641
  "It enables to simulate validation without deployment. The results can be "
642
- "found at &#8220;Public facing pages&#8221; in Logs."
643
  msgstr ""
644
 
645
- #: admin/includes/tab-settings.php:837
646
  msgid "Simulation mode"
647
  msgstr ""
648
 
649
- #: admin/includes/tab-settings.php:856
650
  msgid "Geolocation API settings"
651
  msgstr ""
652
 
653
- #: admin/includes/tab-settings.php:865
654
  msgid ""
655
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
656
  "selection and key settings</dfn>"
657
  msgstr ""
658
 
659
- #: admin/includes/tab-settings.php:887
660
  #, php-format
661
  msgid ""
662
- "Please download <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/"
663
- "WordPress-IP-Geo-API/archive/master.zip\" title=\"Download the contents of "
664
- "tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> from <a rel="
665
- "\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API\" "
666
- "title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a> "
667
- "and upload <code>ip-geo-api</code> to <code>%s</code> with write permission."
668
  msgstr ""
669
 
670
- #: admin/includes/tab-settings.php:896
671
  msgid "Local database settings"
672
  msgstr ""
673
 
674
- #: admin/includes/tab-settings.php:911
675
  msgid "database"
676
  msgstr ""
677
 
678
- #: admin/includes/tab-settings.php:912 classes/class-ip-geo-block-cron.php:342
679
  #, php-format
680
  msgid "Last update: %s"
681
  msgstr ""
682
 
683
- #: admin/includes/tab-settings.php:921
684
  msgid "Auto updating (once a month)"
685
  msgstr ""
686
 
687
- #: admin/includes/tab-settings.php:938
688
  msgid "Download database"
689
  msgstr ""
690
 
691
- #: admin/includes/tab-settings.php:946
692
  msgid "Download now"
693
  msgstr ""
694
 
695
- #: admin/includes/tab-settings.php:958
696
  msgid "Record settings"
697
  msgstr ""
698
 
699
- #: admin/includes/tab-settings.php:967
700
  msgid "Record validation statistics"
701
  msgstr ""
702
 
703
- #: admin/includes/tab-settings.php:983
704
  msgid "Record validation logs"
705
  msgstr ""
706
 
707
- #: admin/includes/tab-settings.php:995
708
  msgid "Only when blocked"
709
  msgstr ""
710
 
711
- #: admin/includes/tab-settings.php:996
712
  msgid "Only when passed"
713
  msgstr ""
714
 
715
- #: admin/includes/tab-settings.php:997
716
  msgid "Unauthenticated user"
717
  msgstr ""
718
 
719
- #: admin/includes/tab-settings.php:998
720
  msgid "Authenticated user"
721
  msgstr ""
722
 
723
- #: admin/includes/tab-settings.php:999
724
  msgid "All of validation"
725
  msgstr ""
726
 
727
- #: admin/includes/tab-settings.php:1008
728
  msgid "Recording period of the logs (days)"
729
  msgstr ""
730
 
731
- #: admin/includes/tab-settings.php:1024
732
  msgid "Maximum length of logs for each target"
733
  msgstr ""
734
 
735
- #: admin/includes/tab-settings.php:1041
736
  msgid ""
737
  "<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be recorded "
738
  "with their values in logs</dfn>"
739
  msgstr ""
740
 
741
- #: admin/includes/tab-settings.php:1059
742
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
743
  msgstr ""
744
 
745
- #: admin/includes/tab-settings.php:1077
746
  msgid "IP address cache settings"
747
  msgstr ""
748
 
749
- #: admin/includes/tab-settings.php:1086
750
  #, php-format
751
  msgid ""
752
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
@@ -754,172 +728,155 @@ msgid ""
754
  "\">Expiration time [sec]</dfn>"
755
  msgstr ""
756
 
757
- #: admin/includes/tab-settings.php:1102
758
  msgid "Garbage collection period [sec]"
759
  msgstr ""
760
 
761
- #: admin/includes/tab-settings.php:1119
762
  msgid "Number of entries to be displayed in cache"
763
  msgstr ""
764
 
765
- #: admin/includes/tab-settings.php:1138
766
  msgid "Submission settings"
767
  msgstr ""
768
 
769
- #: admin/includes/tab-settings.php:1150
770
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
771
  msgstr ""
772
 
773
- #: admin/includes/tab-settings.php:1150
774
  msgid "Message on comment form"
775
  msgstr ""
776
 
777
- #: admin/includes/tab-settings.php:1162
778
  msgid "None"
779
  msgstr ""
780
 
781
- #: admin/includes/tab-settings.php:1163
782
  msgid "Top"
783
  msgstr ""
784
 
785
- #: admin/includes/tab-settings.php:1164
786
  msgid "Bottom"
787
  msgstr ""
788
 
789
- #: admin/includes/tab-settings.php:1176
790
  msgid "Plugin settings"
791
  msgstr ""
792
 
793
- #: admin/includes/tab-settings.php:1185
794
  msgid "Remove all settings at uninstallation"
795
  msgstr ""
796
 
797
- #: admin/includes/tab-settings.php:1203
798
  msgid ""
799
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
800
  "dfn>"
801
  msgstr ""
802
 
803
- #: admin/includes/tab-settings.php:1217
804
  msgid ""
805
  "You need to click the &#8220;Save Changes&#8221; button for imported "
806
  "settings to take effect."
807
  msgstr ""
808
 
809
- #: admin/includes/tab-settings.php:1223
810
  msgid "Export / Import settings"
811
  msgstr ""
812
 
813
- #: admin/includes/tab-settings.php:1230
814
  msgid "Export settings"
815
  msgstr ""
816
 
817
- #: admin/includes/tab-settings.php:1231
818
  msgid "Import from the local file"
819
  msgstr ""
820
 
821
- #: admin/includes/tab-settings.php:1231
822
  msgid "Import settings"
823
  msgstr ""
824
 
825
- #: admin/includes/tab-settings.php:1240
826
  msgid "Import pre-defined settings"
827
  msgstr ""
828
 
829
- #: admin/includes/tab-settings.php:1247
830
  msgid ""
831
  "Import the default settings to revert to the &#8220;Right after "
832
  "installing&#8221; state"
833
  msgstr ""
834
 
835
- #: admin/includes/tab-settings.php:1247
836
  msgid "Default settings"
837
  msgstr ""
838
 
839
- #: admin/includes/tab-settings.php:1248
840
  msgid ""
841
  "Import the preferred settings mainly for the &#8220;Validation target "
842
  "settings&#8221;"
843
  msgstr ""
844
 
845
- #: admin/includes/tab-settings.php:1248
846
- msgid "Best settings"
847
- msgstr ""
848
-
849
- #: admin/includes/tab-settings.php:1257
850
- msgid ""
851
- "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
852
- "forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
853
- "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
854
- "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
855
- msgstr ""
856
-
857
- #: admin/includes/tab-settings.php:1264
858
- msgid "Show PHP, WordPress, theme and plugins information."
859
  msgstr ""
860
 
861
- #: admin/includes/tab-settings.php:1264
862
- msgid "Show information"
863
- msgstr ""
864
-
865
- #: admin/includes/tab-settings.php:1274
866
  msgid "Delete DB table for validation logs"
867
  msgstr ""
868
 
869
- #: admin/includes/tab-settings.php:1282
870
  msgid "Delete now"
871
  msgstr ""
872
 
873
- #: admin/includes/tab-settings.php:1290
874
  msgid "Create DB table for validation logs"
875
  msgstr ""
876
 
877
- #: admin/includes/tab-settings.php:1298
878
  msgid "Create now"
879
  msgstr ""
880
 
881
- #: admin/includes/tab-settings.php:1313
882
  msgid ""
883
- "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
884
- "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
885
- "settings.html\" title=\"The best practice for target settings | IP Geo Block"
886
- "\">The best practice for target settings</a>&#8221;."
887
  msgstr ""
888
 
889
- #: admin/includes/tab-settings.php:1314
890
  msgid ""
891
- "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
892
- "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
893
- "Block &mdash; WordPress Plugins\">WordPress.org</a> and <a rel=\"noreferrer"
894
- "\" href=\"http://www.ipgeoblock.com/codex/#faq\" title=\"Codex | IP Geo Block"
895
- "\">Codex</a>."
896
  msgstr ""
897
 
898
- #: admin/includes/tab-settings.php:1321
899
  msgid ""
900
  "While Maxmind and IP2Location will fetch the local database, others will "
901
  "pass an IP address to the APIs via HTTP."
902
  msgstr ""
903
 
904
- #: admin/includes/tab-settings.php:1322
905
  msgid ""
906
  "Please select the appropriate APIs to fit the privacy law in your country."
907
  msgstr ""
908
 
909
- #: admin/includes/tab-settings.php:1329
910
  msgid ""
911
- "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
912
- "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
913
- "\">Blocking on front-end</a>&#8221; for details, including restrictions on "
914
- "cache plugin."
915
  msgstr ""
916
 
917
- #: admin/includes/tab-settings.php:1330
918
  msgid ""
919
  "If you find any issues or have something to suggest, please feel free to "
920
- "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
921
- "plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP Geo Block"
922
- "\">support forum</a>."
923
  msgstr ""
924
 
925
  #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:184
@@ -1000,31 +957,24 @@ msgid ""
1000
  "<strong>you'll be blocked</strong> after the cache expires."
1001
  msgstr ""
1002
 
1003
- #: classes/class-ip-geo-block-cron.php:227
1004
  msgid "Your database file is up-to-date."
1005
  msgstr ""
1006
 
1007
- #: classes/class-ip-geo-block-cron.php:255
1008
- #: classes/class-ip-geo-block-cron.php:289
1009
  #, php-format
1010
  msgid "Unable to read %s. Please check the permission."
1011
  msgstr ""
1012
 
1013
- #: classes/class-ip-geo-block-cron.php:265
1014
- #: classes/class-ip-geo-block-cron.php:299
1015
- #, php-format
1016
- msgid "Can't lock %s. Please try again after a while."
1017
- msgstr ""
1018
-
1019
- #: classes/class-ip-geo-block-logs.php:149
1020
  #, php-format
1021
  msgid ""
1022
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1023
  "activate again."
1024
  msgstr ""
1025
 
1026
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:147
1027
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:176
1028
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:149
1029
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:178
1030
  msgid "Database file does not exist."
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: IP Geo Block 3.0.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
+ "POT-Creation-Date: 2016-12-05 21:17+0900\n"
8
+ "PO-Revision-Date: 2016-12-05 21:18+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
+ #: admin/class-ip-geo-block-admin.php:161
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
+ #: admin/class-ip-geo-block-admin.php:162
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
+ #: admin/class-ip-geo-block-admin.php:163
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
+ #: admin/class-ip-geo-block-admin.php:164
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
+ #: admin/class-ip-geo-block-admin.php:165
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
+ #: admin/class-ip-geo-block-admin.php:166
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
+ #: admin/class-ip-geo-block-admin.php:167
53
  msgid "This feature is available with HTML5 compliant browsers."
54
  msgstr ""
55
 
56
+ #: admin/class-ip-geo-block-admin.php:194
57
  msgid "Contribute at GitHub"
58
  msgstr ""
59
 
60
+ #: admin/class-ip-geo-block-admin.php:211
61
+ #: admin/class-ip-geo-block-admin.php:365
62
  msgid "Settings"
63
  msgstr ""
64
 
65
+ #: admin/class-ip-geo-block-admin.php:257
66
+ #: admin/class-ip-geo-block-admin.php:258
67
  msgid "IP Geo Block"
68
  msgstr ""
69
 
70
+ #: admin/class-ip-geo-block-admin.php:279
71
  msgid "You need WordPress 3.7+."
72
  msgstr ""
73
 
74
+ #: admin/class-ip-geo-block-admin.php:287
75
  #, php-format
76
  msgid ""
77
  "Now downloading geolocation databases in background. After a little while, "
79
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
80
  msgstr ""
81
 
82
+ #: admin/class-ip-geo-block-admin.php:293
83
  #, php-format
84
  msgid ""
85
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
86
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
87
  msgstr ""
88
 
89
+ #: admin/class-ip-geo-block-admin.php:302
90
  msgid "Local database and matching rule have been updated."
91
  msgstr ""
92
 
93
+ #: admin/class-ip-geo-block-admin.php:313
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  msgid ""
95
  "Once you logout, you will be unable to login again because your country code "
96
  "or IP address is in the blacklist."
97
  msgstr ""
98
 
99
+ #: admin/class-ip-geo-block-admin.php:314
100
  msgid ""
101
  "Once you logout, you will be unable to login again because your country code "
102
  "or IP address is not in the whitelist."
103
  msgstr ""
104
 
105
+ #: admin/class-ip-geo-block-admin.php:317
106
  #, php-format
107
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
108
  msgstr ""
109
 
110
+ #: admin/class-ip-geo-block-admin.php:366
111
  msgid "Statistics"
112
  msgstr ""
113
 
114
+ #: admin/class-ip-geo-block-admin.php:367
115
  msgid "Logs"
116
  msgstr ""
117
 
118
+ #: admin/class-ip-geo-block-admin.php:368
119
  msgid "Search"
120
  msgstr ""
121
 
122
+ #: admin/class-ip-geo-block-admin.php:369
123
  msgid "Attribution"
124
  msgstr ""
125
 
126
+ #: admin/class-ip-geo-block-admin.php:381
127
  msgid "Toggle all"
128
  msgstr ""
129
 
130
+ #: admin/class-ip-geo-block-admin.php:405
131
  msgid "Thanks for providing these great services for free."
132
  msgstr ""
133
 
134
+ #: admin/class-ip-geo-block-admin.php:406
135
  msgid ""
136
  "(Most browsers will redirect you to each site <a href=\"http://www."
137
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
138
  "when you click the link</a>.)"
139
  msgstr ""
140
 
141
+ #: admin/class-ip-geo-block-admin.php:411
142
  msgid "Back to top"
143
  msgstr ""
144
 
145
+ #: admin/class-ip-geo-block-admin.php:503
146
  msgid "Enable"
147
  msgstr ""
148
 
149
+ #: admin/class-ip-geo-block-admin.php:819
150
+ #: admin/class-ip-geo-block-admin.php:832
151
+ #: classes/class-ip-geo-block-cron.php:261
152
+ #: classes/class-ip-geo-block-opts.php:310
 
153
  #, php-format
154
  msgid "Unable to write %s. Please check the permission."
155
  msgstr ""
156
 
157
+ #: admin/class-ip-geo-block-admin.php:820
158
  #, php-format
159
  msgid "Or please refer to %s to set it manually."
160
  msgid_plural "Or please refer to %s to set them manually."
194
  msgid "Export logs"
195
  msgstr ""
196
 
197
+ #: admin/includes/tab-accesslog.php:69 admin/includes/tab-settings.php:1228
198
  msgid "Export to the local file"
199
  msgstr ""
200
 
202
  msgid "Export csv"
203
  msgstr ""
204
 
205
+ #: admin/includes/tab-accesslog.php:109 admin/includes/tab-settings.php:363
206
  #, php-format
207
+ msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
208
  msgstr ""
209
 
210
+ #: admin/includes/tab-accesslog.php:111 admin/includes/tab-settings.php:365
211
  msgid "Comment post"
212
  msgstr ""
213
 
214
+ #: admin/includes/tab-accesslog.php:112 admin/includes/tab-settings.php:366
215
  msgid "XML-RPC"
216
  msgstr ""
217
 
218
+ #: admin/includes/tab-accesslog.php:113 admin/includes/tab-settings.php:367
219
  msgid "Login form"
220
  msgstr ""
221
 
222
+ #: admin/includes/tab-accesslog.php:114 admin/includes/tab-settings.php:368
223
  msgid "Admin area"
224
  msgstr ""
225
 
226
+ #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:370
227
+ msgid "Pubic facing pages"
 
 
 
 
228
  msgstr ""
229
 
230
  #: admin/includes/tab-accesslog.php:121
345
  msgid "(comma or RET separated)"
346
  msgstr ""
347
 
348
+ #: admin/includes/tab-settings.php:107 admin/includes/tab-settings.php:671
349
  msgid "Matching rule"
350
  msgstr ""
351
 
398
  "directory.\">Response code</dfn> %s"
399
  msgstr ""
400
 
401
+ #: admin/includes/tab-settings.php:268
402
  msgid ""
403
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. Front-end URL on "
404
  "your site would not be blocked to prevent loop of redirection even when you "
406
  "\">Redirect URL</dfn>"
407
  msgstr ""
408
 
409
+ #: admin/includes/tab-settings.php:285
410
  msgid ""
411
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
412
  "message</dfn>"
413
  msgstr ""
414
 
415
+ #: admin/includes/tab-settings.php:302
416
  msgid ""
417
  "<dfn title=\"Applied to &#8220;XML-RPC&#8221; and &#8220;Login form&#8221;. "
418
  "Lockout period is defined as expiration time at &#8220;Cache settings&#8221;."
419
  "\">Max number of failed login attempts per IP address</dfn>"
420
  msgstr ""
421
 
422
+ #: admin/includes/tab-settings.php:329
423
  msgid "Select when to run the validation."
424
  msgstr ""
425
 
426
+ #: admin/includes/tab-settings.php:329
427
  msgid "Validation timing"
428
  msgstr ""
429
 
430
+ #: admin/includes/tab-settings.php:340
431
  msgid "&#8220;init&#8221; action hook"
432
  msgstr ""
433
 
434
+ #: admin/includes/tab-settings.php:341
435
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
436
  msgstr ""
437
 
438
+ #: admin/includes/tab-settings.php:344
439
  msgid ""
440
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
441
  "plugins."
442
  msgstr ""
443
 
444
+ #: admin/includes/tab-settings.php:345
445
  msgid ""
446
  "Validate at an earlier phase than other typical plugins. It can reduce load "
447
+ "on server but has <a href='http://www.ipgeoblock.com/codex/validation-timing."
448
+ "html' title='Validation timing | IP Geo Block'>some restrictions</a>."
 
449
  msgstr ""
450
 
451
+ #: admin/includes/tab-settings.php:357
452
  msgid "Back-end target settings"
453
  msgstr ""
454
 
455
+ #: admin/includes/tab-settings.php:369
 
 
 
 
 
456
  msgid "Other areas"
457
  msgstr ""
458
 
459
+ #: admin/includes/tab-settings.php:388 admin/includes/tab-settings.php:408
460
+ #: admin/includes/tab-settings.php:441 admin/includes/tab-settings.php:447
461
+ #: admin/includes/tab-settings.php:659
462
  msgid "Block by country"
463
  msgstr ""
464
 
465
+ #: admin/includes/tab-settings.php:407 admin/includes/tab-settings.php:514
466
+ #: admin/includes/tab-settings.php:992
467
  msgid "Disable"
468
  msgstr ""
469
 
470
+ #: admin/includes/tab-settings.php:409
471
  msgid "Completely close"
472
  msgstr ""
473
 
474
+ #: admin/includes/tab-settings.php:442
475
  msgid ""
476
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
477
  "actions</dfn>"
478
  msgstr ""
479
 
480
+ #: admin/includes/tab-settings.php:448
481
  msgid "Prevent Zero-day Exploit"
482
  msgstr ""
483
 
484
+ #: admin/includes/tab-settings.php:452
485
  msgid ""
486
  "It will block a request related to the services for both public facing pages "
487
  "and the dashboard."
488
  msgstr ""
489
 
490
+ #: admin/includes/tab-settings.php:453
491
  msgid ""
492
  "Regardless of the country code, it will block a malicious request related to "
493
  "the services only for the dashboard."
494
  msgstr ""
495
 
496
+ #: admin/includes/tab-settings.php:480
497
  msgid "Admin ajax/post"
498
  msgstr ""
499
 
500
+ #: admin/includes/tab-settings.php:500
501
+ msgid "Exception for admin action and page"
 
 
502
  msgstr ""
503
 
504
+ #: admin/includes/tab-settings.php:516
505
  #, php-format
506
  msgid ""
507
  "Regardless of the country code, it will block a malicious request to <code>"
508
  "%s&hellip;/*.php</code>."
509
  msgstr ""
510
 
511
+ #: admin/includes/tab-settings.php:517
512
  #, php-format
513
  msgid ""
514
+ "It configures &#8220%s&#8221 to validate a request to the PHP file which "
515
  "does not load WordPress core."
516
  msgstr ""
517
 
518
+ #: admin/includes/tab-settings.php:518
519
  msgid ""
520
  "<dfn title=\"Select the item which causes undesired blocking in order to "
521
  "exclude from the validation target. Grayed item indicates &#8220;"
522
  "INACTIVE&#8221;.\">Exceptions</dfn>"
523
  msgstr ""
524
 
525
+ #: admin/includes/tab-settings.php:554 admin/includes/tab-settings.php:607
526
  msgid "Force to load WP core"
527
  msgstr ""
528
 
529
+ #: admin/includes/tab-settings.php:559
530
  msgid "Plugins area"
531
  msgstr ""
532
 
533
+ #: admin/includes/tab-settings.php:612
534
  msgid "Themes area"
535
  msgstr ""
536
 
537
+ #: admin/includes/tab-settings.php:640
538
  msgid "Front-end target settings"
539
  msgstr ""
540
 
541
+ #: admin/includes/tab-settings.php:664
542
  msgid "Follow &#8220;Validation rule settings&#8221;"
543
  msgstr ""
544
 
545
+ #: admin/includes/tab-settings.php:721
546
  msgid ""
547
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
548
  msgstr ""
549
 
550
+ #: admin/includes/tab-settings.php:733
551
  msgid ""
552
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
553
  "target.\">Post type</dfn>"
554
  msgstr ""
555
 
556
+ #: admin/includes/tab-settings.php:745
557
  msgid ""
558
  "<dfn title=\"Specify the individual category on a single page or archive "
559
  "page as a blocking target.\">Category</dfn>"
560
  msgstr ""
561
 
562
+ #: admin/includes/tab-settings.php:757
563
  msgid ""
564
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
565
  "a blocking target.\">Tag</dfn>"
566
  msgstr ""
567
 
568
+ #: admin/includes/tab-settings.php:772
569
  msgid "Specify the validation target on front-end."
570
  msgstr ""
571
 
572
+ #: admin/includes/tab-settings.php:772
573
  msgid "Validation target"
574
  msgstr ""
575
 
576
+ #: admin/includes/tab-settings.php:783
577
  msgid "All requests"
578
  msgstr ""
579
 
580
+ #: admin/includes/tab-settings.php:784
581
  msgid "Specify the targets"
582
  msgstr ""
583
 
584
+ #: admin/includes/tab-settings.php:787
585
  msgid ""
586
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
587
  "wp&#8221; action hook. It means that this feature would not be compatible "
588
  "with any page caching."
589
  msgstr ""
590
 
591
+ #: admin/includes/tab-settings.php:797
592
  msgid ""
593
  "A part of user agent string and a qualification connected with a separator "
594
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
598
  "qualification&#8221;."
599
  msgstr ""
600
 
601
+ #: admin/includes/tab-settings.php:797
602
  msgid "UA string and qualification"
603
  msgstr ""
604
 
605
+ #: admin/includes/tab-settings.php:816
606
  msgid "Specify the name of action that is invariably blocked."
607
  msgstr ""
608
 
609
+ #: admin/includes/tab-settings.php:816
610
  msgid "Excluded actions"
611
  msgstr ""
612
 
613
+ #: admin/includes/tab-settings.php:835
614
  msgid ""
615
  "It enables to simulate validation without deployment. The results can be "
616
+ "found at &#8220;Pubic facing pages&#8221; in Logs."
617
  msgstr ""
618
 
619
+ #: admin/includes/tab-settings.php:835
620
  msgid "Simulation mode"
621
  msgstr ""
622
 
623
+ #: admin/includes/tab-settings.php:854
624
  msgid "Geolocation API settings"
625
  msgstr ""
626
 
627
+ #: admin/includes/tab-settings.php:863
628
  msgid ""
629
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
630
  "selection and key settings</dfn>"
631
  msgstr ""
632
 
633
+ #: admin/includes/tab-settings.php:885
634
  #, php-format
635
  msgid ""
636
+ "Please download <a href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-"
637
+ "API/archive/master.zip\" title=\"Download the contents of tokkonopapa/"
638
+ "WordPress-IP-Geo-API as a zip file\">ZIP file</a> from <a href=\"https://"
639
+ "github.com/tokkonopapa/WordPress-IP-Geo-API\" title=\"tokkonopapa/WordPress-"
640
+ "IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a> and upload <code>ip-geo-api</"
641
+ "code> to <code>%s</code> with write permission."
642
  msgstr ""
643
 
644
+ #: admin/includes/tab-settings.php:894
645
  msgid "Local database settings"
646
  msgstr ""
647
 
648
+ #: admin/includes/tab-settings.php:909
649
  msgid "database"
650
  msgstr ""
651
 
652
+ #: admin/includes/tab-settings.php:910 classes/class-ip-geo-block-cron.php:306
653
  #, php-format
654
  msgid "Last update: %s"
655
  msgstr ""
656
 
657
+ #: admin/includes/tab-settings.php:919
658
  msgid "Auto updating (once a month)"
659
  msgstr ""
660
 
661
+ #: admin/includes/tab-settings.php:936
662
  msgid "Download database"
663
  msgstr ""
664
 
665
+ #: admin/includes/tab-settings.php:944
666
  msgid "Download now"
667
  msgstr ""
668
 
669
+ #: admin/includes/tab-settings.php:956
670
  msgid "Record settings"
671
  msgstr ""
672
 
673
+ #: admin/includes/tab-settings.php:965
674
  msgid "Record validation statistics"
675
  msgstr ""
676
 
677
+ #: admin/includes/tab-settings.php:981
678
  msgid "Record validation logs"
679
  msgstr ""
680
 
681
+ #: admin/includes/tab-settings.php:993
682
  msgid "Only when blocked"
683
  msgstr ""
684
 
685
+ #: admin/includes/tab-settings.php:994
686
  msgid "Only when passed"
687
  msgstr ""
688
 
689
+ #: admin/includes/tab-settings.php:995
690
  msgid "Unauthenticated user"
691
  msgstr ""
692
 
693
+ #: admin/includes/tab-settings.php:996
694
  msgid "Authenticated user"
695
  msgstr ""
696
 
697
+ #: admin/includes/tab-settings.php:997
698
  msgid "All of validation"
699
  msgstr ""
700
 
701
+ #: admin/includes/tab-settings.php:1006
702
  msgid "Recording period of the logs (days)"
703
  msgstr ""
704
 
705
+ #: admin/includes/tab-settings.php:1022
706
  msgid "Maximum length of logs for each target"
707
  msgstr ""
708
 
709
+ #: admin/includes/tab-settings.php:1039
710
  msgid ""
711
  "<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be recorded "
712
  "with their values in logs</dfn>"
713
  msgstr ""
714
 
715
+ #: admin/includes/tab-settings.php:1057
716
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
717
  msgstr ""
718
 
719
+ #: admin/includes/tab-settings.php:1075
720
  msgid "IP address cache settings"
721
  msgstr ""
722
 
723
+ #: admin/includes/tab-settings.php:1084
724
  #, php-format
725
  msgid ""
726
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
728
  "\">Expiration time [sec]</dfn>"
729
  msgstr ""
730
 
731
+ #: admin/includes/tab-settings.php:1100
732
  msgid "Garbage collection period [sec]"
733
  msgstr ""
734
 
735
+ #: admin/includes/tab-settings.php:1117
736
  msgid "Number of entries to be displayed in cache"
737
  msgstr ""
738
 
739
+ #: admin/includes/tab-settings.php:1136
740
  msgid "Submission settings"
741
  msgstr ""
742
 
743
+ #: admin/includes/tab-settings.php:1148
744
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
745
  msgstr ""
746
 
747
+ #: admin/includes/tab-settings.php:1148
748
  msgid "Message on comment form"
749
  msgstr ""
750
 
751
+ #: admin/includes/tab-settings.php:1160
752
  msgid "None"
753
  msgstr ""
754
 
755
+ #: admin/includes/tab-settings.php:1161
756
  msgid "Top"
757
  msgstr ""
758
 
759
+ #: admin/includes/tab-settings.php:1162
760
  msgid "Bottom"
761
  msgstr ""
762
 
763
+ #: admin/includes/tab-settings.php:1174
764
  msgid "Plugin settings"
765
  msgstr ""
766
 
767
+ #: admin/includes/tab-settings.php:1183
768
  msgid "Remove all settings at uninstallation"
769
  msgstr ""
770
 
771
+ #: admin/includes/tab-settings.php:1201
772
  msgid ""
773
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
774
  "dfn>"
775
  msgstr ""
776
 
777
+ #: admin/includes/tab-settings.php:1215
778
  msgid ""
779
  "You need to click the &#8220;Save Changes&#8221; button for imported "
780
  "settings to take effect."
781
  msgstr ""
782
 
783
+ #: admin/includes/tab-settings.php:1221
784
  msgid "Export / Import settings"
785
  msgstr ""
786
 
787
+ #: admin/includes/tab-settings.php:1228
788
  msgid "Export settings"
789
  msgstr ""
790
 
791
+ #: admin/includes/tab-settings.php:1229
792
  msgid "Import from the local file"
793
  msgstr ""
794
 
795
+ #: admin/includes/tab-settings.php:1229
796
  msgid "Import settings"
797
  msgstr ""
798
 
799
+ #: admin/includes/tab-settings.php:1238
800
  msgid "Import pre-defined settings"
801
  msgstr ""
802
 
803
+ #: admin/includes/tab-settings.php:1245
804
  msgid ""
805
  "Import the default settings to revert to the &#8220;Right after "
806
  "installing&#8221; state"
807
  msgstr ""
808
 
809
+ #: admin/includes/tab-settings.php:1245
810
  msgid "Default settings"
811
  msgstr ""
812
 
813
+ #: admin/includes/tab-settings.php:1246
814
  msgid ""
815
  "Import the preferred settings mainly for the &#8220;Validation target "
816
  "settings&#8221;"
817
  msgstr ""
818
 
819
+ #: admin/includes/tab-settings.php:1246
820
+ msgid "Best practice"
 
 
 
 
 
 
 
 
 
 
 
 
821
  msgstr ""
822
 
823
+ #: admin/includes/tab-settings.php:1256
 
 
 
 
824
  msgid "Delete DB table for validation logs"
825
  msgstr ""
826
 
827
+ #: admin/includes/tab-settings.php:1264
828
  msgid "Delete now"
829
  msgstr ""
830
 
831
+ #: admin/includes/tab-settings.php:1272
832
  msgid "Create DB table for validation logs"
833
  msgstr ""
834
 
835
+ #: admin/includes/tab-settings.php:1280
836
  msgid "Create now"
837
  msgstr ""
838
 
839
+ #: admin/includes/tab-settings.php:1295
840
  msgid ""
841
+ "To enhance the protection ability, please refer to &#8220;<a href=\"http://"
842
+ "www.ipgeoblock.com/codex/the-best-practice-of-target-settings.html\" title="
843
+ "\"The best practice of target settings | IP Geo Block\">The best practice of "
844
+ "target settings</a>&#8221;."
845
  msgstr ""
846
 
847
+ #: admin/includes/tab-settings.php:1296
848
  msgid ""
849
+ "If you have any troubles with these, please open an issue at <a class=\"ip-"
850
+ "geo-block-link\" href=\"http://wordpress.org/support/plugin/ip-geo-block\" "
851
+ "title=\"WordPress &#8250; Support &raquo; IP Geo Block\" "
852
+ "target=_blank>support forum</a>."
 
853
  msgstr ""
854
 
855
+ #: admin/includes/tab-settings.php:1303
856
  msgid ""
857
  "While Maxmind and IP2Location will fetch the local database, others will "
858
  "pass an IP address to the APIs via HTTP."
859
  msgstr ""
860
 
861
+ #: admin/includes/tab-settings.php:1304
862
  msgid ""
863
  "Please select the appropriate APIs to fit the privacy law in your country."
864
  msgstr ""
865
 
866
+ #: admin/includes/tab-settings.php:1311
867
  msgid ""
868
+ "Please refer to the document &#8220;<a href=\"http://www.ipgeoblock.com/"
869
+ "codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block\" "
870
+ "target=_blank>Blocking on front-end</a>&#8221; for details, including "
871
+ "restrictions on cache plugin."
872
  msgstr ""
873
 
874
+ #: admin/includes/tab-settings.php:1312
875
  msgid ""
876
  "If you find any issues or have something to suggest, please feel free to "
877
+ "open an issue at <a class=\"ip-geo-block-link\" href=\"http://wordpress.org/"
878
+ "support/plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP "
879
+ "Geo Block\" target=_blank>support forum</a>."
880
  msgstr ""
881
 
882
  #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:184
957
  "<strong>you'll be blocked</strong> after the cache expires."
958
  msgstr ""
959
 
960
+ #: classes/class-ip-geo-block-cron.php:224
961
  msgid "Your database file is up-to-date."
962
  msgstr ""
963
 
964
+ #: classes/class-ip-geo-block-cron.php:253
 
965
  #, php-format
966
  msgid "Unable to read %s. Please check the permission."
967
  msgstr ""
968
 
969
+ #: classes/class-ip-geo-block-logs.php:131
 
 
 
 
 
 
970
  #, php-format
971
  msgid ""
972
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
973
  "activate again."
974
  msgstr ""
975
 
976
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:145
977
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:174
978
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:149
979
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:178
980
  msgid "Database file does not exist."
languages/ip-geo-block.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: IP Geo Block 3.0.1.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
- "POT-Creation-Date: 2017-02-20 05:54+0900\n"
8
- "PO-Revision-Date: 2017-02-20 05:54+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
@@ -25,53 +25,53 @@ msgid ""
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
- #: admin/class-ip-geo-block-admin.php:160
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
- #: admin/class-ip-geo-block-admin.php:161
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
- #: admin/class-ip-geo-block-admin.php:162
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
- #: admin/class-ip-geo-block-admin.php:163
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
- #: admin/class-ip-geo-block-admin.php:164
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
- #: admin/class-ip-geo-block-admin.php:165
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
- #: admin/class-ip-geo-block-admin.php:166
53
  msgid "This feature is available with HTML5 compliant browsers."
54
  msgstr ""
55
 
56
- #: admin/class-ip-geo-block-admin.php:193
57
  msgid "Contribute at GitHub"
58
  msgstr ""
59
 
60
- #: admin/class-ip-geo-block-admin.php:210
61
- #: admin/class-ip-geo-block-admin.php:390
62
  msgid "Settings"
63
  msgstr ""
64
 
65
- #: admin/class-ip-geo-block-admin.php:265
66
- #: admin/class-ip-geo-block-admin.php:266
67
  msgid "IP Geo Block"
68
  msgstr ""
69
 
70
- #: admin/class-ip-geo-block-admin.php:284
71
  msgid "You need WordPress 3.7+."
72
  msgstr ""
73
 
74
- #: admin/class-ip-geo-block-admin.php:293
75
  #, php-format
76
  msgid ""
77
  "Now downloading geolocation databases in background. After a little while, "
@@ -79,96 +79,82 @@ msgid ""
79
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
80
  msgstr ""
81
 
82
- #: admin/class-ip-geo-block-admin.php:299
83
  #, php-format
84
  msgid ""
85
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
86
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
87
  msgstr ""
88
 
89
- #: admin/class-ip-geo-block-admin.php:308
90
  msgid "Local database and matching rule have been updated."
91
  msgstr ""
92
 
93
- #: admin/class-ip-geo-block-admin.php:319
94
- msgid ""
95
- "Once you logout, you will be unable to login again because the number of "
96
- "login attempts reaches the limit."
97
- msgstr ""
98
-
99
- #: admin/class-ip-geo-block-admin.php:321
100
- #, php-format
101
- msgid ""
102
- "Please execute \"<strong>Clear cache</strong>\" on <a href=\"%s\">Statistics "
103
- "tab</a> to prevent locking yourself out."
104
- msgstr ""
105
-
106
- #: admin/class-ip-geo-block-admin.php:331
107
  msgid ""
108
  "Once you logout, you will be unable to login again because your country code "
109
  "or IP address is in the blacklist."
110
  msgstr ""
111
 
112
- #: admin/class-ip-geo-block-admin.php:332
113
  msgid ""
114
  "Once you logout, you will be unable to login again because your country code "
115
  "or IP address is not in the whitelist."
116
  msgstr ""
117
 
118
- #: admin/class-ip-geo-block-admin.php:335
119
  #, php-format
120
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
121
  msgstr ""
122
 
123
- #: admin/class-ip-geo-block-admin.php:391
124
  msgid "Statistics"
125
  msgstr ""
126
 
127
- #: admin/class-ip-geo-block-admin.php:392
128
  msgid "Logs"
129
  msgstr ""
130
 
131
- #: admin/class-ip-geo-block-admin.php:393
132
  msgid "Search"
133
  msgstr ""
134
 
135
- #: admin/class-ip-geo-block-admin.php:394
136
  msgid "Attribution"
137
  msgstr ""
138
 
139
- #: admin/class-ip-geo-block-admin.php:405
140
  msgid "Toggle all"
141
  msgstr ""
142
 
143
- #: admin/class-ip-geo-block-admin.php:429
144
  msgid "Thanks for providing these great services for free."
145
  msgstr ""
146
 
147
- #: admin/class-ip-geo-block-admin.php:430
148
  msgid ""
149
  "(Most browsers will redirect you to each site <a href=\"http://www."
150
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
151
  "when you click the link</a>.)"
152
  msgstr ""
153
 
154
- #: admin/class-ip-geo-block-admin.php:435
155
  msgid "Back to top"
156
  msgstr ""
157
 
158
- #: admin/class-ip-geo-block-admin.php:527
159
  msgid "Enable"
160
  msgstr ""
161
 
162
- #: admin/class-ip-geo-block-admin.php:840
163
- #: admin/class-ip-geo-block-admin.php:851
164
- #: classes/class-ip-geo-block-cron.php:260
165
- #: classes/class-ip-geo-block-cron.php:294
166
- #: classes/class-ip-geo-block-opts.php:313
167
  #, php-format
168
  msgid "Unable to write %s. Please check the permission."
169
  msgstr ""
170
 
171
- #: admin/class-ip-geo-block-admin.php:841
172
  #, php-format
173
  msgid "Or please refer to %s to set it manually."
174
  msgid_plural "Or please refer to %s to set them manually."
@@ -208,7 +194,7 @@ msgstr ""
208
  msgid "Export logs"
209
  msgstr ""
210
 
211
- #: admin/includes/tab-accesslog.php:69 admin/includes/tab-settings.php:1230
212
  msgid "Export to the local file"
213
  msgstr ""
214
 
@@ -216,33 +202,29 @@ msgstr ""
216
  msgid "Export csv"
217
  msgstr ""
218
 
219
- #: admin/includes/tab-accesslog.php:109
220
  #, php-format
221
- msgid "<dfn title=\"Validation log of request to %s.\">%s</dfn>"
222
  msgstr ""
223
 
224
- #: admin/includes/tab-accesslog.php:111 admin/includes/tab-settings.php:366
225
  msgid "Comment post"
226
  msgstr ""
227
 
228
- #: admin/includes/tab-accesslog.php:112 admin/includes/tab-settings.php:367
229
  msgid "XML-RPC"
230
  msgstr ""
231
 
232
- #: admin/includes/tab-accesslog.php:113 admin/includes/tab-settings.php:368
233
  msgid "Login form"
234
  msgstr ""
235
 
236
- #: admin/includes/tab-accesslog.php:114 admin/includes/tab-settings.php:369
237
  msgid "Admin area"
238
  msgstr ""
239
 
240
- #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:371
241
- msgid "public facing pages"
242
- msgstr ""
243
-
244
- #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:371
245
- msgid "Public facing pages"
246
  msgstr ""
247
 
248
  #: admin/includes/tab-accesslog.php:121
@@ -363,7 +345,7 @@ msgstr ""
363
  msgid "(comma or RET separated)"
364
  msgstr ""
365
 
366
- #: admin/includes/tab-settings.php:107 admin/includes/tab-settings.php:673
367
  msgid "Matching rule"
368
  msgstr ""
369
 
@@ -416,7 +398,7 @@ msgid ""
416
  "directory.\">Response code</dfn> %s"
417
  msgstr ""
418
 
419
- #: admin/includes/tab-settings.php:269
420
  msgid ""
421
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. Front-end URL on "
422
  "your site would not be blocked to prevent loop of redirection even when you "
@@ -424,197 +406,189 @@ msgid ""
424
  "\">Redirect URL</dfn>"
425
  msgstr ""
426
 
427
- #: admin/includes/tab-settings.php:286
428
  msgid ""
429
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
430
  "message</dfn>"
431
  msgstr ""
432
 
433
- #: admin/includes/tab-settings.php:303
434
  msgid ""
435
  "<dfn title=\"Applied to &#8220;XML-RPC&#8221; and &#8220;Login form&#8221;. "
436
  "Lockout period is defined as expiration time at &#8220;Cache settings&#8221;."
437
  "\">Max number of failed login attempts per IP address</dfn>"
438
  msgstr ""
439
 
440
- #: admin/includes/tab-settings.php:330
441
  msgid "Select when to run the validation."
442
  msgstr ""
443
 
444
- #: admin/includes/tab-settings.php:330
445
  msgid "Validation timing"
446
  msgstr ""
447
 
448
- #: admin/includes/tab-settings.php:341
449
  msgid "&#8220;init&#8221; action hook"
450
  msgstr ""
451
 
452
- #: admin/includes/tab-settings.php:342
453
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
454
  msgstr ""
455
 
456
- #: admin/includes/tab-settings.php:345
457
  msgid ""
458
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
459
  "plugins."
460
  msgstr ""
461
 
462
- #: admin/includes/tab-settings.php:346
463
  msgid ""
464
  "Validate at an earlier phase than other typical plugins. It can reduce load "
465
- "on server but has <a rel='noreferrer' href='http://www.ipgeoblock.com/codex/"
466
- "validation-timing.html' title='Validation timing | IP Geo Block'>some "
467
- "restrictions</a>."
468
  msgstr ""
469
 
470
- #: admin/includes/tab-settings.php:358
471
  msgid "Back-end target settings"
472
  msgstr ""
473
 
474
- #: admin/includes/tab-settings.php:364
475
- #, php-format
476
- msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
477
- msgstr ""
478
-
479
- #: admin/includes/tab-settings.php:370
480
  msgid "Other areas"
481
  msgstr ""
482
 
483
- #: admin/includes/tab-settings.php:389 admin/includes/tab-settings.php:409
484
- #: admin/includes/tab-settings.php:442 admin/includes/tab-settings.php:448
485
- #: admin/includes/tab-settings.php:661
486
  msgid "Block by country"
487
  msgstr ""
488
 
489
- #: admin/includes/tab-settings.php:408 admin/includes/tab-settings.php:516
490
- #: admin/includes/tab-settings.php:994
491
  msgid "Disable"
492
  msgstr ""
493
 
494
- #: admin/includes/tab-settings.php:410
495
  msgid "Completely close"
496
  msgstr ""
497
 
498
- #: admin/includes/tab-settings.php:443
499
  msgid ""
500
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
501
  "actions</dfn>"
502
  msgstr ""
503
 
504
- #: admin/includes/tab-settings.php:449
505
  msgid "Prevent Zero-day Exploit"
506
  msgstr ""
507
 
508
- #: admin/includes/tab-settings.php:453
509
  msgid ""
510
  "It will block a request related to the services for both public facing pages "
511
  "and the dashboard."
512
  msgstr ""
513
 
514
- #: admin/includes/tab-settings.php:454
515
  msgid ""
516
  "Regardless of the country code, it will block a malicious request related to "
517
  "the services only for the dashboard."
518
  msgstr ""
519
 
520
- #: admin/includes/tab-settings.php:481
521
  msgid "Admin ajax/post"
522
  msgstr ""
523
 
524
- #: admin/includes/tab-settings.php:501
525
- msgid ""
526
- "<dfn title=\"Same effect as &#8220;ip-geo-block-bypass-admins&#8221; filter "
527
- "hook.\">Exception for admin action and page</dfn>"
528
  msgstr ""
529
 
530
- #: admin/includes/tab-settings.php:518
531
  #, php-format
532
  msgid ""
533
  "Regardless of the country code, it will block a malicious request to <code>"
534
  "%s&hellip;/*.php</code>."
535
  msgstr ""
536
 
537
- #: admin/includes/tab-settings.php:519
538
  #, php-format
539
  msgid ""
540
- "It configures &#8220;%s&#8221; to validate a request to the PHP file which "
541
  "does not load WordPress core."
542
  msgstr ""
543
 
544
- #: admin/includes/tab-settings.php:520
545
  msgid ""
546
  "<dfn title=\"Select the item which causes undesired blocking in order to "
547
  "exclude from the validation target. Grayed item indicates &#8220;"
548
  "INACTIVE&#8221;.\">Exceptions</dfn>"
549
  msgstr ""
550
 
551
- #: admin/includes/tab-settings.php:556 admin/includes/tab-settings.php:609
552
  msgid "Force to load WP core"
553
  msgstr ""
554
 
555
- #: admin/includes/tab-settings.php:561
556
  msgid "Plugins area"
557
  msgstr ""
558
 
559
- #: admin/includes/tab-settings.php:614
560
  msgid "Themes area"
561
  msgstr ""
562
 
563
- #: admin/includes/tab-settings.php:642
564
  msgid "Front-end target settings"
565
  msgstr ""
566
 
567
- #: admin/includes/tab-settings.php:666
568
  msgid "Follow &#8220;Validation rule settings&#8221;"
569
  msgstr ""
570
 
571
- #: admin/includes/tab-settings.php:723
572
  msgid ""
573
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
574
  msgstr ""
575
 
576
- #: admin/includes/tab-settings.php:735
577
  msgid ""
578
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
579
  "target.\">Post type</dfn>"
580
  msgstr ""
581
 
582
- #: admin/includes/tab-settings.php:747
583
  msgid ""
584
  "<dfn title=\"Specify the individual category on a single page or archive "
585
  "page as a blocking target.\">Category</dfn>"
586
  msgstr ""
587
 
588
- #: admin/includes/tab-settings.php:759
589
  msgid ""
590
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
591
  "a blocking target.\">Tag</dfn>"
592
  msgstr ""
593
 
594
- #: admin/includes/tab-settings.php:774
595
  msgid "Specify the validation target on front-end."
596
  msgstr ""
597
 
598
- #: admin/includes/tab-settings.php:774
599
  msgid "Validation target"
600
  msgstr ""
601
 
602
- #: admin/includes/tab-settings.php:785
603
  msgid "All requests"
604
  msgstr ""
605
 
606
- #: admin/includes/tab-settings.php:786
607
  msgid "Specify the targets"
608
  msgstr ""
609
 
610
- #: admin/includes/tab-settings.php:789
611
  msgid ""
612
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
613
  "wp&#8221; action hook. It means that this feature would not be compatible "
614
  "with any page caching."
615
  msgstr ""
616
 
617
- #: admin/includes/tab-settings.php:799
618
  msgid ""
619
  "A part of user agent string and a qualification connected with a separator "
620
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
@@ -624,129 +598,129 @@ msgid ""
624
  "qualification&#8221;."
625
  msgstr ""
626
 
627
- #: admin/includes/tab-settings.php:799
628
  msgid "UA string and qualification"
629
  msgstr ""
630
 
631
- #: admin/includes/tab-settings.php:818
632
  msgid "Specify the name of action that is invariably blocked."
633
  msgstr ""
634
 
635
- #: admin/includes/tab-settings.php:818
636
  msgid "Excluded actions"
637
  msgstr ""
638
 
639
- #: admin/includes/tab-settings.php:837
640
  msgid ""
641
  "It enables to simulate validation without deployment. The results can be "
642
- "found at &#8220;Public facing pages&#8221; in Logs."
643
  msgstr ""
644
 
645
- #: admin/includes/tab-settings.php:837
646
  msgid "Simulation mode"
647
  msgstr ""
648
 
649
- #: admin/includes/tab-settings.php:856
650
  msgid "Geolocation API settings"
651
  msgstr ""
652
 
653
- #: admin/includes/tab-settings.php:865
654
  msgid ""
655
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
656
  "selection and key settings</dfn>"
657
  msgstr ""
658
 
659
- #: admin/includes/tab-settings.php:887
660
  #, php-format
661
  msgid ""
662
- "Please download <a rel=\"noreferrer\" href=\"https://github.com/tokkonopapa/"
663
- "WordPress-IP-Geo-API/archive/master.zip\" title=\"Download the contents of "
664
- "tokkonopapa/WordPress-IP-Geo-API as a zip file\">ZIP file</a> from <a rel="
665
- "\"noreferrer\" href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-API\" "
666
- "title=\"tokkonopapa/WordPress-IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a> "
667
- "and upload <code>ip-geo-api</code> to <code>%s</code> with write permission."
668
  msgstr ""
669
 
670
- #: admin/includes/tab-settings.php:896
671
  msgid "Local database settings"
672
  msgstr ""
673
 
674
- #: admin/includes/tab-settings.php:911
675
  msgid "database"
676
  msgstr ""
677
 
678
- #: admin/includes/tab-settings.php:912 classes/class-ip-geo-block-cron.php:342
679
  #, php-format
680
  msgid "Last update: %s"
681
  msgstr ""
682
 
683
- #: admin/includes/tab-settings.php:921
684
  msgid "Auto updating (once a month)"
685
  msgstr ""
686
 
687
- #: admin/includes/tab-settings.php:938
688
  msgid "Download database"
689
  msgstr ""
690
 
691
- #: admin/includes/tab-settings.php:946
692
  msgid "Download now"
693
  msgstr ""
694
 
695
- #: admin/includes/tab-settings.php:958
696
  msgid "Record settings"
697
  msgstr ""
698
 
699
- #: admin/includes/tab-settings.php:967
700
  msgid "Record validation statistics"
701
  msgstr ""
702
 
703
- #: admin/includes/tab-settings.php:983
704
  msgid "Record validation logs"
705
  msgstr ""
706
 
707
- #: admin/includes/tab-settings.php:995
708
  msgid "Only when blocked"
709
  msgstr ""
710
 
711
- #: admin/includes/tab-settings.php:996
712
  msgid "Only when passed"
713
  msgstr ""
714
 
715
- #: admin/includes/tab-settings.php:997
716
  msgid "Unauthenticated user"
717
  msgstr ""
718
 
719
- #: admin/includes/tab-settings.php:998
720
  msgid "Authenticated user"
721
  msgstr ""
722
 
723
- #: admin/includes/tab-settings.php:999
724
  msgid "All of validation"
725
  msgstr ""
726
 
727
- #: admin/includes/tab-settings.php:1008
728
  msgid "Recording period of the logs (days)"
729
  msgstr ""
730
 
731
- #: admin/includes/tab-settings.php:1024
732
  msgid "Maximum length of logs for each target"
733
  msgstr ""
734
 
735
- #: admin/includes/tab-settings.php:1041
736
  msgid ""
737
  "<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be recorded "
738
  "with their values in logs</dfn>"
739
  msgstr ""
740
 
741
- #: admin/includes/tab-settings.php:1059
742
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
743
  msgstr ""
744
 
745
- #: admin/includes/tab-settings.php:1077
746
  msgid "IP address cache settings"
747
  msgstr ""
748
 
749
- #: admin/includes/tab-settings.php:1086
750
  #, php-format
751
  msgid ""
752
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
@@ -754,172 +728,155 @@ msgid ""
754
  "\">Expiration time [sec]</dfn>"
755
  msgstr ""
756
 
757
- #: admin/includes/tab-settings.php:1102
758
  msgid "Garbage collection period [sec]"
759
  msgstr ""
760
 
761
- #: admin/includes/tab-settings.php:1119
762
  msgid "Number of entries to be displayed in cache"
763
  msgstr ""
764
 
765
- #: admin/includes/tab-settings.php:1138
766
  msgid "Submission settings"
767
  msgstr ""
768
 
769
- #: admin/includes/tab-settings.php:1150
770
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
771
  msgstr ""
772
 
773
- #: admin/includes/tab-settings.php:1150
774
  msgid "Message on comment form"
775
  msgstr ""
776
 
777
- #: admin/includes/tab-settings.php:1162
778
  msgid "None"
779
  msgstr ""
780
 
781
- #: admin/includes/tab-settings.php:1163
782
  msgid "Top"
783
  msgstr ""
784
 
785
- #: admin/includes/tab-settings.php:1164
786
  msgid "Bottom"
787
  msgstr ""
788
 
789
- #: admin/includes/tab-settings.php:1176
790
  msgid "Plugin settings"
791
  msgstr ""
792
 
793
- #: admin/includes/tab-settings.php:1185
794
  msgid "Remove all settings at uninstallation"
795
  msgstr ""
796
 
797
- #: admin/includes/tab-settings.php:1203
798
  msgid ""
799
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
800
  "dfn>"
801
  msgstr ""
802
 
803
- #: admin/includes/tab-settings.php:1217
804
  msgid ""
805
  "You need to click the &#8220;Save Changes&#8221; button for imported "
806
  "settings to take effect."
807
  msgstr ""
808
 
809
- #: admin/includes/tab-settings.php:1223
810
  msgid "Export / Import settings"
811
  msgstr ""
812
 
813
- #: admin/includes/tab-settings.php:1230
814
  msgid "Export settings"
815
  msgstr ""
816
 
817
- #: admin/includes/tab-settings.php:1231
818
  msgid "Import from the local file"
819
  msgstr ""
820
 
821
- #: admin/includes/tab-settings.php:1231
822
  msgid "Import settings"
823
  msgstr ""
824
 
825
- #: admin/includes/tab-settings.php:1240
826
  msgid "Import pre-defined settings"
827
  msgstr ""
828
 
829
- #: admin/includes/tab-settings.php:1247
830
  msgid ""
831
  "Import the default settings to revert to the &#8220;Right after "
832
  "installing&#8221; state"
833
  msgstr ""
834
 
835
- #: admin/includes/tab-settings.php:1247
836
  msgid "Default settings"
837
  msgstr ""
838
 
839
- #: admin/includes/tab-settings.php:1248
840
  msgid ""
841
  "Import the preferred settings mainly for the &#8220;Validation target "
842
  "settings&#8221;"
843
  msgstr ""
844
 
845
- #: admin/includes/tab-settings.php:1248
846
- msgid "Best settings"
847
- msgstr ""
848
-
849
- #: admin/includes/tab-settings.php:1257
850
- msgid ""
851
- "<dfn title=\"Please copy &amp; paste when submitting your issue to support "
852
- "forum.\">Installation information</dfn><br />[ <a rel=\"noreferrer\" href="
853
- "\"https://wordpress.org/support/plugin/ip-geo-block\" title=\"WordPress "
854
- "&#8250; Support &raquo; IP Geo Block\">support forum</a> ]"
855
- msgstr ""
856
-
857
- #: admin/includes/tab-settings.php:1264
858
- msgid "Show PHP, WordPress, theme and plugins information."
859
  msgstr ""
860
 
861
- #: admin/includes/tab-settings.php:1264
862
- msgid "Show information"
863
- msgstr ""
864
-
865
- #: admin/includes/tab-settings.php:1274
866
  msgid "Delete DB table for validation logs"
867
  msgstr ""
868
 
869
- #: admin/includes/tab-settings.php:1282
870
  msgid "Delete now"
871
  msgstr ""
872
 
873
- #: admin/includes/tab-settings.php:1290
874
  msgid "Create DB table for validation logs"
875
  msgstr ""
876
 
877
- #: admin/includes/tab-settings.php:1298
878
  msgid "Create now"
879
  msgstr ""
880
 
881
- #: admin/includes/tab-settings.php:1313
882
  msgid ""
883
- "To enhance the protection ability, please refer to &#8220;<a rel=\"noreferrer"
884
- "\" href=\"http://www.ipgeoblock.com/codex/the-best-practice-for-target-"
885
- "settings.html\" title=\"The best practice for target settings | IP Geo Block"
886
- "\">The best practice for target settings</a>&#8221;."
887
  msgstr ""
888
 
889
- #: admin/includes/tab-settings.php:1314
890
  msgid ""
891
- "If you have any troubles with these, please check FAQ at <a rel=\"noreferrer"
892
- "\" href=\"https://wordpress.org/plugins/ip-geo-block/faq/\" title=\"IP Geo "
893
- "Block &mdash; WordPress Plugins\">WordPress.org</a> and <a rel=\"noreferrer"
894
- "\" href=\"http://www.ipgeoblock.com/codex/#faq\" title=\"Codex | IP Geo Block"
895
- "\">Codex</a>."
896
  msgstr ""
897
 
898
- #: admin/includes/tab-settings.php:1321
899
  msgid ""
900
  "While Maxmind and IP2Location will fetch the local database, others will "
901
  "pass an IP address to the APIs via HTTP."
902
  msgstr ""
903
 
904
- #: admin/includes/tab-settings.php:1322
905
  msgid ""
906
  "Please select the appropriate APIs to fit the privacy law in your country."
907
  msgstr ""
908
 
909
- #: admin/includes/tab-settings.php:1329
910
  msgid ""
911
- "Please refer to the document &#8220;<a rel=\"noreferrer\" href=\"http://www."
912
- "ipgeoblock.com/codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block"
913
- "\">Blocking on front-end</a>&#8221; for details, including restrictions on "
914
- "cache plugin."
915
  msgstr ""
916
 
917
- #: admin/includes/tab-settings.php:1330
918
  msgid ""
919
  "If you find any issues or have something to suggest, please feel free to "
920
- "open an issue at <a rel=\"noreferrer\" href=\"https://wordpress.org/support/"
921
- "plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP Geo Block"
922
- "\">support forum</a>."
923
  msgstr ""
924
 
925
  #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:184
@@ -1000,31 +957,24 @@ msgid ""
1000
  "<strong>you'll be blocked</strong> after the cache expires."
1001
  msgstr ""
1002
 
1003
- #: classes/class-ip-geo-block-cron.php:227
1004
  msgid "Your database file is up-to-date."
1005
  msgstr ""
1006
 
1007
- #: classes/class-ip-geo-block-cron.php:255
1008
- #: classes/class-ip-geo-block-cron.php:289
1009
  #, php-format
1010
  msgid "Unable to read %s. Please check the permission."
1011
  msgstr ""
1012
 
1013
- #: classes/class-ip-geo-block-cron.php:265
1014
- #: classes/class-ip-geo-block-cron.php:299
1015
- #, php-format
1016
- msgid "Can't lock %s. Please try again after a while."
1017
- msgstr ""
1018
-
1019
- #: classes/class-ip-geo-block-logs.php:149
1020
  #, php-format
1021
  msgid ""
1022
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
1023
  "activate again."
1024
  msgstr ""
1025
 
1026
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:147
1027
- #: wp-content/ip-geo-api/ip2location/class-ip2location.php:176
1028
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:149
1029
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:178
1030
  msgid "Database file does not exist."
2
  # This file is distributed under the same license as the IP Geo Block package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: IP Geo Block 3.0.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ip-geo-block\n"
7
+ "POT-Creation-Date: 2016-12-05 21:17+0900\n"
8
+ "PO-Revision-Date: 2016-12-05 21:17+0900\n"
9
  "Last-Translator: tokkonopapa <tokkonopapa@yahoo.com>\n"
10
  "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
25
  "posted from outside your nation, and also prevents zero-day exploit."
26
  msgstr ""
27
 
28
+ #: admin/class-ip-geo-block-admin.php:161
29
  msgid "Import settings ?"
30
  msgstr ""
31
 
32
+ #: admin/class-ip-geo-block-admin.php:162
33
  msgid "Create table ?"
34
  msgstr ""
35
 
36
+ #: admin/class-ip-geo-block-admin.php:163
37
  msgid "Delete table ?"
38
  msgstr ""
39
 
40
+ #: admin/class-ip-geo-block-admin.php:164
41
  msgid "Clear statistics ?"
42
  msgstr ""
43
 
44
+ #: admin/class-ip-geo-block-admin.php:165
45
  msgid "Clear cache ?"
46
  msgstr ""
47
 
48
+ #: admin/class-ip-geo-block-admin.php:166
49
  msgid "Clear logs ?"
50
  msgstr ""
51
 
52
+ #: admin/class-ip-geo-block-admin.php:167
53
  msgid "This feature is available with HTML5 compliant browsers."
54
  msgstr ""
55
 
56
+ #: admin/class-ip-geo-block-admin.php:194
57
  msgid "Contribute at GitHub"
58
  msgstr ""
59
 
60
+ #: admin/class-ip-geo-block-admin.php:211
61
+ #: admin/class-ip-geo-block-admin.php:365
62
  msgid "Settings"
63
  msgstr ""
64
 
65
+ #: admin/class-ip-geo-block-admin.php:257
66
+ #: admin/class-ip-geo-block-admin.php:258
67
  msgid "IP Geo Block"
68
  msgstr ""
69
 
70
+ #: admin/class-ip-geo-block-admin.php:279
71
  msgid "You need WordPress 3.7+."
72
  msgstr ""
73
 
74
+ #: admin/class-ip-geo-block-admin.php:287
75
  #, php-format
76
  msgid ""
77
  "Now downloading geolocation databases in background. After a little while, "
79
  "strong>&#8221; at <a href=\"%s\">Validation rule settings</a>."
80
  msgstr ""
81
 
82
+ #: admin/class-ip-geo-block-admin.php:293
83
  #, php-format
84
  msgid ""
85
  "The &#8220;<strong>Matching rule</strong>&#8221; is not set properly. Please "
86
  "confirm it at <a href=\"%s\">Validation rule settings</a>."
87
  msgstr ""
88
 
89
+ #: admin/class-ip-geo-block-admin.php:302
90
  msgid "Local database and matching rule have been updated."
91
  msgstr ""
92
 
93
+ #: admin/class-ip-geo-block-admin.php:313
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  msgid ""
95
  "Once you logout, you will be unable to login again because your country code "
96
  "or IP address is in the blacklist."
97
  msgstr ""
98
 
99
+ #: admin/class-ip-geo-block-admin.php:314
100
  msgid ""
101
  "Once you logout, you will be unable to login again because your country code "
102
  "or IP address is not in the whitelist."
103
  msgstr ""
104
 
105
+ #: admin/class-ip-geo-block-admin.php:317
106
  #, php-format
107
  msgid "Please check your <a href=\"%s\">Validation rule settings</a>."
108
  msgstr ""
109
 
110
+ #: admin/class-ip-geo-block-admin.php:366
111
  msgid "Statistics"
112
  msgstr ""
113
 
114
+ #: admin/class-ip-geo-block-admin.php:367
115
  msgid "Logs"
116
  msgstr ""
117
 
118
+ #: admin/class-ip-geo-block-admin.php:368
119
  msgid "Search"
120
  msgstr ""
121
 
122
+ #: admin/class-ip-geo-block-admin.php:369
123
  msgid "Attribution"
124
  msgstr ""
125
 
126
+ #: admin/class-ip-geo-block-admin.php:381
127
  msgid "Toggle all"
128
  msgstr ""
129
 
130
+ #: admin/class-ip-geo-block-admin.php:405
131
  msgid "Thanks for providing these great services for free."
132
  msgstr ""
133
 
134
+ #: admin/class-ip-geo-block-admin.php:406
135
  msgid ""
136
  "(Most browsers will redirect you to each site <a href=\"http://www."
137
  "ipgeoblock.com/etc/referer.html\" title=\"Referer Checker\">without referrer "
138
  "when you click the link</a>.)"
139
  msgstr ""
140
 
141
+ #: admin/class-ip-geo-block-admin.php:411
142
  msgid "Back to top"
143
  msgstr ""
144
 
145
+ #: admin/class-ip-geo-block-admin.php:503
146
  msgid "Enable"
147
  msgstr ""
148
 
149
+ #: admin/class-ip-geo-block-admin.php:819
150
+ #: admin/class-ip-geo-block-admin.php:832
151
+ #: classes/class-ip-geo-block-cron.php:261
152
+ #: classes/class-ip-geo-block-opts.php:310
 
153
  #, php-format
154
  msgid "Unable to write %s. Please check the permission."
155
  msgstr ""
156
 
157
+ #: admin/class-ip-geo-block-admin.php:820
158
  #, php-format
159
  msgid "Or please refer to %s to set it manually."
160
  msgid_plural "Or please refer to %s to set them manually."
194
  msgid "Export logs"
195
  msgstr ""
196
 
197
+ #: admin/includes/tab-accesslog.php:69 admin/includes/tab-settings.php:1228
198
  msgid "Export to the local file"
199
  msgstr ""
200
 
202
  msgid "Export csv"
203
  msgstr ""
204
 
205
+ #: admin/includes/tab-accesslog.php:109 admin/includes/tab-settings.php:363
206
  #, php-format
207
+ msgid "<dfn title=\"Validate request to %s.\">%s</dfn>"
208
  msgstr ""
209
 
210
+ #: admin/includes/tab-accesslog.php:111 admin/includes/tab-settings.php:365
211
  msgid "Comment post"
212
  msgstr ""
213
 
214
+ #: admin/includes/tab-accesslog.php:112 admin/includes/tab-settings.php:366
215
  msgid "XML-RPC"
216
  msgstr ""
217
 
218
+ #: admin/includes/tab-accesslog.php:113 admin/includes/tab-settings.php:367
219
  msgid "Login form"
220
  msgstr ""
221
 
222
+ #: admin/includes/tab-accesslog.php:114 admin/includes/tab-settings.php:368
223
  msgid "Admin area"
224
  msgstr ""
225
 
226
+ #: admin/includes/tab-accesslog.php:115 admin/includes/tab-settings.php:370
227
+ msgid "Pubic facing pages"
 
 
 
 
228
  msgstr ""
229
 
230
  #: admin/includes/tab-accesslog.php:121
345
  msgid "(comma or RET separated)"
346
  msgstr ""
347
 
348
+ #: admin/includes/tab-settings.php:107 admin/includes/tab-settings.php:671
349
  msgid "Matching rule"
350
  msgstr ""
351
 
398
  "directory.\">Response code</dfn> %s"
399
  msgstr ""
400
 
401
+ #: admin/includes/tab-settings.php:268
402
  msgid ""
403
  "<dfn title=\"Specify the URL for response code 2xx and 3xx. Front-end URL on "
404
  "your site would not be blocked to prevent loop of redirection even when you "
406
  "\">Redirect URL</dfn>"
407
  msgstr ""
408
 
409
+ #: admin/includes/tab-settings.php:285
410
  msgid ""
411
  "<dfn title=\"Specify the message for response code 4xx and 5xx.\">Response "
412
  "message</dfn>"
413
  msgstr ""
414
 
415
+ #: admin/includes/tab-settings.php:302
416
  msgid ""
417
  "<dfn title=\"Applied to &#8220;XML-RPC&#8221; and &#8220;Login form&#8221;. "
418
  "Lockout period is defined as expiration time at &#8220;Cache settings&#8221;."
419
  "\">Max number of failed login attempts per IP address</dfn>"
420
  msgstr ""
421
 
422
+ #: admin/includes/tab-settings.php:329
423
  msgid "Select when to run the validation."
424
  msgstr ""
425
 
426
+ #: admin/includes/tab-settings.php:329
427
  msgid "Validation timing"
428
  msgstr ""
429
 
430
+ #: admin/includes/tab-settings.php:340
431
  msgid "&#8220;init&#8221; action hook"
432
  msgstr ""
433
 
434
+ #: admin/includes/tab-settings.php:341
435
  msgid "&#8220;mu-plugins&#8221; (ip-geo-block-mu.php)"
436
  msgstr ""
437
 
438
+ #: admin/includes/tab-settings.php:344
439
  msgid ""
440
  "Validate at &#8220;init&#8221; action hook in the same manner as typical "
441
  "plugins."
442
  msgstr ""
443
 
444
+ #: admin/includes/tab-settings.php:345
445
  msgid ""
446
  "Validate at an earlier phase than other typical plugins. It can reduce load "
447
+ "on server but has <a href='http://www.ipgeoblock.com/codex/validation-timing."
448
+ "html' title='Validation timing | IP Geo Block'>some restrictions</a>."
 
449
  msgstr ""
450
 
451
+ #: admin/includes/tab-settings.php:357
452
  msgid "Back-end target settings"
453
  msgstr ""
454
 
455
+ #: admin/includes/tab-settings.php:369
 
 
 
 
 
456
  msgid "Other areas"
457
  msgstr ""
458
 
459
+ #: admin/includes/tab-settings.php:388 admin/includes/tab-settings.php:408
460
+ #: admin/includes/tab-settings.php:441 admin/includes/tab-settings.php:447
461
+ #: admin/includes/tab-settings.php:659
462
  msgid "Block by country"
463
  msgstr ""
464
 
465
+ #: admin/includes/tab-settings.php:407 admin/includes/tab-settings.php:514
466
+ #: admin/includes/tab-settings.php:992
467
  msgid "Disable"
468
  msgstr ""
469
 
470
+ #: admin/includes/tab-settings.php:409
471
  msgid "Completely close"
472
  msgstr ""
473
 
474
+ #: admin/includes/tab-settings.php:442
475
  msgid ""
476
  "<dfn title=\"Specify the individual action as a blocking target.\">Target "
477
  "actions</dfn>"
478
  msgstr ""
479
 
480
+ #: admin/includes/tab-settings.php:448
481
  msgid "Prevent Zero-day Exploit"
482
  msgstr ""
483
 
484
+ #: admin/includes/tab-settings.php:452
485
  msgid ""
486
  "It will block a request related to the services for both public facing pages "
487
  "and the dashboard."
488
  msgstr ""
489
 
490
+ #: admin/includes/tab-settings.php:453
491
  msgid ""
492
  "Regardless of the country code, it will block a malicious request related to "
493
  "the services only for the dashboard."
494
  msgstr ""
495
 
496
+ #: admin/includes/tab-settings.php:480
497
  msgid "Admin ajax/post"
498
  msgstr ""
499
 
500
+ #: admin/includes/tab-settings.php:500
501
+ msgid "Exception for admin action and page"
 
 
502
  msgstr ""
503
 
504
+ #: admin/includes/tab-settings.php:516
505
  #, php-format
506
  msgid ""
507
  "Regardless of the country code, it will block a malicious request to <code>"
508
  "%s&hellip;/*.php</code>."
509
  msgstr ""
510
 
511
+ #: admin/includes/tab-settings.php:517
512
  #, php-format
513
  msgid ""
514
+ "It configures &#8220%s&#8221 to validate a request to the PHP file which "
515
  "does not load WordPress core."
516
  msgstr ""
517
 
518
+ #: admin/includes/tab-settings.php:518
519
  msgid ""
520
  "<dfn title=\"Select the item which causes undesired blocking in order to "
521
  "exclude from the validation target. Grayed item indicates &#8220;"
522
  "INACTIVE&#8221;.\">Exceptions</dfn>"
523
  msgstr ""
524
 
525
+ #: admin/includes/tab-settings.php:554 admin/includes/tab-settings.php:607
526
  msgid "Force to load WP core"
527
  msgstr ""
528
 
529
+ #: admin/includes/tab-settings.php:559
530
  msgid "Plugins area"
531
  msgstr ""
532
 
533
+ #: admin/includes/tab-settings.php:612
534
  msgid "Themes area"
535
  msgstr ""
536
 
537
+ #: admin/includes/tab-settings.php:640
538
  msgid "Front-end target settings"
539
  msgstr ""
540
 
541
+ #: admin/includes/tab-settings.php:664
542
  msgid "Follow &#8220;Validation rule settings&#8221;"
543
  msgstr ""
544
 
545
+ #: admin/includes/tab-settings.php:721
546
  msgid ""
547
  "<dfn title=\"Specify the individual page as a blocking target.\">Page</dfn>"
548
  msgstr ""
549
 
550
+ #: admin/includes/tab-settings.php:733
551
  msgid ""
552
  "<dfn title=\"Specify the individual post type on a single page as a blocking "
553
  "target.\">Post type</dfn>"
554
  msgstr ""
555
 
556
+ #: admin/includes/tab-settings.php:745
557
  msgid ""
558
  "<dfn title=\"Specify the individual category on a single page or archive "
559
  "page as a blocking target.\">Category</dfn>"
560
  msgstr ""
561
 
562
+ #: admin/includes/tab-settings.php:757
563
  msgid ""
564
  "<dfn title=\"Specify the individual tag on a single page or archive page as "
565
  "a blocking target.\">Tag</dfn>"
566
  msgstr ""
567
 
568
+ #: admin/includes/tab-settings.php:772
569
  msgid "Specify the validation target on front-end."
570
  msgstr ""
571
 
572
+ #: admin/includes/tab-settings.php:772
573
  msgid "Validation target"
574
  msgstr ""
575
 
576
+ #: admin/includes/tab-settings.php:783
577
  msgid "All requests"
578
  msgstr ""
579
 
580
+ #: admin/includes/tab-settings.php:784
581
  msgid "Specify the targets"
582
  msgstr ""
583
 
584
+ #: admin/includes/tab-settings.php:787
585
  msgid ""
586
  "Notice that &#8220;Validation timing&#8221; is deferred till &#8220;"
587
  "wp&#8221; action hook. It means that this feature would not be compatible "
588
  "with any page caching."
589
  msgstr ""
590
 
591
+ #: admin/includes/tab-settings.php:797
592
  msgid ""
593
  "A part of user agent string and a qualification connected with a separator "
594
  "that indicates an applicable rule and can be &#8220;:&#8221; (pass) or "
598
  "qualification&#8221;."
599
  msgstr ""
600
 
601
+ #: admin/includes/tab-settings.php:797
602
  msgid "UA string and qualification"
603
  msgstr ""
604
 
605
+ #: admin/includes/tab-settings.php:816
606
  msgid "Specify the name of action that is invariably blocked."
607
  msgstr ""
608
 
609
+ #: admin/includes/tab-settings.php:816
610
  msgid "Excluded actions"
611
  msgstr ""
612
 
613
+ #: admin/includes/tab-settings.php:835
614
  msgid ""
615
  "It enables to simulate validation without deployment. The results can be "
616
+ "found at &#8220;Pubic facing pages&#8221; in Logs."
617
  msgstr ""
618
 
619
+ #: admin/includes/tab-settings.php:835
620
  msgid "Simulation mode"
621
  msgstr ""
622
 
623
+ #: admin/includes/tab-settings.php:854
624
  msgid "Geolocation API settings"
625
  msgstr ""
626
 
627
+ #: admin/includes/tab-settings.php:863
628
  msgid ""
629
  "<dfn title=\"Cache and local database are scanned at the top priority.\">API "
630
  "selection and key settings</dfn>"
631
  msgstr ""
632
 
633
+ #: admin/includes/tab-settings.php:885
634
  #, php-format
635
  msgid ""
636
+ "Please download <a href=\"https://github.com/tokkonopapa/WordPress-IP-Geo-"
637
+ "API/archive/master.zip\" title=\"Download the contents of tokkonopapa/"
638
+ "WordPress-IP-Geo-API as a zip file\">ZIP file</a> from <a href=\"https://"
639
+ "github.com/tokkonopapa/WordPress-IP-Geo-API\" title=\"tokkonopapa/WordPress-"
640
+ "IP-Geo-API - GitHub\">WordPress-IP-Geo-API</a> and upload <code>ip-geo-api</"
641
+ "code> to <code>%s</code> with write permission."
642
  msgstr ""
643
 
644
+ #: admin/includes/tab-settings.php:894
645
  msgid "Local database settings"
646
  msgstr ""
647
 
648
+ #: admin/includes/tab-settings.php:909
649
  msgid "database"
650
  msgstr ""
651
 
652
+ #: admin/includes/tab-settings.php:910 classes/class-ip-geo-block-cron.php:306
653
  #, php-format
654
  msgid "Last update: %s"
655
  msgstr ""
656
 
657
+ #: admin/includes/tab-settings.php:919
658
  msgid "Auto updating (once a month)"
659
  msgstr ""
660
 
661
+ #: admin/includes/tab-settings.php:936
662
  msgid "Download database"
663
  msgstr ""
664
 
665
+ #: admin/includes/tab-settings.php:944
666
  msgid "Download now"
667
  msgstr ""
668
 
669
+ #: admin/includes/tab-settings.php:956
670
  msgid "Record settings"
671
  msgstr ""
672
 
673
+ #: admin/includes/tab-settings.php:965
674
  msgid "Record validation statistics"
675
  msgstr ""
676
 
677
+ #: admin/includes/tab-settings.php:981
678
  msgid "Record validation logs"
679
  msgstr ""
680
 
681
+ #: admin/includes/tab-settings.php:993
682
  msgid "Only when blocked"
683
  msgstr ""
684
 
685
+ #: admin/includes/tab-settings.php:994
686
  msgid "Only when passed"
687
  msgstr ""
688
 
689
+ #: admin/includes/tab-settings.php:995
690
  msgid "Unauthenticated user"
691
  msgstr ""
692
 
693
+ #: admin/includes/tab-settings.php:996
694
  msgid "Authenticated user"
695
  msgstr ""
696
 
697
+ #: admin/includes/tab-settings.php:997
698
  msgid "All of validation"
699
  msgstr ""
700
 
701
+ #: admin/includes/tab-settings.php:1006
702
  msgid "Recording period of the logs (days)"
703
  msgstr ""
704
 
705
+ #: admin/includes/tab-settings.php:1022
706
  msgid "Maximum length of logs for each target"
707
  msgstr ""
708
 
709
+ #: admin/includes/tab-settings.php:1039
710
  msgid ""
711
  "<dfn title=\"e.g. action, comment, log, pwd\">$_POST keys to be recorded "
712
  "with their values in logs</dfn>"
713
  msgstr ""
714
 
715
+ #: admin/includes/tab-settings.php:1057
716
  msgid "<dfn title=\"e.g. 123.456.789.***\">Anonymize IP address</dfn>"
717
  msgstr ""
718
 
719
+ #: admin/includes/tab-settings.php:1075
720
  msgid "IP address cache settings"
721
  msgstr ""
722
 
723
+ #: admin/includes/tab-settings.php:1084
724
  #, php-format
725
  msgid ""
726
  "<dfn title=\"If user authentication fails consecutively %d times, subsequent "
728
  "\">Expiration time [sec]</dfn>"
729
  msgstr ""
730
 
731
+ #: admin/includes/tab-settings.php:1100
732
  msgid "Garbage collection period [sec]"
733
  msgstr ""
734
 
735
+ #: admin/includes/tab-settings.php:1117
736
  msgid "Number of entries to be displayed in cache"
737
  msgstr ""
738
 
739
+ #: admin/includes/tab-settings.php:1136
740
  msgid "Submission settings"
741
  msgstr ""
742
 
743
+ #: admin/includes/tab-settings.php:1148
744
  msgid "The whole will be wrapped by &lt;p&gt; tag. Allowed tags: "
745
  msgstr ""
746
 
747
+ #: admin/includes/tab-settings.php:1148
748
  msgid "Message on comment form"
749
  msgstr ""
750
 
751
+ #: admin/includes/tab-settings.php:1160
752
  msgid "None"
753
  msgstr ""
754
 
755
+ #: admin/includes/tab-settings.php:1161
756
  msgid "Top"
757
  msgstr ""
758
 
759
+ #: admin/includes/tab-settings.php:1162
760
  msgid "Bottom"
761
  msgstr ""
762
 
763
+ #: admin/includes/tab-settings.php:1174
764
  msgid "Plugin settings"
765
  msgstr ""
766
 
767
+ #: admin/includes/tab-settings.php:1183
768
  msgid "Remove all settings at uninstallation"
769
  msgstr ""
770
 
771
+ #: admin/includes/tab-settings.php:1201
772
  msgid ""
773
  "<dfn title=\"Valid key for Google Maps JavaScript API\">Google Maps API key</"
774
  "dfn>"
775
  msgstr ""
776
 
777
+ #: admin/includes/tab-settings.php:1215
778
  msgid ""
779
  "You need to click the &#8220;Save Changes&#8221; button for imported "
780
  "settings to take effect."
781
  msgstr ""
782
 
783
+ #: admin/includes/tab-settings.php:1221
784
  msgid "Export / Import settings"
785
  msgstr ""
786
 
787
+ #: admin/includes/tab-settings.php:1228
788
  msgid "Export settings"
789
  msgstr ""
790
 
791
+ #: admin/includes/tab-settings.php:1229
792
  msgid "Import from the local file"
793
  msgstr ""
794
 
795
+ #: admin/includes/tab-settings.php:1229
796
  msgid "Import settings"
797
  msgstr ""
798
 
799
+ #: admin/includes/tab-settings.php:1238
800
  msgid "Import pre-defined settings"
801
  msgstr ""
802
 
803
+ #: admin/includes/tab-settings.php:1245
804
  msgid ""
805
  "Import the default settings to revert to the &#8220;Right after "
806
  "installing&#8221; state"
807
  msgstr ""
808
 
809
+ #: admin/includes/tab-settings.php:1245
810
  msgid "Default settings"
811
  msgstr ""
812
 
813
+ #: admin/includes/tab-settings.php:1246
814
  msgid ""
815
  "Import the preferred settings mainly for the &#8220;Validation target "
816
  "settings&#8221;"
817
  msgstr ""
818
 
819
+ #: admin/includes/tab-settings.php:1246
820
+ msgid "Best practice"
 
 
 
 
 
 
 
 
 
 
 
 
821
  msgstr ""
822
 
823
+ #: admin/includes/tab-settings.php:1256
 
 
 
 
824
  msgid "Delete DB table for validation logs"
825
  msgstr ""
826
 
827
+ #: admin/includes/tab-settings.php:1264
828
  msgid "Delete now"
829
  msgstr ""
830
 
831
+ #: admin/includes/tab-settings.php:1272
832
  msgid "Create DB table for validation logs"
833
  msgstr ""
834
 
835
+ #: admin/includes/tab-settings.php:1280
836
  msgid "Create now"
837
  msgstr ""
838
 
839
+ #: admin/includes/tab-settings.php:1295
840
  msgid ""
841
+ "To enhance the protection ability, please refer to &#8220;<a href=\"http://"
842
+ "www.ipgeoblock.com/codex/the-best-practice-of-target-settings.html\" title="
843
+ "\"The best practice of target settings | IP Geo Block\">The best practice of "
844
+ "target settings</a>&#8221;."
845
  msgstr ""
846
 
847
+ #: admin/includes/tab-settings.php:1296
848
  msgid ""
849
+ "If you have any troubles with these, please open an issue at <a class=\"ip-"
850
+ "geo-block-link\" href=\"http://wordpress.org/support/plugin/ip-geo-block\" "
851
+ "title=\"WordPress &#8250; Support &raquo; IP Geo Block\" "
852
+ "target=_blank>support forum</a>."
 
853
  msgstr ""
854
 
855
+ #: admin/includes/tab-settings.php:1303
856
  msgid ""
857
  "While Maxmind and IP2Location will fetch the local database, others will "
858
  "pass an IP address to the APIs via HTTP."
859
  msgstr ""
860
 
861
+ #: admin/includes/tab-settings.php:1304
862
  msgid ""
863
  "Please select the appropriate APIs to fit the privacy law in your country."
864
  msgstr ""
865
 
866
+ #: admin/includes/tab-settings.php:1311
867
  msgid ""
868
+ "Please refer to the document &#8220;<a href=\"http://www.ipgeoblock.com/"
869
+ "codex/#blocking-on-front-end\" title=\"Codex | IP Geo Block\" "
870
+ "target=_blank>Blocking on front-end</a>&#8221; for details, including "
871
+ "restrictions on cache plugin."
872
  msgstr ""
873
 
874
+ #: admin/includes/tab-settings.php:1312
875
  msgid ""
876
  "If you find any issues or have something to suggest, please feel free to "
877
+ "open an issue at <a class=\"ip-geo-block-link\" href=\"http://wordpress.org/"
878
+ "support/plugin/ip-geo-block\" title=\"WordPress &#8250; Support &raquo; IP "
879
+ "Geo Block\" target=_blank>support forum</a>."
880
  msgstr ""
881
 
882
  #: admin/includes/tab-statistics.php:24 admin/includes/tab-statistics.php:184
957
  "<strong>you'll be blocked</strong> after the cache expires."
958
  msgstr ""
959
 
960
+ #: classes/class-ip-geo-block-cron.php:224
961
  msgid "Your database file is up-to-date."
962
  msgstr ""
963
 
964
+ #: classes/class-ip-geo-block-cron.php:253
 
965
  #, php-format
966
  msgid "Unable to read %s. Please check the permission."
967
  msgstr ""
968
 
969
+ #: classes/class-ip-geo-block-logs.php:131
 
 
 
 
 
 
970
  #, php-format
971
  msgid ""
972
  "Creating a DB table %s had failed. Once de-activate this plugin, and then "
973
  "activate again."
974
  msgstr ""
975
 
976
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:145
977
+ #: wp-content/ip-geo-api/ip2location/class-ip2location.php:174
978
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:149
979
  #: wp-content/ip-geo-api/maxmind/class-maxmind.php:178
980
  msgid "Database file does not exist."
wp-content/ip-geo-api/ip2location/IP2Location.php CHANGED
@@ -204,7 +204,6 @@ class IP2Location {
204
  throw new Exception('IP2Location.class.php: Unable to open file "' . $file . '".');
205
  }
206
 
207
- flock($fp, LOCK_SH); // @since 1.1.6
208
  $stats = fstat($fp);
209
 
210
  if ($shm_id = @shmop_open(self::SHM_KEY, 'w', 0, 0)) {
@@ -221,7 +220,6 @@ class IP2Location {
221
  }
222
  shmop_close($shm_id);
223
  }
224
- flock($fp, LOCK_UN); // @since 1.1.6
225
  fclose($fp);
226
 
227
  $this->shmId = @shmop_open(self::SHM_KEY, 'a', 0, 0);
@@ -235,13 +233,11 @@ class IP2Location {
235
  default:
236
  $this->mode = self::FILE_IO;
237
  $this->resource = fopen($file, 'rb');
238
- flock($this->resource, LOCK_SH); // @since 1.1.6
239
 
240
  if ($mode == self::MEMORY_CACHE) {
241
  $this->mode = self::MEMORY_CACHE;
242
  $stats = fstat($this->resource);
243
  $this->buffer = fread($this->resource, $stats['size']);
244
- $this->close(); // @since 1.1.6
245
  }
246
  }
247
 
@@ -258,19 +254,6 @@ class IP2Location {
258
  $this->result = new IP2LocationRecord();
259
  }
260
 
261
- /**
262
- * Close resource.
263
- *
264
- * @since 1.1.6
265
- */
266
- public function close() {
267
- if ($this->resource) {
268
- flock($this->resource, LOCK_UN);
269
- fclose($this->resource);
270
- $this->resource = NULL;
271
- }
272
- }
273
-
274
  /**
275
  * Read bytes.
276
  */
204
  throw new Exception('IP2Location.class.php: Unable to open file "' . $file . '".');
205
  }
206
 
 
207
  $stats = fstat($fp);
208
 
209
  if ($shm_id = @shmop_open(self::SHM_KEY, 'w', 0, 0)) {
220
  }
221
  shmop_close($shm_id);
222
  }
 
223
  fclose($fp);
224
 
225
  $this->shmId = @shmop_open(self::SHM_KEY, 'a', 0, 0);
233
  default:
234
  $this->mode = self::FILE_IO;
235
  $this->resource = fopen($file, 'rb');
 
236
 
237
  if ($mode == self::MEMORY_CACHE) {
238
  $this->mode = self::MEMORY_CACHE;
239
  $stats = fstat($this->resource);
240
  $this->buffer = fread($this->resource, $stats['size']);
 
241
  }
242
  }
243
 
254
  $this->result = new IP2LocationRecord();
255
  }
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  /**
258
  * Read bytes.
259
  */
wp-content/ip-geo-api/ip2location/class-ip2location.php CHANGED
@@ -11,7 +11,7 @@ define( 'IP_GEO_BLOCK_IP2LOC_IPV4_ZIP', 'http://download.ip2location.com/lite/IP
11
  define( 'IP_GEO_BLOCK_IP2LOC_IPV6_ZIP', 'http://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP' );
12
 
13
  /**
14
- * Class for IP2Location (ver. 1.1.6)
15
  *
16
  * URL : http://www.ip2location.com/
17
  * Term of use : http://www.ip2location.com/terms
@@ -63,10 +63,8 @@ class IP_Geo_Block_API_IP2Location extends IP_Geo_Block_API {
63
  try {
64
  $geo = new IP2Location( $file );
65
  if ( $geo && ( $geo->get_database_type() & $type ) ) {
66
- $data = $geo->lookup( $ip );
67
- $geo->close(); // @since 1.1.6
68
-
69
  $res = array();
 
70
 
71
  foreach ( $this->transform_table as $key => $val ) {
72
  if ( isset( $data->$val ) && IP2Location::FIELD_NOT_SUPPORTED !== $data->$val )
11
  define( 'IP_GEO_BLOCK_IP2LOC_IPV6_ZIP', 'http://download.ip2location.com/lite/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP' );
12
 
13
  /**
14
+ * Class for IP2Location (ver. 1.1.5)
15
  *
16
  * URL : http://www.ip2location.com/
17
  * Term of use : http://www.ip2location.com/terms
63
  try {
64
  $geo = new IP2Location( $file );
65
  if ( $geo && ( $geo->get_database_type() & $type ) ) {
 
 
 
66
  $res = array();
67
+ $data = $geo->lookup( $ip );
68
 
69
  foreach ( $this->transform_table as $key => $val ) {
70
  if ( isset( $data->$val ) && IP2Location::FIELD_NOT_SUPPORTED !== $data->$val )
wp-content/ip-geo-api/maxmind/class-maxmind.php CHANGED
@@ -11,7 +11,7 @@ define( 'IP_GEO_BLOCK_MAXMIND_IPV4_ZIP', 'http://geolite.maxmind.com/download/ge
11
  define( 'IP_GEO_BLOCK_MAXMIND_IPV6_ZIP', 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz' );
12
 
13
  /**
14
- * Class for Maxmind (ver. 1.1.6)
15
  *
16
  * URL : http://dev.maxmind.com/geoip/legacy/geolite/
17
  * Term of use : http://dev.maxmind.com/geoip/legacy/geolite/#License
11
  define( 'IP_GEO_BLOCK_MAXMIND_IPV6_ZIP', 'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz' );
12
 
13
  /**
14
+ * Class for Maxmind (ver. 1.1.5)
15
  *
16
  * URL : http://dev.maxmind.com/geoip/legacy/geolite/
17
  * Term of use : http://dev.maxmind.com/geoip/legacy/geolite/#License
wp-content/ip-geo-api/maxmind/geoip.inc CHANGED
@@ -255,8 +255,7 @@ function geoip_open($filename, $flags)
255
  if ($gi->flags & GEOIP_SHARED_MEMORY) {
256
  $gi->shmid = @shmop_open(GEOIP_SHM_KEY, "a", 0, 0);
257
  } else {
258
- $gi->filehandle = fopen($filename, "rb"); if (!$gi->filehandle) return FALSE; // or die("Can not open $filename\n");
259
- flock($gi->filehandle, LOCK_SH); // @since 1.1.6
260
  if ($gi->flags & GEOIP_MEMORY_CACHE) {
261
  $s_array = fstat($gi->filehandle);
262
  $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
@@ -273,7 +272,7 @@ function geoip_close($gi)
273
  return true;
274
  }
275
 
276
- return flock($gi->filehandle, LOCK_UN) and fclose($gi->filehandle); // @since 1.1.6
277
  }
278
 
279
  function geoip_country_id_by_addr_v6($gi, $addr)
255
  if ($gi->flags & GEOIP_SHARED_MEMORY) {
256
  $gi->shmid = @shmop_open(GEOIP_SHM_KEY, "a", 0, 0);
257
  } else {
258
+ $gi->filehandle = fopen($filename, "rb") or die("Can not open $filename\n");
 
259
  if ($gi->flags & GEOIP_MEMORY_CACHE) {
260
  $s_array = fstat($gi->filehandle);
261
  $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
272
  return true;
273
  }
274
 
275
+ return fclose($gi->filehandle);
276
  }
277
 
278
  function geoip_country_id_by_addr_v6($gi, $addr)
wp-content/mu-plugins/ip-geo-block-mu.php CHANGED
@@ -10,7 +10,7 @@
10
  * @link http://www.ipgeoblock.com/
11
  * @copyright 2013-2016 tokkonopapa
12
  *
13
- * Plugin Name: IP Geo Block (mu)
14
  * Plugin URI: http://wordpress.org/plugins/ip-geo-block/
15
  * Description: It blocks any spams, login attempts and malicious access to the admin area posted from outside your nation, and also prevents zero-day exploit.
16
  * Version: 3.0.0
10
  * @link http://www.ipgeoblock.com/
11
  * @copyright 2013-2016 tokkonopapa
12
  *
13
+ * Plugin Name: IP Geo Block
14
  * Plugin URI: http://wordpress.org/plugins/ip-geo-block/
15
  * Description: It blocks any spams, login attempts and malicious access to the admin area posted from outside your nation, and also prevents zero-day exploit.
16
  * Version: 3.0.0