Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.136

Version Description

April 1 2020 = * New: Feature allowing to track missed spam requests with the special plugin. * Mod: Enable WooCommerce checkout test by default. * Fix: Fluent forms integration fixed. * Fix: Logging skipped requests - actions added. * Fix: Comments output. * Fix: External forms protection. * Fix: PHP 7.4 compatibility. * Performance improved.

Download this release

Release Info

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

Code changes from version 5.135 to 5.136

cleantalk.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: https://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.135
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: https://cleantalk.org
9
  Text Domain: cleantalk
@@ -131,7 +131,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
131
 
132
  // Do update actions if version is changed
133
  apbct_update_actions();
134
-
135
  // Self cron
136
  if(!defined('DOING_CRON') || (defined('DOING_CRON') && DOING_CRON !== true)){
137
 
@@ -188,7 +188,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
188
 
189
  $apbct_active_integrations = array(
190
  'ContactBank' => array( 'hook' => 'contact_bank_frontend_ajax_call', 'ajax' => true ),
191
- 'FluentForm' => array( 'hook' => 'fluentform_validations', 'ajax' => false ),
192
  'ElfsightContactForm' => array( 'hook' => 'elfsight_contact_form_mail', 'ajax' => true )
193
  );
194
  new \Cleantalk\Antispam\Integrations( $apbct_active_integrations );
3
  Plugin Name: Anti-Spam by CleanTalk
4
  Plugin URI: https://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
+ Version: 5.136
7
  Author: СleanTalk <welcome@cleantalk.org>
8
  Author URI: https://cleantalk.org
9
  Text Domain: cleantalk
131
 
132
  // Do update actions if version is changed
133
  apbct_update_actions();
134
+
135
  // Self cron
136
  if(!defined('DOING_CRON') || (defined('DOING_CRON') && DOING_CRON !== true)){
137
 
188
 
189
  $apbct_active_integrations = array(
190
  'ContactBank' => array( 'hook' => 'contact_bank_frontend_ajax_call', 'ajax' => true ),
191
+ 'FluentForm' => array( 'hook' => 'fluentform_before_insert_submission', 'ajax' => false ),
192
  'ElfsightContactForm' => array( 'hook' => 'elfsight_contact_form_mail', 'ajax' => true )
193
  );
194
  new \Cleantalk\Antispam\Integrations( $apbct_active_integrations );
inc/cleantalk-admin.php CHANGED
@@ -433,7 +433,7 @@ function apbct_admin__notice_message(){
433
  if ($apbct->notice_show && $page_is_ct_settings && !$apbct->data['key_is_ok'] && $apbct->moderate_ip == 0 && !$apbct->white_label){
434
  echo '<div class="error">
435
  <h3><b>'.
436
- __("Wrong <a href='{$settings_link}'><b style=\"color: #49C73B;\">Clean</b><b style=\"color: #349ebf;\">Talk</b> access key</a>! Please check it or ask <a target=\"_blank\" href=\"https://cleantalk.org/forum/\">support</a>.", 'cleantalk').
437
  '</b></h3>
438
  </div>';
439
  }
433
  if ($apbct->notice_show && $page_is_ct_settings && !$apbct->data['key_is_ok'] && $apbct->moderate_ip == 0 && !$apbct->white_label){
434
  echo '<div class="error">
435
  <h3><b>'.
436
+ __("Wrong <a href='{$settings_link}'><b style=\"color: #49C73B;\">Clean</b><b style=\"color: #349ebf;\">Talk</b> access key</a>! Please check it or ask <a target=\"_blank\" href=\"https://wordpress.org/support/plugin/cleantalk-spam-protect/\">support</a>.", 'cleantalk').
437
  '</b></h3>
438
  </div>';
439
  }
inc/cleantalk-ajax.php CHANGED
@@ -297,6 +297,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
297
  'et_fb_get_shortcode_from_fb_object', //Skip generate shortcode
298
  'pp_lf_process_login', //Skip login form
299
  'check_email', //Ajax email checking
 
300
  );
301
 
302
  // Skip test if
@@ -318,6 +319,7 @@ function ct_ajax_hook($message_obj = false, $additional = false)
318
  (isset($_POST['action'], $_POST['arm_action']) && $_POST['action'] == 'arm_shortcode_form_ajax_action' && $_POST['arm_action'] == 'please-login') //arm forms skip login
319
  )
320
  {
 
321
  return false;
322
  }
323
 
@@ -403,21 +405,32 @@ function ct_ajax_hook($message_obj = false, $additional = false)
403
  }
404
 
405
  // Skip submission if no data found
406
- if ($sender_email === ''|| !$contact_form)
407
- return false;
 
 
 
408
 
409
  // Mailpoet fix
410
- if (isset($message['wysijaData'], $message['wysijaplugin'], $message['task'], $message['controller']) && $message['wysijaplugin'] == 'wysija-newsletters' && $message['controller'] == 'campaigns')
411
- return false;
 
 
 
412
  // Mailpoet3 admin skip fix
413
- if (isset($_POST['action'], $_POST['method']) && $_POST['action'] == 'mailpoet' && $_POST['method'] =='save')
 
414
  return false;
 
 
415
 
416
  // WP Foto Vote Fix
417
  if (!empty($_FILES)){
418
  foreach($message as $key => $value){
419
- if(strpos($key, 'oje') !== false)
420
- return;
 
 
421
  } unset($key ,$value);
422
  }
423
 
297
  'et_fb_get_shortcode_from_fb_object', //Skip generate shortcode
298
  'pp_lf_process_login', //Skip login form
299
  'check_email', //Ajax email checking
300
+ 'dflg_do_sign_in_user', // Unknown plugin
301
  );
302
 
303
  // Skip test if
319
  (isset($_POST['action'], $_POST['arm_action']) && $_POST['action'] == 'arm_shortcode_form_ajax_action' && $_POST['arm_action'] == 'please-login') //arm forms skip login
320
  )
321
  {
322
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
323
  return false;
324
  }
325
 
405
  }
406
 
407
  // Skip submission if no data found
408
+ if ($sender_email === ''|| !$contact_form) {
409
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
410
+ return false;
411
+ }
412
+
413
 
414
  // Mailpoet fix
415
+ if (isset($message['wysijaData'], $message['wysijaplugin'], $message['task'], $message['controller']) && $message['wysijaplugin'] == 'wysija-newsletters' && $message['controller'] == 'campaigns') {
416
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
417
+ return false;
418
+ }
419
+
420
  // Mailpoet3 admin skip fix
421
+ if (isset($_POST['action'], $_POST['method']) && $_POST['action'] == 'mailpoet' && $_POST['method'] =='save') {
422
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
423
  return false;
424
+ }
425
+
426
 
427
  // WP Foto Vote Fix
428
  if (!empty($_FILES)){
429
  foreach($message as $key => $value){
430
+ if(strpos($key, 'oje') !== false) {
431
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
432
+ return false;
433
+ }
434
  } unset($key ,$value);
435
  }
436
 
