Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.168

Version Description

Dec 16 2021 =

One integrations added, some skipped requests will be logged, cookies optimized and minor issues fixed.

  • New. Get key. A filter to changing an email to get the key implemented.
  • New. Log exclusions. Option for logging excluded request implemented.
  • New. Integration. Formidable Pro integration added.
  • New. Integration. Smart forms integration added.
  • Upd. Get key. email_filtered parameter added.
  • Upd: Antispam. Prevent skip requests without emails.
  • Upd: Antispam. Prevent skip requests trusted users.
  • Mod: Implementation of sending plugin settings to service_update_local_settings
  • Fix. Antispam. Exception action argument fixed.
  • Fix. Antispam. Preventing catch RC requests.
  • Fix. Antispam. Preventing catch website search requests.
  • Fix. Setting templates. Get templates only after manual getting key.
  • Fix. Admin notices. Notice about getting key removed.
  • Fix. Getting key. Get the right email for gathering the key.
  • Fix. Exception action. Send ajax requests without email to the cloud.
  • Fix. Exception action. Prevent catching admin-side requests.
  • Fix. Exception action. Send ajax requests without email to the cloud.
  • Fix. Exception action. Prevent catching admin-side requests.
  • Fix. Log exclusions. Skip checking excepted requests if the "Log excluded requests" option is disabled.
  • Fix. Antispam. Remove unnecessary cookie from requests.
  • Fix. Visible fields. Collecting visible fields only for unique forms on the page.
  • Fix: excluded some action for Ninja Form from spamtest.
Download this release

Release Info

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

Code changes from version 5.167 to 5.168

cleantalk.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  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.
7
- Version: 5.167
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -205,6 +205,9 @@ if ( $apbct->settings && $apbct->key_is_ok ) {
205
  //Delete cookie for admin trial notice
206
  add_action('wp_logout', 'apbct__hook__wp_logout__delete_trial_notice_cookie');
207
 
 
 
 
208
  // Set cookie only for public pages and for non-AJAX requests
209
  if ( ! is_admin() && ! apbct_is_ajax() && ! defined('DOING_CRON')
210
  && empty($_POST['ct_checkjs_register_form']) // Buddy press registration fix
4
  Plugin Name: Anti-Spam by CleanTalk
5
  Plugin URI: https://cleantalk.org
6
  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.
7
+ Version: 5.168
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
205
  //Delete cookie for admin trial notice
206
  add_action('wp_logout', 'apbct__hook__wp_logout__delete_trial_notice_cookie');
207
 
208
+ // Formidable Forms Pro Ajax Test Spam
209
+ add_filter('frm_validate_entry', 'apbct_form__formidable__testSpam', 1, 2);
210
+
211
  // Set cookie only for public pages and for non-AJAX requests
212
  if ( ! is_admin() && ! apbct_is_ajax() && ! defined('DOING_CRON')
213
  && empty($_POST['ct_checkjs_register_form']) // Buddy press registration fix
css/cleantalk-dashboard-widget.min.css CHANGED
@@ -1 +1 @@
1
- #ct_widget_wrapper{position:relative;width:100%;height:100%}.ct_widget_top_links{text-align:right;padding:0 12px;height:32px}.ct_widget_settings_link{margin:0 0 0 10px}.ct_preloader{display:none;float:left;width:20px;height:20px;margin:0 10px}.ct_widget_hr{width:100%}.ct_widget_block_header{font-size:18px!important;margin-left:12px!important}.ct_widget_block{display:block;position:relative;padding:12px}.ct_widget_chart_wrapper{height:300px;margin-right:10px}.bar{fill:#4682b4}.bar:nth-child(odd){fill:rgba(50,50,250,.9)}.bar:hover{fill:brown}.axis--x path{display:none}.ct_widget_block table{width:100%;text-align:left}.ct_widget_block table tr{margin-bottom:10px}.ct_widget_activate_button,.ct_widget_button{display:block;margin:10px auto}.ct_widget_block table th{text-align:left;padding:10px 0 5px 10px;border-bottom:2px solid gray}.ct_widget_block table td{text-align:left;padding:10px 0 5px 10px;border-bottom:1px solid gray}.ct_widget_activate_button{padding:7px 15px;font-weight:600;border-radius:3px;border:2px solid #aaa;background:rgba(250,50,50,.9)}.ct_widget_resolve_button{background:rgba(50,250,50,.9)}.ct_widget_activate_header{display:inline-block;width:100%;text-align:center;font-size:18px!important}.ct_widget_wprapper_total_blocked{padding:10px 0 10px 10px;background:#f1f1f1}.ct_widget_wprapper_total_blocked span{position:relative;top:2px}.ct_widget_small_logo{margin-right:1em;vertical-align:middle}#ct_widget_button_view_all{cursor:pointer;border:1px solid #0074a2;-webkit-appearance:none;-webkit-border-radius:2px;border-radius:2px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#0085ba;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}#ct_widget_button_view_all:hover{color:#000!important}
1
+ #ct_widget_wrapper{position:relative;width:100%;height:100%}.ct_widget_top_links{text-align:right;padding:0 12px;height:32px}.ct_widget_settings_link{margin:0 0 0 10px}.ct_preloader{display:none;float:left;width:20px;height:20px;margin:0 10px}.ct_widget_hr{width:100%}.ct_widget_block_header{font-size:18px!important;margin-left:12px!important}.ct_widget_block{display:block;position:relative;padding:12px}.ct_widget_chart_wrapper{height:300px;margin-right:10px}.bar{fill:#4682b4}.bar:nth-child(odd){fill:rgba(50,50,250,.9)}.bar:hover{fill:brown}.axis--x path{display:none}.ct_widget_block table{width:100%;text-align:left}.ct_widget_block table tr{margin-bottom:10px}.ct_widget_activate_button,.ct_widget_button{display:block;margin:10px auto}.ct_widget_block table th{text-align:left;padding:10px 0 5px 10px;border-bottom:2px solid gray}.ct_widget_block table td{text-align:left;padding:10px 0 5px 10px;border-bottom:1px solid gray}#ct_widget_wrapper .ct_widget_block table td.ct_widget_block__country_cell img{width:16px!important;height:auto}.ct_widget_activate_button{padding:7px 15px;font-weight:600;border-radius:3px;border:2px solid #aaa;background:rgba(250,50,50,.9)}.ct_widget_resolve_button{background:rgba(50,250,50,.9)}.ct_widget_activate_header{display:inline-block;width:100%;text-align:center;font-size:18px!important}.ct_widget_wprapper_total_blocked{padding:10px 0 10px 10px;background:#f1f1f1}.ct_widget_wprapper_total_blocked span{position:relative;top:2px}.ct_widget_small_logo{margin-right:1em;vertical-align:middle}#ct_widget_wrapper .ct_widget_wprapper_total_blocked img.ct_widget_small_logo{width:24px!important;height:24px!important}#ct_widget_button_view_all{cursor:pointer;border:1px solid #0074a2;-webkit-appearance:none;-webkit-border-radius:2px;border-radius:2px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#0085ba;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}#ct_widget_button_view_all:hover{color:#000!important}
inc/cleantalk-ajax.php CHANGED
@@ -386,7 +386,10 @@ function ct_ajax_hook($message_obj = null)
386
  // Easy Digital Downloads ajax skip
387
  /* !! Do not add actions here. Use apbct_is_skip_request() function below !! */
388
  //Unknown plugin Ticket #25047
389
- 'alhbrmeu'
 
 
 
390
  );
391
 
392
  global $apbct;
@@ -538,7 +541,7 @@ function ct_ajax_hook($message_obj = null)
538
  }
539
 
540
  // Skip submission if no data found
541
- if ( $sender_email === '' || $contact_form === false ) {
542
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
543
 
544
  return false;
@@ -648,12 +651,6 @@ function ct_ajax_hook($message_obj = null)
648
  die();
649
  }
650
 
651
- if ( isset($_POST['action']) && $_POST['action'] === 'frm_entries_create' ) {
652
- $result = array('112' => $ct_result->comment);
653
- print json_encode($result);
654
- die();
655
- }
656
-
657
  if ( isset($_POST['cma-action']) && $_POST['cma-action'] === 'add' ) {
658
  $result = array('success' => 0, 'thread_id' => null, 'messages' => array($ct_result->comment));
659
  print json_encode($result);
386
  // Easy Digital Downloads ajax skip
387
  /* !! Do not add actions here. Use apbct_is_skip_request() function below !! */
388
  //Unknown plugin Ticket #25047
389
+ 'alhbrmeu',
390
+ // Ninja Forms
391
+ 'nf_preview_update',
392
+ 'nf_save_form'
393
  );
394
 
395
  global $apbct;
541
  }
