IP Geo Block - Version 3.0.10.4

Version Description

  • Fix: JavaScript error caused by bad handling form tag without method property. This error was happened with Wordfence Live Traffic.
  • Fix: Inconsistent tags on the settings dashboard.
  • Fix: "Add AS number to Whitelist/Blacklist" at "Bulk action" in "Statistics in cache" section on "Statistics" tab did not work properly because of illegal regular expression.
  • Fix: Add a fallback function to support WP 3.7 and PHP before 5.3.
Download this release

Release Info

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

Code changes from version 3.0.10.3 to 3.0.10.4

README.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: tokkonopapa
3
  Donate link:
4
  Tags: security, firewall, brute force, vulnerability, login, wp-admin, admin, ajax, xmlrpc, comment, pingback, trackback, spam, IP address, geo, geolocation, buddypress, bbPress
5
  Requires at least: 3.7
6
- Tested up to: 4.9.4
7
- Stable tag: 3.0.10.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
10
 
@@ -356,6 +356,12 @@ Please refer to "[How can I fix permission troubles?](http://www.ipgeoblock.com/
356
 
357
  == Changelog ==
358
 
 
 
 
 
 
 
359
  = 3.0.10.3 =
360
  * **Fix:** Add a fallback process to add some fields into database table especially for MariaDB.
361
  * **Fix:** Fatal error that would cause a blank page in PHP 5.3 and under or single site.
3
  Donate link:
4
  Tags: security, firewall, brute force, vulnerability, login, wp-admin, admin, ajax, xmlrpc, comment, pingback, trackback, spam, IP address, geo, geolocation, buddypress, bbPress
5
  Requires at least: 3.7
6
+ Tested up to: 4.9.5
7
+ Stable tag: 3.0.10.4
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.txt
10
 
356
 
357
  == Changelog ==
358
 
359
+ = 3.0.10.4 =
360
+ * **Fix:** JavaScript error caused by bad handling form tag without method property. This error was happened with Wordfence Live Traffic.
361
+ * **Fix:** Inconsistent tags on the settings dashboard.
362
+ * **Fix:** "Add AS number to Whitelist/Blacklist" at "Bulk action" in "Statistics in cache" section on "Statistics" tab did not work properly because of illegal regular expression.
363
+ * **Fix:** Add a fallback function to support WP 3.7 and PHP before 5.3.
364
+
365
  = 3.0.10.3 =
366
  * **Fix:** Add a fallback process to add some fields into database table especially for MariaDB.
367
  * **Fix:** Fatal error that would cause a blank page in PHP 5.3 and under or single site.
admin/class-ip-geo-block-admin.php CHANGED
@@ -665,8 +665,8 @@ class IP_Geo_Block_Admin {
665
  1 => __( 'Statistics', 'ip-geo-block' ),
666
  4 => __( 'Logs', 'ip-geo-block' ),
667
  2 => __( 'Search', 'ip-geo-block' ),
668
- 5 => __( 'Site List', 'ip-geo-block' ),
669
  3 => __( 'Attribution', 'ip-geo-block' ),
 
670
  );
671
 
672
  $settings = IP_Geo_Block::get_option();
@@ -758,8 +758,8 @@ class IP_Geo_Block_Admin {
758
  1 => 'admin/includes/tab-statistics.php',
759
  4 => 'admin/includes/tab-accesslog.php',
760
  2 => 'admin/includes/tab-geolocation.php',
761
- 5 => 'admin/includes/tab-network.php',
762
  3 => 'admin/includes/tab-attribution.php',
 
763
  );
764
 
765
  require_once IP_GEO_BLOCK_PATH . $files[ $this->admin_tab ];
