iQ Block Country - Version 1.1.30

Version Description

  • Change: Added new GeoIP API location for Asia-Pacific region.
  • Change: Added some missing country icons.
Download this release

Release Info

Developer iqpascal
Plugin Icon 128x128 iQ Block Country
Version 1.1.30
Comparing to
See all releases

Code changes from version 1.1.29 to 1.1.30

icons/a1.png ADDED
Binary file
icons/a2.png ADDED
Binary file
icons/ap.png ADDED
Binary file
icons/bl.png ADDED
Binary file
icons/bq.png ADDED
Binary file
icons/gg.png ADDED
Binary file
icons/im.png ADDED
Binary file
icons/je.png ADDED
Binary file
icons/mf.png ADDED
Binary file
icons/o1.png ADDED
Binary file
icons/ss.png ADDED
Binary file
iq-block-country.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: iQ Block Country
4
  Plugin URI: https://www.webence.nl/plugins/iq-block-country-the-wordpress-plugin-that-blocks-countries-for-you/
5
- Version: 1.1.29
6
  Author: Pascal
7
  Author URI: http://www.webence.nl/
8
  Description: Block visitors from visiting your website and backend website based on which country their IP address is from. The Maxmind GeoIP lite database is used for looking up from which country an ip address is from.
@@ -226,6 +226,7 @@ define("TRACKINGURL","http://tracking.webence.nl/iq-block-country-tracking.php")
226
  define("BANLISTRETRIEVEURL","http://tracking.webence.nl/iq-block-country-retrieve.php");
227
  define("GEOIPAPIURL","http://eu.geoip.webence.nl/geoipapi.php");
228
  define("GEOIPAPIURLUS","http://us.geoip.webence.nl/geoipapi.php");
 
229
  define("GEOIPAPICHECKURL","http://eu.geoip.webence.nl/geoipapi-keycheck.php");
230
  define("ADMINAPICHECKURL","http://tracking.webence.nl/adminapi-keycheck.php");
231
  define("VERSION","1.1.29");
