Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.75

Version Description

September 15 2017 = * Pause feature for users/comments spam check. * Improved protection from spam. * Small fixes.

Download this release

Release Info

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

Code changes from version 5.74.2 to 5.75

assets/css/cleantalk-spam-check.css CHANGED
@@ -18,6 +18,10 @@
18
  background:#ffff99;
19
  }
20
 
 
 
 
 
21
  div.ct_check_params_wrapper{}
22
  .ct_check_params_elem{}
23
  .ct_check_params_elem_sub{
18
  background:#ffff99;
19
  }
20
 
21
+ #ct_pause{
22
+ display:none;
23
+ }
24
+
25
  div.ct_check_params_wrapper{}
26
  .ct_check_params_elem{}
27
  .ct_check_params_elem_sub{
assets/js/cleantalk-comments-checkspam.js CHANGED
@@ -13,7 +13,12 @@ String.prototype.printf = function(){
13
  var ct_working = false,
14
  ct_new_check = true,
15
  ct_cooling_down_flag = false,
16
- ct_close_animate = true;
 
 
 
 
 
17
  // Settings
18
  var ct_cool_down_time = 65000,
19
  ct_requests_counter = 0,
@@ -25,7 +30,6 @@ var ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,
25
  ct_comments_spam = 0,
26
  ct_comments_bad = 0,
27
  ct_unchecked = 'unset',
28
- ct_accurate_check = false,
29
  ct_date_from = 0,
30
  ct_date_till = 0;
31
 
@@ -46,6 +50,7 @@ function animate_comment(to,id){
46
  }
47
 
48
  function ct_clear_comments(){
 
49
  var data = {
50
  'action': 'ajax_clear_comments',
51
  'security': ct_ajax_nonce
@@ -56,6 +61,7 @@ function ct_clear_comments(){
56
  url: ajaxurl,
57
  data: data,
58
  success: function(msg){
 
59
  ct_send_comments();
60
  }
61
  });
@@ -109,7 +115,7 @@ function ct_send_comments(){
109
  if(parseInt(msg.error)){
110
  ct_working=false;
111
  if(!confirm(msg.error_message+". Do you want to proceed?")){
112
- var new_href = 'edit-comments.php?page=ct_check_spam&ct_worked=1';
113
  if(ct_date_from != 0 && ct_date_till != 0)
114
  new_href+='&from='+ct_date_from+'&till='+ct_date_till;
115
  location.href = new_href;
@@ -117,7 +123,16 @@ function ct_send_comments(){
117
  ct_send_comments();
118
  }else{
119
  ct_new_check = false;
120
- if(parseInt(msg.end) == 0){
 
 
 
 
 
 
 
 
 
121
  ct_comments_checked += msg.checked;
122
  ct_comments_spam += msg.spam;
123
  ct_comments_bad += msg.bad;
@@ -129,13 +144,6 @@ function ct_send_comments(){
129
  jQuery('#ct_checking_status').html(status_string);
130
  jQuery('#ct_error_message').hide();
131
  ct_send_comments();
132
- }else if(parseInt(msg.end) == 1){
133
- ct_working=false;
134
- jQuery('#ct_working_message').hide();
135
- var new_href = 'edit-comments.php?page=ct_check_spam&ct_worked=1';
136
- if(ct_date_from != 0 && ct_date_till != 0)
137
- new_href+='&from='+ct_date_from+'&till='+ct_date_till;
138
- location.href = new_href;
139
  }
140
  }
141
  },
@@ -181,7 +189,10 @@ function ct_show_info(){
181
  success: function(msg){
182
  msg = jQuery.parseJSON(msg);
183
  jQuery('#ct_checking_status').html(msg.message);
184
- ct_comments_total = msg.total;
 
 
 
185
  },
186
  error: function(jqXHR, textStatus, errorThrown) {
187
  jQuery('#ct_error_message').show();
@@ -232,7 +243,7 @@ function ct_delete_all(){
232
  jQuery('#cleantalk_comments_left').html(msg);
233
  ct_delete_all();
234
  }else{
235
- location.href='edit-comments.php?page=ct_check_spam&ct_worked=1';
236
  }
237
  },
238
  error: function(jqXHR, textStatus, errorThrown) {
@@ -265,7 +276,7 @@ function ct_delete_checked(){
265
  url: ajaxurl,
266
  data: data,
267
  success: function(msg){
268
- location.href='edit-comments.php?page=ct_check_spam&ct_worked=1';
269
  },
270
  error: function(jqXHR, textStatus, errorThrown) {
271
  jQuery('#ct_error_message').show();
@@ -301,18 +312,21 @@ jQuery(document).ready(function(){
301
  // jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});
302
  jQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});
303
 
 
 
 
 
 
 
 
 
 
 
304
  // Toggle dependences
305
  jQuery("#ct_allow_date_range, #ct_accurate_check").on('change', function(){
306
  ct_toggle_depended(jQuery(this));
307
  });
308
-
309
- jQuery("#ct_accurate_check").on('change', function(){
310
- if(ct_accurate_check)
311
- ct_accurate_check = false;
312
- else
313
- ct_accurate_check = true;
314
- });
315
-
316
  var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
317
  {
318
  dateFormat: 'yy-mm-dd',
@@ -330,10 +344,8 @@ jQuery(document).ready(function(){
330
  }
331
  }
332
  );
333
- jQuery('#ct_date_range_from, #ct_date_range_till').prop('disabled', true);
334
- /////
335
- // Check comments
336
- jQuery("#ct_check_spam_button").click(function(){
337
 
338
  if(jQuery('#ct_allow_date_range').is(':checked')){
339
 
@@ -346,15 +358,45 @@ jQuery(document).ready(function(){
346
  }
347
  }
348
 
 
 
 
 
349
  jQuery('.ct_to_hide').hide();
350
  jQuery('#ct_working_message').show();
351
  jQuery('#ct_preloader').show();
 
352
 
353
  ct_working=true;
354
- ct_show_info();
355
- ct_clear_comments();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  });
357
 
 
 
 
 
 
 
 
 
 
 
 
358
  jQuery("#ct_insert_comments").click(function(){
359
  ct_insert_comments();
360
  });
@@ -385,7 +427,7 @@ jQuery(document).ready(function(){
385
  });
386
 
387
  jQuery("#ct_stop_deletion").click(function(){
388
- location.href='users.php?page=ct_check_spam&ct_worked=1';
389
  });
390
 
391
  jQuery(".cleantalk_delete_button").click(function(){
@@ -474,9 +516,4 @@ jQuery(document).ready(function(){
474
  timeout: 5000
475
  });
476
  });
477
-
478
- //Default load actions
479
- // if(location.href.match(/ct_check_spam/) && !location.href.match(/ct_worked=1/)){
480
- // jQuery("#ct_check_spam_button").click();
481
- // }
482
- });
13
  var ct_working = false,
14
  ct_new_check = true,
15
  ct_cooling_down_flag = false,
16
+ ct_close_animate = true,
17
+ ct_accurate_check = false,
18
+ ct_pause = false,
19
+ ct_prev_accurate = ctCommentsCheck.ct_prev_accurate,
20
+ ct_prev_from = ctCommentsCheck.ct_prev_from,
21
+ ct_prev_till = ctCommentsCheck.ct_prev_till;
22
  // Settings
23
  var ct_cool_down_time = 65000,
24
  ct_requests_counter = 0,
30
  ct_comments_spam = 0,
31
  ct_comments_bad = 0,
32
  ct_unchecked = 'unset',
 
33
  ct_date_from = 0,
34
  ct_date_till = 0;
35
 
50
  }
51
 
52
  function ct_clear_comments(){
53
+
54
  var data = {
55
  'action': 'ajax_clear_comments',
56
  'security': ct_ajax_nonce
61
  url: ajaxurl,
62
  data: data,
63
  success: function(msg){
64
+ ct_show_info();
65
  ct_send_comments();
66
  }
67
  });
115
  if(parseInt(msg.error)){
116
  ct_working=false;
117
  if(!confirm(msg.error_message+". Do you want to proceed?")){
118
+ var new_href = 'edit-comments.php?page=ct_check_spam';
119
  if(ct_date_from != 0 && ct_date_till != 0)
120
  new_href+='&from='+ct_date_from+'&till='+ct_date_till;
121
  location.href = new_href;
123
  ct_send_comments();
124
  }else{
125
  ct_new_check = false;
126
+ if(parseInt(msg.end) == 1 || ct_pause === true){
127
+ if(parseInt(msg.end) == 1)
128
+ document.cookie = 'ct_paused_comments_check=0; path=/';
129
+ ct_working=false;
130
+ jQuery('#ct_working_message').hide();
131
+ var new_href = 'edit-comments.php?page=ct_check_spam';
132
+ if(ct_date_from != 0 && ct_date_till != 0)
133
+ new_href+='&from='+ct_date_from+'&till='+ct_date_till;
134
+ location.href = new_href;
135
+ }else if(parseInt(msg.end) == 0){
136
  ct_comments_checked += msg.checked;
137
  ct_comments_spam += msg.spam;
138
  ct_comments_bad += msg.bad;
144
  jQuery('#ct_checking_status').html(status_string);
145
  jQuery('#ct_error_message').hide();
146
  ct_send_comments();
 
 
 
 
 
 
 
147
  }
148
  }
149
  },
189
  success: function(msg){
190
  msg = jQuery.parseJSON(msg);
191
  jQuery('#ct_checking_status').html(msg.message);
192
+ ct_comments_total = msg.total;
193
+ ct_comments_spam = msg.spam;
194
+ ct_comments_checked = msg.checked;
195
+ ct_comments_bad = msg.bad;
196
  },
197
  error: function(jqXHR, textStatus, errorThrown) {
198
  jQuery('#ct_error_message').show();
243
  jQuery('#cleantalk_comments_left').html(msg);
244
  ct_delete_all();
245
  }else{
246
+ location.href='edit-comments.php?page=ct_check_spam';
247
  }
248
  },
249
  error: function(jqXHR, textStatus, errorThrown) {
276
  url: ajaxurl,
277
  data: data,
278
  success: function(msg){
279
+ location.href='edit-comments.php?page=ct_check_spam';
280
  },
281
  error: function(jqXHR, textStatus, errorThrown) {
282
  jQuery('#ct_error_message').show();
312
  // jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});
313
  jQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});
314
 
315
+ // Prev check parameters
316
+ if(ct_prev_accurate){
317
+ jQuery("#ct_accurate_check").prop('checked', true);
318
+ }
319
+ if(ct_prev_from){
320
+ jQuery("#ct_allow_date_range").prop('checked', true).data('state', true);
321
+ jQuery("#ct_date_range_from").removeProp('disabled').val(ct_prev_from);
322
+ jQuery("#ct_date_range_till").removeProp('disabled').val(ct_prev_till);
323
+ }
324
+
325
  // Toggle dependences
326
  jQuery("#ct_allow_date_range, #ct_accurate_check").on('change', function(){
327
  ct_toggle_depended(jQuery(this));
328
  });
329
+
 
 
 
 
 
 
 
330
  var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
331
  {
332
  dateFormat: 'yy-mm-dd',
344
  }
345
  }
346
  );
347
+
348
+ function ct_start_check(continue_check = false){
 
 
349
 
350
  if(jQuery('#ct_allow_date_range').is(':checked')){
351
 
358
  }
359
  }
360
 
361
+ if(jQuery('#ct_accurate_check').is(':checked')){
362
+ ct_accurate_check = true;
363
+ }
364
+
365
  jQuery('.ct_to_hide').hide();
366
  jQuery('#ct_working_message').show();
367
  jQuery('#ct_preloader').show();
368
+ jQuery('#ct_pause').show();
369
 
370
  ct_working=true;
371
+
372
+ if(continue_check){
373
+ ct_show_info();
374
+ ct_send_comments();
375
+ }else
376
+ ct_clear_comments();
377
+
378
+ }
379
+
380
+ // Check comments
381
+ jQuery("#ct_check_spam_button").click(function(){
382
+ document.cookie = 'ct_paused_comments_check=0; path=/';
383
+ ct_start_check(false);
384
+ });
385
+ jQuery("#ct_proceed_check_button").click(function(){
386
+ ct_start_check(true);
387
  });
388
 
389
+ // Pause the check
390
+ jQuery('#ct_pause').on('click', function(){
391
+ ct_pause = true;
392
+ var ct_check = {
393
+ 'accurate': ct_accurate_check,
394
+ 'from' : ct_date_from,
395
+ 'till' : ct_date_till
396
+ };
397
+ document.cookie = 'ct_paused_comments_check=' + JSON.stringify(ct_check) + '; path=/';
398
+ });
399
+
400
  jQuery("#ct_insert_comments").click(function(){
401
  ct_insert_comments();
402
  });
427
  });
428
 
429
  jQuery("#ct_stop_deletion").click(function(){
430
+ location.href='edit-comments.php?page=ct_check_spam';
431
  });
432
 
433
  jQuery(".cleantalk_delete_button").click(function(){
516
  timeout: 5000
517
  });
518
  });
