Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.85

Version Description

January 11 2018 = * Fix: Fast Secure contact form spam block message. * Fix: IP license status. * Layout: Dashboard widget description altered.

Download this release

Release Info

Developer shagimuratov
Plugin Icon 128x128 Spam protection, AntiSpam, FireWall by CleanTalk
Version 5.85
Comparing to
See all releases

Code changes from version 5.84 to 5.85

cleantalk.php CHANGED
@@ -3,17 +3,17 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
- Version: 5.84
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
- $cleantalk_plugin_version='5.84';
12
- $ct_agent_version = 'wordpress-584';
13
  $cleantalk_executed = false;
14
 
15
- define('APBCT_VERSION', '5.84');
16
- define('APBCT_AGENT', 'wordpress-584');
17
 
18
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
19
 
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
+ Version: 5.85
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
+ $cleantalk_plugin_version='5.85';
12
+ $ct_agent_version = 'wordpress-585';
13
  $cleantalk_executed = false;
14
 
15
+ define('APBCT_VERSION', '5.85');
16
+ define('APBCT_AGENT', 'wordpress-585');
17
 
18
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
19
 
css/cleantalk-admin-settings-page.css CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  .ct-warning-test-failed {
2
  display: inline-block;
3
  position: relative;
1
+ a.ct_support_link{
2
+ color: #666;
3
+ margin-right: 0.5em;
4
+ font-size: 10pt;
5
+ font-weight: normal;
6
+ }
7
+
8
  .ct-warning-test-failed {
9
  display: inline-block;
10
  position: relative;
inc/cleantalk-admin.php CHANGED
@@ -147,27 +147,33 @@ function ct_dashboard_statistics_widget_output( $post, $callback_args ) {
147
  <?php }
148
  }
149
  // Notice at the bottom
150
- if(isset($current_user) && in_array("administrator", $current_user->roles)){
151
- if(!isset($ct_data['admin_blocked'])){
152
- $blocked=0;
153
- }else{
154
- $blocked=$ct_data['admin_blocked'];
155
- }
156
- if($blocked>0){
157
- $blocked = number_format($blocked, 0, ',', ' ');
158
- print "<div class='ct_widget_wprapper_total_blocked'>
159
- <img src='".plugins_url('/cleantalk-spam-protect/inc/images/logo_color.png')."' class='ct_widget_small_logo'/>
160
- <span>
161
- <a href='https://cleantalk.org/my/?user_token=".@$ct_data['user_token']."&utm_source=wp-backend&utm_medium=dashboard_widget&cp_mode=antispam' target='_blank'>CleanTalk</a> ";
162
- printf(
163
- /* translators: %s: Number of spam messages */
164
- __( 'has blocked %s spam. The statistics are automatically updated every 24 hours.', 'cleantalk' ),
165
- $blocked
166
- );
167
- print "</span><br><br>".sprintf(__('%sDo you like CleanTalk? %sPost your feedback here%s', 'cleantalk'), '<b style=\'font-size: 16px;\'>', '<u><a href=\'https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/#new-post\' target=\'_blank\'>', '</a></u>.</b>')."</div>";
 
 
 
 
 
 
168
  }
169
  }
170
- echo "</div>";
171
  }
172
 