@@ -795,22 +795,18 @@ class IP_Geo_Block_Admin {
795
  echo "\n<ul class=\"ip-geo-block-list\">\n";
796
  foreach ( $args['providers'] as $key => $val ) {
797
  $id = "${args['option']}_providers_{$key}";
798
- $name = "${args['option']}[providers][$key]"; ?>
 
 
 
799
  <li>
800
- <input type="checkbox" id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="<?php echo $val; ?>"<?php
801
- checked(
802
- ( NULL === $val && ! isset( $args['value'][ $key ] ) ) ||
803
- ( FALSE === $val && ! empty( $args['value'][ $key ] ) ) ||
804
- ( is_string( $val ) && ! empty( $args['value'][ $key ] ) )
805
- ); ?> />
806
  <label for="<?php echo $id; ?>"><?php echo '<dfn title="', esc_attr( $args['titles'][ $key ] ), '">', $key, '</dfn>'; ?></label>
807
- <?php
808
- if ( is_string( $val ) ) { ?>
809
  <input type="text" class="regular-text code" name="<?php echo $name; ?>" value="<?php echo esc_attr( isset( $args['value'][ $key ] ) ? $args['value'][ $key ] : '' ); ?>"<?php if ( ! isset( $val ) ) disabled( TRUE, TRUE ); ?> />
 
810
  </li>
811
- <?php
812
- }
813
- }
814
  echo "</ul>\n";
815
  break;
816
 
@@ -824,8 +820,8 @@ class IP_Geo_Block_Admin {
824
  if ( isset( $args['desc'][ $key ] ) )
825
  echo '<dfn title="', $args['desc'][ $key ], '">', $val, '</dfn>';
826
  else
827
- echo $val;
828
- ?></label>
829
  </li>
830
  <?php
831
  }
@@ -916,7 +912,7 @@ class IP_Geo_Block_Admin {
916
  $default = IP_Geo_Block::get_default();
917
 
918
  // Integrate posted data into current settings because it can be a part of hole data
919
- $input = array_replace_recursive(
920
  $output = $this->preprocess_options( $output, $default ), $input
921
  );
922
 
@@ -1189,6 +1185,46 @@ class IP_Geo_Block_Admin {
1189
  return $output;
1190
  }
1191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1192
  // Callback for preg_replace_callback()
1193
  public function strtoupper( $matches ) {
1194
  return filter_var( $matches[1], FILTER_VALIDATE_IP ) ? $matches[0] : strtoupper( $matches[0] );
@@ -1442,11 +1478,11 @@ class IP_Geo_Block_Admin {
1442
  foreach ( array_unique( (array)$which[ $src ] ) as $val ) {
1443
  // replace anonymized IP address with CIDR (IPv4:256, IPv6:4096)
1444
  $val = preg_replace(
1445
- array( '!\.\*\*\*$!', '!\*\*\*$!' ),
1446
- array( '.0/24', '000/116' ),
1447
  $val
1448
  );
1449
- if ( ( filter_var( preg_replace( '!/\d+$!', '', $val ), FILTER_VALIDATE_IP ) || preg_match( '^AS\d+$', $val ) ) &&
1450
  ( FALSE === strpos( $settings['extra_ips'][ $dst ], $val ) ) ) {
1451
  $settings['extra_ips'][ $dst ] .= "\n" . $val;
1452
  }
665
  1 => __( 'Statistics', 'ip-geo-block' ),
666
  4 => __( 'Logs', 'ip-geo-block' ),
667
  2 => __( 'Search', 'ip-geo-block' ),
 
668
  3 => __( 'Attribution', 'ip-geo-block' ),
669
+ 5 => __( 'Site List', 'ip-geo-block' ),
670
  );
671
 
672
  $settings = IP_Geo_Block::get_option();
758
  1 => 'admin/includes/tab-statistics.php',
759
  4 => 'admin/includes/tab-accesslog.php',
760
  2 => 'admin/includes/tab-geolocation.php',
 
761
  3 => 'admin/includes/tab-attribution.php',
762
+ 5 => 'admin/includes/tab-network.php',
763
  );
764
 
765
  require_once IP_GEO_BLOCK_PATH . $files[ $this->admin_tab ];
795
  echo "\n<ul class=\"ip-geo-block-list\">\n";
796
  foreach ( $args['providers'] as $key => $val ) {
797
  $id = "${args['option']}_providers_{$key}";
798
+ $name = "${args['option']}[providers][$key]";
799
+ $stat = ( NULL === $val && ! isset( $args['value'][ $key ] ) ) ||
800
+ ( FALSE === $val && ! empty( $args['value'][ $key ] ) ) ||
801
+ ( is_string( $val ) && ! empty( $args['value'][ $key ] ) ); ?>
802
  <li>
803
+ <input type="checkbox" id="<?php echo $id; ?>" name="<?php echo $name; ?>" value="<?php echo $val; ?>"<?php checked( $stat ); ?> />
 
 
 
 
 
804
  <label for="<?php echo $id; ?>"><?php echo '<dfn title="', esc_attr( $args['titles'][ $key ] ), '">', $key, '</dfn>'; ?></label>
805
+ <?php if ( is_string( $val ) ) { ?>
 
806
  <input type="text" class="regular-text code" name="<?php echo $name; ?>" value="<?php echo esc_attr( isset( $args['value'][ $key ] ) ? $args['value'][ $key ] : '' ); ?>"<?php if ( ! isset( $val ) ) disabled( TRUE, TRUE ); ?> />
807
+ <?php } ?>
808
  </li>
809
+ <?php }
 
 
810
  echo "</ul>\n";
811
  break;
812
 
820
  if ( isset( $args['desc'][ $key ] ) )
821
  echo '<dfn title="', $args['desc'][ $key ], '">', $val, '</dfn>';
822
  else
823
+ echo $val; ?>
824
+ </label>
825
  </li>
826
  <?php
827
  }
912
  $default = IP_Geo_Block::get_default();
913
 
914
  // Integrate posted data into current settings because it can be a part of hole data
915
+ $input = $this->array_replace_recursive(
916
  $output = $this->preprocess_options( $output, $default ), $input
917
  );
918
 
1185
  return $output;
1186
  }
1187
 
1188
+ /**
1189
+ * A fallback function of array_replace_recursive() before PHP 5.3.
1190
+ *
1191
+ * @link http://php.net/manual/en/function.array-replace-recursive.php#92574
1192
+ * @link http://php.net/manual/en/function.array-replace-recursive.php#109390
1193
+ */
1194
+ public function array_replace_recursive() {
1195
+ if ( function_exists( 'array_replace_recursive' ) ) {
1196
+ $args = func_get_args();
1197
+ return call_user_func_array( 'array_replace_recursive', $args );
1198
+ }
1199
+
1200
+ else {
1201
+ foreach ( array_slice( func_get_args(), 1 ) as $replacements ) {
1202
+ $bref_stack = array( &$base );
1203
+ $head_stack = array( $replacements );
1204
+
1205
+ do {
1206
+ end( $bref_stack );
1207
+
1208
+ $bref = &$bref_stack[ key( $bref_stack ) ];
1209
+ $head = array_pop( $head_stack );
1210
+
1211
+ unset( $bref_stack[ key( $bref_stack ) ] );
1212
+
1213
+ foreach ( array_keys( $head ) as $key ) {
1214
+ if ( isset( $key, $bref ) && is_array( $bref[ $key ] ) && is_array( $head[ $key ] ) ) {
1215
+ $bref_stack[] = &$bref[ $key ];
1216
+ $head_stack[] = $head [ $key ];
1217
+ } else {
1218
+ $bref[ $key ] = $head [ $key ];
1219
+ }
1220
+ }
1221
+ } while( count( $head_stack ) );
1222
+ }
1223
+
1224
+ return $base;
1225
+ }
1226
+ }
1227
+
1228
  // Callback for preg_replace_callback()
1229
  public function strtoupper( $matches ) {
1230
  return filter_var( $matches[1], FILTER_VALIDATE_IP ) ? $matches[0] : strtoupper( $matches[0] );
1478
  foreach ( array_unique( (array)$which[ $src ] ) as $val ) {
1479
  // replace anonymized IP address with CIDR (IPv4:256, IPv6:4096)
1480
  $val = preg_replace(
1481
+ array( '/\.\*\*\*.*$/', '/\*\*\*.*$/' ),
1482
+ array( '.0/24', '000/116' ),
1483
  $val
1484
  );
1485
+ if ( ( filter_var( preg_replace( '/\/\d+$/', '', $val ), FILTER_VALIDATE_IP ) || preg_match( '/^AS\d+$/', $val ) ) &&
1486
  ( FALSE === strpos( $settings['extra_ips'][ $dst ], $val ) ) ) {
1487
  $settings['extra_ips'][ $dst ] .= "\n" . $val;
1488
  }
admin/includes/class-admin-ajax.php CHANGED
@@ -352,7 +352,7 @@ endif; // TEST_RESTORE_NETWORK
352
  unset( $input['version'] );
353
 
354
  // Integrate posted data into current settings because if can be a part of hole data
355
- $input = array_replace_recursive(
356
  $parent->preprocess_options( IP_Geo_Block::get_option(), IP_Geo_Block::get_default() ), $input
357
  );
358
 
352
  unset( $input['version'] );
353
 
354
  // Integrate posted data into current settings because if can be a part of hole data
355
+ $input = $parent->array_replace_recursive(
356
  $parent->preprocess_options( IP_Geo_Block::get_option(), IP_Geo_Block::get_default() ), $input
357
  );
358
 
admin/js/authenticate.js CHANGED
@@ -458,7 +458,7 @@
458
 
459
  // if admin area then add the nonce
460
  if (is_admin(action) === 1) {
461
- if ('post' === $this.attr('method').toLowerCase()) {
462
  $this.attr('action', add_query_nonce(action, auth.nonce));
463
  } else {
464
  $this.append('<input type="hidden" name="' + wpzep.name + '" value="' + auth.nonce + '">');
@@ -494,15 +494,21 @@
494
  }
495
  }
496
  }
 
 
 
 
 
 
497
  }
498
  }
