Version Description
- Change: Removed Asia API Key server.
- Change: Small change when frontend blocking is fired up.
- Change: Adds server ip address (the IP address where your website is hosted) to the frontend whitelist so if you block the country your website is hosted it can still access wp-cron for instance.
Download this release
Release Info
Developer | iqpascal |
Plugin | iQ Block Country |
Version | 1.1.44 |
Comparing to | |
See all releases |
Code changes from version 1.1.43 to 1.1.44
- iq-block-country.php +19 -7
- libs/blockcountry-checks.php +75 -13
- libs/blockcountry-settings.php +6 -19
- readme.txt +15 -16
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.
|
6 |
Author: Pascal
|
7 |
Author URI: https://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.
|
@@ -13,7 +13,7 @@ Domain Path: /lang
|
|
13 |
|
14 |
/* This script uses GeoLite Country from MaxMind (http://www.maxmind.com) which is available under terms of GPL/LGPL */
|
15 |
|
16 |
-
/* Copyright 2010-2017 Pascal (email
|
17 |
|
18 |
This program is free software; you can redistribute it and/or modify
|
19 |
it under the terms of the GNU General Public License, version 2, as
|
@@ -160,7 +160,17 @@ function iqblockcountry_upgrade()
|
|
160 |
update_option('blockcountry_version',VERSION);
|
161 |
|
162 |
|
163 |
-
if ($dbversion != "" && version_compare($dbversion, "1.1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
{
|
165 |
iqblockcountry_find_geoip_location();
|
166 |
update_option('blockcountry_daysstatistics',30);
|
@@ -237,7 +247,8 @@ define("GEOIPAPIURLUS2","https://us2.geoip.webence.nl/geoipapi.php");
|
|
237 |
define("GEOIPAPIURLASIA","https://us2.geoip.webence.nl/geoipapi.php");
|
238 |
define("GEOIPAPICHECKURL","https://eu.geoip.webence.nl/geoipapi-keycheck.php");
|
239 |
define("ADMINAPICHECKURL","https://tracking.webence.nl/adminapi-keycheck.php");
|
240 |
-
define("
|
|
|
241 |
define("DBVERSION","122");
|
242 |
define("PLUGINPATH",plugin_dir_path( __FILE__ ));
|
243 |
|
@@ -323,11 +334,12 @@ add_action( 'admin_enqueue_scripts', 'iq_add_my_scripts' );
|
|
323 |
*/
|
324 |
if (($blockcountry_is_login_page || is_admin() || $blockcountry_is_xmlrpc) && get_option('blockcountry_blockbackend') == 'on')
|
325 |
{
|
326 |
-
add_action ( 'init', '
|
327 |
}
|
328 |
-
elseif (get_option('blockcountry_blockfrontend') ==
|
|
|
329 |
{
|
330 |
-
add_action ( '
|
331 |
}
|
332 |
else
|
333 |
{
|
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.44
|
6 |
Author: Pascal
|
7 |
Author URI: https://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.
|
13 |
|
14 |
/* This script uses GeoLite Country from MaxMind (http://www.maxmind.com) which is available under terms of GPL/LGPL */
|
15 |
|
16 |
+
/* Copyright 2010-2017 Pascal (email: pascal@webence.nl)
|
17 |
|
18 |
This program is free software; you can redistribute it and/or modify
|
19 |
it under the terms of the GNU General Public License, version 2, as
|
160 |
update_option('blockcountry_version',VERSION);
|
161 |
|
162 |
|
163 |
+
if ($dbversion != "" && version_compare($dbversion, "1.1.44", '<=') )
|
164 |
+
{
|
165 |
+
if (get_option('blockcountry_geoapilocation') == "ASIA")
|
166 |
+
{
|
167 |
+
iqblockcountry_find_geoip_location();
|
168 |
+
}
|
169 |
+
$server_addr = array_key_exists( 'SERVER_ADDR', $_SERVER ) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
|
170 |
+
if (get_option('blockcountry_frontendwhitelist') === FALSE || (get_option('blockcountry_frontendwhitelist') == "")) { update_option('blockcountry_frontendwhitelist',$server_addr); } iqblockcountry_install_db();
|
171 |
+
|
172 |
+
}
|
173 |
+
elseif ($dbversion != "" && version_compare($dbversion, "1.1.41", '<') )
|
174 |
{
|
175 |
iqblockcountry_find_geoip_location();
|
176 |
update_option('blockcountry_daysstatistics',30);
|
247 |
define("GEOIPAPIURLASIA","https://us2.geoip.webence.nl/geoipapi.php");
|
248 |
define("GEOIPAPICHECKURL","https://eu.geoip.webence.nl/geoipapi-keycheck.php");
|
249 |
define("ADMINAPICHECKURL","https://tracking.webence.nl/adminapi-keycheck.php");
|
250 |
+
define("IPLOOKUPURL",'https://geoip.webence.nl/iplookup/iplookup.php');
|
251 |
+
define("VERSION","1.1.44");
|
252 |
define("DBVERSION","122");
|
253 |
define("PLUGINPATH",plugin_dir_path( __FILE__ ));
|
254 |
|
334 |
*/
|
335 |
if (($blockcountry_is_login_page || is_admin() || $blockcountry_is_xmlrpc) && get_option('blockcountry_blockbackend') == 'on')
|
336 |
{
|
337 |
+
add_action ( 'init', 'iqblockcountry_checkCountryBackEnd', 1 );
|
338 |
}
|
339 |
+
elseif ((!$blockcountry_is_login_page && !is_admin() && !$blockcountry_is_xmlrpc) && get_option('blockcountry_blockfrontend') == 'on')
|
340 |
+
//elseif (get_option('blockcountry_blockfrontend') == "on")
|
341 |
{
|
342 |
+
add_action ( 'init', 'iqblockcountry_checkCountryFrontEnd', 1 );
|
343 |
}
|
344 |
else
|
345 |
{
|
libs/blockcountry-checks.php
CHANGED
@@ -325,8 +325,7 @@ function iqblockcountry_check($country,$badcountries,$ip_address)
|
|
325 |
* Does the real check of visitor IP against MaxMind database or the GeoAPI
|
326 |
*
|
327 |
*/
|
328 |
-
function
|
329 |
-
|
330 |
$ip_address = iqblockcountry_get_ipaddress();
|
331 |
$country = iqblockcountry_check_ipaddress($ip_address);
|
332 |
global $blockcountry_is_login_page,$blockcountry_is_xmlrpc;
|
@@ -341,18 +340,7 @@ function iqblockcountry_CheckCountry() {
|
|
341 |
$badcountries = $banlist;
|
342 |
}
|
343 |
}
|
344 |
-
else
|
345 |
-
{
|
346 |
-
$banlist = get_option( 'blockcountry_banlist' );
|
347 |
-
if (!is_array($banlist)) { $banlist = array(); }
|
348 |
-
if (get_option( 'blockcountry_banlist_inverse' ) == 'on') {
|
349 |
-
$all_countries = array_keys(iqblockcountry_get_countries());
|
350 |
-
$badcountries = array_diff($all_countries, $banlist);
|
351 |
-
} else {
|
352 |
-
$badcountries = $banlist;
|
353 |
-
}
|
354 |
|
355 |
-
}
|
356 |
$blocklogin = get_option ( 'blockcountry_blocklogin' );
|
357 |
if ( ((is_user_logged_in()) && ($blocklogin != "on")) || (!(is_user_logged_in())) ) {
|
358 |
|
@@ -439,6 +427,80 @@ function iqblockcountry_CheckCountry() {
|
|
439 |
}
|
440 |
}
|
441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
|
443 |
/**
|
444 |
* Check if xmlrpc.php is hit.
|
325 |
* Does the real check of visitor IP against MaxMind database or the GeoAPI
|
326 |
*
|
327 |
*/
|
328 |
+
function iqblockcountry_CheckCountryBackEnd() {
|
|
|
329 |
$ip_address = iqblockcountry_get_ipaddress();
|
330 |
$country = iqblockcountry_check_ipaddress($ip_address);
|
331 |
global $blockcountry_is_login_page,$blockcountry_is_xmlrpc;
|
340 |
$badcountries = $banlist;
|
341 |
}
|
342 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
|
|
|
344 |
$blocklogin = get_option ( 'blockcountry_blocklogin' );
|
345 |
if ( ((is_user_logged_in()) && ($blocklogin != "on")) || (!(is_user_logged_in())) ) {
|
346 |
|
427 |
}
|
428 |
}
|
429 |
|
430 |
+
/*
|
431 |
+
*
|
432 |
+
* Does the real check of visitor IP against MaxMind database or the GeoAPI FrontEnd
|
433 |
+
*
|
434 |
+
*/
|
435 |
+
function iqblockcountry_CheckCountryFrontEnd() {
|
436 |
+
$ip_address = iqblockcountry_get_ipaddress();
|
437 |
+
$country = iqblockcountry_check_ipaddress($ip_address);
|
438 |
+
$banlist = get_option( 'blockcountry_banlist' );
|
439 |
+
if (!is_array($banlist)) { $banlist = array(); }
|
440 |
+
if (get_option( 'blockcountry_banlist_inverse' ) == 'on') {
|
441 |
+
$all_countries = array_keys(iqblockcountry_get_countries());
|
442 |
+
$badcountries = array_diff($all_countries, $banlist);
|
443 |
+
} else {
|
444 |
+
$badcountries = $banlist;
|
445 |
+
}
|
446 |
+
|
447 |
+
$blocklogin = get_option ( 'blockcountry_blocklogin' );
|
448 |
+
if ( ((is_user_logged_in()) && ($blocklogin != "on")) || (!(is_user_logged_in())) ) {
|
449 |
+
|
450 |
+
/* Check ip address against banlist, whitelist and blacklist */
|
451 |
+
if (iqblockcountry_check($country,$badcountries,$ip_address))
|
452 |
+
{
|
453 |
+
$blocked = get_option('blockcountry_frontendnrblocks');
|
454 |
+
if (empty($blocked)) { $blocked = 0; }
|
455 |
+
$blocked++;
|
456 |
+
update_option('blockcountry_frontendnrblocks', $blocked);
|
457 |
+
if (!get_option('blockcountry_logging'))
|
458 |
+
{
|
459 |
+
iqblockcountry_logging($ip_address, $country, "F");
|
460 |
+
iqblockcountry_debug_logging($ip_address,$country,'FB');
|
461 |
+
}
|
462 |
+
|
463 |
+
|
464 |
+
$blockmessage = get_option ( 'blockcountry_blockmessage' );
|
465 |
+
$blockredirect = get_option ( 'blockcountry_redirect');
|
466 |
+
$blockredirect_url = get_option ( 'blockcountry_redirect_url');
|
467 |
+
$header = get_option('blockcountry_header');
|
468 |
+
if (!empty($header) && ($header))
|
469 |
+
{
|
470 |
+
// Prevent as much as possible that this error message is cached:
|
471 |
+
header("Cache-Control: no-store, no-cache, must-revalidate");
|
472 |
+
header("Cache-Control: post-check=0, pre-check=0", false);
|
473 |
+
header("Pragma: no-cache");
|
474 |
+
header("Expires: Sat, 26 Jul 2012 05:00:00 GMT");
|
475 |
+
|
476 |
+
header ( 'HTTP/1.1 403 Forbidden' );
|
477 |
+
}
|
478 |
+
if (!empty($blockredirect_url))
|
479 |
+
{
|
480 |
+
header("Location: $blockredirect_url");
|
481 |
+
}
|
482 |
+
elseif (!empty($blockredirect) && $blockredirect != 0)
|
483 |
+
{
|
484 |
+
$redirecturl = get_permalink($blockredirect);
|
485 |
+
header("Location: $redirecturl");
|
486 |
+
}
|
487 |
+
// Display block message
|
488 |
+
print "$blockmessage";
|
489 |
+
|
490 |
+
|
491 |
+
exit ();
|
492 |
+
}
|
493 |
+
else
|
494 |
+
{
|
495 |
+
iqblockcountry_debug_logging($ip_address,$country,'NB');
|
496 |
+
}
|
497 |
+
}
|
498 |
+
else
|
499 |
+
{
|
500 |
+
iqblockcountry_debug_logging($ip_address,$country,'NB');
|
501 |
+
}
|
502 |
+
}
|
503 |
+
|
504 |
|
505 |
/**
|
506 |
* Check if xmlrpc.php is hit.
|
libs/blockcountry-settings.php
CHANGED
@@ -199,7 +199,9 @@ function iqblockcountry_set_defaults()
|
|
199 |
$countrylist = iqblockcountry_get_countries();
|
200 |
$ip_address = iqblockcountry_get_ipaddress();
|
201 |
$usercountry = iqblockcountry_check_ipaddress($ip_address);
|
|
|
202 |
|
|
|
203 |
if (get_option('blockcountry_blockfrontend') === FALSE) { update_option('blockcountry_blockfrontend' , 'on'); }
|
204 |
if (get_option('blockcountry_backendnrblocks') === FALSE) { update_option('blockcountry_backendnrblocks', 0); }
|
205 |
if (get_option('blockcountry_frontendnrblocks') === FALSE) { update_option('blockcountry_frontendnrblocks', 0); }
|
@@ -207,7 +209,7 @@ function iqblockcountry_set_defaults()
|
|
207 |
if (get_option('blockcountry_nrstatistics') === FALSE) { update_option('blockcountry_nrstatistics',15); }
|
208 |
if (get_option('blockcountry_daysstatistics') === FALSE) { update_option('blockcountry_daysstatistics',30); }
|
209 |
if (get_option('blockcountry_backendwhitelist') === FALSE || (get_option('blockcountry_backendwhitelist') == "")) { update_option('blockcountry_backendwhitelist',$ip_address); }
|
210 |
-
iqblockcountry_install_db();
|
211 |
iqblockcountry_find_geoip_location();
|
212 |
}
|
213 |
|
@@ -1440,7 +1442,6 @@ if (is_file ( IPV4DBFILE ) && (!get_option('blockcountry_geoapikey'))) {
|
|
1440 |
<input type="radio" name="blockcountry_geoapilocation" value="EU" <?php checked('EU', get_option('blockcountry_geoapilocation'), true); ?>> Europe<br />
|
1441 |
<input type="radio" name="blockcountry_geoapilocation" value="US" <?php checked('US', get_option('blockcountry_geoapilocation'), true); ?>> United States - East coast<br />
|
1442 |
<input type="radio" name="blockcountry_geoapilocation" value="US2" <?php checked('US2', get_option('blockcountry_geoapilocation'), true); ?>> United States - West coast<br />
|
1443 |
-
<input type="radio" name="blockcountry_geoapilocation" value="ASIA" <?php checked('ASIA', get_option('blockcountry_geoapilocation'), true); ?>> Asia-Pacific region
|
1444 |
</td></tr>
|
1445 |
<tr valign="top">
|
1446 |
<th width="30%"><?php _e('Admin block API Key:', 'iq-block-country'); ?><br />
|
@@ -1512,7 +1513,7 @@ function iqblockcountry_settings_logging()
|
|
1512 |
$mysqldate = date($format, $datetime);
|
1513 |
if ($lookupstats)
|
1514 |
{
|
1515 |
-
echo $mysqldate . '</td><td>' . $row->ipaddress . '</td><td>'. $row->ipaddress . '</td><td>' . $row->url . '</td><td>' . $countryurl . $countrylist[$row->country] . '<td>';
|
1516 |
}
|
1517 |
else
|
1518 |
{
|
@@ -1731,16 +1732,6 @@ function iqblockcountry_find_geoip_location()
|
|
1731 |
$infous2 = curl_getinfo($curl);
|
1732 |
curl_close($curl);
|
1733 |
|
1734 |
-
$curl = curl_init();
|
1735 |
-
curl_setopt_array($curl, array(
|
1736 |
-
CURLOPT_RETURNTRANSFER => 1,
|
1737 |
-
CURLOPT_URL => 'https://asia.geoip.webence.nl/test',
|
1738 |
-
CURLOPT_USERAGENT => 'iQ Block Country location test'
|
1739 |
-
));
|
1740 |
-
$resp = curl_exec($curl);
|
1741 |
-
$infoasia = curl_getinfo($curl);
|
1742 |
-
curl_close($curl);
|
1743 |
-
|
1744 |
$curl = curl_init();
|
1745 |
curl_setopt_array($curl, array(
|
1746 |
CURLOPT_URL => 'https://eu.geoip.webence.nl/test',
|
@@ -1750,13 +1741,9 @@ function iqblockcountry_find_geoip_location()
|
|
1750 |
$infoeu = curl_getinfo($curl);
|
1751 |
curl_close($curl);
|
1752 |
|
1753 |
-
$fastestsite = min($infoeu['total_time'],$infous['total_time'],$infous2['total_time']
|
1754 |
|
1755 |
-
if ($
|
1756 |
-
{
|
1757 |
-
update_option('blockcountry_geoapilocation','ASIA');
|
1758 |
-
}
|
1759 |
-
elseif ($infous['total_time'] == $fastestsite)
|
1760 |
{
|
1761 |
update_option('blockcountry_geoapilocation','US');
|
1762 |
}
|
199 |
$countrylist = iqblockcountry_get_countries();
|
200 |
$ip_address = iqblockcountry_get_ipaddress();
|
201 |
$usercountry = iqblockcountry_check_ipaddress($ip_address);
|
202 |
+
$server_addr = array_key_exists( 'SERVER_ADDR', $_SERVER ) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];
|
203 |
|
204 |
+
|
205 |
if (get_option('blockcountry_blockfrontend') === FALSE) { update_option('blockcountry_blockfrontend' , 'on'); }
|
206 |
if (get_option('blockcountry_backendnrblocks') === FALSE) { update_option('blockcountry_backendnrblocks', 0); }
|
207 |
if (get_option('blockcountry_frontendnrblocks') === FALSE) { update_option('blockcountry_frontendnrblocks', 0); }
|
209 |
if (get_option('blockcountry_nrstatistics') === FALSE) { update_option('blockcountry_nrstatistics',15); }
|
210 |
if (get_option('blockcountry_daysstatistics') === FALSE) { update_option('blockcountry_daysstatistics',30); }
|
211 |
if (get_option('blockcountry_backendwhitelist') === FALSE || (get_option('blockcountry_backendwhitelist') == "")) { update_option('blockcountry_backendwhitelist',$ip_address); }
|
212 |
+
if (get_option('blockcountry_frontendwhitelist') === FALSE || (get_option('blockcountry_frontendwhitelist') == "")) { update_option('blockcountry_frontendwhitelist',$server_addr); } iqblockcountry_install_db();
|
213 |
iqblockcountry_find_geoip_location();
|
214 |
}
|
215 |
|
1442 |
<input type="radio" name="blockcountry_geoapilocation" value="EU" <?php checked('EU', get_option('blockcountry_geoapilocation'), true); ?>> Europe<br />
|
1443 |
<input type="radio" name="blockcountry_geoapilocation" value="US" <?php checked('US', get_option('blockcountry_geoapilocation'), true); ?>> United States - East coast<br />
|
1444 |
<input type="radio" name="blockcountry_geoapilocation" value="US2" <?php checked('US2', get_option('blockcountry_geoapilocation'), true); ?>> United States - West coast<br />
|
|
|
1445 |
</td></tr>
|
1446 |
<tr valign="top">
|
1447 |
<th width="30%"><?php _e('Admin block API Key:', 'iq-block-country'); ?><br />
|
1513 |
$mysqldate = date($format, $datetime);
|
1514 |
if ($lookupstats)
|
1515 |
{
|
1516 |
+
echo $mysqldate . '</td><td>' . $row->ipaddress . '</td><td>' . $row->ipaddress . 'S</td><td>' . $row->url . '</td><td>' . $countryurl . $countrylist[$row->country] . '<td>';
|
1517 |
}
|
1518 |
else
|
1519 |
{
|
1732 |
$infous2 = curl_getinfo($curl);
|
1733 |
curl_close($curl);
|
1734 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1735 |
$curl = curl_init();
|
1736 |
curl_setopt_array($curl, array(
|
1737 |
CURLOPT_URL => 'https://eu.geoip.webence.nl/test',
|
1741 |
$infoeu = curl_getinfo($curl);
|
1742 |
curl_close($curl);
|
1743 |
|
1744 |
+
$fastestsite = min($infoeu['total_time'],$infous['total_time'],$infous2['total_time']);
|
1745 |
|
1746 |
+
if ($infous['total_time'] == $fastestsite)
|
|
|
|
|
|
|
|
|
1747 |
{
|
1748 |
update_option('blockcountry_geoapilocation','US');
|
1749 |
}
|
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.8
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -13,26 +13,20 @@ Allow or disallow visitors from certain countries accessing (parts of) your webs
|
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
iQ Block Country is a plugin that allows you to limit access to your website content.
|
17 |
-
You can either allow or disallow visitors from defined countries to (parts of) your content.
|
18 |
|
19 |
For instance if you have content that should be restricted to a limited set of countries you can do so.
|
20 |
-
If you want to block rogue countries that cause issues like for instance hack attempts, spamming of your comments etc
|
21 |
-
you can block them as well.
|
22 |
|
23 |
-
Do you want secure your WordPress Admin backend site to only your country? Entirely possible! You can even
|
24 |
-
block all countries and only allow your ip address.
|
25 |
|
26 |
-
And even if you block a country you can still allow certain visitors by whitelisting their ip address just
|
27 |
-
like you can allow a country but blacklist ip addresses from that country.
|
28 |
|
29 |
-
You can show blocked visitors a message which you can style by using CSS or you can redirect them to a page
|
30 |
-
within your WordPress site. Or you can redirect the visitors to an external website.
|
31 |
|
32 |
You can (dis)allow visitors to blog articles, blog categories or pages or all content.
|
33 |
|
34 |
-
Stop visitors from doing harmful things on your WordPress site or limit the countries that can access your
|
35 |
-
blog. Add an additional layer of security to your WordPress site.
|
36 |
|
37 |
This plugin uses the GeoLite database from Maxmind. It has a 99.5% accuracy so that is pretty good for a free database. If you need higher accuracy you can buy a license from MaxMind directly.
|
38 |
If you cannot or do not want to download the GeoIP database from Maxmind you can use the GeoIP API website available on https://geoip.webence.nl/
|
@@ -45,8 +39,7 @@ Do you need help with this plugin? Please email support@webence.nl.
|
|
45 |
= Using this plugin with a caching plugin =
|
46 |
|
47 |
Please note that many of the caching plugins are not compatible with this plugin. The nature of caching is that a dynamically build web page is cached into a static page.
|
48 |
-
If a visitor is blocked this plugin sends header data where it supplies info that the page should not be cached. Many plugins however disregard this info and cache the
|
49 |
-
page or the redirect. Resulting in valid visitors receiving a message that they are blocked. This is not a malfunction of this plugin.
|
50 |
|
51 |
Disclaimer: No guarantees are made but after some light testing the following caching plugins seem to work: Comet Cache, WP Super Cache
|
52 |
Plugins that do NOT work: W3 Total Cache, Hyper cache, WPRocket
|
@@ -213,6 +206,12 @@ As the basic rule is to block all and every post you have to configure this in a
|
|
213 |
|
214 |
== Changelog ==
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
= 1.1.43 =
|
217 |
|
218 |
* Change: Altered address for Asia API Key server
|
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.8.1
|
7 |
+
Stable tag: 1.1.44
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
iQ Block Country is a plugin that allows you to limit access to your website content. You can either allow or disallow visitors from defined countries to (parts of) your content.
|
|
|
17 |
|
18 |
For instance if you have content that should be restricted to a limited set of countries you can do so.
|
19 |
+
If you want to block rogue countries that cause issues like for instance hack attempts, spamming of your comments etc you can block them as well.
|
|
|
20 |
|
21 |
+
Do you want secure your WordPress Admin backend site to only your country? Entirely possible! You can even block all countries and only allow your ip address.
|
|
|
22 |
|
23 |
+
And even if you block a country you can still allow certain visitors by whitelisting their ip address just like you can allow a country but blacklist ip addresses from that country.
|
|
|
24 |
|
25 |
+
You can show blocked visitors a message which you can style by using CSS or you can redirect them to a page within your WordPress site. Or you can redirect the visitors to an external website.
|
|
|
26 |
|
27 |
You can (dis)allow visitors to blog articles, blog categories or pages or all content.
|
28 |
|
29 |
+
Stop visitors from doing harmful things on your WordPress site or limit the countries that can access your blog. Add an additional layer of security to your WordPress site.
|
|
|
30 |
|
31 |
This plugin uses the GeoLite database from Maxmind. It has a 99.5% accuracy so that is pretty good for a free database. If you need higher accuracy you can buy a license from MaxMind directly.
|
32 |
If you cannot or do not want to download the GeoIP database from Maxmind you can use the GeoIP API website available on https://geoip.webence.nl/
|
39 |
= Using this plugin with a caching plugin =
|
40 |
|
41 |
Please note that many of the caching plugins are not compatible with this plugin. The nature of caching is that a dynamically build web page is cached into a static page.
|
42 |
+
If a visitor is blocked this plugin sends header data where it supplies info that the page should not be cached. Many plugins however disregard this info and cache the page or the redirect. Resulting in valid visitors receiving a message that they are blocked. This is not a malfunction of this plugin.
|
|
|
43 |
|
44 |
Disclaimer: No guarantees are made but after some light testing the following caching plugins seem to work: Comet Cache, WP Super Cache
|
45 |
Plugins that do NOT work: W3 Total Cache, Hyper cache, WPRocket
|
206 |
|
207 |
== Changelog ==
|
208 |
|
209 |
+
= 1.1.44 =
|
210 |
+
|
211 |
+
* Change: Removed Asia API Key server.
|
212 |
+
* Change: Small change when frontend blocking is fired up.
|
213 |
+
* Change: Adds server ip address (the IP address where your website is hosted) to the frontend whitelist so if you block the country your website is hosted it can still access wp-cron for instance.
|
214 |
+
|
215 |
= 1.1.43 =
|
216 |
|
217 |
* Change: Altered address for Asia API Key server
|