173
  /**
@@ -334,60 +340,55 @@ function ct_account_status_check(){
334
  ? $_POST['cleantalk_settings']['apikey']
335
  : (!empty($ct_options['apikey'])
336
  ? $ct_options['apikey']
337
- : false);
338
 
339
- if($api_key){
340
 
341
- $result = CleantalkHelper::noticePaidTill($api_key);
342
-
343
- if ($result){
344
-
345
- $result = json_decode($result, true);
346
-
347
- if (isset($result['data']) && is_array($result['data']))
348
- $result = $result['data'];
349
 
350
- if(isset($result['spam_count']))
351
- $ct_data['admin_blocked'] = $result['spam_count'];
352
 
353
- if (isset($result['show_notice'])){
354
-
355
- if ($result['show_notice'] == 1 && isset($result['trial']) && $result['trial'] == 1){
356
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 3600);
357
- $show_ct_notice_trial = true;
358
- $ct_data['show_ct_notice_trial']=1;
359
- }
360
-
361
- if ($result['show_notice'] == 1 && isset($result['renew']) && $result['renew'] == 1){
362
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 1800);
363
- $show_ct_notice_renew = true;
364
- $ct_data['show_ct_notice_renew']=1;
365
- }
366
-
367
- if (isset($result['show_review']) && $result['show_review'] == 1)
368
- $ct_data['show_ct_notice_review'] = 1;
369
-
370
- if ($result['show_notice'] == 0)
371
- CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
372
-
373
- $ct_data['show_ct_notice_trial'] = (int) $show_ct_notice_trial;
374
- $ct_data['show_ct_notice_renew'] = (int) $show_ct_notice_renew;
375
  }
376
 
377
- if (isset($result['moderate_ip']) && $result['moderate_ip'] == 1){
378
- $ct_data['moderate_ip'] = 1;
379
- $ct_data['ip_license'] = $result['ip_license'];
380
- }else{
381
- $ct_data['moderate_ip'] = 0;
382
- $ct_data['ip_license'] = 0;
383
  }
384
 
385
- if (isset($result['user_token']))
386
- $ct_data['user_token'] = $result['user_token'];
387
-
388
- update_option('cleantalk_data', $ct_data);
389
 
 
 
 
 
 
390
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  }
392
  }
393
 
@@ -860,10 +861,7 @@ function ct_section_settings_state() {
860
  $ct_options = ct_get_options();
861
  $ct_data = ct_get_data();
862
 
863
- if(!isset($ct_data['moderate_ip']))
864
- {
865
- $ct_data['moderate_ip'] = 0;
866
- }
867
 
868
  $path_to_img = plugin_dir_url(__FILE__) . "images/";
869
 
@@ -1006,59 +1004,42 @@ function ct_mail_send_connection_report() {
1006
  */
