Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.105

Version Description

September 26 2018 = * Integration: Now bloking spam for QAEngine questions. * Fix: Async http__request call. * Fix: Unnecessary get_antispam_report_breif method call. * Layout: Hide "Do you like Cleantlak?" when key is not ok. * Layout: Minor fixes.

Download this release

Release Info

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

Code changes from version 5.104 to 5.105

cleantalk.php CHANGED
@@ -3,7 +3,7 @@
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.
6
- Version: 5.104
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
@@ -202,7 +202,8 @@ if(!defined('CLEANTALK_PLUGIN_DIR')){
202
 
203
  //QAEngine Theme answers
204
  if (intval($apbct->settings['general_contact_forms_test']))
205
- add_filter('et_pre_insert_answer', 'ct_ajax_hook', 1, 1);
 
206
 
207
  //
208
  // Some of plugins to register a users use AJAX context.
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.
6
+ Version: 5.105
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
202
 
203
  //QAEngine Theme answers
204
  if (intval($apbct->settings['general_contact_forms_test']))
205
+ add_filter('et_pre_insert_question', 'ct_ajax_hook', 1, 1); // Questions
206
+ add_filter('et_pre_insert_answer', 'ct_ajax_hook', 1, 1); // Answers
207
 
208
  //
209
  // Some of plugins to register a users use AJAX context.
css/cleantalk-admin-settings-page.css CHANGED
@@ -135,45 +135,21 @@ a.ct_support_link{
135
 
136
  /* Settings banners */
137
  .ct_settings_banner{
 
138
  display:inline-block;
 
139
  margin: 1em 0;
140
  vertical-align: top;
141
- text-align: center;
142
  }
143
 
144
  #ct_translate_plugin {margin-left: 0px;}
145
- .ct_rate_block {border: 1px dashed #666; width: 370px; padding: 0.2em; padding-bottom: 15px;}
146
- #ct_translate_plugin .spbc_button_rate{margin-bottom: 10px;}
147
-
148
- .ct_button_rate {
149
  display: inline-block;
 
 
 
 
150
  text-align: center;
151
- vertical-align: middle;
152
- padding: 12px 24px;
153
- border: 1px solid #216298;
154
- border-radius: 8px;
155
- background: #35a0f7;
156
- background: -webkit-gradient(linear, left top, left bottom, from(#35a0f7), to(#216298));
157
- background: -moz-linear-gradient(top, #35a0f7, #216298);
158
- background: linear-gradient(to bottom, #35a0f7, #216298);
159
- text-shadow: #153e5f 1px 1px 1px;
160
- font: normal normal bold 16px verdana;
161
- color: #ffffff;
162
- text-decoration: none;
163
  }
164
- .ct_button_rate:hover,
165
- .ct_button_rate:focus {
166
- border: 1px solid #297bbe;
167
- background: #40c0ff;
168
- background: -webkit-gradient(linear, left top, left bottom, from(#40c0ff), to(#2876b6));
169
- background: -moz-linear-gradient(top, #40c0ff, #2876b6);
170
- background: linear-gradient(to bottom, #40c0ff, #2876b6);
171
- color: #ffffff;
172
- text-decoration: none;
173
- }
174
- .ct_button_rate:active {
175
- background: #216298;
176
- background: -webkit-gradient(linear, left top, left bottom, from(#216298), to(#216298));
177
- background: -moz-linear-gradient(top, #216298, #216298);
178
- background: linear-gradient(to bottom, #216298, #216298);
179
- }
135
 
136
  /* Settings banners */
137
  .ct_settings_banner{
138
+ text-align: right;
139
  display:inline-block;
140
+ width: 100%;
141
  margin: 1em 0;
142
  vertical-align: top;
 
143
  }
144
 
145
  #ct_translate_plugin {margin-left: 0px;}
146
+ .ct_rate_block {
 
 
 
147
  display: inline-block;
148
+ width: 370px;
149
+ margin-right: 3em;
150
+ padding: 0.8em;
151
+ padding-bottom: 15px;
152
  text-align: center;
153
+ border: 1px dashed #666;
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
+ #ct_translate_plugin .spbc_button_rate{margin-bottom: 10px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cleantalk-admin.php CHANGED
@@ -38,7 +38,7 @@ function ct_dashboard_statistics_widget_output( $post, $callback_args ) {
38
  <h4 class='ct_widget_block_header'><?php _e('Top 5 spam IPs blocked', 'cleantalk'); ?></h4>
39
  <hr class='ct_widget_hr'>
40
  <?php
41
- if(!apbct_api_key__is_correct() || (isset($apbct->brief_data['error_no']) && $apbct->brief_data['error_no'] == 6)){
42
  $plugin_settings_link = (is_network_admin() ? "settings.php" : "options-general.php" )."?page=cleantalk";
43
  ?> <div class='ct_widget_block'>
44
  <form action='<? echo $plugin_settings_link; ?>' method='POST'>
@@ -47,7 +47,7 @@ function ct_dashboard_statistics_widget_output( $post, $callback_args ) {
47
  </form>
48
  </div>
49
  <?php
50
- }elseif(!empty($apbct->brief_data['error'])){
51
  echo '<div class="ct_widget_block">'
52
  .'<h2 class="ct_widget_activate_header">'
53
  .sprintf(__('Something went wrong! Error: "%s".', 'cleantalk'), "<u>{$apbct->brief_data['error_string']}</u>")
@@ -63,7 +63,7 @@ function ct_dashboard_statistics_widget_output( $post, $callback_args ) {
63
  echo '</div>';
64
  }
65
 
66
- if(apbct_api_key__is_correct() && empty($apbct->brief_data['error'])){
67
  ?>
68
  <div class='ct_widget_block'>
69
  <table cellspacing="0">
@@ -142,7 +142,7 @@ function apbct_admin__init(){
142
  }
143
 
144
  // Getting dashboard widget statistics
145
- if(!empty($_POST['ct_brief_refresh']) || empty($apbct->brief_data)){
146
  $apbct->data['brief_data'] = CleantalkHelper::api_method__get_antispam_report_breif($apbct->api_key);
147
  $apbct->saveData();
148
  }
38
  <h4 class='ct_widget_block_header'><?php _e('Top 5 spam IPs blocked', 'cleantalk'); ?></h4>
39
  <hr class='ct_widget_hr'>
40
  <?php
41
+ if(!apbct_api_key__is_correct() || (isset($apbct->data['brief_data']['error_no']) && $apbct->data['brief_data']['error_no'] == 6)){
42
  $plugin_settings_link = (is_network_admin() ? "settings.php" : "options-general.php" )."?page=cleantalk";
43
  ?> <div class='ct_widget_block'>
44
  <form action='<? echo $plugin_settings_link; ?>' method='POST'>
47
  </form>
48
  </div>
49
  <?php
50
+ }elseif(!empty($apbct->data['brief_data']['error'])){
51
  echo '<div class="ct_widget_block">'
52
  .'<h2 class="ct_widget_activate_header">'
53
  .sprintf(__('Something went wrong! Error: "%s".', 'cleantalk'), "<u>{$apbct->brief_data['error_string']}</u>")
63
  echo '</div>';
64
  }
65
 
66
+ if(apbct_api_key__is_correct() && empty($apbct->data['brief_data']['error'])){
67
  ?>
68
  <div class='ct_widget_block'>
69
  <table cellspacing="0">
142
  }
143
 
144
  // Getting dashboard widget statistics
145
+ if(!empty($_POST['ct_brief_refresh']) || empty($apbct->data['brief_data'])){
146
  $apbct->data['brief_data'] = CleantalkHelper::api_method__get_antispam_report_breif($apbct->api_key);
147
  $apbct->saveData();
148
  }
inc/cleantalk-comments.php CHANGED
@@ -16,9 +16,13 @@ function ct_add_comments_menu(){
16
 
17
  function ct_show_checkspam_page(){
18
 
 
 
19
  ?>
20
  <div class="wrap">
21
- <h2><img src="<?php echo plugin_dir_url(__FILE__) ?>/images/logo_color.png" /> <?php echo APBCT_NAME; ?></h2><br />
 
 
22
  <?php
23
 
24
  // If access key is unset in
@@ -173,10 +177,7 @@ function ct_show_checkspam_page(){
173
 
174
  // Outputs email if exists
175
  if($email)
176
- echo "<a href='mailto:$email'>$email</a>"
177
- ."<a href='https://cleantalk.org/blacklists/$email ' target='_blank'>"
178
- ."&nbsp;<img src='".plugin_dir_url(__FILE__)."images/new_window.gif' border='0' style='float:none'/>"
179
- ."</a>";
180
  else
181
  echo "No email";
182
  echo "<br/>";
16
 
17
  function ct_show_checkspam_page(){
18
 
19
+ $settings_link = (is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk');
20
+
21
  ?>
22
  <div class="wrap">
23
+ <h2><img src="<?php echo plugin_dir_url(__FILE__) ?>/images/logo_color.png" /> <?php echo APBCT_NAME; ?></h2>
24
+ <a style="color: gray; margin-left: 23px;" href="<?php echo $settings_link; ?>">Plugin Settings</a>
25
+ <br />
26
  <?php
27
 
28
  // If access key is unset in
177
 
178
  // Outputs email if exists
179
  if($email)
180
+ echo "<a href='mailto:$email'>$email</a>";
 
 
 
181
  else
182
  echo "No email";
183
  echo "<br/>";
inc/cleantalk-public.php CHANGED
@@ -912,21 +912,26 @@ function ct_preprocess_comment($comment) {
912
  $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_result->comment;
913
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
914
 
915
- if($ct_result->stop_queue == 1) // Terminate. Definitely spam.
 
916
  wp_die($err_text, 'Blacklisted', array('back_link' => true));
917
 
918
- if($ct_result->spam == 3) // Don't move to spam folder. Delete.
 
919
  wp_die($err_text, 'Blacklisted', array('back_link' => true));
920
 
 
921
  if($ct_result->spam == 2){
922
  add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
923
  add_action('comment_post', 'ct_wp_trash_comment', 997, 2);
924
  }
925
 
 
926
  if($ct_result->spam == 1)
927
  add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
928
 
929
- if($ct_result->stop_words){ // Contains stop_words. Move to pending folder.
 
930
  add_filter('pre_comment_approved', 'ct_set_not_approved', 998, 2);
931
  add_action('comment_post', 'ct_mark_red', 998, 2);
932
  }
@@ -1837,9 +1842,6 @@ function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) {
1837
 
1838
  global $apbct, $cleantalk_executed, $ct_gform_is_spam, $ct_gform_response;
1839
 
1840
-
1841
-
1842
-
1843
  if (
1844
  $apbct->settings['contact_forms_test'] == 0 ||
1845
  $is_spam ||
912
  $err_text = '<center><b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_result->comment;
913
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
914
 
915
+ // Terminate. Definitely spam.
916
+ if($ct_result->stop_queue == 1)
917
  wp_die($err_text, 'Blacklisted', array('back_link' => true));
918
 
919
+ // Terminate by user's setting.
920
+ if($ct_result->spam == 3)
921
  wp_die($err_text, 'Blacklisted', array('back_link' => true));
922
 
923
+ // Trash comment.
924
  if($ct_result->spam == 2){
925
  add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
926
  add_action('comment_post', 'ct_wp_trash_comment', 997, 2);
927
  }
928
 
929
+ // Spam comment
930
  if($ct_result->spam == 1)
931
  add_filter('pre_comment_approved', 'ct_set_comment_spam', 997, 2);
932
 
933
+ // Move to pending folder. Contains stop_words.
934
+ if($ct_result->stop_words){
935
  add_filter('pre_comment_approved', 'ct_set_not_approved', 998, 2);
936
  add_action('comment_post', 'ct_mark_red', 998, 2);
937
  }
1842
 
1843
  global $apbct, $cleantalk_executed, $ct_gform_is_spam, $ct_gform_response;
1844
 
 
 
 
1845
  if (
1846
  $apbct->settings['contact_forms_test'] == 0 ||
1847
  $is_spam ||
inc/cleantalk-settings.php CHANGED
@@ -5,7 +5,7 @@
5
  */
6
  function apbct_settings__add_page() {
7
 
8
- global $apbct;
9
 
10
  // Adding settings page
11
  if(is_network_admin())
@@ -13,6 +13,9 @@ function apbct_settings__add_page() {
13
  else
14
  add_options_page(__('CleanTalk settings', 'cleantalk'), APBCT_NAME, 'manage_options', 'cleantalk', 'apbct_settings_page');
15
 
 
 
 
16
  register_setting('cleantalk_settings', 'cleantalk_settings', 'apbct_settings__validate');
17
 
18
  add_settings_section('cleantalk_section_settings_main', '', 'apbct_section__settings_main', 'cleantalk');
@@ -279,7 +282,8 @@ function apbct_settings_page() {
279
  echo '<span id="apbct_gdpr_open_modal" style="text-decoration: underline;">'.__('GDPR compliance', 'cleantalk').'</span><br/>';
280
  echo __('Use s@cleantalk.org to test plugin in any WordPress form.', 'cleantalk').'<br>';
281
  echo __('CleanTalk is registered Trademark. All rights reserved.', 'cleantalk').'<br/>';
282
- echo '<b style="display: inline-block; margin-top: 10px;">'.sprintf(__('Do you like CleanTalk? %sPost your feedback here%s.', 'cleantalk'), '<a href="https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/#new-post" target="_blank">', '</a>').'</b><br />';
 
283
  apbct_admin__badge__get_premium();
284
  echo '<div id="gdpr_dialog" style="display: none; padding: 7px;">';
285
  apbct_gdpr__show_text();
5
  */
6
  function apbct_settings__add_page() {
7
 
8
+ global $apbct, $pagenow;
9
 
10
  // Adding settings page
11
  if(is_network_admin())
13
  else
14
  add_options_page(__('CleanTalk settings', 'cleantalk'), APBCT_NAME, 'manage_options', 'cleantalk', 'apbct_settings_page');
15
 
16
+ if(!in_array($pagenow, array('options.php', 'options-general.php', 'settings.php')))
17
+ return;
18
+
19
  register_setting('cleantalk_settings', 'cleantalk_settings', 'apbct_settings__validate');
20
 
21
  add_settings_section('cleantalk_section_settings_main', '', 'apbct_section__settings_main', 'cleantalk');
282
  echo '<span id="apbct_gdpr_open_modal" style="text-decoration: underline;">'.__('GDPR compliance', 'cleantalk').'</span><br/>';
283
  echo __('Use s@cleantalk.org to test plugin in any WordPress form.', 'cleantalk').'<br>';
284
  echo __('CleanTalk is registered Trademark. All rights reserved.', 'cleantalk').'<br/>';
285
+ if($apbct->key_is_ok)
286
+ echo '<b style="display: inline-block; margin-top: 10px;">'.sprintf(__('Do you like CleanTalk? %sPost your feedback here%s.', 'cleantalk'), '<a href="https://wordpress.org/support/plugin/cleantalk-spam-protect/reviews/#new-post" target="_blank">', '</a>').'</b><br />';
287
  apbct_admin__badge__get_premium();
288
  echo '<div id="gdpr_dialog" style="display: none; padding: 7px;">';
289
  apbct_gdpr__show_text();
inc/cleantalk-users.php CHANGED
@@ -17,11 +17,15 @@ function ct_add_users_menu(){
17
 
18
  function ct_show_users_page(){
19
 
 
 
20
  global $wpdb;
21
 
22
  ?>
23
  <div class="wrap">
24
- <h2><img src="<?php echo plugin_dir_url(__FILE__) ?>/images/logo_color.png" /> <?php echo APBCT_NAME; ?></h2><br />
 
 
25
  <?php
26
 
27
  // If access key is unset in
17
 
18
  function ct_show_users_page(){
19
 
20
+ $settings_link = (is_network_admin() ? 'settings.php?page=cleantalk' : 'options-general.php?page=cleantalk');
21
+
22
  global $wpdb;
23
 
24
  ?>
25
  <div class="wrap">
26
+ <h2><img src="<?php echo plugin_dir_url(__FILE__) ?>/images/logo_color.png" /> <?php echo APBCT_NAME; ?></h2>
27
+ <a style="color: gray; margin-left: 23px;" href="<?php echo $settings_link; ?>">Plugin Settings</a>
28
+ <br />
29
  <?php
30
 
31
  // If access key is unset in
js/cleantalk-admin.js CHANGED
@@ -6,4 +6,6 @@ jQuery(document).ready(function(){
6
  document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString();
7
  });
8
 
 
 
9
  });
6
  document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString();
7
  });
8
 
9
+ jQuery('a[href="options-general.php?page=cleantalk"]').css('padding','5px 8px');
10
+
11
  });
lib/CleantalkHelper.php CHANGED
@@ -607,7 +607,7 @@ class CleantalkHelper
607
  // Make a request, don't wait for an answer
608
  case 'dont_wait_for_answer':
609
  $opts[CURLOPT_CONNECTTIMEOUT_MS] = 1000;
610
- $opts[CURLOPT_TIMEOUT_MS] = 1;
611
  break;
612
 
613
  case 'get':
607
  // Make a request, don't wait for an answer
608
  case 'dont_wait_for_answer':
609
  $opts[CURLOPT_CONNECTTIMEOUT_MS] = 1000;
610
+ $opts[CURLOPT_TIMEOUT_MS] = 500;
611
  break;
612
 
613
  case 'get':
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: safronik
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
- Stable tag: 5.104
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -516,6 +516,13 @@ Yes, it is. Please read this article,
516
  10. Website's options.
517
 
518
  == Changelog ==
 
 
 
 
 
 
 
519
  = 5.104 September 18 2018 =
520
  * Fix: Error when saving settings.
521
  * Fix: Trying update anti spam plugin for the first installation.
@@ -1656,6 +1663,13 @@ Yes, it is. Please read this article,
1656
  * First version
1657
 
1658
  == Upgrade Notice ==
 
 
 
 
 
 
 
1659
  = 5.104 September 18 2018 =
1660
  * Fix: Error when saving settings.
1661
  * Fix: Trying update plugin plugin for the first installation.
3
  Tags: spam, antispam, protection, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
+ Stable tag: 5.105
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
516
  10. Website's options.
517
 
518
  == Changelog ==
519
+ = 5.105 September 26 2018 =
520
+ * Integration: Now bloking spam for QAEngine questions.
521
+ * Fix: Async http__request call.
522
+ * Fix: Unnecessary get_antispam_report_breif method call.
523
+ * Layout: Hide "Do you like Cleantlak?" when key is not ok.
524
+ * Layout: Minor fixes.
525
+
526
  = 5.104 September 18 2018 =
527
  * Fix: Error when saving settings.
528
  * Fix: Trying update anti spam plugin for the first installation.
1663
  * First version
1664
 
1665
  == Upgrade Notice ==
1666
+ = 5.105 September 26 2018 =
1667
+ * Integration: Now bloking spam for QAEngine questions.
1668
+ * Fix: Async http__request call.
1669
+ * Fix: Unnecessary get_antispam_report_breif method call.
1670
+ * Layout: Hide "Do you like Cleantlak?" when key is not ok.
1671
+ * Layout: Minor fixes.
1672
+
1673
  = 5.104 September 18 2018 =
1674
  * Fix: Error when saving settings.
1675
  * Fix: Trying update plugin plugin for the first installation.
templates/translate_banner.php CHANGED
@@ -1,11 +1,13 @@
1
  <?php
2
  $ct_translate_banner_template = '
3
  <div class="ct_settings_banner" id="ct_translate_plugin">
4
- <div class="ct_rate_block">
5
- <p>'.__('Help others use the plugin in your language.', 'cleantalk').'</p>
6
- <p>'.__('We ask you to help with the translation of the plugin in your language. Please take a few minutes to make the plugin more comfortable.', 'cleantalk').'</p>
 
 
7
  <div>
8
- <a class="ct_button_rate" href="https://translate.wordpress.org/locale/%s/default/wp-plugins/cleantalk-spam-protect" target="_blank">'.__('TRANSLATE', 'cleantalk').'</a>
9
  </div>
10
  </div>
11
  </div>';
1
  <?php
2
  $ct_translate_banner_template = '
3
  <div class="ct_settings_banner" id="ct_translate_plugin">
4
+ <div class="ct_rate_block">'
5
+ .'<p>'
6
+ .__('Help others use the plugin in your language.', 'cleantalk')
7
+ .__('We ask you to help with the translation of the plugin in your language. Please take a few minutes to make the plugin more comfortable.', 'cleantalk')
8
+ .'</p>
9
  <div>
10
+ <a href="https://translate.wordpress.org/locale/%s/default/wp-plugins/cleantalk-spam-protect" target="_blank">'.__('TRANSLATE', 'cleantalk').'</a>
11
  </div>
12
  </div>
13
  </div>';