542
 
543
  // Skip submission if no data found
544
+ if ( $contact_form === false ) {
545
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
546
 
547
  return false;
651
  die();
652
  }
653
 
 
 
 
 
 
 
654
  if ( isset($_POST['cma-action']) && $_POST['cma-action'] === 'add' ) {
655
  $result = array('success' => 0, 'thread_id' => null, 'messages' => array($ct_result->comment));
656
  print json_encode($result);
inc/cleantalk-common.php CHANGED
@@ -177,6 +177,21 @@ function apbct_base_call($params = array(), $reg_flag = false)
177
  'submit_time' => apbct_get_submit_time()
178
  );
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  /**
181
  * Add honeypot_field if exists in params
182
  */
@@ -709,18 +724,25 @@ function ct_get_admin_email()
709
  {
710
  global $apbct;
711
 
712
- // Not WPMS
713
- if (!is_multisite()) {
714
- return $apbct->data['account_email'] ?: get_option('admin_email');
 
 
 
 
 
 
715
  }
716
 
717
- // Main site, common account
718
- if (is_main_site() || $apbct->network_settings['multisite__work_mode'] != 3) {
719
- return $apbct->data['account_email'] ?: get_site_option('admin_email');
 
 
720
  }
721
 
722
- // Individual account, individual key
723
- return $apbct->data['account_email'] ?: get_blog_option(get_current_blog_id(), 'admin_email');
724
  }
725
 
726
  /**
177
  'submit_time' => apbct_get_submit_time()
178
  );
179
 
180
+ /**
181
+ * Add exception_action sender email is empty
182
+ */
183
+ if ( empty($params['sender_email']) && ! isset($params['exception_action']) ) {
184
+ $params['exception_action'] = 1;
185
+ }
186
+
187
+ /**
188
+ * Skip checking excepted requests if the "Log excluded requests" option is disabled.
189
+ */
190
+ if ( isset($params['exception_action']) && $params['exception_action'] == 1 && ! $apbct->settings['exclusions__log_excluded_requests'] ) {
191
+ do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
192
+ return array('ct_result' => new CleantalkResponse());
193
+ }
194
+
195
  /**
196
  * Add honeypot_field if exists in params
197
  */
724
  {
725
  global $apbct;
726
 
727
+ if ( ! is_multisite() ) {
728
+ // Not WPMS
729
+ $admin_email = get_option('admin_email');
730
+ } elseif ( is_main_site() || $apbct->network_settings['multisite__work_mode'] != 3) {
731
+ // WPMS - Main site, common account
732
+ $admin_email = get_site_option('admin_email');
733
+ } else {
734
+ // WPMS - Individual account, individual key
735
+ $admin_email = get_blog_option(get_current_blog_id(), 'admin_email');
736
  }
737
 
738
+ if ( $apbct->data['account_email'] ) {
739
+ add_filter('apbct_get_api_key_email', function () {
740
+ global $apbct;
741
+ return $apbct->data['account_email'];
742
+ });
743
  }
744
 
745
+ return $admin_email;
 
746
  }
747
 
748
  /**
inc/cleantalk-pluggable.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
  use Cleantalk\Variables\Get;
4
  use Cleantalk\Variables\Post;
5
  use Cleantalk\Variables\Server;
@@ -465,6 +466,14 @@ function apbct_is_skip_request($ajax = false)
465
  /* !!! Have to use more than one factor to detect the request - is_plugin active() && $_POST['action'] !!! */
466
  //@ToDo Implement direct integration checking - if have the direct integration will be returned false
467
 
 
 
 
 
 
 
 
 
468
  if ( $ajax ) {
469
  /*****************************************/
470
  /* Here is ajax requests skipping */
1
  <?php
2
 
3
+ use Cleantalk\ApbctWP\RemoteCalls;
4
  use Cleantalk\Variables\Get;
5
  use Cleantalk\Variables\Post;
6
  use Cleantalk\Variables\Server;
466
  /* !!! Have to use more than one factor to detect the request - is_plugin active() && $_POST['action'] !!! */
467
  //@ToDo Implement direct integration checking - if have the direct integration will be returned false
468
 
469
+ if ( RemoteCalls::check() ) {
470
+ return 'CleanTalk RemoteCall request.';
471
+ }
472
+
473
+ if ( is_admin() && ! $ajax ) {
474
+ return 'Admin side request.';
475
+ }
476
+
477
  if ( $ajax ) {
478
  /*****************************************/
479
  /* Here is ajax requests skipping */
inc/cleantalk-public-integrations.php CHANGED
@@ -329,10 +329,9 @@ function apbct_integration__buddyPres__private_msg_check($bp_message_obj)
329
  }
330
  }
331
 
 
332
  if ( ! empty($is_max_comments) ) {
333
- do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
334
-
335
- return;
336
  }
337
 
338
  $sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
@@ -349,6 +348,7 @@ function apbct_integration__buddyPres__private_msg_check($bp_message_obj)
349
  ),
350
  'js_on' => apbct_js_test('ct_checkjs', $_COOKIE, true) ?: apbct_js_test('ct_checkjs', $_POST),
351
  'sender_info' => array('sender_url' => null),
 
352
  )
353
  );
354
 
@@ -417,6 +417,7 @@ function apbct_forms__search__testSpam($search)
417
  'sender_email' => $user !== null ? $user->user_email : null,
418
  'sender_nickname' => $user !== null ? $user->user_login : null,
419
  'post_info' => array('comment_type' => 'site_search_wordpress'),
 
420
  )
421
  );
422
  $ct_result = $base_call_result['ct_result'];
@@ -776,6 +777,18 @@ function apbct_form__formidable__testSpam($errors, $_form)
776
  $ct_result = $base_call_result['ct_result'];
777
 
778
  if ( $ct_result->allow == 0 ) {
 
 
 
 
 
 
 
 
 
 
 
 
779
  $errors['ct_error'] = '<br /><b>' . $ct_result->comment . '</b><br /><br />';
780
  }
781
 
@@ -977,7 +990,6 @@ function ct_preprocess_comment($comment)
977
  $apbct->settings['forms__comments_test'] == 0 ||
978
  $ct_comment_done ||
979
  (isset($_SERVER['HTTP_REFERER']) && stripos($_SERVER['HTTP_REFERER'], 'page=wysija_campaigns&action=editTemplate') !== false) ||
