From d359c048e30a3139ff41db8e51a5597edc5d22c4 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Thu, 27 Jan 2022 16:39:52 -0300 Subject: [PATCH] Fix a bug in clickedStatsColor() The method clickedStatsColor() should return different color codes depending on the percentage of clicks (> 30%, < 30% and > 10%, < 10%). It receives the percentage value as an absolute number. There was a bug in this method where it was checking for values greater than 3, between 3 and 1, and smaller than 1 instead of greater than 30, between 30 and 10, and smaller than 10. [MAILPOET-3324] --- mailpoet/lib/Twig/Functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailpoet/lib/Twig/Functions.php b/mailpoet/lib/Twig/Functions.php index 933c8b9166..500470cdd9 100644 --- a/mailpoet/lib/Twig/Functions.php +++ b/mailpoet/lib/Twig/Functions.php @@ -271,9 +271,9 @@ class Functions extends AbstractExtension { } public function clickedStatsColor($clicked) { - if ($clicked > 3) { + if ($clicked > 30) { return '#7ed321'; - } elseif ($clicked > 1) { + } elseif ($clicked > 10) { return '#ff9f00'; } else { return '#f559c3';