2
  /*
3
  Plugin Name: iQ Block Country
4
  Plugin URI: https://www.webence.nl/plugins/iq-block-country-the-wordpress-plugin-that-blocks-countries-for-you/
5
+ Version: 1.1.30
6
  Author: Pascal
7
  Author URI: http://www.webence.nl/
8
  Description: Block visitors from visiting your website and backend website based on which country their IP address is from. The Maxmind GeoIP lite database is used for looking up from which country an ip address is from.
226
  define("BANLISTRETRIEVEURL","http://tracking.webence.nl/iq-block-country-retrieve.php");
227
  define("GEOIPAPIURL","http://eu.geoip.webence.nl/geoipapi.php");
228
  define("GEOIPAPIURLUS","http://us.geoip.webence.nl/geoipapi.php");
229
+ define("GEOIPAPIURLASIA","http://asia.geoip.webence.nl/geoipapi.php");
230
  define("GEOIPAPICHECKURL","http://eu.geoip.webence.nl/geoipapi-keycheck.php");
231
  define("ADMINAPICHECKURL","http://tracking.webence.nl/adminapi-keycheck.php");
232
  define("VERSION","1.1.29");
libs/blockcountry-checks.php CHANGED
@@ -55,6 +55,10 @@ function iqblockcountry_retrieve_geoipapi($ipaddress)
55
  {
56
  $url = GEOIPAPIURLUS;
57
  }
 
 
 
 
58
 
59
  $result = wp_remote_post(
60
  $url,
55
  {
56
  $url = GEOIPAPIURLUS;
57
  }
58
+ if (get_option('blockcountry_geoapilocation') == "ASIA")
59
+ {
60
+ $url = GEOIPAPIURLASIA;
61
+ }
62
 
63
  $result = wp_remote_post(
64
  $url,
libs/blockcountry-settings.php CHANGED
@@ -1334,6 +1334,7 @@ if (is_file ( IPV4DBFILE ) && (!get_option('blockcountry_geoapikey'))) {
1334
 
1335
  <input type="radio" name="blockcountry_geoapilocation" value="EU" <?php checked('EU', get_option('blockcountry_geoapilocation'), true); ?>> Europe
1336
  <input type="radio" name="blockcountry_geoapilocation" value="US" <?php checked('US', get_option('blockcountry_geoapilocation'), true); ?>> United States
 
1337
  </td></tr>
1338
  <tr valign="top">
1339
  <th width="30%"><?php _e('Admin block API Key:', 'iq-block-country'); ?><br />
@@ -1595,14 +1596,28 @@ function iqblockcountry_find_geoip_location()
1595
 
1596
  $curl = curl_init();
1597
  curl_setopt_array($curl, array(
1598
- CURLOPT_URL => 'http://geoip.webence.nl/test',
 
 
 
 
 
 
 
 
 
 
1599
  CURLOPT_USERAGENT => 'iQ Block Country location test'
1600
  ));
1601
  $resp = curl_exec($curl);
1602
  $infoeu = curl_getinfo($curl);
1603
  curl_close($curl);
1604
 
1605
- if ($infoeu['total_time'] < $infous['total_time'])
 
 
 
 
1606
  {
1607
  update_option('blockcountry_geoapilocation','EU');
1608
  }
1334
 
1335
  <input type="radio" name="blockcountry_geoapilocation" value="EU" <?php checked('EU', get_option('blockcountry_geoapilocation'), true); ?>> Europe
1336
  <input type="radio" name="blockcountry_geoapilocation" value="US" <?php checked('US', get_option('blockcountry_geoapilocation'), true); ?>> United States
1337
+ <input type="radio" name="blockcountry_geoapilocation" value="ASIA" <?php checked('ASIA', get_option('blockcountry_geoapilocation'), true); ?>> Asia-Pacific region
1338
  </td></tr>
1339
  <tr valign="top">
1340
  <th width="30%"><?php _e('Admin block API Key:', 'iq-block-country'); ?><br />
1596
 
1597
  $curl = curl_init();
1598
  curl_setopt_array($curl, array(
1599
+ CURLOPT_RETURNTRANSFER => 1,
1600
+ CURLOPT_URL => 'http://asia.geoip.webence.nl/test',
1601
+ CURLOPT_USERAGENT => 'iQ Block Country location test'
1602
+ ));
1603
+ $resp = curl_exec($curl);
1604
+ $infoasia = curl_getinfo($curl);
1605
+ curl_close($curl);
1606
+
1607
+ $curl = curl_init();
1608
+ curl_setopt_array($curl, array(
1609
+ CURLOPT_URL => 'http://eu.geoip.webence.nl/test',
1610
  CURLOPT_USERAGENT => 'iQ Block Country location test'
1611
  ));
1612
  $resp = curl_exec($curl);
1613
  $infoeu = curl_getinfo($curl);
1614
  curl_close($curl);
1615
 
1616
+ if ($infoasia['total_time'] < $infoeu['total_time'])
1617
+ {
1618
+ update_option('blockcountry_geoapilocation','ASIA');
1619
+ }
1620
+ elseif ($infoeu['total_time'] < $infous['total_time'])
1621
  {
1622
  update_option('blockcountry_geoapilocation','EU');
1623
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: iqpascal
3
  Donate link: https://www.webence.nl/plugins/donate
4
  Tags: spam, block, country, comments, ban, geo, geo blocking, geo ip, block country, block countries, ban countries, ban country, blacklist, whitelist, security
5
  Requires at least: 3.5.2
6
- Tested up to: 4.4.2
7
- Stable tag: 1.1.29
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -199,6 +199,11 @@ You can allow Jetpack by selecting "Jetpack by wordpress.com" as a search engine
199
 
200
  == Changelog ==
201
 
 
 
 
 
 
202
  = 1.1.29 =
203
 
204
  * Change: Small changes in GeoIP API calls
3
  Donate link: https://www.webence.nl/plugins/donate
4
  Tags: spam, block, country, comments, ban, geo, geo blocking, geo ip, block country, block countries, ban countries, ban country, blacklist, whitelist, security
5
  Requires at least: 3.5.2
6
+ Tested up to: 4.5.1
7
+ Stable tag: 1.1.30
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
199
 
200
  == Changelog ==
201
 
202
+ = 1.1.30 =
203
+
204
+ * Change: Added new GeoIP API location for Asia-Pacific region.
205
+ * Change: Added some missing country icons.
206
+
207
  = 1.1.29 =
208
 
209
  * Change: Small changes in GeoIP API calls