499
 
500
  $(window).on('error', function (/*event*/) { // event.originalEvent.message
501
- attach_ready(false); // fallback on error
502
  });
503
 
504
  $(function () {
505
- attach_ready(true);
506
  });
507
 
508
  // Attach event to add nonce
458
 
459
  // if admin area then add the nonce
460
  if (is_admin(action) === 1) {
461
+ if ('post' === ($this.attr('method') || '').toLowerCase()) {
462
  $this.attr('action', add_query_nonce(action, auth.nonce));
463
  } else {
464
  $this.append('<input type="hidden" name="' + wpzep.name + '" value="' + auth.nonce + '">');
494
  }
495
  }
496
  }
497
+
498
+ // Hide the title of sub-menu.
499
+ $('#toplevel_page_ip-geo-block li.wp-first-item').each(function (/*i, obj*/) {
500
+ var $this = $(this);
501
+ $this.css('display', 'IP Geo Block' === $this.children('a').text() ? 'none' : 'block');
502
+ });
503
  }
504
  }
505
 
506
  $(window).on('error', function (/*event*/) { // event.originalEvent.message
507
+ attach_ready(); // fallback on error
508
  });
509
 
510
  $(function () {
511
+ attach_ready();
512
  });
513
 
514
  // Attach event to add nonce