519
+ });
 
 
 
 
 
assets/js/cleantalk-comments-editscreen.js CHANGED
@@ -7,9 +7,8 @@ function ct_is_ip(str){
7
 
8
  jQuery(document).ready(function(){
9
 
10
- /* Shows "Find spam users" Buttons */
11
- jQuery('#post-query-submit').after('<a href="edit-comments.php?page=ct_check_spam" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctCommentsScreen.spambutton_text+'</a>' +
12
- ' <a href="edit-comments.php?page=ct_check_spam&ct_worked=1" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctCommentsScreen.spambutton_text_show+'</a>&nbsp;');
13
 
14
  /* Shows link to blacklists near every email and IP address */
15
  if(parseInt(ctCommentsScreen.ct_show_check_links))
7
 
8
  jQuery(document).ready(function(){
9
 
10
+ /* Shows "Find spam users" button */
11
+ jQuery('#post-query-submit').after('<a href="edit-comments.php?page=ct_check_spam" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctCommentsScreen.spambutton_text+'</a>&nbsp;');
 
12
 
13
  /* Shows link to blacklists near every email and IP address */
14
  if(parseInt(ctCommentsScreen.ct_show_check_links))
assets/js/cleantalk-users-checkspam.js CHANGED
@@ -13,7 +13,12 @@ String.prototype.printf = function(){
13
  var ct_working = false,
14
  ct_new_check = true,
15
  ct_cooling_down_flag = false,
16
- ct_close_animate = true;
 
 
 
 
 
17
  // Settings
18
  var ct_cool_down_time = 65000,
19
  ct_requests_counter = 0,
@@ -25,7 +30,6 @@ var ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,
25
  ct_users_spam = 0,
26
  ct_users_bad = 0,
27
  ct_unchecked = 'unset',
28
- ct_accurate_check = false,
29
  ct_date_from = 0,
30
  ct_date_till = 0;
31
 
@@ -46,6 +50,7 @@ function animate_comment(to,id){
46
  }
47
 
48
  function ct_clear_users(){
 
49
  var data = {
50
  'action': 'ajax_clear_users',
51
  'security': ct_ajax_nonce
@@ -56,6 +61,7 @@ function ct_clear_users(){
56
  url: ajaxurl,
57
  data: data,
58
  success: function(msg){
 
59
  ct_send_users();
60
  }
61
  });
@@ -109,7 +115,7 @@ function ct_send_users(){
109
  if(parseInt(msg.error)){
110
  ct_working=false;
111
  if(!confirm(msg.error_message+". Do you want to proceed?")){
112
- var new_href = 'users.php?page=ct_check_users&ct_worked=1';
113
  if(ct_date_from != 0 && ct_date_till != 0)
114
  new_href+='&from='+ct_date_from+'&till='+ct_date_till;
115
  location.href = new_href;
@@ -117,7 +123,16 @@ function ct_send_users(){
117
  ct_send_users();
118
  }else{
119
  ct_new_check = false;
120
- if(parseInt(msg.end) == 0){
 
 
 
 
 
 
 
 
 
121
  ct_users_checked += msg.checked;
122
  ct_users_spam += msg.spam;
123
  ct_users_bad += msg.bad;
@@ -129,13 +144,6 @@ function ct_send_users(){
129
  jQuery('#ct_checking_status').html(status_string);
130
  jQuery('#ct_error_message').hide();
131
  ct_send_users();
132
- }else if(parseInt(msg.end) == 1){
133
- ct_working=false;
134
- jQuery('#ct_working_message').hide();
135
- var new_href = 'users.php?page=ct_check_users&ct_worked=1';
136
- if(ct_date_from != 0 && ct_date_till != 0)
137
- new_href+='&from='+ct_date_from+'&till='+ct_date_till;
138
- location.href = new_href;
139
  }
140
  }
141
  },
@@ -181,7 +189,10 @@ function ct_show_users_info(){
181
  success: function(msg){
182
  msg = jQuery.parseJSON(msg);
183
  jQuery('#ct_checking_status').html(msg.message);
184
- ct_users_total = msg.total;
 
 
 
185
  },
186
  error: function (jqXHR, textStatus, errorThrown){
187
  jQuery('#ct_error_message').show();
@@ -301,18 +312,21 @@ jQuery(document).ready(function(){
301
  // jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});
302
  jQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});
303
 
 
 
 
 
 
 
 
 
 
 
304
  // Toggle dependences
305
  jQuery("#ct_allow_date_range, #ct_accurate_check").on('change', function(){
306
  ct_toggle_depended(jQuery(this));
307
  });
308
-
309
- jQuery("#ct_accurate_check").on('change', function(){
310
- if(ct_accurate_check)
311
- ct_accurate_check = false;
312
- else
313
- ct_accurate_check = true;
314
- });
315
-
316
  var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
317
  {
318
  dateFormat: 'yy-mm-dd',
@@ -330,10 +344,8 @@ jQuery(document).ready(function(){
330
  }
331
  }
332
  );
333
- jQuery('#ct_date_range_from, #ct_date_range_till').prop('disabled', true);
334
- /////
335
- // Check users
336
- jQuery("#ct_check_spam_button").click(function(){
337
 
338
  if(jQuery('#ct_allow_date_range').is(':checked')){
339
 
@@ -346,13 +358,43 @@ jQuery(document).ready(function(){
346
  }
347
  }
348
 
 
 
 
 
349
  jQuery('.ct_to_hide').hide();
350
  jQuery('#ct_working_message').show();
351
  jQuery('#ct_preloader').show();
 
352
 
353
  ct_working=true;
354
- ct_show_users_info();
355
- ct_clear_users();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  });
357
 
358
  jQuery("#ct_insert_users").click(function(){
@@ -385,7 +427,7 @@ jQuery(document).ready(function(){
385
  });
386
 
387
  jQuery("#ct_stop_deletion").click(function(){
388
- location.href='users.php?page=ct_check_users&ct_worked=1';
389
  });
390
 
391
  jQuery(".cleantalk_delete_user_button").click(function(){
@@ -496,9 +538,4 @@ jQuery(document).ready(function(){
496
  },
497
  });
498
  });
499
-
500
- //Default load actions
501
- // if(location.href.match(/ct_check_users/) && !location.href.match(/ct_worked=1/)){
502
- // jQuery("#ct_check_spam_button").click();
503
- // }
504
- });
13
  var ct_working = false,
14
  ct_new_check = true,
15
  ct_cooling_down_flag = false,
16
+ ct_close_animate = true,
17
+ ct_accurate_check = false,
18
+ ct_pause = false,
19
+ ct_prev_accurate = ctUsersCheck.ct_prev_accurate,
20
+ ct_prev_from = ctUsersCheck.ct_prev_from,
21
+ ct_prev_till = ctUsersCheck.ct_prev_till;
22
  // Settings
23
  var ct_cool_down_time = 65000,
24
  ct_requests_counter = 0,
30
  ct_users_spam = 0,
31
  ct_users_bad = 0,
32
  ct_unchecked = 'unset',
 
33
  ct_date_from = 0,
34
  ct_date_till = 0;
35
 
50
  }
51
 
52
  function ct_clear_users(){
53
+
54
  var data = {
55
  'action': 'ajax_clear_users',
56
  'security': ct_ajax_nonce
61
  url: ajaxurl,
62
  data: data,
63
  success: function(msg){
64
+ ct_show_users_info();
65
  ct_send_users();
66
  }
67
  });
115
  if(parseInt(msg.error)){
116
  ct_working=false;
117
  if(!confirm(msg.error_message+". Do you want to proceed?")){
118
+ var new_href = 'users.php?page=ct_check_users';
119
  if(ct_date_from != 0 && ct_date_till != 0)
120
  new_href+='&from='+ct_date_from+'&till='+ct_date_till;
121
  location.href = new_href;
123
  ct_send_users();
124
  }else{
125
  ct_new_check = false;
126
+ if(parseInt(msg.end) == 1 || ct_pause == true){
127
+ if(parseInt(msg.end) == 1)
128
+ document.cookie = 'ct_paused_users_check=0; path=/';
129
+ ct_working=false;
130
+ jQuery('#ct_working_message').hide();
131
+ var new_href = 'users.php?page=ct_check_users&ct_worked=1';
132
+ if(ct_date_from != 0 && ct_date_till != 0)
133
+ new_href+='&from='+ct_date_from+'&till='+ct_date_till;
134
+ location.href = new_href;
135
+ }else if(parseInt(msg.end) == 0){
136
  ct_users_checked += msg.checked;
137
  ct_users_spam += msg.spam;
138
  ct_users_bad += msg.bad;
144
  jQuery('#ct_checking_status').html(status_string);
145
  jQuery('#ct_error_message').hide();
146
  ct_send_users();
 
 
 
 
 
 
 
147
  }
148
  }
149
  },
189
  success: function(msg){
190
  msg = jQuery.parseJSON(msg);
191
  jQuery('#ct_checking_status').html(msg.message);
192
+ ct_users_total = msg.total;
193
+ ct_users_spam = msg.spam;
194
+ ct_users_checked = msg.checked;
195
+ ct_users_bad = msg.bad;
196
  },
197
  error: function (jqXHR, textStatus, errorThrown){
198
  jQuery('#ct_error_message').show();
312
  // jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});
313
  jQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});
314
 
315
+ // Prev check parameters
316
+ if(ct_prev_accurate){
317
+ jQuery("#ct_accurate_check").prop('checked', true);
318
+ }
319
+ if(ct_prev_from){
320
+ jQuery("#ct_allow_date_range").prop('checked', true).data('state', true);
321
+ jQuery("#ct_date_range_from").removeProp('disabled').val(ct_prev_from);
322
+ jQuery("#ct_date_range_till").removeProp('disabled').val(ct_prev_till);
323
+ }
324
+
325
  // Toggle dependences
326
  jQuery("#ct_allow_date_range, #ct_accurate_check").on('change', function(){
327
  ct_toggle_depended(jQuery(this));
328
  });
329
+
 
 
 
 
 
 
 
330
  var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
331
  {
332
  dateFormat: 'yy-mm-dd',
344
  }
345
  }
346
  );
347
+
348
+ function ct_start_check(continue_check = false){
 
 
349
 
350
  if(jQuery('#ct_allow_date_range').is(':checked')){
351
 
358
  }
359
  }
360
 
361
+ if(jQuery('#ct_accurate_check').is(':checked')){
362
+ ct_accurate_check = true;
363
+ }
364
+
365
  jQuery('.ct_to_hide').hide();
366
  jQuery('#ct_working_message').show();
367
  jQuery('#ct_preloader').show();
368
+ jQuery('#ct_pause').show();
369
 
370
  ct_working=true;
371
+
372
+ if(continue_check){
373
+ ct_show_users_info();
374
+ ct_send_users();
375
+ }else
376
+ ct_clear_users();
377
+
378
+ }
379
+
380
+ // Check users
381
+ jQuery("#ct_check_spam_button").click(function(){
382
+ document.cookie = 'ct_paused_users_check=0; path=/';
383
+ ct_start_check(false);
384
+ });
385
+ jQuery("#ct_proceed_check_button").click(function(){
386
+ ct_start_check(true);
387
+ });
388
+
389
+ // Pause the check
390
+ jQuery('#ct_pause').on('click', function(){
391
+ ct_pause = true;
392
+ var ct_check = {
393
+ 'accurate': ct_accurate_check,
394
+ 'from' : ct_date_from,
395
+ 'till' : ct_date_till
396
+ };
397
+ document.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/';
398
  });
399
 
400
  jQuery("#ct_insert_users").click(function(){
427
  });
428
 
429
  jQuery("#ct_stop_deletion").click(function(){
430
+ location.href='users.php?page=ct_check_users';
431
  });
432
 
433
  jQuery(".cleantalk_delete_user_button").click(function(){
538
  },
539
  });
540
  });
541
+ });
 
 
 
 
 
assets/js/cleantalk-users-editscreen.js CHANGED
@@ -8,8 +8,7 @@ function ct_is_ip(str){
8
  jQuery(document).ready(function(){
9
 
10
  /* Shows "Find spam users" Buttons */
11
- jQuery('#changeit').after(' <a href="users.php?page=ct_check_users" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctUsersScreen.spambutton_users_text+'</a>' +
12
- ' <a href="users.php?page=ct_check_users&ct_worked=1" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctUsersScreen.spambutton_users_text_show+'</a>');
13
 
14
  /* Shows link to blacklists near every email and IP address */
15
  if(parseInt(ctUsersScreen.ct_show_check_links))
8
  jQuery(document).ready(function(){
9
 
10
  /* Shows "Find spam users" Buttons */
11
+ jQuery('#changeit').after(' <a href="users.php?page=ct_check_users" class="button" style="margin:1px 0 0 0; display: inline-block;">'+ctAdminCommon.logo_small_colored+'&nbsp;'+ctUsersScreen.spambutton_text+'</a>&nbsp;');
 
12
 
13
  /* Shows link to blacklists near every email and IP address */
14
  if(parseInt(ctUsersScreen.ct_show_check_links))
cleantalk.php CHANGED
@@ -3,15 +3,15 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
- Version: 5.74.2
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
- $cleantalk_plugin_version='5.74.2';
12
- $ct_agent_version = 'wordpress-5742';
13
  $cleantalk_executed=false;
14
-
15
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
16
 
17
  if(!defined('CLEANTALK_PLUGIN_DIR')){
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. Formerly Anti-Spam by CleanTalk.
6
+ Version: 5.75
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: http://cleantalk.org
9
  */
10
 
11
+ $cleantalk_plugin_version='5.75';
12
+ $ct_agent_version = 'wordpress-575';
13
  $cleantalk_executed=false;
14
+
15
  define('CLEANTALK_REMOTE_CALL_SLEEP', 10); // Minimum time between remote call
16
 
17
  if(!defined('CLEANTALK_PLUGIN_DIR')){
inc/cleantalk-admin.php CHANGED
@@ -228,31 +228,35 @@ function ct_enqueue_scripts($hook) {
228
  if( $hook == 'comments_page_ct_check_spam' || $hook == 'edit-comments.php'){
229
 
230
  wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url().'/cleantalk-spam-protect/assets/css/cleantalk-spam-check.css', array(), $cleantalk_plugin_version, 'all');
231
- wp_enqueue_style('jqueryui_css', plugins_url().'/cleantalk-spam-protect/assets/js/jquery-ui.min.css', array(), '1.21.1', 'all');
232
 
233
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
234
  $user_token = !empty($ct_data['user_token']) ? $ct_data['user_token'] : '';
235
- $show_check_links = !empty($ct_options['show_check_links']) ? $ct_options['show_check_links'] : 0;
 
 
236
 
237
- wp_enqueue_script('ct_comments_checkspam', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-comments-checkspam.js'), array(), $cleantalk_plugin_version);
238
- wp_enqueue_script('ct_comments_editscreen', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-comments-editscreen.js'), array(), $cleantalk_plugin_version);
239
- wp_enqueue_script('jqueryui', plugins_url('/cleantalk-spam-protect/assets/js/jquery-ui.min.js'), array(), '1.12.1');
240
 
241
  wp_localize_script( 'jquery', 'ctCommentsCheck', array(
242
- 'ct_ajax_nonce' => $ajax_nonce,
 
 
 
243
  'ct_timeout_confirm' => __('Failed from timeout. Going to check comments again.', 'cleantalk'),
244
  'ct_comments_added' => __('Added', 'cleantalk'),
245
  'ct_comments_deleted' => __('Deleted', 'cleantalk'),
246
  'ct_comments_added_after' => __('comments', 'cleantalk'),
247
  'ct_confirm_deletion_all' => __('Delete all spam comments?', 'cleantalk'),
248
  'ct_confirm_deletion_checked' => __('Delete checked comments?', 'cleantalk'),
249
- 'ct_status_string' => __("Total comments %s. Checked %s. Found %s spam comments. %s bad comments (without IP or email).", 'cleantalk'),
250
- 'ct_status_string_warning' => "<p>".__("Please do backup of WordPress database before delete any accounts!", 'cleantalk')."</p>"
251
  ));
252
  wp_localize_script( 'jquery', 'ctCommentsScreen', array(
253
  'ct_ajax_nonce' => $ajax_nonce,
254
  'spambutton_text' => __("Find spam-comments", 'cleantalk'),
255
- 'spambutton_text_show' => __("Show spam-comments", 'cleantalk'),
256
  'ct_feedback_msg_whitelisted' => __("The sender has been whitelisted.", 'cleantalk'),
257
  'ct_feedback_msg_blacklisted' => __("The sender has been blacklisted.", 'cleantalk'),
258
  'ct_feedback_msg' => sprintf(__("Feedback has been sent to %sCleanTalk Dashboard%s.", 'cleantalk'), $user_token ? "<a target='_blank' href=https://cleantalk.org/my?user_token={$user_token}&cp_mode=antispam>" : '', $user_token ? "</a>" : ''),
@@ -266,18 +270,23 @@ function ct_enqueue_scripts($hook) {
266
  if( $hook == 'users_page_ct_check_users' || $hook == 'users.php'){
267
 
268
  wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url().'/cleantalk-spam-protect/assets/css/cleantalk-spam-check.css', array(), $cleantalk_plugin_version, 'all');
269
- wp_enqueue_style('jqueryui_css', plugins_url().'/cleantalk-spam-protect/assets/js/jquery-ui.min.css', array(), '1.21.1', 'all');
270
 
271
  $current_user = wp_get_current_user();
272
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
273
- $show_check_links = !empty($ct_options['show_check_links']) ? $ct_options['show_check_links'] : 0;
 
 
274
 
275
- wp_enqueue_script('ct_users_checkspam', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-users-checkspam.js'), array(), $cleantalk_plugin_version);
276
- wp_enqueue_script('ct_users_editscreen', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-users-editscreen.js'), array(), $cleantalk_plugin_version);
277
- wp_enqueue_script('jqueryui', plugins_url('/cleantalk-spam-protect/assets/js/jquery-ui.min.js'), array(), '1.12.1');
278
 
279
  wp_localize_script( 'jquery', 'ctUsersCheck', array(
280
  'ct_ajax_nonce' => $ajax_nonce,
 
 
 
281
  'ct_timeout' => __('Failed from timeout. Going to check users again.', 'cleantalk'),
282
  'ct_timeout_delete' => __('Failed from timeout. Going to run a new attempt to delete spam users.', 'cleantalk'),
283
  'ct_inserted' => __('Inserted', 'cleantalk'),
@@ -291,8 +300,7 @@ function ct_enqueue_scripts($hook) {
291
  'ct_status_string_warning' => "<p>".__("Please do backup of WordPress database before delete any accounts!", 'cleantalk')."</p>"
292
  ));
293
  wp_localize_script( 'jquery', 'ctUsersScreen', array(
294
- 'spambutton_users_text' => __("Find spam-users", 'cleantalk'),
295
- 'spambutton_users_text_show' => __("Show spam-users", 'cleantalk'),
296
  'ct_show_check_links' => $show_check_links,
297
  'ct_img_src_new_tab' => plugin_dir_url(__FILE__)."images/new_window.gif"
298
  ));
@@ -650,7 +658,7 @@ function ct_input_all_time_counter() {
650
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_all_time_counter1' name='cleantalk_settings[all_time_counter]' value='1' ".($value=='1'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_all_time_counter1'> ".__('Yes')."</label>";
651
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
652
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_all_time_counter0' name='cleantalk_settings[all_time_counter]' value='0' ".($value=='0'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_all_time_counter0'> ".__('No')."</label>";
653
- ct_add_descriptions_to_fields(sprintf(__('Display all-time requests counter in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'), $ct_options['all_time_counter']));
654
  }
655
 
656
  function ct_input_daily_counter() {
@@ -680,7 +688,7 @@ function ct_input_sfw_counter() {
680
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_sfw_counter1' name='cleantalk_settings[sfw_counter]' value='1' ".($value=='1'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_sfw_counter1'> ".__('Yes')."</label>";
681
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
682
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_sfw_counter0' name='cleantalk_settings[sfw_counter]' value='0' ".($value=='0'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_sfw_counter0'> ".__('No')."</label>";
683
- ct_add_descriptions_to_fields(sprintf(__('Display all-time requests counter in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'), $ct_options['sfw_counter']));
684
  }
685
 
686
  function ct_add_admin_menu( $wp_admin_bar ) {
228
  if( $hook == 'comments_page_ct_check_spam' || $hook == 'edit-comments.php'){
229
 
230
  wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url().'/cleantalk-spam-protect/assets/css/cleantalk-spam-check.css', array(), $cleantalk_plugin_version, 'all');
231
+ wp_enqueue_style('jqueryui_css', plugins_url().'/cleantalk-spam-protect/assets/js/jquery-ui.min.css', array(), '1.21.1', 'all');
232
 
233
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
234
  $user_token = !empty($ct_data['user_token']) ? $ct_data['user_token'] : '';
235
+ $show_check_links = !empty($ct_options['show_check_links']) ? $ct_options['show_check_links'] : 0;
236
+ if(!empty($_COOKIE['ct_paused_comments_check']))
237
+ $prev_check = json_decode(stripslashes($_COOKIE['ct_paused_comments_check']), true);
238
 
239
+ wp_enqueue_script('ct_comments_checkspam', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-comments-checkspam.js'), array(), $cleantalk_plugin_version);
240
+ wp_enqueue_script('ct_comments_editscreen', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-comments-editscreen.js'), array(), $cleantalk_plugin_version);
241
+ wp_enqueue_script('jqueryui', plugins_url('/cleantalk-spam-protect/assets/js/jquery-ui.min.js'), array('jquery'), '1.12.1');
242
 
243
  wp_localize_script( 'jquery', 'ctCommentsCheck', array(
244
+ 'ct_ajax_nonce' => $ajax_nonce,
245
+ 'ct_prev_accurate' => !empty($prev_check['accurate']) ? true : false,
246
+ 'ct_prev_from' => !empty($prev_check['from']) ? $prev_check['from'] : false,
247
+ 'ct_prev_till' => !empty($prev_check['till']) ? $prev_check['till'] : false,
248
  'ct_timeout_confirm' => __('Failed from timeout. Going to check comments again.', 'cleantalk'),
249
  'ct_comments_added' => __('Added', 'cleantalk'),
250
  'ct_comments_deleted' => __('Deleted', 'cleantalk'),
251
  'ct_comments_added_after' => __('comments', 'cleantalk'),
252
  'ct_confirm_deletion_all' => __('Delete all spam comments?', 'cleantalk'),
253
  'ct_confirm_deletion_checked' => __('Delete checked comments?', 'cleantalk'),
254
+ 'ct_status_string' => __('Total comments %s. Checked %s. Found %s spam comments. %s bad comments (without IP or email).', 'cleantalk'),
255
+ 'ct_status_string_warning' => '<p>'.__('Please do backup of WordPress database before delete any accounts!', 'cleantalk').'</p>'
256
  ));
257
  wp_localize_script( 'jquery', 'ctCommentsScreen', array(
258
  'ct_ajax_nonce' => $ajax_nonce,
259
  'spambutton_text' => __("Find spam-comments", 'cleantalk'),
 
260
  'ct_feedback_msg_whitelisted' => __("The sender has been whitelisted.", 'cleantalk'),
261
  'ct_feedback_msg_blacklisted' => __("The sender has been blacklisted.", 'cleantalk'),
262
  'ct_feedback_msg' => sprintf(__("Feedback has been sent to %sCleanTalk Dashboard%s.", 'cleantalk'), $user_token ? "<a target='_blank' href=https://cleantalk.org/my?user_token={$user_token}&cp_mode=antispam>" : '', $user_token ? "</a>" : ''),
270
  if( $hook == 'users_page_ct_check_users' || $hook == 'users.php'){
271
 
272
  wp_enqueue_style('cleantalk_admin_css_settings_page', plugins_url().'/cleantalk-spam-protect/assets/css/cleantalk-spam-check.css', array(), $cleantalk_plugin_version, 'all');
273
+ wp_enqueue_style('jqueryui_css', plugins_url().'/cleantalk-spam-protect/assets/js/jquery-ui.min.css', array(), '1.21.1', 'all');
274
 
275
  $current_user = wp_get_current_user();
276
  $ajax_nonce = wp_create_nonce( "ct_secret_nonce" );
277
+ $show_check_links = !empty($ct_options['show_check_links']) ? $ct_options['show_check_links'] : 0;
278
+ if(!empty($_COOKIE['ct_paused_users_check']))
279
+ $prev_check = json_decode(stripslashes($_COOKIE['ct_paused_users_check']), true);
280
 
281
+ wp_enqueue_script('ct_users_checkspam', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-users-checkspam.js'), array(), $cleantalk_plugin_version);
282
+ wp_enqueue_script('ct_users_editscreen', plugins_url('/cleantalk-spam-protect/assets/js/cleantalk-users-editscreen.js'), array(), $cleantalk_plugin_version);
283
+ wp_enqueue_script('jqueryui', plugins_url('/cleantalk-spam-protect/assets/js/jquery-ui.min.js'), array('jquery'), '1.12.1');
284
 
285
  wp_localize_script( 'jquery', 'ctUsersCheck', array(
286
  'ct_ajax_nonce' => $ajax_nonce,
287
+ 'ct_prev_accurate' => !empty($prev_check['accurate']) ? true : false,
288
+ 'ct_prev_from' => !empty($prev_check['from']) ? $prev_check['from'] : false,
289
+ 'ct_prev_till' => !empty($prev_check['till']) ? $prev_check['till'] : false,
290
  'ct_timeout' => __('Failed from timeout. Going to check users again.', 'cleantalk'),
291
  'ct_timeout_delete' => __('Failed from timeout. Going to run a new attempt to delete spam users.', 'cleantalk'),
292
  'ct_inserted' => __('Inserted', 'cleantalk'),
300
  'ct_status_string_warning' => "<p>".__("Please do backup of WordPress database before delete any accounts!", 'cleantalk')."</p>"
301
  ));
302
  wp_localize_script( 'jquery', 'ctUsersScreen', array(
303
+ 'spambutton_text' => __("Find spam-users", 'cleantalk'),
 
304
  'ct_show_check_links' => $show_check_links,
305
  'ct_img_src_new_tab' => plugin_dir_url(__FILE__)."images/new_window.gif"
306
  ));
658
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_all_time_counter1' name='cleantalk_settings[all_time_counter]' value='1' ".($value=='1'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_all_time_counter1'> ".__('Yes')."</label>";
659
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
660
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_all_time_counter0' name='cleantalk_settings[all_time_counter]' value='0' ".($value=='0'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_all_time_counter0'> ".__('No')."</label>";
661
+ ct_add_descriptions_to_fields(__('Display all-time requests counter in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'));
662
  }
663
 
664
  function ct_input_daily_counter() {
688
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_sfw_counter1' name='cleantalk_settings[sfw_counter]' value='1' ".($value=='1'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_sfw_counter1'> ".__('Yes')."</label>";
689
  echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
690
  echo "<input type='radio' class='ct-depends-of-show-adminbar' id='cleantalk_sfw_counter0' name='cleantalk_settings[sfw_counter]' value='0' ".($value=='0'?'checked':'').($value2=='0'?' disabled':'')." /><label for='cleantalk_sfw_counter0'> ".__('No')."</label>";
691
+ ct_add_descriptions_to_fields(__('Display all-time requests counter in the admin bar. Counter displays number of requests since plugin installation.', 'cleantalk'));
692
  }
693
 
694
  function ct_add_admin_menu( $wp_admin_bar ) {
inc/cleantalk-comments.php CHANGED
@@ -11,7 +11,7 @@ add_action( 'wp_ajax_ajax_ct_approve_comment', 'ct_comment_check_approve_comment
11
 
12
  function ct_add_comments_menu(){
13
  if(current_user_can('activate_plugins'))
14
- add_comments_page( __("Check for spam", 'cleantalk'), __("Show spam comments", 'cleantalk'), 'read', 'ct_check_spam', 'ct_show_checkspam_page');
15
  }
16
 
17
  function ct_show_checkspam_page(){
@@ -54,6 +54,7 @@ function ct_show_checkspam_page(){
54
  <!-- Check options -->
55
  <div class="ct_to_hide" id="ct_check_params_wrapper">
56
  <button class="button ct_check_params_elem" id="ct_check_spam_button"><?php _e("Start check", 'cleantalk'); ?></button>
 
57
  <p class="ct_check_params_desc"><?php _e("The plugin will check all comments against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
58
  <br />
59
  <div class="ct_check_params_elem ct_check_params_elem_sub">
@@ -65,8 +66,8 @@ function ct_show_checkspam_page(){
65
  <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
66
  </div>
67
  <div class="ct_check_params_desc">
68
- <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo isset($_GET['from']) ? $_GET['from'] : ''; ?>" readonly />
69
- <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo isset($_GET['till']) ? $_GET['till'] : ''; ?>" readonly />
70
  </div>
71
  </div>
72
 
@@ -81,6 +82,9 @@ function ct_show_checkspam_page(){
81
  <?php _e("Please wait! CleanTalk is checking all approved and pending comments via blacklist database at cleantalk.org. You will have option to delete found spam comments after plugin finish.", 'cleantalk'); ?>
82
  </div>
83
 
 
 
 
84
  <?php
85
 
86
  // Pagination
@@ -467,7 +471,10 @@ function ct_ajax_info_comments($direct_call = false){
467
 
468
  $return = array(
469
  'message' => '',
470
- 'total' => $cnt
 
 
 
471
  );
472
 
473
  $return['message'] .= sprintf (__("Total comments %s. Checked %s. Found %s spam comments. %s bad comments (without IP or email).", 'cleantalk'), $cnt, $cnt_checked, $cnt_spam, $cnt_bad);
@@ -510,7 +517,7 @@ function ct_ajax_insert_comments(){
510
  //* INSERTION
511
  global $wpdb;
512
 
513
- $to_insert = 10;
514
  $time = current_time('timestamp')-(730*86400);
515
 
516
  $result = $wpdb->get_results("SELECT network FROM `".$wpdb->base_prefix."cleantalk_sfw` LIMIT $to_insert;", ARRAY_A);
@@ -604,6 +611,7 @@ function ct_ajax_delete_all(){
604
  }
605
 
606
  function ct_ajax_clear_comments(){
 
607
  check_ajax_referer( 'ct_secret_nonce', 'security' );
608
  global $wpdb;
609
  $wpdb->query("delete from $wpdb->commentmeta where meta_key='ct_checked' or meta_key='ct_marked_as_spam' or meta_key='ct_bad';");
11
 
12
  function ct_add_comments_menu(){
13
  if(current_user_can('activate_plugins'))
14
+ add_comments_page( __("Check for spam", 'cleantalk'), __("Find spam comments", 'cleantalk'), 'read', 'ct_check_spam', 'ct_show_checkspam_page');
15
  }
16
 
17
  function ct_show_checkspam_page(){
54
  <!-- Check options -->
55
  <div class="ct_to_hide" id="ct_check_params_wrapper">
56
  <button class="button ct_check_params_elem" id="ct_check_spam_button"><?php _e("Start check", 'cleantalk'); ?></button>
57
+ <?php if(!empty($_COOKIE['ct_paused_comments_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk'); ?></button><?php } ?>
58
  <p class="ct_check_params_desc"><?php _e("The plugin will check all comments against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
59
  <br />
60
  <div class="ct_check_params_elem ct_check_params_elem_sub">
66
  <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
67
  </div>
68
  <div class="ct_check_params_desc">
69
+ <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo isset($_GET['from']) ? $_GET['from'] : ''; ?>" disabled readonly />
70
+ <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo isset($_GET['till']) ? $_GET['till'] : ''; ?>" disabled readonly />
71
  </div>
72
  </div>
73
 
82
  <?php _e("Please wait! CleanTalk is checking all approved and pending comments via blacklist database at cleantalk.org. You will have option to delete found spam comments after plugin finish.", 'cleantalk'); ?>
83
  </div>
84
 
85
+ <!-- Pause button -->
86
+ <button class="button" id="ct_pause">Pause check</button>
87
+
88
  <?php
89
 
90
  // Pagination
471
 
472
  $return = array(
473
  'message' => '',
474
+ 'total' => $cnt,
475
+ 'spam' => $cnt_spam,
476
+ 'checked' => $cnt_checked,
477
+ 'bad' => $cnt_bad,
478
  );
479
 
480
  $return['message'] .= sprintf (__("Total comments %s. Checked %s. Found %s spam comments. %s bad comments (without IP or email).", 'cleantalk'), $cnt, $cnt_checked, $cnt_spam, $cnt_bad);
517
  //* INSERTION
518
  global $wpdb;
519
 
520
+ $to_insert = 100;
521
  $time = current_time('timestamp')-(730*86400);
522
 
523
  $result = $wpdb->get_results("SELECT network FROM `".$wpdb->base_prefix."cleantalk_sfw` LIMIT $to_insert;", ARRAY_A);
611
  }
612
 
613
  function ct_ajax_clear_comments(){
614
+
615
  check_ajax_referer( 'ct_secret_nonce', 'security' );
616
  global $wpdb;
617
  $wpdb->query("delete from $wpdb->commentmeta where meta_key='ct_checked' or meta_key='ct_marked_as_spam' or meta_key='ct_bad';");
inc/cleantalk-public.php CHANGED
@@ -704,86 +704,91 @@ function ct_add_hidden_fields($random_key = false, $field_name = 'ct_checkjs', $
704
  function ct_add_mouse_tracking($return_string = false){
705
 
706
  $js_script = '<script type="text/javascript">
707
- function ctSetCookie(c_name, value) {
708
- document.cookie = c_name + "=" + encodeURIComponent(value) + "; path=/";
709
- }
 
 
 
 
 
 
710
 
711
- ctSetCookie("ct_ps_timestamp", Math.floor(new Date().getTime()/1000));
712
- ctSetCookie("ct_fkp_timestamp", "0");
713
- ctSetCookie("ct_pointer_data", "0");
714
- ctSetCookie("ct_timezone", "0");
715
 
716
- setTimeout(function(){
717
- ctSetCookie("ct_timezone", d.getTimezoneOffset()/60*(-1));
718
- },1000);
719
 
720
- //Stop observing function
721
- function ctMouseStopData(){
722
- if(typeof window.addEventListener == "function")
723
- window.removeEventListener("mousemove", ctFunctionMouseMove);
724
- else
725
- window.detachEvent("onmousemove", ctFunctionMouseMove);
726
- clearInterval(ctMouseReadInterval);
727
- clearInterval(ctMouseWriteDataInterval);
728
- }
729
-
730
- //Stop key listening function
731
- function ctKeyStopStopListening(){
732
- if(typeof window.addEventListener == "function"){
733
- window.removeEventListener("mousedown", ctFunctionFirstKey);
734
- window.removeEventListener("keydown", ctFunctionFirstKey);
735
- }else{
736
- window.detachEvent("mousedown", ctFunctionFirstKey);
737
- window.detachEvent("keydown", ctFunctionFirstKey);
738
  }
739
- clearInterval(ctMouseReadInterval);
740
- clearInterval(ctMouseWriteDataInterval);
741
- }
742
 
743
- var d = new Date(),
744
- ctTimeMs = new Date().getTime(),
745
- ctMouseEventTimerFlag = true, //Reading interval flag
746
- ctMouseData = "[",
747
- ctMouseDataCounter = 0;
748
-
749
- //Reading interval
750
- var ctMouseReadInterval = setInterval(function(){
751
  ctMouseEventTimerFlag = true;
752
- }, 300);
753
-
754
- //Writting interval
755
- var ctMouseWriteDataInterval = setInterval(function(){
756
- var ctMouseDataToSend = ctMouseData.slice(0,-1).concat("]");
757
- ctSetCookie("ct_pointer_data", ctMouseDataToSend);
758
- }, 3000);
759
-
760
- //Logging mouse position each 300 ms
761
- var ctFunctionMouseMove = function output(event){
762
- if(ctMouseEventTimerFlag == true){
763
- var mouseDate = new Date();
764
- ctMouseData += "[" + event.pageY + "," + event.pageX + "," + (mouseDate.getTime() - ctTimeMs) + "],";
765
- ctMouseDataCounter++;
766
- ctMouseEventTimerFlag = false;
767
- if(ctMouseDataCounter >= 100)
768
- ctMouseStopData();
 
 
 
 
 
 
769
  }
770
- }
771
- //Writing first key press timestamp
772
- var ctFunctionFirstKey = function output(event){
773
- var KeyTimestamp = Math.floor(new Date().getTime()/1000);
774
- ctSetCookie("ct_fkp_timestamp", KeyTimestamp);
775
- ctKeyStopStopListening();
776
- }
777
 
778
- if(typeof window.addEventListener == "function"){
779
- window.addEventListener("mousemove", ctFunctionMouseMove);
780
- window.addEventListener("mousedown", ctFunctionFirstKey);
781
- window.addEventListener("keydown", ctFunctionFirstKey);
782
- }else{
783
- window.attachEvent("onmousemove", ctFunctionMouseMove);
784
- window.attachEvent("mousedown", ctFunctionFirstKey);
785
- window.attachEvent("keydown", ctFunctionFirstKey);
786
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
787
  </script>';
788
 
789
  if($return_string)
704
  function ct_add_mouse_tracking($return_string = false){
705
 
706
  $js_script = '<script type="text/javascript">
707
+ var ct_date = new Date(),
708
+ ctTimeMs = new Date().getTime(),
709
+ ctMouseEventTimerFlag = true, //Reading interval flag
710
+ ctMouseData = [],
711
+ ctMouseDataCounter = 0;
712
+
713
+ function ctSetCookieSec(c_name, value) {
714
+ document.cookie = c_name + "=" + encodeURIComponent(value) + "; path=/";
715
+ }
716
 
717
+ ctSetCookieSec("ct_ps_timestamp", Math.floor(new Date().getTime()/1000));
718
+ ctSetCookieSec("ct_fkp_timestamp", "0");
719
+ ctSetCookieSec("ct_pointer_data", "0");
720
+ ctSetCookieSec("ct_timezone", "0");
721
 
722
+ setTimeout(function(){
723
+ ctSetCookieSec("ct_timezone", ct_date.getTimezoneOffset()/60*(-1));
724
+ },1000);
725
 
726
+ //Writing first key press timestamp
727
+ var ctFunctionFirstKey = function output(event){
728
+ var KeyTimestamp = Math.floor(new Date().getTime()/1000);
729
+ ctSetCookieSec("ct_fkp_timestamp", KeyTimestamp);
730
+ ctKeyStopStopListening();
 
 
 
 
 
 
 
 
 
 
 
 
 
731
  }
 
 
 
732
 
733
+ //Reading interval
734
+ var ctMouseReadInterval = setInterval(function(){
 
 
 
 
 
 
735
  ctMouseEventTimerFlag = true;
736
+ }, 150);
737
+
738
+ //Writting interval
739
+ var ctMouseWriteDataInterval = setInterval(function(){
740
+ ctSetCookieSec("ct_pointer_data", JSON.stringify(ctMouseData));
741
+ }, 1200);
742
+
743
+ //Logging mouse position each 150 ms
744
+ var ctFunctionMouseMove = function output(event){
745
+ if(ctMouseEventTimerFlag == true){
746
+
747
+ ctMouseData.push([
748
+ Math.round(event.pageY),
749
+ Math.round(event.pageX),
750
+ Math.round(new Date().getTime() - ctTimeMs)
751
+ ]);
752
+
753
+ ctMouseDataCounter++;
754
+ ctMouseEventTimerFlag = false;
755
+ if(ctMouseDataCounter >= 100){
756
+ ctMouseStopData();
757
+ }
758
+ }
759
  }
 
 
 
 
 
 
 
760
 
761
+ //Stop mouse observing function
762
+ function ctMouseStopData(){
763
+ if(typeof window.addEventListener == "function"){
764
+ window.removeEventListener("mousemove", ctFunctionMouseMove);
765
+ }else{
766
+ window.detachEvent("onmousemove", ctFunctionMouseMove);
767
+ }
768
+ clearInterval(ctMouseReadInterval);
769
+ clearInterval(ctMouseWriteDataInterval);
770
+ }
771
+
772
+ //Stop key listening function
773
+ function ctKeyStopStopListening(){
774
+ if(typeof window.addEventListener == "function"){
775
+ window.removeEventListener("mousedown", ctFunctionFirstKey);
776
+ window.removeEventListener("keydown", ctFunctionFirstKey);
777
+ }else{
778
+ window.detachEvent("mousedown", ctFunctionFirstKey);
779
+ window.detachEvent("keydown", ctFunctionFirstKey);
780
+ }
781
+ }
782
+
783
+ if(typeof window.addEventListener == "function"){
784
+ window.addEventListener("mousemove", ctFunctionMouseMove);
785
+ window.addEventListener("mousedown", ctFunctionFirstKey);
786
+ window.addEventListener("keydown", ctFunctionFirstKey);
787
+ }else{
788
+ window.attachEvent("onmousemove", ctFunctionMouseMove);
789
+ window.attachEvent("mousedown", ctFunctionFirstKey);
790
+ window.attachEvent("keydown", ctFunctionFirstKey);
791
+ }
792
  </script>';
793
 
794
  if($return_string)
inc/cleantalk-users.php CHANGED
@@ -12,7 +12,7 @@ add_action( 'wp_ajax_ajax_ct_get_csv_file', 'ct_usercheck_get_csv_file' );
12
 
13
  function ct_add_users_menu(){
14
  if(current_user_can('activate_plugins'))
15
- add_users_page( __("Check for spam", 'cleantalk'), __("Check for spam", 'cleantalk'), 'read', 'ct_check_users', 'ct_show_users_page');
16
  }
17
 
18
  function ct_show_users_page(){
@@ -54,6 +54,7 @@ function ct_show_users_page(){
54
  <!-- Check options -->
55
  <div class="ct_to_hide" id="ct_check_params_wrapper">
56
  <button class="button ct_check_params_elem" id="ct_check_spam_button"><?php _e("Start check", 'cleantalk'); ?></button>
 
57
  <p class="ct_check_params_desc"><?php _e("The plugin will check all comments against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
58
  <br />
59
  <div class="ct_check_params_elem ct_check_params_elem_sub">
@@ -65,8 +66,8 @@ function ct_show_users_page(){
65
  <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
66
  </div>
67
  <div class="ct_check_params_desc">
68
- <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo isset($_GET['from']) ? $_GET['from'] : ''; ?>" readonly />
69
- <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo isset($_GET['till']) ? $_GET['till'] : ''; ?>" readonly />
70
  </div>
71
  </div>
72
 
@@ -81,6 +82,9 @@ function ct_show_users_page(){
81
  <?php _e("Please wait for a while. CleanTalk is checking all users via blacklist database at cleantalk.org. You will have option to delete found spam users after plugin finish.", 'cleantalk'); ?>
82
  </div>
83
 
 
 
 
84
  <?php
85
 
86
  // Pagination
@@ -177,8 +181,6 @@ function ct_show_users_page(){
177
  echo "No IP adress";
178
  echo "</td>";
179
  ?>
180
-
181
-
182
  <td class="comment column-comment">
183
  <div class="submitted-on">
184
  <?php print $c_spam[$i]->data->display_name; ?>
@@ -506,7 +508,10 @@ function ct_ajax_info_users($direct_call = false)
506
 
507
  $return = array(
508
  'message' => '',
509
- 'total' => $cnt
 
 
 
510
  );
511
 
512
  $return['message'] .= sprintf (__("Total users %s, checked %s, found %s spam users and %s bad users (without IP or email)", 'cleantalk'), $cnt, $cnt_checked, $cnt_spam, $cnt_bad);
12
 
13
  function ct_add_users_menu(){
14
  if(current_user_can('activate_plugins'))
15
+ add_users_page( __("Check for spam", 'cleantalk'), __("Find spam users", 'cleantalk'), 'read', 'ct_check_users', 'ct_show_users_page');
16
  }
17
 
18
  function ct_show_users_page(){
54
  <!-- Check options -->
55
  <div class="ct_to_hide" id="ct_check_params_wrapper">
56
  <button class="button ct_check_params_elem" id="ct_check_spam_button"><?php _e("Start check", 'cleantalk'); ?></button>
57
+ <?php if(!empty($_COOKIE['ct_paused_users_check'])) { ?><button class="button ct_check_params_elem" id="ct_proceed_check_button"><?php _e("Continue check", 'cleantalk'); ?></button><?php } ?>
58
  <p class="ct_check_params_desc"><?php _e("The plugin will check all comments against blacklists database and show you senders that have spam activity on other websites.", 'cleantalk'); ?></p>
59
  <br />
60
  <div class="ct_check_params_elem ct_check_params_elem_sub">
66
  <input id="ct_allow_date_range" type="checkbox" value="1" /><label for="ct_allow_date_range"><b><?php _e("Specify date range", 'cleantalk'); ?></b></label>
67
  </div>
68
  <div class="ct_check_params_desc">
69
+ <input class="ct_date" type="text" id="ct_date_range_from" value="<?php echo isset($_GET['from']) ? $_GET['from'] : ''; ?>" disabled readonly />
70
+ <input class="ct_date" type="text" id="ct_date_range_till" value="<?php echo isset($_GET['till']) ? $_GET['till'] : ''; ?>" disabled readonly />
71
  </div>
72
  </div>
73
 
82
  <?php _e("Please wait for a while. CleanTalk is checking all users via blacklist database at cleantalk.org. You will have option to delete found spam users after plugin finish.", 'cleantalk'); ?>
83
  </div>
84
 
85
+ <!-- Pause button -->
86
+ <button class="button" id="ct_pause">Pause check</button>
87
+
88
  <?php
89
 
90
  // Pagination
181
  echo "No IP adress";
182
  echo "</td>";
183
  ?>
 
 
184
  <td class="comment column-comment">
185
  <div class="submitted-on">
186
  <?php print $c_spam[$i]->data->display_name; ?>
508
 
509
  $return = array(
510
  'message' => '',
511
+ 'total' => $cnt,
512
+ 'spam' => $cnt_spam,
513
+ 'checked' => $cnt_checked,
514
+ 'bad' => $cnt_bad,
515
  );
516
 
517
  $return['message'] .= sprintf (__("Total users %s, checked %s, found %s spam users and %s bad users (without IP or email)", 'cleantalk'), $cnt, $cnt_checked, $cnt_spam, $cnt_bad);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: znaeff, shagimuratov, serge00, sartemd174, amagsumov
3
  Tags: antispam, protection, contact form, comments, spam
4
  Requires at least: 3.0
5
  Tested up to: 4.8
6
- Stable tag: 5.74.2
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
@@ -506,6 +506,11 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
506
  1. The plugin deletes/removes the existing spam comments and users accounts.
507
 
508
  == Changelog ==
 
 
 
 
 
509
  = 5.74.2 September 2 2017 =
510
  * Fix for users spam check for PHP 5.3 and lower.
511
 
@@ -1428,6 +1433,11 @@ We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade
1428
  * First version
1429
 
1430
  == Upgrade Notice ==
 
 
 
 
 
1431
  = 5.74.2 September 2 2017 =
1432
  * Fix for users spam check for PHP 5.3 and lower.
1433
 
3
  Tags: antispam, protection, contact form, comments, spam
4
  Requires at least: 3.0
5
  Tested up to: 4.8
6
+ Stable tag: 5.75
7
  License: GPLv2
8
 
9
  Spam protection, antispam, all-in-one, premium plugin. No spam comments & users, no spam contact form & WooCommerce spam. Forget spam.
506
  1. The plugin deletes/removes the existing spam comments and users accounts.
507
 
508
  == Changelog ==
509
+ = 5.75 September 15 2017 =
510
+ * Pause feature for users/comments spam check.
511
+ * Improved protection from spam.
512
+ * Small fixes.
513
+
514
  = 5.74.2 September 2 2017 =
515
  * Fix for users spam check for PHP 5.3 and lower.
516
 
1433
  * First version
1434
 
1435
  == Upgrade Notice ==
1436
+ = 5.75 September 15 2017 =
1437
+ * Pause feature for users/comments spam check.
1438
+ * Improved protection from spam.
1439
+ * Small fixes.
1440
+
1441
  = 5.74.2 September 2 2017 =
1442
  * Fix for users spam check for PHP 5.3 and lower.
1443