1007
  function ct_input_apikey() {
1008
  global $ct_options, $ct_data, $ct_notice_online_label;
 
1009
  $ct_options=ct_get_options();
1010
  $ct_data=ct_get_data();
1011
 
1012
- if(!isset($ct_data['admin_blocked']))
1013
- {
1014
- $blocked=0;
1015
- }
1016
- else
1017
- {
1018
- $blocked=$ct_data['admin_blocked'];
1019
- }
1020
-
1021
- echo "<style>a.ct_support_link{color: #666; margin-right: 0.5em; font-size: 10pt; font-weight: normal;}</style>";
1022
-
1023
- if($blocked>0)
1024
- {
1025
- $blocked = number_format($blocked, 0, ',', ' ');
1026
 
 
1027
  echo "<script>var cleantalk_blocked_message=\"<div style='height:24px;width:100%;display:table-cell; vertical-align:middle;'><span>CleanTalk ";
1028
  printf(
1029
  /* translators: %s: Number of spam messages */
1030
  __( 'has blocked <b>%s</b> spam.', 'cleantalk' ),
1031
- $blocked
1032
  );
1033
  echo "</span></div><br />\";\n";
1034
- }
1035
- else
1036
- {
1037
  echo "<script>var cleantalk_blocked_message=\"\";\n";
1038
  }
1039
- echo "var cleantalk_statistics_link=\"<a class='cleantalk_manual_link' target='__blank' href='https://cleantalk.org/my?user_token=".@$ct_data['user_token']."&cp_mode=antispam'>".__('Click here to get anti-spam statistics', 'cleantalk')."</a>\";";
1040
- echo "var cleantalk_support_link=\"<a class='cleantalk_auto_link' target='__blank' href='https://wordpress.org/support/plugin/cleantalk-spam-protect'>"
1041
- .__('Support', 'cleantalk')."</a>\";
1042
  </script>";
1043
 
1044
  $value = $ct_options['apikey'];
1045
  $def_value = '';
1046
  $is_wpmu=false;
1047
- if(!defined('CLEANTALK_ACCESS_KEY'))
1048
- {
1049
  echo "<input id='cleantalk_apikey' name='cleantalk_settings[apikey]' size='20' type='text' value='$value' style=\"font-size: 14pt;\" placeholder='" . __('Enter the key', 'cleantalk') . "' />";
1050
  echo "<script>var cleantalk_wpmu=false;</script>";
1051
- }
1052
- else
1053
- {
1054
  echo "<script>var cleantalk_wpmu=true;</script>";
1055
- $is_wpmu=true;
1056
  }
1057
 
1058
  //echo "<script src='".plugins_url( 'cleantalk-admin.js', __FILE__ )."?ver=".$cleantalk_plugin_version."'></script>\n";
1059
- if (ct_valid_key($value) === false && !$is_wpmu) {
1060
  echo "<script>var cleantalk_good_key=false;</script>";
1061
- if (function_exists('curl_init') && function_exists('json_decode')) {
1062
  echo '<br /><br />';
1063
  echo "<a target='__blank' style='' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(ct_get_admin_email())."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'><input type='button' class='cleantalk_auto_link' value='".__('Get access key manually', 'cleantalk')."' /></a>";
1064
  echo "&nbsp;" . __("or") . "&nbsp;";
@@ -1072,7 +1053,6 @@ function ct_input_apikey() {
1072
  }
1073
  } else {
1074
  $cleantalk_support_links = "<br /><div>";
1075
- $cleantalk_support_links .= "<style>a.ct_support_link{color: #666; margin-right: 0.5em; font-size: 10pt; font-weight: normal;}</style>";
1076
  $cleantalk_support_links .= "<a href='#' id='cleantalk_access_key_link' class='ct_support_link'>" . __("Show the access key", 'cleantalk') . "</a>";
1077
  $cleantalk_support_links .= "&nbsp;&nbsp;";
1078
  $cleantalk_support_links .= "&nbsp;&nbsp;";
@@ -1086,10 +1066,10 @@ function ct_input_apikey() {
1086
  }
1087
 
1088
  $test_failed = (!empty($ct_data['testing_failed']) ? true : false);
1089
- $modearte_ip = (!empty($ct_data['moderate_ip']) ? true : false);
1090
 
1091
  //Testing failed output
1092
- if($test_failed && !$modearte_ip){
1093
  echo "<script type=\"text/javascript\">var cleantalk_testing_failed = true;</script>";
1094
  echo "<br>";
1095
  echo "<div class='ct-warning-test-failed'>";
147
  <?php }
148
  }
149
  // Notice at the bottom
150
+ if(isset($current_user) && in_array('administrator', $current_user->roles)){
151
+
152
+ $blocked = isset($ct_data['admin_blocked']) ? $ct_data['admin_blocked'] : 0;
153
+
154
+ if($blocked > 0){
155
+ echo '<div class="ct_widget_wprapper_total_blocked">'
156
+ .'<img src="'.plugins_url('/cleantalk-spam-protect/inc/images/logo_color.png').'" class="ct_widget_small_logo"/>'
157
+ .'<span title="'.__('This is the count from the CleanTalk\'s cloud and could be different to admin bar counters', 'cleantalk').'">'
158
+ .sprintf(
159
+ /* translators: %s: Number of spam messages */
160
+ __( '%sCleanTalk%s has blocked %s spam for all time. The statistics are automatically updated every 24 hours.', 'cleantalk'),
161
+ '<a href="https://cleantalk.org/my/?user_token='.@$ct_data['user_token'].'&utm_source=wp-backend&utm_medium=dashboard_widget&cp_mode=antispam" target="_blank">',
162
+ '</a>',
163
+ number_format($blocked)
164
+ )
165
+ .'</span><br><br>'
166
+ .'<b style="font-size: 16px;">'
167
+ .sprintf(
168
+ __('Do you like CleanTalk?%s Post your feedback here%s.', 'cleantalk'),
169
+ '<u><a href="https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/#new-post" target="_blank">',
170
+ '</a></u>'
171
+ )
172
+ .'</b>'
173
+ .'</div>';
174
  }
175
  }
176
+ echo '</div>';
177
  }
178
 
179
  /**
340
  ? $_POST['cleantalk_settings']['apikey']
341
  : (!empty($ct_options['apikey'])
342
  ? $ct_options['apikey']
343
+ : null);
344
 
345
+ $result = CleantalkHelper::noticePaidTill($api_key);
346
 
347
+ if(empty($result['error'])){
348
+
349
+ if (isset($result['data']) && is_array($result['data']))
350
+ $result = $result['data'];
 
 
 
 
351
 
352
+ if(isset($result['spam_count']))
353
+ $ct_data['admin_blocked'] = $result['spam_count'];
354
 
355
+ if (isset($result['show_notice'])){
356
+
357
+ if ($result['show_notice'] == 1 && isset($result['trial']) && $result['trial'] == 1){
358
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 3600);
359
+ $show_ct_notice_trial = true;
360
+ $ct_data['show_ct_notice_trial']=1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  }
362
 
363
+ if ($result['show_notice'] == 1 && isset($result['renew']) && $result['renew'] == 1){
364
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 1800);
365
+ $show_ct_notice_renew = true;
366
+ $ct_data['show_ct_notice_renew']=1;
 
 
367
  }
368
 
369
+ if (isset($result['show_review']) && $result['show_review'] == 1)
370
+ $ct_data['show_ct_notice_review'] = 1;
 
 
371
 
372
+ if ($result['show_notice'] == 0)
373
+ CleantalkCron::updateTask('check_account_status', 'ct_account_status_check', 86400);
374
+
375
+ $ct_data['show_ct_notice_trial'] = (int) $show_ct_notice_trial;
376
+ $ct_data['show_ct_notice_renew'] = (int) $show_ct_notice_renew;
377
  }
378
+
379
+ if (isset($result['moderate_ip']) && $result['moderate_ip'] == 1){
380
+ $ct_data['moderate_ip'] = 1;
381
+ $ct_data['ip_license'] = $result['ip_license'];
382
+ }else{
383
+ $ct_data['moderate_ip'] = 0;
384
+ $ct_data['ip_license'] = 0;
385
+ }
386
+
387
+ if (isset($result['user_token']))
388
+ $ct_data['user_token'] = $result['user_token'];
389
+
390
+ update_option('cleantalk_data', $ct_data);
391
+
392
  }
393
  }
394
 
861
  $ct_options = ct_get_options();
862
  $ct_data = ct_get_data();
863
 
864
+ $ct_data['moderate_ip'] = isset($ct_data['moderate_ip']) ? $ct_data['moderate_ip'] : 0;
 
 
 
865
 
866
  $path_to_img = plugin_dir_url(__FILE__) . "images/";
867
 
1004
  */
1005
  function ct_input_apikey() {
1006
  global $ct_options, $ct_data, $ct_notice_online_label;
1007
+
1008
  $ct_options=ct_get_options();
1009
  $ct_data=ct_get_data();
1010
 
1011
+ $blocked = isset($ct_data['admin_blocked']) ? $ct_data['admin_blocked'] : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
1012
 
1013
+ if($blocked > 0){
1014
  echo "<script>var cleantalk_blocked_message=\"<div style='height:24px;width:100%;display:table-cell; vertical-align:middle;'><span>CleanTalk ";
1015
  printf(
1016
  /* translators: %s: Number of spam messages */
1017
  __( 'has blocked <b>%s</b> spam.', 'cleantalk' ),
1018
+ number_format($blocked)
1019
  );
1020
  echo "</span></div><br />\";\n";
1021
+ }else{
 
 
1022
  echo "<script>var cleantalk_blocked_message=\"\";\n";
1023
  }
1024
+ echo "var cleantalk_statistics_link=\"<a class='cleantalk_manual_link' target='__blank' href='https://cleantalk.org/my?user_token=".@$ct_data['user_token']."&cp_mode=antispam'>".__('Click here to get anti-spam statistics', 'cleantalk')."</a>\";";
1025
+ echo "var cleantalk_support_link=\"<a class='cleantalk_auto_link' target='__blank' href='https://wordpress.org/support/plugin/cleantalk-spam-protect'>".__('Support', 'cleantalk')."</a>\";
 
1026
  </script>";
1027
 
1028
  $value = $ct_options['apikey'];
1029
  $def_value = '';
1030
  $is_wpmu=false;
1031
+ if(!defined('CLEANTALK_ACCESS_KEY')){
 
1032
  echo "<input id='cleantalk_apikey' name='cleantalk_settings[apikey]' size='20' type='text' value='$value' style=\"font-size: 14pt;\" placeholder='" . __('Enter the key', 'cleantalk') . "' />";
1033
  echo "<script>var cleantalk_wpmu=false;</script>";
1034
+ }else{
 
 
1035
  echo "<script>var cleantalk_wpmu=true;</script>";
1036
+ $is_wpmu = true;
1037
  }
1038
 
1039
  //echo "<script src='".plugins_url( 'cleantalk-admin.js', __FILE__ )."?ver=".$cleantalk_plugin_version."'></script>\n";
1040
+ if (ct_valid_key($value) === false && !$is_wpmu){
1041
  echo "<script>var cleantalk_good_key=false;</script>";
1042
+ if (function_exists('curl_init') && function_exists('json_decode')){
1043
  echo '<br /><br />';
1044
  echo "<a target='__blank' style='' href='https://cleantalk.org/register?platform=wordpress&email=".urlencode(ct_get_admin_email())."&website=".urlencode(parse_url(get_option('siteurl'),PHP_URL_HOST))."'><input type='button' class='cleantalk_auto_link' value='".__('Get access key manually', 'cleantalk')."' /></a>";
1045
  echo "&nbsp;" . __("or") . "&nbsp;";
1053
  }
1054
  } else {
1055
  $cleantalk_support_links = "<br /><div>";
 
1056
  $cleantalk_support_links .= "<a href='#' id='cleantalk_access_key_link' class='ct_support_link'>" . __("Show the access key", 'cleantalk') . "</a>";
1057
  $cleantalk_support_links .= "&nbsp;&nbsp;";
1058
  $cleantalk_support_links .= "&nbsp;&nbsp;";
1066
  }
1067
 
1068
  $test_failed = (!empty($ct_data['testing_failed']) ? true : false);
1069
+ $moderate_ip = (!empty($ct_data['moderate_ip']) ? true : false);
1070
 
1071
  //Testing failed output
1072
+ if($test_failed && !$moderate_ip){
1073
  echo "<script type=\"text/javascript\">var cleantalk_testing_failed = true;</script>";
1074
  echo "<br>";
1075
  echo "<div class='ct-warning-test-failed'>";
inc/cleantalk-public.php CHANGED
@@ -1735,7 +1735,6 @@ function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
1735
  'sender_email' => $sender_email,
1736
  'sender_nickname' => $sender_nickname,
1737
  'post_info' => array('comment_type' => 'feedback'),
1738
- 'sender_info' => $sender_info,
1739
  'checkjs' => js_test('ct_checkjs', $_POST, true),
1740
  )
1741
  );
1735
  'sender_email' => $sender_email,
1736
  'sender_nickname' => $sender_nickname,
1737
  'post_info' => array('comment_type' => 'feedback'),
 
1738
  'checkjs' => js_test('ct_checkjs', $_POST, true),
1739
  )