admin/js/authenticate.min.js CHANGED
@@ -3,4 +3,4 @@
3
  Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
  This software is released under the MIT License.
5
  */
6
- (function(g,h,k){function y(a){var b=k.createElement("div");b.appendChild(k.createTextNode(a));a=b.innerHTML.replace(/["']/g,function(a){return{'"':"&quot;","'":"&#39;"}[a]});b="";return a}function q(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 m(a,b){"object"!==typeof a&&(a=q(a||h.location.href));for(var e=a.query?a.query.split("&"):[],d=e.length;0<d--;)if(0===e[d].indexOf(l.name)){e.splice(d,1);break}e.push(l.name+"="+encodeURIComponent(b));a.query=e.join("&");return(a.scheme?a.scheme+":":"")+(a.relative+a.path)+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")}function u(a){return(!a.scheme||/^https?$/.test(a.scheme))&&(a.path||a.query)}function n(a){a=a||h.location.pathname;var b=q(a.toLowerCase());if(u(b)){b=z(a);if(b.origin!==h.location.origin)return-1;if((a=A.exec(b.pathname))&&(0<=a[0].indexOf(f.admin+"admin-")||0<=a[0].indexOf(f.admin)||0<=a[0].indexOf(f.plugins)||0<=a[0].indexOf(f.themes)))return 1}return 0}function v(a){return-1!==(a.attr("rel")||"").indexOf("nofollow")}function r(a,b,e){var d=b.split(/\s+/);a.each(function(a){for(a=0;a<d.length;++a){var b=g.trim(d[a]).match(/[^\.]+/i)[0],c=g(this),f=b;b=e;c=g._data(c[0]).events[f];f=b?c.splice(c.delegateCount-1,1)[0]:c.pop();c.splice(b?0:c.delegateCount||0,0,f)}})}function p(){if(!l.init&&(l.init=!0,g("img").each(function(){var a=g(this).attr("src");1===n(a)&&g(this).attr("src",m(a,f.nonce))}),"undefined"!==typeof h._wpRevisionsSettings)){var a,b=h._wpRevisionsSettings.revisionData,e=b.length;for(a=0;a<e;++a)-1===b[a].restoreUrl.indexOf(l.name)&&(h._wpRevisionsSettings.revisionData[a].restoreUrl=m(b[a].restoreUrl,f.nonce))}}var f=IP_GEO_BLOCK_AUTH,l={init:!1,name:"ip-geo-block-auth-nonce"},A=new RegExp("^(?:"+(f.home||"")+f.admin+"|"+(f.home||"")+f.plugins+"|"+(f.home||"")+f.themes+")(?:.*.php|.*/)?$"),w=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},x={"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":w,"network/theme-install.php":w},z=function(){var a=null;try{new URL("/","http://example.com/")}catch(b){try{a=(new DOMParser).parseFromString("<html><head></head><body></body></html>","text/html")}catch(e){a=k.implementation.createHTMLDocument("")}}return function(b,e){var d=k;b="undefined"!==typeof b?b:h.location.href;if(null===a){"undefined"===typeof e&&(e=h.location.href);try{var c=new URL(b,e)}catch(B){c=new URL(b,h.location.href)}}else{if("undefined"!==typeof e){for(d=a;d.head.firstChild;)d.head.removeChild(d.head.firstChild);c=d.createElement("base");c.setAttribute("href",e);d.head.appendChild(c)}d=d.createElement("a");d.setAttribute("href",b);d.setAttribute("href",d.href);c={protocol:d.protocol,host:d.host,hostname:d.hostname,port:d.port,pathname:d.pathname,search:d.search,hash:d.hash,href:d.href,username:"",password:"",origin:d.origin||null};"http:"===c.protocol&&"80"===c.port?(c.port="",c.host=c.host.replace(/:80$/,"")):"https:"===c.protocol&&"443"===c.port&&(c.port="",c.host=c.host.replace(/:443$/,""));if("http:"===c.protocol||"https:"===c.protocol)c.pathname&&"/"!==c.pathname.charAt(0)&&(c.pathname="/"+c.pathname),c.origin||(c.origin=c.protocol+"//"+c.hostname+(c.port?":"+c.port:""))}if(c.username||c.password)throw new URIError(c.username+":"+c.password);return c}}();g.ajaxPrefilter(function(a){if(1===n(a.url)&&!a.url.match(/async-upload\.php$/))if("undefined"!==typeof h.FormData&&a.data instanceof FormData)a.data.append(l.name,f.nonce);else{var b=q(a.url);if("undefined"===typeof a.data||b.query)a.url=m(b,f.nonce);else{b=a.data?a.data.split("&"):[];var e=h.location.pathname;e=e.replace(f.home+f.admin,"");(e=x.hasOwnProperty(e)?x[e]:null)&&(b=e(b));b.push(l.name+"="+encodeURIComponent(f.nonce));a.data=b.join("&")}}});"undefined"===typeof g.fn.onFirst&&(g.fn.onFirst=function(a,b){var e,d=g(this),c="string"===typeof b;g.fn.on.apply(d,arguments);if("object"===typeof a)for(e in a)a.hasOwnProperty(e)&&r(d,e,c);else"string"===typeof a&&r(d,a,c);return d});g(h).on("error",function(){p(!1)});g(function(){p(!0)});(function(){var a=g(k);a.onFirst("click contextmenu","a",function(a){var b=0,d=g(this),c=d.attr("href")||"",k=q(c);u(k)&&(b=n(c));if("click"===a.type)if(1===b)d.attr("href",/\/$/.test(k.path)?c:m(c,v(d)?"nofollow":f.nonce));else if(-1===b&&(1===n(h.location.pathname)||0<=h.location.search.indexOf(l.name))){if(!(b="_self"===d.attr("target")))a:{b=c;var t,r=f.sites.length;for(t=0;t<r;++t){var p=b.indexOf(f.sites[t]+"/");if(0<=p&&6>=p){b=!0;break a}}b=!1}if(b)d.attr("href",/\/$/.test(k.path)?c:m(c,v(d)?"nofollow":f.nonce));else if(!this.hasAttribute("onClick"))return c.split(";",2).shift(),c=y(decodeURIComponent(this.href)),b=h.open(),b.document.write('<!DOCTYPE html><html><head><meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+c+'" />'+(g("body").hasClass("webview")?'<script>window.location.replace("'+c+'")\x3c/script>':"")+"</head></html>"),b.document.close(),a.stopImmediatePropagation(),!1}});a.onFirst("submit","form",function(){var a=g(this),e=a.attr("action");1===n(e)&&("post"===a.attr("method").toLowerCase()?a.attr("action",m(e,f.nonce)):a.append('<input type="hidden" name="'+l.name+'" value="'+f.nonce+'">'))})})()})(jQuery,window,document);
3
  Copyright (c) 2013-2018 tokkonopapa (tokkonopapa@yahoo.com)
4
  This software is released under the MIT License.
5
  */
6
+ (function(g,h,k){function y(a){var b=k.createElement("div");b.appendChild(k.createTextNode(a));a=b.innerHTML.replace(/["']/g,function(a){return{'"':"&quot;","'":"&#39;"}[a]});b="";return a}function q(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 m(a,b){"object"!==typeof a&&(a=q(a||h.location.href));for(var e=a.query?a.query.split("&"):[],d=e.length;0<d--;)if(0===e[d].indexOf(l.name)){e.splice(d,1);break}e.push(l.name+"="+encodeURIComponent(b));a.query=e.join("&");return(a.scheme?a.scheme+":":"")+(a.relative+a.path)+(a.query?"?"+a.query:"")+(a.fragment?"#"+a.fragment:"")}function u(a){return(!a.scheme||/^https?$/.test(a.scheme))&&(a.path||a.query)}function n(a){a=a||h.location.pathname;var b=q(a.toLowerCase());if(u(b)){b=z(a);if(b.origin!==h.location.origin)return-1;if((a=A.exec(b.pathname))&&(0<=a[0].indexOf(f.admin+"admin-")||0<=a[0].indexOf(f.admin)||0<=a[0].indexOf(f.plugins)||0<=a[0].indexOf(f.themes)))return 1}return 0}function v(a){return-1!==(a.attr("rel")||"").indexOf("nofollow")}function r(a,b,e){var d=b.split(/\s+/);a.each(function(a){for(a=0;a<d.length;++a){var b=g.trim(d[a]).match(/[^\.]+/i)[0],c=g(this),f=b;b=e;c=g._data(c[0]).events[f];f=b?c.splice(c.delegateCount-1,1)[0]:c.pop();c.splice(b?0:c.delegateCount||0,0,f)}})}function p(){if(!l.init){l.init=!0;g("img").each(function(){var a=g(this).attr("src");1===n(a)&&g(this).attr("src",m(a,f.nonce))});if("undefined"!==typeof h._wpRevisionsSettings){var a,b=h._wpRevisionsSettings.revisionData,e=b.length;for(a=0;a<e;++a)-1===b[a].restoreUrl.indexOf(l.name)&&(h._wpRevisionsSettings.revisionData[a].restoreUrl=m(b[a].restoreUrl,f.nonce))}g("#toplevel_page_ip-geo-block li.wp-first-item").each(function(){var a=g(this);a.css("display","IP Geo Block"===a.children("a").text()?"none":"block")})}}var f=IP_GEO_BLOCK_AUTH,l={init:!1,name:"ip-geo-block-auth-nonce"},A=new RegExp("^(?:"+(f.home||"")+f.admin+"|"+(f.home||"")+f.plugins+"|"+(f.home||"")+f.themes+")(?:.*.php|.*/)?$"),w=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},x={"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":w,"network/theme-install.php":w},z=function(){var a=null;try{new URL("/","http://example.com/")}catch(b){try{a=(new DOMParser).parseFromString("<html><head></head><body></body></html>","text/html")}catch(e){a=k.implementation.createHTMLDocument("")}}return function(b,e){var d=k;b="undefined"!==typeof b?b:h.location.href;if(null===a){"undefined"===typeof e&&(e=h.location.href);try{var c=new URL(b,e)}catch(B){c=new URL(b,h.location.href)}}else{if("undefined"!==typeof e){for(d=a;d.head.firstChild;)d.head.removeChild(d.head.firstChild);c=d.createElement("base");c.setAttribute("href",e);d.head.appendChild(c)}d=d.createElement("a");d.setAttribute("href",b);d.setAttribute("href",d.href);c={protocol:d.protocol,host:d.host,hostname:d.hostname,port:d.port,pathname:d.pathname,search:d.search,hash:d.hash,href:d.href,username:"",password:"",origin:d.origin||null};"http:"===c.protocol&&"80"===c.port?(c.port="",c.host=c.host.replace(/:80$/,"")):"https:"===c.protocol&&"443"===c.port&&(c.port="",c.host=c.host.replace(/:443$/,""));if("http:"===c.protocol||"https:"===c.protocol)c.pathname&&"/"!==c.pathname.charAt(0)&&(c.pathname="/"+c.pathname),c.origin||(c.origin=c.protocol+"//"+c.hostname+(c.port?":"+c.port:""))}if(c.username||c.password)throw new URIError(c.username+":"+c.password);return c}}();g.ajaxPrefilter(function(a){if(1===n(a.url)&&!a.url.match(/async-upload\.php$/))if("undefined"!==typeof h.FormData&&a.data instanceof FormData)a.data.append(l.name,f.nonce);else{var b=q(a.url);if("undefined"===typeof a.data||b.query)a.url=m(b,f.nonce);else{b=a.data?a.data.split("&"):[];var e=h.location.pathname;e=e.replace(f.home+f.admin,"");(e=x.hasOwnProperty(e)?x[e]:null)&&(b=e(b));b.push(l.name+"="+encodeURIComponent(f.nonce));a.data=b.join("&")}}});"undefined"===typeof g.fn.onFirst&&(g.fn.onFirst=function(a,b){var e,d=g(this),c="string"===typeof b;g.fn.on.apply(d,arguments);if("object"===typeof a)for(e in a)a.hasOwnProperty(e)&&r(d,e,c);else"string"===typeof a&&r(d,a,c);return d});g(h).on("error",function(){p()});g(function(){p()});(function(){var a=g(k);a.onFirst("click contextmenu","a",function(a){var b=0,d=g(this),c=d.attr("href")||"",k=q(c);u(k)&&(b=n(c));if("click"===a.type)if(1===b)d.attr("href",/\/$/.test(k.path)?c:m(c,v(d)?"nofollow":f.nonce));else if(-1===b&&(1===n(h.location.pathname)||0<=h.location.search.indexOf(l.name))){if(!(b="_self"===d.attr("target")))a:{b=c;var t,r=f.sites.length;for(t=0;t<r;++t){var p=b.indexOf(f.sites[t]+"/");if(0<=p&&6>=p){b=!0;break a}}b=!1}if(b)d.attr("href",/\/$/.test(k.path)?c:m(c,v(d)?"nofollow":f.nonce));else if(!this.hasAttribute("onClick"))return c.split(";",2).shift(),c=y(decodeURIComponent(this.href)),b=h.open(),b.document.write('<!DOCTYPE html><html><head><meta name="referrer" content="never" /><meta name="referrer" content="no-referrer" /><meta http-equiv="refresh" content="0; url='+c+'" />'+(g("body").hasClass("webview")?'<script>window.location.replace("'+c+'")\x3c/script>':"")+"</head></html>"),b.document.close(),a.stopImmediatePropagation(),!1}});a.onFirst("submit","form",function(){var a=g(this),e=a.attr("action");1===n(e)&&("post"===(a.attr("method")||"").toLowerCase()?a.attr("action",m(e,f.nonce)):a.append('<input type="hidden" name="'+l.name+'" value="'+f.nonce+'">'))})})()})(jQuery,window,document);
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.10.3';
19
  const GEOAPI_NAME = 'ip-geo-api';
20
  const PLUGIN_NAME = 'ip-geo-block';
21
  const OPTION_NAME = 'ip_geo_block_settings';
15
  * Unique identifier for this plugin.
16
  *
17
  */
18
+ const VERSION = '3.0.10.4';
19
  const GEOAPI_NAME = 'ip-geo-api';
20
  const PLUGIN_NAME = 'ip-geo-block';
21
  const OPTION_NAME = 'ip_geo_block_settings';
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.10.3
17
  * Author: tokkonopapa
18
  * Author URI: http://www.ipgeoblock.com/
19
  * Text Domain: ip-geo-block
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.10.4
17
  * Author: tokkonopapa
18
  * Author URI: http://www.ipgeoblock.com/
19
  * Text Domain: ip-geo-block