From 0d96af12afcbacb1e86205e3ccaca70f5b7981c8 Mon Sep 17 00:00:00 2001 From: Jason Nulla Date: Wed, 22 Apr 2020 01:57:56 +0800 Subject: [PATCH 1/3] added check if rc_referrer_id cookie exists --- includes/class-wc-referralcandy-integration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-referralcandy-integration.php b/includes/class-wc-referralcandy-integration.php index 837e8fc..202cdd6 100644 --- a/includes/class-wc-referralcandy-integration.php +++ b/includes/class-wc-referralcandy-integration.php @@ -151,7 +151,7 @@ public function add_referrer_id($post_id) { try { if (in_array(get_post($post_id)->post_type, ['shop_order', 'shop_subscription'])) { // prevent admin cookies from automatically adding a referrer_id; this can be done manually though - if (is_admin() == false) { + if (is_admin() == false && isset($_COOKIE['rc_referrer_id'])) { update_post_meta($post_id, 'rc_referrer_id', $_COOKIE['rc_referrer_id']); } } From ae1698ed74d55d1d685300d52909af5f7b1a49ea Mon Sep 17 00:00:00 2001 From: Jason Nulla Date: Wed, 22 Apr 2020 02:40:08 +0800 Subject: [PATCH 2/3] bump version --- woocommerce-referralcandy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce-referralcandy.php b/woocommerce-referralcandy.php index 730da4b..7d86691 100644 --- a/woocommerce-referralcandy.php +++ b/woocommerce-referralcandy.php @@ -6,7 +6,7 @@ * Author: ReferralCandy * Author URI: http://www.referralcandy.com * Text Domain: woocommerce-referralcandy - * Version: 2.2.2 + * Version: 2.2.3 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 204314a597fc71622d3043d3db3ffc36f5dfcf2e Mon Sep 17 00:00:00 2001 From: Jason Nulla Date: Wed, 22 Apr 2020 02:40:15 +0800 Subject: [PATCH 3/3] updated changelog --- readme.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.txt b/readme.txt index da2c392..17f0150 100644 --- a/readme.txt +++ b/readme.txt @@ -72,6 +72,9 @@ We maintain a list of FAQs on our [help page](http://help.referralcandy.com/)! == Changelog == += 2.2.3 = +* Fixed issue where the plugin uses the `rc_referrer_id` cookie even if non-existent + = 2.2.2 = * Fixed failing code for logging API requests