Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.21

Version Description

2015-08-21 = * Fixed bug with skipping spam submissions * Fixed bug with receiving old user_token for viewing anti-spam statistics * Small backend fixes

Download this release

Release Info

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

Code changes from version 5.20 to 5.21

cleantalk-admin.php CHANGED
@@ -7,7 +7,7 @@ $ct_data=ct_get_data();
7
  if(isset($_GET['close_notice']))
8
  {
9
  global $ct_data, $pagenow;
10
- //$ct_data=ct_get_data();
11
  $ct_data['next_notice_show']=time()+86400;
12
  update_option('cleantalk_data', $ct_data);
13
  $_SERVER["QUERY_STRING"]=str_replace("close_notice=1","",$_SERVER["QUERY_STRING"]);
@@ -42,7 +42,7 @@ function ct_ajax_get_timezone()
42
  {
43
  global $ct_data;
44
  check_ajax_referer( 'ct_secret_nonce', 'security' );
45
- //$ct_data = ct_get_data();
46
  if(isset($_POST['offset']))
47
  {
48
  $ct_data['timezone'] = intval($_POST['offset']);
@@ -75,8 +75,8 @@ function ct_admin_add_page() {
75
  function ct_admin_init() {
76
  global $ct_server_timeout, $show_ct_notice_autokey, $ct_notice_autokey_label, $ct_notice_autokey_value, $show_ct_notice_renew, $ct_notice_renew_label, $show_ct_notice_trial, $ct_notice_trial_label, $show_ct_notice_online, $ct_notice_online_label, $renew_notice_showtime, $trial_notice_showtime, $ct_plugin_name, $ct_options, $ct_data, $trial_notice_check_timeout, $account_notice_check_timeout, $ct_user_token_label, $cleantalk_plugin_version, $notice_check_timeout;
77
 
78
- //$ct_options = ct_get_options();
79
- //$ct_data = ct_get_data();
80
 
81
  $current_version=@trim($ct_data['current_version']);
82
  if($current_version!=$cleantalk_plugin_version)
@@ -84,9 +84,9 @@ function ct_admin_init() {
84
  $ct_data['current_version']=$cleantalk_plugin_version;
85
  update_option('cleantalk_data', $ct_data);
86
  $ct_base_call_result = ct_base_call(array(
87
- 'message' => 'CleanTalk connection test',
88
  'example' => null,
89
- 'sender_email' => 'stop_email@example.com',
90
  'sender_nickname' => 'CleanTalk',
91
  'post_info' => '',
92
  'checkjs' => 1
@@ -95,9 +95,9 @@ function ct_admin_init() {
95
  if(isset($_POST['option_page'])&&$_POST['option_page']=='cleantalk_settings')
96
  {
97
  $ct_base_call_result = ct_base_call(array(
98
- 'message' => 'CleanTalk connection test',
99
  'example' => null,
100
- 'sender_email' => 'stop_email@example.com',
101
  'sender_nickname' => 'CleanTalk',
102
  'post_info' => '',
103
  'checkjs' => 1
@@ -132,14 +132,17 @@ function ct_admin_init() {
132
 
133
  $result = getAutoKey($email, $website, $platform);
134
 
135
- if ($result) {
 
 
 
136
  $result = json_decode($result, true);
137
- if (isset($result['data']) && is_array($result['data'])) {
 
138
  $result = $result['data'];
139
- }
140
  if(isset($result['user_token']))
141
  {
142
-
143
  $ct_data['user_token'] = $result['user_token'];
144
  update_option('cleantalk_data', $ct_data);
145
  }
@@ -149,9 +152,9 @@ function ct_admin_init() {
149
  $ct_options['apikey']=$result['auth_key'];
150
  update_option('cleantalk_settings', $ct_options);
151
  $ct_base_call_result = ct_base_call(array(
152
- 'message' => 'CleanTalk connection test',
153
  'example' => null,
154
- 'sender_email' => 'stop_email@example.com',
155
  'sender_nickname' => 'CleanTalk',
156
  'post_info' => '',
157
  'checkjs' => 1
@@ -305,6 +308,9 @@ add_action( 'admin_bar_menu', 'ct_add_admin_menu', 999 );
305
  function ct_add_admin_menu( $wp_admin_bar ) {
306
  // add a parent item
307
  global $ct_options, $ct_data;
 
 
 
308
 
309
  if(isset($ct_options['show_adminbar']))
310
  {
@@ -348,7 +354,8 @@ function ct_add_admin_menu( $wp_admin_bar ) {
348
  function ct_section_settings_state() {
349
  global $ct_options, $ct_data;
350
 
351
- //print_r($ct_options);
 
352
 
353
  $img="yes.png";
354
  $img_no="no.png";
@@ -444,7 +451,7 @@ function ct_input_apikey() {
444
  }
445
  } else {
446
  if (isset($_COOKIE[$ct_notice_online_label]) && $_COOKIE[$ct_notice_online_label] > 0) {
447
- echo '&nbsp;&nbsp;<span style="text-decoration: underline;">The key accepted!</span>&nbsp;';
448
  }
449
  echo "<br /><br /><a target='__blank' href='https://cleantalk.org/my?user_token=".@$ct_data['user_token']."'>".__('Click here to get anti-spam statistics', 'cleantalk')."</a>";
450
  }
@@ -456,6 +463,9 @@ function ct_input_apikey() {
456
  function ct_input_comments_test() {
457
  global $ct_options, $ct_data;
458
 
 
 
 
459
  $value = $ct_options['comments_test'];
460
  echo "<input type='radio' id='cleantalk_comments_test1' name='cleantalk_settings[comments_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_comments_test1'> " . __('Yes') . "</label>";
461
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@@ -469,6 +479,9 @@ function ct_input_comments_test() {
469
  function ct_input_registrations_test() {
470
  global $ct_options, $ct_data;
471
 
 
 
 
472
  $value = $ct_options['registrations_test'];
473
  echo "<input type='radio' id='cleantalk_registrations_test1' name='cleantalk_settings[registrations_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_registrations_test1'> " . __('Yes') . "</label>";
474
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@@ -482,6 +495,9 @@ function ct_input_registrations_test() {
482
  function ct_input_contact_forms_test() {
483
  global $ct_options, $ct_data;
484
 
 
 
 
485
  $value = $ct_options['contact_forms_test'];
486
  echo "<input type='radio' id='cleantalk_contact_forms_test1' name='cleantalk_settings[contact_forms_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_contact_forms_test1'> " . __('Yes') . "</label>";
487
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@@ -495,6 +511,9 @@ function ct_input_contact_forms_test() {
495
  function ct_input_general_contact_forms_test() {
496
  global $ct_options, $ct_data;
497
 
 
 
 
498
  $value = $ct_options['general_contact_forms_test'];
499
  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>";
500
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@@ -510,6 +529,9 @@ function ct_input_general_contact_forms_test() {
510
  */
511
  function ct_input_remove_old_spam() {
512
  global $ct_options, $ct_data;
 
 
 
513
 
514
  $value = $ct_options['remove_old_spam'];
515
  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>";
@@ -525,6 +547,9 @@ function ct_input_remove_old_spam() {
525
  */
526
  function ct_input_show_adminbar() {
527
  global $ct_options, $ct_data;
 
 
 
528
 
529
  if(isset($ct_options['show_adminbar']))
530
  {
@@ -547,6 +572,9 @@ function ct_input_show_adminbar() {
547
  */
548
  function ct_input_general_postdata_test() {
549
  global $ct_options, $ct_data;
 
 
 
550
 
551
  if(isset($ct_options['general_postdata_test']))
552
  {
@@ -564,6 +592,9 @@ function ct_input_general_postdata_test() {
564
 
565
  function ct_input_use_ajax() {
566
  global $ct_options, $ct_data;
 
 
 
567
 
568
  if(isset($ct_options['use_ajax']))
569
  {
@@ -581,6 +612,9 @@ function ct_input_use_ajax() {
581
 
582
  function ct_input_check_external() {
583
  global $ct_options, $ct_data;
 
 
 
584
 
585
  if(isset($ct_options['check_external']))
586
  {
@@ -649,7 +683,8 @@ input[type=submit] {padding: 10px; background: #3399FF; color: #fff; border:0 no
649
  function admin_notice_message(){
650
  global $show_ct_notice_trial, $show_ct_notice_renew, $show_ct_notice_online, $show_ct_notice_autokey, $ct_notice_autokey_value, $ct_plugin_name, $ct_options, $ct_data;
651
 
652
- //$ct_data=ct_get_data();
 
653
 
654
  $user_token = '';
655
  if (isset($ct_data['user_token']) && $ct_data['user_token'] != '') {
@@ -740,6 +775,10 @@ function admin_addDescriptionsFields($descr = '') {
740
  */
741
  function ct_valid_key($apikey = null) {
742
  global $ct_options, $ct_data;
 
 
 
 
743
  if ($apikey === null) {
744
  $apikey = $ct_options['apikey'];
745
  }
@@ -876,6 +915,9 @@ if (!function_exists ( 'ct_plugin_action_links')) {
876
  */
877
  function ct_update_option($option_name) {
878
  global $show_ct_notice_online, $ct_notice_online_label, $ct_notice_trial_label, $trial_notice_showtime, $ct_options, $ct_data, $ct_server_timeout;
 
 
 
879
 
880
  if($option_name !== 'cleantalk_settings') {
881
  return;
@@ -891,9 +933,9 @@ function ct_update_option($option_name) {
891
  }
892
 
893
  $ct_base_call_result = ct_base_call(array(
894
- 'message' => 'CleanTalk connection test',
895
  'example' => null,
896
- 'sender_email' => 'stop_email@example.com',
897
  'sender_nickname' => 'CleanTalk',
898
  'post_info' => '',
899
  'checkjs' => 1
7
  if(isset($_GET['close_notice']))
8
  {
9
  global $ct_data, $pagenow;
10
+ $ct_data=ct_get_data();
11
  $ct_data['next_notice_show']=time()+86400;
12
  update_option('cleantalk_data', $ct_data);
13
  $_SERVER["QUERY_STRING"]=str_replace("close_notice=1","",$_SERVER["QUERY_STRING"]);
42
  {
43
  global $ct_data;
44
  check_ajax_referer( 'ct_secret_nonce', 'security' );
45
+ $ct_data = ct_get_data();
46
  if(isset($_POST['offset']))
47
  {
48
  $ct_data['timezone'] = intval($_POST['offset']);
75
  function ct_admin_init() {
76
  global $ct_server_timeout, $show_ct_notice_autokey, $ct_notice_autokey_label, $ct_notice_autokey_value, $show_ct_notice_renew, $ct_notice_renew_label, $show_ct_notice_trial, $ct_notice_trial_label, $show_ct_notice_online, $ct_notice_online_label, $renew_notice_showtime, $trial_notice_showtime, $ct_plugin_name, $ct_options, $ct_data, $trial_notice_check_timeout, $account_notice_check_timeout, $ct_user_token_label, $cleantalk_plugin_version, $notice_check_timeout;
77
 
78
+ $ct_options = ct_get_options();
79
+ $ct_data = ct_get_data();
80
 
81
  $current_version=@trim($ct_data['current_version']);
82
  if($current_version!=$cleantalk_plugin_version)
84
  $ct_data['current_version']=$cleantalk_plugin_version;
85
  update_option('cleantalk_data', $ct_data);
86
  $ct_base_call_result = ct_base_call(array(
87
+ 'message' => 'CleanTalk setup test',
88
  'example' => null,
89
+ 'sender_email' => 'good@cleantalk.org',
90
  'sender_nickname' => 'CleanTalk',
91
  'post_info' => '',
92
  'checkjs' => 1
95
  if(isset($_POST['option_page'])&&$_POST['option_page']=='cleantalk_settings')
96
  {
97
  $ct_base_call_result = ct_base_call(array(
98
+ 'message' => 'CleanTalk setup test',
99
  'example' => null,
100
+ 'sender_email' => 'good@cleantalk.org',
101
  'sender_nickname' => 'CleanTalk',
102
  'post_info' => '',
103
  'checkjs' => 1
132
 
133
  $result = getAutoKey($email, $website, $platform);
134
 
135
+ if ($result)
136
+ {
137
+ $ct_data['next_account_status_check']=0;
138
+ update_option('cleantalk_data', $ct_data);
139
  $result = json_decode($result, true);
140
+ if (isset($result['data']) && is_array($result['data']))
141
+ {
142
  $result = $result['data'];
143
+ }
144
  if(isset($result['user_token']))
145
  {
 
146
  $ct_data['user_token'] = $result['user_token'];
147
  update_option('cleantalk_data', $ct_data);
148
  }
152
  $ct_options['apikey']=$result['auth_key'];
153
  update_option('cleantalk_settings', $ct_options);
154
  $ct_base_call_result = ct_base_call(array(
155
+ 'message' => 'CleanTalk setup test',
156
  'example' => null,
157
+ 'sender_email' => 'good@cleantalk.org',
158
  'sender_nickname' => 'CleanTalk',
159
  'post_info' => '',
160
  'checkjs' => 1
308
  function ct_add_admin_menu( $wp_admin_bar ) {
309
  // add a parent item
310
  global $ct_options, $ct_data;
311
+
312
+ $ct_options = ct_get_options();
313
+ $ct_data = ct_get_data();
314
 
315
  if(isset($ct_options['show_adminbar']))
316
  {
354
  function ct_section_settings_state() {
355
  global $ct_options, $ct_data;
356
 
357
+ $ct_options = ct_get_options();
358
+ $ct_data = ct_get_data();
359
 
360
  $img="yes.png";
361
  $img_no="no.png";
451
  }
452
  } else {
453
  if (isset($_COOKIE[$ct_notice_online_label]) && $_COOKIE[$ct_notice_online_label] > 0) {
454
+ //echo '&nbsp;&nbsp;<span style="text-decoration: underline;">The key accepted!</span>&nbsp;';
455
  }
456
  echo "<br /><br /><a target='__blank' href='https://cleantalk.org/my?user_token=".@$ct_data['user_token']."'>".__('Click here to get anti-spam statistics', 'cleantalk')."</a>";
457
  }
463
  function ct_input_comments_test() {
464
  global $ct_options, $ct_data;
465
 
466
+ $ct_options = ct_get_options();
467
+ $ct_data = ct_get_data();
468
+
469
  $value = $ct_options['comments_test'];
470
  echo "<input type='radio' id='cleantalk_comments_test1' name='cleantalk_settings[comments_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_comments_test1'> " . __('Yes') . "</label>";
471
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
479
  function ct_input_registrations_test() {
480
  global $ct_options, $ct_data;
481
 
482
+ $ct_options = ct_get_options();
483
+ $ct_data = ct_get_data();
484
+
485
  $value = $ct_options['registrations_test'];
486
  echo "<input type='radio' id='cleantalk_registrations_test1' name='cleantalk_settings[registrations_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_registrations_test1'> " . __('Yes') . "</label>";
487
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
495
  function ct_input_contact_forms_test() {
496
  global $ct_options, $ct_data;
497
 
498
+ $ct_options = ct_get_options();
499
+ $ct_data = ct_get_data();
500
+
501
  $value = $ct_options['contact_forms_test'];
502
  echo "<input type='radio' id='cleantalk_contact_forms_test1' name='cleantalk_settings[contact_forms_test]' value='1' " . ($value == '1' ? 'checked' : '') . " /><label for='cleantalk_contact_forms_test1'> " . __('Yes') . "</label>";
503
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
511
  function ct_input_general_contact_forms_test() {
512
  global $ct_options, $ct_data;
513
 
514
+ $ct_options = ct_get_options();
515
+ $ct_data = ct_get_data();
516
+
517
  $value = $ct_options['general_contact_forms_test'];
518
  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>";
519
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
529
  */
530
  function ct_input_remove_old_spam() {
531
  global $ct_options, $ct_data;
532
+
533
+ $ct_options = ct_get_options();
534
+ $ct_data = ct_get_data();
535
 
536
  $value = $ct_options['remove_old_spam'];
537
  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>";
547
  */
548
  function ct_input_show_adminbar() {
549
  global $ct_options, $ct_data;
550
+
551
+ $ct_options = ct_get_options();
552
+ $ct_data = ct_get_data();
553
 
554
  if(isset($ct_options['show_adminbar']))
555
  {
572
  */
573
  function ct_input_general_postdata_test() {
574
  global $ct_options, $ct_data;
575
+
576
+ $ct_options = ct_get_options();
577
+ $ct_data = ct_get_data();
578
 
579
  if(isset($ct_options['general_postdata_test']))
580
  {
592
 
593
  function ct_input_use_ajax() {
594
  global $ct_options, $ct_data;
595
+
596
+ $ct_options = ct_get_options();
597
+ $ct_data = ct_get_data();
598
 
599
  if(isset($ct_options['use_ajax']))
600
  {
612
 
613
  function ct_input_check_external() {
614
  global $ct_options, $ct_data;
615
+
616
+ $ct_options = ct_get_options();
617
+ $ct_data = ct_get_data();
618
 
619
  if(isset($ct_options['check_external']))
620
  {
683
  function admin_notice_message(){
684
  global $show_ct_notice_trial, $show_ct_notice_renew, $show_ct_notice_online, $show_ct_notice_autokey, $ct_notice_autokey_value, $ct_plugin_name, $ct_options, $ct_data;
685
 
686
+ $ct_options = ct_get_options();
687
+ $ct_data = ct_get_data();
688
 
689
  $user_token = '';
690
  if (isset($ct_data['user_token']) && $ct_data['user_token'] != '') {
775
  */
776
  function ct_valid_key($apikey = null) {
777
  global $ct_options, $ct_data;
778
+
779
+ $ct_options = ct_get_options();
780
+ $ct_data = ct_get_data();
781
+
782
  if ($apikey === null) {
783
  $apikey = $ct_options['apikey'];
784
  }
915
  */
916
  function ct_update_option($option_name) {
917
  global $show_ct_notice_online, $ct_notice_online_label, $ct_notice_trial_label, $trial_notice_showtime, $ct_options, $ct_data, $ct_server_timeout;
918
+
919
+ $ct_options = ct_get_options();
920
+ $ct_data = ct_get_data();
921
 
922
  if($option_name !== 'cleantalk_settings') {
923
  return;
933
  }
934
 
935
  $ct_base_call_result = ct_base_call(array(
936
+ 'message' => 'CleanTalk setup test',
937
  'example' => null,
938
+ 'sender_email' => 'good@cleantalk.org',
939
  'sender_nickname' => 'CleanTalk',
940
  'post_info' => '',
941
  'checkjs' => 1
cleantalk-ajax.php CHANGED
@@ -82,7 +82,7 @@ function ct_get_stats()
82
  {
83
  check_ajax_referer( 'ct_secret_nonce', 'security' );
84
  global $ct_data;
85
- //$ct_data=ct_get_data();
86
 
87
  if(!isset($ct_data['array_accepted']))
88
  {
@@ -102,8 +102,8 @@ function ct_validate_email_ajaxlogin($email=null, $is_ajax=true)
102
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
103
  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;
104
 
105
- //$ct_options=ct_get_options();
106
- //$ct_data=ct_get_data();
107
 
108
  $email = is_null( $email ) ? $email : $_POST['email'];
109
  $email=sanitize_email($email);
@@ -197,8 +197,8 @@ function ct_user_register_ajaxlogin($user_id)
197
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
198
  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;
199
 
200
- //$ct_options=ct_get_options();
201
- //$ct_data=ct_get_data();
202
 
203
  if(class_exists('AjaxLogin')&&isset($_POST['action'])&&$_POST['action']=='register_submit')
204
  {
@@ -286,8 +286,8 @@ function ct_ajax_hook()
286
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
287
  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;
288
 
289
- //$ct_data=ct_get_data();
290
- //$ct_options=ct_get_options();
291
 
292
  $sender_email = null;
293
  $message = '';
82
  {
83
  check_ajax_referer( 'ct_secret_nonce', 'security' );
84
  global $ct_data;
85
+ $ct_data=ct_get_data();
86
 
87
  if(!isset($ct_data['array_accepted']))
88
  {
102
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
103
  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;
104
 
105
+ $ct_options = ct_get_options();
106
+ $ct_data = ct_get_data();
107
 
108
  $email = is_null( $email ) ? $email : $_POST['email'];
109
  $email=sanitize_email($email);
197
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
198
  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;
199
 
200
+ $ct_options = ct_get_options();
201
+ $ct_data = ct_get_data();
202
 
203
  if(class_exists('AjaxLogin')&&isset($_POST['action'])&&$_POST['action']=='register_submit')
204
  {
286
  require_once(CLEANTALK_PLUGIN_DIR . 'cleantalk-public.php');
287
  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;
288
 
289
+ $ct_options = ct_get_options();
290
+ $ct_data = ct_get_data();
291
 
292
  $sender_email = null;
293
  $message = '';
cleantalk-comments.php CHANGED
@@ -33,11 +33,29 @@ function ct_show_checkspam_page()
33
  'count'=>true
34
  );
35
  $cnt_unchecked=get_comments($args_unchecked);
 
 
 
 
 
 
 
 
 
 
 
36
  //if($cnt_unchecked>0)
37
  {
38
  ?>
39
  <button class="button" id="ct_check_spam_button"><?php _e("Find spam comments", 'cleantalk'); ?></button><br /><br />
40
- <div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all not spam comments against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam comments' to start.", 'cleantalk'); ?></div>
 
 
 
 
 
 
 
41
  <?php
42
  }
43
  ?>
@@ -233,7 +251,7 @@ function ct_ajax_check_comments()
233
  {
234
  check_ajax_referer( 'ct_secret_nonce', 'security' );
235
  global $ct_options;
236
- //$ct_options = ct_get_options();
237
 
238
  $args_unchecked = array(
239
  'meta_query' => array(
@@ -332,7 +350,7 @@ function ct_ajax_info_comments()
332
  'meta_query' => array(
333
  Array(
334
  'key' => 'ct_hash',
335
- 'value'=>'1',
336
  'compare' => 'EXISTS'
337
  )
338
  ),
@@ -342,7 +360,7 @@ function ct_ajax_info_comments()
342
  'meta_query' => array(
343
  Array(
344
  'key' => 'ct_checked',
345
- 'value'=>'1',
346
  'compare' => 'EXISTS'
347
  )
348
  ),
33
  'count'=>true
34
  );
35
  $cnt_unchecked=get_comments($args_unchecked);
36
+
37
+ $args_spam = array(
38
+ 'meta_query' => array(
39
+ Array(
40
+ 'key' => 'ct_marked_as_spam',
41
+ 'compare' => 'EXISTS'
42
+ )
43
+ ),
44
+ 'count'=>true
45
+ );
46
+ $cnt_spam=get_comments($args_spam);
47
  //if($cnt_unchecked>0)
48
  {
49
  ?>
50
  <button class="button" id="ct_check_spam_button"><?php _e("Find spam comments", 'cleantalk'); ?></button><br /><br />
51
+ <div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all not spam comments against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam comments' to start.", 'cleantalk'); ?>
52
+ <?php
53
+ if($cnt_spam>0)
54
+ {
55
+ print "<br />
56
+ There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.";
57
+ }
58
+ ?></div>
59
  <?php
60
  }
61
  ?>
251
  {
252
  check_ajax_referer( 'ct_secret_nonce', 'security' );
253
  global $ct_options;
254
+ $ct_options = ct_get_options();
255
 
256
  $args_unchecked = array(
257
  'meta_query' => array(
350
  'meta_query' => array(
351
  Array(
352
  'key' => 'ct_hash',
353
+ //'value'=>'1',
354
  'compare' => 'EXISTS'
355
  )
356
  ),
360
  'meta_query' => array(
361
  Array(
362
  'key' => 'ct_checked',
363
+ //'value'=>'1',
364
  'compare' => 'EXISTS'
365
  )
366
  ),
cleantalk-common.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- $ct_agent_version = 'wordpress-520';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
@@ -230,6 +230,9 @@ function submit_time_test() {
230
  */
231
  function get_sender_info() {
232
  global $ct_direct_post, $ct_options, $ct_data;
 
 
 
233
 
234
  $php_session = session_id() != '' ? 1 : 0;
235
 
@@ -308,7 +311,8 @@ function ct_cookies_test ($test = false) {
308
  */
309
  function ct_get_checkjs_value($random_key = false) {
310
  global $ct_options, $ct_data;
311
- //$ct_data=ct_get_data();
 
312
 
313
  if ($random_key) {
314
  $keys = $ct_data['js_keys'];
@@ -436,6 +440,9 @@ function ct_hash($new_hash = '') {
436
  */
437
  function ct_feedback($hash, $message = null, $allow) {
438
  global $ct_options, $ct_data;
 
 
 
439
 
440
  require_once('cleantalk.class.php');
441
 
@@ -473,6 +480,9 @@ function ct_feedback($hash, $message = null, $allow) {
473
  */
474
  function ct_send_feedback($feedback_request = null) {
475
  global $ct_options, $ct_data;
 
 
 
476
 
477
  if (empty($feedback_request) && isset($_SESSION['feedback_request']) && preg_match("/^[a-z0-9\;\:]+$/", $_SESSION['feedback_request'])) {
478
  $feedback_request = $_SESSION['feedback_request'];
@@ -515,6 +525,9 @@ function ct_send_feedback($feedback_request = null) {
515
  */
516
  function ct_do_this_hourly() {
517
  global $ct_options, $ct_data;
 
 
 
518
  // do something every hour
519
 
520
  if (!isset($ct_options))
@@ -534,6 +547,9 @@ function ct_do_this_hourly() {
534
  function delete_spam_comments() {
535
  global $pagenow, $ct_options, $ct_data;
536
 
 
 
 
537
  if ($ct_options['remove_old_spam'] == 1) {
538
  $last_comments = get_comments(array('status' => 'spam', 'number' => 1000, 'order' => 'ASC'));
539
  foreach ($last_comments as $c) {
@@ -658,4 +674,25 @@ function ct_check_array_keys($arr)
658
  return $ct_check_post_result;
659
  }
660
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
661
  ?>
1
  <?php
2
 
3
+ $ct_agent_version = 'wordpress-521';
4
  $ct_plugin_name = 'Anti-spam by CleanTalk';
5
  $ct_checkjs_frm = 'ct_checkjs_frm';
6
  $ct_checkjs_register_form = 'ct_checkjs_register_form';
230
  */
231
  function get_sender_info() {
232
  global $ct_direct_post, $ct_options, $ct_data;
233
+
234
+ $ct_options = ct_get_options();
235
+ $ct_data = ct_get_data();
236
 
237
  $php_session = session_id() != '' ? 1 : 0;
238
 
311
  */
312
  function ct_get_checkjs_value($random_key = false) {
313
  global $ct_options, $ct_data;
314
+ $ct_options = ct_get_options();
315
+ $ct_data = ct_get_data();
316
 
317
  if ($random_key) {
318
  $keys = $ct_data['js_keys'];
440
  */
441
  function ct_feedback($hash, $message = null, $allow) {
442
  global $ct_options, $ct_data;
443
+
444
+ $ct_options = ct_get_options();
445
+ $ct_data = ct_get_data();
446
 
447
  require_once('cleantalk.class.php');
448
 
480
  */
481
  function ct_send_feedback($feedback_request = null) {
482
  global $ct_options, $ct_data;
483
+
484
+ $ct_options = ct_get_options();
485
+ $ct_data = ct_get_data();
486
 
487
  if (empty($feedback_request) && isset($_SESSION['feedback_request']) && preg_match("/^[a-z0-9\;\:]+$/", $_SESSION['feedback_request'])) {
488
  $feedback_request = $_SESSION['feedback_request'];
525
  */
526
  function ct_do_this_hourly() {
527
  global $ct_options, $ct_data;
528
+
529
+ $ct_options = ct_get_options();
530
+ $ct_data = ct_get_data();
531
  // do something every hour
532
 
533
  if (!isset($ct_options))
547
  function delete_spam_comments() {
548
  global $pagenow, $ct_options, $ct_data;
549
 
550
+ $ct_options = ct_get_options();
551
+ $ct_data = ct_get_data();
552
+
553
  if ($ct_options['remove_old_spam'] == 1) {
554
  $last_comments = get_comments(array('status' => 'spam', 'number' => 1000, 'order' => 'ASC'));
555
  foreach ($last_comments as $c) {
674
  return $ct_check_post_result;
675
  }
676
 
677
+ function check_url_exclusions()
678
+ {
679
+ global $cleantalk_url_exclusions;
680
+ $result=false;
681
+ if(isset($cleantalk_url_exclusions) && sizeof($cleantalk_url_exclusions)>0)
682
+ {
683
+ foreach($cleantalk_url_exclusions as $key=>$value)
684
+ {
685
+ if(stripos($_SERVER['REQUEST_URI'], $value)!==false)
686
+ {
687
+ $result=true;
688
+ }
689
+ }
690
+ }
691
+ else
692
+ {
693
+ $result=false;
694
+ }
695
+ return $result;
696
+ }
697
+
698
  ?>
cleantalk-public.php CHANGED
@@ -39,8 +39,8 @@ function ct_init() {
39
 
40
  if($test_external_forms && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cleantalk_hidden_method']) && isset($_POST['cleantalk_hidden_action']))
41
  {
42
- $action=$_POST['cleantalk_hidden_action'];
43
- $method=$_POST['cleantalk_hidden_method'];
44
  unset($_POST['cleantalk_hidden_action']);
45
  unset($_POST['cleantalk_hidden_method']);
46
  ct_contact_form_validate();
@@ -210,6 +210,8 @@ function ct_ajaxurl() {
210
  */
211
  function ct_comment_form($post_id) {
212
  global $ct_options, $ct_data;
 
 
213
 
214
  if (ct_is_user_enable() === false) {
215
  return false;
@@ -242,8 +244,9 @@ function ct_footer_add_cookie() {
242
  * @param bool $random_key switch on generation random key for every page load
243
  */
244
  function ct_add_hidden_fields($random_key = false, $field_name = 'ct_checkjs', $return_string = false, $cookie_check = false) {
245
- global $ct_checkjs_def, $ct_plugin_name, $ct_options;
246
- //$ct_options=ct_get_options();
 
247
  if(isset($ct_options['use_ajax']))
248
  {
249
  $use_ajax = @intval($ct_options['use_ajax']);
@@ -354,6 +357,9 @@ function ct_frm_entries_footer_scripts($fields, $form) {
354
  */
355
  function ct_frm_validate_entry ($errors, $values) {
356
  global $wpdb, $current_user, $ct_agent_version, $ct_checkjs_frm, $ct_options, $ct_data;
 
 
 
357
 
358
  if ($ct_options['contact_forms_test'] == 0) {
359
  return false;
@@ -404,6 +410,9 @@ function ct_frm_validate_entry ($errors, $values) {
404
  */
405
  function ct_bbp_new_pre_content ($comment) {
406
  global $ct_options, $ct_data;
 
 
 
407
 
408
  if (ct_is_user_enable() === false || $ct_options['comments_test'] == 0 || is_user_logged_in()) {
409
  return $comment;
@@ -457,6 +466,9 @@ function ct_preprocess_comment($comment) {
457
  // this action is called by wp-comments-post.php
458
  // after processing WP makes redirect to post page with comment's form by GET request (see above)
459
  global $wpdb, $current_user, $comment_post_id, $ct_agent_version, $ct_comment_done, $ct_approved_request_id_label, $ct_jp_comments, $ct_options, $ct_data;
 
 
 
460
 
461
  if (ct_is_user_enable() === false || $ct_options['comments_test'] == 0 || $ct_comment_done) {
462
  return $comment;
@@ -634,7 +646,8 @@ function ct_die_extended($comment_body) {
634
  function js_test($field_name = 'ct_checkjs', $data = null, $random_key = false) {
635
  global $ct_options, $ct_data;
636
 
637
- //$ct_data=ct_get_data();
 
638
 
639
  $checkjs = null;
640
  $js_post_value = null;
@@ -786,6 +799,9 @@ function ct_plugin_active($plugin_name){
786
  */
787
  function ct_register_form() {
788
  global $ct_checkjs_register_form, $ct_options, $ct_data;
 
 
 
789
 
790
  if ($ct_options['registrations_test'] == 0) {
791
  return false;
@@ -802,6 +818,9 @@ function ct_register_form() {
802
  */
803
  function ct_login_message($message) {
804
  global $errors, $ct_session_register_ok_label, $ct_options, $ct_data;
 
 
 
805
 
806
  if ($ct_options['registrations_test'] != 0) {
807
  if( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) {
@@ -897,6 +916,9 @@ function ct_test_message($nickname, $email, $ip, $text){
897
  function ct_test_registration($nickname, $email, $ip){
898
  global $ct_checkjs_register_form, $ct_agent_version, $ct_options, $ct_data;
899
 
 
 
 
900
  $submit_time = submit_time_test();
901
 
902
  $sender_info = get_sender_info();
@@ -1114,6 +1136,9 @@ function ct_user_register($user_id) {
1114
  */
1115
  function ct_grunion_contact_form_field_html($r, $field_label) {
1116
  global $ct_checkjs_jpcf, $ct_jpcf_patched, $ct_jpcf_fields, $ct_options, $ct_data;
 
 
 
1117
 
1118
  if ($ct_options['contact_forms_test'] == 1 && $ct_jpcf_patched === false && preg_match("/[text|email]/i", $r)) {
1119
 
@@ -1137,6 +1162,9 @@ function ct_grunion_contact_form_field_html($r, $field_label) {
1137
  */
1138
  function ct_contact_form_is_spam($form) {
1139
  global $ct_checkjs_jpcf, $ct_options, $ct_data;
 
 
 
1140
 
1141
  if ($ct_options['contact_forms_test'] == 0) {
1142
  return null;
@@ -1195,6 +1223,9 @@ function ct_contact_form_is_spam($form) {
1195
 
1196
  function ct_contact_form_is_spam_jetpack($is_spam,$form) {
1197
  global $ct_checkjs_jpcf, $ct_options, $ct_data;
 
 
 
1198
 
1199
  if ($ct_options['contact_forms_test'] == 0) {
1200
  return null;
@@ -1258,6 +1289,9 @@ function ct_contact_form_is_spam_jetpack($is_spam,$form) {
1258
  */
1259
  function ct_wpcf7_form_elements($html) {
1260
  global $wpdb, $current_user, $ct_checkjs_cf7, $ct_options, $ct_data;
 
 
 
1261
 
1262
  if ($ct_options['contact_forms_test'] == 0) {
1263
  return $html;
@@ -1273,6 +1307,9 @@ function ct_wpcf7_form_elements($html) {
1273
  */
1274
  function ct_wpcf7_spam($param) {
1275
  global $wpdb, $current_user, $ct_agent_version, $ct_checkjs_cf7, $ct_cf7_comment, $ct_options, $ct_data;
 
 
 
1276
 
1277
  if (WPCF7_VERSION >= '3.0.0') {
1278
  if($param === true)
@@ -1376,6 +1413,9 @@ function ct_si_contact_display_after_fields($string = '', $style = '', $form_err
1376
  */
1377
  function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
1378
  global $ct_options, $ct_data;
 
 
 
1379
 
1380
  if (!empty($form_errors))
1381
  return $form_errors;
@@ -1452,6 +1492,9 @@ function ct_comment_text($comment_text) {
1452
  */
1453
  function ct_check_wplp(){
1454
  global $ct_wplp_result_label, $ct_options, $ct_data;
 
 
 
1455
  if (!isset($_COOKIE[$ct_wplp_result_label])) {
1456
  // First AJAX submit of WPLP form
1457
  if ($ct_options['contact_forms_test'] == 0)
@@ -1514,6 +1557,9 @@ function ct_check_wplp(){
1514
  function ct_s2member_registration_test() {
1515
  global $ct_agent_version, $ct_post_data_label, $ct_post_data_authnet_label, $ct_formtime_label, $ct_options, $ct_data;
1516
 
 
 
 
1517
  if ($ct_options['registrations_test'] == 0) {
1518
  return null;
1519
  }
@@ -1595,21 +1641,30 @@ function ct_s2member_registration_test() {
1595
  * General test for any contact form
1596
  */
1597
  function ct_contact_form_validate () {
1598
- global $pagenow,$cleantalk_executed;
1599
  if($cleantalk_executed)
1600
  {
1601
  return null;
1602
  }
 
 
 
 
 
 
 
 
 
1603
 
1604
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1605
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1606
- (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword'||
1607
  strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false ||
1608
  strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
1609
  strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false||
1610
  strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
1611
- @strpos($_SERVER['HTTP_REFERER'],'/wp-admin/')!==false
1612
- )
1613
  ) {
1614
  return null;
1615
  }
@@ -1695,7 +1750,7 @@ function ct_contact_form_validate () {
1695
  * General test for any post data
1696
  */
1697
  function ct_contact_form_validate_postdata () {
1698
- global $pagenow,$cleantalk_executed;
1699
  if($cleantalk_executed)
1700
  {
1701
  return null;
@@ -1704,6 +1759,15 @@ function ct_contact_form_validate_postdata () {
1704
  {
1705
  return null;
1706
  }
 
 
 
 
 
 
 
 
 
1707
 
1708
 
1709
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
@@ -1715,7 +1779,8 @@ function ct_contact_form_validate_postdata () {
1715
  strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
1716
  strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false ||
1717
  strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
1718
- @strpos($_SERVER['HTTP_REFERER'],'/wp-admin/')!==false
 
1719
  ) {
1720
  return null;
1721
  }
@@ -1854,4 +1919,4 @@ function ct_print_form($arr,$k)
1854
  }
1855
  }
1856
 
1857
- ?>
39
 
40
  if($test_external_forms && $_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cleantalk_hidden_method']) && isset($_POST['cleantalk_hidden_action']))
41
  {
42
+ $action=htmlspecialchars($_POST['cleantalk_hidden_action']);
43
+ $method=htmlspecialchars($_POST['cleantalk_hidden_method']);
44
  unset($_POST['cleantalk_hidden_action']);
45
  unset($_POST['cleantalk_hidden_method']);
46
  ct_contact_form_validate();
210
  */
211
  function ct_comment_form($post_id) {
212
  global $ct_options, $ct_data;
213
+ $ct_options = ct_get_options();
214
+ $ct_data = ct_get_data();
215
 
216
  if (ct_is_user_enable() === false) {
217
  return false;
244
  * @param bool $random_key switch on generation random key for every page load
245
  */
246
  function ct_add_hidden_fields($random_key = false, $field_name = 'ct_checkjs', $return_string = false, $cookie_check = false) {
247
+ global $ct_checkjs_def, $ct_plugin_name, $ct_options, $ct_data;
248
+ $ct_options = ct_get_options();
249
+ $ct_data = ct_get_data();
250
  if(isset($ct_options['use_ajax']))
251
  {
252
  $use_ajax = @intval($ct_options['use_ajax']);
357
  */
358
  function ct_frm_validate_entry ($errors, $values) {
359
  global $wpdb, $current_user, $ct_agent_version, $ct_checkjs_frm, $ct_options, $ct_data;
360
+
361
+ $ct_options = ct_get_options();
362
+ $ct_data = ct_get_data();
363
 
364
  if ($ct_options['contact_forms_test'] == 0) {
365
  return false;
410
  */
411
  function ct_bbp_new_pre_content ($comment) {
412
  global $ct_options, $ct_data;
413
+
414
+ $ct_options = ct_get_options();
415
+ $ct_data = ct_get_data();
416
 
417
  if (ct_is_user_enable() === false || $ct_options['comments_test'] == 0 || is_user_logged_in()) {
418
  return $comment;
466
  // this action is called by wp-comments-post.php
467
  // after processing WP makes redirect to post page with comment's form by GET request (see above)
468
  global $wpdb, $current_user, $comment_post_id, $ct_agent_version, $ct_comment_done, $ct_approved_request_id_label, $ct_jp_comments, $ct_options, $ct_data;
469
+
470
+ $ct_options = ct_get_options();
471
+ $ct_data = ct_get_data();
472
 
473
  if (ct_is_user_enable() === false || $ct_options['comments_test'] == 0 || $ct_comment_done) {
474
  return $comment;
646
  function js_test($field_name = 'ct_checkjs', $data = null, $random_key = false) {
647
  global $ct_options, $ct_data;
648
 
649
+ $ct_options = ct_get_options();
650
+ $ct_data = ct_get_data();
651
 
652
  $checkjs = null;
653
  $js_post_value = null;
799
  */
800
  function ct_register_form() {
801
  global $ct_checkjs_register_form, $ct_options, $ct_data;
802
+
803
+ $ct_options = ct_get_options();
804
+ $ct_data = ct_get_data();
805
 
806
  if ($ct_options['registrations_test'] == 0) {
807
  return false;
818
  */
819
  function ct_login_message($message) {
820
  global $errors, $ct_session_register_ok_label, $ct_options, $ct_data;
821
+
822
+ $ct_options = ct_get_options();
823
+ $ct_data = ct_get_data();
824
 
825
  if ($ct_options['registrations_test'] != 0) {
826
  if( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) {
916
  function ct_test_registration($nickname, $email, $ip){
917
  global $ct_checkjs_register_form, $ct_agent_version, $ct_options, $ct_data;
918
 
919
+ $ct_options = ct_get_options();
920
+ $ct_data = ct_get_data();
921
+
922
  $submit_time = submit_time_test();
923
 
924
  $sender_info = get_sender_info();
1136
  */
1137
  function ct_grunion_contact_form_field_html($r, $field_label) {
1138
  global $ct_checkjs_jpcf, $ct_jpcf_patched, $ct_jpcf_fields, $ct_options, $ct_data;
1139
+
1140
+ $ct_options = ct_get_options();
1141
+ $ct_data = ct_get_data();
1142
 
1143
  if ($ct_options['contact_forms_test'] == 1 && $ct_jpcf_patched === false && preg_match("/[text|email]/i", $r)) {
1144
 
1162
  */
1163
  function ct_contact_form_is_spam($form) {
1164
  global $ct_checkjs_jpcf, $ct_options, $ct_data;
1165
+
1166
+ $ct_options = ct_get_options();
1167
+ $ct_data = ct_get_data();
1168
 
1169
  if ($ct_options['contact_forms_test'] == 0) {
1170
  return null;
1223
 
1224
  function ct_contact_form_is_spam_jetpack($is_spam,$form) {
1225
  global $ct_checkjs_jpcf, $ct_options, $ct_data;
1226
+
1227
+ $ct_options = ct_get_options();
1228
+ $ct_data = ct_get_data();
1229
 
1230
  if ($ct_options['contact_forms_test'] == 0) {
1231
  return null;
1289
  */
1290
  function ct_wpcf7_form_elements($html) {
1291
  global $wpdb, $current_user, $ct_checkjs_cf7, $ct_options, $ct_data;
1292
+
1293
+ $ct_options = ct_get_options();
1294
+ $ct_data = ct_get_data();
1295
 
1296
  if ($ct_options['contact_forms_test'] == 0) {
1297
  return $html;
1307
  */
1308
  function ct_wpcf7_spam($param) {
1309
  global $wpdb, $current_user, $ct_agent_version, $ct_checkjs_cf7, $ct_cf7_comment, $ct_options, $ct_data;
1310
+
1311
+ $ct_options = ct_get_options();
1312
+ $ct_data = ct_get_data();
1313
 
1314
  if (WPCF7_VERSION >= '3.0.0') {
1315
  if($param === true)
1413
  */
1414
  function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
1415
  global $ct_options, $ct_data;
1416
+
1417
+ $ct_options = ct_get_options();
1418
+ $ct_data = ct_get_data();
1419
 
1420
  if (!empty($form_errors))
1421
  return $form_errors;
1492
  */
1493
  function ct_check_wplp(){
1494
  global $ct_wplp_result_label, $ct_options, $ct_data;
1495
+
1496
+ $ct_options = ct_get_options();
1497
+ $ct_data = ct_get_data();
1498
  if (!isset($_COOKIE[$ct_wplp_result_label])) {
1499
  // First AJAX submit of WPLP form
1500
  if ($ct_options['contact_forms_test'] == 0)
1557
  function ct_s2member_registration_test() {
1558
  global $ct_agent_version, $ct_post_data_label, $ct_post_data_authnet_label, $ct_formtime_label, $ct_options, $ct_data;
1559
 
1560
+ $ct_options = ct_get_options();
1561
+ $ct_data = ct_get_data();
1562
+
1563
  if ($ct_options['registrations_test'] == 0) {
1564
  return null;
1565
  }
1641
  * General test for any contact form
1642
  */
1643
  function ct_contact_form_validate () {
1644
+ global $pagenow,$cleantalk_executed, $cleantalk_url_exclusions;
1645
  if($cleantalk_executed)
1646
  {
1647
  return null;
1648
  }
1649
+ if(isset($cleantalk_url_exclusions))
1650
+ {
1651
+ $ct_cnt=sizeof($cleantalk_url_exclusions);
1652
+ }
1653
+ else
1654
+ {
1655
+ $ct_cnt=0;
1656
+ }
1657
+ @header("CtExclusions: ".$ct_cnt);
1658
 
1659
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1660
  (isset($pagenow) && $pagenow == 'wp-login.php') || // WordPress log in form
1661
+ (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_GET['action']) && $_GET['action']=='lostpassword') ||
1662
  strpos($_SERVER['REQUEST_URI'],'/checkout/')!==false ||
1663
  strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
1664
  strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false||
1665
  strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
1666
+ @strpos($_SERVER['HTTP_REFERER'],'/wp-admin/')!==false ||
1667
+ check_url_exclusions()
1668
  ) {
1669
  return null;
1670
  }
1750
  * General test for any post data
1751
  */
1752
  function ct_contact_form_validate_postdata () {
1753
+ global $pagenow,$cleantalk_executed, $cleantalk_url_exclusions;
1754
  if($cleantalk_executed)
1755
  {
1756
  return null;
1759
  {
1760
  return null;
1761
  }
1762
+ if(isset($cleantalk_url_exclusions))
1763
+ {
1764
+ $ct_cnt=sizeof($cleantalk_url_exclusions);
1765
+ }
1766
+ else
1767
+ {
1768
+ $ct_cnt=0;
1769
+ }
1770
+ @header("CtExclusions: ".$ct_cnt);
1771
 
1772
 
1773
  if ($_SERVER['REQUEST_METHOD'] != 'POST' ||
1779
  strpos($_SERVER['REQUEST_URI'],'/wp-admin/')!==false ||
1780
  strpos($_SERVER['REQUEST_URI'],'wp-login.php')!==false ||
1781
  strpos($_SERVER['REQUEST_URI'],'wp-comments-post.php')!==false ||
1782
+ @strpos($_SERVER['HTTP_REFERER'],'/wp-admin/')!==false ||
1783
+ check_url_exclusions()
1784
  ) {
1785
  return null;
1786
  }
1919
  }
1920
  }
1921
 
1922
+ ?>
cleantalk-users.php CHANGED
@@ -32,11 +32,28 @@ function ct_show_users_page()
32
  )
33
  );
34
  $cnt_unchecked=sizeof(get_users($args_unchecked));
 
 
 
 
 
 
 
 
 
35
  //if($cnt_unchecked>0)
36
  {
37
  ?>
38
  <button class="button" id="ct_check_users_button"><?php _e("Find spam users", 'cleantalk'); ?></button><br /><br />
39
- <div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all users against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam users' to start.", 'cleantalk'); ?></div>
 
 
 
 
 
 
 
 
40
  <?php
41
  }
42
  ?>
@@ -235,9 +252,9 @@ add_action( 'wp_ajax_ajax_check_users', 'ct_ajax_check_users' );
235
 
236
  function ct_ajax_check_users()
237
  {
238
- check_ajax_referer( 'ct_secret_nonce', 'security' );
239
  global $ct_options;
240
- //$ct_options = ct_get_options();
241
 
242
  $args_unchecked = array(
243
  'meta_query' => array(
@@ -346,7 +363,7 @@ function ct_ajax_info_users()
346
  'meta_query' => array(
347
  Array(
348
  'key' => 'ct_marked_as_spam',
349
- 'value' => '1',
350
  'compare' => 'NUMERIC'
351
  )
352
  )
32
  )
33
  );
34
  $cnt_unchecked=sizeof(get_users($args_unchecked));
35
+ $args_spam = array(
36
+ 'meta_query' => array(
37
+ Array(
38
+ 'key' => 'ct_marked_as_spam',
39
+ 'compare' => 'EXISTS'
40
+ )
41
+ )
42
+ );
43
+ $cnt_spam=sizeof(get_users($args_spam));
44
  //if($cnt_unchecked>0)
45
  {
46
  ?>
47
  <button class="button" id="ct_check_users_button"><?php _e("Find spam users", 'cleantalk'); ?></button><br /><br />
48
+ <div id="ct_info_message"><?php _e("Anti-spam by CleanTalk will check all users against blacklists database and show you senders that have spam activity on other websites. Just click 'Find spam users' to start.", 'cleantalk'); ?>
49
+ <?php
50
+ if($cnt_spam>0)
51
+ {
52
+ print "<br />
53
+ There is some differencies between blacklists database and our API mechanisms. Blacklists shows all history of spam activity, but our API (that used in spam checking) used another parameters, too: last day of activity, number of spam attacks during last days etc. This mechanisms help us to reduce number of false positivitie. So, there is nothing strange, if some emails/IPs will be not found by this checking.";
54
+ }
55
+ ?>
56
+ </div>
57
  <?php
58
  }
59
  ?>
252
 
253
  function ct_ajax_check_users()
254
  {
255
+ check_ajax_referer('ct_secret_nonce', 'security');
256
  global $ct_options;
257
+ $ct_options = ct_get_options();
258
 
259
  $args_unchecked = array(
260
  'meta_query' => array(
363
  'meta_query' => array(
364
  Array(
365
  'key' => 'ct_marked_as_spam',
366
+ //'value' => '1',
367
  'compare' => 'NUMERIC'
368
  )
369
  )
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.20
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
- $cleantalk_plugin_version='5.20';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
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.21
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
+ $cleantalk_plugin_version='5.21';
11
  $cleantalk_executed=false;
12
 
13
  if(defined('CLEANTALK_AJAX_USE_BUFFER'))
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
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.20
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -306,6 +306,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
306
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
307
 
308
  == Changelog ==
 
 
 
 
 
309
  = 5.20 2015-08-15 =
310
  * Fixed anti-spam stats in admin bar - now statistics updates every hour
311
  * Fixed issue with skipping spam submissions
@@ -738,6 +743,11 @@ WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enab
738
  * First version
739
 
740
  == Upgrade Notice ==
 
 
 
 
 
741
  = 5.20 2015-08-15 =
742
  * Fixed anti-spam stats in admin bar
743
  * Fixed issue with skipping spam submissions
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
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.21
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
306
  1. Setup Android/iOS app to have push notices when new legitiamte comments/registrations or contactcs appears on the website.
307
 
308
  == Changelog ==
309
+ = 5.21 2015-08-21 =
310
+ * Fixed bug with skipping spam submissions
311
+ * Fixed bug with receiving old user_token for viewing anti-spam statistics
312
+ * Small backend fixes
313
+
314
  = 5.20 2015-08-15 =
315
  * Fixed anti-spam stats in admin bar - now statistics updates every hour
316
  * Fixed issue with skipping spam submissions
743
  * First version
744
 
745
  == Upgrade Notice ==
746
+ = 5.21 2015-08-21 =
747
+ * Fixed bug with skipping spam submissions
748
+ * Fixed bug with receiving old user_token for viewing anti-spam statistics
749
+ * Small backend fixes
750
+
751
  = 5.20 2015-08-15 =
752
  * Fixed anti-spam stats in admin bar
753
  * Fixed issue with skipping spam submissions
screenshot-1.png CHANGED
Binary file