1740
  );
lib/CleantalkHelper.php CHANGED
@@ -274,7 +274,7 @@ class CleantalkHelper
274
  );
275
 
276
  $result = self::sendRawRequest(self::URL, $request);
277
- // $result = $do_check ? self::checkRequestResult($result, 'notice_paid_till') : $result;
278
 
279
  return $result;
280
  }
274
  );
275
 
276
  $result = self::sendRawRequest(self::URL, $request);
277
+ $result = $do_check ? self::checkRequestResult($result, 'notice_paid_till') : $result;
278
 
279
  return $result;
280
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, sartemd174
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9.1
6
- Stable tag: 5.84
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
@@ -504,6 +504,11 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
504
  1. The plugin deletes/removes the existing spam comments and users accounts.
505
 
506
  == Changelog ==
 
 
 
 
 
507
  = 5.84 December 26 2017 =
508
  * Integration: PeepSo contact form
509
  * Repared: Feedback from comments page.
@@ -1492,6 +1497,11 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
1492
  * First version
1493
 
1494
  == Upgrade Notice ==
 
 
 
 
 
1495
  = 5.84 December 26 2017 =
1496
  * Integration: PeepSo contact form
1497
  * Repared: Feedback from comments page.
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9.1
6
+ Stable tag: 5.85
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
504
  1. The plugin deletes/removes the existing spam comments and users accounts.
505
 
506
  == Changelog ==
507
+ = 5.85 January 11 2018 =
508
+ * Fix: Fast Secure contact form spam block message.
509
+ * Fix: IP license status.
510
+ * Layout: Dashboard widget description altered.
511
+
512
  = 5.84 December 26 2017 =
513
  * Integration: PeepSo contact form
514
  * Repared: Feedback from comments page.
1497
  * First version
1498
 
1499
  == Upgrade Notice ==
1500
+ = 5.85 January 11 2018 =
1501
+ * Fix: Fast Secure contact form spam block message.
1502
+ * Fix: IP license status.
1503
+ * Layout: Dashboard widget description altered.
1504
+
1505
  = 5.84 December 26 2017 =
1506
  * Integration: PeepSo contact form
1507
  * Repared: Feedback from comments page.