Spam protection, AntiSpam, FireWall by CleanTalk - Version 3.4

Version Description

2014-09-04 = * We've added anti spam for themes contact forms and any untested contact forms plugins. To use this test enable option "Custom contact forms" in plugin settings. * We've added auto rotation for spam comments. Now the plugin removes comments in SPAM folder older then 15 days. This option is enabled by default.

Download this release

Release Info

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

Code changes from version 3.2 to 3.4

Files changed (4) hide show
  1. cleantalk-admin.php +49 -11
  2. cleantalk.php +150 -29
  3. inc/images/yes.png +0 -0
  4. readme.txt +18 -9
cleantalk-admin.php CHANGED
@@ -22,7 +22,7 @@ function ct_admin_add_page() {
22
  * Admin action 'admin_init' - Add the admin settings and such
23
  */
24
  function ct_admin_init() {
25
- global $show_ct_notice_trial, $ct_notice_trial_label, $show_ct_notice_online, $ct_notice_online_label, $trial_notice_showtime, $pagenow, $ct_plugin_name, $ct_options, $trial_notice_check_timeout, $account_notice_check_timeout, $ct_user_token_label, $ct_account_status_check;
26
 
27
  $ct_options = ct_get_options();
28
 
@@ -89,24 +89,31 @@ function ct_admin_init() {
89
 
90
  $show_ct_notice_online = '';
91
  if (isset($_COOKIE[$ct_notice_online_label])) {
92
- if ($_COOKIE[$ct_notice_online_label] == 1) {
93
  $show_ct_notice_online = 'Y';
94
- }else{
 
 
 
 
95
  $show_ct_notice_online = 'N';
96
- }
97
  }
98
 
99
  ct_init_session();
100
-
101
  register_setting('cleantalk_settings', 'cleantalk_settings', 'ct_settings_validate');
102
  add_settings_section('cleantalk_settings_main', __($ct_plugin_name, 'cleantalk'), 'ct_section_settings_main', 'cleantalk');
103
  add_settings_section('cleantalk_settings_anti_spam', __('Anti-spam settings', 'cleantalk'), 'ct_section_settings_anti_spam', 'cleantalk');
104
  add_settings_field('cleantalk_apikey', __('Access key', 'cleantalk'), 'ct_input_apikey', 'cleantalk', 'cleantalk_settings_main');
105
  add_settings_field('cleantalk_autoPubRevelantMess', __('Publish relevant comments', 'cleantalk'), 'ct_input_autoPubRevelantMess', 'cleantalk', 'cleantalk_settings_main');
106
  add_settings_field('cleantalk_ssl_on', __('Use secure (SSL) connection to CleanTalk cloud', 'cleantalk'), 'ct_radio_ssl_on', 'cleantalk', 'cleantalk_settings_main');
 
 
107
  add_settings_field('cleantalk_registrations_test', __('Registration forms', 'cleantalk'), 'ct_input_registrations_test', 'cleantalk', 'cleantalk_settings_anti_spam');
108
  add_settings_field('cleantalk_comments_test', __('Comments form', 'cleantalk'), 'ct_input_comments_test', 'cleantalk', 'cleantalk_settings_anti_spam');
109
  add_settings_field('cleantalk_contact_forms_test', __('Contact forms', 'cleantalk'), 'ct_input_contact_forms_test', 'cleantalk', 'cleantalk_settings_anti_spam');
 
110
  }
111
 
112
  /**
@@ -156,13 +163,17 @@ function ct_radio_ssl_on() {
156
  * Admin callback function - Displays inputs of 'apikey' plugin parameter
157
  */
158
  function ct_input_apikey() {
159
- global $ct_options;
160
 
161
  $value = $ct_options['apikey'];
162
  $def_value = '';
163
  echo "<input id='cleantalk_apikey' name='cleantalk_settings[apikey]' size='20' type='text' value='$value' style=\"font-size: 14pt;\"/>";
164
  if (ct_valid_key($value) === false) {
165
  echo "<a target='__blank' style='margin-left: 10px' href='http://cleantalk.org/install/wordpress?step=2'>".__('Click here to get access key', 'cleantalk')."</a>";
 
 
 
 
166
  }
167
  }
168
 
@@ -205,6 +216,34 @@ function ct_input_contact_forms_test() {
205
  admin_addDescriptionsFields(__('Contact Form 7, Formiadble forms, JetPack, Fast Secure Contact Form, WordPress Landing Pages', 'cleantalk'));
206
  }
207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  /**
209
  * Admin callback function - Plugin parameters validator
210
  */
@@ -268,6 +307,7 @@ function admin_notice_message(){
268
  $show_notice = true;
269
  if ($show_notice && ct_valid_key($options['apikey']) === false) {
270
  echo '<div class="updated"><h3>' . __("Please enter the Access Key in <a href=\"options-general.php?page=cleantalk\">CleanTalk plugin</a> settings to enable protection from spam!", 'cleantalk') . '</h3></div>';
 
271
  }
272
 
273
  if ($show_notice && $show_ct_notice_trial) {
@@ -287,8 +327,6 @@ function admin_notice_message(){
287
 
288
  ct_send_feedback();
289
 
290
- delete_spam_comments();
291
-
292
  return true;
293
  }
294
 
@@ -298,7 +336,7 @@ function admin_notice_message(){
298
  * Add descriptions for field
299
  */
300
  function admin_addDescriptionsFields($descr = '') {
301
- echo "<div style='color: #666 !important'>$descr</div>";
302
  }
303
 
304
  /**
@@ -465,8 +503,8 @@ function ct_update_option($option_name) {
465
 
466
  if ($ct_result->inactive == 1) {
467
  setcookie($ct_notice_online_label, 0, null, '/');
468
- }else{
469
- setcookie($ct_notice_online_label, 1, strtotime("+5 seconds"), '/');
470
  setcookie($ct_notice_trial_label, (int) 0, strtotime("+$trial_notice_showtime minutes"), '/');
471
  }
472
  }
22
  * Admin action 'admin_init' - Add the admin settings and such
23
  */
24
  function ct_admin_init() {
25
+ global $show_ct_notice_trial, $ct_notice_trial_label, $show_ct_notice_online, $ct_notice_online_label, $trial_notice_showtime, $ct_plugin_name, $ct_options, $trial_notice_check_timeout, $account_notice_check_timeout, $ct_user_token_label, $ct_account_status_check;
26
 
27
  $ct_options = ct_get_options();
28
 
89
 
90
  $show_ct_notice_online = '';
91
  if (isset($_COOKIE[$ct_notice_online_label])) {
92
+ if ($_COOKIE[$ct_notice_online_label] != 0 && time() - $_COOKIE[$ct_notice_online_label] <= 5) {
93
  $show_ct_notice_online = 'Y';
94
+ } else {
95
+ $show_ct_notice_online = '';
96
+ }
97
+
98
+ if ($_COOKIE[$ct_notice_online_label] == 0) {
99
  $show_ct_notice_online = 'N';
100
+ }
101
  }
102
 
103
  ct_init_session();
104
+
105
  register_setting('cleantalk_settings', 'cleantalk_settings', 'ct_settings_validate');
106
  add_settings_section('cleantalk_settings_main', __($ct_plugin_name, 'cleantalk'), 'ct_section_settings_main', 'cleantalk');
107
  add_settings_section('cleantalk_settings_anti_spam', __('Anti-spam settings', 'cleantalk'), 'ct_section_settings_anti_spam', 'cleantalk');
108
  add_settings_field('cleantalk_apikey', __('Access key', 'cleantalk'), 'ct_input_apikey', 'cleantalk', 'cleantalk_settings_main');
109
  add_settings_field('cleantalk_autoPubRevelantMess', __('Publish relevant comments', 'cleantalk'), 'ct_input_autoPubRevelantMess', 'cleantalk', 'cleantalk_settings_main');
110
  add_settings_field('cleantalk_ssl_on', __('Use secure (SSL) connection to CleanTalk cloud', 'cleantalk'), 'ct_radio_ssl_on', 'cleantalk', 'cleantalk_settings_main');
111
+ add_settings_field('cleantalk_remove_old_spam', __('Automatically delete spam comments', 'cleantalk'), 'ct_input_remove_old_spam', 'cleantalk', 'cleantalk_settings_main');
112
+
113
  add_settings_field('cleantalk_registrations_test', __('Registration forms', 'cleantalk'), 'ct_input_registrations_test', 'cleantalk', 'cleantalk_settings_anti_spam');
114
  add_settings_field('cleantalk_comments_test', __('Comments form', 'cleantalk'), 'ct_input_comments_test', 'cleantalk', 'cleantalk_settings_anti_spam');
115
  add_settings_field('cleantalk_contact_forms_test', __('Contact forms', 'cleantalk'), 'ct_input_contact_forms_test', 'cleantalk', 'cleantalk_settings_anti_spam');
116
+ add_settings_field('cleantalk_general_contact_forms_test', __('Custom contact forms', 'cleantalk'), 'ct_input_general_contact_forms_test', 'cleantalk', 'cleantalk_settings_anti_spam');
117
  }
118
 
119
  /**
163
  * Admin callback function - Displays inputs of 'apikey' plugin parameter
164
  */
165
  function ct_input_apikey() {
166
+ global $ct_options, $ct_notice_online_label;
167
 
168
  $value = $ct_options['apikey'];
169
  $def_value = '';
170
  echo "<input id='cleantalk_apikey' name='cleantalk_settings[apikey]' size='20' type='text' value='$value' style=\"font-size: 14pt;\"/>";
171
  if (ct_valid_key($value) === false) {
172
  echo "<a target='__blank' style='margin-left: 10px' href='http://cleantalk.org/install/wordpress?step=2'>".__('Click here to get access key', 'cleantalk')."</a>";
173
+ } else{
174
+ if (isset($_COOKIE[$ct_notice_online_label]) && $_COOKIE[$ct_notice_online_label] > 0) {
175
+ echo '&nbsp;&nbsp;<span style="text-decoration: underline;">The key accepted!</span>&nbsp;<img src="' . plugin_dir_url(__FILE__) . 'inc/images/yes.png" alt="" height="" />';
176
+ }
177
  }
178
  }
179
 
216
  admin_addDescriptionsFields(__('Contact Form 7, Formiadble forms, JetPack, Fast Secure Contact Form, WordPress Landing Pages', 'cleantalk'));
217
  }
218
 
219
+ /**
220
+ * Admin callback function - Displays inputs of 'general_contact_forms_test' plugin parameter
221
+ */
222
+ function ct_input_general_contact_forms_test() {
223
+ global $ct_options;
224
+
225
+ $value = $ct_options['general_contact_forms_test'];
226
+ echo "<input type='radio' id='cleantalk_general_contact_forms_test1' name='cleantalk_settings[general_contact_forms_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_general_contact_forms_test1'> " . __('Yes') . "</label>";
227
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
228
+ echo "<input type='radio' id='cleantalk_general_contact_forms_test0' name='cleantalk_settings[general_contact_forms_test]' value='0' " . ($value == '0' ? 'checked' : '') . " /><label for='cleantalk_general_contact_forms_test0'> " . __('No') . "</label>";
229
+ admin_addDescriptionsFields(__('Anti spam test for any WordPress or themes contacts forms', 'cleantalk'));
230
+ }
231
+
232
+ /**
233
+ * @author Artem Leontiev
234
+ * Admin callback function - Displays inputs of 'Publicate relevant comments' plugin parameter
235
+ *
236
+ * @return null
237
+ */
238
+ function ct_input_remove_old_spam() {
239
+ $options = ct_get_options();
240
+ $value = $options['remove_old_spam'];
241
+ echo "<input type='radio' id='cleantalk_remove_old_spam1' name='cleantalk_settings[remove_old_spam]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_remove_old_spam1'> " . __('Yes') . "</label>";
242
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
243
+ echo "<input type='radio' id='cleantalk_remove_old_spam0' name='cleantalk_settings[remove_old_spam]' value='0' " . ($value == '0' ? 'checked' : '') . " /><label for='cleantalk_remove_old_spam0'> " . __('No') . "</label>";
244
+ admin_addDescriptionsFields(sprintf(__('Delete spam comments older than %d days.', 'cleantalk'), $options['spam_store_days']));
245
+ }
246
+
247
  /**
248
  * Admin callback function - Plugin parameters validator
249
  */
307
  $show_notice = true;
308
  if ($show_notice && ct_valid_key($options['apikey']) === false) {
309
  echo '<div class="updated"><h3>' . __("Please enter the Access Key in <a href=\"options-general.php?page=cleantalk\">CleanTalk plugin</a> settings to enable protection from spam!", 'cleantalk') . '</h3></div>';
310
+ $show_notice = false;
311
  }
312
 
313
  if ($show_notice && $show_ct_notice_trial) {
327
 
328
  ct_send_feedback();
329
 
 
 
330
  return true;
331
  }
332
 
336
  * Add descriptions for field
337
  */
338
  function admin_addDescriptionsFields($descr = '') {
339
+ echo "<div style='font-size: 10pt; color: #666 !important'>$descr</div>";
340
  }
341
 
342
  /**
503
 
504
  if ($ct_result->inactive == 1) {
505
  setcookie($ct_notice_online_label, 0, null, '/');
506
+ } else {
507
+ setcookie($ct_notice_online_label, time(), strtotime("+14 days"), '/');
508
  setcookie($ct_notice_trial_label, (int) 0, strtotime("+$trial_notice_showtime minutes"), '/');
509
  }
510
  }
cleantalk.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: Anti-spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Cloud antispam for comments, registrations and contacts. The plugin doesn't use CAPTCHA, Q&A, math, counting animals or quiz to stop spam bots.
6
- Version: 3.2
7
  Author: СleanTalk <welcome@cleantalk.ru>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
  define('CLEANTALK_PLUGIN_DIR', plugin_dir_path(__FILE__));
12
 
13
- $ct_agent_version = 'wordpress-32';
14
  $ct_plugin_name = 'Anti-spam by CleanTalk';
15
  $ct_checkjs_frm = 'ct_checkjs_frm';
16
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -134,7 +134,27 @@ add_filter('bbp_new_topic_pre_content', 'ct_bbp_new_pre_content', 1);
134
  add_filter('bbp_new_reply_pre_content', 'ct_bbp_new_pre_content', 1);
135
  add_action('bbp_theme_before_topic_form_content', 'ct_comment_form');
136
  add_action('bbp_theme_before_reply_form_content', 'ct_comment_form');
137
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  if (is_admin()) {
139
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-admin.php');
140
 
@@ -215,7 +235,17 @@ function ct_init() {
215
  if (ct_plugin_active('new-user-approve/new-user-approve.php')) {
216
  add_action('register_post', 'ct_register_post', 1, 3);
217
  }
218
-
 
 
 
 
 
 
 
 
 
 
219
  }
220
 
221
  /**
@@ -248,8 +278,9 @@ function ct_def_options() {
248
  'registrations_test' => '1',
249
  'comments_test' => '1',
250
  'contact_forms_test' => '1',
 
251
  'remove_old_spam' => '0',
252
- 'spam_store_days' => '31', // Days before delete comments from folder Spam
253
  'ssl_on' => 0, // Secure connection to servers
254
  'next_account_status_check' => 0, // Time label when the plugin should check account status
255
  'user_token' => '', // User token
@@ -653,8 +684,7 @@ function ct_frm_validate_entry ($errors, $values) {
653
  * @return mixed[] $comment Comment string
654
  */
655
  function ct_bbp_new_pre_content ($comment) {
656
- // wp_die('123', 'Blacklisted', array('back_link' => true));
657
- // bbp_add_error('bbp_reply_content', __('Sorry, but you have been detected as spam', 'cleantalk' ));
658
  $options = ct_get_options();
659
  if (ct_is_user_enable() === false || $options['comments_test'] == 0 || is_user_logged_in()) {
660
  return $comment;
@@ -737,7 +767,7 @@ function ct_preprocess_comment($comment) {
737
  $sender_info = array(
738
  'sender_url' => @$comment['comment_author_url']
739
  );
740
-
741
  //
742
  // JetPack comments logic
743
  //
@@ -1043,26 +1073,6 @@ function ct_get_checkjs_value() {
1043
  return md5($salt);
1044
  }
1045
 
1046
- /**
1047
- * Delete old spam comments
1048
- * @return null
1049
- */
1050
- function delete_spam_comments() {
1051
- $options = ct_get_options();
1052
-
1053
- if ($options['remove_old_spam'] == 1) {
1054
- $last_comments = get_comments(array('status' => 'spam', 'number' => 1000, 'order' => 'ASC'));
1055
- foreach ($last_comments as $c) {
1056
- if (time() - strtotime($c->comment_date_gmt) > 86400 * $options['spam_store_days']) {
1057
- // Force deletion old spam comments
1058
- wp_delete_comment($c->comment_ID, true);
1059
- }
1060
- }
1061
- }
1062
-
1063
- return null;
1064
- }
1065
-
1066
 
1067
  /**
1068
  * Insert a hidden field to registration form
@@ -1170,7 +1180,7 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
1170
  $user_email = $_POST['signup_email'];
1171
  $buddypress = true;
1172
  }
1173
-
1174
  $submit_time = submit_time_test();
1175
 
1176
  $options = ct_get_options();
@@ -1688,6 +1698,95 @@ function ct_s2member_registration_test() {
1688
  return true;
1689
  }
1690
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1691
  /**
1692
  * Inner function - Default data array for senders
1693
  * @return array
@@ -1707,4 +1806,26 @@ function get_sender_info() {
1707
  );
1708
  }
1709
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1710
  ?>
3
  Plugin Name: Anti-spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Cloud antispam for comments, registrations and contacts. The plugin doesn't use CAPTCHA, Q&A, math, counting animals or quiz to stop spam bots.
6
+ Version: 3.4
7
  Author: СleanTalk <welcome@cleantalk.ru>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
  define('CLEANTALK_PLUGIN_DIR', plugin_dir_path(__FILE__));
12
 
13
+ $ct_agent_version = 'wordpress-34';
14
  $ct_plugin_name = 'Anti-spam by CleanTalk';
15
  $ct_checkjs_frm = 'ct_checkjs_frm';
16
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
134
  add_filter('bbp_new_reply_pre_content', 'ct_bbp_new_pre_content', 1);
135
  add_action('bbp_theme_before_topic_form_content', 'ct_comment_form');
136
  add_action('bbp_theme_before_reply_form_content', 'ct_comment_form');
137
+
138
+ register_activation_hook( __FILE__, 'ct_activation' );
139
+
140
+ /**
141
+ * On activation, set a time, frequency and name of an action hook to be scheduled.
142
+ */
143
+ function ct_activation() {
144
+ wp_schedule_event(time(), 'hourly', 'ct_hourly_event_hook' );
145
+ }
146
+
147
+ // Hourly run hook
148
+ add_action('ct_hourly_event_hook', 'ct_do_this_hourly');
149
+
150
+ /**
151
+ * On the scheduled action hook, run the function.
152
+ */
153
+ function ct_do_this_hourly() {
154
+ // do something every hour
155
+ delete_spam_comments();
156
+ }
157
+
158
  if (is_admin()) {
159
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-admin.php');
160
 
235
  if (ct_plugin_active('new-user-approve/new-user-approve.php')) {
236
  add_action('register_post', 'ct_register_post', 1, 3);
237
  }
238
+
239
+ //
240
+ // Load JS code to website footer for contact forms
241
+ //
242
+ if (!is_admin() && !(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
243
+ $options = get_option('cleantalk_settings');
244
+ if (isset($options['general_contact_forms_test']) && $options['general_contact_forms_test'] == 1) {
245
+ add_action('wp_footer', 'ct_footer_add_cookie', 1);
246
+ ct_contact_form_validate();
247
+ }
248
+ }
249
  }
250
 
251
  /**
278
  'registrations_test' => '1',
279
  'comments_test' => '1',
280
  'contact_forms_test' => '1',
281
+ 'general_contact_forms_test' => '0', // Antispam test for unsupported and untested contact forms
282
  'remove_old_spam' => '0',
283
+ 'spam_store_days' => '15', // Days before delete comments from folder Spam
284
  'ssl_on' => 0, // Secure connection to servers
285
  'next_account_status_check' => 0, // Time label when the plugin should check account status
286
  'user_token' => '', // User token
684
  * @return mixed[] $comment Comment string
685
  */
686
  function ct_bbp_new_pre_content ($comment) {
687
+
 
688
  $options = ct_get_options();
689
  if (ct_is_user_enable() === false || $options['comments_test'] == 0 || is_user_logged_in()) {
690
  return $comment;
767
  $sender_info = array(
768
  'sender_url' => @$comment['comment_author_url']
769
  );
770
+
771
  //
772
  // JetPack comments logic
773
  //
1073
  return md5($salt);
1074
  }
1075
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1076
 
1077
  /**
1078
  * Insert a hidden field to registration form
1180
  $user_email = $_POST['signup_email'];
1181
  $buddypress = true;
1182
  }
1183
+
1184
  $submit_time = submit_time_test();
1185
 
1186
  $options = ct_get_options();
1698
  return true;
1699
  }
1700
 
1701
+ /**
1702
+ * General test for any contact form
1703
+ */
1704
+ function ct_contact_form_validate () {
1705
+ if ($_SERVER['REQUEST_METHOD'] != 'POST') {
1706
+ return null;
1707
+ }
1708
+
1709
+ $checkjs = js_test('ct_checkjs', $_COOKIE);
1710
+
1711
+ $sender_info = get_sender_info();
1712
+ $sender_info = json_encode($sender_info);
1713
+ if ($sender_info === false) {
1714
+ $sender_info= '';
1715
+ }
1716
+
1717
+ $post_info['comment_type'] = 'feedback_general_contact_form';
1718
+ $post_info = json_encode($post_info);
1719
+ if ($post_info === false) {
1720
+ $post_info = '';
1721
+ }
1722
+
1723
+ $sender_email = null;
1724
+ $sender_nickname = null;
1725
+ $subject = '';
1726
+ $message = '';
1727
+ $contact_form = false;
1728
+ foreach ($_POST as $k => $v) {
1729
+ if ($sender_email === null && preg_match("/^\S+@\S+\.\S+$/", $v)) {
1730
+ $sender_email = $v;
1731
+ }
1732
+ if ($sender_nickname === null && ct_get_data_from_submit($k, 'name')) {
1733
+ $sender_nickname = $v;
1734
+ }
1735
+ if ($message === '' && ct_get_data_from_submit($k, 'message')) {
1736
+ $message = $v;
1737
+ }
1738
+ if ($subject === '' && ct_get_data_from_submit($k, 'subject')) {
1739
+ $subject = $v;
1740
+ }
1741
+
1742
+ if (!$contact_form && preg_match("/(contact|form|feedback)/", $k) && !preg_match("/^ct_checkjs/", $k)) {
1743
+ $contact_form = true;
1744
+ }
1745
+ }
1746
+
1747
+ // Skip submision if no data found
1748
+ if ((!$sender_email && $message == '' && $subject == '') || !$contact_form) {
1749
+ return false;
1750
+ }
1751
+
1752
+ $ct_base_call_result = ct_base_call(array(
1753
+ 'message' => $subject . "\n\n" . $message,
1754
+ 'example' => null,
1755
+ 'sender_email' => $sender_email,
1756
+ 'sender_nickname' => $sender_nickname,
1757
+ 'post_info' => $post_info,
1758
+ 'sender_info' => $sender_info,
1759
+ 'checkjs' => $checkjs
1760
+ ));
1761
+
1762
+ $ct = $ct_base_call_result['ct'];
1763
+ $ct_result = $ct_base_call_result['ct_result'];
1764
+
1765
+ if ($ct_result->allow == 0) {
1766
+ global $ct_comment;
1767
+ $ct_comment = $ct_result->comment;
1768
+ ct_die(null, null);
1769
+ exit;
1770
+ }
1771
+
1772
+ return null;
1773
+ }
1774
+
1775
+
1776
+ /**
1777
+ * Inner function - Finds and returns pattern in string
1778
+ * @return null|bool
1779
+ */
1780
+ function ct_get_data_from_submit($value = null, $field_name = null) {
1781
+ if (!$value || !$field_name) {
1782
+ return false;
1783
+ }
1784
+ if (preg_match("/[a-z0-9_\-]*" . $field_name. "[a-z0-9_\-]*$/", $value)) {
1785
+ return true;
1786
+ }
1787
+ }
1788
+
1789
+
1790
  /**
1791
  * Inner function - Default data array for senders
1792
  * @return array
1806
  );
1807
  }
1808
 
1809
+ /**
1810
+ * Delete old spam comments
1811
+ * @return null
1812
+ */
1813
+ function delete_spam_comments() {
1814
+ global $pagenow;
1815
+
1816
+ $options = ct_get_options();
1817
+ if ($options['remove_old_spam'] == 1) {
1818
+ $last_comments = get_comments(array('status' => 'spam', 'number' => 1000, 'order' => 'ASC'));
1819
+ foreach ($last_comments as $c) {
1820
+ if (time() - strtotime($c->comment_date_gmt) > 86400 * $options['spam_store_days']) {
1821
+ // Force deletion old spam comments
1822
+ wp_delete_comment($c->comment_ID, true);
1823
+ }
1824
+ }
1825
+ }
1826
+
1827
+ return null;
1828
+ }
1829
+
1830
+
1831
  ?>
inc/images/yes.png ADDED
Binary file
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
- === Anti-spam by CleanTalk (No CAPTCHA) ===
2
  Contributors: znaeff, shagimuratov
3
- Tags: antispam, anti-spam, anti spam, spam, spammers, captcha, comments, registration, contact form, blacklist, math, signup, formidable, bot, spam bots, spammy, s2member, wordpress, support, BuddyPress, bbpress, landing pages, fast secure contact form, WooCommerce, jetpack, cf7, forms
4
  Requires at least: 3.0
5
  Tested up to: 4.0
6
- Stable tag: 3.2
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Cloud, premium antispam for WordPress. No captcha, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks.
11
 
12
  == Description ==
13
  No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam bots.
@@ -21,11 +21,11 @@ No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam b
21
  = Spam protection =
22
  * WordPress, JetPack comments.
23
  * WordPress, BuddyPress, bbPress, S2Member signups.
24
- * Formidable forms, Contact form 7, JetPack Contact form, Fast Secure Contact form.
25
  * WooCommerce review form.
26
  * WordPress Landing Pages.
27
 
28
- = Cloud antispam for WordPress. no spam comments, no spam registrations, no spam contact emails, no spam trackbacks =
29
  Spam is one of the most irritating factors. Spam become every year more and conventional anti spam can no longer handle all the spam bots. CleanTalk prevents spam and automatically blocks it. You'll be surprised of effective protection against spam.
30
 
31
  = Anti spam plugin info =
@@ -50,8 +50,10 @@ The CleanTalk is premium anti spam for WordPress, please look at the <a href="ht
50
  * No captcha, puzzles, etc.
51
  * Free mobile app
52
 
53
- = How to Protect Sites from Bots? =
54
- The most popular method is CAPTCHA -- the annoying picture with curved and sloping symbols, which are offered to the visitor to fill in. It is supposed that spam bots won’t discern these CAPTCHA, but a visitor will. CAPTCHA provokes great irritation, but if one wants to speak out, he has to fill in these symbols time after time, making mistakes and starting once again. At the sight of CAPTCHA and after input errors, many visitors leave the resource. Thus, CAPTCHA helps to protect the resource both from bots and visitors. CAPTCHA is not a panacea from spam. Doubts Concerning the Need for CAPTCHA?
 
 
55
 
56
  = Additional features =
57
  * Online, daily and weekly anti spam reports traffic VS spam.
@@ -146,9 +148,13 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
146
  == Screenshots ==
147
  1. Plugin settings screen.
148
  1. Android app main screen.
149
- 1. Anti spam stopped spam bot at the registration form.
150
 
151
  == Changelog ==
 
 
 
 
152
  = 3.2 2014-08-27 =
153
  * Fixed submit_time() logic for failed submits (comments/registrations). Now form fill time resets after every failed submit.
154
 
@@ -383,6 +389,9 @@ WordPress 3.0 at least. PHP 4, 5 with CURL or file_get_contents() function and e
383
  * First version
384
 
385
  == Upgrade Notice ==
 
 
 
386
  = 3.2 2014-08-27 =
387
  Minor changes in spam filtration logic.
388
 
1
+ === Anti-spam by CleanTalk (no CAPTCHA) ===
2
  Contributors: znaeff, shagimuratov
3
+ Tags: antispam, anti-spam, anti spam, spam, spammers, captcha, comments, registration, contact form, blacklist, math, signup, formidable, bot, spam bots, spammy, s2member, wordpress, support, BuddyPress, bbpress, landing pages, fast secure contact form, WooCommerce, jetpack, cf7
4
  Requires at least: 3.0
5
  Tested up to: 4.0
6
+ Stable tag: 3.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ No captcha, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks. Cloud, CAPTCHA less, premium antispam for WordPress.
11
 
12
  == Description ==
13
  No CAPTCHA, no questions, no counting animals, no puzzles, no math and no spam bots.
21
  = Spam protection =
22
  * WordPress, JetPack comments.
23
  * WordPress, BuddyPress, bbPress, S2Member signups.
24
+ * Formidable forms, Contact form 7, JetPack Contact form, Fast Secure Contact form any themes/custom contact form.
25
  * WooCommerce review form.
26
  * WordPress Landing Pages.
27
 
28
+ = Cloud antispam for WordPress. CAPTCHA less, no spam comments, no spam registrations, no spam contact emails, no spam trackbacks =
29
  Spam is one of the most irritating factors. Spam become every year more and conventional anti spam can no longer handle all the spam bots. CleanTalk prevents spam and automatically blocks it. You'll be surprised of effective protection against spam.
30
 
31
  = Anti spam plugin info =
50
  * No captcha, puzzles, etc.
51
  * Free mobile app
52
 
53
+ = How to protect sites from spam bots without CAPTCHA? =
54
+ The most popular method is CAPTCHA -- the annoying picture with curved and sloping symbols, which are offered to the visitor to fill in. It is supposed that spam bots won’t discern these CAPTCHA, but a visitor will. CAPTCHA provokes great irritation, but if one wants to speak out, he has to fill in these symbols time after time, making mistakes and starting once again.
55
+ Sometimes CAPTCHA reminds doodle 2x year old child. For users with vision problems captcha is just an insurmountable obstacle. Users hate captcha. Captcha for users means "hate". Unreadable CAPTCHA stops about 80% of site visitors. After 2 failed attempts to bring it up to 95% reject further attempts.
56
+ At the sight of CAPTCHA and after input errors, many visitors leave the resource. Thus, CAPTCHA helps to protect the resource both from bots and visitors. CAPTCHA is not a panacea from spam. Doubts Concerning the Need for CAPTCHA?
57
 
58
  = Additional features =
59
  * Online, daily and weekly anti spam reports traffic VS spam.
148
  == Screenshots ==
149
  1. Plugin settings screen.
150
  1. Android app main screen.
151
+ 1. Anti spam stopped spam bot at the CAPTCHA less registration form.
152
 
153
  == Changelog ==
154
+ = 3.4 2014-09-04 =
155
+ * We've added anti spam for themes contact forms and any untested contact forms plugins. To use this test enable option "Custom contact forms" in plugin settings.
156
+ * We've added auto rotation for spam comments. Now the plugin removes comments in SPAM folder older then 15 days. This option is enabled by default.
157
+
158
  = 3.2 2014-08-27 =
159
  * Fixed submit_time() logic for failed submits (comments/registrations). Now form fill time resets after every failed submit.
160
 
389
  * First version
390
 
391
  == Upgrade Notice ==
392
+ = 3.4 2014-09-04 =
393
+ Spam comments rotation. Custom (themes) contact forms support.
394
+
395
  = 3.2 2014-08-27 =
396
  Minor changes in spam filtration logic.
397