980
- (isset($is_max_comments) && $is_max_comments) ||
981
  (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') !== false)
982
  )
983
  ) {
@@ -1055,7 +1067,8 @@ function ct_preprocess_comment($comment)
1055
  'page_url' => apbct_get_server_variable('HTTP_HOST') . apbct_get_server_variable('REQUEST_URI'),
1056
  )
1057
  )
1058
- )
 
1059
  );
1060
 
1061
  /**
@@ -2894,7 +2907,7 @@ function apbct_form__the7_contact_form()
2894
  }
2895
 
2896
  // Skip submission if no data found
2897
- if ( $sender_email === '' || ! $contact_form ) {
2898
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
2899
 
2900
  return false;
329
  }
330
  }
331
 
332
+ $exception_action = false;
333
  if ( ! empty($is_max_comments) ) {
334
+ $exception_action = true;
 
 
335
  }
336
 
337
  $sender_user_obj = get_user_by('id', $bp_message_obj->sender_id);
348
  ),
349
  'js_on' => apbct_js_test('ct_checkjs', $_COOKIE, true) ?: apbct_js_test('ct_checkjs', $_POST),
350
  'sender_info' => array('sender_url' => null),
351
+ 'exception_action' => $exception_action === true ? 1 : null
352
  )
353
  );
354
 
417
  'sender_email' => $user !== null ? $user->user_email : null,
418
  'sender_nickname' => $user !== null ? $user->user_login : null,
419
  'post_info' => array('comment_type' => 'site_search_wordpress'),
420
+ 'exception_action' => 0,
421
  )
422
  );
423
  $ct_result = $base_call_result['ct_result'];
777
  $ct_result = $base_call_result['ct_result'];
778
 
779
  if ( $ct_result->allow == 0 ) {
780
+ if (apbct_is_ajax()) {
781
+ $result = array (
782
+ 'errors' =>
783
+ array (),
784
+ 'content' => '',
785
+ 'pass' => false,
786
+ 'error_message' => '<div class="frm_error_style" role="status"><p>' . $ct_result->comment . '</p></div>',
787
+ );
788
+ print json_encode($result);
789
+ die();
790
+ }
791
+
792
  $errors['ct_error'] = '<br /><b>' . $ct_result->comment . '</b><br /><br />';
793
  }
794
 
990
  $apbct->settings['forms__comments_test'] == 0 ||
991
  $ct_comment_done ||
992
  (isset($_SERVER['HTTP_REFERER']) && stripos($_SERVER['HTTP_REFERER'], 'page=wysija_campaigns&action=editTemplate') !== false) ||
 
993
  (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') !== false)
994
  )
995
  ) {
1067
  'page_url' => apbct_get_server_variable('HTTP_HOST') . apbct_get_server_variable('REQUEST_URI'),
1068
  )
1069
  )
1070
+ ),
1071
+ 'exception_action' => isset($is_max_comments) && $is_max_comments ? 1 : null,
1072
  );
1073
 
1074
  /**
2907
  }
2908
 
2909
  // Skip submission if no data found
2910
+ if ( ! $contact_form ) {
2911
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
2912
 
2913
  return false;
inc/cleantalk-public-validate.php CHANGED
@@ -206,7 +206,7 @@ function ct_contact_form_validate()
206
  }
207
 
208
  // Skip submission if no data found
209
- if ( $sender_email === '' || ! $contact_form ) {
210
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
211
 
212
  return false;
206
  }
207
 
208
  // Skip submission if no data found
209
+ if ( ! $contact_form ) {
210
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
211
 
212
  return false;
inc/cleantalk-public.php CHANGED
@@ -196,7 +196,6 @@ function apbct_init()
196
  }
197
 
198
  // Formidable
199
- add_filter('frm_entries_before_create', 'apbct_form__formidable__testSpam', 999999, 2);
200
  add_action('frm_entries_footer_scripts', 'apbct_form__formidable__footerScripts', 20, 2);
201
 
202
  // BuddyPress
196
  }
197
 
198
  // Formidable
 
199
  add_action('frm_entries_footer_scripts', 'apbct_form__formidable__footerScripts', 20, 2);
200
 
201
  // BuddyPress
inc/cleantalk-settings.php CHANGED
@@ -522,6 +522,10 @@ function apbct_settings__set_fileds()
522
  'title' => __('Exclusions', 'cleantalk-spam-protect'),
523
  'section' => 'hidden_section',
524
  'fields' => array(
 
 
 
 
525
  'exclusions__urls' => array(
526
  'type' => 'textarea',
527
  'title' => __('URL exclusions', 'cleantalk-spam-protect'),
@@ -2208,6 +2212,11 @@ function apbct_settings__validate($settings)
2208
  \Cleantalk\ApbctWP\Variables\AltSessions::wipe();
2209
  }
2210
 
 
 
 
 
 
2211
  return $settings;
2212
  }
2213
 
@@ -2350,9 +2359,16 @@ function apbct_settings__get_key_auto($direct_call = false)
2350
  $hoster_api_key = $apbct->network_settings['multisite__hoster_api_key'];
2351
  $admin_email = ct_get_admin_email();
2352
 
 
 
 
 
 
 
 
2353
  $result = \Cleantalk\ApbctWP\API::methodGetApiKey(
2354
  'antispam',
2355
- $admin_email,
2356
  $website,
2357
  $platform,
2358
  $timezone,
@@ -2360,7 +2376,8 @@ function apbct_settings__get_key_auto($direct_call = false)
2360
  $user_ip,
2361
  $wpms,
2362
  $white_label,
2363
- $hoster_api_key
 
2364
  );
2365
 
2366
  if ( empty($result['error']) ) {
@@ -2373,7 +2390,7 @@ function apbct_settings__get_key_auto($direct_call = false)
2373
  $apbct->settings['apikey'] = trim($result['auth_key']);
2374
  }
2375
 
2376
- $templates = \Cleantalk\ApbctWP\CleantalkSettingsTemplates::getOptionsTemplate($result['auth_key']);
2377
 
2378
  if ( ! empty($templates) ) {
2379
  $templatesObj = new \Cleantalk\ApbctWP\CleantalkSettingsTemplates($result['auth_key']);
@@ -2713,3 +2730,21 @@ function apbct_debug__set_sfw_update_cron()
2713
  . '<input form="debug__cron_set" type="hidden" name="first_call" value="' . (time() + 60) . '" />'
2714
  . '<input form="debug__cron_set" type="submit" value="Set SFW update to 60 seconds from now" />';
2715
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  'title' => __('Exclusions', 'cleantalk-spam-protect'),
523
  'section' => 'hidden_section',
524
  'fields' => array(
525
+ 'exclusions__log_excluded_requests' => array(
526
+ 'title' => __('Log excluded requests', 'cleantalk-spam-protect'),
527
+ 'description' => __('Enable the option to log some types of the excluded requests, like comments from approved authors or POST requests without an Email address', 'cleantalk-spam-protect'),
528
+ ),
529
  'exclusions__urls' => array(
530
  'type' => 'textarea',
531
  'title' => __('URL exclusions', 'cleantalk-spam-protect'),
2212
  \Cleantalk\ApbctWP\Variables\AltSessions::wipe();
2213
  }
2214
 
2215
+ /**
2216
+ * Triggered before returning the settings
2217
+ */
2218
+ do_action('apbct_before_returning_settings', $settings);
2219
+
2220
  return $settings;
2221
  }
2222
 
2359
  $hoster_api_key = $apbct->network_settings['multisite__hoster_api_key'];
2360
  $admin_email = ct_get_admin_email();
