From 52e73c7fbdb2848b39fbf909b059c6b9fdf34045 Mon Sep 17 00:00:00 2001 From: Denis Shagimuratov Date: Thu, 6 Nov 2014 12:18:10 +0500 Subject: [PATCH] Added admin notice email Admin notice for API failures on onSpamCheck(). --- antispambycleantalk.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/antispambycleantalk.php b/antispambycleantalk.php index 56bae2c..d8e5b0e 100644 --- a/antispambycleantalk.php +++ b/antispambycleantalk.php @@ -3,7 +3,7 @@ /** * CleanTalk joomla plugin * - * @version 2.4 + * @version 2.5 * @package Cleantalk * @subpackage Joomla * @author CleanTalk (welcome@cleantalk.ru) @@ -21,7 +21,7 @@ class plgSystemAntispambycleantalk extends JPlugin { /** * Plugin version string for server */ - const ENGINE = 'joomla-24'; + const ENGINE = 'joomla-25'; /** * Default value for hidden field ct_checkjs @@ -1204,6 +1204,10 @@ public function onSpamCheck($context='', $data){ ) ); + if ($ctResponse['errno'] != 0) { + $this->sendAdminEmail("CleanTalk plugin error", $ctResponse['comment']); + } + if (!empty($ctResponse['allow']) AND $ctResponse['allow'] == 1) { return true; } else {