Version Description
- Fix: Small security issue fixed
- Fix: Redirect to page fixed
Download this release
Release Info
Developer | iqpascal |
Plugin | iQ Block Country |
Version | 1.2.19 |
Comparing to | |
See all releases |
Code changes from version 1.2.18 to 1.2.19
- iq-block-country.php +2 -2
- libs/blockcountry-checks.php +9 -11
- libs/blockcountry-settings.php +3 -3
- readme.txt +6 -1
iq-block-country.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: iQ Block Country
|
4 |
Plugin URI: https://webence.nl/plugins/iq-block-country-the-wordpress-plugin-that-blocks-countries-for-you/
|
5 |
-
Version: 1.2.
|
6 |
Author: Pascal
|
7 |
Author URI: https://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.
|
@@ -175,7 +175,7 @@ define("GEOIPAPIURLASIA", "https://asia.geoip.webence.nl/geoipapi.php");
|
|
175 |
define("GEOIPAPICHECKURL", "https://eu.geoip.webence.nl/geoipapi-keycheck.php");
|
176 |
define("GEOIPAPICHECKUSAGEURL", "https://eu.geoip.webence.nl/geoipapi-usage.php");
|
177 |
define("ADMINAPICHECKURL", "https://tracking.webence.nl/adminapi-keycheck.php");
|
178 |
-
define("IQVERSION", "1.2.
|
179 |
define("IQDBVERSION", "122");
|
180 |
define("IQBCPLUGINPATH", plugin_dir_path(__FILE__));
|
181 |
|
2 |
/*
|
3 |
Plugin Name: iQ Block Country
|
4 |
Plugin URI: https://webence.nl/plugins/iq-block-country-the-wordpress-plugin-that-blocks-countries-for-you/
|
5 |
+
Version: 1.2.19
|
6 |
Author: Pascal
|
7 |
Author URI: https://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.
|
175 |
define("GEOIPAPICHECKURL", "https://eu.geoip.webence.nl/geoipapi-keycheck.php");
|
176 |
define("GEOIPAPICHECKUSAGEURL", "https://eu.geoip.webence.nl/geoipapi-usage.php");
|
177 |
define("ADMINAPICHECKURL", "https://tracking.webence.nl/adminapi-keycheck.php");
|
178 |
+
define("IQVERSION", "1.2.19");
|
179 |
define("IQDBVERSION", "122");
|
180 |
define("IQBCPLUGINPATH", plugin_dir_path(__FILE__));
|
181 |
|
libs/blockcountry-checks.php
CHANGED
@@ -390,7 +390,7 @@ function iqblockcountry_CheckCountryBackEnd()
|
|
390 |
|
391 |
|
392 |
$iqbc_blockmessage = get_option('blockcountry_blockmessage');
|
393 |
-
$iqbc_blockredirect =
|
394 |
$iqbc_blockredirect_url = esc_url_raw(get_option('blockcountry_redirect_url'));
|
395 |
$iqbc_header = sanitize_text_field(get_option('blockcountry_header'));
|
396 |
if (!empty($iqbc_header) && ($iqbc_header)) {
|
@@ -462,7 +462,7 @@ function iqblockcountry_CheckCountryFrontEnd()
|
|
462 |
|
463 |
|
464 |
$iqbc_blockmessage = get_option('blockcountry_blockmessage');
|
465 |
-
$iqbc_blockredirect =
|
466 |
$iqbc_blockredirect_url = esc_url(get_option('blockcountry_redirect_url'));
|
467 |
$iqbc_header = get_option('blockcountry_header');
|
468 |
if (!empty($iqbc_header) && ($iqbc_header)) {
|
@@ -477,10 +477,12 @@ function iqblockcountry_CheckCountryFrontEnd()
|
|
477 |
if (!empty($iqbc_blockredirect_url)) {
|
478 |
header("Location: $iqbc_blockredirect_url");
|
479 |
}
|
480 |
-
elseif (!empty($iqbc_blockredirect) && $iqbc_blockredirect != 0)
|
481 |
-
|
482 |
-
|
|
|
483 |
}
|
|
|
484 |
// Display block message
|
485 |
print esc_html($iqbc_blockmessage);
|
486 |
|
@@ -574,15 +576,11 @@ function iqblockcountry_is_login_page()
|
|
574 |
$iqbc_pos2 = strpos($_SERVER['REQUEST_URI'], $iqbc_whlpage);
|
575 |
}
|
576 |
}
|
577 |
-
|
578 |
-
|
579 |
|
580 |
-
|
581 |
-
if ($iqbc_pos !== false) { $iqbc_found = true;
|
582 |
-
}
|
583 |
elseif ($iqbc_pos2 !== false) { $iqbc_found = true;
|
584 |
}
|
585 |
-
|
586 |
return $iqbc_found;
|
587 |
}
|
588 |
|
390 |
|
391 |
|
392 |
$iqbc_blockmessage = get_option('blockcountry_blockmessage');
|
393 |
+
$iqbc_blockredirect = get_option('blockcountry_redirect');
|
394 |
$iqbc_blockredirect_url = esc_url_raw(get_option('blockcountry_redirect_url'));
|
395 |
$iqbc_header = sanitize_text_field(get_option('blockcountry_header'));
|
396 |
if (!empty($iqbc_header) && ($iqbc_header)) {
|
462 |
|
463 |
|
464 |
$iqbc_blockmessage = get_option('blockcountry_blockmessage');
|
465 |
+
$iqbc_blockredirect = get_option('blockcountry_redirect');
|
466 |
$iqbc_blockredirect_url = esc_url(get_option('blockcountry_redirect_url'));
|
467 |
$iqbc_header = get_option('blockcountry_header');
|
468 |
if (!empty($iqbc_header) && ($iqbc_header)) {
|
477 |
if (!empty($iqbc_blockredirect_url)) {
|
478 |
header("Location: $iqbc_blockredirect_url");
|
479 |
}
|
480 |
+
elseif (!empty($iqbc_blockredirect) && $iqbc_blockredirect != 0)
|
481 |
+
{
|
482 |
+
$iqbc_redirecturl = get_permalink($iqbc_blockredirect);
|
483 |
+
header("Location: $iqbc_redirecturl");
|
484 |
}
|
485 |
+
|
486 |
// Display block message
|
487 |
print esc_html($iqbc_blockmessage);
|
488 |
|
576 |
$iqbc_pos2 = strpos($_SERVER['REQUEST_URI'], $iqbc_whlpage);
|
577 |
}
|
578 |
}
|
|
|
|
|
579 |
|
580 |
+
if (stripos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false && ($GLOBALS['pagenow'] === 'wp-login.php' || $_SERVER['PHP_SELF'] === '/wp-login.php')) { $iqbc_found = true; }
|
|
|
|
|
581 |
elseif ($iqbc_pos2 !== false) { $iqbc_found = true;
|
582 |
}
|
583 |
+
|
584 |
return $iqbc_found;
|
585 |
}
|
586 |
|
libs/blockcountry-settings.php
CHANGED
@@ -1432,7 +1432,7 @@ function iqblockcountry_settings_home()
|
|
1432 |
<tr valign="top">
|
1433 |
<th width="30%"><?php esc_html_e('Page to redirect to:', 'iq-block-country'); ?><br />
|
1434 |
<em><?php esc_html_e('If you select a page here blocked visitors will be redirected to this page instead of displaying above block message.', 'iq-block-country'); ?></em></th>
|
1435 |
-
|
1436 |
<td width="70%">
|
1437 |
<select class="chosen" name="blockcountry_redirect" style="width:400px;">
|
1438 |
<?php
|
@@ -1440,10 +1440,10 @@ function iqblockcountry_settings_home()
|
|
1440 |
echo "<option value=\"0\">". esc_html("Choose a page...", 'iq-block-country') . "</option>";
|
1441 |
$iqbc_pages = get_pages();
|
1442 |
foreach ( $iqbc_pages as $iqbc_page ) {
|
1443 |
-
print "<option value
|
1444 |
if ($iqbc_page->ID == $iqbc_haystack) {
|
1445 |
|
1446 |
-
print " selected=\"selected\"
|
1447 |
}
|
1448 |
print ">" . esc_html($iqbc_page->post_title) . "</option>\n";
|
1449 |
}
|
1432 |
<tr valign="top">
|
1433 |
<th width="30%"><?php esc_html_e('Page to redirect to:', 'iq-block-country'); ?><br />
|
1434 |
<em><?php esc_html_e('If you select a page here blocked visitors will be redirected to this page instead of displaying above block message.', 'iq-block-country'); ?></em></th>
|
1435 |
+
|
1436 |
<td width="70%">
|
1437 |
<select class="chosen" name="blockcountry_redirect" style="width:400px;">
|
1438 |
<?php
|
1440 |
echo "<option value=\"0\">". esc_html("Choose a page...", 'iq-block-country') . "</option>";
|
1441 |
$iqbc_pages = get_pages();
|
1442 |
foreach ( $iqbc_pages as $iqbc_page ) {
|
1443 |
+
print "<option value=\"" . esc_html($iqbc_page->ID) . "\"";
|
1444 |
if ($iqbc_page->ID == $iqbc_haystack) {
|
1445 |
|
1446 |
+
print " selected=\"selected\"";
|
1447 |
}
|
1448 |
print ">" . esc_html($iqbc_page->post_title) . "</option>\n";
|
1449 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://webence.nl/plugins/donate
|
|
4 |
Tags: spam, block, country, comments, ban, geo, geo blocking, geo ip, block country, block countries, ban countries, ban country, allow list, block list, security
|
5 |
Requires at least: 3.5.2
|
6 |
Tested up to: 6.0.1
|
7 |
-
Stable tag: 1.2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Requires PHP: 7.0
|
@@ -284,6 +284,11 @@ Privacy policy regarding this service specific can be found here: https://webenc
|
|
284 |
|
285 |
== Changelog ==
|
286 |
|
|
|
|
|
|
|
|
|
|
|
287 |
= 1.2.18 =
|
288 |
|
289 |
* Fix: Small errors
|
4 |
Tags: spam, block, country, comments, ban, geo, geo blocking, geo ip, block country, block countries, ban countries, ban country, allow list, block list, security
|
5 |
Requires at least: 3.5.2
|
6 |
Tested up to: 6.0.1
|
7 |
+
Stable tag: 1.2.19
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Requires PHP: 7.0
|
284 |
|
285 |
== Changelog ==
|
286 |
|
287 |
+
= 1.2.19 =
|
288 |
+
|
289 |
+
* Fix: Small security issue fixed
|
290 |
+
* Fix: Redirect to page fixed
|
291 |
+
|
292 |
= 1.2.18 =
|
293 |
|
294 |
* Fix: Small errors
|