2361
 
2362
+ /**
2363
+ * Filters the email to get API key
2364
+ *
2365
+ * @param string email to get API key
2366
+ */
2367
+ $filtered_admin_email = apply_filters('apbct_get_api_key_email', $admin_email);
2368
+
2369
  $result = \Cleantalk\ApbctWP\API::methodGetApiKey(
2370
  'antispam',
2371
+ $filtered_admin_email,
2372
  $website,
2373
  $platform,
2374
  $timezone,
2376
  $user_ip,
2377
  $wpms,
2378
  $white_label,
2379
+ $hoster_api_key,
2380
+ $filtered_admin_email !== $admin_email
2381
  );
2382
 
2383
  if ( empty($result['error']) ) {
2390
  $apbct->settings['apikey'] = trim($result['auth_key']);
2391
  }
2392
 
2393
+ $templates = ! $direct_call ? \Cleantalk\ApbctWP\CleantalkSettingsTemplates::getOptionsTemplate($result['auth_key']) : '';
2394
 
2395
  if ( ! empty($templates) ) {
2396
  $templatesObj = new \Cleantalk\ApbctWP\CleantalkSettingsTemplates($result['auth_key']);
2730
  . '<input form="debug__cron_set" type="hidden" name="first_call" value="' . (time() + 60) . '" />'
2731
  . '<input form="debug__cron_set" type="submit" value="Set SFW update to 60 seconds from now" />';
2732
  }
2733
+
2734
+ /**
2735
+ * Implementation of service_update_local_settings functionality
2736
+ */
2737
+ add_action('apbct_before_returning_settings', 'apbct__send_local_settings_to_api');
2738
+
2739
+ function apbct__send_local_settings_to_api($settings)
2740
+ {
2741
+ global $apbct;
2742
+
2743
+ // Settings to JSON
2744
+ $settings = json_encode($settings);
2745
+
2746
+ // Hostname
2747
+ $hostname = preg_replace('/^(https?:)?(\/\/)?(www\.)?/', '', get_site_url());
2748
+
2749
+ \Cleantalk\Common\API::methodSendLocalSettings($apbct->api_key, $hostname, $settings);
2750
+ }
inc/cleantalk-updater.php CHANGED
@@ -1096,3 +1096,15 @@ function apbct_update_to_5_164_2()
1096
  global $apbct;
1097
  $apbct->errorDeleteAll();
1098
  }
 
 
 
 
 
 
 
 
 
 
 
 
1096
  global $apbct;
1097
  $apbct->errorDeleteAll();
1098
  }
