From 6525c2c50a59f9bcb78f1ecedf42df96050316fa Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Mon, 11 Sep 2017 12:15:25 -0300 Subject: [PATCH 1/2] =?UTF-8?q?break=20if=20first=20rule=20don=E2=80=99t?= =?UTF-8?q?=20match?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/class-geotr-rules.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-geotr-rules.php b/includes/class-geotr-rules.php index 94c9c40..00e219a 100644 --- a/includes/class-geotr-rules.php +++ b/includes/class-geotr-rules.php @@ -78,6 +78,9 @@ public static function do_redirection( $rules = '' ) { $match = apply_filters( 'geotr/rules/rule_match/' . $rule['param'], $rule ); if ( ! $match ) { $match_group = false; + // if one rule fails we don't need to check the rest of the rules in the group + // that way if we add geo rules down it won't get executed and will save credits + break; } } } From 46e6dcadc85a7b36788ed6553f4c94587dfa4e76 Mon Sep 17 00:00:00 2001 From: Damian Logghe Date: Tue, 12 Sep 2017 13:00:40 -0300 Subject: [PATCH 2/2] VERSION BUMP 1.0.2.2 --- README.txt | 6 +++++- geo-redirects.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.txt b/README.txt index b1906a5..8f7dff6 100755 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ Contributors: timersys Donate link: https://timersys.com Tags: geo redirects, geo redirection, redirect by country, geotargeting, geolite, maxmind Tested up to: 4.8 -Stable tag: 1.0.2.1 +Stable tag: 1.0.2.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -34,6 +34,10 @@ Rules available: == Changelog == += 1.0.2.2 = +* Changes rules priority to save users credits by simple putting geo rules at the end +* Updated core files + = 1.0.2.1 = * Fixed problem with automatic updates * Updated core files diff --git a/geo-redirects.php b/geo-redirects.php index 5da0b8f..02bb2d8 100755 --- a/geo-redirects.php +++ b/geo-redirects.php @@ -9,7 +9,7 @@ * Plugin Name: Geo Redirects * Plugin URI: https://geotargetingwp/ * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. - * Version: 1.0.2.1 + * Version: 1.0.2.2 * Author: Damian Logghe * Author URI: https://timersys.com * License: GPL-2.0+ @@ -23,7 +23,7 @@ die; } -define( 'GEOTR_VERSION', '1.0.2.1'); +define( 'GEOTR_VERSION', '1.0.2.2'); define( 'GEOTR_PLUGIN_FILE' , __FILE__); define( 'GEOTR_DIR', dirname(__FILE__)); define( 'GEOTR_URL', plugin_dir_url(__FILE__));