inc/cleantalk-common.php CHANGED
@@ -79,11 +79,11 @@ function apbct_plugin_loaded() {
79
  * @return array array('ct'=> Cleantalk, 'ct_result' => CleantalkResponse)
80
  */
81
  function apbct_base_call($params = array(), $reg_flag = false){
82
-
83
  global $apbct, $cleantalk_executed;
84
-
85
  $cleantalk_executed = true;
86
-
87
  $sender_info = !empty($params['sender_info'])
88
  ? CleantalkHelper::array_merge__save_numeric_keys__recursive(apbct_get_sender_info(), (array)$params['sender_info'])
89
  : apbct_get_sender_info();
79
  * @return array array('ct'=> Cleantalk, 'ct_result' => CleantalkResponse)
80
  */
81
  function apbct_base_call($params = array(), $reg_flag = false){
82
+
83
  global $apbct, $cleantalk_executed;
84
+
85
  $cleantalk_executed = true;
86
+
87
  $sender_info = !empty($params['sender_info'])
88
  ? CleantalkHelper::array_merge__save_numeric_keys__recursive(apbct_get_sender_info(), (array)$params['sender_info'])
89
  : apbct_get_sender_info();
inc/cleantalk-public.php CHANGED
@@ -36,10 +36,21 @@ function apbct_init() {
36
  if($apbct->settings['check_external']){
37
 
38
  // Fixing form and directs it this site
39
- if($apbct->settings['check_external__capture_buffer'] && !is_admin() && !apbct_is_ajax() && apbct_is_user_enable() && !(defined('DOING_CRON') && DOING_CRON) && !(defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)){
40
- add_action('wp', 'apbct_buffer__start');
41
- add_action('shutdown', 'apbct_buffer__end', 0);
42
- add_action('shutdown', 'apbct_buffer__output', 2);
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
 
45
  // Check and redirecct
@@ -326,7 +337,7 @@ function apbct_buffer__end(){
326
  */
327
  function apbct_buffer__output(){
328
 
329
- global $apbct;
330
 
331
  if(empty($apbct->buffer))
332
  return;
@@ -352,7 +363,7 @@ function apbct_buffer__output(){
352
  $method = $method ? $method : 'get';
353
  // Directs form to our site
354
  $form->setAttribute('method', 'POST');
355
- $form->setAttribute('action', $site_url);
356
 
357
  // Add cleantalk_hidden_action
358
  $new_input = $dom->createElement('input');
@@ -369,16 +380,20 @@ function apbct_buffer__output(){
369
  $form->appendChild($new_input);
370
 
371
  }
 
372
  } unset($form);
373
 
374
  $html = $dom->getElementsByTagName('html');
 
 
 
 
 
 
 
 
375
 
376
- echo gettype($html) == 'object' && !isset( $html[0], $html[0]->childNodes, $html[0]->childNodes[0] )
377
- ? $html[0]
378
- ->childNodes[0]
379
- ->ownerDocument
380
- ->saveHTML()
381
- : $apbct->buffer;
382
  }
383
 
384
  // MailChimp Premium for Wordpress
@@ -420,11 +435,17 @@ function ct_validate_ccf_submission($value, $field_id, $required){
420
 
421
 
422
  //If the check for contact forms enabled
423
- if(!$apbct->settings['contact_forms_test'])
424
- return true;
 
 
 
425
  //If the check for logged in users enabled
426
- if($apbct->settings['protect_logged_in'] == 1 && is_user_logged_in())
427
- return true;
 
 
 
428
 
429
  //Accumulate data
430
  $ct_global_temporary_data[] = $value;
@@ -432,8 +453,11 @@ function ct_validate_ccf_submission($value, $field_id, $required){
432
  //If it's the last field of the form
433
  (!isset($ct_global_temporary_data['count']) ? $ct_global_temporary_data['count'] = 1 : $ct_global_temporary_data['count']++);
434
  $form_id = $_POST['form_id'];
435
- if($ct_global_temporary_data['count'] != count(get_post_meta( $form_id, 'ccf_attached_fields', true )))
436
- return true;
 
 
 
437
  unset($ct_global_temporary_data['count']);
438
 
439
  //Getting request params
@@ -481,13 +505,19 @@ function ct_woocommerce_wishlist_check($args){
481
 
482
  //Protect logged in users
483
  if($args['wishlist_status'])
484
- if($apbct->settings['protect_logged_in'] == 0)
485
- return $args;
 
 
 
486
 
487
  //If the IP is a Google bot
488
  $hostname = gethostbyaddr( apbct_get_server_variable( 'REMOTE_ADDR' ) );
489
- if(!strpos($hostname, 'googlebot.com'))
490
- return $args;
 
 
 
491
 
492
  //Getting request params
493
  $message = '';
@@ -543,8 +573,11 @@ function apbct_integration__buddyPres__activityWall( $is_spam, $activity_obj = n
543
 
544
  global $apbct;
545
 
546
- if($activity_obj === null || $activity_obj->privacy == 'media' || !isset($_POST['action']) || $_POST['action'] && $_POST['action'] !== 'post_update')
547
- return;
 
 
 
548
 
549
  $curr_user = get_user_by('id', $activity_obj->user_id);
550
 
@@ -601,15 +634,18 @@ function apbct_integration__buddyPres__activityWall_showResponse( $activity_obj
601
  *
602
  * @global SpbcState $apbct
603
  * @param type $bp_message_obj
604
- * @return array with errors if spam has found
605
  */
606
  function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
607
 
608
  global $apbct;
609
 
610
  //Check for enabled option
611
- if($apbct->settings['bp_private_messages'] == 0)
612
- return;
 
 
 
613
 
614
  //Check for quantity of comments
615
  $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER')
@@ -636,8 +672,11 @@ function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
636
  $is_max_comments = true;
637
  }
638
 
639
- if(!empty($is_max_comments))
640
- return;
 
 
 
641
 
642
  $sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
643
 
@@ -695,6 +734,7 @@ function apbct_forms__search__testSpam( $search ){
695
  $apbct->settings['search_test'] == 0 ||
696
  $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
697
  ){
 
698
  return $search;
699
  }
700
 
@@ -792,8 +832,11 @@ function apbct_form__piratesForm__testSpam(){
792
  global $apbct;
793
 
794
  //Check for enabled option
795
- if( !$apbct->settings['contact_forms_test'])
796
- return;
 
 
 
797
 
798
  //Getting request params
799
  $ct_temp_msg_data = ct_get_fields_any($_POST);
@@ -986,11 +1029,13 @@ function apbct_rorm__formidable__testSpam ( $errors, $form ) {
986
  global $apbct;
987
 
988
  if ( !$apbct->settings['contact_forms_test']) {
 
989
  return $errors;
990
  }
991
 
992
  // Skip processing for logged in users.
993
  if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in()) {
 
994
  return $errors;
995
  }
996
 
@@ -1054,13 +1099,17 @@ function ct_bbp_new_pre_content ($comment) {
1054
  global $apbct, $current_user;
1055
 
1056
  if ( !$apbct->settings['comments_test']) {
 
1057
  return $comment;
1058
  }
1059
 
1060
  // Skip processing for logged in users and admin.
1061
  if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in() ||
1062
- in_array("administrator", $current_user->roles))
 
1063
  return $comment;
 
 
1064
 
1065
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
1066
  ? apbct_js_test('ct_checkjs', $_COOKIE)
@@ -1184,8 +1233,11 @@ function ct_preprocess_comment($comment) {
1184
  }
1185
 
1186
  // Skip processing admin.
1187
- if (in_array("administrator", $current_user->roles))
1188
- return $comment;
 
 
 
1189
 
1190
  $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? CLEANTALK_CHECK_COMMENTS_NUMBER : 3;
1191
 
@@ -1212,6 +1264,7 @@ function ct_preprocess_comment($comment) {
1212
  )
1213
  )
1214
  {
 
1215
  return $comment;
1216
  }
1217
 
@@ -1226,6 +1279,7 @@ function ct_preprocess_comment($comment) {
1226
 
1227
  // Go out if author in local blacklists
1228
  if ($comment['comment_type']!='trackback' && $local_blacklists === true) {
 
1229
  return $comment;
1230
  }
1231
 
@@ -1444,7 +1498,9 @@ function apbct_comment__Wordpress__changeMailNotification($notify_message, $comm
1444
  * @param type $comment_status
1445
  */
1446
  function ct_die($comment_id, $comment_status) {
 
1447
  global $ct_comment;
 
1448
  $err_text = '<center>' . ((defined('CLEANTALK_DISABLE_BLOCKING_TITLE') && CLEANTALK_DISABLE_BLOCKING_TITLE == true) ? '' : '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ') . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
1449
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1450
  if(isset($_POST['et_pb_contact_email']))
@@ -1463,6 +1519,7 @@ function ct_die($comment_id, $comment_status) {
1463
  * @param type $comment_body
1464
  */
1465
  function ct_die_extended($comment_body) {
 
1466
  $err_text = '<center>' . ((defined('CLEANTALK_DISABLE_BLOCKING_TITLE') && CLEANTALK_DISABLE_BLOCKING_TITLE == true) ? '' : '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ') . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $comment_body;
1467
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1468
  wp_die($err_text, 'Blacklisted', array('response' => 200, 'back_link' => true));
@@ -1800,16 +1857,19 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
1800
 
1801
  // Go out if a registrered user action
1802
  if (apbct_is_user_enable() === false) {
 
1803
  return $errors;
1804
  }
1805
 
1806
  if ($apbct->settings['registrations_test'] == 0) {
 
1807
  return $errors;
1808
  }
1809
 
1810
  // The function already executed
1811
  // It happens when used ct_register_post();
1812
  if ($ct_signup_done && is_object($errors) && count($errors->errors) > 0) {
 
1813
  return $errors;
1814
  }
1815
 
@@ -1841,6 +1901,7 @@ function ct_registration_errors($errors, $sanitized_user_login = null, $user_ema
1841
  if ($ct_negative_comment) {
1842
  $bp->signup->errors['signup_username'] = $ct_negative_comment;
1843
  }
 
1844
  return $errors;
1845
  }
1846
 
@@ -1974,8 +2035,11 @@ function apbct_registration__UltimateMembers__check( $args ){
1974
 
1975
  global $apbct, $cleantalk_executed;
1976
 
1977
- if ($apbct->settings['registrations_test'] == 0)
1978
- return $args;
 
 
 
1979
 
1980
  $checkjs = apbct_js_test('ct_checkjs_register_form', $args);
1981
  $sender_info['post_checkjs_passed'] = $checkjs;
@@ -2082,6 +2146,7 @@ function ct_contact_form_is_spam($form) {
2082
  global $ct_checkjs_jpcf, $apbct;
2083
 
2084
  if ($apbct->settings['contact_forms_test'] == 0) {
 
2085
  return null;
2086
  }
2087
 
@@ -2129,6 +2194,7 @@ function ct_contact_form_is_spam_jetpack($is_spam,$form) {
2129
  global $ct_checkjs_jpcf, $apbct;
2130
 
2131
  if ($apbct->settings['contact_forms_test'] == 0) {
 
2132
  return null;
2133
  }
2134
 
@@ -2221,6 +2287,7 @@ function apbct_form__contactForm7__testSpam($param) {
2221
  apbct_exclusions_check__ip() ||
2222
  isset($apbct->cf7_checked)
2223
  ){
 
2224
  return $param;
2225
  }
2226
 
@@ -2338,6 +2405,7 @@ function apbct_form__ninjaForms__testSpam() {
2338
  || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2339
  || apbct_exclusions_check__url()
2340
  ){
 
2341
  return;
2342
  }
2343
 
@@ -2423,6 +2491,7 @@ function apbct_form__seedprod_coming_soon__testSpam() {
2423
  || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2424
  || apbct_exclusions_check__url()
2425
  ){
 
2426
  return;
2427
  }
2428
 
@@ -2574,6 +2643,7 @@ function apbct_form__WPForms__testSpam() {
2574
  $apbct->settings['contact_forms_test'] == 0 ||
2575
  $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
2576
  ){
 
2577
  return;
2578
  }
2579
 
@@ -2699,14 +2769,20 @@ function ct_si_contact_display_after_fields($string = '', $style = '', $form_err
2699
  function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
2700
  global $apbct, $cleantalk_executed;
2701
 
2702
- if (!empty($form_errors))
2703
- return $form_errors;
 
 
2704
 
2705
- if ($apbct->settings['contact_forms_test'] == 0)
2706
- return $form_errors;
 
 
 
2707
 
2708
  // Skip processing because data already processed.
2709
  if ($cleantalk_executed) {
 
2710
  return $form_errors;
2711
  }
2712
 
@@ -2774,8 +2850,10 @@ function ct_check_wplp(){
2774
 
2775
  if (!isset($_COOKIE[$ct_wplp_result_label])) {
2776
  // First AJAX submit of WPLP form
2777
- if ($apbct->settings['contact_forms_test'] == 0)
2778
- return;
 
 
2779
 
2780
  $post_info['comment_type'] = 'feedback';
2781
  $post_info = json_encode($post_info);
@@ -2861,8 +2939,10 @@ function apbct_form__gravityForms__testSpam($is_spam, $form, $entry) {
2861
  $apbct->settings['contact_forms_test'] == 0 ||
2862
  $is_spam ||
2863
  $cleantalk_executed // Return unchanged result if the submission was already tested.
2864
- )
2865
- return $is_spam;
 
 
2866
 
2867
  $ct_temp = array();
2868
  foreach($entry as $key => $value){
@@ -2931,6 +3011,7 @@ function ct_s2member_registration_test($post_key) {
2931
  global $apbct;
2932
 
2933
  if ($apbct->settings['registrations_test'] == 0) {
 
2934
  return null;
2935
  }
2936
 
@@ -2975,6 +3056,7 @@ function apbct_form__the7_contact_form() {
2975
 
2976
  // Skip submission if no data found
2977
  if ($sender_email === ''|| !$contact_form) {
 
2978
  return false;
2979
  }
2980
  $cleantalk_executed = true;
@@ -3021,6 +3103,7 @@ function apbct_form__elementor_pro__testSpam() {
3021
  || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
3022
  || apbct_exclusions_check__url()
3023
  ){
 
3024
  return;
3025
  }
3026
 
@@ -3071,6 +3154,7 @@ function apbct_form__inevio__testSpam() {
3071
  ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) || // Skip processing for logged in users.
3072
  apbct_exclusions_check__url()
3073
  ) {
 
3074
  return false;
3075
  }
3076
  $form_data = array();
@@ -3110,8 +3194,10 @@ function ct_contact_form_validate() {
3110
  global $pagenow,$cleantalk_executed ,$apbct, $ct_checkjs_frm;
3111
 
3112
  // Exclusios common function
3113
- if ( apbct_exclusions_check(__FUNCTION__) )
3114
- return null;
 
 
3115
 
3116
  if (@sizeof($_POST)==0 ||
3117
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
@@ -3183,16 +3269,20 @@ function ct_contact_form_validate() {
3183
  apbct_is_in_uri('login-1') || //Skip login form
3184
  apbct_is_in_uri('recuperacao-de-senha-2') //Skip form reset password
3185
  ) {
 
3186
  return null;
3187
  }
3188
 
3189
  //Skip woocommerce checkout
3190
  if (apbct_is_in_uri('wc-ajax=update_order_review') || apbct_is_in_uri('wc-ajax=checkout') || !empty($_POST['woocommerce_checkout_place_order']) || apbct_is_in_uri('wc-ajax=wc_ppec_start_checkout') || apbct_is_in_referer('wc-ajax=update_order_review')) {
 
3191
  return null;
3192
  }
3193
  // Do not execute anti-spam test for logged in users.
3194
- if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1)
 
3195
  return null;
 
3196
 
3197
  $post_info['comment_type'] = 'feedback_general_contact_form';
3198
 
@@ -3209,6 +3299,7 @@ function ct_contact_form_validate() {
3209
 
3210
  // Skip submission if no data found
3211
  if ($sender_email === ''|| !$contact_form) {
 
3212
  return false;
3213
  }
3214
  $cleantalk_executed=true;
@@ -3321,8 +3412,10 @@ function ct_contact_form_validate_postdata() {
3321
  global $apbct, $pagenow,$cleantalk_executed;
3322
 
3323
  // Exclusios common function
3324
- if ( apbct_exclusions_check(__FUNCTION__) )
3325
- return null;
 
 
3326
 
3327
  if (@sizeof($_POST)==0 ||
3328
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
@@ -3370,14 +3463,18 @@ function ct_contact_form_validate_postdata() {
3370
  (isset($_POST['lrm_action']) && $_POST['lrm_action'] == 'login') || //Skip login form
3371
  apbct_is_in_uri( 'xmlrpc.php?for=jetpack' )
3372
  ) {
 
3373
  return null;
3374
  }
3375
 
3376
  $message = ct_get_fields_any_postdata($_POST);
3377
 
3378
  // ???
3379
- if(strlen(json_encode($message))<10)
3380
- return null;
 
 
 
3381
 
3382
  // Skip if request contains params
3383
  $skip_params = array(
@@ -3386,8 +3483,10 @@ function ct_contact_form_validate_postdata() {
3386
  'payment_status', // PayPal payment status
3387
  );
3388
  foreach($skip_params as $key=>$value){
3389
- if(@array_key_exists($value,$_GET)||@array_key_exists($value,$_POST))
3390
- return null;
 
 
3391
  }
3392
 
3393
  $base_call_result = apbct_base_call(
@@ -3637,8 +3736,10 @@ function ct_comments_output($curr_comment, $param2, $wp_list_comments_args){
3637
 
3638
  echo "</div>";
3639
 
 
 
3640
  // Ending comment output
3641
- echo "</{$wp_list_comments_args['style']}>";
3642
  }
3643
 
3644
  /**
36
  if($apbct->settings['check_external']){
37
 
38
  // Fixing form and directs it this site
39
+ if($apbct->settings['check_external__capture_buffer'] && !is_admin() && !apbct_is_ajax() && !apbct_is_post() && apbct_is_user_enable() && !(defined('DOING_CRON') && DOING_CRON) && !(defined('XMLRPC_REQUEST') && XMLRPC_REQUEST)){
40
+ $catch_buffer = defined('CLEANTALK_CAPTURE_BUFFER_SPECIFIC_URL') ? false : true;
41
+
42
+ if (defined('CLEANTALK_CAPTURE_BUFFER_SPECIFIC_URL') && is_string(CLEANTALK_CAPTURE_BUFFER_SPECIFIC_URL)) {
43
+ $urls = explode(',', CLEANTALK_CAPTURE_BUFFER_SPECIFIC_URL);
44
+ foreach ($urls as $url) {
45
+ if (apbct_is_in_uri($url))
46
+ $catch_buffer = true;
47
+ }
48
+ }
49
+ if ($catch_buffer) {
50
+ add_action('wp', 'apbct_buffer__start');
51
+ add_action('shutdown', 'apbct_buffer__end', 0);
52
+ add_action('shutdown', 'apbct_buffer__output', 2);
53
+ }
54
  }
55
 
56
  // Check and redirecct
337
  */
338
  function apbct_buffer__output(){
339
 
340
+ global $apbct, $wp;
341
 
342
  if(empty($apbct->buffer))
343
  return;
363
  $method = $method ? $method : 'get';
364
  // Directs form to our site
365
  $form->setAttribute('method', 'POST');
366
+ $form->setAttribute('action', home_url(add_query_arg(array(), $wp->request)));
367
 
368
  // Add cleantalk_hidden_action
369
  $new_input = $dom->createElement('input');
380
  $form->appendChild($new_input);
381
 
382
  }
383
+
384
  } unset($form);
385
 
386
  $html = $dom->getElementsByTagName('html');
387
+
388
+ $output = '';
389
+
390
+ if (gettype($html) == 'object' && isset($html[0], $html[0]->childNodes, $html[0]->childNodes[0])) {
391
+ foreach ($html[0]->childNodes as $node)
392
+ $output .= $html[0]->ownerDocument->saveHTML($node);
393
+ } else
394
+ $output = $apbct->buffer;
395
 
396
+ echo $output;
 
 
 
 
 
397
  }
398
 
399
  // MailChimp Premium for Wordpress
435
 
436
 
437
  //If the check for contact forms enabled
438
+ if(!$apbct->settings['contact_forms_test']) {
439
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
440
+ return true;
441
+ }
442
+
443
  //If the check for logged in users enabled
444
+ if($apbct->settings['protect_logged_in'] == 1 && is_user_logged_in()) {
445
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
446
+ return true;
447
+ }
448
+
449
 
450
  //Accumulate data
451
  $ct_global_temporary_data[] = $value;
453
  //If it's the last field of the form
454
  (!isset($ct_global_temporary_data['count']) ? $ct_global_temporary_data['count'] = 1 : $ct_global_temporary_data['count']++);
455
  $form_id = $_POST['form_id'];
456
+ if($ct_global_temporary_data['count'] != count(get_post_meta( $form_id, 'ccf_attached_fields', true ))) {
457
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
458
+ return true;
459
+ }
460
+
461
  unset($ct_global_temporary_data['count']);
462
 
463
  //Getting request params
505
 
506
  //Protect logged in users
507
  if($args['wishlist_status'])
508
+ if($apbct->settings['protect_logged_in'] == 0) {
509
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
510
+ return $args;
511
+ }
512
+
513
 
514
  //If the IP is a Google bot
515
  $hostname = gethostbyaddr( apbct_get_server_variable( 'REMOTE_ADDR' ) );
516
+ if(!strpos($hostname, 'googlebot.com')) {
517
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
518
+ return $args;
519
+ }
520
+
521
 
522
  //Getting request params
523
  $message = '';
573
 
574
  global $apbct;
575
 
576
+ if($activity_obj === null || $activity_obj->privacy == 'media' || !isset($_POST['action']) || $_POST['action'] && $_POST['action'] !== 'post_update') {
577
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
578
+ return false;
579
+ }
580
+
581
 
582
  $curr_user = get_user_by('id', $activity_obj->user_id);
583
 
634
  *
635
  * @global SpbcState $apbct
636
  * @param type $bp_message_obj
637
+ * @return void|array with errors if spam has found
638
  */
639
  function apbct_integration__buddyPres__private_msg_check( $bp_message_obj){
640
 
641
  global $apbct;
642
 
643
  //Check for enabled option
644
+ if($apbct->settings['bp_private_messages'] == 0) {
645
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
646
+ return;
647
+ }
648
+
649
 
650
  //Check for quantity of comments
651
  $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER')
672
  $is_max_comments = true;
673
  }
674
 
675
+ if(!empty($is_max_comments)) {
676
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
677
+ return;
678
+ }
679
+
680
 
681
  $sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
682
 
734
  $apbct->settings['search_test'] == 0 ||
735
  $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
736
  ){
737
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
738
  return $search;
739
  }
740
 
832
  global $apbct;
833
 
834
  //Check for enabled option
835
+ if( !$apbct->settings['contact_forms_test']) {
836
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
837
+ return;
838
+ }
839
+
840
 
841
  //Getting request params
842
  $ct_temp_msg_data = ct_get_fields_any($_POST);
1029
  global $apbct;
1030
 
1031
  if ( !$apbct->settings['contact_forms_test']) {
1032
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1033
  return $errors;
1034
  }
1035
 
1036
  // Skip processing for logged in users.
1037
  if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in()) {
1038
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1039
  return $errors;
1040
  }
1041
 
1099
  global $apbct, $current_user;
1100
 
1101
  if ( !$apbct->settings['comments_test']) {
1102
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1103
  return $comment;
1104
  }
1105
 
1106
  // Skip processing for logged in users and admin.
1107
  if ( !$apbct->settings['protect_logged_in'] && is_user_logged_in() ||
1108
+ in_array("administrator", $current_user->roles)) {
1109
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1110
  return $comment;
1111
+ }
1112
+
1113
 
1114
  $checkjs = apbct_js_test('ct_checkjs', $_COOKIE)
1115
  ? apbct_js_test('ct_checkjs', $_COOKIE)
1233
  }
1234
 
1235
  // Skip processing admin.
1236
+ if (in_array("administrator", $current_user->roles)){
1237
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1238
+ return $comment;
1239
+ }
1240
+
1241
 
1242
  $comments_check_number = defined('CLEANTALK_CHECK_COMMENTS_NUMBER') ? CLEANTALK_CHECK_COMMENTS_NUMBER : 3;
1243
 
1264
  )
1265
  )
1266
  {
1267
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1268
  return $comment;
1269
  }
1270
 
1279
 
1280
  // Go out if author in local blacklists
1281
  if ($comment['comment_type']!='trackback' && $local_blacklists === true) {
1282
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1283
  return $comment;
1284
  }
1285
 
1498
  * @param type $comment_status
1499
  */
1500
  function ct_die($comment_id, $comment_status) {
1501
+
1502
  global $ct_comment;
1503
+
1504
  $err_text = '<center>' . ((defined('CLEANTALK_DISABLE_BLOCKING_TITLE') && CLEANTALK_DISABLE_BLOCKING_TITLE == true) ? '' : '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ') . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $ct_comment;
1505
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1506
  if(isset($_POST['et_pb_contact_email']))
1519
  * @param type $comment_body
1520
  */
1521
  function ct_die_extended($comment_body) {
1522
+
1523
  $err_text = '<center>' . ((defined('CLEANTALK_DISABLE_BLOCKING_TITLE') && CLEANTALK_DISABLE_BLOCKING_TITLE == true) ? '' : '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ') . __('Spam protection', 'cleantalk') . "</center><br><br>\n" . $comment_body;
1524
  $err_text .= '<script>setTimeout("history.back()", 5000);</script>';
1525
  wp_die($err_text, 'Blacklisted', array('response' => 200, 'back_link' => true));
1857
 
1858
  // Go out if a registrered user action
1859
  if (apbct_is_user_enable() === false) {
1860
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1861
  return $errors;
1862
  }
1863
 
1864
  if ($apbct->settings['registrations_test'] == 0) {
1865
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1866
  return $errors;
1867
  }
1868
 
1869
  // The function already executed
1870
  // It happens when used ct_register_post();
1871
  if ($ct_signup_done && is_object($errors) && count($errors->errors) > 0) {
1872
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1873
  return $errors;
1874
  }
1875
 
1901
  if ($ct_negative_comment) {
1902
  $bp->signup->errors['signup_username'] = $ct_negative_comment;
1903
  }
1904
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
1905
  return $errors;
1906
  }
1907
 
2035
 
2036
  global $apbct, $cleantalk_executed;
2037
 
2038
+ if ($apbct->settings['registrations_test'] == 0) {
2039
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2040
+ return $args;
2041
+ }
2042
+
2043
 
2044
  $checkjs = apbct_js_test('ct_checkjs_register_form', $args);
2045
  $sender_info['post_checkjs_passed'] = $checkjs;
2146
  global $ct_checkjs_jpcf, $apbct;
2147
 
2148
  if ($apbct->settings['contact_forms_test'] == 0) {
2149
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2150
  return null;
2151
  }
2152
 
2194
  global $ct_checkjs_jpcf, $apbct;
2195
 
2196
  if ($apbct->settings['contact_forms_test'] == 0) {
2197
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2198
  return null;
2199
  }
2200
 
2287
  apbct_exclusions_check__ip() ||
2288
  isset($apbct->cf7_checked)
2289
  ){
2290
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2291
  return $param;
2292
  }
2293
 
2405
  || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2406
  || apbct_exclusions_check__url()
2407
  ){
2408
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2409
  return;
2410
  }
2411
 
2491
  || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
2492
  || apbct_exclusions_check__url()
2493
  ){
2494
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2495
  return;
2496
  }
2497
 
2643
  $apbct->settings['contact_forms_test'] == 0 ||
2644
  $apbct->settings['protect_logged_in'] != 1 && is_user_logged_in() // Skip processing for logged in users.
2645
  ){
2646
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2647
  return;
2648
  }
2649
 
2769
  function ct_si_contact_form_validate($form_errors = array(), $form_id_num = 0) {
2770
  global $apbct, $cleantalk_executed;
2771
 
2772
+ if (!empty($form_errors)) {
2773
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2774
+ return $form_errors;
2775
+ }
2776
 
2777
+
2778
+ if ($apbct->settings['contact_forms_test'] == 0) {
2779
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2780
+ return $form_errors;
2781
+ }
2782
 
2783
  // Skip processing because data already processed.
2784
  if ($cleantalk_executed) {
2785
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2786
  return $form_errors;
2787
  }
2788
 
2850
 
2851
  if (!isset($_COOKIE[$ct_wplp_result_label])) {
2852
  // First AJAX submit of WPLP form
2853
+ if ($apbct->settings['contact_forms_test'] == 0) {
2854
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2855
+ return;
2856
+ }
2857
 
2858
  $post_info['comment_type'] = 'feedback';
2859
  $post_info = json_encode($post_info);
2939
  $apbct->settings['contact_forms_test'] == 0 ||
2940
  $is_spam ||
2941
  $cleantalk_executed // Return unchanged result if the submission was already tested.
2942
+ ) {
2943
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
2944
+ return $is_spam;
2945
+ }
2946
 
2947
  $ct_temp = array();
2948
  foreach($entry as $key => $value){
3011
  global $apbct;
3012
 
3013
  if ($apbct->settings['registrations_test'] == 0) {
3014
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3015
  return null;
3016
  }
3017
 
3056
 
3057
  // Skip submission if no data found
3058
  if ($sender_email === ''|| !$contact_form) {
3059
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3060
  return false;
3061
  }
3062
  $cleantalk_executed = true;
3103
  || ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) // Skip processing for logged in users.
3104
  || apbct_exclusions_check__url()
3105
  ){
3106
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3107
  return;
3108
  }
3109
 
3154
  ($apbct->settings['protect_logged_in'] != 1 && is_user_logged_in()) || // Skip processing for logged in users.
3155
  apbct_exclusions_check__url()
3156
  ) {
3157
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3158
  return false;
3159
  }
3160
  $form_data = array();
3194
  global $pagenow,$cleantalk_executed ,$apbct, $ct_checkjs_frm;
3195
 
3196
  // Exclusios common function
3197
+ if ( apbct_exclusions_check(__FUNCTION__) ) {
3198
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3199
+ return null;
3200
+ }
3201
 
3202
  if (@sizeof($_POST)==0 ||
3203
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3269
  apbct_is_in_uri('login-1') || //Skip login form
3270
  apbct_is_in_uri('recuperacao-de-senha-2') //Skip form reset password
3271
  ) {
3272
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3273
  return null;
3274
  }
3275
 
3276
  //Skip woocommerce checkout
3277
  if (apbct_is_in_uri('wc-ajax=update_order_review') || apbct_is_in_uri('wc-ajax=checkout') || !empty($_POST['woocommerce_checkout_place_order']) || apbct_is_in_uri('wc-ajax=wc_ppec_start_checkout') || apbct_is_in_referer('wc-ajax=update_order_review')) {
3278
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3279
  return null;
3280
  }
3281
  // Do not execute anti-spam test for logged in users.
3282
+ if (isset($_COOKIE[LOGGED_IN_COOKIE]) && $apbct->settings['protect_logged_in'] != 1) {
3283
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3284
  return null;
3285
+ }
3286
 
3287
  $post_info['comment_type'] = 'feedback_general_contact_form';
3288
 
3299
 
3300
  // Skip submission if no data found
3301
  if ($sender_email === ''|| !$contact_form) {
3302
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3303
  return false;
3304
  }
3305
  $cleantalk_executed=true;
3412
  global $apbct, $pagenow,$cleantalk_executed;
3413
 
3414
  // Exclusios common function
3415
+ if ( apbct_exclusions_check(__FUNCTION__) ) {
3416
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3417
+ return null;
3418
+ }
3419
 
3420
  if (@sizeof($_POST)==0 ||
3421
  (isset($_POST['signup_username']) && isset($_POST['signup_email']) && isset($_POST['signup_password'])) ||
3463
  (isset($_POST['lrm_action']) && $_POST['lrm_action'] == 'login') || //Skip login form
3464
  apbct_is_in_uri( 'xmlrpc.php?for=jetpack' )
3465
  ) {
3466
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3467
  return null;
3468
  }
3469
 
3470
  $message = ct_get_fields_any_postdata($_POST);
3471
 
3472
  // ???
3473
+ if(strlen(json_encode($message))<10) {
3474
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3475
+ return null;
3476
+ }
3477
+
3478
 
3479
  // Skip if request contains params
3480
  $skip_params = array(
3483
  'payment_status', // PayPal payment status
3484
  );
3485
  foreach($skip_params as $key=>$value){
3486
+ if(@array_key_exists($value,$_GET)||@array_key_exists($value,$_POST)) {
3487
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
3488
+ return null;
3489
+ }
3490
  }
3491
 
3492
  $base_call_result = apbct_base_call(
3736
 
3737
  echo "</div>";
3738
 
3739
+ $ending_tag = is_null($wp_list_comments_args['style']) ? 'div' : $wp_list_comments_args['style'];
3740
+
3741
  // Ending comment output
3742
+ echo "</{$ending_tag}>";
3743
  }
3744
 
3745
  /**
inc/cleantalk-settings.php CHANGED
@@ -922,21 +922,25 @@ function apbct_settings__field__apikey(){
922
  function apbct_settings__field__action_buttons(){
923
 
924
  global $apbct;
925
-
 
 
 
 
 
 
 
 
 
926
  echo '<div class="apbct_settings-field_wrapper">';
927
 
928
- if(apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok){
929
- echo '<div>'
930
- .'<a href="edit-comments.php?page=ct_check_spam" class="ct_support_link">' . __('Check comments for spam', 'cleantalk') . '</a>'
931
- .'&nbsp;&nbsp;'
932
- .'&nbsp;&nbsp;'
933
- .'<a href="users.php?page=ct_check_users" class="ct_support_link">' . __('Check users for spam', 'cleantalk') . '</a>'
934
- .'&nbsp;&nbsp;'
935
- .'&nbsp;&nbsp;'
936
- .'<a href="#" class="ct_support_link" onclick="apbct_show_hide_elem(\'apbct_statistics\')">' . __('Statistics & Reports', 'cleantalk') . '</a>'
937
- .'</div>';
938
-
939
  }
 
 
940
 
941
  echo '</div>';
942
  }
922
  function apbct_settings__field__action_buttons(){
923
 
924
  global $apbct;
925
+
926
+ $links = apply_filters(
927
+ 'apbct_settings_action_buttons',
928
+ array(
929
+ '<a href="edit-comments.php?page=ct_check_spam" class="ct_support_link">' . __('Check comments for spam', 'cleantalk') . '</a>',
930
+ '<a href="users.php?page=ct_check_users" class="ct_support_link">' . __('Check users for spam', 'cleantalk') . '</a>',
931
+ '<a href="#" class="ct_support_link" onclick="apbct_show_hide_elem(\'apbct_statistics\')">' . __('Statistics & Reports', 'cleantalk') . '</a>',
932
+ )
933
+ );
934
+
935
  echo '<div class="apbct_settings-field_wrapper">';
936
 
937
+ if( apbct_api_key__is_correct($apbct->api_key) && $apbct->key_is_ok ){
938
+ echo '<div>';
939
+ foreach( $links as $link ) {
940
+ echo $link . '&nbsp;&nbsp;&nbsp;&nbsp;';
 
 
 
 
 
 
 
941
  }
942
+ echo '</div>';
943
+ }
944
 
945
  echo '</div>';
946
  }
inc/sfw_die_page.html CHANGED
@@ -22,18 +22,27 @@
22
  }
23
  </style>
24
  <script>
25
- var reload_timeout = 1000;
26
  var ct_date = new Date;
 
27
  function set_spamFireWallCookie(cookie_name, cookie_value) {
28
  var date = new Date;
29
  date.setDate(date.getDate() + 30);
30
  document.cookie = cookie_name + '=' + escape(cookie_value) + '; path=/; domain={COOKIE_DOMAIN}; expires=' + date.toUTCString();
31
  return null;
32
  }
 
33
  function get_current_url() {
34
  document.write(window.location.href);
35
  return null;
36
  }
 
 
 
 
 
 
 
 
37
  </script>
38
  </head>
39
 
@@ -66,21 +75,9 @@
66
  <a href='https://cleantalk.org' target='_blank'>{CLEANTALK_TITLE}</a>
67
  </div>
68
  <script type='text/javascript'>
69
- document.getElementById('js_info').style.display = 'none';
70
- document.getElementById('js_passed').style.display = 'block';
71
-
72
- document.getElementById('curr_date').innerHTML = ct_date.toGMTString();
73
-
74
- if(location.search.search('debug=1') === -1){
75
- setTimeout(function(){
76
- window.location.href = window.location.origin + window.location.pathname + '?sfw=pass' + Math.round(ct_date.getTime()/1000);
77
- }, reload_timeout);
78
- }
79
-
80
- setTimeout(function(){
81
- set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_pass_key','{SFW_COOKIE}');
82
- set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_passed','1');
83
- }, 50);
84
  </script>
85
  {DEBUG}
86
  </body>
22
  }
23
  </style>
24
  <script>
 
25
  var ct_date = new Date;
26
+
27
  function set_spamFireWallCookie(cookie_name, cookie_value) {
28
  var date = new Date;
29
  date.setDate(date.getDate() + 30);
30
  document.cookie = cookie_name + '=' + escape(cookie_value) + '; path=/; domain={COOKIE_DOMAIN}; expires=' + date.toUTCString();
31
  return null;
32
  }
33
+
34
  function get_current_url() {
35
  document.write(window.location.href);
36
  return null;
37
  }
38
+
39
+ set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_pass_key','{SFW_COOKIE}');
40
+ set_spamFireWallCookie('{COOKIE_PREFIX}ct_sfw_passed','1');
41
+
42
+ if(location.search.search('debug=1') === -1){
43
+ window.location.href = window.location.origin + window.location.pathname + '?sfw=pass' + Math.round(ct_date.getTime()/1000);
44
+ window.stop();
45
+ }
46
  </script>
47
  </head>
48
 
75
  <a href='https://cleantalk.org' target='_blank'>{CLEANTALK_TITLE}</a>
76
  </div>
77
  <script type='text/javascript'>
78
+ document.getElementById('js_info').style.display = 'none';
79
+ document.getElementById('js_passed').style.display = 'block';
80
+ document.getElementById('curr_date').innerHTML = ct_date.toGMTString();
 
 
 
 
 
 
 
 
 
 
 
 
81
  </script>
82
  {DEBUG}
83
  </body>
js/apbct-public--alt.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["apbct-public--alt.js"],"names":["apbct_fingerprint","Fingerprint","canvas","ie_activex","hasher","apbct_md5","get","apbct_cookie__get","names","prefixes","cookie","split","document","forEach","item","i","arr","curr","trim","name","all","prefix","indexOf","apbct_cookie__delete","date","Date","toUTCString","jQuery","ready","ajax","type","url","apbctPublicAlt","ajax_url","data","apbct_action","apbct_secret","nonce","session_id","async","success","msg","console","log","JSON","parse","result","cookies","error","err","window","onunload"],"mappings":"AACA,IAAIA,kBAAoB,IAAIC,YAAY,CAACC,QAAQ,EAAMC,YAAY,EAAMC,OAAQC,YAAYC,MAG7F,SAASC,kBAAkBC,EAAOC,GACjC,IAAIC,EAAS,GAuBb,MArBmB,iBADnBF,EAAQA,GAAS,QACYA,EAAQA,EAAMG,SAE5B,SADfF,EAAWA,GAAY,CAAC,SAAU,UACFA,EAAW,MACrB,iBAAZA,IAAsBA,EAAWA,EAASE,SACpDC,SAASF,OAAOC,MAAM,KAAKE,QAAQ,SAASC,EAAMC,EAAGC,GACpD,IAAIC,EAAOH,EAAKI,OAAOP,MAAM,KAE1BH,GACFA,EAAMK,QAAQ,SAASM,EAAMJ,EAAGK,GAC5BH,EAAK,KAAOE,IACdT,EAAOO,EAAK,IAAOA,EAAK,MAIxBR,GACFA,EAASI,QAAQ,SAASQ,EAAQN,EAAGK,GACL,IAA5BH,EAAK,GAAGK,QAAQD,KAClBX,EAAOO,EAAK,IAAOA,EAAK,QAIrBP,EAIR,SAASa,qBAAqBf,EAAOC,GACpC,IAAIe,EAAO,IAAIC,KAAK,GAED,iBADnBjB,EAAQA,GAAS,QACYA,EAAQA,EAAMG,SAE5B,SADfF,EAAWA,GAAY,CAAC,SAAU,UACFA,EAAW,MACrB,iBAAZA,IAAsBA,EAAWA,EAASE,SACpDC,SAASF,OAAOC,MAAM,KAAKE,QAAQ,SAASC,EAAMC,EAAGC,GACpD,IAAIC,EAAOH,EAAKI,OAAOP,MAAM,KAE1BH,GACFA,EAAMK,QAAQ,SAASM,EAAMJ,EAAGK,GAC5BH,EAAK,KAAOE,IACdP,SAASF,OAASO,EAAK,GAAK,sBAAwBO,EAAKE,iBAIzDjB,GACFA,EAASI,QAAQ,SAASQ,EAAQN,EAAGK,GACL,IAA5BH,EAAK,GAAGK,QAAQD,KAClBT,SAASF,OAASO,EAAK,GAAK,sBAAwBO,EAAKE,mBAM9DC,OAAOf,UAAUgB,MAAM,WAErBD,OAAOE,KAAK,CACXC,KAAM,OACNC,IAAKC,eAAeC,SACpBC,KAAM,CACLC,aAAc,eACdC,aAAcJ,eAAeK,MAC7BC,WAAYtC,mBAEbuC,OAAO,EACPC,QAAS,SAASC,GAIjB,GAHAC,QAAQC,IAAI,YACZF,EAAMG,KAAKC,MAAMJ,IAEVK,OAEN,IAAIpC,UADJgC,QAAQC,IAAIF,GACEA,EAAIM,QACjBL,QAAQC,IAAIjC,QAEZE,SAASF,OAASA,OAAS,IAAM+B,EAAIM,QAAQrC,QAAU,iBAGxDgC,QAAQC,IAAIF,GACZC,QAAQC,IAAI,6BAGdK,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM,MAIfC,OAAOC,SAAW,WAGhBJ,QAAUxC,oBAEXmC,QAAQC,IAAI,SAEXhB,OAAOE,KAAK,CACZC,KAAM,OACNC,IAAKC,eAAeC,SACpBC,KAAM,CACLC,aAAc,eACdC,aAAcJ,eAAeK,MAC7BC,WAAYtC,kBACZkC,KAAMa,SAEPR,OAAO,EACPC,QAAS,SAASC,IACjBA,EAAMG,KAAKC,MAAMJ,IACVK,QACNJ,QAAQC,IAAI,WACZD,QAAQC,IAAIF,GAEZlB,uBACAmB,QAAQC,IAAI,oBAEZD,QAAQC,IAAI,4BACZD,QAAQC,IAAIF,KAGdO,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM","file":"apbct-public--alt.min.js","sourcesContent":["// Fingerprint\r\nvar apbct_fingerprint = new Fingerprint({canvas: true, ie_activex: true, hasher: apbct_md5}).get();\r\n\r\n/* Function: Reuturns cookie with prefix */\r\nfunction apbct_cookie__get(names, prefixes){\r\n\tvar cookie = {};\r\n\tnames = names || null;\r\n\tif(typeof names == 'string') names = names.split();\r\n\tprefixes = prefixes || ['apbct_', 'ct_'];\r\n\tif(prefixes == 'none') prefixes = null;\r\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\r\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\r\n\t\tvar curr = item.trim().split('=');\r\n\t\t// Detect by full cookie name\r\n\t\tif(names){\r\n\t\t\tnames.forEach(function(name, i, all){\r\n\t\t\t\tif(curr[0] === name)\r\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\r\n\t\t\t});\r\n\t\t}\r\n\t\t// Detect by name prefix\r\n\t\tif(prefixes){\r\n\t\t\tprefixes.forEach(function(prefix, i, all){\r\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\r\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\treturn cookie;\r\n}\r\n\r\n/* Function: Deletes cookie with prefix */\r\nfunction apbct_cookie__delete(names, prefixes){\r\n\tvar date = new Date(0);\r\n\tnames = names || null;\r\n\tif(typeof names == 'string') names = names.split();\r\n\tprefixes = prefixes || ['apbct_', 'ct_'];\r\n\tif(prefixes == 'none') prefixes = null;\r\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\t\r\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\r\n\t\tvar curr = item.trim().split('=');\r\n\t\t// Detect by full cookie name\r\n\t\tif(names){\r\n\t\t\tnames.forEach(function(name, i, all){\r\n\t\t\t\tif(curr[0] === name)\r\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString();\r\n\t\t\t});\r\n\t\t}\r\n\t\t// Detect by name prefix\r\n\t\tif(prefixes){\r\n\t\t\tprefixes.forEach(function(prefix, i, all){\r\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\r\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString();\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\t\r\n\t jQuery.ajax({\r\n\t\t type: \"POST\",\r\n\t\t url: apbctPublicAlt.ajax_url,\r\n\t\t data: {\r\n\t\t\t apbct_action: 'get_sessions',\r\n\t\t\t apbct_secret: apbctPublicAlt.nonce,\r\n\t\t\t session_id: apbct_fingerprint,\r\n\t\t },\r\n\t\t async: true,\r\n\t\t success: function(msg){\r\n\t\t\t console.log('success');\r\n\t\t\t msg = JSON.parse(msg);\r\n\t\t\t\r\n\t\t\t if(msg.result){\r\n\t\t\t\t console.log(msg);\r\n\t\t\t\t for(cookie in msg.cookies){\r\n\t\t\t\t\t console.log(cookie);\r\n//\t\t\t\t\t console.log(msg.cookies[cookie]);\r\n\t\t\t\t\t document.cookie = cookie + \"=\" + msg.cookies[cookie] + \"; path=/;\";\r\n\t\t\t\t };\r\n\t\t\t }else{\r\n\t\t\t\t console.log(msg);\r\n\t\t\t\t console.log('APBCT SESSIONS GET ERROR');\r\n\t\t\t }\r\n\t\t },\r\n\t\t error: function(err){\r\n\t\t\t console.log('err');\r\n\t\t\t console.log(err);\r\n\t\t }\r\n\t });\r\n\t\r\n\twindow.onunload = function(){\r\n\t\t\r\n\t\t// Getting ct_ and apbct_ cookies\r\n\t\t cookies = apbct_cookie__get();\r\n\t\t\r\n\t\tconsole.log('leave');\r\n\t\t\r\n\t\t jQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: apbctPublicAlt.ajax_url,\r\n\t\t\tdata: {\r\n\t\t\t\tapbct_action: 'set_sessions',\r\n\t\t\t\tapbct_secret: apbctPublicAlt.nonce,\r\n\t\t\t\tsession_id: apbct_fingerprint,\r\n\t\t\t\tdata: cookies,\r\n\t\t\t},\r\n\t\t\tasync: false,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tmsg = JSON.parse(msg);\r\n\t\t\t\tif(msg.result){\r\n\t\t\t\t\tconsole.log('success');\r\n\t\t\t\t\tconsole.log(msg);\r\n\t\t\t\t\t// Deleting ct_ and apbct_ cookies on success\r\n\t\t\t\t\tapbct_cookie__delete();\r\n\t\t\t\t\tconsole.log('cookie DELETED');\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.log('APBCT SESSIONS GET ERROR');\r\n\t\t\t\t\tconsole.log(msg);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function(err){\r\n\t\t\t\tconsole.log('err');\r\n\t\t\t\tconsole.log(err);\r\n\t\t\t}\r\n\t\t}); \r\n\t}\r\n});"]}
1
+ {"version":3,"sources":["apbct-public--alt.js"],"names":["apbct_fingerprint","Fingerprint","canvas","ie_activex","hasher","apbct_md5","get","apbct_cookie__get","names","prefixes","cookie","split","document","forEach","item","i","arr","curr","trim","name","all","prefix","indexOf","apbct_cookie__delete","date","Date","toUTCString","jQuery","ready","ajax","type","url","apbctPublicAlt","ajax_url","data","apbct_action","apbct_secret","nonce","session_id","async","success","msg","console","log","JSON","parse","result","cookies","error","err","window","onunload"],"mappings":"AACA,IAAIA,kBAAoB,IAAIC,YAAY,CAACC,QAAQ,EAAMC,YAAY,EAAMC,OAAQC,YAAYC,MAG7F,SAASC,kBAAkBC,EAAOC,GACjC,IAAIC,EAAS,GAuBb,MArBmB,iBADnBF,EAAQA,GAAS,QACYA,EAAQA,EAAMG,SAE5B,SADfF,EAAWA,GAAY,CAAC,SAAU,UACFA,EAAW,MACrB,iBAAZA,IAAsBA,EAAWA,EAASE,SACpDC,SAASF,OAAOC,MAAM,KAAKE,QAAQ,SAASC,EAAMC,EAAGC,GACpD,IAAIC,EAAOH,EAAKI,OAAOP,MAAM,KAE1BH,GACFA,EAAMK,QAAQ,SAASM,EAAMJ,EAAGK,GAC5BH,EAAK,KAAOE,IACdT,EAAOO,EAAK,IAAOA,EAAK,MAIxBR,GACFA,EAASI,QAAQ,SAASQ,EAAQN,EAAGK,GACL,IAA5BH,EAAK,GAAGK,QAAQD,KAClBX,EAAOO,EAAK,IAAOA,EAAK,QAIrBP,EAIR,SAASa,qBAAqBf,EAAOC,GACpC,IAAIe,EAAO,IAAIC,K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K,QACNJ,QAAQC,IAAI,WACZD,QAAQC,IAAIF,GAEZlB,uBACAmB,QAAQC,IAAI,oBAEZD,QAAQC,IAAI,4BACZD,QAAQC,IAAIF,KAGdO,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM","file":"apbct-public--alt.min.js","sourcesContent":["// Fingerprint\nvar apbct_fingerprint = new Fingerprint({canvas: true, ie_activex: true, hasher: apbct_md5}).get();\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\n/* Function: Deletes cookie with prefix */\nfunction apbct_cookie__delete(names, prefixes){\n\tvar date = new Date(0);\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\t\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString();\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString();\n\t\t\t});\n\t\t}\n\t});\n}\n\njQuery(document).ready(function(){\n\t\n\t jQuery.ajax({\n\t\t type: \"POST\",\n\t\t url: apbctPublicAlt.ajax_url,\n\t\t data: {\n\t\t\t apbct_action: 'get_sessions',\n\t\t\t apbct_secret: apbctPublicAlt.nonce,\n\t\t\t session_id: apbct_fingerprint,\n\t\t },\n\t\t async: true,\n\t\t success: function(msg){\n\t\t\t console.log('success');\n\t\t\t msg = JSON.parse(msg);\n\t\t\t\n\t\t\t if(msg.result){\n\t\t\t\t console.log(msg);\n\t\t\t\t for(cookie in msg.cookies){\n\t\t\t\t\t console.log(cookie);\n//\t\t\t\t\t console.log(msg.cookies[cookie]);\n\t\t\t\t\t document.cookie = cookie + \"=\" + msg.cookies[cookie] + \"; path=/;\";\n\t\t\t\t };\n\t\t\t }else{\n\t\t\t\t console.log(msg);\n\t\t\t\t console.log('APBCT SESSIONS GET ERROR');\n\t\t\t }\n\t\t },\n\t\t error: function(err){\n\t\t\t console.log('err');\n\t\t\t console.log(err);\n\t\t }\n\t });\n\t\n\twindow.onunload = function(){\n\t\t\n\t\t// Getting ct_ and apbct_ cookies\n\t\t cookies = apbct_cookie__get();\n\t\t\n\t\tconsole.log('leave');\n\t\t\n\t\t jQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: apbctPublicAlt.ajax_url,\n\t\t\tdata: {\n\t\t\t\tapbct_action: 'set_sessions',\n\t\t\t\tapbct_secret: apbctPublicAlt.nonce,\n\t\t\t\tsession_id: apbct_fingerprint,\n\t\t\t\tdata: cookies,\n\t\t\t},\n\t\t\tasync: false,\n\t\t\tsuccess: function(msg){\n\t\t\t\tmsg = JSON.parse(msg);\n\t\t\t\tif(msg.result){\n\t\t\t\t\tconsole.log('success');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t\t// Deleting ct_ and apbct_ cookies on success\n\t\t\t\t\tapbct_cookie__delete();\n\t\t\t\t\tconsole.log('cookie DELETED');\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log('APBCT SESSIONS GET ERROR');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err){\n\t\t\t\tconsole.log('err');\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t}); \n\t}\n});"]}
js/apbct-public--gdpr.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["apbct-public--gdpr.js"],"names":["jQuery","document","ready","ctPublicGDPR","gdpr_forms","forEach","item","i","arr","elem","is","find","children","first","attr","indexOf","append","gdpr_text"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAElBC,aAAaC,YAEjBD,aAAaC,WAAWC,QAAQ,SAASC,EAAMC,EAAGC,GAEjD,IAAIC,EAAOT,OAAO,IAAIM,EAAK,MAAMA,GAG7BG,EAAKC,GAAG,UAERD,EAAKE,KAAK,QAAQ,GACpBF,EAAOA,EAAKG,SAAS,QAAQC,QAEtBb,OAAO,qBAAqB,KAA0E,IAApEA,OAAO,qBAAqBc,KAAK,MAAMC,QAAQ,UAAUT,GAClGG,EAAOT,OAAO,qBAEPA,OAAO,cAAc,KAA6E,IAAvEA,OAAO,cAAca,QAAQC,KAAK,MAAMC,QAAQ,YAAYT,GAC9FG,EAAOT,OAAO,cAAca,QAAQD,SAAS,QAEtCZ,OAAO,iBAAiB,KAAoF,IAA9EA,OAAO,iBAAiBa,QAAQC,KAAK,MAAMC,QAAQ,gBAAgBT,KACxGG,EAAOT,OAAO,oBAIbS,EAAKC,GAAG,SAAiC,SAAtBD,EAAKK,KAAK,SAC/BL,EAAKO,OAAO,yBAAyBT,EAAE,wFACrCS,OAAO,mDAAmDT,EAAE,KAAKJ,aAAac,UAAU","file":"apbct-public--gdpr.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\t\r\n\tif(!ctPublicGDPR.gdpr_forms) return;\r\n\t\r\n\tctPublicGDPR.gdpr_forms.forEach(function(item, i, arr){\r\n\t\t\r\n\t\tvar elem = jQuery('#'+item+', .'+item);\r\n\t\t\r\n\t\t// Filter forms\r\n\t\tif(!elem.is('form')){\r\n\t\t\t// Caldera\r\n\t\t\tif(elem.find('form')[0])\r\n\t\t\t\telem = elem.children('form').first();\r\n\t\t\t// Contact Form 7\r\n\t\t\telse if(jQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]').attr('id').indexOf('wpcf7-f'+item) !== -1)\r\n\t\t\t\telem = jQuery('.wpcf7[role=form]');\r\n\t\t\t// Formidable\r\n\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\r\n\t\t\t\telem = jQuery('.frm_forms').first().children('form');\r\n\t\t\t// WPForms\r\n\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\r\n\t\t\t\telem = jQuery('.wpforms-form');\r\n\t\t}\r\n\t\t\r\n\t\t// Adding notice\r\n\t\tif(elem.is('form') || elem.attr('role') === 'form'){\r\n\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required \" style=\"display: inline; margin-right: 10px;\">')\r\n\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\r\n\t\t}\r\n\t});\r\n\t\r\n});"]}
1
+ {"version":3,"sources":["apbct-public--gdpr.js"],"names":["jQuery","document","ready","ctPublicGDPR","gdpr_forms","forEach","item","i","arr","elem","is","find","children","first","attr","indexOf","append","gdpr_text"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAElBC,aAAaC,YAEjBD,aAAaC,WAAWC,QAAQ,SAASC,EAAMC,EAAGC,GAEjD,IAAIC,EAAOT,OAAO,IAAIM,EAAK,MAAMA,GAG7BG,EAAKC,GAAG,UAERD,EAAKE,KAAK,QAAQ,GACpBF,EAAOA,EAAKG,SAAS,QAAQC,QAEtBb,OAAO,qBAAqB,KAA0E,IAApEA,OAAO,qBAAqBc,KAAK,MAAMC,QAAQ,UAAUT,GAClGG,EAAOT,OAAO,qBAEPA,OAAO,cAAc,KAA6E,IAAvEA,OAAO,cAAca,QAAQC,KAAK,MAAMC,QAAQ,YAAYT,GAC9FG,EAAOT,OAAO,cAAca,QAAQD,SAAS,QAEtCZ,OAAO,iBAAiB,KAAoF,IAA9EA,OAAO,iBAAiBa,QAAQC,KAAK,MAAMC,QAAQ,gBAAgBT,KACxGG,EAAOT,OAAO,oBAIbS,EAAKC,GAAG,SAAiC,SAAtBD,EAAKK,KAAK,SAC/BL,EAAKO,OAAO,yBAAyBT,EAAE,wFACrCS,OAAO,mDAAmDT,EAAE,KAAKJ,aAAac,UAAU","file":"apbct-public--gdpr.min.js","sourcesContent":["jQuery(document).ready(function(){\n\t\n\tif(!ctPublicGDPR.gdpr_forms) return;\n\t\n\tctPublicGDPR.gdpr_forms.forEach(function(item, i, arr){\n\t\t\n\t\tvar elem = jQuery('#'+item+', .'+item);\n\t\t\n\t\t// Filter forms\n\t\tif(!elem.is('form')){\n\t\t\t// Caldera\n\t\t\tif(elem.find('form')[0])\n\t\t\t\telem = elem.children('form').first();\n\t\t\t// Contact Form 7\n\t\t\telse if(jQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]').attr('id').indexOf('wpcf7-f'+item) !== -1)\n\t\t\t\telem = jQuery('.wpcf7[role=form]');\n\t\t\t// Formidable\n\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t// WPForms\n\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\telem = jQuery('.wpforms-form');\n\t\t}\n\t\t\n\t\t// Adding notice\n\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required \" style=\"display: inline; margin-right: 10px;\">')\n\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t}\n\t});\n\t\n});"]}
js/apbct-public.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function apbct_js_keys__set_input_value(e,t,n,o){if(null!==document.getElementById(n.input_name)){var i=document.getElementById(n.input_name).value;document.getElementById(n.input_name).value=document.getElementById(n.input_name).value.replace(i,e.js_key)}}if(function(){var e=new Date,t=(new Date).getTime(),n=!0,o=[],i=0;function a(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/"}function u(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function c(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}a("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),a("ct_fkp_timestamp","0"),a("ct_pointer_data","0"),a("ct_timezone","0"),setTimeout(function(){a("ct_timezone",e.getTimezoneOffset()/60*-1)},1e3);var r=function(e){a("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),c(window,"mousedown",r),c(window,"keydown",r)},l=setInterval(function(){n=!0},150),s=setInterval(function(){a("ct_pointer_data",JSON.stringify(o))},1200),m=function(e){!0===n&&(o.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),n=!1,50<=++i&&(c(window,"mousemove",m),clearInterval(l),clearInterval(s)))};u(window,"mousemove",m),u(window,"mousedown",r),u(window,"keydown",r),u(window,"DOMContentLoaded",function(){a("apbct_visible_fields",0),a("apbct_visible_fields_count",0),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t=document.forms[e];t.onsubmit_prev=t.onsubmit,t.onsubmit=function(e){var t=[];for(var n in this.elements)isNaN(+n)||(t[n]=this.elements[n]);var o=(t=t.filter(function(o){return"none"!==getComputedStyle(o).display&&"hidden"!==getComputedStyle(o).visibility&&"0"!==getComputedStyle(o).opacity&&"hidden"!==o.getAttribute("type")&&"submit"!==o.getAttribute("type")&&""!==o.value&&null!==o.getAttribute("name")&&("radio"===o.getAttribute("type")&&t.forEach(function(e,t,n){o.getAttribute("name")!==e.getAttribute("name")||!1}),!0)})).length,i="";t.forEach(function(e,t,n){i+=" "+e.getAttribute("name")}),a("apbct_visible_fields",i=i.trim()),a("apbct_visible_fields_count",o),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)}}},1e3)})}(),"undefined"!=typeof jQuery){function apbct_sendAJAXRequest(o,t,n){var i=t.callback||null,a=t.notJson||null,e=t.timeout||15e3;n=n||null;o._ajax_nonce=ctPublic._ajax_nonce,jQuery.ajax({type:"POST",url:ctPublic._ajax_url,data:o,success:function(e){a||(e=JSON.parse(e)),e.error||i&&i(e,o,t,n)},error:function(e,t,n){console.log("APBCT_AJAX_ERROR"),console.log(o),console.log(e),console.log(t),console.log(n)},timeout:e})}jQuery(document).ajaxComplete(function(e,t,n){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){var o=JSON.parse(t.responseText);void 0!==o.apbct&&(o=o.apbct).blocked&&alert(o.comment)}})}
2
  //# sourceMappingURL=apbct-public.min.js.map
1
+ function apbct_js_keys__set_input_value(e,t,n,o){if(null!==document.getElementById(n.input_name)){var i=document.getElementById(n.input_name).value;document.getElementById(n.input_name).value=document.getElementById(n.input_name).value.replace(i,e.js_key)}}if(function(){var e=new Date,t=(new Date).getTime(),n=!0,o=[],i=0;function a(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/"}function u(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function c(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}a("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),a("ct_fkp_timestamp","0"),a("ct_pointer_data","0"),a("ct_timezone","0"),setTimeout(function(){a("ct_timezone",e.getTimezoneOffset()/60*-1)},1e3);var r=function(e){a("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),c(window,"mousedown",r),c(window,"keydown",r)},s=setInterval(function(){n=!0},150),l=setInterval(function(){a("ct_pointer_data",JSON.stringify(o))},1200),m=function(e){!0===n&&(o.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),n=!1,50<=++i&&(c(window,"mousemove",m),clearInterval(s),clearInterval(l)))};u(window,"mousemove",m),u(window,"mousedown",r),u(window,"keydown",r),u(window,"DOMContentLoaded",function(){a("apbct_visible_fields",0),a("apbct_visible_fields_count",0),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t=document.forms[e];t.classList.contains("slp_search_form")||(t.onsubmit_prev=t.onsubmit,t.onsubmit=function(e){var t=[];for(var n in this.elements)isNaN(+n)||(t[n]=this.elements[n]);var o=(t=t.filter(function(o){return"none"!==getComputedStyle(o).display&&"hidden"!==getComputedStyle(o).visibility&&"0"!==getComputedStyle(o).opacity&&"hidden"!==o.getAttribute("type")&&"submit"!==o.getAttribute("type")&&""!==o.value&&null!==o.getAttribute("name")&&("radio"===o.getAttribute("type")&&t.forEach(function(e,t,n){o.getAttribute("name")!==e.getAttribute("name")||!1}),!0)})).length,i="";t.forEach(function(e,t,n){i+=" "+e.getAttribute("name")}),a("apbct_visible_fields",i=i.trim()),a("apbct_visible_fields_count",o),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3)})}(),"undefined"!=typeof jQuery){function apbct_sendAJAXRequest(o,t,n){var i=t.callback||null,a=t.notJson||null,e=t.timeout||15e3;n=n||null;o._ajax_nonce=ctPublic._ajax_nonce,jQuery.ajax({type:"POST",url:ctPublic._ajax_url,data:o,success:function(e){a||(e=JSON.parse(e)),e.error||i&&i(e,o,t,n)},error:function(e,t,n){console.log("APBCT_AJAX_ERROR"),console.log(o),console.log(e),console.log(t),console.log(n)},timeout:e})}jQuery(document).ajaxComplete(function(e,t,n){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){var o=JSON.parse(t.responseText);void 0!==o.apbct&&(o=o.apbct).blocked&&alert(o.comment)}})}
2
  //# sourceMappingURL=apbct-public.min.js.map
js/apbct-public.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["apbct-public.js"],"names":["apbct_js_keys__set_input_value","result","data","params","obj","document","getElementById","input_name","ct_input_value","value","replace","js_key","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctSetCookieSec","c_name","cookie","encodeURIComponent","apbct_attach_event_handler","elem","event","callback","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","Math","floor","setTimeout","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","JSON","stringify","ctFunctionMouseMove","push","round","clientY","clientX","clearInterval","i","forms","length","form","onsubmit_prev","onsubmit","elements","key","this","isNaN","visible_fields_count","filter","getComputedStyle","display","visibility","opacity","getAttribute","forEach","el","j","els","visible_fields","trim","target","Function","call","jQuery","apbct_sendAJAXRequest","notJson","timeout","_ajax_nonce","ctPublic","ajax","type","url","_ajax_url","success","parse","error","jqXHR","textStatus","errorThrown","console","log","ajaxComplete","xhr","settings","responseText","indexOf","response","apbct","blocked","alert","comment"],"mappings":"AA8JA,SAASA,+BAA+BC,EAAQC,EAAMC,EAAQC,GAC7D,GAAmD,OAA/CC,SAASC,eAAeH,EAAOI,YAAsB,CACxD,IAAIC,EAAiBH,SAASC,eAAeH,EAAOI,YAAYE,MAChEJ,SAASC,eAAeH,EAAOI,YAAYE,MAAQJ,SAASC,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EAAO0E,SAAW,KAC5BC,EAAU3E,EAAO2E,SAAW,KAC5B1E,EAAMA,GAAO,KAEjBF,EAAK6E,YAAcC,SAASD,YAE5BJ,OAAOM,KAAK,CACXC,KAAM,OACNC,IAAKH,SAASI,UACdlF,KAAMA,EACNmF,QAAS,SAAUpF,GACb4E,IAAS5E,EAASwC,KAAK6C,MAAMrF,IAC9BA,EAAOsF,OAGN7D,GACHA,EAASzB,EAAQC,EAAMC,EAAQC,IAGlCmF,MAAO,SAAUC,EAAOC,EAAYC,GACnCC,QAAQC,IAAI,oBACZD,QAAQC,IAAI1F,GACZyF,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbZ,QAASA,IA1CXH,OAAOtE,UAAUwF,aAAa,SAAUpE,EAAOqE,EAAKC,GACnD,GAAID,EAAIE,eAAwD,IAAxCF,EAAIE,aAAaC,QAAQ,UAAkB,CAClE,IAAIC,EAAWzD,KAAK6C,MAAMQ,EAAIE,mBACA,IAAnBE,EAASC,QACnBD,EAAWA,EAASC,OACPC,SACZC,MAAMH,EAASI","file":"apbct-public.min.js","sourcesContent":["(function() {\n\n\tvar ct_date = new Date(),\n\t\tctTimeMs = new Date().getTime(),\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\n\t\tctMouseData = [],\n\t\tctMouseDataCounter = 0;\n\n\tfunction ctSetCookieSec(c_name, value) {\n\t\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/\";\n\t}\n\n\tfunction apbct_attach_event_handler(elem, event, callback){\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\t\telse elem.attachEvent(event, callback);\n\t}\n\n\tfunction apbct_remove_event_handler(elem, event, callback){\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\t\telse elem.detachEvent(event, callback);\n\t}\n\n\tctSetCookieSec(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\n\tctSetCookieSec(\"ct_fkp_timestamp\", \"0\");\n\tctSetCookieSec(\"ct_pointer_data\", \"0\");\n\tctSetCookieSec(\"ct_timezone\", \"0\");\n\n\tsetTimeout(function(){\n\t\tctSetCookieSec(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\n\t},1000);\n\n\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookieSec(\"ct_fkp_timestamp\", KeyTimestamp);\n\t\tctKeyStopStopListening();\n\t};\n\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookieSec(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n\n\t//Logging mouse position each 150 ms\n\tvar ctFunctionMouseMove = function output(event){\n\t\tif(ctMouseEventTimerFlag === true){\n\n\t\t\tctMouseData.push([\n\t\t\t\tMath.round(event.clientY),\n\t\t\t\tMath.round(event.clientX),\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t\t]);\n\n\t\t\tctMouseDataCounter++;\n\t\t\tctMouseEventTimerFlag = false;\n\t\t\tif(ctMouseDataCounter >= 50){\n\t\t\t\tctMouseStopData();\n\t\t\t}\n\t\t}\n\t};\n\n\t//Stop mouse observing function\n\tfunction ctMouseStopData(){\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\t\tclearInterval(ctMouseReadInterval);\n\t\tclearInterval(ctMouseWriteDataInterval);\n\t}\n\n\t//Stop key listening function\n\tfunction ctKeyStopStopListening(){\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\t}\n\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\t\tctSetCookieSec(\"apbct_visible_fields\", 0);\n\t\tctSetCookieSec(\"apbct_visible_fields_count\", 0);\n\t\tsetTimeout(function(){\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\t\tvar form = document.forms[i];\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\t\t\t\tform.onsubmit = function(event){\n\n\t\t\t\t\t// Get only fields\n\t\t\t\t\tvar elements = [];\n\t\t\t\t\tfor(var key in this.elements){\n\t\t\t\t\t\tif(!isNaN(+key))\n\t\t\t\t\t\t\telements[key] = this.elements[key];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Filter fields\n\t\t\t\t\telements = elements.filter(function(elem){\n\n\t\t\t\t\t\tvar pass = true;\n\n\t\t\t\t\t\t// Filter fields\n\t\t\t\t\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\n\t\t\t\t\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\t\t\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\t\t\t\t\telem.value === \"\" || // empty value\n\t\t\t\t\t\t\telem.getAttribute('name') === null\n\t\t\t\t\t\t){\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Filter elements with same names for type == radio\n\t\t\t\t\t\tif(elem.getAttribute(\"type\") === \"radio\"){\n\t\t\t\t\t\t\telements.forEach(function(el, j, els){\n\t\t\t\t\t\t\t\tif(elem.getAttribute('name') === el.getAttribute('name')){\n\t\t\t\t\t\t\t\t\tpass = false;\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n\n\t\t\t\t\t// Visible fields count\n\t\t\t\t\tvar visible_fields_count = elements.length;\n\n\t\t\t\t\t// Visible fields\n\t\t\t\t\tvar visible_fields = '';\n\t\t\t\t\telements.forEach(function(elem, i, elements){\n\t\t\t\t\t\tvisible_fields += \" \" + elem.getAttribute(\"name\");\n\t\t\t\t\t});\n\t\t\t\t\tvisible_fields = visible_fields.trim();\n\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields\", visible_fields);\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields_count\", visible_fields_count);\n\n\t\t\t\t\t// Call previous submit action\n\t\t\t\t\tif(event.target.onsubmit_prev instanceof Function){\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif (document.getElementById(params.input_name) !== null) {\n\t\tvar ct_input_value = document.getElementById(params.input_name).value;\n\t\tdocument.getElementById(params.input_name).value = document.getElementById(params.input_name).value.replace(ct_input_value, result.js_key);\n\t}\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tif (typeof response.apbct !== 'undefined') {\n\t\t\t\tresponse = response.apbct;\n\t\t\t\tif (response.blocked) {\n\t\t\t\t\talert(response.comment);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction apbct_sendAJAXRequest(data, params, obj) {\n\n\t\t// Default params\n\t\tvar callback = params.callback || null;\n\t\tvar notJson = params.notJson || null;\n\t\tvar timeout = params.timeout || 15000;\n\t\tvar obj = obj || null;\n\n\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublic._ajax_url,\n\t\t\tdata: data,\n\t\t\tsuccess: function (result) {\n\t\t\t\tif (!notJson) result = JSON.parse(result);\n\t\t\t\tif (result.error) {\n\n\t\t\t\t} else {\n\t\t\t\t\tif (callback)\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\t\tconsole.log(data);\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: timeout\n\t\t});\n\t}\n}"]}
1
+ {"version":3,"sources":["apbct-public.js"],"names":["apbct_js_keys__set_input_value","result","data","params","obj","document","getElementById","input_name","ct_input_value","value","replace","js_key","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctSetCookieSec","c_name","cookie","encodeURIComponent","apbct_attach_event_handler","elem","event","callback","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","Math","floor","setTimeout","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","JSON","stringify","ctFunctionMouseMove","push","round","clientY","clientX","clearInterval","i","forms","length","form","classList","contains","onsubmit_prev","onsubmit","elements","key","this","isNaN","visible_fields_count","filter","getComputedStyle","display","visibility","opacity","getAttribute","forEach","el","j","els","visible_fields","trim","target","Function","call","jQuery","apbct_sendAJAXRequest","notJson","timeout","_ajax_nonce","ctPublic","ajax","type","url","_ajax_url","success","parse","error","jqXHR","textStatus","errorThrown","console","log","ajaxComplete","xhr","settings","responseText","indexO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AA8B0C,GAG1CpC,EAAMiD,OAAOnB,yBAAyBoB,UACxCxC,WAAW,WACVV,EAAMiD,OAAOnB,cAAcqB,KAAKnD,EAAMiD,OAAQjD,IAC5C,SAIJ,OA5JL,GAyKqB,oBAAXoD,OAAwB,CAejC,SAASC,sBAAsB5E,EAAMC,EAAQC,GAG5C,IAAIsB,EAAWvB,EAAOuB,UAAY,KAC9BqD,EAAU5E,EAAO4E,SAAW,KAC5BC,EAAU7E,EAAO6E,SAAW,KAC5B5E,EAAMA,GAAO,KAEjBF,EAAK+E,YAAcC,SAASD,YAE5BJ,OAAOM,KAAK,CACXC,KAAM,OACNC,IAAKH,SAASI,UACdpF,KAAMA,EACNqF,QAAS,SAAUtF,GACb8E,IAAS9E,EAASwC,KAAK+C,MAAMvF,IAC9BA,EAAOwF,OAGN/D,GACHA,EAASzB,EAAQC,EAAMC,EAAQC,IAGlCqF,MAAO,SAAUC,EAAOC,EAAYC,GACnCC,QAAQC,IAAI,oBACZD,QAAQC,IAAI5F,GACZ2F,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbZ,QAASA,IA1CXH,OAAOxE,UAAU0F,aAAa,SAAUtE,EAAOuE,EAAKC,GACnD,GAAID,EAAIE,eAAwD,IAAxCF,EAAIE,aAAaC,QAAQ,UAAkB,CAClE,IAAIC,EAAW3D,KAAK+C,MAAMQ,EAAIE,mBACA,IAAnBE,EAASC,QACnBD,EAAWA,EAASC,OACPC,SACZC,MAAMH,EAASI","file":"apbct-public.min.js","sourcesContent":["(function() {\n\n\tvar ct_date = new Date(),\n\t\tctTimeMs = new Date().getTime(),\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\n\t\tctMouseData = [],\n\t\tctMouseDataCounter = 0;\n\n\tfunction ctSetCookieSec(c_name, value) {\n\t\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/\";\n\t}\n\n\tfunction apbct_attach_event_handler(elem, event, callback){\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\t\telse elem.attachEvent(event, callback);\n\t}\n\n\tfunction apbct_remove_event_handler(elem, event, callback){\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\t\telse elem.detachEvent(event, callback);\n\t}\n\n\tctSetCookieSec(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\n\tctSetCookieSec(\"ct_fkp_timestamp\", \"0\");\n\tctSetCookieSec(\"ct_pointer_data\", \"0\");\n\tctSetCookieSec(\"ct_timezone\", \"0\");\n\n\tsetTimeout(function(){\n\t\tctSetCookieSec(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\n\t},1000);\n\n\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookieSec(\"ct_fkp_timestamp\", KeyTimestamp);\n\t\tctKeyStopStopListening();\n\t};\n\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookieSec(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n\n\t//Logging mouse position each 150 ms\n\tvar ctFunctionMouseMove = function output(event){\n\t\tif(ctMouseEventTimerFlag === true){\n\n\t\t\tctMouseData.push([\n\t\t\t\tMath.round(event.clientY),\n\t\t\t\tMath.round(event.clientX),\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t\t]);\n\n\t\t\tctMouseDataCounter++;\n\t\t\tctMouseEventTimerFlag = false;\n\t\t\tif(ctMouseDataCounter >= 50){\n\t\t\t\tctMouseStopData();\n\t\t\t}\n\t\t}\n\t};\n\n\t//Stop mouse observing function\n\tfunction ctMouseStopData(){\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\t\tclearInterval(ctMouseReadInterval);\n\t\tclearInterval(ctMouseWriteDataInterval);\n\t}\n\n\t//Stop key listening function\n\tfunction ctKeyStopStopListening(){\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\t}\n\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\t\tctSetCookieSec(\"apbct_visible_fields\", 0);\n\t\tctSetCookieSec(\"apbct_visible_fields_count\", 0);\n\t\tsetTimeout(function(){\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\t\tvar form = document.forms[i];\n\n\t\t\t\t//Exclusion for StoreLocatorPlus form\n\t\t\t\tif (form.classList.contains('slp_search_form'))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\t\t\t\tform.onsubmit = function(event){\n\n\t\t\t\t\t// Get only fields\n\t\t\t\t\tvar elements = [];\n\t\t\t\t\tfor(var key in this.elements){\n\t\t\t\t\t\tif(!isNaN(+key))\n\t\t\t\t\t\t\telements[key] = this.elements[key];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Filter fields\n\t\t\t\t\telements = elements.filter(function(elem){\n\n\t\t\t\t\t\tvar pass = true;\n\n\t\t\t\t\t\t// Filter fields\n\t\t\t\t\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\n\t\t\t\t\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\t\t\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\t\t\t\t\telem.value === \"\" || // empty value\n\t\t\t\t\t\t\telem.getAttribute('name') === null\n\t\t\t\t\t\t){\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Filter elements with same names for type == radio\n\t\t\t\t\t\tif(elem.getAttribute(\"type\") === \"radio\"){\n\t\t\t\t\t\t\telements.forEach(function(el, j, els){\n\t\t\t\t\t\t\t\tif(elem.getAttribute('name') === el.getAttribute('name')){\n\t\t\t\t\t\t\t\t\tpass = false;\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n\n\t\t\t\t\t// Visible fields count\n\t\t\t\t\tvar visible_fields_count = elements.length;\n\n\t\t\t\t\t// Visible fields\n\t\t\t\t\tvar visible_fields = '';\n\t\t\t\t\telements.forEach(function(elem, i, elements){\n\t\t\t\t\t\tvisible_fields += \" \" + elem.getAttribute(\"name\");\n\t\t\t\t\t});\n\t\t\t\t\tvisible_fields = visible_fields.trim();\n\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields\", visible_fields);\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields_count\", visible_fields_count);\n\n\t\t\t\t\t// Call previous submit action\n\t\t\t\t\tif(event.target.onsubmit_prev instanceof Function){\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif (document.getElementById(params.input_name) !== null) {\n\t\tvar ct_input_value = document.getElementById(params.input_name).value;\n\t\tdocument.getElementById(params.input_name).value = document.getElementById(params.input_name).value.replace(ct_input_value, result.js_key);\n\t}\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tif (typeof response.apbct !== 'undefined') {\n\t\t\t\tresponse = response.apbct;\n\t\t\t\tif (response.blocked) {\n\t\t\t\t\talert(response.comment);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction apbct_sendAJAXRequest(data, params, obj) {\n\n\t\t// Default params\n\t\tvar callback = params.callback || null;\n\t\tvar notJson = params.notJson || null;\n\t\tvar timeout = params.timeout || 15000;\n\t\tvar obj = obj || null;\n\n\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublic._ajax_url,\n\t\t\tdata: data,\n\t\t\tsuccess: function (result) {\n\t\t\t\tif (!notJson) result = JSON.parse(result);\n\t\t\t\tif (result.error) {\n\n\t\t\t\t} else {\n\t\t\t\t\tif (callback)\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\t\tconsole.log(data);\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: timeout\n\t\t});\n\t}\n}"]}
js/cleantalk-admin-settings-page.min.js CHANGED
@@ -1 +1,2 @@
1
- function apbct_banner_check(){var i=setInterval(function(){apbct_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(e,t,n,c){e.close_renew_banner&&(jQuery("#apbct_renew_notice").length&&jQuery("#apbct_renew_notice").hide("slow"),jQuery("#apbct_trial_notice").length&&jQuery("#apbct_trial_notice").hide("slow"),clearInterval(i))}})},6e4)}function apbct_get_elems(e){for(var t,n=0,c=(e=e.split(",")).length;n<c;n++)t=jQuery("#"+e[n]),e[n]=0===t.length?jQuery("."+e[n]):t;return e}function apbct_get_elems__native(e){"string"==typeof e&&(e=e.split(","));var i=[];return e.forEach(function(e,t,n){var c=document.getElementById(e);if(null===c){if(null!==(c=document.getElementsByClassName(e))&&0!==c.length)for(key in c)0<=+key&&i.push(c[key])}else i.push(c[key])}),i}function apbct_show_hide_elem(e){for(var t=0,n=(e=apbct_get_elems(e)).length;t<n;t++)e[t].each(function(e,t){var n=(t=jQuery(t)).next("label")||t.prev("label")||null;t.is(":visible")?(t.hide(),n&&n.hide()):(t.show(),n&&n.show())})}function apbctSettingsDependencies(e,a){a=+a||null,apbct_get_elems__native(e).forEach(function(e,t,n){function c(){console.log(e),e.setAttribute("disabled","disabled")}function i(){e.removeAttribute("disabled")}(null!==a?1===a?i:c:null===e.getAttribute("disabled")?c:i)()})}function apbct_settings__showDescription(e,t){var i=function(e){void 0!==e&&(0!=jQuery(e.target).parent(".apbct_long_desc").length&&!jQuery(e.target).hasClass("apbct_long_desc__cancel")||jQuery(e.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",i))};i(),e.after("<div id='apbct_long_desc__"+t+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+t);n.append("<i class='icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:e.position().top-5,left:e.position().left+25}),apbct_sendAJAX({action:"apbct_settings__get_description",setting_id:t},{spinner:n.children("img"),callback:function(e,t,n,c){c.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+e.title+"</h3>").append("<p>"+e.desc+"</p>"),jQuery(document).on("click",i)}},n)}jQuery(document).ready(function(){jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var e=new Date;jQuery("#ct_admin_timezone").val(e.getTimezoneOffset()/60*-1),jQuery("#apbct_gdpr_open_modal").on("click",function(){jQuery("#gdpr_dialog").dialog({modal:!0,show:!0,position:{my:"center",at:"center",of:window},width:+jQuery("#wpbody").width()/100*70,height:"auto",title:"GDPR compliance",draggable:!1,resizable:!1,closeText:"Close"})}),jQuery(document).on("click",".apbct_settings-long_description---show",function(){self=jQuery(this),apbct_settings__showDescription(self,self.attr("setting"))}),(jQuery("#apbct_renew_notice").length||jQuery("#apbct_trial_notice").length)&&apbct_banner_check()});
 
1
+ function apbct_banner_check(){var i=setInterval(function(){apbct_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(e,t,n,c){e.close_renew_banner&&(jQuery("#apbct_renew_notice").length&&jQuery("#apbct_renew_notice").hide("slow"),jQuery("#apbct_trial_notice").length&&jQuery("#apbct_trial_notice").hide("slow"),clearInterval(i))}})},6e4)}function apbct_get_elems(e){for(var t,n=0,c=(e=e.split(",")).length;n<c;n++)t=jQuery("#"+e[n]),e[n]=0===t.length?jQuery("."+e[n]):t;return e}function apbct_get_elems__native(e){"string"==typeof e&&(e=e.split(","));var i=[];return e.forEach(function(e,t,n){var c=document.getElementById(e);if(null===c){if(null!==(c=document.getElementsByClassName(e))&&0!==c.length)for(key in c)0<=+key&&i.push(c[key])}else i.push(c[key])}),i}function apbct_show_hide_elem(e){for(var t=0,n=(e=apbct_get_elems(e)).length;t<n;t++)e[t].each(function(e,t){var n=(t=jQuery(t)).next("label")||t.prev("label")||null;t.is(":visible")?(t.hide(),n&&n.hide()):(t.show(),n&&n.show())})}function apbctSettingsDependencies(e,a){a=+a||null,apbct_get_elems__native(e).forEach(function(e,t,n){function c(){console.log(e),e.setAttribute("disabled","disabled")}function i(){e.removeAttribute("disabled")}null!==a?1===a?i():c():null===e.getAttribute("disabled")?c():i()})}function apbct_settings__showDescription(e,t){var i=function(e){void 0!==e&&(0!=jQuery(e.target).parent(".apbct_long_desc").length&&!jQuery(e.target).hasClass("apbct_long_desc__cancel")||jQuery(e.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",i))};i(),e.after("<div id='apbct_long_desc__"+t+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+t);n.append("<i class='icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:e.position().top-5,left:e.position().left+25}),apbct_sendAJAX({action:"apbct_settings__get_description",setting_id:t},{spinner:n.children("img"),callback:function(e,t,n,c){c.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+e.title+"</h3>").append("<p>"+e.desc+"</p>"),jQuery(document).on("click",i)}},n)}jQuery(document).ready(function(){jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var e=new Date;jQuery("#ct_admin_timezone").val(e.getTimezoneOffset()/60*-1),jQuery("#apbct_gdpr_open_modal").on("click",function(){jQuery("#gdpr_dialog").dialog({modal:!0,show:!0,position:{my:"center",at:"center",of:window},width:+jQuery("#wpbody").width()/100*70,height:"auto",title:"GDPR compliance",draggable:!1,resizable:!1,closeText:"Close"})}),jQuery(document).on("click",".apbct_settings-long_description---show",function(){self=jQuery(this),apbct_settings__showDescription(self,self.attr("setting"))}),(jQuery("#apbct_renew_notice").length||jQuery("#apbct_trial_notice").length)&&apbct_banner_check()});
2
+ //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
js/cleantalk-admin-settings-page.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-admin-settings-page.js"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","getElementsByClassName","key","push","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","do_disable","console","log","setAttribute","do_enable","removeAttribute","getAttribute","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","ready","val","attr","this","fadeOut","d","Date","getTimezoneOffset","dialog","modal","my","at","of","window","width","height","draggable","resizable","closeText","self"],"mappings":"AAwCA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,eACC,CAACC,OAAQ,sCACT,CACCC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACpCH,EAAOI,qBACNC,OAAO,uBAAuBC,QACjCD,OAAO,uBAAuBE,KAAK,QAChCF,OAAO,uBAAuBC,QACjCD,OAAO,uBAAuBE,KAAK,QACpCC,cAAcb,QAKhB,KAUJ,SAASc,gBAAgBC,GAErB,IAAK,IAA6BC,EAAzBC,EAAE,EAAGC,GADdH,EAAQA,EAAMI,MAAM,MACMR,OAAaM,EAAIC,EAAKD,IAC5CD,EAAMN,OAAO,IAAIK,EAAME,IACvBF,EAAME,GAAoB,IAAfD,EAAIL,OAAeD,OAAO,IAAIK,EAAME,IAAMD,EAEzD,OAAOD,EAUX,SAASK,wBAAwBL,GAGZ,iBAAVA,IACTA,EAAQA,EAAMI,MAAM,MAErB,IAAIE,EAAM,GAuBV,OArBAN,EAAMO,QAAQ,SAASC,EAAMN,EAAGO,GAG/B,IAAIR,EAAMS,SAASC,eAAeH,GAClC,GAAY,OAARP,GAQJ,GAAY,QADZA,EAAMS,SAASE,uBAAuBJ,KACJ,IAAdP,EAAIL,OACvB,IAAIiB,OAAOZ,EACE,IAAPY,KACJP,EAAIQ,KAAMb,EAAIY,WAVhBP,EAAIQ,KAAMb,EAAIY,QAgBTP,EAGR,SAASS,qBAAqBf,GAE1B,IAAK,IAAIE,EAAE,EAAGC,GADjBH,EAAQD,gBA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AAO,MAAMpD,EAAO6D,KAAK,QAE3BxD,OAAOe,UAAU0C,GAAG,QAASlB,KAG/BzC,GAtMFE,OAAOe,UAAU2C,MAAM,WAGnB1D,OAAO,qBAAqByD,GAAG,QAAS,WACpCzD,OAAO,2BAA2B2D,IAAI3D,OAAO,2BAA2B4D,KAAK,QAC7E5D,OAAO,+BAA+B0B,OACtC1B,OAAO6D,MAAMC,QAAQ,OAG5B,IAAIC,EAAI,IAAIC,KACZhE,OAAO,sBAAsB2D,IAAII,EAAEE,oBAAoB,IAAK,GAG5DjE,OAAO,0BAA0ByD,GAAG,QAAS,WAC5CzD,OAAO,gBAAgBkE,OAAO,CAC7BC,OAAM,EACNzC,MAAM,EACNwB,SAAU,CAAEkB,GAAI,SAAUC,GAAI,SAAUC,GAAIC,QAC5CC,OAASxE,OAAO,WAAWwE,QAAU,IAAM,GAC3CC,OAAQ,OACRlB,MAAO,kBACPmB,WAAW,EACXC,WAAW,EACXC,UAAW,YAIb5E,OAAOe,UAAU0C,GAAG,QAAS,0CAA2C,WACvEoB,KAAO7E,OAAO6D,MACdxB,gCAAgCwC,KAAMA,KAAKjB,KAAK,eAG7C5D,OAAO,uBAAuBC,QAAUD,OAAO,uBAAuBC,SACzEZ"}
1
+ {"version":3,"sources":["cleantalk-admin-settings-page.js"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","getElementsByClassName","key","push","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","do_disable","console","log","setAttribute","do_enable","removeAttribute","getAttribute","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","ready","val","attr","this","fadeOut","d","Date","getTimezoneOffset","dialog","modal","my","at","of","window","width","height","draggable","resizable","closeText","self"],"mapp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,EAAEE,oBAAoB,IAAK,GAG5DjE,OAAO,0BAA0ByD,GAAG,QAAS,WAC5CzD,OAAO,gBAAgBkE,OAAO,CAC7BC,OAAM,EACNzC,MAAM,EACNwB,SAAU,CAAEkB,GAAI,SAAUC,GAAI,SAAUC,GAAIC,QAC5CC,OAASxE,OAAO,WAAWwE,QAAU,IAAM,GAC3CC,OAAQ,OACRlB,MAAO,kBACPmB,WAAW,EACXC,WAAW,EACXC,UAAW,YAIb5E,OAAOe,UAAU0C,GAAG,QAAS,0CAA2C,WACvEoB,KAAO7E,OAAO6D,MACdxB,gCAAgCwC,KAAMA,KAAKjB,KAAK,eAG7C5D,OAAO,uBAAuBC,QAAUD,OAAO,uBAAuBC,SACzEZ","file":"cleantalk-admin-settings-page.min.js","sourcesContent":["jQuery(document).ready(function(){\n\n // Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\t\n\t// GDPR modal window\n\tjQuery('#apbct_gdpr_open_modal').on('click', function(){\n\t\tjQuery('#gdpr_dialog').dialog({\n\t\t\tmodal:true, \n\t\t\tshow: true,\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\n\t\t\theight: 'auto',\n\t\t\ttitle: 'GDPR compliance',\n\t\t\tdraggable: false,\n\t\t\tresizable: false,\n\t\t\tcloseText: \"Close\",\n\t\t});\n\t});\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#apbct_renew_notice').length || jQuery('#apbct_trial_notice').length) \n\t\tapbct_banner_check();\n\t\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#apbct_renew_notice').length)\n\t\t\t\t\t\t\tjQuery('#apbct_renew_notice').hide('slow');\n\t\t\t\t\t\tif (jQuery('#apbct_trial_notice').length)\n\t\t\t\t\t\t\tjQuery('#apbct_trial_notice').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 60000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of outpur array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\tenable = +enable || null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){console.log( elem ); elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable !== null) // Set\n\t\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\t// Toggle\n\t\telse{\n\t\t\telem.getAttribute('disabled') === null ? do_disable() : do_enable();\n\t\t}\n\n\t});\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class='icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_sendAJAX(\n\t\t{action: 'apbct_settings__get_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}"]}
js/cleantalk-admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-admin.js"],"names":["apbct_sendAJAX","data","params","obj","callback","notJson","timeout","button","spinner","progressbar","setAttribute","style","cursor","jQuery","css","_ajax_nonce","ctAdminCommon","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","alert","jqXHR","textStatus","errorThrown","console","log","document","ready","on","ct_date","Date","getTime","cookie","toUTCString"],"mappings":"AAYA,SAASA,eAAeC,EAAMC,EAAQC,GAGrC,IAAIC,EAAcF,EAAOE,UAAe,KACpCC,EAAcH,EAAOG,SAAe,KACpCC,EAAcJ,EAAOI,SAAe,KAEpCC,GADAJ,EAAcA,GAAsB,KACtBD,EAAOK,QAAe,MACpCC,EAAcN,EAAOM,SAAe,KACpCC,EAAcP,EAAOO,aAAe,KAGrCF,IAAUA,EAAOG,aAAa,WAAY,YAAaH,EAAOI,MAAMC,OAAS,eAC7EJ,GAASK,OAAOL,GAASM,IAAI,UAAW,UAG3Cb,EAAKc,YAAcC,cAAcD,YAEjCF,OAAOI,KAAK,CACXC,KAAM,OACNC,IAAKH,cAAcI,UACnBnB,KAAMA,EACNoB,QAAS,SAASC,GACdf,IAAUA,EAAOgB,gBAAgB,YAAahB,EAAOI,MAAMC,OAAS,WACpEJ,GAAUK,OAAOL,GAASM,IAAI,UAAW,QACxCT,IAASiB,EAASE,KAAKC,MAAMH,IAC9BA,EAAOI,OACTC,WAAW,WAAelB,GAAaA,EAAYmB,QAAQ,SAAY,KACvEC,MAAM,mBAAqBP,EAAOI,OAAS,YAExCtB,GACFA,EAASkB,EAAQrB,EAAMC,EAAQC,IAGlCuB,MAAO,SAASI,EAAOC,EAAYC,GAC/BzB,IAAUA,EAAOgB,gBAAgB,YAAahB,EAAOI,MAAMC,OAAS,WACpEJ,GAASK,OAAOL,GAASM,IAAI,UAAW,QAC3CmB,QAAQC,IAAI,oBACZD,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,GACTA,GACFH,MAAMG,IAER1B,QAASA,IAxDXO,OAAOsB,UAAUC,MAAM,WAGtBvB,OAAO,wBAAwBwB,GAAG,QAAS,SAAU,WACpD,IAAIC,EAAU,IAAIC,MAAK,IAAIA,MAAOC,UAAY,QAC9CL,SAASM,OAAS,iDAAmDH,EAAQI,gBAG9E7B,OAAO,mDAAmDC,IAAI,cAAc","file":"cleantalk-admin.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\t\r\n\t// Auto update banner close handler\r\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\r\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\r\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString();\r\n\t});\r\n\t\r\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap');\r\n\t\r\n});\r\n\r\nfunction apbct_sendAJAX(data, params, obj){\r\n\r\n\t// Default params\r\n\tvar callback = params.callback || null;\r\n\tvar notJson = params.notJson || null;\r\n\tvar timeout = params.timeout || 15000;\r\n\tvar obj = obj || null;\r\n\tvar button = params.button || null;\r\n\tvar spinner = params.spinner || null;\r\n\tvar progressbar = params.progressbar || null;\r\n\r\n\t// Button and spinner\r\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\r\n\tif(spinner) jQuery(spinner).css('display', 'inline');\r\n\r\n\t// Adding security code\r\n\tdata._ajax_nonce = ctAdminCommon._ajax_nonce;\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ctAdminCommon._ajax_url,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\r\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\r\n\t\t\tif(!notJson) result = JSON.parse(result);\r\n\t\t\tif(result.error){\r\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\r\n\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\r\n\t\t\t}else{\r\n\t\t\t\tif(callback)\r\n\t\t\t\t\tcallback(result, data, params, obj);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown){\r\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\r\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\r\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\r\n\t\t\tconsole.log(jqXHR);\r\n\t\t\tconsole.log(textStatus);\r\n\t\t\tconsole.log(errorThrown);\r\n\t\t\tif(errorThrown)\r\n\t\t\t\talert(errorThrown);\r\n\t\t},\r\n\t\ttimeout: timeout,\r\n\t});\r\n}"]}
1
+ {"version":3,"sources":["cleantalk-admin.js"],"names":["apbct_sendAJAX","data","params","obj","callback","notJson","timeout","button","spinner","progressbar","setAttribute","style","cursor","jQuery","css","_ajax_nonce","ctAdminCommon","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","alert","jqXHR","textStatus","errorThrown","console","log","document","ready","on","ct_date","Date","getTime","cookie","toUTCString"],"mappings":"AAYA,SAASA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n\t// Auto update banner close handler\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString();\n\t});\n\t\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap');\n\t\n});\n\nfunction apbct_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\t// Adding security code\n\tdata._ajax_nonce = ctAdminCommon._ajax_nonce;\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctAdminCommon._ajax_url,\n\t\tdata: data,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback)\n\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t\tif(errorThrown)\n\t\t\t\talert(errorThrown);\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}"]}
js/cleantalk-comments-checkspam.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-comments-checkspam.js"],"names":["ct_working","String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","is","val","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","parseJSON","parseInt","error","confirm","error_message","new_href","location","href","end","document","cookie","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_delete_all","e","target","addClass","css","removeClass","ready","state","on","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_deletion_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAAY,CAC9B,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,UAAUD,GAAOK,EAE9C,OAAOP,IAKVS,cAAe,EACfC,sBAAuB,EACvBC,kBA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BK,GAAG,cAClCzB,mBAAoB,GAGrBoB,OAAO,eAAeiC,OACtBjC,OAAO,uBAAuB4C,OAC9B5C,OAAO,iBAAiB4C,OACxB5C,OAAO,aAAa4C,OAEpBhF,YAAW,EAERsH,GACFlE,eACAC,oBAEAf,qBAKFF,OAAO,yBAAyBoF,MAAM,WAErCH,IADAlD,SAASC,OAAS,yCAGnBhC,OAAO,4BAA4BoF,MAAM,WACxCH,GAAe,KAIhBjF,OAAO,aAAa8D,GAAG,QAAS,WAC/BjF,UAAW,EACX,IAAIwG,EAAW,CACdC,SAAY1G,kBACZuB,KAAYR,aACZS,KAAYR,cAEbmC,SAASC,OAAS,4BAA8BuD,KAAKC,UAAUH,GAAY,aAI/C,MAA1BtG,gBAAgB0G,QAClB1D,SAASC,OAAS,sCAAwC,IAAI0D,KAAK,GAAGC,cAAgB,WACtF3F,OAAO,yBAAyBoF,SAIjCpF,OAAO,kBAAkBoF,MAAM,SAAU7B,GAExC,IAAK9B,QAAQ1C,gBAAgB6G,yBAC5B,OAAO,EAERtC,cAAeC","file":"cleantalk-comments-checkspam.min.js","sourcesContent":["// Printf for JS\r\nString.prototype.printf = function(){\r\n var formatted = this;\r\n for( var arg in arguments ) {\r\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\r\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\r\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\r\n }\r\n return formatted;\r\n};\r\n\r\n// Flags\r\nvar ct_working = false,\r\n\tct_new_check = true,\r\n\tct_cooling_down_flag = false,\r\n\tct_close_animate = true,\r\n\tct_accurate_check = false,\r\n\tct_pause = false,\r\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\r\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\r\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\r\n// Settings\r\nvar ct_cool_down_time = 90000,\r\n\tct_requests_counter = 0,\r\n\tct_max_requests = 60;\r\n// Variables\r\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\r\n\tct_comments_total = 0,\r\n\tct_comments_checked = 0,\r\n\tct_comments_spam = 0,\r\n\tct_comments_bad = 0,\r\n\tct_unchecked = 'unset',\r\n\tct_date_from = 0,\r\n\tct_date_till = 0;\r\n\r\nfunction animate_comment(to,id){\r\n\tif(ct_close_animate){\r\n\t\tif(to==0.3){\r\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\r\n\t\t\t\tanimate_comment(1,id)\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\r\n\t\t\t\tanimate_comment(0.3,id)\r\n\t\t\t});\r\n\t\t}\r\n\t}else{\r\n\t\tct_close_animate=true;\r\n\t}\r\n}\r\n\r\nfunction ct_clear_comments(){\r\n\r\n\tvar from = 0, till = 0;\r\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\r\n\t\tfrom = jQuery('#ct_date_range_from').val();\r\n\t\ttill = jQuery('#ct_date_range_till').val();\r\n\t}\r\n\tvar data = {\r\n\t\t'action' : 'ajax_clear_comments',\r\n\t\t'security' : ct_ajax_nonce,\r\n\t\t'from' : from,\r\n\t\t'till' : till\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\tct_show_info();\r\n\t\t\tct_send_comments();\r\n\t\t}\r\n\t});\r\n}\r\n\r\n//Continues the check after cooldown time\r\n//Called by ct_send_users();\r\nfunction ct_cooling_down_toggle(){\r\n\tct_cooling_down_flag = false;\r\n\tct_send_comments();\r\n\tct_show_info();\r\n}\r\n\r\nfunction ct_send_comments(){\r\n\t\r\n\tif(ct_cooling_down_flag === true)\r\n\t\treturn;\r\n\t\r\n\tif(ct_requests_counter >= ct_max_requests){\r\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\r\n\t\tct_requests_counter = 0;\r\n\t\tct_cooling_down_flag = true;\r\n\t\treturn;\r\n\t}else{\r\n\t\tct_requests_counter++;\r\n\t}\r\n\t\r\n\tvar data = {\r\n\t\t'action': 'ajax_check_comments',\r\n\t\t'security': ct_ajax_nonce,\r\n\t\t'new_check': ct_new_check,\r\n\t\t'unchecked': ct_unchecked\r\n\t};\r\n\t\r\n\tif(ct_accurate_check)\r\n\t\tdata['accurate_check'] = true;\r\n\t\r\n\tif(ct_date_from && ct_date_till){\r\n\t\tdata['from'] = ct_date_from;\r\n\t\tdata['till'] = ct_date_till;\r\n\t}\r\n\t\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\t\r\n\t\t\tmsg = jQuery.parseJSON(msg);\r\n\t\t\t\r\n\t\t\tif(parseInt(msg.error)){\r\n\t\t\t\tct_working=false;\r\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\r\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\r\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\r\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\t\t\t\tlocation.href = new_href;\r\n\t\t\t\t}else\r\n\t\t\t\t\tct_send_comments();\r\n\t\t\t}else{\r\n\t\t\t\tct_new_check = false;\r\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\r\n\t\t\t\t\tif(parseInt(msg.end) == 1)\r\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_comments_check=0; path=/';\r\n\t\t\t\t\tct_working=false;\r\n\t\t\t\t\tjQuery('#ct_working_message').hide();\r\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\r\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\r\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\t\t\t\tlocation.href = new_href;\r\n\t\t\t\t}else if(parseInt(msg.end) == 0){\r\n\t\t\t\t\tct_comments_checked += msg.checked;\r\n\t\t\t\t\tct_comments_spam += msg.spam;\r\n\t\t\t\t\tct_comments_bad += msg.bad;\r\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\r\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\r\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_total, ct_comments_checked, ct_comments_spam, ct_comments_bad);\r\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\r\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\r\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\r\n\t\t\t\t\tjQuery('#ct_error_message').hide();\r\n\t\t\t\t\t// If DB woks not properly\r\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\r\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/';\r\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_safe_check=1; path=/';\r\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tct_send_comments();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\r\n\t\t\tsetTimeout(ct_send_comments(), 3000); \r\n },\r\n timeout: 25000\r\n\t});\r\n}\r\nfunction ct_show_info(){\r\n\t\r\n\tif(ct_working){\r\n\t\t\r\n\t\tif(ct_cooling_down_flag == true){\r\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\r\n\t\t\tjQuery('#ct_cooling_notice').show();\r\n\t\t\treturn;\t\t\t\r\n\t\t}else{\r\n\t\t\tjQuery('#ct_cooling_notice').hide();\r\n\t\t}\r\n\t\t\r\n\t\tif(!ct_comments_total){\r\n\t\t\t\r\n\t\t\tvar data = {\r\n\t\t\t\t'action': 'ajax_info_comments',\r\n\t\t\t\t'security': ct_ajax_nonce\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(ct_date_from && ct_date_till){\r\n\t\t\t\tdata['from'] = ct_date_from;\r\n\t\t\t\tdata['till'] = ct_date_till;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tjQuery.ajax({\r\n\t\t\t\ttype: \"POST\",\r\n\t\t\t\turl: ajaxurl,\r\n\t\t\t\tdata: data,\r\n\t\t\t\tsuccess: function(msg){\r\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\r\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\r\n\t\t\t\t\tct_comments_total = msg.total;\r\n\t\t\t\t\tct_comments_spam = msg.spam;\r\n\t\t\t\t\tct_comments_checked = msg.checked;\r\n\t\t\t\t\tct_comments_bad = msg.bad;\r\n\t\t\t\t},\r\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\r\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \r\n\t\t\t\t},\r\n\t\t\t\ttimeout: 15000\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\n// Function to toggle dependences\r\nfunction ct_toggle_depended(obj, secondary){\r\n\r\n secondary = secondary || null;\r\n\r\n\tvar depended = jQuery(obj.data('depended')),\r\n\t\tstate = obj.data('state');\r\n\t\t\r\n\tif(!state && !secondary){\r\n\t\tobj.data('state', true);\r\n\t\tdepended.removeProp('disabled');\r\n\t}else{\r\n\t\tobj.data('state', false);\r\n\t\tdepended.prop('disabled', true);\r\n\t\tdepended.removeProp('checked');\r\n\t\tif(depended.data('depended'))\r\n\t\t\tct_toggle_depended(depended, true);\r\n\t}\r\n}\r\n\r\nfunction ct_delete_all( e ) {\r\n\r\n\tvar data = {\r\n\t\t'action': 'ajax_delete_all',\r\n\t\t'security': ct_ajax_nonce\r\n\t};\r\n\r\n\tjQuery('.' + e.target.id).addClass('disabled');\r\n\tjQuery('.spinner').css('visibility', 'visible');\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function( msg ){\r\n\t\t\tif( msg > 0 ){\r\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\r\n\t\t\t\tct_delete_all( e );\r\n\t\t\t}else{\r\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\r\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\r\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam_total';\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\r\n\t\t\tsetTimeout(ct_delete_all( e ), 3000);\r\n\t\t},\r\n\t\ttimeout: 25000\r\n\t});\r\n\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\t// Setting dependences\r\n\t// jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});\r\n\tjQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});\r\n\t\r\n\t// Prev check parameters\r\n\tif(ct_prev_accurate){\r\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\r\n\t}\r\n\tif(ct_prev_from){\r\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\r\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\r\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\r\n\t}\r\n\t\r\n\t// Toggle dependences\r\n\tjQuery(\"#ct_allow_date_range, #ct_accurate_check\").on('change', function(){\r\n\t\tct_toggle_depended(jQuery(this));\r\n\t});\r\n\r\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\r\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\r\n\t\t{\r\n\t\t\tdateFormat: 'M d yy',\r\n\t\t\tmaxDate:\"+0D\",\r\n\t\t\tchangeMonth:true,\r\n\t\t\tchangeYear:true,\r\n\t\t\tshowAnim: 'slideDown',\r\n\t\t\tonSelect: function(selectedDate){\r\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\r\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\r\n\t\t\t\tdate = jQuery.datepicker.parseDate(\r\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\r\n\t\t\t\t\tselectedDate, instance.settings);\r\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t\r\n\tfunction ct_start_check(continue_check){\r\n\r\n continue_check = continue_check || null;\r\n\r\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\r\n\t\t\t\r\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val(),\r\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\r\n\t\t\t\t\t\t\r\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\r\n\t\t\t\talert('Please, specify a date range.');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\r\n\t\t\tct_accurate_check = true;\r\n\t\t}\r\n\t\t\r\n\t\tjQuery('.ct_to_hide').hide();\r\n\t\tjQuery('#ct_working_message').show();\r\n\t\tjQuery('#ct_preloader').show();\r\n\t\tjQuery('#ct_pause').show();\r\n\r\n\t\tct_working=true;\r\n\t\t\r\n\t\tif(continue_check){\r\n\t\t\tct_show_info();\r\n\t\t\tct_send_comments();\r\n\t\t}else\r\n\t\t\tct_clear_comments();\r\n\t\t\r\n\t}\r\n\t\r\n\t// Check comments\r\n\tjQuery(\"#ct_check_spam_button\").click(function(){\r\n\t\tdocument.cookie = 'ct_paused_comments_check=0; path=/';\r\n\t\tct_start_check(false);\r\n\t});\r\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\r\n\t\tct_start_check(true);\r\n\t});\r\n\r\n\t// Pause the check\r\n\tjQuery('#ct_pause').on('click', function(){\r\n\t\tct_pause = true;\r\n\t\tvar ct_check = {\r\n\t\t\t'accurate': ct_accurate_check,\r\n\t\t\t'from' : ct_date_from,\r\n\t\t\t'till' : ct_date_till\r\n\t\t};\r\n\t\tdocument.cookie = 'ct_paused_comments_check=' + JSON.stringify(ct_check) + '; path=/';\r\n\t});\r\n\r\n\r\n\tif(ctCommentsCheck.start === '1'){\r\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/';\r\n\t\tjQuery('#ct_check_spam_button').click();\t\r\n\t}\r\n\r\n\t// Delete all spam comments\r\n\tjQuery(\".ct_delete_all\").click(function( e ){\r\n\r\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_deletion_all))\r\n\t\t\treturn false;\r\n\r\n\t\tct_delete_all( e );\r\n\r\n\t});\r\n\r\n});"]}
1
+ {"version":3,"sources":["cleantalk-comments-checkspam.js"],"names":["ct_working","String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","is","val","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","parseJSON","parseInt","error","confirm","error_message","new_href","location","href","end","document","cookie","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_delete_all","e","target","addClass","css","removeClass","ready","state","on","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_deletion_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAAY,CAC9B,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,UAAUD,GAAOK,EAE9C,OAAOP,IAKVS,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,gBAAgBD,iBACnCE,aAAeD,gBAAgBC,aAC/BC,aAAeF,gBAAgBE,aAE5BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,gBAAgBM,cACnCC,kBAAoB,EACpBC,oBAAsB,EACtBC,iBAAmB,EACnBC,gBAAkB,EAClBC,aAAe,QACfC,aAAe,EACfC,aAAe,EAEhB,SAASC,gBAAgBC,EAAGC,GACxBpB,iBACK,IAAJmB,EACFE,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,EAAEE,KAGnBC,OAAO,YAA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AKC,UAAUH,GAAY,aAI/C,MAA1BtG,gBAAgB0G,QAClB1D,SAASC,OAAS,sCAAwC,IAAI0D,KAAK,GAAGC,cAAgB,WACtF3F,OAAO,yBAAyBoF,SAIjCpF,OAAO,kBAAkBoF,MAAM,SAAU7B,GAExC,IAAK9B,QAAQ1C,gBAAgB6G,yBAC5B,OAAO,EAERtC,cAAeC","file":"cleantalk-comments-checkspam.min.js","sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_comments_check=0; path=/';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_total, ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/';\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_safe_check=1; path=/';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_delete_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_delete_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam_total';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_delete_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\t// jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});\n\tjQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range, #ct_accurate_check\").on('change', function(){\n\t\tct_toggle_depended(jQuery(this));\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val(),\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_comments_check=0; path=/';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_comments_check=' + JSON.stringify(ct_check) + '; path=/';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_delete_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_deletion_all))\n\t\t\treturn false;\n\n\t\tct_delete_all( e );\n\n\t});\n\n});"]}
js/cleantalk-comments-editscreen.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-comments-editscreen.js"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg_whitelisted","ct_feedback_msg","is","ct_feedback_msg_blacklisted","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTime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Content":["function ct_is_email(str){\r\n\treturn str.search(/.*@.*\\..*/);\r\n}\r\nfunction ct_is_ip(str){\r\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\t/* Shows link to blacklists near every email and IP address */\r\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\r\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\r\n\t\t\tvar ct_curr_str = jQuery(this).html();\r\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\r\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t/* Feedback for comments */\r\n\tvar ct_comment_id;\r\n\t\r\n\t// For approved\r\n\tjQuery('span.approve').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tundo_comment_id = ct_comment_id;\r\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\r\n\t});\r\n\t\r\n\t// For unapprove\r\n\tjQuery('span.unapprove').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tundo_comment_id = ct_comment_id;\r\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\r\n\t});\r\n\t\r\n\t// For spammed\r\n\tjQuery('span.spam').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tundo_comment_id = ct_comment_id;\r\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\r\n\t\t\r\n\t\tsetTimeout(function(){\r\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\r\n\t\t\t\tvar result = jQuery(this).attr('href');\r\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\r\n\t\t\t\tct_comment_id = result[1];\r\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\r\n\t\t\t});\r\n\t\t}, 202);\r\n\t\t\r\n\t});\r\n\t\r\n\t// For unspammed\r\n\tjQuery('span.unspam').on('click', function(){\r\n\t\tvar result = jQuery(this).children('a').attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\r\n\t});\r\n\t\r\n\t// For untrashed\r\n\tjQuery('span.untrash a').on('click', function(){\r\n\t\tvar result = jQuery(this).attr('href');\r\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\r\n\t\tct_comment_id = result[1];\r\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\r\n\t});\t\r\n});\r\n\r\n// Send feedback to backend\r\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\r\n\t\r\n\tvar data = {\r\n\t\t'action': 'ct_feedback_comment',\r\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\r\n\t\t'comment_id': ct_comment_id,\r\n\t\t'comment_status': ct_comment_status\r\n\t};\r\n\t\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\r\n\t\t},\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tconsole.log(jqXHR);\r\n\t\t\tconsole.log(textStatus);\r\n\t\t\tconsole.log(errorThrown);\r\n\t\t},\r\n timeout: 5000\r\n\t});\r\n}\r\n\r\n// Outputs CT message about feedback\r\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\r\n\tif(ct_result == 1){\r\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\r\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\r\n\t\t\t\t.html('')\r\n\t\t\t\t.show()\r\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\r\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\r\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg_whitelisted+\" \"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\t\t\t\t\t\t\r\n\t\t}\r\n\t\tif(ct_comment_status == 'spam'){\r\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\r\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\r\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\r\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\r\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg_blacklisted+\" \"+ctCommentsScreen.ct_feedback_msg);\r\n\t\t\t}else{\r\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\r\n\t\t\t\t.html('')\r\n\t\t\t\t.show()\r\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\r\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\r\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg_blacklisted+\" \"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif(ct_result == 0){\r\n\t\t// Error occurred\r\n\t}if(ct_result == 'no_hash'){\r\n\t\t// No hash for this comment\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"sources":["cleantalk-comments-editscreen.js"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg_whitelisted","ct_feedback_msg","is","ct_feedback_msg_blacklisted","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCAwEnB,SAASE,yBAAyBC,EAAeC,EAAmBC,GAEnE,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,iBAAiBC,cAC7BC,WAAcR,EACdS,eAAkBR,GAGnBS,OAAOC,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLX,KAAMA,EACNY,QAAS,SAASC,GACjBC,2BAA2BjB,EAAeC,EAAmBe,EAAKd,IAE7DgB,MAAO,SAASC,EAAOC,EAAYC,GACxCC,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEPG,QAAS,MAKjB,SAASP,2BAA2BjB,EAAeC,EAAmBwB,EAAWvB,GAChE,GAAbuB,IACsB,WAArBxB,GAAmCC,GACrCQ,OAAO,cAAcV,GACnB0B,KAAK,IACLC,OACAC,OAAO,yBAAyBC,SAAS,MACxCC,IAAI,aAAc,yBAClBF,OAAO,iCAAiCtB,iBAAiByB,4BAA4B,IAAIzB,iBAAiB0B,gBAAgB,UAEtG,QAArB/B,IACCS,OAAO,MAAMuB,GAAG,SAASjC,IAC3BU,OAAO,WAAWV,GAChB8B,IAA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AOE,MAAM,+BAEtBhD,yBADAC,EAAgB6C,EAAO,GACiB,UAAW,MAElD,OAKJnC,OAAO,eAAekC,GAAG,QAAS,WACjC,IAAIC,EAASnC,OAAO+B,MAAMZ,SAAS,KAAKiB,KAAK,QAC7CD,EAASA,EAAOE,MAAM,8BAEtBhD,yBADAC,EAAgB6C,EAAO,GACiB,UAAW,KAIpDnC,OAAO,kBAAkBkC,GAAG,QAAS,WACpC,IAAIC,EAASnC,OAAO+B,MAAMK,KAAK,QAC/BD,EAASA,EAAOE,MAAM,8BACtB/C,EAAgB6C,EAAO,GACvBM,gBAAkBpD,yBAAyBC,EAAe,UAAW","file":"cleantalk-comments-editscreen.min.js","sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\t\t\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\t\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\n\t\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\n\t});\n\t\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\t\t\n\t});\n\t\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\t\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\t\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\t\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg_whitelisted+\" \"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\t\t\t\t\t\t\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg_blacklisted+\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg_blacklisted+\" \"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"]}
js/cleantalk-dashboard-widget.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-dashboard-widget.js"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","ctParseData","apbctDashboardWidget","addRows","options","width","first","height","colors","legend","bar","groupWidth","chartArea","left","vAxis","gridlines","count","ColumnChart","draw"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGtBF,OAAO,2BAA2BG,GAAG,QAAS,WAC7CH,OAAO,iBAAiBI,OACxBC,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsBQ,SAASC,IAAM,MAAQ,GAC7FJ,WAAW,WAAWL,OAAO,oBAAoBU,UAAY,QAG1C,cAAjBC,SAASC,MACXP,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsBQ,SAASC,IAAM,MAAQ,GAG9FT,OAAO,sBAAsBa,SAASC,IAAI,UAAW,GAGrD,IAAIC,EAAWd,SAASe,eAAe,mBACtCC,EAASC,UAAUC,UAAYD,UAAUE,aAgB1CC,OAAOC,OAAOC,KAAK,UAAW,CAACC,SAAS,CAAC,YAAa,SACtDH,OAAOC,OAAOG,kBAEd,WACC,IAAIC,EAAO,IAAIL,OAAOM,cAAcC,UACpCF,EAAKG,UAAU,SAAU,gBACzBH,EAAKG,UAAU,SAAU,aApB1B,SAAqBC,GACpB,IAAIC,EAAiB,IAAIC,KAAKC,eAAehB,EAAQ,CACpDiB,MAAO,QACPC,IAAK,YAENL,EAAKM,KAAK,SAASC,EAAEC,GACpB,OAAO,IAAIC,KAAKF,EAAE,IAAM,IAAIE,KAAKD,EAAE,MAEpCR,EAAKU,QAAQ,SAASC,GACrBA,EAAE,GAAKF,KAAKG,MAAMD,EAAE,IACpBA,EAAE,GAAKV,EAAeY,OAAOF,EAAE,MAYhCG,CAAYC,qBAAqBnB,MACjCA,EAAKoB,QAAQD,qBAAqBnB,MAElC,IAAIqB,EAAU,CACbC,MAAOhD,OAAO,oBAAoBiD,QAAQD,QAC1CE,OAAQ,IACRC,OAAQ,CAAC,aACTC,OAAQ,OACRC,IAAK,CAACC,WAAY,OAClBC,UAAU,CAACC,KAAK,GAAG/C,IAAI,GAAGuC,MAAM,MAAME,OAAO,OAC7CO,MAAO,CAAEC,UAAW,CAAEC,MAAO,KAG9B,GAAG5C,EAAS,CACC,IAAIM,OAAOM,cAAciC,YAAY7C,GAC3C8C,KAAKnC,EAAMqB","file":"cleantalk-dashboard-widget.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\t\r\n\t// Set \"refresh\" link handler\r\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\r\n\t\tjQuery('.ct_preloader').show();\r\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\r\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\r\n\t});\r\n\t\r\n\tif(location.hash == '#ct_widget')\r\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\r\n\t\r\n\t// Fixing default wrapper style\r\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\r\n\t\r\n\t// Chart \r\n\tvar ct_chart = document.getElementById('ct_widget_chart'),\r\n\t\tlocale = navigator.language || navigator.userLanguage;\r\n\t\t\r\n\tfunction ctParseData(date){\r\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\r\n\t\t\tmonth: \"short\",\r\n\t\t\tday: \"numeric\"\r\n\t\t});\t\r\n\t\tdate.sort(function(a,b){\r\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \r\n\t\t});\t\t\t\r\n\t\tdate.forEach(function(d){\t\r\n\t\t\td[0] = Date.parse(d[0]);\r\n\t\t\td[0] = date_formatter.format(d[0]);\r\n\t\t});\t\t\r\n\t}\r\n\t\t\r\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\r\n\tgoogle.charts.setOnLoadCallback(drawStuff);\r\n\r\n\tfunction drawStuff() {\r\n\t\tvar data = new google.visualization.DataTable();\r\n\t\tdata.addColumn('string', 'Spam Blocked');\r\n\t\tdata.addColumn('number', 'Frequency');\r\n\t\t\r\n\t\tctParseData(apbctDashboardWidget.data);\r\n\t\tdata.addRows(apbctDashboardWidget.data);\r\n\t\r\n\t\tvar options = {\r\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\r\n\t\t\theight: 300,\r\n\t\t\tcolors: ['steelblue'],\r\n\t\t\tlegend: 'none',\r\n\t\t\tbar: {groupWidth: '95%'},\r\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\r\n\t\t\tvAxis: { gridlines: { count: 5 } }\r\n\t\t};\r\n\r\n\t\tif(ct_chart){\r\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\r\n\t\t\tchart.draw(data, options);\r\n\t\t}\r\n\t};\t\r\n});"]}
1
+ {"version":3,"sources":["cleantalk-dashboard-widget.js"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","ctParseData","apbctDashboardWidget","addRows","options","width","first","height","colors","legend","bar","groupWidth","chartArea","left","vAxis","gridlines","count","ColumnChart","draw"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGtBF,OAAO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qB","file":"cleantalk-dashboard-widget.min.js","sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set \"refresh\" link handler\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.ct_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\n\t});\n\t\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\n\t\n\t// Fixing default wrapper style\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\n\t\n\t// Chart \n\tvar ct_chart = document.getElementById('ct_widget_chart'),\n\t\tlocale = navigator.language || navigator.userLanguage;\n\t\t\n\tfunction ctParseData(date){\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\t\tmonth: \"short\",\n\t\t\tday: \"numeric\"\n\t\t});\t\n\t\tdate.sort(function(a,b){\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \n\t\t});\t\t\t\n\t\tdate.forEach(function(d){\t\n\t\t\td[0] = Date.parse(d[0]);\n\t\t\td[0] = date_formatter.format(d[0]);\n\t\t});\t\t\n\t}\n\t\t\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\n\tgoogle.charts.setOnLoadCallback(drawStuff);\n\n\tfunction drawStuff() {\n\t\tvar data = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Spam Blocked');\n\t\tdata.addColumn('number', 'Frequency');\n\t\t\n\t\tctParseData(apbctDashboardWidget.data);\n\t\tdata.addRows(apbctDashboardWidget.data);\n\t\n\t\tvar options = {\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\n\t\t\theight: 300,\n\t\t\tcolors: ['steelblue'],\n\t\t\tlegend: 'none',\n\t\t\tbar: {groupWidth: '95%'},\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\n\t\t\tvAxis: { gridlines: { count: 5 } }\n\t\t};\n\n\t\tif(ct_chart){\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\n\t\t\tchart.draw(data, options);\n\t\t}\n\t};\t\n});"]}
js/cleantalk-debug-ajax.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-debug-ajax.js"],"names":["jQuery","document","ready","console","log","ajaxComplete","event","xhr","settings","data"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAEtBC,QAAQC,IAAI,YAGZJ,OAAOC,UAAUI,aAAa,SAASC,EAAOC,EAAKC,EAAUC,GAC5DN,QAAQC,IAAI,YACZD,QAAQC,IAAI,YACZD,QAAQC,IAAIE,GACZH,QAAQC,IAAI,eACZD,QAAQC,IAAIG,GACZJ,QAAQC,IAAI,uBACZD,QAAQC,IAAII,GACZL,QAAQC,IAAI,WACZD,QAAQC,IAAIK","file":"cleantalk-debug-ajax.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\r\n\tconsole.log('CT debug');\r\n\r\n\t// Debug. Console all AJAX requests.\r\n\tjQuery(document).ajaxComplete(function(event, xhr, settings, data) {\r\n\t\tconsole.log(\"Success!\")\r\n\t\tconsole.log('Event:\\n');\r\n\t\tconsole.log(event);\r\n\t\tconsole.log('Response:\\n');\r\n\t\tconsole.log(xhr);\r\n\t\tconsole.log('Request settings:\\n');\r\n\t\tconsole.log(settings);\r\n\t\tconsole.log('Data:\\n');\r\n\t\tconsole.log(data);\r\n\t});\r\n\t\t\r\n});"]}
1
+ {"version":3,"sources":["cleantalk-debug-ajax.js"],"names":["jQuery","document","ready","console","log","ajaxComplete","event","xhr","settings","data"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAEtBC,QAAQC,IAAI,YAGZJ,OAAOC,UAAUI,aAAa,SAASC,EAAOC,EAAKC,EAAUC,GAC5DN,QAAQC,IAAI,YACZD,QAAQC,IAAI,YACZD,QAAQC,IAAIE,GACZH,QAAQC,IAAI,eACZD,QAAQC,IAAIG,GACZJ,QAAQC,IAAI,uBACZD,QAAQC,IAAII,GACZL,QAAQC,IAAI,WACZD,QAAQC,IAAIK","file":"cleantalk-debug-ajax.min.js","sourcesContent":["jQuery(document).ready(function(){\n\n\tconsole.log('CT debug');\n\n\t// Debug. Console all AJAX requests.\n\tjQuery(document).ajaxComplete(function(event, xhr, settings, data) {\n\t\tconsole.log(\"Success!\")\n\t\tconsole.log('Event:\\n');\n\t\tconsole.log(event);\n\t\tconsole.log('Response:\\n');\n\t\tconsole.log(xhr);\n\t\tconsole.log('Request settings:\\n');\n\t\tconsole.log(settings);\n\t\tconsole.log('Data:\\n');\n\t\tconsole.log(data);\n\t});\n\t\t\n});"]}
js/cleantalk-public-admin.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-public-admin.js"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_comment_status","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGvBF,OAAO,oBAAoBG,UAAUC,KAAK,WACxC,GAAwD,GAAnDC,EAAIL,OAAOM,MAAMC,IAAI,qBAAqBC,QAAmB,oBAALH,EAE5D,OADAL,OAAO,oBAAoBO,IAAI,aAAcF,IACtC,IAKT,IAAII,EAAgBT,OAAO,oBAAoBU,OAAOC,OAAOJ,IAAI,SACjEP,OAAO,oBAAoBO,IAAI,QAASE,GAExC,IAAIG,EAAWZ,OAAO,oBAEtBA,OAAOY,GAAUR,KAAK,SAASS,EAAMC,GACpCC,UAAYf,OAAOc,GACnBC,UAAUC,SAASC,QAAQF,aAI5Bf,OAAO,eAAekB,GAAG,QAAS,WAEjC,IAGCC,EAHGC,EAAoBpB,OAAOM,MAC9Be,EAAmBrB,OAAOM,MAAMgB,SAAS,qBACzCC,EAAkBvB,OAAO,oBAIzBmB,EADEC,EAAkBI,SAAS,mBACT,OAEA,UAErB,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,cAAcC,cAC1BC,WAAcV,EAAkBW,KAAK,aACrCC,eAAkBb,EAClBc,cAAiB,GAGlBjC,OAAOkC,KAAK,CACXC,KAAM,OACNC,IAAKR,cAAcS,QACnBZ,KAAMA,EACNa,QAAS,SAASC,GACjBnB,EAAkBoB,OAClBpB,EAAkBE,SAAS,mBAAmBmB,OAE9CzC,OAAO,uBAAuBwC,OACN,WAArBrB,EACFnB,OAAO,gCAAgCyC,OAEvCzC,OAAO,4BAA4ByC,OAE1B,GAAPF,GACFhB,EAAgBmB,SAAS,uBACzBnB,EAAgBoB,KAAKf,cAAcL,kBACpB,GAAPgB,GAERhB,EAAgBmB,SAAS,qBACzBnB,EAAgBoB,KAAKf,cAAcgB,oBACpB,WAAPL,IAERhB,EAAgBmB,SAAS,uBACzBnB,EAAgBoB,KAAKf,cAAciB,sBAGpCxB,EAAiBoB,OACjBpB,EAAiBd,IAAI,UAAW,gBAEhC,IAAIuC,EAAgBzB,EAAiBI,KAAK,eAC1CsB,cAAcD,GACdA,EAAgBE,WAAW,WAC1B3B,EAAiB4B,QAAQ,MACvB,KACH5B,EAAiBI,KAAK,cAAeqB,IAEtCI,MAAO,SAASC,EAAOC,EAAYC,GAClCC,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbG,QAAS","file":"cleantalk-public-admin.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\t\r\n\t// Set background-color similar to parents\r\njQuery('.ct_comment_info').parents().each(function() {\r\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \r\n \tjQuery('.ct_comment_info').css('background', e);\r\n \treturn false;\r\n }\r\n});\r\n\t\r\n\t// Set same float style with article\r\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\r\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\r\n\t\r\n\tvar ct_posts = jQuery('.ct_comment_info');\r\n\t\r\n\tjQuery(ct_posts).each(function(indx, elem){\r\n\t\tcurr_elem = jQuery(elem);\r\n\t\tcurr_elem.parent().prepend(curr_elem);\r\n\t});\r\n\t\r\n\t// Handler for buttons\r\n\tjQuery('.ct_this_is').on('click', function(){\r\n\t\t\r\n\t\tvar ct_current_button = jQuery(this),\r\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\r\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\r\n\t\t\tct_comment_status;\r\n\t\t\t\r\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\r\n\t\t\tct_comment_status = 'spam';\r\n\t\telse\r\n\t\t\tct_comment_status = 'approve';\r\n\t\t\r\n\t\tvar data = {\r\n\t\t\t'action': 'ct_feedback_comment',\r\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\r\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\r\n\t\t\t'comment_status': ct_comment_status,\r\n\t\t\t'change_status': 1\r\n\t\t};\r\n\t\t\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ctPublicAdmin.ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tct_current_button.hide();\r\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\r\n\t\t\t\t\r\n\t\t\t\tjQuery('.ct_feedback_result').hide();\r\n\t\t\t\tif(ct_comment_status == 'approve')\r\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\r\n\t\t\t\telse\r\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\r\n\t\t\t\t\r\n\t\t\t\tif(msg == 1){\r\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\r\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\r\n\t\t\t\t}else if(msg == 0){\r\n\t\t\t\t\t// Error occurred\r\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\r\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\r\n\t\t\t\t}else if(msg == 'no_hash'){\r\n\t\t\t\t\t// No hash for this comment\r\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\r\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\r\n\t\t\t\t}\r\n\t\t\t\t// Hidding feedback message for every message type\r\n\t\t\t\tct_feedback_wrap.show();\r\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\r\n\t\t\t\t\r\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\r\n\t\t\t\tclearInterval(ct_timeout_id);\r\n\t\t\t\tct_timeout_id = setTimeout(function(){\r\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\r\n\t\t\t\t}, 5000);\r\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\r\n\t\t\t},\r\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\t\tconsole.log(jqXHR);\r\n\t\t\t\tconsole.log(textStatus);\r\n\t\t\t\tconsole.log(errorThrown);\r\n\t\t\t},\r\n\t\t\ttimeout: 5000\r\n\t\t});\r\n\t});\r\n\t\r\n});"]}
1
+ {"version":3,"sources":["cleantalk-public-admin.js"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_comment_status","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGvBF,OAAO,oBAAoBG,UAAUC,KAAK,WACxC,GAAwD,GAAnDC,EAAIL,OAAOM,MAAMC,IAAI,qBAAqBC,QAAmB,oBAALH,EAE5D,OADAL,OAAO,oBAAoBO,IAAI,aAAcF,IACtC,IAKT,IAAII,EAAgBT,OAAO,oBAAoBU,OAAOC,OAAOJ,IAAI,SACjEP,OAAO,oBAAoBO,IAAI,QAASE,GAExC,IAAIG,EAAWZ,OAAO,oBAEtBA,OAAOY,GAAUR,KAAK,SAASS,EAAMC,GACpCC,UAAYf,OAAOc,GACnBC,UAAUC,SAASC,QAAQF,aAI5Bf,OAAO,eAAekB,GAAG,QAAS,WAEjC,IAGCC,EAHGC,EAAoBpB,OAAOM,MAC9Be,EAAmBrB,OAAOM,MAAMgB,SAAS,qBACzCC,EAAkBvB,OAAO,oBAIzBmB,EADEC,EAAkBI,SAAS,mBACT,OAEA,UAErB,IAAIC,EAAO,CACVC,OAAU,sBACVC,SAAYC,cAAcC,cAC1BC,WAAcV,EAAkBW,KAAK,aACrCC,eAAkBb,EAClBc,cAAiB,GAGlBjC,OAAOkC,KAAK,CACXC,KAAM,OACNC,IAAKR,cAAcS,QACnBZ,KAAMA,EACNa,QAAS,SAASC,GACjBnB,EAAkBoB,OAClBpB,EAAkBE,SAAS,mBAAmBmB,OAE9CzC,OAAO,uBAAuBwC,OACN,WAArBrB,EACFnB,OAAO,gCAAgCyC,OAEvCzC,OAAO,4BAA4ByC,OAE1B,GAAPF,GACFhB,EAAgBmB,SAAS,uBACzBnB,EAAgBoB,KAAKf,cAAcL,kBACpB,GAAPgB,GAERhB,EAAgBmB,SAAS,qBACzBnB,EAAgBoB,KAAKf,cAAcgB,oBACpB,WAAPL,IAERhB,EAAgBmB,SAAS,uBACzBnB,EAAgBoB,KAAKf,cAAciB,sBAGpCxB,EAAiBoB,OACjBpB,EAAiBd,IAAI,UAAW,gBAEhC,IAAIuC,EAAgBzB,EAAiBI,KAAK,eAC1CsB,cAAcD,GACdA,EAAgBE,WAAW,WAC1B3B,EAAiB4B,QAAQ,MACvB,KACH5B,EAAiBI,KAAK,cAAeqB,IAEtCI,MAAO,SAASC,EAAOC,EAAYC,GAClCC,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbG,QAAS","file":"cleantalk-public-admin.min.js","sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set background-color similar to parents\njQuery('.ct_comment_info').parents().each(function() {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \n \tjQuery('.ct_comment_info').css('background', e);\n \treturn false;\n }\n});\n\t\n\t// Set same float style with article\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\n\t\n\tvar ct_posts = jQuery('.ct_comment_info');\n\t\n\tjQuery(ct_posts).each(function(indx, elem){\n\t\tcurr_elem = jQuery(elem);\n\t\tcurr_elem.parent().prepend(curr_elem);\n\t});\n\t\n\t// Handler for buttons\n\tjQuery('.ct_this_is').on('click', function(){\n\t\t\n\t\tvar ct_current_button = jQuery(this),\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\n\t\t\tct_comment_status;\n\t\t\t\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\n\t\t\tct_comment_status = 'spam';\n\t\telse\n\t\t\tct_comment_status = 'approve';\n\t\t\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\n\t\t\t'comment_status': ct_comment_status,\n\t\t\t'change_status': 1\n\t\t};\n\t\t\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublicAdmin.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_current_button.hide();\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\n\t\t\t\t\n\t\t\t\tjQuery('.ct_feedback_result').hide();\n\t\t\t\tif(ct_comment_status == 'approve')\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\n\t\t\t\telse\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\n\t\t\t\t\n\t\t\t\tif(msg == 1){\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n\t\t\t\t}else if(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n\t\t\t\t}else if(msg == 'no_hash'){\n\t\t\t\t\t// No hash for this comment\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n\t\t\t\t}\n\t\t\t\t// Hidding feedback message for every message type\n\t\t\t\tct_feedback_wrap.show();\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\n\t\t\t\t\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\n\t\t\t\tclearInterval(ct_timeout_id);\n\t\t\t\tct_timeout_id = setTimeout(function(){\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\n\t\t\t\t}, 5000);\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t});\n\t\n});"]}
js/cleantalk-users-checkspam.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-users-checkspam.js"],"names":["String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","is","val","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","setTimeout","check_amount","new_check","unchecked","amount","parseJSON","parseInt","error","confirm","error_message","new_href","location","href","end","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_delete_all_users","e","target","addClass","css","removeClass","ready","state","on","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","click","ct_check","accurate","JSON","stringify","ct_id","attr","fadeOut","remove","user_id","status","filename","ct_csv_filename","ct_bad_csv","URL","createObjectURL","Blob","dummy","createElement","download","body","appendChild","ct_confirm_deletion_all"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAAY,CAC9B,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,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AG1B,IAAIlF,EAAO,CACVC,OAAU,uBACVC,SAAYlC,cACZwB,GAAMyF,OAEPxF,OAAOU,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN,KAAMA,EACNO,QAAS,SAASC,GACjBf,OAAO,YAAYwF,OAAOE,QAAQ,OAAQ,WACzC1F,OAAO,YAAYwF,OAAOG,cAMzBpF,EAAO,CACVC,OAAU,mBACVC,SAAYlC,cACZqH,QAAWJ,MACXK,OAAU,WAEX7F,OAAOU,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN,KAAMA,EACNO,QAAS,SAASC,KAWlBW,MAAO,SAASe,EAAOC,EAAYC,KAGnCE,QAAS,QAMX7C,OAAO,oBAAoBmF,MAAM,SAAU1B,GAC1C,IAAIlD,EAAO,CACVC,OAAU,uBACVC,SAAYlC,cACZuH,SAAY7H,aAAa8H,iBAE1B/F,OAAO,IAAMyD,EAAEC,OAAO3D,IAAI4D,SAAS,YACnC3D,OAAO,YAAY4D,IAAI,aAAc,WACrC5D,OAAOU,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN,KAAMA,EACNO,QAAS,SAASC,GACjB,GAAsB,IAAlBU,SAASV,GACZwC,MAAMtF,aAAa+H,gBACb,CACN,IAAIpF,EAAMqF,IAAIC,gBAAgB,IAAIC,KAAK,CAACpF,KAEpCqF,EAAQ3I,SAAS4I,cAAc,KACnCD,EAAMrE,KAAOnB,EACbwF,EAAME,SAAWrI,aAAa8H,gBAAkB,OAEhDtI,SAAS8I,KAAKC,YAAYJ,GAC1BA,EAAMjB,QAEPnF,OAAO,IAAMyD,EAAEC,OAAO3D,IAAI8D,YAAY,YACtC7D,OAAO,YAAY4D,IAAI,aAAc,eAMxC5D,OAAO,wBAAwBmF,MAAM,SAAU1B,GAE9C,IAAO9B,QAAS1D,aAAawI,yBAC5B,OAAO,EAORjD,oBAAqBC","file":"cleantalk-users-checkspam.min.js","sourcesContent":["// Printf for JS\r\nString.prototype.printf = function(){\r\n var formatted = this;\r\n for( var arg in arguments ) {\r\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\r\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\r\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\r\n }\r\n return formatted;\r\n};\r\n\r\n// Set deafult amount to check by request.\r\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/\";\r\n\r\n// Flags\r\nvar ct_working = false,\r\n\tct_new_check = true,\r\n\tct_cooling_down_flag = false,\r\n\tct_close_animate = true,\r\n\tct_accurate_check = false,\r\n\tct_pause = false,\r\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\r\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\r\n\tct_prev_till = ctUsersCheck.ct_prev_till;\r\n// Settings\r\nvar ct_cool_down_time = 90000,\r\n\tct_requests_counter = 0,\r\n\tct_max_requests = 60;\r\n// Variables\r\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\r\n\tct_users_total = 0,\r\n\tct_users_checked = 0,\r\n\tct_users_spam = 0,\r\n\tct_users_bad = 0,\r\n\tct_unchecked = 'unset',\r\n\tct_date_from = 0,\r\n\tct_date_till = 0;\r\n\r\n/* Function: Reuturns cookie with prefix */\r\nfunction apbct_cookie__get(names, prefixes){\r\n\tvar cookie = {};\r\n\tnames = names || null;\r\n\tif(typeof names == 'string') names = names.split();\r\n\tprefixes = prefixes || ['apbct_', 'ct_'];\r\n\tif(prefixes === 'none') prefixes = null;\r\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\r\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\r\n\t\tvar curr = item.trim().split('=');\r\n\t\t// Detect by full cookie name\r\n\t\tif(names){\r\n\t\t\tnames.forEach(function(name, i, all){\r\n\t\t\t\tif(curr[0] === name)\r\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\r\n\t\t\t});\r\n\t\t}\r\n\t\t// Detect by name prefix\r\n\t\tif(prefixes){\r\n\t\t\tprefixes.forEach(function(prefix, i, all){\r\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\r\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\treturn cookie;\r\n}\r\n\r\nfunction apbct_get_cookie( name ){\r\n\tvar cookie = apbct_cookie__get( name, name );\r\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\r\n\t\treturn cookie[name];\r\n\t}else\r\n\t\treturn null;\r\n}\r\n\r\nfunction animate_comment(to,id){\r\n\tif(ct_close_animate){\r\n\t\tif(to === 0.3){\r\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\r\n\t\t\t\tanimate_comment(1,id)\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\r\n\t\t\t\tanimate_comment(0.3,id)\r\n\t\t\t});\r\n\t\t}\r\n\t}else{\r\n\t\tct_close_animate=true;\r\n\t}\r\n}\r\n\r\nfunction ct_clear_users(){\r\n\r\n\tvar from = 0, till = 0;\r\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\r\n\t\tfrom = jQuery('#ct_date_range_from').val();\r\n\t\ttill = jQuery('#ct_date_range_till').val();\r\n\t}\r\n\tvar data = {\r\n\t\t'action' : 'ajax_clear_users',\r\n\t\t'security' : ct_ajax_nonce,\r\n\t\t'from' : from,\r\n\t\t'till' : till\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\tct_show_users_info();\r\n\t\t\tct_send_users();\r\n\t\t}\r\n\t});\r\n\r\n}\r\n\r\n//Continues the check after cooldown time\r\n//Called by ct_send_users();\r\nfunction ct_cooling_down_toggle(){\r\n\tct_cooling_down_flag = false;\r\n\tct_send_users();\r\n\tct_show_users_info();\r\n}\r\n\r\nfunction ct_send_users(){\r\n\t\r\n\tif(ct_cooling_down_flag === true)\r\n\t\treturn;\r\n\t\r\n\tif(ct_requests_counter >= ct_max_requests){\r\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\r\n\t\tct_requests_counter = 0;\r\n\t\tct_cooling_down_flag = true;\r\n\t\treturn;\r\n\t}else{\r\n\t\tct_requests_counter++;\r\n\t}\r\n\r\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\r\n\r\n\tvar data = {\r\n\t\taction: 'ajax_check_users',\r\n\t\tsecurity: ct_ajax_nonce,\r\n\t\tnew_check: ct_new_check,\r\n\t\tunchecked: ct_unchecked,\r\n\t\tamount: check_amount\r\n\t};\r\n\t\r\n\tif(ct_accurate_check)\r\n\t\tdata['accurate_check'] = true;\r\n\t\r\n\tif(ct_date_from && ct_date_till){\r\n\t\tdata['from'] = ct_date_from;\r\n\t\tdata['till'] = ct_date_till;\r\n\t}\r\n\t\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(msg){\r\n\t\t\t\r\n\t\t\tmsg = jQuery.parseJSON(msg);\r\n\t\t\t\r\n\t\t\tif(parseInt(msg.error)){\r\n\t\t\t\tct_working=false;\r\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\r\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\r\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\r\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\t\t\t\tlocation.href = new_href;\r\n\t\t\t\t}else\r\n\t\t\t\t\tct_send_users();\r\n\t\t\t}else{\r\n\t\t\t\tct_new_check = false;\r\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\r\n\t\t\t\t\tif(parseInt(msg.end) == 1)\r\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/';\r\n\t\t\t\t\tct_working=false;\r\n\t\t\t\t\tjQuery('#ct_working_message').hide();\r\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\r\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\r\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\r\n\t\t\t\t\tlocation.href = new_href;\r\n\t\t\t\t}else if(parseInt(msg.end) == 0){\r\n\t\t\t\t\tct_users_checked += msg.checked;\r\n\t\t\t\t\tct_users_spam += msg.spam;\r\n\t\t\t\t\tct_users_bad += msg.bad;\r\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\r\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\r\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\r\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\r\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\r\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\r\n\t\t\t\t\tjQuery('#ct_error_message').hide();\r\n\t\t\t\t\tct_send_users();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n error: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tif(check_amount > 20){\r\n\t\t\t\tcheck_amount -= 20;\r\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/\";\r\n\t\t\t}\r\n\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\r\n\t\t\tsetTimeout(ct_send_users(), 3000);\r\n },\r\n timeout: 25000\r\n\t});\r\n}\r\nfunction ct_show_users_info(){\r\n\t\r\n\tif( ct_working ){\r\n\t\t\r\n\t\tif(ct_cooling_down_flag == true){\r\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\r\n\t\t\tjQuery('#ct_cooling_notice').show();\r\n\t\t\treturn;\t\t\t\r\n\t\t}else{\r\n\t\t\tjQuery('#ct_cooling_notice').hide();\r\n\t\t}\r\n\t\t\r\n\t\tif( ! ct_users_total ){\r\n\t\t\t\r\n\t\t\tvar data = {\r\n\t\t\t\t'action': 'ajax_info_users',\r\n\t\t\t\t'security': ct_ajax_nonce\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif( ct_date_from && ct_date_till ){\r\n\t\t\t\tdata['from'] = ct_date_from;\r\n\t\t\t\tdata['till'] = ct_date_till;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tjQuery.ajax({\r\n\t\t\t\ttype: \"POST\",\r\n\t\t\t\turl: ajaxurl,\r\n\t\t\t\tdata: data,\r\n\t\t\t\tsuccess: function(msg){\r\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\r\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\r\n\t\t\t\t\tct_users_spam = msg.spam;\r\n\t\t\t\t\tct_users_checked = msg.checked;\r\n\t\t\t\t\tct_users_bad = msg.bad;\r\n\t\t\t\t},\r\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\r\n\t\t\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\r\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\r\n\t\t\t\t},\r\n\t\t\t\ttimeout: 15000\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n// Function to toggle dependences\r\nfunction ct_toggle_depended(obj, secondary){\r\n\r\n secondary = secondary || null;\r\n\r\n\tvar depended = jQuery(obj.data('depended')),\r\n\t\tstate = obj.data('state');\r\n\t\t\r\n\tif(!state && !secondary){\r\n\t\tobj.data('state', true);\r\n\t\tdepended.removeProp('disabled');\r\n\t}else{\r\n\t\tobj.data('state', false);\r\n\t\tdepended.prop('disabled', true);\r\n\t\tdepended.removeProp('checked');\r\n\t\tif(depended.data('depended'))\r\n\t\t\tct_toggle_depended(depended, true);\r\n\t}\r\n}\r\n\r\n// Main function of checking\r\nfunction ct_start_check( continue_check ){\r\n\r\n\tcontinue_check = continue_check || null;\r\n\r\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\r\n\r\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\r\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\r\n\r\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\r\n\t\t\talert('Please, specify a date range.');\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tif(jQuery('#ct_accurate_check').is(':checked')){\r\n\t\tct_accurate_check = true;\r\n\t}\r\n\r\n\tjQuery('.ct_to_hide').hide();\r\n\tjQuery('#ct_working_message').show();\r\n\tjQuery('#ct_preloader').show();\r\n\tjQuery('#ct_pause').show();\r\n\r\n\tct_working = true;\r\n\r\n\tif( continue_check ){\r\n\t\tct_show_users_info();\r\n\t\tct_send_users();\r\n\t} else {\r\n\t\tct_clear_users();\r\n\t}\r\n\r\n}\r\n\r\nfunction ct_delete_all_users( e ){\r\n\r\n\tjQuery('.' + e.target.id).addClass('disabled');\r\n\tjQuery('.spinner').css('visibility', 'visible');\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function( msg ){\r\n\t\t\tif( msg > 0 ){\r\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\r\n\t\t\t\tct_delete_all_users( e );\r\n\t\t\t}else{\r\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\r\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\r\n\t\t\t\tlocation.href='users.php?page=ct_check_users_total';\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\tjQuery('#ct_error_message').show();\r\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\r\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\r\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\r\n\t\t},\r\n\t\ttimeout: 25000\r\n\t});\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\t// Setting dependences\r\n\t// jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});\r\n\tjQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});\r\n\t\r\n\t// Prev check parameters\r\n\tif(ct_prev_accurate){\r\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\r\n\t}\r\n\tif(ct_prev_from){\r\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\r\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\r\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\r\n\t}\r\n\t\r\n\t// Toggle dependences\r\n\tjQuery(\"#ct_allow_date_range, #ct_accurate_check\").on('change', function(){\r\n\t\tct_toggle_depended(jQuery(this));\r\n\t});\r\n\r\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\r\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\r\n\t\t{\r\n\t\t\tdateFormat: 'M d yy',\r\n\t\t\tmaxDate:\"+0D\",\r\n\t\t\tchangeMonth:true,\r\n\t\t\tchangeYear:true,\r\n\t\t\tshowAnim: 'slideDown',\r\n\t\t\tonSelect: function(selectedDate){\r\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\r\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\r\n\t\t\t\tdate = jQuery.datepicker.parseDate(\r\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\r\n\t\t\t\t\tselectedDate, instance.settings);\r\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n\t\r\n\t// Check users\r\n\tjQuery(\"#ct_check_spam_button\").click(function(){\r\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/';\r\n\t\tct_start_check(false);\r\n\t});\r\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\r\n\t\tct_start_check(true);\r\n\t});\r\n\t\r\n\t// Pause the check\r\n\tjQuery('#ct_pause').on('click', function(){\r\n\t\tct_pause = true;\r\n\t\tvar ct_check = {\r\n\t\t\t'accurate': ct_accurate_check,\r\n\t\t\t'from' : ct_date_from,\r\n\t\t\t'till' : ct_date_till\r\n\t\t};\r\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/';\r\n\t});\r\n\t\t\r\n\t//Approve button\r\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\r\n\t\tct_id = jQuery(this).attr(\"data-id\");\r\n\t\t\r\n\t\t// Approving\r\n\t\tvar data = {\r\n\t\t\t'action': 'ajax_ct_approve_user',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'id': ct_id\r\n\t\t};\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\r\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t});\r\n\t\t\r\n\t\t// Positive feedback\r\n\t\tvar data = {\r\n\t\t\t'action': 'ct_feedback_user',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'user_id': ct_id,\r\n\t\t\t'status': 'approve'\r\n\t\t};\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tif(msg == 1){\r\n\t\t\t\t\t// Success\r\n\t\t\t\t}\r\n\t\t\t\tif(msg == 0){\r\n\t\t\t\t\t// Error occurred\r\n\t\t\t\t}\r\n\t\t\t\tif(msg == 'no_hash'){\r\n\t\t\t\t\t// No hash\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\r\n\t\t\t\t\r\n\t\t\t},\r\n\t\t\ttimeout: 5000\r\n\t\t});\r\n\t\t\r\n\t});\r\n\t\r\n\t// Request to Download CSV file.\r\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\r\n\t\tvar data = {\r\n\t\t\t'action': 'ajax_ct_get_csv_file',\r\n\t\t\t'security': ct_ajax_nonce,\r\n\t\t\t'filename': ctUsersCheck.ct_csv_filename\r\n\t\t};\r\n\t\tjQuery('.' + e.target.id).addClass('disabled');\r\n\t\tjQuery('.spinner').css('visibility', 'visible');\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(msg){\r\n\t\t\t\tif( parseInt(msg) === 0 ) {\r\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\r\n\r\n\t\t\t\t\tvar dummy = document.createElement('a');\r\n\t\t\t\t\tdummy.href = url;\r\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\r\n\r\n\t\t\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\t\t\tdummy.click();\r\n\t\t\t\t}\r\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\r\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t// Delete all spam users\r\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\r\n\r\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\r\n\t\t\treturn false;\r\n\r\n\t\tvar data = {\r\n\t\t\t'action': 'ajax_delete_all_users',\r\n\t\t\t'security': ct_ajax_nonce\r\n\t\t};\r\n\r\n\t\tct_delete_all_users( e );\r\n\r\n\t});\r\n\r\n});"]}
1
+ {"version":3,"sources":["cleantalk-users-checkspam.js"],"names":["String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","is","val","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","setTimeout","check_amount","new_check","unchecked","amount","parseJSON","parseInt","error","confirm","error_message","new_href","location","href","end","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_delete_all_users","e","target","addClass","css","removeClass","ready","state","on","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","click","ct_check","accurate","JSON","stringify","ct_id","attr","fadeOut","remove","user_id","status","filename","ct_csv_filename","ct_bad_csv","URL","createObjectURL","Blob","dummy","createElement","download","body","appendChild","ct_confirm_deletion_all"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAAY,CAC9B,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,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users-checkspam.min.js","sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/\";\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes === 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to === 0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked += msg.checked;\n\t\t\t\t\tct_users_spam += msg.spam;\n\t\t\t\t\tct_users_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/\";\n\t\t\t}\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\t\n\tif( ct_working ){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif( ! ct_users_total ){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif( ct_date_from && ct_date_till ){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert('Please, specify a date range.');\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='users.php?page=ct_check_users_total';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\t// jQuery('#ct_accurate_check') .data({'depended': '#ct_allow_date_range', 'state': false});\n\tjQuery('#ct_allow_date_range').data({'depended': '.ct_date', 'state': false});\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range, #ct_accurate_check\").on('change', function(){\n\t\tct_toggle_depended(jQuery(this));\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t}\n\t\t}\n\t);\n\t\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\t\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/';\n\t});\n\t\t\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve'\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t\t\n\t});\n\t\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tjQuery('.spinner').css('visibility', 'visible');\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif( parseInt(msg) === 0 ) {\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_delete_all_users',\n\t\t\t'security': ct_ajax_nonce\n\t\t};\n\n\t\tct_delete_all_users( e );\n\n\t});\n\n});"]}
js/cleantalk-users-editscreen.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-users-editscreen.js"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCAGnBE,OAAOC,UAAUC,MAAM,WAGnBC,SAASC,cAAcC,sBACzBL,OAAO,mBAAmBM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,MAAMC,QACC,GAA7Bb,YAAYW,IACdP,OAAOQ,MAAME,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB","file":"cleantalk-users-editscreen.min.js","sourcesContent":["function ct_is_email(str){\r\n\treturn str.search(/.*@.*\\..*/);\r\n}\r\nfunction ct_is_ip(str){\r\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\t/* Shows link to blacklists near every email and IP address */\r\n\tif(parseInt(ctUsersScreen.ct_show_check_links))\r\n\t\tjQuery('.column-email a').each(function(){\r\n\t\t\tvar ct_curr_str = jQuery(this).html();\r\n\t\t\tif(ct_is_email(ct_curr_str) != -1){\r\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\r\n\t\t\t}\r\n\t\t});\r\n});"]}
1
+ {"version":3,"sources":["cleantalk-users-editscreen.js"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCAGnBE,OAAOC,UAAUC,MAAM,WAGnBC,SAASC,cAAcC,sBACzBL,OAAO,mBAAmBM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,MAAMC,QACC,GAA7Bb,YAAYW,IACdP,OAAOQ,MAAME,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB","file":"cleantalk-users-editscreen.min.js","sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctUsersScreen.ct_show_check_links))\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n});"]}
js/cleantalk_external.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function ct_protect_external(){for(var t=0;t<document.forms.length;t++)if("string"==typeof document.forms[t].action){var e=document.forms[t].action;if(-1!==e.indexOf("http://")||-1!==e.indexOf("https://")){var n=e.split("//");if((n=n[1].split("/"))[0].toLowerCase()!==location.hostname.toLowerCase()){var o=document.createElement("input");o.name="cleantalk_hidden_action",o.value=e,o.type="hidden",document.forms[t].appendChild(o);var d=document.createElement("input");d.name="cleantalk_hidden_method",d.value=document.forms[t].method,d.type="hidden",document.forms[t].method="POST",document.forms[t].appendChild(d),document.forms[t].action=document.location}}}}window.onload=function(){setTimeout(function(){ct_protect_external()},1500)};
2
  //# sourceMappingURL=cleantalk_external.min.js.map
1
+ function ct_protect_external(){for(var t=0;t<document.forms.length;t++)if(null==document.forms[t].cleantalk_hidden_action&&null==document.forms[t].cleantalk_hidden_method&&"string"==typeof document.forms[t].action){var e=document.forms[t].action;if(-1!==e.indexOf("http://")||-1!==e.indexOf("https://")){var n=e.split("//");if((n=n[1].split("/"))[0].toLowerCase()!==location.hostname.toLowerCase()){var o=document.createElement("input");o.name="cleantalk_hidden_action",o.value=e,o.type="hidden",document.forms[t].appendChild(o);var d=document.createElement("input");d.name="cleantalk_hidden_method",d.value=document.forms[t].method,d.type="hidden",document.forms[t].method="POST",document.forms[t].appendChild(d),document.forms[t].action=document.location}}}}window.onload=function(){setTimeout(function(){ct_protect_external()},1500)};
2
  //# sourceMappingURL=cleantalk_external.min.js.map
js/cleantalk_external.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk_external.js"],"names":["ct_protect_external","i","document","forms","length","action","indexOf","tmp","split","toLowerCase","location","hostname","ct_action","createElement","name","value","type","appendChild","ct_method","method","window","onload","setTimeout"],"mappings":"AAAA,SAASA,sBAER,IAAI,IAAIC,EAAI,EAAGA,EAAIC,SAASC,MAAMC,OAAQH,IAEzC,GAAuC,iBAA7BC,SAASC,MAAMF,GAAS,OAAc,CAE/C,IAAII,EAASH,SAASC,MAAMF,GAAGI,OAE/B,IAAkC,IAA/BA,EAAOC,QAAQ,aAAqD,IAAhCD,EAAOC,QAAQ,YAAmB,CAExE,IAAIC,EAAMF,EAAOG,MAAM,MAIvB,IAHAD,EAAMA,EAAI,GAAGC,MAAM,MACJ,GAAGC,gBAENC,SAASC,SAASF,cAAc,CAE5B,IAAIG,EAAYV,SAASW,cAAc,SACvCD,EAAUE,KAAO,0BAChCF,EAAUG,MAAQV,EAClBO,EAAUI,KAAO,SACjBd,SAASC,MAAMF,GAAGgB,YAAYL,GAEf,IAAIM,EAAYhB,SAASW,cAAc,SACvCK,EAAUJ,KAAO,0BAChCI,EAAUH,MAAQb,SAASC,MAAMF,GAAGkB,OACpCD,EAAUF,KAAO,SAEjBd,SAASC,MAAMF,GAAGkB,OAAS,OAC3BjB,SAASC,MAAMF,GAAGgB,YAAYC,GAE9BhB,SAASC,MAAMF,GAAGI,OAASH,SAASQ,YAOzCU,OAAOC,OAAS,WACZC,WAAW,WACPtB,uBACD","file":"cleantalk_external.min.js","sourcesContent":["function ct_protect_external(){\r\n\t\t\t\r\n\tfor(var i = 0; i < document.forms.length; i++){\r\n\t\t\r\n\t\tif(typeof(document.forms[i].action) == 'string'){\r\n\t\t\t\r\n\t\t\tvar action = document.forms[i].action;\r\n\r\n\t\t\tif(action.indexOf('http://') !== -1 || action.indexOf('https://') !== -1){\r\n\t\t\t\t\r\n\t\t\t\tvar tmp = action.split('//');\r\n\t\t\t\ttmp = tmp[1].split('/');\r\n\t\t\t\tvar host = tmp[0].toLowerCase();\r\n\r\n\t\t\t\tif(host !== location.hostname.toLowerCase()){\r\n\r\n var ct_action = document.createElement(\"input\");\r\n ct_action.name = 'cleantalk_hidden_action';\r\n\t\t\t\t\tct_action.value = action;\r\n\t\t\t\t\tct_action.type = 'hidden';\r\n\t\t\t\t\tdocument.forms[i].appendChild(ct_action);\r\n\r\n var ct_method = document.createElement(\"input\");\r\n ct_method.name = 'cleantalk_hidden_method';\r\n\t\t\t\t\tct_method.value = document.forms[i].method;\r\n\t\t\t\t\tct_method.type = 'hidden';\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tdocument.forms[i].method = 'POST';\r\n\t\t\t\t\tdocument.forms[i].appendChild(ct_method);\r\n\t\t\t\t\t\r\n\t\t\t\t\tdocument.forms[i].action = document.location;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nwindow.onload = function () {\r\n setTimeout(function () {\r\n ct_protect_external()\r\n }, 1500);\r\n};"]}
1
+ {"version":3,"sources":["cleantalk_external.js"],"names":["ct_protect_external","i","document","forms","length","undefined","cleantalk_hidden_action","cleantalk_hidden_method","action","indexOf","tmp","split","toLowerCase","location","hostname","ct_action","createElement","name","value","type","appendChild","ct_method","method","window","onload","setTimeout"],"mappings":"AAAA,SAASA,sBAER,IAAI,IAAIC,EAAI,EAAGA,EAAIC,SAASC,MAAMC,OAAQH,IACzC,GAAiDI,MAA7CH,SAASC,MAAMF,GAAGK,yBAAqFD,MAA7CH,SAASC,MAAMF,GAAGM,yBACxC,iBAA7BL,SAASC,MAAMF,GAAS,OAAc,CAE/C,IAAIO,EAASN,SAASC,MAAMF,GAAGO,OAE/B,IAAkC,IAA/BA,EAAOC,QAAQ,aAAqD,IAAhCD,EAAOC,QAAQ,YAAmB,CAExE,IAAIC,EAAMF,EAAOG,MAAM,MAIvB,IAHAD,EAAMA,EAAI,GAAGC,MAAM,MACJ,GAAGC,gBAENC,SAASC,SAASF,cAAc,CAE5B,IAAIG,EAAYb,SAASc,cAAc,SACvCD,EAAUE,KAAO,0BAChCF,EAAUG,MAAQV,EAClBO,EAAUI,KAAO,SACjBjB,SAASC,MAAMF,GAAGmB,YAAYL,GAEf,IAAIM,EAAYnB,SAASc,cAAc,SACvCK,EAAUJ,KAAO,0BAChCI,EAAUH,MAAQhB,SAASC,MAAMF,GAAGqB,OACpCD,EAAUF,KAAO,SAEjBjB,SAASC,MAAMF,GAAGqB,OAAS,OAC3BpB,SAASC,MAAMF,GAAGmB,YAAYC,GAE9BnB,SAASC,MAAMF,GAAGO,OAASN,SAASW,YAQ1CU,OAAOC,OAAS,WACZC,WAAW,WACPzB,uBACD","file":"cleantalk_external.min.js","sourcesContent":["function ct_protect_external(){\n\t\t\t\n\tfor(var i = 0; i < document.forms.length; i++){\n\t\tif (document.forms[i].cleantalk_hidden_action == undefined && document.forms[i].cleantalk_hidden_method == undefined) {\n\t\t\tif(typeof(document.forms[i].action) == 'string'){\n\t\t\t\t\n\t\t\t\tvar action = document.forms[i].action;\n\n\t\t\t\tif(action.indexOf('http://') !== -1 || action.indexOf('https://') !== -1){\n\t\t\t\t\t\n\t\t\t\t\tvar tmp = action.split('//');\n\t\t\t\t\ttmp = tmp[1].split('/');\n\t\t\t\t\tvar host = tmp[0].toLowerCase();\n\n\t\t\t\t\tif(host !== location.hostname.toLowerCase()){\n\n\t var ct_action = document.createElement(\"input\");\n\t ct_action.name = 'cleantalk_hidden_action';\n\t\t\t\t\t\tct_action.value = action;\n\t\t\t\t\t\tct_action.type = 'hidden';\n\t\t\t\t\t\tdocument.forms[i].appendChild(ct_action);\n\n\t var ct_method = document.createElement(\"input\");\n\t ct_method.name = 'cleantalk_hidden_method';\n\t\t\t\t\t\tct_method.value = document.forms[i].method;\n\t\t\t\t\t\tct_method.type = 'hidden';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tdocument.forms[i].method = 'POST';\n\t\t\t\t\t\tdocument.forms[i].appendChild(ct_method);\n\t\t\t\t\t\t\n\t\t\t\t\t\tdocument.forms[i].action = document.location;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nwindow.onload = function () {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};"]}
js/cleantalk_internal.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk_internal.js"],"names":["ct_check_internal","currForm","ct_data","elems","elements","key","type","undefined","value","name","jQuery","ajax","url","ctNocache","blog_home","datatype","data","success","alert","submit","error","document","ready","ct_currAction","ct_currForm","i","forms","length","action","indexOf","search","ctPrevHandler","click","off","on"],"mappings":"AAAA,SAASA,kBAAkBC,GAGvB,IAAIC,EAAU,GACVC,EAAQF,EAASG,SAErB,IAAK,IAAIC,KAAOF,EACU,UAAnBA,EAAME,GAAKC,MAAwCC,MAApBJ,EAAME,GAAKG,OAA0C,IAApBL,EAAME,GAAKG,QAE9EN,EAAQC,EAAME,GAAKI,MAAQR,EAASG,SAASC,GAAKG,OAEtDN,EAAgB,OAAI,oBAGpBQ,OAAOC,KAAK,CACRL,KAAM,OACNM,IAAKC,UAAUC,UACfC,SAAW,OACXC,KAAMd,EACNe,QAAS,SAASD,GACd,GAAW,QAARA,EAIC,OADAE,MAAMF,IACC,EAHPf,EAASkB,UAMjBC,MAAO,WACHnB,EAASkB,YAKrBT,OAAOW,UAAUC,MAAO,WACpB,IAAIC,EAAgB,GAChBC,EAAc,GACrB,IAAIC,EAAE,EAAEA,EAAEJ,SAASK,MAAMC,OAAOF,IACM,iBAA3BJ,SAASK,MAAMD,GAAS,UAGK,IADtCF,GADSC,EAAcH,SAASK,MAAMD,IACVG,QACXC,QAAQ,aAAoD,GAApCN,EAAcM,QAAQ,cACW,GAA1DN,EAAcO,OAAO,kCAA2F,GAAhDP,EAAcM,QAAQhB,UAAUC,aAC/FiB,cAAgBP,EAAYQ,MAC5BtB,OAAOc,GAAaS,IAAI,MACxBvB,OAAOc,GAAaS,MACpBvB,OAAOc,GAAaU,GAAG,SAAU,WAE7B,OADAlC,kBAAkBwB,IACX","file":"cleantalk_internal.min.js","sourcesContent":["function ct_check_internal(currForm){\r\n \r\n//Gathering data\r\n var ct_data = {},\r\n elems = currForm.elements;\r\n\r\n for (var key in elems) {\r\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\r\n continue;\r\n ct_data[elems[key].name] = currForm.elements[key].value;\r\n }\r\n ct_data['action'] = 'ct_check_internal';\r\n\r\n//AJAX Request\r\n jQuery.ajax({\r\n type: 'POST',\r\n url: ctNocache.blog_home,\r\n datatype : 'text',\r\n data: ct_data,\r\n success: function(data){\r\n if(data == 'true'){\r\n currForm.submit();\r\n }else{\r\n alert(data);\r\n return false;\r\n }\r\n },\r\n error: function(){\r\n currForm.submit();\r\n }\r\n }); \r\n}\r\n \r\njQuery(document).ready( function(){\r\n var ct_currAction = '',\r\n ct_currForm = '';\r\n\tfor(i=0;i<document.forms.length;i++){\r\n\t\tif(typeof(document.forms[i].action)=='string'){\r\n ct_currForm = document.forms[i];\r\n\t\t\tct_currAction = ct_currForm.action;\r\n\t\t\tif(ct_currAction.indexOf('http://')!=-1||ct_currAction.indexOf('https://')!=-1){\r\n if(ct_currAction.search(/\\/wp-content\\/themes.*\\.php$/) != (-1) && ct_currAction.indexOf(ctNocache.blog_home) != (-1)){\r\n ctPrevHandler = ct_currForm.click;\r\n jQuery(ct_currForm).off('**');\r\n jQuery(ct_currForm).off();\r\n jQuery(ct_currForm).on('submit', function(){\r\n ct_check_internal(ct_currForm);\r\n return false;\r\n });\r\n }\r\n }\r\n\t\t}\r\n\t}\r\n});"]}
1
+ {"version":3,"sources":["cleantalk_internal.js"],"names":["ct_check_internal","currForm","ct_data","elems","elements","key","type","undefined","value","name","jQuery","ajax","url","ctNocache","blog_home","datatype","data","success","alert","submit","error","document","ready","ct_currAction","ct_currForm","i","forms","length","action","indexOf","search","ctPrevHandler","click","off","on"],"mappings":"AAAA,SAASA,kBAAkBC,GAGvB,IAAIC,EAAU,GACVC,EAAQF,EAASG,SAErB,IAAK,IAAIC,KAAOF,EACU,UAAnBA,EAAME,GAAKC,MAAwCC,MAApBJ,EAAME,GAAKG,OAA0C,IAApBL,EAAME,GAAKG,QAE9EN,EAAQC,EAAME,GAAKI,MAAQR,EAASG,SAASC,GAAKG,OAEtDN,EAAgB,OAAI,oBAGpBQ,OAAOC,KAAK,CACRL,KAAM,OACNM,IAAKC,UAAUC,UACfC,SAAW,OACXC,KAAMd,EACNe,QAAS,SAASD,GACd,GAAW,QAARA,EAIC,OADAE,MAAMF,IACC,EAHPf,EAASkB,UAMjBC,MAAO,WACHnB,EAASkB,YAKrBT,OAAOW,UAAUC,MAAO,WACpB,IAAIC,EAAgB,GAChBC,EAAc,GACrB,IAAIC,EAAE,EAAEA,EAAEJ,SAASK,MAAMC,OAAOF,IACM,iBAA3BJ,SAASK,MAAMD,GAAS,UAGK,IADtCF,GADSC,EAAcH,SAASK,MAAMD,IACVG,QACXC,QAAQ,aAAoD,GAApCN,EAAcM,QAAQ,cACW,GAA1DN,EAAcO,OAAO,kCAA2F,GAAhDP,EAAcM,QAAQhB,UAAUC,aAC/FiB,cAAgBP,EAAYQ,MAC5BtB,OAAOc,GAAaS,IAAI,MACxBvB,OAAOc,GAAaS,MACpBvB,OAAOc,GAAaU,GAAG,SAAU,WAE7B,OADAlC,kBAAkBwB,IACX","file":"cleantalk_internal.min.js","sourcesContent":["function ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n//AJAX Request\n jQuery.ajax({\n type: 'POST',\n url: ctNocache.blog_home,\n datatype : 'text',\n data: ct_data,\n success: function(data){\n if(data == 'true'){\n currForm.submit();\n }else{\n alert(data);\n return false;\n }\n },\n error: function(){\n currForm.submit();\n }\n }); \n}\n \njQuery(document).ready( function(){\n var ct_currAction = '',\n ct_currForm = '';\n\tfor(i=0;i<document.forms.length;i++){\n\t\tif(typeof(document.forms[i].action)=='string'){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n\t\t\tif(ct_currAction.indexOf('http://')!=-1||ct_currAction.indexOf('https://')!=-1){\n if(ct_currAction.search(/\\/wp-content\\/themes.*\\.php$/) != (-1) && ct_currAction.indexOf(ctNocache.blog_home) != (-1)){\n ctPrevHandler = ct_currForm.click;\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(){\n ct_check_internal(ct_currForm);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});"]}
js/cleantalk_nocache.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function sendRequest(e,t,n){var c=createXMLHTTPObject();if(c){var o=n?"POST":"GET";e="https:"===location.protocol?e.replace("http:","https:"):e.replace("https:","http:"),c.open(o,e,!0),n&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.onreadystatechange=function(){4==c.readyState&&(200!=c.status&&304!=c.status||t(c))},4!=c.readyState&&c.send(n)}}"undefined"==typeof ctNocache&&(ctNocache.set_cookies_flag=!0,ctNocache.ajaxurl="/wp-admin/admin-ajax.php");var XMLHttpFactories=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject(){for(var e=!1,t=0;t<XMLHttpFactories.length;t++){try{e=XMLHttpFactories[t]()}catch(e){continue}break}return e}function ct_getCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0}function ct_setCookie(e,t){if(ctNocache.set_cookies_flag){document.cookie=e+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /",document.cookie=e+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT";var n=new Date;n.setDate(n.getDate()+1),setTimeout(function(){document.cookie=e+"="+t+"; expires="+n.toUTCString()+"; path = /;"},500)}return null}function ct_callback(t){for(ct_cookie=t.responseText.trim(),ct_setCookie("ct_checkjs",ct_cookie),i=0;i<document.forms.length;i++)for(f=document.forms[i],j=0;j<f.elements.length;j++)e=f.elements[j],void 0!==e.name&&-1!=e.name.indexOf("ct_checkjs")&&(e.value=ct_cookie)}if(Date.now||(Date.now=function(){return(new Date).getTime()}),null==ct_nocache_executed){var ct_nocache_executed=!0,checkjs_cookie=ct_getCookie("ct_checkjs");if(null!=checkjs_cookie)for(i=0;i<document.forms.length;i++)for(f=document.forms[i],j=0;j<f.elements.length;j++)e=f.elements[j],void 0!==e.name&&-1!=e.name.indexOf("ct_checkjs")&&(e.value=checkjs_cookie);if(null==checkjs_cookie&&sendRequest(ctNocache.ajaxurl+"?"+Math.random(),ct_callback,"action=ct_get_cookie"),void 0!==ctNocache.info_flag&&ctNocache.info_flag){var cleantalk_user_info={},cleantalk_screen_info={};for(var prop in screen)navigator[prop]instanceof Object||""===screen[prop]||(cleantalk_screen_info[prop]=screen[prop]);cleantalk_user_info.screen=cleantalk_screen_info;for(var prev,cleantalk_plugins=Array(),cnt=0,i=0;i<navigator.plugins.length;i++){var plugin;prev!=(plugin=(plugin=navigator.plugins[i]).name+" "+(plugin.version||""))&&(cleantalk_plugins[cnt]=plugin,cnt++,prev=plugin)}cleantalk_user_info.plugins=cleantalk_plugins,cleantalk_user_info.timezone_offset=-(new Date).getTimezoneOffset()/60,cleantalk_user_info.datetime=Math.round((new Date).getTime()/1e3),cleantalk_user_info.browser_x=document.documentElement.clientWidth,cleantalk_user_info.browser_y=document.documentElement.clientHeight;var ua=navigator.userAgent.toLowerCase(),flashInstalled=0;if(void 0!==navigator.plugins&&"object"==typeof navigator.plugins["Shockwave Flash"])flashInstalled=1;else if(void 0!==window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(flashInstalled=1)}catch(e){}cleantalk_user_info.is_flash=flashInstalled,isVisitedMain=-1,location.href!="http://"+location.hostname+"/"&&location.href!="https://"+location.hostname+"/"||(isVisitedMain=1,setTimeout(function(){document.cookie="ct_visited_main = 1; path = /;"},1500)),ct_visited_main=ct_getCookie("ct_visited_main"),isVisitedMain=null==ct_visited_main&&-1==isVisitedMain?0:1,cleantalk_user_info.is_main=isVisitedMain,setTimeout(function(){document.cookie="ct_user_info = "+escape(JSON.stringify(cleantalk_user_info))+"; path = /;"},1500)}}
2
  //# sourceMappingURL=cleantalk_nocache.min.js.map
1
+ function sendRequest(e,t,n){var c=createXMLHTTPObject();if(c){var i=n?"POST":"GET";e="https:"===location.protocol?e.replace("http:","https:"):e.replace("https:","http:"),c.open(i,e,!0),n&&c.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c.onreadystatechange=function(){4==c.readyState&&(200!=c.status&&304!=c.status||t(c))},4!=c.readyState&&c.send(n)}}"undefined"==typeof ctNocache&&(ctNocache.set_cookies_flag=!0,ctNocache.ajaxurl="/wp-admin/admin-ajax.php");var XMLHttpFactories=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject(){for(var e=!1,t=0;t<XMLHttpFactories.length;t++){try{e=XMLHttpFactories[t]()}catch(e){continue}break}return e}function ct_getCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0}function ct_setCookie(e,t){if(ctNocache.set_cookies_flag){document.cookie=e+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /",document.cookie=e+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT";var n=new Date;n.setDate(n.getDate()+1),setTimeout(function(){document.cookie=e+"="+t+"; expires="+n.toUTCString()+"; path = /;"},500)}return null}function ct_callback(t){for(ct_cookie=t.responseText.trim(),ct_setCookie("ct_checkjs",ct_cookie),i=0;i<document.forms.length;i++)for(f=document.forms[i],j=0;j<f.elements.length;j++)e=f.elements[j],void 0!==e.name&&-1!=e.name.indexOf("ct_checkjs")&&(e.value=ct_cookie)}if(Date.now||(Date.now=function(){return(new Date).getTime()}),null==ct_nocache_executed){var ct_nocache_executed=!0,checkjs_cookie=ct_getCookie("ct_checkjs");if(null!=checkjs_cookie)for(i=0;i<document.forms.length;i++)for(f=document.forms[i],j=0;j<f.elements.length;j++)e=f.elements[j],void 0!==e.name&&-1!=e.name.indexOf("ct_checkjs")&&(e.value=checkjs_cookie);if(null==checkjs_cookie&&sendRequest(ctNocache.ajaxurl+"?"+Math.random(),ct_callback,"action=ct_get_cookie"),void 0!==ctNocache.info_flag&&ctNocache.info_flag){var cleantalk_user_info={},cleantalk_screen_info={};for(var prop in screen)navigator[prop]instanceof Object||""===screen[prop]||(cleantalk_screen_info[prop]=screen[prop]);cleantalk_user_info.screen=cleantalk_screen_info;for(var prev,cleantalk_plugins=Array(),cnt=0,i=0;i<navigator.plugins.length;i++){var plugin;prev!=(plugin=(plugin=navigator.plugins[i]).name+" "+(plugin.version||""))&&(cleantalk_plugins[cnt]=plugin,cnt++,prev=plugin)}cleantalk_user_info.plugins=cleantalk_plugins,cleantalk_user_info.timezone_offset=-(new Date).getTimezoneOffset()/60,cleantalk_user_info.datetime=Math.round((new Date).getTime()/1e3),cleantalk_user_info.browser_x=document.documentElement.clientWidth,cleantalk_user_info.browser_y=document.documentElement.clientHeight;var ua=navigator.userAgent.toLowerCase(),flashInstalled=0;if(void 0!==navigator.plugins&&"object"==typeof navigator.plugins["Shockwave Flash"])flashInstalled=1;else if(void 0!==window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(flashInstalled=1)}catch(e){}cleantalk_user_info.is_flash=flashInstalled,isVisitedMain=-1,location.href!="http://"+location.hostname+"/"&&location.href!="https://"+location.hostname+"/"||(isVisitedMain=1,setTimeout(function(){document.cookie="ct_visited_main = 1; path = /;"},1500)),ct_visited_main=ct_getCookie("ct_visited_main"),null==ct_visited_main&&-1==isVisitedMain?isVisitedMain=0:isVisitedMain=1,cleantalk_user_info.is_main=isVisitedMain,setTimeout(function(){document.cookie="ct_user_info = "+escape(JSON.stringify(cleantalk_user_info))+"; path = /;"},1500)}}
2
  //# sourceMappingURL=cleantalk_nocache.min.js.map
js/cleantalk_nocache.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk_nocache.js"],"names":["sendRequest","url","callback","postData","req","createXMLHTTPObject","method","location","protocol","replace","open","setRequestHeader","onreadystatechange","readyState","status","send","ctNocache","set_cookies_flag","ajaxurl","XMLHttpFactories","XMLHttpRequest","ActiveXObject","xmlhttp","i","length","e","ct_getCookie","name","matches","document","cookie","match","RegExp","decodeURIComponent","undefined","ct_setCookie","value","date","Date","setDate","getDate","setTimeout","toUTCString","ct_callback","ct_cookie","responseText","trim","forms","f","j","elements","indexOf","now","getTime","ct_nocache_executed","checkjs_cookie","Math","random","info_flag","cleantalk_user_info","cleantalk_screen_info","prop","screen","navigator","Object","prev","cleantalk_plugins","Array","cnt","plugins","plugin","version","timezone_offset","getTimezoneOffset","datetime","round","browser_x","documentElement","clientWidth","browser_y","clientHeight","ua","userAgent","toLowerCase","flashInstalled","window","is_flash","isVisitedMain","href","hostname","ct_visited_main","is_main","escape","JSON","stringify"],"mappings":"AAQA,SAASA,YAAYC,EAAIC,EAASC,GAC9B,IAAIC,EAAMC,sBACV,GAAKD,EAAL,CACA,IAAIE,EAAS,EAAa,OAAS,MAI/BL,EADa,WADFM,SAASC,SAEdP,EAAIQ,QAAQ,QAAS,UAErBR,EAAIQ,QAAQ,SAAU,SAGhCL,EAAIM,KAAKJ,EAAOL,GAAI,GAChBE,GACAC,EAAIO,iBAAiB,eAAe,qCACxCP,EAAIQ,mBAAqB,WACC,GAAlBR,EAAIS,aACU,KAAdT,EAAIU,QAA+B,KAAdV,EAAIU,QAI7BZ,EAASE,KAES,GAAlBA,EAAIS,YACRT,EAAIW,KAAKZ,IA7BY,oBAAda,YACPA,UAAUC,kBAAmB,EAC7BD,UAAUE,QAAU,4BA8BxB,IAAIC,iBAAmB,CACnB,WAAa,OAAO,IAAIC,gBACxB,WAAa,OAAO,IAAIC,cAAc,mBACtC,WAAa,OAAO,IAAIA,cAAc,mBACtC,WAAa,OAAO,IAAIA,cAAc,uBAG1C,SAAShB,sBAEL,IADA,IAAIiB,GAAU,EACLC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S,kCAAmC,OAI9E4D,gBAAkBhE,aAAa,mBAG9B6D,cAFmBrD,MAAjBwD,kBAA8C,GAAhBH,cAElB,EAIA,EAGf5B,oBAAoBgC,QAAQJ,cAE5B9C,WAAW,WAAaZ,SAASC,OAAS,kBAAkB8D,OAAOC,KAAKC,UAAUnC,sBAAsB,eAAgB","file":"cleantalk_nocache.min.js","sourcesContent":["/*\r\n Assign default values for backend variables.\r\n*/\r\nif (typeof ctNocache === 'undefined') {\r\n ctNocache.set_cookies_flag = true;\r\n ctNocache.ajaxurl = '/wp-admin/admin-ajax.php';\r\n}\r\n\r\nfunction sendRequest(url,callback,postData) {\r\n var req = createXMLHTTPObject();\r\n if (!req) return;\r\n var method = (postData) ? \"POST\" : \"GET\";\r\n \r\n var protocol = location.protocol;\r\n if (protocol === 'https:') {\r\n url = url.replace('http:', 'https:');\r\n } else {\r\n url = url.replace('https:', 'http:');\r\n }\r\n \r\n req.open(method,url,true);\r\n if (postData)\r\n req.setRequestHeader('Content-type','application/x-www-form-urlencoded');\r\n req.onreadystatechange = function () {\r\n if (req.readyState != 4) return;\r\n if (req.status != 200 && req.status != 304) {\r\n// alert('HTTP error ' + req.status);\r\n return;\r\n }\r\n callback(req);\r\n };\r\n if (req.readyState == 4) return;\r\n req.send(postData);\r\n}\r\n\r\nvar XMLHttpFactories = [\r\n function () {return new XMLHttpRequest()},\r\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\r\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\r\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\r\n];\r\n\r\nfunction createXMLHTTPObject() {\r\n var xmlhttp = false;\r\n for (var i=0;i<XMLHttpFactories.length;i++) {\r\n try {\r\n xmlhttp = XMLHttpFactories[i]();\r\n }\r\n catch (e) {\r\n continue;\r\n }\r\n break;\r\n }\r\n return xmlhttp;\r\n}\r\n\r\nfunction ct_getCookie(name) {\r\n var matches = document.cookie.match(new RegExp(\r\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\r\n ));\r\n return matches ? decodeURIComponent(matches[1]) : undefined;\r\n}\r\n\r\nfunction ct_setCookie(name, value)\r\n{\r\n if (ctNocache.set_cookies_flag) {\r\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /\";\r\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT\";\r\n \r\n var date = new Date;\r\n date.setDate(date.getDate() + 1);\r\n setTimeout(function() { document.cookie = name+\"=\" + value + \"; expires=\" + date.toUTCString() + \"; path = /;\"}, 500);\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction ct_callback(req)\r\n{\r\n\tct_cookie = req.responseText.trim();\r\n\t//alert('Key value: ' + ct_cookie);\r\n\t\r\n\tct_setCookie('ct_checkjs', ct_cookie);\r\n\t\r\n\tfor(i=0;i<document.forms.length;i++)\r\n\t{\r\n\t\tf=document.forms[i];\r\n\t\tfor(j=0;j<f.elements.length;j++)\r\n\t\t{\r\n\t\t\te=f.elements[j];\r\n\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\r\n\t\t\t{\r\n\t\t\t\te.value=ct_cookie;\r\n\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//alert('Set cookie: \\n' + document.cookie);\r\n}\r\n\r\nif (!Date.now) {\r\n\tDate.now = function() { return new Date().getTime(); }\r\n}\r\n\r\nif(ct_nocache_executed==undefined)\r\n{\r\n\tvar ct_nocache_executed=true;\r\n\t\r\n\tvar checkjs_cookie=ct_getCookie('ct_checkjs');\r\n\t\r\n\tif(checkjs_cookie!=undefined)\r\n\t{\r\n\t\tfor(i=0;i<document.forms.length;i++)\r\n\t\t{\r\n\t\t\tf=document.forms[i];\r\n\t\t\tfor(j=0;j<f.elements.length;j++)\r\n\t\t\t{\r\n\t\t\t\te=f.elements[j];\r\n\t\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\r\n\t\t\t\t{\r\n\t\t\t\t\te.value=checkjs_cookie;\r\n\t\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tif(checkjs_cookie==undefined) //86400 is 24 hours\r\n\t{\r\n\t\tsendRequest(ctNocache.ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');\r\n\t}\r\n\t\r\n\tif(typeof ctNocache.info_flag !== 'undefined' && ctNocache.info_flag)\r\n\t{\r\n\t\r\n\t\tvar cleantalk_user_info={};\r\n\t\t\r\n\t\tvar cleantalk_screen_info={};\r\n\t\tfor(var prop in screen)\r\n\t\t{\r\n\t\t\tif (navigator[prop] instanceof Object || screen[prop]==='')\r\n\t\t\t\tcontinue;\r\n\t\t\tcleantalk_screen_info[prop]=screen[prop];\r\n\t\t}\r\n\t\t\r\n\t\tcleantalk_user_info.screen=cleantalk_screen_info;\r\n\t\t\r\n\t\tvar cleantalk_plugins=Array();\r\n\t\tvar prev;\r\n\t\tvar cnt=0;\r\n\t\tfor(var i=0;i<navigator.plugins.length;i++)\r\n\t\t{\r\n\t\t\tvar plugin = navigator.plugins[i];\r\n\t\t\tvar plugin = plugin.name+\" \"+(plugin.version || '')\r\n\t\t\tif (prev == plugin ) continue;\r\n\t\t\tcleantalk_plugins[cnt]=plugin;\r\n\t\t\tcnt++;\r\n\t\t\tprev = plugin;\r\n\t\t}\r\n\t\tcleantalk_user_info.plugins=cleantalk_plugins;\r\n\t\t\r\n\t\tcleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;\r\n\t\tcleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);\r\n\t\t\r\n\t\tcleantalk_user_info.browser_x=document.documentElement.clientWidth;\r\n\t\tcleantalk_user_info.browser_y=document.documentElement.clientHeight;\r\n\t\t\r\n\t\tvar ua = navigator.userAgent.toLowerCase();\r\n\t\tvar flashInstalled = 0;\r\n\t\tif (typeof(navigator.plugins)!=\"undefined\"&&typeof(navigator.plugins[\"Shockwave Flash\"])==\"object\")\r\n\t\t{\r\n\t\t\tflashInstalled = 1;\r\n\t\t}\r\n\t\telse if (typeof window.ActiveXObject != \"undefined\")\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tif (new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tflashInstalled = 1;\r\n\t\t\t\t}\r\n\t\t\t} catch(e) {};\r\n\t\t};\r\n\t\t\r\n\t\tcleantalk_user_info.is_flash=flashInstalled;\r\n\t\t\r\n\t\tisVisitedMain=-1;\r\n\t\tif(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')\r\n\t\t{\r\n\t\t\tisVisitedMain=1;\r\n\t\t\tsetTimeout(function() { document.cookie = \"ct_visited_main = 1; path = /;\"}, 1500);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tct_visited_main = ct_getCookie('ct_visited_main');\r\n\t\tif(ct_visited_main==undefined && isVisitedMain==-1)\r\n\t\t{\r\n\t\t\tisVisitedMain=0;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tisVisitedMain=1;\r\n\t\t}\r\n\t\t\r\n\t\tcleantalk_user_info.is_main=isVisitedMain;\r\n\t\t\r\n\t\tsetTimeout(function() { document.cookie = \"ct_user_info = \"+escape(JSON.stringify(cleantalk_user_info))+\"; path = /;\"}, 1500);\r\n\t}\r\n}"]}
1
+ {"version":3,"sources":["cleantalk_nocache.js"],"names":["sendRequest","url","callback","postData","req","createXMLHTTPObject","method","location","protocol","replace","open","setRequestHeader","onreadystatechange","readyState","status","send","ctNocache","set_cookies_flag","ajaxurl","XMLHttpFactories","XMLHttpRequest","ActiveXObject","xmlhttp","i","length","e","ct_getCookie","name","matches","document","cookie","match","RegExp","decodeURIComponent","undefined","ct_setCookie","value","date","Date","setDate","getDate","setTimeout","toUTCString","ct_callback","ct_cookie","responseText","trim","forms","f","j","elements","indexOf","now","getTime","ct_nocache_executed","checkjs_cookie","Math","random","info_flag","cleantalk_user_info","cleantalk_screen_info","prop","screen","navigator","Object","prev","cleantalk_plugins","Array","cnt","plugins","plugin","version","timezone_offset","getTimezoneOffset","datetime","round","browser_x","documentElement","clientWidth","browser_y","clientHeight","ua","userAgent","toLowerCase","flashInstalled","window","is_flash","isVisitedMain","href","hostname","ct_visited_main","is_main","escape","JSON","stringify"],"mappings":"AAQA,SAASA,YAAYC,EAAIC,EAASC,GAC9B,IAAIC,EAAMC,sBACV,GAAKD,EAAL,CACA,IAAIE,EAAS,EAAa,OAAS,MAI/BL,EADa,WADFM,SAASC,SAEdP,EAAIQ,QAAQ,QAAS,UAErBR,EAAIQ,QAAQ,SAAU,SAGhCL,EAAIM,KAAKJ,EAAOL,GAAI,GAChBE,GACAC,EAAIO,iBAAiB,eAAe,qCACxCP,EAAIQ,mBAAqB,WACC,GAAlBR,EAAIS,aACU,KAAdT,EAAIU,QAA+B,KAAdV,EAAIU,QAI7BZ,EAASE,KAES,GAAlBA,EAAIS,YACRT,EAAIW,KAAKZ,IA7BY,oBAAda,YACPA,UAAUC,kBAAmB,EAC7BD,UAAUE,QAAU,4BA8BxB,IAAIC,iBAAmB,CACnB,WAAa,OAAO,IAAIC,gBACxB,WAAa,OAAO,IAAIC,cAAc,mBACtC,WAAa,OAAO,IAAIA,cAAc,mBACtC,WAAa,OAAO,IAAIA,cAAc,uBAG1C,SAAShB,sBAEL,IADA,IAAIiB,GAAU,EACLC,EAAE,EAAEA,EAAEJ,iBAAiBK,OAAOD,IAAK,CACxC,IACID,EAAUH,iBAAiBI,KAE/B,MAAOE,GACH,SAEJ,MAEJ,OAAOH,EAGX,SAASI,aAAaC,GACpB,IAAIC,EAAUC,SAASC,OAAOC,MAAM,IAAIC,OACtC,WAAa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AUnC,sBAAsB,eAAgB","file":"cleantalk_nocache.min.js","sourcesContent":["/*\n Assign default values for backend variables.\n*/\nif (typeof ctNocache === 'undefined') {\n ctNocache.set_cookies_flag = true;\n ctNocache.ajaxurl = '/wp-admin/admin-ajax.php';\n}\n\nfunction sendRequest(url,callback,postData) {\n var req = createXMLHTTPObject();\n if (!req) return;\n var method = (postData) ? \"POST\" : \"GET\";\n \n var protocol = location.protocol;\n if (protocol === 'https:') {\n url = url.replace('http:', 'https:');\n } else {\n url = url.replace('https:', 'http:');\n }\n \n req.open(method,url,true);\n if (postData)\n req.setRequestHeader('Content-type','application/x-www-form-urlencoded');\n req.onreadystatechange = function () {\n if (req.readyState != 4) return;\n if (req.status != 200 && req.status != 304) {\n// alert('HTTP error ' + req.status);\n return;\n }\n callback(req);\n };\n if (req.readyState == 4) return;\n req.send(postData);\n}\n\nvar XMLHttpFactories = [\n function () {return new XMLHttpRequest()},\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\n];\n\nfunction createXMLHTTPObject() {\n var xmlhttp = false;\n for (var i=0;i<XMLHttpFactories.length;i++) {\n try {\n xmlhttp = XMLHttpFactories[i]();\n }\n catch (e) {\n continue;\n }\n break;\n }\n return xmlhttp;\n}\n\nfunction ct_getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ct_setCookie(name, value)\n{\n if (ctNocache.set_cookies_flag) {\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /\";\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT\";\n \n var date = new Date;\n date.setDate(date.getDate() + 1);\n setTimeout(function() { document.cookie = name+\"=\" + value + \"; expires=\" + date.toUTCString() + \"; path = /;\"}, 500);\n }\n\n return null;\n}\n\nfunction ct_callback(req)\n{\n\tct_cookie = req.responseText.trim();\n\t//alert('Key value: ' + ct_cookie);\n\t\n\tct_setCookie('ct_checkjs', ct_cookie);\n\t\n\tfor(i=0;i<document.forms.length;i++)\n\t{\n\t\tf=document.forms[i];\n\t\tfor(j=0;j<f.elements.length;j++)\n\t\t{\n\t\t\te=f.elements[j];\n\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\n\t\t\t{\n\t\t\t\te.value=ct_cookie;\n\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\n\t\t\t}\n\t\t}\n\t}\n\n\t//alert('Set cookie: \\n' + document.cookie);\n}\n\nif (!Date.now) {\n\tDate.now = function() { return new Date().getTime(); }\n}\n\nif(ct_nocache_executed==undefined)\n{\n\tvar ct_nocache_executed=true;\n\t\n\tvar checkjs_cookie=ct_getCookie('ct_checkjs');\n\t\n\tif(checkjs_cookie!=undefined)\n\t{\n\t\tfor(i=0;i<document.forms.length;i++)\n\t\t{\n\t\t\tf=document.forms[i];\n\t\t\tfor(j=0;j<f.elements.length;j++)\n\t\t\t{\n\t\t\t\te=f.elements[j];\n\t\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\n\t\t\t\t{\n\t\t\t\t\te.value=checkjs_cookie;\n\t\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\tif(checkjs_cookie==undefined) //86400 is 24 hours\n\t{\n\t\tsendRequest(ctNocache.ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');\n\t}\n\t\n\tif(typeof ctNocache.info_flag !== 'undefined' && ctNocache.info_flag)\n\t{\n\t\n\t\tvar cleantalk_user_info={};\n\t\t\n\t\tvar cleantalk_screen_info={};\n\t\tfor(var prop in screen)\n\t\t{\n\t\t\tif (navigator[prop] instanceof Object || screen[prop]==='')\n\t\t\t\tcontinue;\n\t\t\tcleantalk_screen_info[prop]=screen[prop];\n\t\t}\n\t\t\n\t\tcleantalk_user_info.screen=cleantalk_screen_info;\n\t\t\n\t\tvar cleantalk_plugins=Array();\n\t\tvar prev;\n\t\tvar cnt=0;\n\t\tfor(var i=0;i<navigator.plugins.length;i++)\n\t\t{\n\t\t\tvar plugin = navigator.plugins[i];\n\t\t\tvar plugin = plugin.name+\" \"+(plugin.version || '')\n\t\t\tif (prev == plugin ) continue;\n\t\t\tcleantalk_plugins[cnt]=plugin;\n\t\t\tcnt++;\n\t\t\tprev = plugin;\n\t\t}\n\t\tcleantalk_user_info.plugins=cleantalk_plugins;\n\t\t\n\t\tcleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;\n\t\tcleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);\n\t\t\n\t\tcleantalk_user_info.browser_x=document.documentElement.clientWidth;\n\t\tcleantalk_user_info.browser_y=document.documentElement.clientHeight;\n\t\t\n\t\tvar ua = navigator.userAgent.toLowerCase();\n\t\tvar flashInstalled = 0;\n\t\tif (typeof(navigator.plugins)!=\"undefined\"&&typeof(navigator.plugins[\"Shockwave Flash\"])==\"object\")\n\t\t{\n\t\t\tflashInstalled = 1;\n\t\t}\n\t\telse if (typeof window.ActiveXObject != \"undefined\")\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"))\n\t\t\t\t{\n\t\t\t\t\tflashInstalled = 1;\n\t\t\t\t}\n\t\t\t} catch(e) {};\n\t\t};\n\t\t\n\t\tcleantalk_user_info.is_flash=flashInstalled;\n\t\t\n\t\tisVisitedMain=-1;\n\t\tif(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')\n\t\t{\n\t\t\tisVisitedMain=1;\n\t\t\tsetTimeout(function() { document.cookie = \"ct_visited_main = 1; path = /;\"}, 1500);\n\t\t}\n\t\t\n\t\t\n\t\tct_visited_main = ct_getCookie('ct_visited_main');\n\t\tif(ct_visited_main==undefined && isVisitedMain==-1)\n\t\t{\n\t\t\tisVisitedMain=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tisVisitedMain=1;\n\t\t}\n\t\t\n\t\tcleantalk_user_info.is_main=isVisitedMain;\n\t\t\n\t\tsetTimeout(function() { document.cookie = \"ct_user_info = \"+escape(JSON.stringify(cleantalk_user_info))+\"; path = /;\"}, 1500);\n\t}\n}"]}
lib/Cleantalk.php CHANGED
@@ -406,6 +406,7 @@ class Cleantalk {
406
  */
407
  private function sendRequest($data = null, $url, $server_timeout = 3)
408
  {
 
409
  // Convert to array
410
  $data = (array)json_decode(json_encode($data), true);
411
 
@@ -477,8 +478,7 @@ class Cleantalk {
477
  // Use SSL next time, if error occurs.
478
  if(!$this->ssl_on){
479
  $this->ssl_on = true;
480
- $args = func_get_args();
481
- return $this->sendRequest($args[0], $args[1], $server_timeout);
482
  }
483
  }
484
 
406
  */
407
  private function sendRequest($data = null, $url, $server_timeout = 3)
408
  {
409
+ $original_args = func_get_args();
410
  // Convert to array
411
  $data = (array)json_decode(json_encode($data), true);
412
 
478
  // Use SSL next time, if error occurs.
479
  if(!$this->ssl_on){
480
  $this->ssl_on = true;
481
+ return $this->sendRequest($original_args[0], $original_args[1], $server_timeout);
 
482
  }
483
  }
484
 
lib/Cleantalk/Antispam/API.php CHANGED
@@ -655,7 +655,7 @@ class API
655
  $result = curl_exec($ch);
656
  $errors = curl_error($ch);
657
  curl_close($ch);
658
-
659
  // Retry with SSL enabled if failed
660
  if($result === false){
661
  if($ssl === false){
@@ -688,7 +688,7 @@ class API
688
  $errors .= '_AND_ALLOW_URL_FOPEN_IS_DISABLED';
689
  }
690
  }
691
-
692
  return empty($result) || !empty($errors)
693
  ? array('error' => $errors)
694
  : $result;
655
  $result = curl_exec($ch);
656
  $errors = curl_error($ch);
657
  curl_close($ch);
658
+
659
  // Retry with SSL enabled if failed
660
  if($result === false){
661
  if($ssl === false){
688
  $errors .= '_AND_ALLOW_URL_FOPEN_IS_DISABLED';
689
  }
690
  }
691
+
692
  return empty($result) || !empty($errors)
693
  ? array('error' => $errors)
694
  : $result;
lib/Cleantalk/Antispam/Integrations.php CHANGED
@@ -38,6 +38,7 @@ class Integrations
38
  $this->integration = new $class();
39
  if( ! ( $this->integration instanceof \Cleantalk\Antispam\Integrations\IntegrationBase ) ) {
40
  // @ToDo have to handle an error
 
41
  return;
42
  }
43
  // Run data collecting for spam checking
38
  $this->integration = new $class();
39
  if( ! ( $this->integration instanceof \Cleantalk\Antispam\Integrations\IntegrationBase ) ) {
40
  // @ToDo have to handle an error
41
+ do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, array('Integration is not instanse of IntegrationBase class.') );
42
  return;
43
  }
44
  // Run data collecting for spam checking
lib/CleantalkState.php CHANGED
@@ -57,8 +57,8 @@ class CleantalkState
57
  'comments_test' => 1,
58
  'contact_forms_test' => 1,
59
  'general_contact_forms_test' => 1, // Antispam test for unsupported and untested contact forms
60
- 'wc_checkout_test' => 0, // WooCommerce checkout default test => OFF
61
- 'wc_register_from_order' => 1, // Woocommerce registration during checkout => ON
62
  'search_test' => 1, // Test deafult Wordpress form
63
  'check_external' => 0,
64
  'check_external__capture_buffer' => 0,
57
  'comments_test' => 1,
58
  'contact_forms_test' => 1,
59
  'general_contact_forms_test' => 1, // Antispam test for unsupported and untested contact forms
60
+ 'wc_checkout_test' => 1, // WooCommerce checkout default test
61
+ 'wc_register_from_order' => 1, // Woocommerce registration during checkout
62
  'search_test' => 1, // Test deafult Wordpress form
63
  'check_external' => 0,
64
  'check_external__capture_buffer' => 0,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, woocommerce, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.4
6
  Requires PHP: 5.4
7
- Stable tag: 5.135
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -566,6 +566,16 @@ If your website has forms that send data to external sources, you can enable opt
566
 
567
  == Changelog ==
568
 
 
 
 
 
 
 
 
 
 
 
569
  = 5.135 March 16 2020 =
570
  * New: Setting which disallow sub-sites administrators to manage plugin settings.
571
  * New: Add custom title for message.
4
  Requires at least: 3.0
5
  Tested up to: 5.4
6
  Requires PHP: 5.4
7
+ Stable tag: 5.136
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
566
 
567
  == Changelog ==
568
 
569
+ = 5.136 April 1 2020 =
570
+ * New: Feature allowing to track missed spam requests with the special plugin.
571
+ * Mod: Enable WooCommerce checkout test by default.
572
+ * Fix: Fluent forms integration fixed.
573
+ * Fix: Logging skipped requests - actions added.
574
+ * Fix: Comments output.
575
+ * Fix: External forms protection.
576
+ * Fix: PHP 7.4 compatibility.
577
+ * Performance improved.
578
+
579
  = 5.135 March 16 2020 =
580
  * New: Setting which disallow sub-sites administrators to manage plugin settings.
581
  * New: Add custom title for message.