1099
+
1100
+ /**
1101
+ * 5.167.1
1102
+ */
1103
+ function apbct_update_to_5_167_1()
1104
+ {
1105
+ global $apbct;
1106
+
1107
+ // For the current installations, after updating the option will turn off
1108
+ $apbct->settings['exclusions__log_excluded_requests'] = '0';
1109
+ $apbct->saveSettings();
1110
+ }
js/apbct-public.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function apbct_collect_visible_fields(e){var t,i=[],n="",c=0,o="",a=0,l=[];for(t in e.elements)isNaN(+t)||(i[t]=e.elements[t]);return(i=i.filter(function(e){return-1===l.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(l.push(e.getAttribute("name")),!1))})).forEach(function(e,t,i){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),c++):(o+=" "+e.getAttribute("name"),a++))}),o=o.trim(),{visible_fields:n=n.trim(),visible_fields_count:c,invisible_fields:o,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var i="object"==typeof e&&null!==e?e:{};if(1==+ctPublic.data__set_cookies)for(var n in i)ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(i[n]));else ctSetCookie("apbct_visible_fields",JSON.stringify(i))}function apbct_js_keys__set_input_value(e,t,i,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var c=document.querySelectorAll("[name^=ct_checkjs]"),o=0;o<c.length;o++)c[o].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}!function(){var c=new Date,t=(new Date).getTime(),i=!0,n=[],o=0,a={},e=!1,l=!1;function s(e,t,i){"function"==typeof window.addEventListener?e.addEventListener(t,i):e.attachEvent(t,i)}function u(e,t,i){"function"==typeof window.removeEventListener?e.removeEventListener(t,i):e.detachEvent(t,i)}var d=function(e){var t=Math.floor((new Date).getTime()/1e3);ctSetCookie("ct_fkp_timestamp",t),u(window,"mousedown",d),u(window,"keydown",d)},_=setInterval(function(){i=!0},150),r=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(n))},1200),m=function(e){l||(ctSetCookie("ct_mouse_moved","true"),l=!0),!0===i&&(n.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),i=!1,50<=++o&&(u(window,"mousemove",m),clearInterval(_),clearInterval(r)))};function f(e){var t=e.target.value;!t||t in a||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(a[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(a)))}}):"custom_ajax"===ctPublicFunctions.data__ajax_type?apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{apbct_ajax:1,callback:function(e){e.result&&(a[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(a)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(a[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(a)))}}))}s(window,"mousemove",m),s(window,"mousedown",d),s(window,"keydown",d),s(window,"scroll",function(){e||(ctSetCookie("ct_has_scrolled","true"),e=!0)}),s(window,"DOMContentLoaded",function(){var e=[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",c.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["ct_has_scrolled","false"],["ct_mouse_moved","false"]];if(1!=+ctPublic.data__set_cookies)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var i=0;i<t.length;i++){var n=t[i].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(e.push(["apbct_pixel_url",ctPublic.pixel__url]),+ctPublic.pixel__enabled&&(document.getElementById("apbct_pixel")||jQuery("body").append('<img alt="Cleantalk Pixel" id="apbct_pixel" style="display: none; left: 99999px;" src="'+ctPublic.pixel__url+'">'))),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),jQuery("input[type = 'email'], #email").blur(f)),ctSetCookie(e),setTimeout(function(){for(var e={},t=0;t<document.forms.length;t++){var i=document.forms[t];i.classList.contains("slp_search_form")||i.parentElement.classList.contains("mec-booking")||-1!==i.action.toString().indexOf("activehosted.com")||i.id&&"caspioform"==i.id||i.name.classList&&i.name.classList.contains("tinkoffPayRow")||i.name.classList&&i.name.classList.contains("give-form")||i.id&&"ult-forgot-password-form"===i.id||i.id&&-1!==i.id.indexOf("calculatedfields")||(e[t]=apbct_collect_visible_fields(i),i.onsubmit_prev=i.onsubmit,i.ctFormIndex=t,i.onsubmit=function(e){var t;1!=+ctPublic.data__set_cookies&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}apbct_visible_fields_set_cookie(e)},1e3)})}(),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,i){!t.responseText||-1===t.responseText.indexOf('"apbct')||void 0!==(t=JSON.parse(t.responseText)).apbct&&(t=t.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t.comment}})),cleantalkModal.loaded=t.comment,cleantalkModal.open(),1==+t.stop_script&&window.stop())});
2
  //# sourceMappingURL=apbct-public.min.js.map
1
+ function apbct_collect_visible_fields(e){var t=[],n="",o=0,c="",a=0,i=[];for(var l in e.elements)isNaN(+l)||(t[l]=e.elements[l]);return(t=t.filter(function(e){return-1===i.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(i.push(e.getAttribute("name")),!1))})).forEach(function(e,t,i){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),o++):(c+=" "+e.getAttribute("name"),a++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:o,invisible_fields:c,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var i="object"==typeof e&&null!==e?e:{};if(1==+ctPublic.data__set_cookies)for(var n in i){ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(i[n]))}else ctSetCookie("apbct_visible_fields",JSON.stringify(i))}function apbct_visible_fields_already_collected(e,t){if(0<e.length&&0<t.elements.length){var i=t.method,n=(t.action,t.elements.length),o=[];for(var c in t.elements)isNaN(+c)||(o[c]=t.elements[c]);for(var a=0;a<e.length;a++){if(e[a].method!==i)return!1;if(e[a].action,e[a].fields_count!==n)return!1;var l=e[a].fields_names;for(var s in l){if(0<o.filter(function(e,t,i){var n=e.name,o=e.type;if(l[s].fieldName===n&&l[s].fieldType===o)return!0}).length)return!0}}return!1}return!1}function apbct_get_form_details(e){if(0<e.elements.length){var t={},n=e.elements;for(i=0;i<n.length;i++){var o=n[i].name,c=n[i].type;t[i]={fieldName:o,fieldType:c}}return{method:e.method,action:e.action,fields_count:e.elements.length,fields_names:t}}return!1}function apbct_js_keys__set_input_value(e,t,i,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var o=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<o.length;c++)o[c].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}!function(){var o=new Date,t=(new Date).getTime(),i=!0,n=[],c=0,a={},e=!1,l=!1;function s(e,t,i){"function"==typeof window.addEventListener?e.addEventListener(t,i):e.attachEvent(t,i)}function r(e,t,i){"function"==typeof window.removeEventListener?e.removeEventListener(t,i):e.detachEvent(t,i)}var d=function(){var e=Math.floor((new Date).getTime()/1e3);ctSetCookie("ct_fkp_timestamp",e),r(window,"mousedown",d),r(window,"keydown",d)},u=setInterval(function(){i=!0},150),_=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(n))},1200),m=function(e){l||(ctSetCookie("ct_mouse_moved","true"),l=!0),!0===i&&(n.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),i=!1,50<=++c&&(r(window,"mousemove",m),clearInterval(u),clearInterval(_)))};function f(e){var t=e.target.value;!t||t in a||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(a[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(a)))}}):"custom_ajax"===ctPublicFunctions.data__ajax_type?apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{apbct_ajax:1,callback:function(e){e.result&&(a[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(a)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(a[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(a)))}}))}s(window,"mousemove",m),s(window,"mousedown",d),s(window,"keydown",d),s(window,"scroll",function(){e||(ctSetCookie("ct_has_scrolled","true"),e=!0)}),s(window,"DOMContentLoaded",function(){var e=[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",o.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["ct_has_scrolled","false"],["ct_mouse_moved","false"]];if(1!=+ctPublic.data__set_cookies)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var i=0;i<t.length;i++){var n=t[i].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(e.push(["apbct_pixel_url",ctPublic.pixel__url]),+ctPublic.pixel__enabled&&(document.getElementById("apbct_pixel")||jQuery("body").append('<img alt="Cleantalk Pixel" id="apbct_pixel" style="display: none; left: 99999px;" src="'+ctPublic.pixel__url+'">'))),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),jQuery("input[type = 'email'], #email").blur(f)),ctSetCookie(e),setTimeout(function(){for(var e={},t=[],i=0;i<document.forms.length;i++){var n=document.forms[i];n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"==n.id||n.name.classList&&n.name.classList.contains("tinkoffPayRow")||n.name.classList&&n.name.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.indexOf("calculatedfields")||(apbct_visible_fields_already_collected(t,n)||(e[i]=apbct_collect_visible_fields(n),t.push(apbct_get_form_details(n))),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=i,n.onsubmit=function(e){var t;1!=+ctPublic.data__set_cookies&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}apbct_visible_fields_set_cookie(e)},1e3)})}(),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,i){var n;!t.responseText||-1===t.responseText.indexOf('"apbct')||void 0!==(n=JSON.parse(t.responseText)).apbct&&(n=n.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:n.comment}})),cleantalkModal.loaded=n.comment,cleantalkModal.open(),1==+n.stop_script&&window.stop())});
2
  //# sourceMappingURL=apbct-public.min.js.map
js/apbct-public.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"apbct-public.min.js","sources":["apbct-public.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\t\tctCheckedEmails = {},\n\t\tctScrollCollected = false,\n\t\tctMouseMovedCollected = false;\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\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookie(\"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\tctSetCookie(\"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\tctSetMouseMoved();\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\tfunction checkEmail(e) {\n\t\tvar current_email = e.target.value;\n\t\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t\t// Using REST API handler\n\t\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\t\tapbct_public_sendREST(\n\t\t\t\t\t'check_email_before_post',\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Using AJAX request and handler\n\t\t\t}else if( ctPublicFunctions.data__ajax_type === 'custom_ajax' ) {\n\t\t\t\tapbct_public_sendAJAX(\n\t\t\t\t\t{\n\t\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\t\temail : current_email,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tapbct_ajax: 1,\n\t\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\t\tapbct_public_sendAJAX(\n\t\t\t\t\t{\n\t\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\t\temail : current_email,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction ctSetHasScrolled() {\n\t\tif( ! ctScrollCollected ) {\n\t\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\t\tctScrollCollected = true;\n\t\t}\n\t}\n\n\tfunction ctSetMouseMoved() {\n\t\tif( ! ctMouseMovedCollected ) {\n\t\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\t\tctMouseMovedCollected = true;\n\t\t}\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\tapbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\n\t\t// Collect scrolling info\n\t\tvar initCookies = [\n\t\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t\t[\"ct_pointer_data\", \"0\"],\n\t\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t\t[\"ct_has_scrolled\", 'false'],\n\t\t\t[\"ct_mouse_moved\", 'false'],\n\t\t];\n\n\t\tif( + ctPublic.data__set_cookies !== 1 ) {\n\t\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t\t} else {\n\t\t\t// Delete all visible fields cookies on load the page\n\t\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\t\tif( cookiesArray.length !== 0 ) {\n\t\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( +ctPublic.pixel__setting ){\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t\tif( +ctPublic.pixel__enabled ){\n\t\t\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\t\t\tjQuery('body').append( '<img alt=\"Cleantalk Pixel\" id=\"apbct_pixel\" style=\"display: none; left: 99999px;\" src=\"' + ctPublic.pixel__url + '\">' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( +ctPublic.data__email_check_before_post) {\n\t\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\t\tjQuery(\"input[type = 'email'], #email\").blur(checkEmail);\n\t\t}\n\n\t\tctSetCookie(initCookies);\n\n\t\tsetTimeout(function(){\n\n\t\t\tvar visible_fields_collection = {};\n\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 forms\n\t\t\t\tif (\n\t\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t\t(form.id && form.id == 'caspioform') || //Caspio Form\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('give-form')) || // GiveWP\n\t\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t\t(form.id && form.id.indexOf('calculatedfields') !== -1) // CalculatedFieldsForm\n\t\t\t\t)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvisible_fields_collection[i] = apbct_collect_visible_fields( form );\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\t\tform.ctFormIndex = i;\n\t\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\t\tif ( + ctPublic.data__set_cookies !== 1 && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t\t}\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\n\t\t\tapbct_visible_fields_set_cookie( visible_fields_collection );\n\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( + ctPublic.data__set_cookies === 1 ) {\n\t\tfor ( var i in collection ) {\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\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\tdocument.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\t\t\tcleantalkModal.open();\n\n\t\t\t\t\tif(+response.stop_script == 1)\n\t\t\t\t\t\twindow.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}"],"names":["apbct_collect_visible_fields","form","key","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","elements","isNaN","filter","elem","indexOf","getAttribute","push","forEach","i","getComputedStyle","display","visibility","opacity","classList","contains","trim","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","apbct_visible_fields_set_cookie","visible_fields_collection","form_id","collection","ctPublic","data__set_cookies","ctSetCookie","undefined","JSON","stringify","apbct_js_keys__set_input_value","result","data","params","obj","document","querySelectorAll","length","value","js_key","apbctGetScreenInfo","fullWidth","documentElement","scrollWidth","fullHeight","Math","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctScrollCollected","ctMouseMovedCollected","apbct_attach_event_handler","event","callback","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","KeyTimestamp","floor","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","round","clientY","clientX","clearInterval","checkEmail","e","current_email","target","ctPublicFunctions","data__ajax_type","apbct_public_sendREST","method","email","timestamp","now","apbct_public_sendAJAX","action","apbct_ajax","initCookies","getTimezoneOffset","cookiesArray","cookie","split","cookieName","ctDeleteCookie","pixel__setting","pixel__url","pixel__enabled","getElementById","jQuery","append","data__email_check_before_post","blur","setTimeout","forms","parentElement","toString","id","name","onsubmit_prev","onsubmit","ctFormIndex","this","Function","call","ajaxComplete","xhr","settings","responseText","response","parse","apbct","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","comment","cleantalkModal","loaded","open","stop_script","stop"],"mappings":"AAgPA,SAASA,6BAA8BC,GAGtC,IAOQC,EAPJC,EAAS,GACZC,EAAiB,GACjBC,EAAuB,EACvBC,EAAmB,GACnBC,EAAyB,EACzBC,EAA8B,GAE/B,IAAQN,KAAOD,EAAKQ,SACfC,OAAOR,KACVC,EAAOD,GAAOD,EAAKQ,SAASP,IAsD9B,OAlDAC,EAASA,EAAOQ,OAAO,SAASC,GAG/B,OAA0E,IAAtEJ,EAA4BK,QAASD,EAAKE,aAAa,YAItD,IAAM,CAAC,QAAS,YAAYD,QAASD,EAAKE,aAAa,WAC3DN,EAA4BO,KAAMH,EAAKE,aAAa,UAC7C,OAMFE,QAAQ,SAASJ,EAAMK,EAAGR,GAGO,WAAtCG,EAAKE,aAAa,SACoB,OAAtCF,EAA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7C,gCAAiCC,IAE/B,OA1OL,GA+VqB,oBAAXwF,QAGTA,OAAO1E,UAAU0F,aAAa,SAAU5D,EAAO6D,EAAKC,IAC/CD,EAAIE,eAAwD,IAAxCF,EAAIE,aAAa5H,QAAQ,gBAElB,KAD1B6H,EAAWrG,KAAKsG,MAAMJ,EAAIE,eACVG,QACnBF,EAAWA,EAASE,OACPC,UACZjG,SAASkG,cACR,IAAIC,YAAa,qBAAsB,CACtCC,SAAS,EACTC,OAAQ,CAAEC,QAASR,EAASS,YAK9BC,eAAeC,OAASX,EAASS,QACjCC,eAAeE,OAEa,IAAxBZ,EAASa,aACZ3E,OAAO4E"}
1
+ {"version":3,"file":"apbct-public.min.js","sources":["apbct-public.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\t\tctCheckedEmails = {},\n\t\tctScrollCollected = false,\n\t\tctMouseMovedCollected = false;\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\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookie(\"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\tctSetCookie(\"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\tctSetMouseMoved();\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\tfunction checkEmail(e) {\n\t\tvar current_email = e.target.value;\n\t\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t\t// Using REST API handler\n\t\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\t\tapbct_public_sendREST(\n\t\t\t\t\t'check_email_before_post',\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Using AJAX request and handler\n\t\t\t}else if( ctPublicFunctions.data__ajax_type === 'custom_ajax' ) {\n\t\t\t\tapbct_public_sendAJAX(\n\t\t\t\t\t{\n\t\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\t\temail : current_email,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tapbct_ajax: 1,\n\t\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\t\tapbct_public_sendAJAX(\n\t\t\t\t\t{\n\t\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\t\temail : current_email,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction ctSetHasScrolled() {\n\t\tif( ! ctScrollCollected ) {\n\t\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\t\tctScrollCollected = true;\n\t\t}\n\t}\n\n\tfunction ctSetMouseMoved() {\n\t\tif( ! ctMouseMovedCollected ) {\n\t\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\t\tctMouseMovedCollected = true;\n\t\t}\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\tapbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\n\t\t// Collect scrolling info\n\t\tvar initCookies = [\n\t\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t\t[\"ct_pointer_data\", \"0\"],\n\t\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t\t[\"ct_has_scrolled\", 'false'],\n\t\t\t[\"ct_mouse_moved\", 'false'],\n\t\t];\n\n\t\tif( + ctPublic.data__set_cookies !== 1 ) {\n\t\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t\t} else {\n\t\t\t// Delete all visible fields cookies on load the page\n\t\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\t\tif( cookiesArray.length !== 0 ) {\n\t\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( +ctPublic.pixel__setting ){\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t\tif( +ctPublic.pixel__enabled ){\n\t\t\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\t\t\tjQuery('body').append( '<img alt=\"Cleantalk Pixel\" id=\"apbct_pixel\" style=\"display: none; left: 99999px;\" src=\"' + ctPublic.pixel__url + '\">' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( +ctPublic.data__email_check_before_post) {\n\t\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\t\tjQuery(\"input[type = 'email'], #email\").blur(checkEmail);\n\t\t}\n\n\t\tctSetCookie(initCookies);\n\n\t\tsetTimeout(function(){\n\n\t\t\tvar visible_fields_collection = {};\n\t\t\tvar processedForms = [];\n\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 forms\n\t\t\t\tif (\n\t\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t\t(form.id && form.id == 'caspioform') || //Caspio Form\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('give-form')) || // GiveWP\n\t\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t\t(form.id && form.id.indexOf('calculatedfields') !== -1) // CalculatedFieldsForm\n\t\t\t\t)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif( ! apbct_visible_fields_already_collected( processedForms, form ) ) {\n\t\t\t\t\tvisible_fields_collection[i] = apbct_collect_visible_fields( form );\n\t\t\t\t\tprocessedForms.push( apbct_get_form_details( form ) );\n\t\t\t\t}\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\t\tform.ctFormIndex = i;\n\t\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\t\tif ( + ctPublic.data__set_cookies !== 1 && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t\t}\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\n\t\t\tapbct_visible_fields_set_cookie( visible_fields_collection );\n\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( + ctPublic.data__set_cookies === 1 ) {\n\t\tfor ( var i in collection ) {\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t}\n}\n\nfunction apbct_visible_fields_already_collected( formsProcessed, form ) {\n\n\tif ( formsProcessed.length > 0 && form.elements.length > 0 ) {\n\n\t\tvar formMethod = form.method;\n\t\tvar formAction = form.action;\n\t\tvar formFieldsCount = form.elements.length;\n\t\tvar formInputs = [];\n\n\t\t// Getting only input elements from HTMLFormControlsCollection and putting these into the simple array.\n\t\tfor( var key in form.elements ){\n\t\t\tif( ! isNaN( +key ) ) {\n\t\t\t\tformInputs[key] = form.elements[key];\n\t\t\t}\n\t\t}\n\n\t\tfor ( var i = 0; i < formsProcessed.length; i++ ) {\n\t\t\t// The form with the same METHOD has not processed.\n\t\t\tif ( formsProcessed[i].method !== formMethod ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// The form with the same ACTION has not processed.\n\t\t\tif ( formsProcessed[i].action !== formAction ) {\n\t\t\t\t// @ToDo actions often are different in the similar forms\n\t\t\t\t//return false;\n\t\t\t}\n\t\t\t// The form with the same FIELDS COUNT has not processed.\n\t\t\tif ( formsProcessed[i].fields_count !== formFieldsCount ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Compare every form fields by their TYPE and NAME\n\t\t\tvar fieldsNames = formsProcessed[i].fields_names;\n\t\t\tfor ( var field in fieldsNames ) {\n\t\t\t\tvar res = formInputs.filter(function(item, index, array){\n\t\t\t\t\tvar fieldName = item.name;\n\t\t\t\t\tvar fieldType = item.type;\n\t\t\t\t\tif( fieldsNames[field].fieldName === fieldName && fieldsNames[field].fieldType === fieldType ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif( res.length > 0 ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\treturn false;\n}\n\nfunction apbct_get_form_details( form ) {\n\n\tif( form.elements.length > 0 ) {\n\n\t\tvar fieldsNames = {};\n\n\t\t// Collecting fields and their names\n\t\tvar inputs = form.elements;\n\t\tfor (i = 0; i < inputs.length; i++) {\n\t\t\tvar fieldName = inputs[i].name;\n\t\t\tvar fieldType = inputs[i].type;\n\t\t\tfieldsNames[i] = {\n\t\t\t\tfieldName : fieldName,\n\t\t\t\tfieldType : fieldType,\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t'method' : form.method,\n\t\t\t'action' : form.action,\n\t\t\t'fields_count' : form.elements.length,\n\t\t\t'fields_names' : fieldsNames,\n\t\t};\n\t}\n\n\treturn false;\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\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\tdocument.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\t\t\tcleantalkModal.open();\n\n\t\t\t\t\tif(+response.stop_script == 1)\n\t\t\t\t\t\twindow.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}"],"names":["apbct_collect_visible_fields","form","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","key","elements","isNaN","filter","elem","indexOf","getAttribute","push","forEach","i","getComputedStyle","display","visibility","opacity","classList","contains","trim","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","apbct_visible_fields_set_cookie","visible_fields_collection","form_id","collection","ctPublic","data__set_cookies","ctSetCookie","undefined","JSON","stringify","apbct_visible_fields_already_collected","formsProcessed","length","formMethod","method","formFieldsCount","action","formInputs","fields_count","fieldsNames","fields_names","field","item","index","array","fieldName","name","fieldType","type","apbct_get_form_details","apbct_js_keys__set_input_value","result","data","params","obj","document","querySelectorAll","value","js_key","apbctGetScreenInfo","fullWidth","documentElement","scrollWidth","fullHeight","Math","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","ctScrollCollected","ctMouseMovedCollected","apbct_attach_event_handler","event","callback","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","KeyTimestamp","floor","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","round","clientY","clientX","clearInterval","checkEmail","e","current_email","target","ctPublicFunctions","data__ajax_type","apbct_public_sendREST","email","timestamp","now","apbct_public_sendAJAX","apbct_ajax","initCookies","getTimezoneOffset","cookiesArray","cookie","split","cookieName","ctDeleteCookie","pixel__setting","pixel__url","pixel__enabled","getElementById","jQuery","append","data__email_check_before_post","blur","setTimeout","processedForms","forms","parentElement","toString","id","onsubmit_prev","onsubmit","ctFormIndex","this","Function","call","ajaxComplete","xhr","settings","response","responseText","parse","apbct","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","comment","cleantalkModal","loaded","open","stop_script","stop"],"mappings":"AAoPA,SAASA,6BAA8BC,GAGtC,IAAIC,EAAS,GACZC,EAAiB,GACjBC,EAAuB,EACvBC,EAAmB,GACnBC,EAAyB,EACzBC,EAA8B,GAE/B,IAAI,IAAIC,KAAOP,EAAKQ,SACfC,OAAOF,KACVN,EAAOM,GAAOP,EAAKQ,SAASD,IAsD9B,OAlDAN,EAASA,EAAOS,OAAO,SAASC,GAG/B,OAA0E,IAAtEL,EAA4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D,IAA7B2D,EAAMsB,OAAOgC,eAE1D1H,EAAiB,IACN,GAAKzB,6BAA6BoJ,MACjDvH,gCAAiCJ,EAAgBoE,EAAMsB,OAAOgC,cAI3DtD,EAAMsB,OAAO8B,yBAAyBI,UACzCV,WAAW,WACV9C,EAAMsB,OAAO8B,cAAcK,KAAKzD,EAAMsB,OAAQtB,IAC5C,OAKNhE,gCAAiCC,IAE/B,OA9OL,GAobqB,oBAAXyG,QAGTA,OAAOvE,UAAUuF,aAAa,SAAU1D,EAAO2D,EAAKC,GACnD,IACKC,GADDF,EAAIG,eAAwD,IAAxCH,EAAIG,aAAa9I,QAAQ,gBAElB,KAD1B6I,EAAWrH,KAAKuH,MAAMJ,EAAIG,eACVE,QACnBH,EAAWA,EAASG,OACPC,UACZ9F,SAAS+F,cACR,IAAIC,YAAa,qBAAsB,CACtCC,SAAS,EACTC,OAAQ,CAAEC,QAAST,EAASU,YAK9BC,eAAeC,OAASZ,EAASU,QACjCC,eAAeE,OAEa,IAAxBb,EAASc,aACZzE,OAAO0E"}
lib/Cleantalk/Antispam/Cleantalk.php CHANGED
@@ -231,6 +231,7 @@ class Cleantalk
231
  '/\s?apbct_page_hits=\d*?[^;]*;?/',
232
  '/\s?apbct_visible_fields_count=\d*?[^;]*;?/',
233
  '/\s?apbct_visible_fields=%7B.*%7D[^;]*;?/',
 
234
  ), '', $ct_tmp[$cookie_name]);
