Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.28

Version Description

2015-10-16 = * Fixed errors in anti-spam checking * Restored options for spam checking registrations and cpmmon contact forms * Improved antispam defence * Fixed problems with AJAX functionality in MailPoet, WooCommerce and other AJAX plugins

Download this release

Release Info

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

Code changes from version 5.27-options to 5.28

cleantalk.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Anti-spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.27
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.27';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
@@ -27,11 +27,15 @@ else
27
  {
28
  $cleantalk_use_footer_header=true;
29
  }
30
-
31
  if(!defined('CLEANTALK_PLUGIN_DIR')){
32
  define('CLEANTALK_PLUGIN_DIR', plugin_dir_path(__FILE__));
33
  global $ct_options, $ct_data;
34
 
 
 
 
 
 
35
 
36
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-common.php');
37
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
@@ -215,14 +219,6 @@ if (!function_exists ( 'ct_activation')) {
215
  wp_schedule_event(time(), 'hourly', 'ct_send_sfw_log' );
216
  wp_schedule_event(time(), 'daily', 'cleantalk_update_sfw' );
217
 
218
-
219
- global $wpdb;
220
- $wpdb->query("drop table if exists `".$wpdb->base_prefix."cleantalk_sfw`;");
221
- $wpdb->query("CREATE TABLE IF NOT EXISTS `".$wpdb->base_prefix."cleantalk_sfw` (
222
- `network` int(11) unsigned NOT NULL,
223
- `mask` int(11) unsigned NOT NULL,
224
- INDEX ( `network` , `mask` )
225
- ) ENGINE = MYISAM ;");
226
  cleantalk_update_sfw();
227
  add_option('ct_plugin_do_activation_redirect', true);
228
  }
@@ -368,6 +364,14 @@ add_action( 'right_now_content_table_end', 'my_add_counts_to_dashboard' );
368
 
369
  function cleantalk_update_sfw()
370
  {
 
 
 
 
 
 
 
 
371
  if(!function_exists('sendRawRequest'))
372
  {
373
  require_once('inc/cleantalk.class.php');
@@ -447,45 +451,6 @@ function cleantalk_get_ip()
447
 
448
  function ct_send_sfw_log()
449
  {
450
- /*global $ct_options, $ct_data;
451
- $ct_options = ct_get_options();
452
- $ct_data = ct_get_data();
453
-
454
- if(isset($ct_options['spam_firewall']))
455
- {
456
- $value = @intval($ct_options['spam_firewall']);
457
- }
458
- else
459
- {
460
- $value=0;
461
- }
462
-
463
- if($value==1 && isset($ct_data['sfw_log']))
464
- {
465
- $sfw_log=$ct_data['sfw_log'];
466
- $data=Array();
467
- foreach($sfw_log as $key=>$value)
468
- {
469
- $data[]=Array($key, $value['block'], $value['allow']);
470
- }
471
- $qdata = array (
472
- 'data' => json_encode($data),
473
- 'rows' => count($data),
474
- 'timestamp' => time()
475
- );
476
-
477
- $result = sendRawRequest('https://api.cleantalk.org/?method_name=sfw_logs&auth_key='.$ct_options['apikey'],$qdata);
478
- $result = json_decode($result);
479
- if(isset($result->data) && isset($result->data->rows))
480
- {
481
- if($result->data->rows == count($data))
482
- {
483
- $ct_data['sfw_log']=Array();
484
- update_option('cleantalk_data', $ct_data);
485
- }
486
- }
487
-
488
- }*/
489
  include_once("inc/cleantalk-sfw.class.php");
490
  $sfw = new CleanTalkSFW();
491
  $sfw->send_logs();
3
  Plugin Name: Anti-spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, captcha less, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
+ Version: 5.28
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.28';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
27
  {
28
  $cleantalk_use_footer_header=true;
29
  }
 
30
  if(!defined('CLEANTALK_PLUGIN_DIR')){
31
  define('CLEANTALK_PLUGIN_DIR', plugin_dir_path(__FILE__));
32
  global $ct_options, $ct_data;
33
 
34
+ if(@sizeof($_POST)==0 && @sizeof($_GET)==3 && isset($_GET['your_name']) && isset($_GET['email']) && isset($_GET['message']))
35
+ {
36
+ $_POST=$_GET;
37
+ }
38
+
39
 
40
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-common.php');
41
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
219
  wp_schedule_event(time(), 'hourly', 'ct_send_sfw_log' );
220
  wp_schedule_event(time(), 'daily', 'cleantalk_update_sfw' );
221
 
 
 
 
 
 
 
 
 
222
  cleantalk_update_sfw();
223
  add_option('ct_plugin_do_activation_redirect', true);
224
  }
364
 
365
  function cleantalk_update_sfw()
366
  {
367
+ global $wpdb;
368
+ $wpdb->query("drop table if exists `".$wpdb->base_prefix."cleantalk_sfw`;");
369
+ $wpdb->query("CREATE TABLE IF NOT EXISTS `".$wpdb->base_prefix."cleantalk_sfw` (
370
+ `network` int(11) unsigned NOT NULL,
371
+ `mask` int(11) unsigned NOT NULL,
372
+ INDEX ( `network` , `mask` )
373
+ ) ENGINE = MYISAM ;");
374
+
375
  if(!function_exists('sendRawRequest'))
376
  {
377
  require_once('inc/cleantalk.class.php');
451
 
452
  function ct_send_sfw_log()
453
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
454
  include_once("inc/cleantalk-sfw.class.php");
455
  $sfw = new CleanTalkSFW();
456
  $sfw->send_logs();
inc/cleantalk-admin.php CHANGED
@@ -318,20 +318,20 @@ function ct_admin_init() {
318
  </style>';
319
  if(isset($ct_data['testing_failed'])&&$ct_data['testing_failed']==1)
320
  {
321
- $buttons_html.='<a href="#" id="ct_button_check_comments" onclick="alert('."'".__('Feature is disabled, because testing of access key is failed!', 'cleantalk')."'".')">'.__('Check comments', 'cleantalk').'</a>
322
- <a href="#" id="ct_button_check_users" onclick="alert('."'".__('Feature is disabled, because testing of access key is failed!', 'cleantalk')."'".')">'.__('Check users', 'cleantalk').'</a><div class="clear"></div>';
323
  }
324
  else
325
  {
326
- $buttons_html.='<a href="edit-comments.php?page=ct_check_spam&do_check=1" style="font-size:10pt;font-weight:400;">'.__('Check comments', 'cleantalk').'</a><br />
327
- <a href="users.php?page=ct_check_users&do_check=1" style="font-size:10pt;font-weight:400;">'.__('Check users', 'cleantalk').'</a><div class="clear"></div>';
328
  }
329
 
330
  register_setting('cleantalk_settings', 'cleantalk_settings', 'ct_settings_validate');
331
  add_settings_section('cleantalk_settings_main', __($ct_plugin_name, 'cleantalk'), 'ct_section_settings_main', 'cleantalk');
332
  add_settings_section('cleantalk_settings_state', "<hr>".__('Protection is active', 'cleantalk'), 'ct_section_settings_state', 'cleantalk');
333
  //add_settings_section('cleantalk_settings_autodel', "<hr>", 'ct_section_settings_autodel', 'cleantalk');
334
- add_settings_section('cleantalk_settings_banner', "<hr>Check existing comments and users <br /><br />$buttons_html<hr></h3>", '', 'cleantalk');
335
  add_settings_section('cleantalk_settings_anti_spam', "<a href='#' style='text-decoration:underline;font-size:10pt;font-weight:400;'>".__('Advanced settings', 'cleantalk')."</a>", 'ct_section_settings_anti_spam', 'cleantalk');
336
 
337
  add_settings_field('cleantalk_apikey', __('Access key', 'cleantalk'), 'ct_input_apikey', 'cleantalk', 'cleantalk_settings_main');
@@ -348,7 +348,7 @@ function ct_admin_init() {
348
  add_settings_field('cleantalk_check_comments_number', __("Don't check comments", 'cleantalk'), 'ct_input_check_comments_number', 'cleantalk', 'cleantalk_settings_anti_spam');
349
  //add_settings_field('cleantalk_check_messages_number', __("Don't check messages", 'cleantalk'), 'ct_input_check_messages_number', 'cleantalk', 'cleantalk_settings_anti_spam');
350
  add_settings_field('cleantalk_show_link', __('', 'cleantalk'), 'ct_input_show_link', 'cleantalk', 'cleantalk_settings_banner');
351
- add_settings_field('cleantalk_spam_firewall', __('', 'cleantalk'), 'ct_input_spam_firewall', 'cleantalk', 'cleantalk_settings_banner');
352
  }
353
  }
354
 
@@ -829,11 +829,12 @@ function ct_input_spam_firewall() {
829
 
830
  echo "<div id='cleantalk_anchor1' style='display:none'></div><input type=hidden name='cleantalk_settings[spam_firewall]' value='0' />";
831
  echo "<input type='checkbox' id='cleantalk_spam_firewall1' name='cleantalk_settings[spam_firewall]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_spam_firewall1'> " . __('SpamFireWall') . "</label>";
832
- @admin_addDescriptionsFields(sprintf(__("This option allows to filter spam bots before they access website. Also reduces CPU usage on hosting server and accelerates pages load time.", 'cleantalk'), $ct_options['spam_firewall']));
833
  echo "<script>
834
  jQuery(document).ready(function(){
835
  jQuery('#cleantalk_anchor1').parent().parent().children().first().hide();
836
  jQuery('#cleantalk_anchor1').parent().css('padding-left','0px');
 
837
  });
838
  </script>";
839
  }
318
  </style>';
319
  if(isset($ct_data['testing_failed'])&&$ct_data['testing_failed']==1)
320
  {
321
+ /*$buttons_html.='<a href="#" id="ct_button_check_comments" onclick="alert('."'".__('Feature is disabled, because testing of access key is failed!', 'cleantalk')."'".')">'.__('Check comments', 'cleantalk').'</a>
322
+ <a href="#" id="ct_button_check_users" onclick="alert('."'".__('Feature is disabled, because testing of access key is failed!', 'cleantalk')."'".')">'.__('Check users', 'cleantalk').'</a><div class="clear"></div>';*/
323
  }
324
  else
325
  {
326
+ /*$buttons_html.='<a href="edit-comments.php?page=ct_check_spam&do_check=1" style="font-size:10pt;font-weight:400;">'.__('Check comments', 'cleantalk').'</a><br />
327
+ <a href="users.php?page=ct_check_users&do_check=1" style="font-size:10pt;font-weight:400;">'.__('Check users', 'cleantalk').'</a><div class="clear"></div>';*/
328
  }
329
 
330
  register_setting('cleantalk_settings', 'cleantalk_settings', 'ct_settings_validate');
331
  add_settings_section('cleantalk_settings_main', __($ct_plugin_name, 'cleantalk'), 'ct_section_settings_main', 'cleantalk');
332
  add_settings_section('cleantalk_settings_state', "<hr>".__('Protection is active', 'cleantalk'), 'ct_section_settings_state', 'cleantalk');
333
  //add_settings_section('cleantalk_settings_autodel', "<hr>", 'ct_section_settings_autodel', 'cleantalk');
334
+ add_settings_section('cleantalk_settings_banner', "<hr></h3>", '', 'cleantalk');
335
  add_settings_section('cleantalk_settings_anti_spam', "<a href='#' style='text-decoration:underline;font-size:10pt;font-weight:400;'>".__('Advanced settings', 'cleantalk')."</a>", 'ct_section_settings_anti_spam', 'cleantalk');
336
 
337
  add_settings_field('cleantalk_apikey', __('Access key', 'cleantalk'), 'ct_input_apikey', 'cleantalk', 'cleantalk_settings_main');
348
  add_settings_field('cleantalk_check_comments_number', __("Don't check comments", 'cleantalk'), 'ct_input_check_comments_number', 'cleantalk', 'cleantalk_settings_anti_spam');
349
  //add_settings_field('cleantalk_check_messages_number', __("Don't check messages", 'cleantalk'), 'ct_input_check_messages_number', 'cleantalk', 'cleantalk_settings_anti_spam');
350
  add_settings_field('cleantalk_show_link', __('', 'cleantalk'), 'ct_input_show_link', 'cleantalk', 'cleantalk_settings_banner');
351
+ add_settings_field('cleantalk_spam_firewall', __('', 'cleantalk'), 'ct_input_spam_firewall', 'cleantalk', 'cleantalk_settings_anti_spam');
352
  }
353
  }
354
 
829
 
830
  echo "<div id='cleantalk_anchor1' style='display:none'></div><input type=hidden name='cleantalk_settings[spam_firewall]' value='0' />";
831
  echo "<input type='checkbox' id='cleantalk_spam_firewall1' name='cleantalk_settings[spam_firewall]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_spam_firewall1'> " . __('SpamFireWall') . "</label>";
832
+ @admin_addDescriptionsFields(sprintf(__("EXPEREMENTAL! Use on your own risk.<br />This option allows to filter spam bots before they access website. Also reduces CPU usage on hosting server and accelerates pages load time.", 'cleantalk'), $ct_options['spam_firewall']));
833
  echo "<script>
834
  jQuery(document).ready(function(){
835
  jQuery('#cleantalk_anchor1').parent().parent().children().first().hide();
836
  jQuery('#cleantalk_anchor1').parent().css('padding-left','0px');
837
+ jQuery('#cleantalk_anchor1').parent().attr('colspan', '2');
838
  });
839
  </script>";
840
  }
inc/cleantalk-ajax.php CHANGED
@@ -197,7 +197,7 @@ function ct_validate_email_ajaxlogin($email=null, $is_ajax=true)
197
 
198
  function ct_user_register_ajaxlogin($user_id)
199
  {
200
- require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
201
  global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
202
 
203
  $ct_options = ct_get_options();
@@ -286,7 +286,7 @@ function ct_get_fields(&$email,&$message,$arr)
286
 
287
  function ct_ajax_hook()
288
  {
289
- require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
290
  global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
291
 
292
  $ct_options = ct_get_options();
197
 
198
  function ct_user_register_ajaxlogin($user_id)
199
  {
200
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
201
  global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
202
 
203
  $ct_options = ct_get_options();
286
 
287
  function ct_ajax_hook()
288
  {
289
+ require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-public.php');
290
  global $ct_agent_version, $ct_checkjs_register_form, $ct_session_request_id_label, $ct_session_register_ok_label, $bp, $ct_signup_done, $ct_formtime_label, $ct_negative_comment, $ct_options, $ct_data;
291
 
292
  $ct_options = ct_get_options();
inc/cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-527';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -133,6 +133,7 @@ function ct_base_call($params = array()) {
133
 
134
  $ct_options=ct_get_options();
135
  $ct_data=ct_get_data();
 
136
 
137
  /*if(defined('CLEANTALK_CHECK_MESSAGES_NUMBER'))
138
  {
@@ -179,6 +180,7 @@ function ct_base_call($params = array()) {
179
  }*/
180
 
181
  require_once('cleantalk.class.php');
 
182
 
183
  $submit_time = submit_time_test();
184
 
@@ -189,6 +191,7 @@ function ct_base_call($params = array()) {
189
  $sender_info = json_encode($sender_info);
190
  if ($sender_info === false)
191
  $sender_info = '';
 
192
 
193
  $config = get_option('cleantalk_server');
194
 
@@ -218,8 +221,10 @@ function ct_base_call($params = array()) {
218
  $ct_request->last_error_time=$ct_data['last_error_time'];
219
  $ct_request->last_error_text=$ct_data['last_error_text'];
220
  }
 
221
 
222
  $ct_result = $ct->isAllowMessage($ct_request);
 
223
  if ($ct->server_change) {
224
  update_option(
225
  'cleantalk_server', array(
@@ -229,9 +234,25 @@ function ct_base_call($params = array()) {
229
  )
230
  );
231
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  // Restart submit form counter for failed requests
234
  if ($ct_result->allow == 0) {
 
235
  $_SESSION[$ct_formtime_label] = time();
236
  if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
237
  {
@@ -240,17 +261,18 @@ function ct_base_call($params = array()) {
240
  }
241
  else
242
  {
 
243
  if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
244
  {
245
  ct_add_event('yes');
246
  }
247
- if($is_logged_in)
248
  {
249
  $user_cnt++;
250
  update_user_meta( $user_id, 'cleantalk_messages_number', $user_cnt);
251
- }
252
  }
253
-
254
  return array('ct' => $ct, 'ct_result' => $ct_result);
255
  }
256
 
@@ -787,4 +809,4 @@ function ct_filter_array(&$array)
787
  return $array;
788
  }
789
  }
790
- ?>
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-528';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
133
 
134
  $ct_options=ct_get_options();
135
  $ct_data=ct_get_data();
136
+ @header("CtBaseCall: get options & data");
137
 
138
  /*if(defined('CLEANTALK_CHECK_MESSAGES_NUMBER'))
139
  {
180
  }*/
181
 
182
  require_once('cleantalk.class.php');
183
+ @header("CtBaseCall: include class");
184
 
185
  $submit_time = submit_time_test();
186
 
191
  $sender_info = json_encode($sender_info);
192
  if ($sender_info === false)
193
  $sender_info = '';
194
+ @header("CtBaseCall: get sender info");
195
 
196
  $config = get_option('cleantalk_server');
197
 
221
  $ct_request->last_error_time=$ct_data['last_error_time'];
222
  $ct_request->last_error_text=$ct_data['last_error_text'];
223
  }
224
+ @header("CtBaseCall: fill request");
225
 
226
  $ct_result = $ct->isAllowMessage($ct_request);
227
+ @header("CtBaseCall: execute isAllowMessage");
228
  if ($ct->server_change) {
229
  update_option(
230
  'cleantalk_server', array(
234
  )
235
  );
236
  }
237
+
238
+ if($ct_result->errno != 0)
239
+ {
240
+ if($params['checkjs']!=1)
241
+ {
242
+ $ct_result->allow = 0;
243
+ $ct_result->spam = 1;
244
+ $ct_result->comment=__( 'Forbidden. Please, enable Javascript.', 'cleantalk' );
245
+ }
246
+ else
247
+ {
248
+ $ct_result->allow = 1;
249
+ $ct_result->comment=__( 'Allow', 'cleantalk' );
250
+ }
251
+ }
252
 
253
  // Restart submit form counter for failed requests
254
  if ($ct_result->allow == 0) {
255
+ @header("CtBaseCall: result not allow");
256
  $_SESSION[$ct_formtime_label] = time();
257
  if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
258
  {
261
  }
262
  else
263
  {
264
+ @header("CtBaseCall: result allow");
265
  if(!isset($ct_result->errno)||isset($ct_result->errno)&&$ct_result->errno!=0)
266
  {
267
  ct_add_event('yes');
268
  }
269
+ /*if($is_logged_in)
270
  {
271
  $user_cnt++;
272
  update_user_meta( $user_id, 'cleantalk_messages_number', $user_cnt);
273
+ }*/
274
  }
275
+ @header("CtBaseCall: return");
276
  return array('ct' => $ct, 'ct_result' => $ct_result);
277
  }
278
 
809
  return $array;
810
  }
811
  }
812
+ ?>
inc/cleantalk-public.php CHANGED
@@ -63,6 +63,10 @@ function ct_init() {
63
  {
64
  add_action('CMA_custom_post_type_nav','ct_contact_form_validate_postdata',1);
65
  add_action('template_redirect','ct_contact_form_validate',1);
 
 
 
 
66
  /*if(isset($_GET['ait-action'])&&$_GET['ait-action']=='register')
67
  {
68
  $tmp=$_POST['redirect_to'];
@@ -1695,7 +1699,7 @@ function ct_contact_form_validate () {
1695
  }
1696
  @header("CtExclusions: ".$ct_cnt);
1697
 
1698
- if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1699
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1700
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
1701
  strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false ||
@@ -1717,6 +1721,7 @@ function ct_contact_form_validate () {
1717
  @header("CtConditions: Passed");
1718
 
1719
  $_POST=ct_filter_array($_POST);
 
1720
 
1721
  $checkjs = js_test('ct_checkjs', $_COOKIE, true);
1722
 
@@ -1733,6 +1738,17 @@ function ct_contact_form_validate () {
1733
  $contact_form = true;
1734
 
1735
  @ct_get_fields_any($sender_email, $message, $sender_nickname, $subject, $contact_form, $_POST);
 
 
 
 
 
 
 
 
 
 
 
1736
 
1737
 
1738
  // Skip submission if no data found
@@ -1746,6 +1762,8 @@ function ct_contact_form_validate () {
1746
  $tmp=$_POST['TellAFriend_Link'];
1747
  unset($_POST['TellAFriend_Link']);
1748
  }
 
 
1749
 
1750
  $ct_base_call_result = ct_base_call(array(
1751
  'message' => $subject . "\n\n" . $message,
@@ -1756,6 +1774,7 @@ function ct_contact_form_validate () {
1756
  'sender_info' => get_sender_info(),
1757
  'checkjs' => $checkjs
1758
  ));
 
1759
 
1760
  if(isset($_POST['TellAFriend_Link']))
1761
  {
@@ -1766,8 +1785,10 @@ function ct_contact_form_validate () {
1766
  $ct_result = $ct_base_call_result['ct_result'];
1767
 
1768
  if ($ct_result->allow == 0) {
 
1769
 
1770
  if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
 
1771
  global $ct_comment;
1772
  $ct_comment = $ct_result->comment;
1773
  if(isset($_POST['cma-action'])&&$_POST['cma-action']=='add')
@@ -1787,10 +1808,12 @@ function ct_contact_form_validate () {
1787
  ct_die(null, null);
1788
  }
1789
  } else {
 
1790
  echo $ct_result->comment;
1791
  }
1792
  exit;
1793
  }
 
1794
 
1795
  return null;
1796
  }
63
  {
64
  add_action('CMA_custom_post_type_nav','ct_contact_form_validate_postdata',1);
65
  add_action('template_redirect','ct_contact_form_validate',1);
66
+ if(isset($_POST['reg_redirect_link'])&&isset($_POST['tmpl_registration_nonce_field']))
67
+ {
68
+ ct_contact_form_validate();
69
+ }
70
  /*if(isset($_GET['ait-action'])&&$_GET['ait-action']=='register')
71
  {
72
  $tmp=$_POST['redirect_to'];
1699
  }
1700
  @header("CtExclusions: ".$ct_cnt);
1701
 
1702
+ if (@sizeof($_POST)>0 ||
1703
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1704
  (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
1705
  strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false ||
1721
  @header("CtConditions: Passed");
1722
 
1723
  $_POST=ct_filter_array($_POST);
1724
+ @header("CtFilterArray: Passed");
1725
 
1726
  $checkjs = js_test('ct_checkjs', $_COOKIE, true);
1727
 
1738
  $contact_form = true;
1739
 
1740
  @ct_get_fields_any($sender_email, $message, $sender_nickname, $subject, $contact_form, $_POST);
1741
+ @header("CtGetFieldsAny: Passed");
1742
+ @header("CtSenderEmail: $sender_email");
1743
+ if($contact_form)
1744
+ {
1745
+ @header("CtContactForm: true");
1746
+ }
1747
+ else
1748
+ {
1749
+ @header("CtContactForm: false");
1750
+ }
1751
+
1752
 
1753
 
1754
  // Skip submission if no data found
1762
  $tmp=$_POST['TellAFriend_Link'];
1763
  unset($_POST['TellAFriend_Link']);
1764
  }
1765
+
1766
+ @header("CtBaseCallBefore: 1");
1767
 
1768
  $ct_base_call_result = ct_base_call(array(
1769
  'message' => $subject . "\n\n" . $message,
1774
  'sender_info' => get_sender_info(),
1775
  'checkjs' => $checkjs
1776
  ));
1777
+ @header("CtBaseCall: Executed");
1778
 
1779
  if(isset($_POST['TellAFriend_Link']))
1780
  {
1785
  $ct_result = $ct_base_call_result['ct_result'];
1786
 
1787
  if ($ct_result->allow == 0) {
1788
+ @header("CtResult: Not Allow");
1789
 
1790
  if (!(defined( 'DOING_AJAX' ) && DOING_AJAX)) {
1791
+ @header("AJAX: No");
1792
  global $ct_comment;
1793
  $ct_comment = $ct_result->comment;
1794
  if(isset($_POST['cma-action'])&&$_POST['cma-action']=='add')
1808
  ct_die(null, null);
1809
  }
1810
  } else {
1811
+ @header("AJAX: Yes");
1812
  echo $ct_result->comment;
1813
  }
1814
  exit;
1815
  }
1816
+ @header("CtResult: Allow");
1817
 
1818
  return null;
1819
  }
inc/cleantalk.class.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Cleantalk base class
4
  *
5
- * @version 2.1.0
6
  * @package Cleantalk
7
  * @subpackage Base
8
  * @author Cleantalk team (welcome@cleantalk.org)
@@ -295,6 +295,9 @@ class CleantalkRequest {
295
  * @var int
296
  */
297
  public $submit_time = null;
 
 
 
298
 
299
  /**
300
  * Is enable Java Script,
@@ -373,7 +376,7 @@ class Cleantalk {
373
  * Server connection timeout in seconds
374
  * @var int
375
  */
376
- private $server_timeout = 3;
377
 
378
  /**
379
  * Cleantalk server url
@@ -715,11 +718,15 @@ class Cleantalk {
715
  if(method_exists($request,'server'))
716
  {
717
  $si['remote_addr']=$request->server('REMOTE_ADDR');
 
 
718
  }
719
  }
720
  else
721
  {
722
  $si['remote_addr']=$_SERVER['REMOTE_ADDR'];
 
 
723
  }
724
  $msg->sender_info=json_encode($si);
725
  if (((isset($this->work_url) && $this->work_url !== '') && ($this->server_changed + $this->server_ttl > time()))
2
  /**
3
  * Cleantalk base class
4
  *
5
+ * @version 2.1.1
6
  * @package Cleantalk
7
  * @subpackage Base
8
  * @author Cleantalk team (welcome@cleantalk.org)
295
  * @var int
296
  */
297
  public $submit_time = null;
298
+
299
+ public $x_forwarded_for = '';
300
+ public $x_real_ip = '';
301
 
302
  /**
303
  * Is enable Java Script,
376
  * Server connection timeout in seconds
377
  * @var int
378
  */
379
+ private $server_timeout = 6;
380
 
381
  /**
382
  * Cleantalk server url
718
  if(method_exists($request,'server'))
719
  {
720
  $si['remote_addr']=$request->server('REMOTE_ADDR');
721
+ $msg->x_forwarded_for=$request->server('X_FORWARDED_FOR');
722
+ $msg->x_real_ip=$request->server('X_REAL_IP');
723
  }
724
  }
725
  else
726
  {
727
  $si['remote_addr']=$_SERVER['REMOTE_ADDR'];
728
+ $msg->x_forwarded_for=@$_SERVER['X_FORWARDED_FOR'];
729
+ $msg->x_real_ip=@$_SERVER['X_REAL_IP'];
730
  }
731
  $msg->sender_info=json_encode($si);
732
  if (((isset($this->work_url) && $this->work_url !== '') && ($this->server_changed + $this->server_ttl > time()))
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Anti-Spam by CleanTalk - No Captcha, no comments & registrations spam ===
2
  Contributors: znaeff, shagimuratov, vlad-cleantalk
3
- Tags: anti-spam, antispam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spam, spammers, spammy, woocommerce, wordpress spam, booking, order, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, akismet, plugin, contact, recaptcha, google captcha, math, security, login, blacklist, cache, prevent, wordpress, User Frontend, bulk delete, bulk remove, cloudflare, widget, review, auth forms, firewall, ddos, flood
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.27
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -36,7 +36,10 @@ Filers spam bots on registrations forms WordPress, BuddyPress, bbPress, S2Member
36
  Plugin is tested and ready to protect against spam emails via Formidable forms, Contact form 7, JetPack Contact form, Fast Secure Contact form, Ninja forms, Landing pages, Gravity forms and any themes/custom contact forms.
37
 
38
  = WooCommerce spam filter =
39
- Anti-spam by CleanTalk filters spam bots registrations and spam reviews for WooCommerce. Plugin is fully compatible with WooCommerce 2.1 and upper.
 
 
 
40
 
41
  = Spam filter for themes contact forms =
42
  Plugin blocks spam emails via any themes (built-in) contact forms. With AJAX forms plugin silent (without any error notices on WordPress frontend) filters spam emails.
@@ -78,6 +81,9 @@ All the CleanTalk Spam FireWall activity is being logged in the process of filte
78
  = Spam FireWall DDos Protection =
79
  Spam FireWall can mitigate HTTP/HTTPS DDoS attacks. When an intruder makes GET requests to attack your website. Spam FireWall blocks all requests from bad IP addresses. Your website givies infringer a special page with description of DDoS rejection instead of the website pages. Therefore Spam FireWall can help to reduce of CPU usage on your server.
80
 
 
 
 
81
  = No spam comments, no spam registrations, no spam contact emails, no spam trackbacks. CAPTCHA less anti-spam for WordPress =
82
  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.
83
 
@@ -338,6 +344,12 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
338
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
339
 
340
  == Changelog ==
 
 
 
 
 
 
341
  = 5.27 2015-10-13 =
342
  * Improvements in Spam FireWall feature
343
  * Code optimization
@@ -810,6 +822,12 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
810
  * First version
811
 
812
  == Upgrade Notice ==
 
 
 
 
 
 
813
  = 5.27 2015-10-13 =
814
  * Improvements in Spam FireWall feature
815
  * Code optimization
1
  === Anti-Spam by CleanTalk - No Captcha, no comments & registrations spam ===
2
  Contributors: znaeff, shagimuratov, vlad-cleantalk
3
+ Tags: anti-spam, antispam, bbpress, buddypress, captcha, capcha, captha, catcha, cf7 spam, comments, contact form spam, signup, spam, spammers, spammy, woocommerce, wordpress spam, booking, order, subscription, gravity spam, jetpack, bots, contact form 7, contact form, registrations, ninja, Fast Secure Contact, Gravity forms, formidable, mailchimp, s2member, protection, protect, email, akismet, plugin, contact, recaptcha, google captcha, math, security, login, blacklist, cache, prevent, wordpress, User Frontend, bulk delete, bulk remove, cloudflare, widget, review, auth forms, firewall, ddos, flood, cleantalk, mailpoet
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.28
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
36
  Plugin is tested and ready to protect against spam emails via Formidable forms, Contact form 7, JetPack Contact form, Fast Secure Contact form, Ninja forms, Landing pages, Gravity forms and any themes/custom contact forms.
37
 
38
  = WooCommerce spam filter =
39
+ Anti-spam by CleanTalk filters spam registrations and spam reviews for WooCommerce. Plugin is fully compatible with WooCommerce 2.1 and upper.
40
+
41
+ = Newsletters filter =
42
+ Anti-spam by CleanTalk filters spam subsciptions for MailPoet and many other newsletters plugins.
43
 
44
  = Spam filter for themes contact forms =
45
  Plugin blocks spam emails via any themes (built-in) contact forms. With AJAX forms plugin silent (without any error notices on WordPress frontend) filters spam emails.
81
  = Spam FireWall DDos Protection =
82
  Spam FireWall can mitigate HTTP/HTTPS DDoS attacks. When an intruder makes GET requests to attack your website. Spam FireWall blocks all requests from bad IP addresses. Your website givies infringer a special page with description of DDoS rejection instead of the website pages. Therefore Spam FireWall can help to reduce of CPU usage on your server.
83
 
84
+ = XML-RPC brute force protection =
85
+ Spam FireWall can mitigate XML-RPS brute force attacks. It blocks XML-RPS attacks from bad IP addresses. That helps to prevent bruteforce attacks by a Remote Procedure Call.
86
+
87
  = No spam comments, no spam registrations, no spam contact emails, no spam trackbacks. CAPTCHA less anti-spam for WordPress =
88
  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.
89
 
344
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
345
 
346
  == Changelog ==
347
+ = 5.28 2015-10-16 =
348
+ * Fixed errors in anti-spam checking
349
+ * Restored options for spam checking registrations and cpmmon contact forms
350
+ * Improved antispam defence
351
+ * Fixed problems with AJAX functionality in MailPoet, WooCommerce and other AJAX plugins
352
+
353
  = 5.27 2015-10-13 =
354
  * Improvements in Spam FireWall feature
355
  * Code optimization
822
  * First version
823
 
824
  == Upgrade Notice ==
825
+ = 5.28 2015-10-16 =
826
+ * Fixed errors in anti-spam checking
827
+ * Restored options for spam checking registrations and cpmmon contact forms
828
+ * Improved antispam defence
829
+ * Fixed problems with AJAX functionality in MailPoet, WooCommerce and other AJAX plugins
830
+
831
  = 5.27 2015-10-13 =
832
  * Improvements in Spam FireWall feature
833
  * Code optimization
screenshot-1.png CHANGED
Binary file