235
  }
236
  $request->all_headers = json_encode($ct_tmp);
231
  '/\s?apbct_page_hits=\d*?[^;]*;?/',
232
  '/\s?apbct_visible_fields_count=\d*?[^;]*;?/',
233
  '/\s?apbct_visible_fields=%7B.*%7D[^;]*;?/',
234
+ '/\s?apbct_visible_fields_\d=%7B.*%7D[^;]*;?/',
235
  ), '', $ct_tmp[$cookie_name]);
236
  }
237
  $request->all_headers = json_encode($ct_tmp);
lib/Cleantalk/Antispam/CleantalkRequest.php CHANGED
@@ -8,7 +8,6 @@ namespace Cleantalk\Antispam;
8
  */
9
  class CleantalkRequest
10
  {
11
-
12
  /**
13
  * All http request headers
14
  * @var string
@@ -170,6 +169,11 @@ class CleantalkRequest
170
  */
171
  public $honeypot_field;
172
 
 
 
 
 
 
173
  /**
174
  * Fill params with constructor
175
  *
@@ -203,6 +207,7 @@ class CleantalkRequest
203
  $this->post_info = isset($params['post_info']) ? (string)json_encode($params['post_info']) : null;
204
  $this->sender_info = isset($params['sender_info']) ? (string)json_encode($params['sender_info']) : null;
205
  $this->honeypot_field = isset($params['honeypot_field']) ? (int)$params['honeypot_field'] : null;
 
206
 
207
  $this->message = ! empty($params['message'])
208
  ? (! is_scalar($params['message'])
8
  */
9
  class CleantalkRequest
10
  {
 
11
  /**
12
  * All http request headers
13
  * @var string
169
  */
170
  public $honeypot_field;
171
 
172
+ /**
173
+ * @var int|null
174
+ */
175
+ public $exception_action;
176
+
177
  /**
178
  * Fill params with constructor
179
  *
207
  $this->post_info = isset($params['post_info']) ? (string)json_encode($params['post_info']) : null;
208
  $this->sender_info = isset($params['sender_info']) ? (string)json_encode($params['sender_info']) : null;
209
  $this->honeypot_field = isset($params['honeypot_field']) ? (int)$params['honeypot_field'] : null;
210
+ $this->exception_action = isset($params['exception_action']) ? (int)$params['exception_action'] : null;
211
 
212
  $this->message = ! empty($params['message'])
213
  ? (! is_scalar($params['message'])
lib/Cleantalk/ApbctWP/AdminNotices.php CHANGED
@@ -18,7 +18,6 @@ class AdminNotices
18
  * @var array
19
  */
20
  const NOTICES = array(
21
- 'notice_get_key_error',
22
  'notice_key_is_incorrect',
23
  'notice_trial',
24
  'notice_renew',
18
  * @var array
19
  */
20
  const NOTICES = array(
 
21
  'notice_key_is_incorrect',
22
  'notice_trial',
23
  'notice_renew',
lib/Cleantalk/ApbctWP/State.php CHANGED
@@ -95,6 +95,8 @@ class State extends \Cleantalk\Common\State
95
  'data__email_check_before_post' => 1,
96
 
97
  // Exclusions
 
 
98
  'exclusions__urls' => '',
99
  'exclusions__urls__use_regexp' => 0,
100
  'exclusions__fields' => '',
95
  'data__email_check_before_post' => 1,
96
 
97
  // Exclusions
98
+ // Send to the cloud some excepted requests
99
+ 'exclusions__log_excluded_requests' => 1,
100
  'exclusions__urls' => '',
101
  'exclusions__urls__use_regexp' => 0,
102
  'exclusions__fields' => '',
lib/Cleantalk/Common/API.php CHANGED
@@ -76,6 +76,7 @@ class API
76
  $wpms = false,
77
  $white_label = false,
78
  $hoster_api_key = '',
 
79
  $do_check = true
80
  ) {
81
  $request = array(
@@ -90,6 +91,7 @@ class API
90
  'wpms_setup' => $wpms,
91
  'hoster_whitelabel' => $white_label,
92
  'hoster_api_key' => $hoster_api_key,
 
93
  );
94
 
95
  $result = static::sendRequest($request);
@@ -848,6 +850,37 @@ class API
848
  return $result;
849
  }
850
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
851
  private static function getProductId($product_name)
852
  {
853
  $product_id = null;
76
  $wpms = false,
77
  $white_label = false,
78
  $hoster_api_key = '',
79
+ $email_filtered = false,
80
  $do_check = true
81
  ) {
82
  $request = array(
91
  'wpms_setup' => $wpms,
92
  'hoster_whitelabel' => $white_label,
93
  'hoster_api_key' => $hoster_api_key,
94
+ 'email_filtered' => $email_filtered
95
  );
96
 
97
  $result = static::sendRequest($request);
850
  return $result;
851
  }
852
 
853
+ /**
854
+ * Sending of local settings API method wrapper
855
+ *
856
+ * @param string $api_key
857
+ * @param string $hostname
858
+ * @param string $settings
859
+ *
860
+ * @return array|bool|mixed
861
+ *
862
+ * @psalm-suppress PossiblyUnusedMethod
863
+ * @psalm-suppress PossiblyUnusedReturnValue
864
+ */
865
+ public static function methodSendLocalSettings(
866
+ $api_key,
867
+ $hostname,
868
+ $settings,
869
+ $do_check = true
870
+ ) {
871
+ $request = array(
872
+ 'method_name' => 'service_update_local_settings',
873
+ 'auth_key' => $api_key,
874
+ 'hostname' => $hostname,
875
+ 'settings' => $settings
876
+ );
877
+
878
+ $result = static::sendRequest($request);
879
+ $result = $do_check ? static::checkResponse($result, 'send_local_settings') : $result;
880
+
881
+ return $result;
882
+ }
883
+
884
  private static function getProductId($product_name)
885
  {
886
  $product_id = null;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
- Stable tag: 5.167
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -595,6 +595,31 @@ If your website has forms that send data to external sources, you can enable opt
595
 
596
  == Changelog ==
597
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
598
  = 5.167 Dec 06 2021 =
599
  * Fix. Comment scanner. Scanning loop fixed.
600
  * Fix. Comment scanner. Scan only not spam comments.
@@ -607,7 +632,7 @@ If your website has forms that send data to external sources, you can enable opt
607
  * Fix. Settings. Getting key button fixed.
608
  * Fix: Removed ajax_type from apbct_email_check_before_post
609
  * Fixed Ajax.php errors with apbct_email_check_before_post
610
- * Fix: Add integration for CalculatedFieldsForm and fixed scripts
611
 
612
  = 5.166 Nov 18 2021 =
613
  * Fix: skip ult-forgot-password action.
4
  Requires at least: 3.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
+ Stable tag: 5.168
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
595
 
596
  == Changelog ==
597
 
598
+ = 5.168 Dec 16 2021 =
599
+ #### One integrations added, some skipped requests will be logged, cookies optimized and minor issues fixed.
600
+ * New. Get key. A filter to changing an email to get the key implemented.
601
+ * New. Log exclusions. Option for logging excluded request implemented.
602
+ * New. Integration. Formidable Pro integration added.
603
+ * New. Integration. Smart forms integration added.
604
+ * Upd. Get key. email_filtered parameter added.
605
+ * Upd: Antispam. Prevent skip requests without emails.
606
+ * Upd: Antispam. Prevent skip requests trusted users.
607
+ * Mod: Implementation of sending plugin settings to service_update_local_settings
608
+ * Fix. Antispam. Exception action argument fixed.
609
+ * Fix. Antispam. Preventing catch RC requests.
610
+ * Fix. Antispam. Preventing catch website search requests.
611
+ * Fix. Setting templates. Get templates only after manual getting key.
612
+ * Fix. Admin notices. Notice about getting key removed.
613
+ * Fix. Getting key. Get the right email for gathering the key.
614
+ * Fix. Exception action. Send ajax requests without email to the cloud.
615
+ * Fix. Exception action. Prevent catching admin-side requests.
616
+ * Fix. Exception action. Send ajax requests without email to the cloud.
617
+ * Fix. Exception action. Prevent catching admin-side requests.
618
+ * Fix. Log exclusions. Skip checking excepted requests if the "Log excluded requests" option is disabled.
619
+ * Fix. Antispam. Remove unnecessary cookie from requests.
620
+ * Fix. Visible fields. Collecting visible fields only for unique forms on the page.
621
+ * Fix: excluded some action for Ninja Form from spamtest.
622
+
623
  = 5.167 Dec 06 2021 =
624
  * Fix. Comment scanner. Scanning loop fixed.
625
  * Fix. Comment scanner. Scan only not spam comments.
632
  * Fix. Settings. Getting key button fixed.
633
  * Fix: Removed ajax_type from apbct_email_check_before_post
634
  * Fixed Ajax.php errors with apbct_email_check_before_post
635
+ * Fix: Add integration for CalculatedFieldsForm and fixed scripts
636
 
637
  = 5.166 Nov 18 2021 =
638
  * Fix: skip ult-forgot-password action.