Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.183

Version Description

Aug 18 2022 =

Checking for bot while email encoder decode, negative reports improved, some integrations fixed and some minor issues fixed.
  • New: Email Encoder. Check bot before decode.
  • New. Storing big connection reports.
  • Fix. Kses tag fixed.
  • Fix: Skipped login form for Wishlist Member
  • Mod: Added headers_sent in Cookie::set
  • Mod: Added aweber external form integration
  • Fix. Server variables. Getting Request variable fixed.
  • Fix. Connection reports. Getting data from options fixed.
  • Fix. Connection reports. Saving data fixed.
  • Fix. Connection reports. Displaying data fixed.
  • Fix. Cookies. Getting cookies from alternative way fixed.
  • Fix. Cookies. ApbctWP\Variables\Cookie getting fixed.
  • Fix. Cookies. Cookie check parameter fixed.
  • Fix: Fixed error with response from custom ajax requests
Download this release

Release Info

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

Code changes from version 5.182.2 to 5.183

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.182.2
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -121,12 +121,7 @@ $apbct->api_key = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->w
121
  $apbct->key_is_ok = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['key_is_ok'] : $apbct->network_data['key_is_ok'];
122
  $apbct->moderate = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['moderate'] : $apbct->network_data['moderate'];
123
 
124
- $apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date(
125
- 'd M'
126
- );
127
- $apbct->data['connection_reports']['since'] = isset($apbct->data['connection_reports']['since']) ? $apbct->data['user_counter']['since'] : date(
128
- 'd M'
129
- );
130
 
131
  $apbct->firewall_updating = (bool)$apbct->fw_stats['firewall_updating_id'];
132
 
@@ -146,7 +141,7 @@ if (
146
  $apbct->key_is_ok &&
147
  ( ! is_admin() || apbct_is_ajax() ) &&
148
  $apbct->settings['data__email_decoder'] ) {
149
- \Cleantalk\Antispam\EmailEncoder::getInstance();
150
  }
151
 
152
  add_action('rest_api_init', 'apbct_register_my_rest_routes');
@@ -2323,7 +2318,7 @@ function apbct_cookie()
2323
  // Cookies test
2324
  $cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
2325
  if ( $apbct->data['cookies_type'] === 'native' ) {
2326
- Cookie::set('apbct_cookies_test', json_encode($cookie_test_value), 0, '/', $domain, null, true);
2327
  }
2328
 
2329
  $apbct->flags__cookies_setuped = true;
@@ -2436,12 +2431,25 @@ function ct_account_status_check($api_key = null, $process_errors = true)
2436
  return $result;
2437
  }
2438
 
 
 
 
2439
  function ct_mail_send_connection_report()
2440
  {
2441
  global $apbct;
2442
 
2443
- if ( ($apbct->settings['misc__send_connection_reports'] == 1 && $apbct->connection_reports['negative'] > 0) || ! empty(Get::get('ct_send_connection_report')) ) {
2444
- $to = "welcome@cleantalk.org";
 
 
 
 
 
 
 
 
 
 
2445
  $subject = "Connection report for " . Server::get('HTTP_HOST');
2446
  $message = '
2447
  <html lang="en">
@@ -2450,11 +2458,11 @@ function ct_mail_send_connection_report()
2450
  </head>
2451
  <body>
2452
  <p>From '
2453
- . $apbct->connection_reports['since']
2454
- . ' to ' . date('d M') . ' has been made '
2455
- . ($apbct->connection_reports['success'] + $apbct->connection_reports['negative'])
2456
- . ' calls, where ' . $apbct->connection_reports['success'] . ' were success and '
2457
- . $apbct->connection_reports['negative'] . ' were negative
2458
  </p>
2459
  <p>Negative report:</p>
2460
  <table> <tr>
@@ -2465,26 +2473,46 @@ function ct_mail_send_connection_report()
2465
  <td><b>Server IP</b></td>
2466
  </tr>
2467
  ';
 
2468
  foreach ( $apbct->connection_reports['negative_report'] as $key => $report ) {
2469
- $message .= '<tr>'
2470
- . '<td>' . ($key + 1) . '.</td>'
2471
- . '<td>' . $report['date'] . '</td>'
2472
- . '<td>' . $report['page_url'] . '</td>'
2473
- . '<td>' . $report['lib_report'] . '</td>'
2474
- . '<td>' . $report['work_url'] . '</td>'
2475
- . '</tr>';
 
 
2476
  }
2477
- $message .= '</table></body></html>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2478
 
2479
  $headers = "Content-type: text/html; charset=windows-1251 \r\n";
2480
  $headers .= 'From: ' . ct_get_admin_email();
2481
  /** @psalm-suppress UnusedFunctionCall */
2482
- mail($to, $subject, $message, $headers);
 
 
 
 
 
 
2483
  }
2484
-
2485
- $apbct->data['connection_reports'] = $apbct->def_data['connection_reports'];
2486
- $apbct->data['connection_reports']['since'] = date('d M');
2487
- $apbct->saveData();
2488
  }
2489
 
2490
  /**
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.183
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
121
  $apbct->key_is_ok = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['key_is_ok'] : $apbct->network_data['key_is_ok'];
122
  $apbct->moderate = ! APBCT_WPMS || $apbct->allow_custom_key || $apbct->white_label ? $apbct->data['moderate'] : $apbct->network_data['moderate'];
123
 
124
+ $apbct->data['user_counter']['since'] = isset($apbct->data['user_counter']['since']) ? $apbct->data['user_counter']['since'] : date('d M');
 
 
 
 
 
125
 
126
  $apbct->firewall_updating = (bool)$apbct->fw_stats['firewall_updating_id'];
127
 
141
  $apbct->key_is_ok &&
142
  ( ! is_admin() || apbct_is_ajax() ) &&
143
  $apbct->settings['data__email_decoder'] ) {
144
+ \Cleantalk\ApbctWP\Antispam\EmailEncoder::getInstance();
145
  }
146
 
147
  add_action('rest_api_init', 'apbct_register_my_rest_routes');
2318
  // Cookies test
2319
  $cookie_test_value['check_value'] = md5($cookie_test_value['check_value']);
2320
  if ( $apbct->data['cookies_type'] === 'native' ) {
2321
+ Cookie::set('apbct_cookies_test', urlencode(json_encode($cookie_test_value)), 0, '/', $domain, null, true);
2322
  }
2323
 
2324
  $apbct->flags__cookies_setuped = true;
2431
  return $result;
2432
  }
2433
 
2434
+ /**
2435
+ * Send failed connection reports if exist and still unsent.
2436
+ */
2437
  function ct_mail_send_connection_report()
2438
  {
2439
  global $apbct;
2440
 
2441
+ if ( ( isset($apbct->connection_reports['negative']) && $apbct->connection_reports['negative'] > 0 ) || !empty(Get::get('ct_send_connection_report')) ) {
2442
+ //skip empty reports for cron job
2443
+ $unsent_exist = false;
2444
+ foreach ( $apbct->connection_reports['negative_report'] as $_key => $report ) {
2445
+ if ( $report['is_sent'] == false ) {
2446
+ $unsent_exist = true;
2447
+ }
2448
+ }
2449
+ if ( ! $unsent_exist ) {
2450
+ return;
2451
+ }
2452
+ $to = "welcome@cleantalk.org";
2453
  $subject = "Connection report for " . Server::get('HTTP_HOST');
2454
  $message = '
2455
  <html lang="en">
2458
  </head>
2459
  <body>
2460
  <p>From '
2461
+ . $apbct->connection_reports['since']
2462
+ . ' to ' . date('d M') . ' has been made '
2463
+ . ( $apbct->connection_reports['success'] + $apbct->connection_reports['negative'] )
2464
+ . ' calls, where ' . $apbct->connection_reports['success'] . ' were success and '
2465
+ . $apbct->connection_reports['negative'] . ' were negative
2466
  </p>
2467
  <p>Negative report:</p>
2468
  <table> <tr>
2473
  <td><b>Server IP</b></td>
2474
  </tr>
2475
  ';
2476
+ $counter = 0;
2477
  foreach ( $apbct->connection_reports['negative_report'] as $key => $report ) {
2478
+ if ( !$report['is_sent'] ) {
2479
+ $message .= '<tr>'
2480
+ . '<td>' . ( ++$counter ) . '.</td>'
2481
+ . '<td>' . $report['date'] . '</td>'
2482
+ . '<td>' . $report['page_url'] . '</td>'
2483
+ . '<td>' . $report['lib_report'] . '</td>'
2484
+ . '<td>' . $report['work_url'] . '</td>'
2485
+ . '</tr>';
2486
+ }
2487
  }
2488
+ $message .= '</table>';
2489
+
2490
+ $message .= '<br>';
2491
+ $show_connection_reports_link =
2492
+ substr(get_option('home'), -1) === '/' ? get_option('home') : get_option('home') . '/'
2493
+ . '?'
2494
+ . http_build_query([
2495
+ 'plugin_name' => 'apbct',
2496
+ 'spbc_remote_call_token' => md5($apbct->api_key),
2497
+ 'spbc_remote_call_action' => 'debug',
2498
+ 'show_only' => 'connection_reports',
2499
+ ]);
2500
+ $message .= '<a href="' . $show_connection_reports_link . '" target="_blank">Show connection reports with remote call</a>';
2501
+ $message .= '<br>';
2502
+
2503
+ $message .= '</body></html>';
2504
 
2505
  $headers = "Content-type: text/html; charset=windows-1251 \r\n";
2506
  $headers .= 'From: ' . ct_get_admin_email();
2507
  /** @psalm-suppress UnusedFunctionCall */
2508
+ if ( wp_mail($to, $subject, $message, $headers) ) {
2509
+ foreach ( $apbct->storage['connection_reports']['negative_report'] as $key => &$report ) {
2510
+ $report['is_sent'] = true;
2511
+ }
2512
+ unset($report);
2513
+ $apbct->save('connection_reports', true, false);
2514
+ }
2515
  }
 
 
 
 
2516
  }
2517
 
2518
  /**
inc/cleantalk-ajax.php CHANGED
@@ -566,8 +566,8 @@ function ct_ajax_hook($message_obj = null)
566
  Post::hasString('action', 'fusion_form_submit_form_to_email') ||
567
  Post::hasString('action', 'fusion_form_submit_ajax')
568
  ) {
569
- if (Post::get('formData')) {
570
- $form_data = Post::get('formData');
571
  $form_data = explode('&', $form_data);
572
 
573
  for ($index = 0; $index < count($form_data); $index++) {
566
  Post::hasString('action', 'fusion_form_submit_form_to_email') ||
567
  Post::hasString('action', 'fusion_form_submit_ajax')
568
  ) {
569
+ if (isset($_POST['formData'])) {
570
+ $form_data = $_POST['formData'];
571
  $form_data = explode('&', $form_data);
572
 
573
  for ($index = 0; $index < count($form_data); $index++) {
inc/cleantalk-common.php CHANGED
@@ -225,12 +225,11 @@ function apbct_base_call($params = array(), $reg_flag = false)
225
  $default_params['sender_info']['server_info'] = $_SERVER;
226
  }
227
 
 
228
  $ct_request = new CleantalkRequest(
229
  \Cleantalk\ApbctWP\Helper::arrayMergeSaveNumericKeysRecursive($default_params, $params)
230
  );
231
 
232
- $ct = new Cleantalk();
233
-
234
  // Options store url without scheme because of DB error with ''://'
235
  $config = ct_get_server();
236
  $ct->server_url = APBCT_MODERATE_URL;
@@ -252,26 +251,8 @@ function apbct_base_call($params = array(), $reg_flag = false)
252
  $apbct->stats['last_request']['server'] = $ct->work_url;
253
  $apbct->save('stats');
254
 
255
- // Connection reports
256
- if ( $ct_result->errno === 0 && empty($ct_result->errstr) ) {
257
- $apbct->data['connection_reports']['success']++;
258
- } else {
259
- $apbct->data['connection_reports']['negative']++;
260
- $apbct->data['connection_reports']['negative_report'][] = array(
261
- 'date' => date("Y-m-d H:i:s"),
262
- 'page_url' => Server::get('REQUEST_URI'),
263
- 'lib_report' => $ct_result->errstr,
264
- 'work_url' => $ct->work_url,
265
- );
266
-
267
- if ( count($apbct->data['connection_reports']['negative_report']) > 20 ) {
268
- $apbct->data['connection_reports']['negative_report'] = array_slice(
269
- $apbct->data['connection_reports']['negative_report'],
270
- -20,
271
- 20
272
- );
273
- }
274
- }
275
 
276
  if ( $ct->server_change ) {
277
  update_option(
@@ -307,6 +288,61 @@ function apbct_base_call($params = array(), $reg_flag = false)
307
  return array('ct' => $ct, 'ct_result' => $ct_result);
308
  }
309
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  function apbct_rotate_moderate()
311
  {
312
  $ct = new Cleantalk();
225
  $default_params['sender_info']['server_info'] = $_SERVER;
226
  }
227
 
228
+ $ct = new Cleantalk();
229
  $ct_request = new CleantalkRequest(
230
  \Cleantalk\ApbctWP\Helper::arrayMergeSaveNumericKeysRecursive($default_params, $params)
231
  );
232
 
 
 
233
  // Options store url without scheme because of DB error with ''://'
234
  $config = ct_get_server();
235
  $ct->server_url = APBCT_MODERATE_URL;
251
  $apbct->stats['last_request']['server'] = $ct->work_url;
252
  $apbct->save('stats');
253
 
254
+ // Add a connection report
255
+ apbct_add_connection_report($ct, $ct_request, $ct_result);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
 
257
  if ( $ct->server_change ) {
258
  update_option(
288
  return array('ct' => $ct, 'ct_result' => $ct_result);
289
  }
290
 
291
+ /**
292
+ * Save and rotate connection reports
293
+ *
294
+ * @param Cleantalk $cleantalk
295
+ * @param CleantalkRequest $request
296
+ * @param CleantalkResponse $request_response
297
+ *
298
+ * @return void
299
+ */
300
+ function apbct_add_connection_report(
301
+ Cleantalk $cleantalk,
302
+ CleantalkRequest $request,
303
+ CleantalkResponse $request_response
304
+ ) {
305
+ global $apbct;
306
+
307
+ // if not defined, reset the connection reports
308
+ if ( empty(Helper::arrayObjectToArray($apbct->connection_reports)) ) {
309
+ $apbct->drop('connection_reports');
310
+ }
311
+
312
+ // if not defined, set the gathering connection report start date
313
+ if ( empty($apbct->connection_reports['since']) ) {
314
+ $apbct->connection_reports['since'] = date('d M');
315
+ }
316
+
317
+ // Succeeded connection
318
+ if ( $request_response->errno === 0 && empty($request_response->errstr) ) {
319
+ $apbct->connection_reports['success']++;
320
+
321
+ // Failed to connect. Add a negative report
322
+ } else {
323
+ $apbct->connection_reports['negative']++;
324
+ $apbct->connection_reports['negative_report'][] = array(
325
+ 'date' => date("Y-m-d H:i:s"),
326
+ 'page_url' => get_site_url() . Server::get('REQUEST_URI'),
327
+ 'lib_report' => $request_response->errstr,
328
+ 'work_url' => $cleantalk->work_url,
329
+ 'content' => $request,
330
+ 'is_sent' => false
331
+ );
332
+
333
+ // Rotate negative reports. Save only last 20
334
+ if ( count($apbct->connection_reports['negative_report']) > 20 ) {
335
+ $apbct->connection_reports['negative_report'] = array_slice(
336
+ $apbct->connection_reports['negative_report'],
337
+ -20,
338
+ 20
339
+ );
340
+ }
341
+ }
342
+
343
+ $apbct->save('connection_reports', true, false);
344
+ }
345
+
346
  function apbct_rotate_moderate()
347
  {
348
  $ct = new Cleantalk();
inc/cleantalk-pluggable.php CHANGED
@@ -789,6 +789,14 @@ function apbct_is_skip_request($ajax = false)
789
  ) {
790
  return 'MultiStep Checkout for WooCommerce - step validation';
791
  }
 
 
 
 
 
 
 
 
792
  } else {
793
  /*****************************************/
794
  /* Here is non-ajax requests skipping */
789
  ) {
790
  return 'MultiStep Checkout for WooCommerce - step validation';
791
  }
792
+
793
+ // Skip Login Form for Wishlist Member
794
+ if (
795
+ apbct_is_plugin_active('wishlist-member/wpm.php') &&
796
+ Post::get('action') === 'wishlistmember_ajax_login'
797
+ ) {
798
+ return 'Wishlist Member - skip login';
799
+ }
800
  } else {
801
  /*****************************************/
802
  /* Here is non-ajax requests skipping */
inc/cleantalk-public.php CHANGED
@@ -1230,16 +1230,9 @@ function ct_enqueue_scripts_public($_hook)
1230
 
1231
  // Show controls for commentaries
1232
  if ( in_array("administrator", $current_user->roles) ) {
 
1233
  if ( $apbct->settings['comments__manage_comments_on_public_page'] ) {
1234
  $ajax_nonce = wp_create_nonce("ct_secret_nonce");
1235
-
1236
- wp_enqueue_style(
1237
- 'ct_public_admin_css',
1238
- APBCT_CSS_ASSETS_PATH . '/cleantalk-public-admin.min.css',
1239
- array(),
1240
- APBCT_VERSION,
1241
- 'all'
1242
- );
1243
  wp_enqueue_script(
1244
  'ct_public_admin_js',
1245
  APBCT_JS_ASSETS_PATH . '/cleantalk-public-admin.min.js',
@@ -1260,8 +1253,12 @@ function ct_enqueue_scripts_public($_hook)
1260
  __("Feedback has been sent to %sCleanTalk Dashboard%s.", 'cleantalk-spam-protect'),
1261
  $apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my/show_requests?user_token={$apbct->user_token}&cp_mode=antispam>" : '',
1262
  $apbct->user_token ? "</a>" : ''
1263
- ) . ' ' . esc_html__('The service accepts feedback only for requests made no more than 7 or 45 days
1264
- (if the Extra package is activated) ago.', 'cleantalk-spam-protect'),
 
 
 
 
1265
  ));
1266
  }
1267
  }
@@ -1285,7 +1282,7 @@ function ct_enqueue_scripts_public($_hook)
1285
 
1286
  function ct_enqueue_styles_public()
1287
  {
1288
- global $apbct;
1289
 
1290
  if ( apbct_exclusions_check__url() ) {
1291
  return;
@@ -1302,12 +1299,26 @@ function ct_enqueue_styles_public()
1302
  $apbct->settings['comments__bp_private_messages'] ||
1303
  $apbct->settings['data__general_postdata_test']
1304
  ) {
 
1305
  wp_enqueue_style(
1306
  'ct_public_css',
1307
  APBCT_CSS_ASSETS_PATH . '/cleantalk-public.min.css',
1308
  array(),
1309
  APBCT_VERSION
1310
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
1311
  }
1312
  }
1313
 
@@ -1330,7 +1341,7 @@ function apbct_enqueue_and_localize_public_scripts()
1330
  '_rest_url' => Escape::escUrl(apbct_get_rest_url()),
1331
  'data__cookies_type' => $apbct->data['cookies_type'],
1332
  'data__ajax_type' => $apbct->data['ajax_type'],
1333
- 'text__wait_for_decoding' => esc_html__('Wait for decoding...', 'cleantalk-spam-protect'),
1334
  'cookiePrefix' => apbct__get_cookie_prefix(),
1335
  ));
1336
 
@@ -1346,6 +1357,14 @@ function apbct_enqueue_and_localize_public_scripts()
1346
  'data__cookies_type' => $apbct->data['cookies_type'],
1347
  'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
1348
  ));
 
 
 
 
 
 
 
 
1349
  }
1350
 
1351
  /**
1230
 
1231
  // Show controls for commentaries
1232
  if ( in_array("administrator", $current_user->roles) ) {
1233
+ // Admin javascript for managing comments on public pages
1234
  if ( $apbct->settings['comments__manage_comments_on_public_page'] ) {
1235
  $ajax_nonce = wp_create_nonce("ct_secret_nonce");
 
 
 
 
 
 
 
 
1236
  wp_enqueue_script(
1237
  'ct_public_admin_js',
1238
  APBCT_JS_ASSETS_PATH . '/cleantalk-public-admin.min.js',
1253
  __("Feedback has been sent to %sCleanTalk Dashboard%s.", 'cleantalk-spam-protect'),
1254
  $apbct->user_token ? "<a target='_blank' href=https://cleantalk.org/my/show_requests?user_token={$apbct->user_token}&cp_mode=antispam>" : '',
1255
  $apbct->user_token ? "</a>" : ''
1256
+ )
1257
+ . ' '
1258
+ . esc_html__(
1259
+ 'The service accepts feedback only for requests made less than 7 (or 45 if the Extra Package is activated) days ago.',
1260
+ 'cleantalk-spam-protect'
1261
+ ),
1262
  ));
1263
  }
1264
  }
1282
 
1283
  function ct_enqueue_styles_public()
1284
  {
1285
+ global $apbct, $current_user;
1286
 
1287
  if ( apbct_exclusions_check__url() ) {
1288
  return;
1299
  $apbct->settings['comments__bp_private_messages'] ||
1300
  $apbct->settings['data__general_postdata_test']
1301
  ) {
1302
+ // Common public styles
1303
  wp_enqueue_style(
1304
  'ct_public_css',
1305
  APBCT_CSS_ASSETS_PATH . '/cleantalk-public.min.css',
1306
  array(),
1307
  APBCT_VERSION
1308
  );
1309
+ // Public admin styles
1310
+ if ( in_array("administrator", $current_user->roles) ) {
1311
+ // Admin style for managing comments on public pages
1312
+ if ( $apbct->settings['comments__manage_comments_on_public_page'] ) {
1313
+ wp_enqueue_style(
1314
+ 'ct_public_admin_css',
1315
+ APBCT_CSS_ASSETS_PATH . '/cleantalk-public-admin.min.css',
1316
+ array(),
1317
+ APBCT_VERSION,
1318
+ 'all'
1319
+ );
1320
+ }
1321
+ }
1322
  }
1323
  }
1324
 
1341
  '_rest_url' => Escape::escUrl(apbct_get_rest_url()),
1342
  'data__cookies_type' => $apbct->data['cookies_type'],
1343
  'data__ajax_type' => $apbct->data['ajax_type'],
1344
+ 'text__wait_for_decoding' => esc_html__('Anti-spam by CleanTalk: Decoding contact data...', 'cleantalk-spam-protect'),
1345
  'cookiePrefix' => apbct__get_cookie_prefix(),
1346
  ));
1347
 
1357
  'data__cookies_type' => $apbct->data['cookies_type'],
1358
  'data__visible_fields_required' => ! apbct_is_user_logged_in() || $apbct->settings['data__protect_logged_in'] == 1,
1359
  ));
1360
+
1361
+ wp_enqueue_style(
1362
+ 'ct_public_css',
1363
+ APBCT_CSS_ASSETS_PATH . '/cleantalk-public.min.css',
1364
+ array(),
1365
+ APBCT_VERSION,
1366
+ 'all'
1367
+ );
1368
  }
1369
 
1370
  /**
inc/cleantalk-settings.php CHANGED
@@ -711,14 +711,6 @@ function apbct_settings__set_fields()
711
  'section' => 'hidden_section',
712
  'html_after' => '</div><div id="apbct_hidden_section_nav">{HIDDEN_SECTION_NAV}</div></div>',
713
  'fields' => array(
714
- 'misc__send_connection_reports' => array(
715
- 'type' => 'checkbox',
716
- 'title' => __('Send connection reports', 'cleantalk-spam-protect'),
717
- 'description' => __(
718
- "Checking this box you allow plugin to send the information about your connection. The option in a beta state.",
719
- 'cleantalk-spam-protect'
720
- ),
721
- ),
722
  'misc__async_js' => array(
723
  'type' => 'checkbox',
724
  'title' => __('Async JavaScript loading', 'cleantalk-spam-protect'),
@@ -1784,53 +1776,89 @@ function apbct_settings__field__statistics()
1784
  )
1785
  );
1786
  echo '<br>';
 
 
1787
 
1788
  // Connection reports
1789
  if ( $apbct->connection_reports ) {
 
1790
  if ( $apbct->connection_reports['negative'] == 0 ) {
1791
  _e('There are no failed connections to server.', 'cleantalk-spam-protect');
1792
  } else {
1793
- echo "<table id='negative_reports_table''>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1794
  <tr>
1795
  <td>#</td>
1796
  <td><b>Date</b></td>
1797
  <td><b>Page URL</b></td>
1798
  <td><b>Report</b></td>
1799
  <td><b>Server IP</b></td>
1800
- </tr>";
1801
- foreach ( $apbct->connection_reports['negative_report'] as $key => $report ) {
1802
- echo '<tr>'
1803
- . '<td>' . Escape::escHtml($key + 1) . '.</td>'
1804
- . '<td>' . Escape::escHtml($report['date']) . '</td>'
1805
- . '<td>' . Escape::escUrl($report['page_url']) . '</td>'
1806
- . '<td>' . Escape::escHtml($report['lib_report']) . '</td>'
1807
- . '<td>' . Escape::escUrl($report['work_url']) . '</td>'
1808
- . '</tr>';
1809
- }
1810
- echo "</table>";
1811
- echo '<br/>';
1812
- echo '<button'
1813
- . ' name="submit"'
1814
- . ' class="cleantalk_link cleantalk_link-manual"'
1815
- . ' value="ct_send_connection_report"'
1816
- . (! $apbct->settings['misc__send_connection_reports'] ? ' disabled="disabled"' : '')
1817
- . '>'
1818
- . __('Send report', 'cleantalk-spam-protect')
1819
- . '</button>';
1820
- if ( ! $apbct->settings['misc__send_connection_reports'] ) {
1821
- echo '<br><br>';
1822
- _e(
1823
- 'Please, enable "Send connection reports" setting to be able to send reports',
1824
- 'cleantalk-spam-protect'
1825
- );
 
 
 
 
 
 
 
 
 
1826
  }
1827
  }
1828
  }
1829
 
1830
  echo '<br/>';
1831
-
1832
- echo 'Plugin version: ' . Escape::escHtml(APBCT_VERSION);
1833
-
1834
  echo '</div>';
1835
  }
1836
 
711
  'section' => 'hidden_section',
712
  'html_after' => '</div><div id="apbct_hidden_section_nav">{HIDDEN_SECTION_NAV}</div></div>',
713
  'fields' => array(
 
 
 
 
 
 
 
 
714
  'misc__async_js' => array(
715
  'type' => 'checkbox',
716
  'title' => __('Async JavaScript loading', 'cleantalk-spam-protect'),
1776
  )
1777
  );
1778
  echo '<br>';
1779
+ echo 'Plugin version: ' . APBCT_VERSION;
1780
+ echo '<br>';
1781
 
1782
  // Connection reports
1783
  if ( $apbct->connection_reports ) {
1784
+ // if no negative show nothing
1785
  if ( $apbct->connection_reports['negative'] == 0 ) {
1786
  _e('There are no failed connections to server.', 'cleantalk-spam-protect');
1787
  } else {
1788
+ $unsent_reports_count = 0;
1789
+ $reports_html = '';
1790
+ foreach ( $apbct->connection_reports['negative_report'] as $key => $report ) {
1791
+ //count unsent
1792
+ if ( isset($report['is_sent']) && !$report['is_sent'] ) {
1793
+ $unsent_reports_count++;
1794
+ }
1795
+ //colorize
1796
+ if ( isset($report['is_sent']) && $report['is_sent'] ) {
1797
+ $status = 'Sent';
1798
+ $color = 'gray';
1799
+ } else {
1800
+ $status = 'New';
1801
+ $color = 'black';
1802
+ }
1803
+ //draw reports rows
1804
+ $reports_html .= '<tr style="color:' . $color . '">'
1805
+ . '<td>' . Escape::escHtml($key + 1) . '.</td>'
1806
+ . '<td>' . Escape::escHtml($report['date']) . '</td>'
1807
+ . '<td>' . Escape::escUrl($report['page_url']) . '</td>'
1808
+ . '<td>' . Escape::escHtml($report['lib_report']) . '</td>'
1809
+ . '<td>' . Escape::escUrl($report['work_url']) . '</td>'
1810
+ . '<td>' . Escape::escHtml($status) . '</td>'
1811
+ . '</tr>';
1812
+ }
1813
+ //draw main report table
1814
+ $reports_html = "<table id='negative_reports_table''>
1815
+ <th colspan='6'>Failed connection reports</th>
1816
  <tr>
1817
  <td>#</td>
1818
  <td><b>Date</b></td>
1819
  <td><b>Page URL</b></td>
1820
  <td><b>Report</b></td>
1821
  <td><b>Server IP</b></td>
1822
+ <td><b>Status</b></td>
1823
+ </tr>"
1824
+ //attach reports rows
1825
+ . $reports_html
1826
+ . "</table>"
1827
+ . "<br/>";
1828
+ //escaping html
1829
+ echo Escape::escKses(
1830
+ $reports_html,
1831
+ array(
1832
+ 'tr' => array(
1833
+ 'style' => true
1834
+ ),
1835
+ 'td' => array(),
1836
+ 'th' => array(
1837
+ 'colspan' => true
1838
+ ),
1839
+ 'b' => array(),
1840
+ 'br' => array(),
1841
+ 'table' => array(
1842
+ 'id' => true
1843
+ ),
1844
+ )
1845
+ );
1846
+ //if no unsent reports show caption, in another case show the button
1847
+ if ( $unsent_reports_count === 0 ) {
1848
+ _e('All the reports already have been sent.', 'cleantalk-spam-protect');
1849
+ } else {
1850
+ echo '<button'
1851
+ . ' name="submit"'
1852
+ . ' class="cleantalk_link cleantalk_link-manual"'
1853
+ . ' value="ct_send_connection_report"'
1854
+ . '>'
1855
+ . __('Send new report', 'cleantalk-spam-protect')
1856
+ . '</button>';
1857
  }
1858
  }
1859
  }
1860
 
1861
  echo '<br/>';
 
 
 
1862
  echo '</div>';
1863
  }
1864
 
inc/cleantalk-updater.php CHANGED
@@ -644,7 +644,6 @@ function apbct_update_to_5_154_0()
644
  'gdpr_enabled' => 'gdpr__enabled',
645
  'gdpr_text' => 'gdpr__text',
646
  'collect_details' => 'misc__collect_details',
647
- 'send_connection_reports' => 'misc__send_connection_reports',
648
  'async_js' => 'misc__async_js',
649
  'debug_ajax' => 'misc__debug_ajax',
650
  'store_urls' => 'misc__store_urls',
@@ -1146,3 +1145,23 @@ function apbct_update_to_5_179_2()
1146
  $apbct->remote_calls['post_api_key'] = array('last_call' => 0);
1147
  $apbct->save('remote_calls');
1148
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
644
  'gdpr_enabled' => 'gdpr__enabled',
645
  'gdpr_text' => 'gdpr__text',
646
  'collect_details' => 'misc__collect_details',
 
647
  'async_js' => 'misc__async_js',
648
  'debug_ajax' => 'misc__debug_ajax',
649
  'store_urls' => 'misc__store_urls',
1145
  $apbct->remote_calls['post_api_key'] = array('last_call' => 0);
1146
  $apbct->save('remote_calls');
1147
  }
1148
+
1149
+ function apbct_update_to_5_182_0()
1150
+ {
1151
+ global $apbct;
1152
+
1153
+ // Move connection report from cleantalk_data to separate option cleantalk_connection_reports
1154
+ $connection_reports = array(
1155
+ 'success' => 0,
1156
+ 'negative' => 0,
1157
+ 'negative_report' => array(),
1158
+ 'since' => '',
1159
+ );
1160
+ if ( isset($apbct->data['connection_reports']) ) {
1161
+ $connection_reports = $apbct->data['connection_reports'];
1162
+ unset($apbct->data['connection_reports']);
1163
+ $apbct->save('data');
1164
+ }
1165
+
1166
+ update_option('cleantalk_connection_reports', $connection_reports, false);
1167
+ }
js/apbct-public-bundle.min.js CHANGED
@@ -1 +1,2 @@
1
- function ctSetCookie(e,t,o){var n;("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",a="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+a}):"alternative"!==ctPublicFunctions.data__cookies_type||n||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})))}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(t,o,n){var a=o.callback||null,c=o.callback_context||null,i=o.callback_params||null,e=o.async||!0,l=o.notJson||null,r=o.timeout||15e3,n=n||null,s=o.button||null,d=o.spinner||null,u=o.progressbar||null,p=o.silent||null,m=o.no_nonce||null;"string"==typeof t?t=(t=m?t:t+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce)+"&no_cache="+Math.random():(m||(t._ajax_nonce=ctPublicFunctions._ajax_nonce),t.no_cache=Math.random()),s&&(s.setAttribute("disabled","disabled"),s.style.cursor="not-allowed"),d&&jQuery(d).css("display","inline"),jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,data:t,async:e,success:function(e){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){u&&u.fadeOut("slow")},1e3),console.log("Error happens: "+(e.error||"Unkown"))):a&&(i?a.apply(c,[e,t,o,n].concat(i)):a(e,t,o,n))},error:function(e,t,o){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),o&&!p&&(console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+o+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:r})}function apbct_public_sendREST(t,o){var n=o.callback||null,e=o.data||[],a=o.method||"POST";jQuery.ajax({type:a,url:ctPublicFunctions._rest_url+"cleantalk-antispam/v1/"+t,data:e,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ctPublicFunctions._rest_nonce)},success:function(e){e.error?console.log("Error happens: "+(e.error||"Unknown")):n&&n(e,t,o,null)},error:function(e,t,o){o&&(console.log("APBCT_REST_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin REST API error: "+o+" Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}apbctLocalStorage={get:function(e,t){void 0===t&&(t="value");e=localStorage.getItem(e);if(null!==e)try{const o=JSON.parse(e);return o.hasOwnProperty(t)?JSON.parse(o[t]):o}catch(e){return new Error(e)}return!1},set:function(e,t,o=!0){o?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)}};var ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&jQuery("body").append('<img alt="Cleantalk Pixel" id="apbct_pixel" style="display: none; left: 99999px;" src="'+e+'">')}function ctGetPixelUrl(){var e=ctGetPixelUrlLocalstorage();if(!1!==e){if(!ctIsOutdatedPixelUrlLocalstorage(e))return void ctSetPixelImg(e);ctCleaPixelUrlLocalstorage(e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function apbct_ready(){var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if("native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),jQuery("input[type = 'email'], #email").blur(checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||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.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&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)})}},1e3);let a=document.querySelectorAll("[data-original-string]");if(a.length)for(let e=0;e<a.length;++e)a[e].parentElement.href||a[e].parentElement.parentElement.href||a[e].addEventListener("click",function e(t){this.removeEventListener("click",e),apbctAjaxEmailDecode(t)})}function apbctAjaxEmailDecode(t){const o=t.target;o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress","rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:{encodedEmail:t.target.dataset.originalString},method:"POST",callback:function(e){e.success&&(ctFillDecodedEmail(e.data,t.target),o.setAttribute("title",""),o.removeAttribute("style"))}}):apbct_public_sendAJAX({action:"apbct_decode_email",encodedEmail:t.target.dataset.originalString},{notJson:!0,callback:function(e){e.success&&(ctFillDecodedEmail(e.data,t.target),o.setAttribute("title",""),o.removeAttribute("style"))}})}function ctFillDecodedEmail(e,t){t.innerHTML=e}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,l=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.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,o){"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"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var a=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<a.length;c++)a[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 ctSetPixelUrlLocalstorage(e){localStorage.setItem("session_pixel_url",e),localStorage.setItem(e,Math.floor(Date.now()/1e3).toString())}function ctGetPixelUrlLocalstorage(){var e=localStorage.getItem("session_pixel_url");return null!==e&&e}function ctIsOutdatedPixelUrlLocalstorage(e){e=Number(localStorage.getItem(e));return 10800<Math.floor(Date.now()/1e3).toString()-e}function ctCleaPixelUrlLocalstorage(e){localStorage.removeItem(e),localStorage.removeItem("session_pixel_url")}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;if("string"==typeof o.action)if(isIntegratedForm(o)){jQuery(o).before('<i class="cleantalk_placeholder" style="display: none;"></i>');var n=jQuery(o).prev(),a=o.outerHTML,c=jQuery(o).detach(),a=(n.after(a),document.createElement("input")),i=(a.name="action",a.value="cleantalk_force_ajax_check",a.type="hidden",document.forms[e]);i.appendChild(a);let t=!1;if(void 0!==i.classList){let e=["newsletterform","ml-block-form"];e.forEach(function(e){i.classList.contains(e)&&(t=e)})}if(t){let e=jQuery("form."+t).find('button[type="submit"]');void 0!==e&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(i,n,c)})}else document.forms[e].onsubmit=function(e){e.preventDefault();var t=jQuery(e.currentTarget).prev(),o=jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget,t,o)}}else-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((a=document.createElement("input")).name="cleantalk_hidden_action",a.value=o.action,a.type="hidden",o.appendChild(a),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var a=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(a.val())})})}function isIntegratedForm(e){var t=e.action;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com"))}function sendAjaxCheckingFormData(i,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(i),apbct_visible_fields_set_cookie(o),{}),o=i.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n,a,c){void 0!==e.apbct&&+e.apbct.blocked||(apbct_replace_inputs_values_from_other_form(jQuery(i).detach(),c),a.after(c),0===(e=jQuery(c).find("button[type=submit]")).length&&0===(e=jQuery(c).find("input[type=submit]")).length&&0===(e=jQuery(c).find('button[data-element="submit"]')).length&&0===(e=jQuery(c).find('input[type="image"][name="submit"]')).length||e[0].click())},callback_context:null,callback_params:[e,t]})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,datatype:"text",data:o,success:function(e){if("true"!=e)return alert(e),!1;t.submit()},error:function(){t.submit()}})}function ct_check_internal__is_exclude_form(t){let e=[ctPublic.blog_home+"wp-login.php",ctPublic.blog_home+"wp-comments-post.php"];return e.some(e=>null!==t.match(new RegExp("^"+e)))}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){console.log(e.toString())}void 0!==n.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())}}),cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},l=document.createElement("style"),i=(l.setAttribute("id","cleantalk-modal-styles"),l.innerHTML="body.cleantalk-modal-opened{"+i+"}",l.innerHTML+="#cleantalk-modal-overlay{"+t+"}",l.innerHTML+="#cleantalk-modal-close{"+n+"}",l.innerHTML+="#cleantalk-modal-close:before{"+a+"}",l.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(l),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?a.innerHTML=this.loaded:(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),jQuery(document).ready(function(){"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms&&ctPublicGDPR.gdpr_forms.forEach(function(e,t,o){var n=jQuery("#"+e+", ."+e);n.is("form")||(n.find("form")[0]?n=n.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?n=jQuery(".wpcf7[role=form]"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?n=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(n=jQuery(".wpforms-form"))),!n.is("form")&&"form"!==n.attr("role")||n.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>")})}),window.onload=function(){+ctPublic.settings__forms__check_external&&setTimeout(function(){ct_protect_external()},1500)},jQuery(document).ready(function(){let t="",o;if(+ctPublic.settings__forms__check_internal)for(let e=0;e<document.forms.length;e++)"string"==typeof document.forms[e].action&&(o=document.forms[e],null===(t=o.action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(ctPrevHandler=o.click,jQuery(o).off("**"),jQuery(o).off(),jQuery(o).on("submit",function(e){return ct_check_internal(e.target),!1})))});
 
1
+ function ctSetCookie(e,t,o){var c;("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(c="ct_pointer_data"===e,e=[[e,t,o]]),"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?e.forEach(function(e,t,o){var c=void 0!==e[2]?"expires="+c+"; ":"",n="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+c+"path=/; samesite=lax"+n}):"alternative"!==ctPublicFunctions.data__cookies_type||c||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})))}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(t,o,c){var n=o.callback||null,i=o.callback_context||null,a=o.callback_params||null,e=o.async||!0,l=o.notJson||null,r=o.timeout||15e3,c=c||null,s=o.button||null,d=o.spinner||null,u=o.progressbar||null,p=o.silent||null,_=o.no_nonce||null;"string"==typeof t?t=(t=_?t:t+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce)+"&no_cache="+Math.random():(_||(t._ajax_nonce=ctPublicFunctions._ajax_nonce),t.no_cache=Math.random()),s&&(s.setAttribute("disabled","disabled"),s.style.cursor="not-allowed"),d&&jQuery(d).css("display","inline"),jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,data:t,async:e,success:function(e){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){u&&u.fadeOut("slow")},1e3),console.log("Error happens: "+(e.error||"Unkown"))):n&&(a?n.apply(i,[e,t,o,c].concat(a)):n(e,t,o,c))},error:function(e,t,o){s&&(s.removeAttribute("disabled"),s.style.cursor="pointer"),d&&jQuery(d).css("display","none"),o&&!p&&(console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+o+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:r})}function apbct_public_sendREST(t,o){var c=o.callback||null,e=o.data||[],n=o.method||"POST";jQuery.ajax({type:n,url:ctPublicFunctions._rest_url+"cleantalk-antispam/v1/"+t,data:e,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ctPublicFunctions._rest_nonce)},success:function(e){e.error?console.log("Error happens: "+(e.error||"Unknown")):c&&c(e,t,o,null)},error:function(e,t,o){o&&(console.log("APBCT_REST_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin REST API error: "+o+" Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}apbctLocalStorage={get:function(e,t){void 0===t&&(t="value");e=localStorage.getItem(e);if(null!==e)try{const o=JSON.parse(e);return o.hasOwnProperty(t)?JSON.parse(o[t]):o}catch(e){return new Error(e)}return!1},set:function(e,t,o=!0){o?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)}};var ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&jQuery("body").append('<img alt="Cleantalk Pixel" id="apbct_pixel" style="display: none; left: 99999px;" src="'+e+'">')}function ctGetPixelUrl(){var e=ctGetPixelUrlLocalstorage();if(!1!==e){if(!ctIsOutdatedPixelUrlLocalstorage(e))return void ctSetPixelImg(e);ctCleaPixelUrlLocalstorage(e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(ctGetPixelUrlLocalstorage()||ctSetPixelUrlLocalstorage(e),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function apbct_ready(){var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if("native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var c=t[o].trim().split("=")[0];0===c.indexOf("apbct_visible_fields_")&&ctDeleteCookie(c)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),jQuery("input[type = 'email'], #email").blur(checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t,o,c=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===c.method.toString().toLowerCase()||c.classList.contains("slp_search_form")||c.parentElement.classList.contains("mec-booking")||-1!==c.action.toString().indexOf("activehosted.com")||c.id&&"caspioform"===c.id||c.classList&&c.classList.contains("tinkoffPayRow")||c.classList&&c.classList.contains("give-form")||c.id&&"ult-forgot-password-form"===c.id||c.id&&-1!==c.id.toString().indexOf("calculatedfields")||c.id&&-1!==c.id.toString().indexOf("sac-form")||c.id&&-1!==c.id.toString().indexOf("cp_tslotsbooking_pform")||c.name&&-1!==c.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===c.action.toString()||c.name&&-1!==c.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(c),t.value=JSON.stringify(o),c.append(t),c.onsubmit_prev=c.onsubmit,c.ctFormIndex=e,c.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&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)})}},1e3);let n=document.querySelectorAll("[data-original-string]");if(n.length)for(let e=0;e<n.length;++e)n[e].parentElement.href||n[e].parentElement.parentElement.href||n[e].addEventListener("click",function e(t){this.removeEventListener("click",e),apbctAjaxEmailDecode(t)})}function apbctAjaxEmailDecode(t){const o=t.target;o.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),o.style.cursor="progress",jQuery(o).append('<div class="apbct-tooltip">\n<div class="apbct-tooltip--text"></div>\n<div class="apbct-tooltip--arrow"></div>\n</div>'),ctShowDecodeComment(o,ctPublicFunctions.text__wait_for_decoding);var e=getJavascriptClientData();"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:{encodedEmail:t.target.dataset.originalString,event_javascript_data:e},method:"POST",callback:function(e){e.success&&ctProcessDecodedDataResult(e.data,t.target),setTimeout(function(){jQuery(o).children(".apbct-tooltip").fadeOut(700)},4e3)}}):apbct_public_sendAJAX({action:"apbct_decode_email",encodedEmail:t.target.dataset.originalString,event_javascript_data:e},{notJson:!0,callback:function(e){e.success&&ctProcessDecodedDataResult(e.data,t.target),setTimeout(function(){jQuery(o).children(".apbct-tooltip").fadeOut(700)},4e3)}})}function getJavascriptClientData(){let e={};e.apbct_headless=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),e.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),e.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),e.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),e.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),e.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),e.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),e.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),e.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var t=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),o=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),n=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),i=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");return e.ct_mouse_moved=void 0!==t?t:n,e.ct_has_scrolled=void 0!==o?o:i,e.ct_cookies_type=void 0!==c?c:a,e=removeDoubleJsonEncoding(e),JSON.stringify(e)}function removeDoubleJsonEncoding(e){if("object"==typeof e)for(var t in e){var o;"object"==typeof e[t]&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"==typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){var o=jQuery(e).children(".apbct-tooltip");jQuery(e).html(t).append(o)}function ctShowDecodeComment(e,t){jQuery(e).find(".apbct-tooltip").show().find(".apbct-tooltip--text").html(t)}function apbct_collect_visible_fields(e){var t,o=[],c="",n=0,i="",a=0,l=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.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,o){"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")?(c+=" "+e.getAttribute("name"),n++):(i+=" "+e.getAttribute("name"),a++))}),i=i.trim(),{visible_fields:c=c.trim(),visible_fields_count:n,invisible_fields:i,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var c in o){if(10<c)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:c),JSON.stringify(o[c]))}else ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,c){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var n=document.querySelectorAll("[name^=ct_checkjs]"),i=0;i<n.length;i++)n[i].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 ctSetPixelUrlLocalstorage(e){localStorage.setItem("session_pixel_url",e),localStorage.setItem(e,Math.floor(Date.now()/1e3).toString())}function ctGetPixelUrlLocalstorage(){var e=localStorage.getItem("session_pixel_url");return null!==e&&e}function ctIsOutdatedPixelUrlLocalstorage(e){e=Number(localStorage.getItem(e));return 10800<Math.floor(Date.now()/1e3).toString()-e}function ctCleaPixelUrlLocalstorage(e){localStorage.removeItem(e),localStorage.removeItem("session_pixel_url")}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;if("string"==typeof o.action)if(isIntegratedForm(o)){jQuery(o).before('<i class="cleantalk_placeholder" style="display: none;"></i>');var c=jQuery(o).prev(),n=o.outerHTML,i=jQuery(o).detach(),n=(c.after(n),document.createElement("input")),a=(n.name="action",n.value="cleantalk_force_ajax_check",n.type="hidden",document.forms[e]);a.appendChild(n);let t=!1;if(void 0!==a.classList){let e=["newsletterform","ml-block-form"];e.forEach(function(e){a.classList.contains(e)&&(t=e)})}if(t){let e=jQuery("form."+t).find('button[type="submit"]');void 0!==e&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(a,c,i)})}else document.forms[e].onsubmit=function(e){e.preventDefault();var t=jQuery(e.currentTarget).prev(),o=jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget,t,o)}}else-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((n=document.createElement("input")).name="cleantalk_hidden_action",n.value=o.action,n.type="hidden",o.appendChild(n),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,c){var n=jQuery(c);o.each(function(e,t){var o=jQuery(t);c.outerHTML===t.outerHTML&&o.val(n.val())})})}function isIntegratedForm(e){var t=e.action;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com"))}function sendAjaxCheckingFormData(a,e,t){var o={},c=(o[0]=apbct_collect_visible_fields(a),apbct_visible_fields_set_cookie(o),{}),o=a.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?c["input_"+t]=e.value:c[e.name]=e.value}),apbct_public_sendAJAX(c,{async:!1,callback:function(e,t,o,c,n,i){void 0!==e.apbct&&+e.apbct.blocked||(apbct_replace_inputs_values_from_other_form(jQuery(a).detach(),i),n.after(i),0===(e=jQuery(i).find("button[type=submit]")).length&&0===(e=jQuery(i).find("input[type=submit]")).length&&0===(e=jQuery(i).find('button[data-element="submit"]')).length&&0===(e=jQuery(i).find('input[type="image"][name="submit"]')).length||e[0].click())},callback_context:null,callback_params:[e,t]})}function ct_check_internal(t){var e,o={},c=t.elements;for(e in c)"submit"!=c[e].type&&null!=c[e].value&&""!=c[e].value&&(o[c[e].name]=t.elements[e].value);o.action="ct_check_internal",jQuery.ajax({type:"POST",url:ctPublicFunctions._ajax_url,datatype:"text",data:o,success:function(e){if("true"!=e)return alert(e),!1;t.submit()},error:function(){t.submit()}})}function ct_check_internal__is_exclude_form(t){let e=[ctPublic.blog_home+"wp-login.php",ctPublic.blog_home+"wp-comments-post.php"];return e.some(e=>null!==t.match(new RegExp("^"+e)))}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var c=JSON.parse(t.responseText)}catch(e){console.log(e.toString())}void 0!==c.apbct&&(c=c.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:c.comment}})),cleantalkModal.loaded=c.comment,cleantalkModal.open(),1==+c.stop_script&&window.stop())}}),cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,c){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},c={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},n={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},a={styles:{overflow:"hidden"},toString:e},l=document.createElement("style"),a=(l.setAttribute("id","cleantalk-modal-styles"),l.innerHTML="body.cleantalk-modal-opened{"+a+"}",l.innerHTML+="#cleantalk-modal-overlay{"+t+"}",l.innerHTML+="#cleantalk-modal-close{"+c+"}",l.innerHTML+="#cleantalk-modal-close:before{"+n+"}",l.innerHTML+="#cleantalk-modal-close:after{"+i+"}",document.body.append(l),document.createElement("div")),t=(a.setAttribute("id","cleantalk-modal-overlay"),document.body.append(a),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),c=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),a.append(t),document.createElement("div")),n=(c.setAttribute("id","cleantalk-modal-close"),t.append(c),document.createElement("div"));this.loaded?n.innerHTML=this.loaded:(n.innerHTML="Loading...",this.load("get_options_template")),n.setAttribute("id","cleantalk-modal-content"),t.append(n),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),jQuery(document).ready(function(){"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms&&ctPublicGDPR.gdpr_forms.forEach(function(e,t,o){var c=jQuery("#"+e+", ."+e);c.is("form")||(c.find("form")[0]?c=c.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?c=jQuery(".wpcf7[role=form]"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?c=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(c=jQuery(".wpforms-form"))),!c.is("form")&&"form"!==c.attr("role")||c.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required " style="display: inline; margin-right: 10px;">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>")})}),window.onload=function(){+ctPublic.settings__forms__check_external&&setTimeout(function(){ct_protect_external()},1500)},jQuery(document).ready(function(){let t="",o;if(+ctPublic.settings__forms__check_internal)for(let e=0;e<document.forms.length;e++)"string"==typeof document.forms[e].action&&(o=document.forms[e],null===(t=o.action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(ctPrevHandler=o.click,jQuery(o).off("**"),jQuery(o).off(),jQuery(o).on("submit",function(e){return ct_check_internal(e.target),!1})))});
2
+ //# sourceMappingURL=apbct-public-bundle.min.js.map
js/apbct-public-bundle.min.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["function ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(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 ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n var callback = params.callback || null;\n var callback_context = params.callback_context || null;\n var callback_params = params.callback_params || null;\n var async = params.async || true;\n var notJson = params.notJson || null;\n var timeout = params.timeout || 15000;\n var obj = obj || null;\n var button = params.button || null;\n var spinner = params.spinner || null;\n var progressbar = params.progressbar || null;\n var silent = params.silent || null;\n var no_nonce = params.no_nonce || null;\n\n if(typeof (data) === 'string') {\n if( ! no_nonce )\n data = data + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n data = data + '&no_cache=' + Math.random()\n } else {\n if( ! no_nonce )\n data._ajax_nonce = ctPublicFunctions._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n if(spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: \"POST\",\n url: ctPublicFunctions._ajax_url,\n data: data,\n async: async,\n success: function(result){\n if(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n if(spinner) jQuery(spinner).css('display', 'none');\n if(!notJson) result = JSON.parse(result);\n if(result.error){\n setTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n console.log('Error happens: ' + (result.error || 'Unkown'));\n }else{\n if(callback) {\n if (callback_params)\n callback.apply( callback_context, [ result, data, params, obj ].concat(callback_params) );\n else\n callback(result, data, params, obj);\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown){\n if(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n if(spinner) jQuery(spinner).css('display', 'none');\n if( errorThrown && ! silent ) {\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n }\n },\n timeout: timeout,\n });\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n var callback = params.callback || null;\n var data = params.data || [];\n var method = params.method || 'POST';\n\n jQuery.ajax({\n type: method,\n url: ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/' + route,\n data: data,\n beforeSend : function ( xhr ) {\n xhr.setRequestHeader( 'X-WP-Nonce', ctPublicFunctions._rest_nonce );\n },\n success: function(result){\n if(result.error){\n console.log('Error happens: ' + (result.error || 'Unknown'));\n }else{\n if(callback) {\n var obj = null;\n callback(result, route, params, obj);\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown){\n if( errorThrown ) {\n console.log('APBCT_REST_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log('Anti-spam by Cleantalk plugin REST API error: ' + errorThrown + ' Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n }\n },\n });\n}\n\napbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return new Error(e);\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n }\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\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\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\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\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tjQuery('body').append( '<img alt=\"Cleantalk Pixel\" id=\"apbct_pixel\" style=\"display: none; left: 99999px;\" src=\"' + pixelUrl + '\">' );\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = ctGetPixelUrlLocalstorage();\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( ctIsOutdatedPixelUrlLocalstorage(local_storage_pixel_url) ) {\n\t\t\tctCleaPixelUrlLocalstorage(local_storage_pixel_url)\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! ctGetPixelUrlLocalstorage() ){\n\t\t\t\t\t\t\tctSetPixelUrlLocalstorage(result);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! ctGetPixelUrlLocalstorage() ){\n\t\t\t\t\t\t\tctSetPixelUrlLocalstorage(result);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tjQuery(\"input[type = 'email'], #email\").blur(checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = JSON.stringify(visibleFieldsToInput);\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', function ctFillDecodedEmailHandler(event) {\n\t\t\t\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\tapbctAjaxEmailDecode(event);\n\t\t\t});\n\t\t}\n\t}\n}\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\nfunction apbctAjaxEmailDecode(event){\n\tconst element = event.target;\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tjQuery(element).append(\n\t\t'<div class=\"apbct-tooltip\">\\n' +\n\t\t\t'<div class=\"apbct-tooltip--text\"></div>\\n' +\n\t\t\t'<div class=\"apbct-tooltip--arrow\"></div>\\n' +\n\t\t'</div>'\n\t);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tconst javascriptClientData = getJavascriptClientData();\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: {\n\t\t\t\t\tencodedEmail: event.target.dataset.originalString,\n\t\t\t\t\tevent_javascript_data: javascriptClientData,\n\t\t\t\t},\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tjQuery(element)\n\t\t\t\t\t\t\t.children('.apbct-tooltip')\n\t\t\t\t\t\t\t.fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_decode_email',\n\t\t\t\tencodedEmail: event.target.dataset.originalString,\n\t\t\t\tevent_javascript_data: javascriptClientData,\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tjQuery(element)\n\t\t\t\t\t\t\t.children('.apbct-tooltip')\n\t\t\t\t\t\t\t.fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction getJavascriptClientData() {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tlet tooltip = jQuery(target).children('.apbct-tooltip');\n jQuery(target).html(email)\n\t\t\t\t .append(tooltip);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\tjQuery(target).find('.apbct-tooltip')\n\t\t.show()\n\t\t.find('.apbct-tooltip--text').html(comment);\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__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\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\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString())\n\t\t\t}\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}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tlocalStorage.setItem('session_pixel_url', ajax_pixel_url)\n\t//set pixel timestamp to the storage\n\tlocalStorage.setItem(ajax_pixel_url, Math.floor(Date.now() / 1000).toString())\n}\n\nfunction ctGetPixelUrlLocalstorage() {\n\tlet local_storage_pixel = localStorage.getItem('session_pixel_url');\n\tif ( local_storage_pixel !== null ) {\n\t\treturn local_storage_pixel;\n\t} else {\n\t\treturn false;\n\t}\n}\n\nfunction ctIsOutdatedPixelUrlLocalstorage(local_storage_pixel_url) {\n\tlet local_storage_pixel_timestamp = Number(localStorage.getItem(local_storage_pixel_url));\n\tlet current_timestamp = Math.floor(Date.now() / 1000).toString()\n\tlet timestamp_difference = current_timestamp - local_storage_pixel_timestamp;\n\treturn timestamp_difference > 3600 * 3;\n}\n\nfunction ctCleaPixelUrlLocalstorage(local_storage_pixel_url) {\n\t//remove timestamp\n\tlocalStorage.removeItem(local_storage_pixel_url)\n\t//remove pixel itself\n\tlocalStorage.removeItem('session_pixel_url')\n}\n/* Cleantalk Modal object */\ncleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\njQuery(document).ready(function(){\n\n\tif (typeof ctPublicGDPR === 'undefined') return;\n\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});\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n if(isIntegratedForm(currentForm)) {\n\n jQuery( currentForm ).before('<i class=\"cleantalk_placeholder\" style=\"display: none;\"></i>');\n\n // Deleting form to prevent submit event\n var prev = jQuery(currentForm).prev(),\n form_html = currentForm.outerHTML,\n form_original = jQuery(currentForm).detach();\n\n prev.after( form_html );\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n var reUseCurrentForm = document.forms[i];\n\n reUseCurrentForm.appendChild(force_action);\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(reUseCurrentForm, prev, form_original);\n });\n }\n } else {\n document.forms[i].onsubmit = function ( event ){\n event.preventDefault();\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget, prev, form_original);\n };\n }\n\n // Common flow\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n}\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1\n\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj, prev, formOriginal ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n var form_new = jQuery(form).detach();\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n prev.after( formOriginal );\n\n // Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n },\n callback_context: null,\n callback_params: [prev, formOriginal],\n }\n );\n}\n\nfunction 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: ctPublicFunctions._ajax_url,\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 let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n\tfor( let 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 if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n ctPublic.blog_home + 'wp-login.php', // WordPress login page\n ctPublic.blog_home + 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp('^' + item)) !== null;\n });\n}"],"names":["ctSetCookie","cookies","value","expires","skip_alt","ctPublicFunctions","data__cookies_type","forEach","item","i","arr","ctSecure","location","protocol","document","cookie","cookiePrefix","encodeURIComponent","data__ajax_type","apbct_public_sendREST","method","data","apbct_public_sendAJAX","action","notJson","ctGetCookie","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ctDeleteCookie","cookieName","params","obj","callback","callback_context","callback_params","async","timeout","button","spinner","progressbar","silent","no_nonce","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","console","log","apply","concat","jqXHR","textStatus","errorThrown","route","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","apbctLocalStorage","get","key","property","storageValue","localStorage","getItem","json","hasOwnProperty","e","Error","set","is_json","objToSave","stringify","timestamp","floor","Date","getTime","setItem","isAlive","maxLifetime","this","isSet","delete","removeItem","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","elem","event","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","push","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","target","email","now","ctSetPixelImg","pixelUrl","ctPublic","pixel__enabled","getElementById","append","ctGetPixelUrl","let","local_storage_pixel_url","ctGetPixelUrlLocalstorage","ctIsOutdatedPixelUrlLocalstorage","ctCleaPixelUrlLocalstorage","ctSetPixelUrlLocalstorage","ctSetHasScrolled","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","length","trim","indexOf","pixel__setting","pixel__url","data__email_check_before_post","blur","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","toString","toLowerCase","classList","contains","parentElement","id","createElement","apbct_collect_visible_fields","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","call","decodedEmailNodes","querySelectorAll","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","element","text__wait_for_decoding","ctShowDecodeComment","javascriptClientData","getJavascriptClientData","encodedEmail","dataset","originalString","event_javascript_data","ctProcessDecodedDataResult","children","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","object","objectKey","parsedValue","response","targetElement","is_allowed","ctFillDecodedEmail","decoded_email","show_comment","comment","tooltip","html","find","show","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","elements","isNaN","filter","getAttribute","getComputedStyle","display","visibility","opacity","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ajax_pixel_url","local_storage_pixel","local_storage_pixel_timestamp","Number","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","before","prev","form_html","outerHTML","form_original","detach","force_action","after","reUseCurrentForm","appendChild","mailerlite_detected_class","mailerlite_classes","mailerlite_class","mailerliteSubmitButton","click","preventDefault","sendAjaxCheckingFormData","currentTarget","clone","hostname","ct_action","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","index","elem_source","source","index2","elem_target","val","formObj","formAction","firstChild","formOriginal","elems","Array","prototype","slice","y","apbct","blocked","subm_button","ct_check_internal","currForm","ct_data","datatype","alert","submit","ct_check_internal__is_exclude_form","ct_internal_script_exclusions","blog_home","some","ajaxComplete","settings","responseText","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","open","stop_script","stop","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","innerHTML","inner","add","close","remove","ready","ctPublicGDPR","gdpr_forms","is","first","attr","gdpr_text","onload","settings__forms__check_external","ct_currAction","ct_currForm","settings__forms__check_internal","ctPrevHandler","off","on"],"mappings":"AAAA,SAASA,YAAaC,EAASC,EAAOC,GAElC,IACQC,GADe,iBAAZH,GAAyC,iBAAVC,GAAuC,iBAAVA,KAC/DE,EAAuB,oBAAZH,EACfA,EAAU,CAAE,CAAEA,EAASC,EAAOC,KAIW,SAAzCE,kBAAkBC,qBAI6B,WAAzCD,kBAAkBC,mBACxBL,EAAQM,QAAS,SAAUC,EAAMC,EAAGC,GAChC,IAAIP,OAA6B,IAAZK,EAAK,GAAqB,WAAaL,EAAU,KAAO,GACzEQ,EAAiC,WAAtBC,SAASC,SAAwB,WAAa,GAC7DC,SAASC,OAASV,kBAAkBW,aAAeR,EAAK,GAAK,IAAMS,mBAAmBT,EAAK,IAAM,KAAOL,EAAU,uBAAyBQ,IAIhG,gBAAzCN,kBAAkBC,oBAA0CF,IAGxB,SAAtCC,kBAAkBa,gBAClBC,sBACI,eACA,CACIC,OAAQ,OACRC,KAAM,CAAEpB,QAASA,KAKoB,eAAtCI,kBAAkBa,iBACzBI,sBACI,CACIC,OAAQ,gCACRtB,QAASA,GAEb,CACIuB,QAAS,MAY7B,SAASC,YAAYC,GACbC,EAAUb,SAASC,OAAOa,MAAM,IAAIC,OACpC,WAAaH,EAAKI,QAAQ,+BAAgC,QAAU,aAExE,OAAOH,EAAUI,mBAAmBJ,EAAQ,SAAMK,EAGtD,SAASC,eAAeC,GAEpB,IAMQvB,EANqC,SAAzCN,kBAAk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xI,EAAE,wFACrCwI,OAAO,mDAAmDxI,EAAE,KAAK+X,aAAaK,UAAU,gBA6H7FzR,OAAO0R,OAAS,YAELhQ,SAASiQ,iCAIhB7U,WAAW,WACPoN,uBACD,OAuIPhO,OAAOxC,UAAUyX,MAAO,WACpBpP,IAAI6P,EAAgB,GAChBC,EAEJ,IAAOnQ,SAASoQ,gCAInB,IAAK/P,IAAI1I,EAAE,EAAGA,EAAEK,SAAS4J,MAAMP,OAAQ1J,IACG,iBAA7BK,SAAS4J,MAAMjK,GAAS,SAC1BwY,EAAcnY,SAAS4J,MAAMjK,GAGc,QAFpDuY,EAAgBC,EAAY1X,QAED8I,QAAQ,cACmC,OAAzD2O,EAAcpX,MAAMkH,SAASmM,UAAY,YACvCF,mCAAmCiE,KAErCG,cAAgBF,EAAYvG,MAC5BpP,OAAO2V,GAAaG,IAAI,MACxB9V,OAAO2V,GAAaG,MACpB9V,OAAO2V,GAAaI,GAAG,SAAU,SAASlS,GAEtC,OADAsN,kBAAkBtN,EAAMsB,SACjB"}
lib/Cleantalk/Antispam/Cleantalk.php CHANGED
@@ -481,4 +481,20 @@ class Cleantalk
481
 
482
  return $response;
483
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
  }
481
 
482
  return $response;
483
  }
484
+
485
+ /**
486
+ * Call check_bot API method
487
+ *
488
+ * Make a decision if it's bot or not based on limited input JavaScript data
489
+ *
490
+ * @param CleantalkRequest $request
491
+ *
492
+ * @return CleantalkResponse
493
+ */
494
+ public function checkBot(CleantalkRequest $request)
495
+ {
496
+ $msg = $this->createMsg('check_bot', $request);
497
+
498
+ return $this->httpRequest($msg);
499
+ }
500
  }
lib/Cleantalk/Antispam/CleantalkRequest.php CHANGED
@@ -174,6 +174,31 @@ class CleantalkRequest
174
  */
175
  public $exception_action;
176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  /**
178
  * Fill params with constructor
179
  *
@@ -209,6 +234,12 @@ class CleantalkRequest
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'])
214
  ? serialize($params['message'])
174
  */
175
  public $exception_action;
176
 
177
+ /**
178
+ * @var string|null
179
+ */
180
+ public $event_token;
181
+
182
+ /**
183
+ * @var string|null
184
+ */
185
+ public $event_javascript_data;
186
+
187
+ /**
188
+ * @var string|null
189
+ */
190
+ public $browser_sign;
191
+
192
+ /**
193
+ * @var string|null
194
+ */
195
+ public $event_type;
196
+
197
+ /**
198
+ * @var string|null
199
+ */
200
+ public $message_to_log;
201
+
202
  /**
203
  * Fill params with constructor
204
  *
234
  $this->honeypot_field = isset($params['honeypot_field']) ? (int)$params['honeypot_field'] : null;
235
  $this->exception_action = isset($params['exception_action']) ? (int)$params['exception_action'] : null;
236
 
237
+ $this->event_token = isset($params['event_token']) ? (string)$params['event_token'] : null;
238
+ $this->event_javascript_data = isset($params['event_javascript_data']) ? (string)$params['event_javascript_data'] : null;
239
+ $this->browser_sign = isset($params['browser_sign']) ? (string)$params['browser_sign'] : null;
240
+ $this->event_type = isset($params['event_type']) ? (string)$params['event_type'] : null;
241
+ $this->message_to_log = isset($params['message_to_log']) ? (string)$params['message_to_log'] : null;
242
+
243
  $this->message = ! empty($params['message'])
244
  ? (! is_scalar($params['message'])
245
  ? serialize($params['message'])
lib/Cleantalk/Antispam/CleantalkResponse.php CHANGED
@@ -121,6 +121,11 @@ class CleantalkResponse
121
  */
122
  public $codes = array();
123
 
 
 
 
 
 
124
  /**
125
  * Create server response
126
  *
121
  */
122
  public $codes = array();
123
 
124
+ /**
125
+ * @var null|array Contains a error
126
+ */
127
+ public $error = null;
128
+
129
  /**
130
  * Create server response
131
  *
lib/Cleantalk/Antispam/EmailEncoder.php CHANGED
@@ -15,9 +15,9 @@ class EmailEncoder
15
  private $secret_key;
16
 
17
  /**
18
- * @var bool
19
  */
20
- private $encription;
21
 
22
  /**
23
  * Keep arrays of exclusion signs in the array
@@ -25,6 +25,21 @@ class EmailEncoder
25
  */
26
  private $encoding_exclusions_signs;
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /**
29
  * @inheritDoc
30
  */
@@ -45,7 +60,7 @@ class EmailEncoder
45
 
46
  $this->secret_key = md5($apbct->api_key);
47
 
48
- $this->encription = function_exists('openssl_encrypt') && function_exists('openssl_decrypt');
49
 
50
  $hooks_to_encode = array(
51
  'the_title',
@@ -105,26 +120,54 @@ class EmailEncoder
105
  /**
106
  * Ajax handler for the apbct_decode_email action
107
  *
108
- * @return void
109
  */
110
  public function ajaxDecodeEmailHandler()
111
  {
112
- check_ajax_referer('ct_secret_stuff');
113
- $this->ajaxDecodeEmail();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
  /**
117
  * Main logic of the decoding the encoded data.
118
  *
119
- * @return void returns json string to the JS
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  */
121
- public function ajaxDecodeEmail()
122
  {
123
- // @ToDo implement bot checking via API. the method not implemented yet.
 
124
 
125
- $encoded_email = trim(Post::get('encodedEmail'));
126
- $email = $this->decodeString($encoded_email, $this->secret_key);
127
- wp_send_json_success(strip_tags($email, '<a>'));
128
  }
129
 
130
  /**
@@ -137,7 +180,7 @@ class EmailEncoder
137
  */
138
  private function encodeString($plain_string, $key)
139
  {
140
- if ( $this->encription ) {
141
  $encoded_email = htmlspecialchars(@openssl_encrypt($plain_string, 'aes-128-cbc', $key));
142
  } else {
143
  $encoded_email = htmlspecialchars(base64_encode(str_rot13($plain_string)));
@@ -155,7 +198,7 @@ class EmailEncoder
155
  */
156
  private function decodeString($encoded_string, $key)
157
  {
158
- if ( $this->encription ) {
159
  $decoded_email = htmlspecialchars_decode(@openssl_decrypt($encoded_string, 'aes-128-cbc', $key));
160
  } else {
161
  $decoded_email = htmlspecialchars_decode(base64_decode($encoded_string));
@@ -196,7 +239,7 @@ class EmailEncoder
196
  $encoded = $this->encodeString($email_str, $this->secret_key);
197
 
198
  return '<span
199
- data-original-string="' . $encoded . '"
200
  class="apbct-email-encoder"
201
  title="' . esc_attr($this->getTooltip()) . '">' . $obfuscated . '</span>';
202
  }
15
  private $secret_key;
16
 
17
  /**
18
+ * @var bool Show if the encryption functions are avaliable in current surroundings
19
  */
20
+ private $encryption_is_available;
21
 
22
  /**
23
  * Keep arrays of exclusion signs in the array
25
  */
26
  private $encoding_exclusions_signs;
27
 
28
+ /**
29
+ * @var string
30
+ */
31
+ protected $decoded_email;
32
+
33
+ /**
34
+ * @var string
35
+ */
36
+ protected $encoded_email;
37
+
38
+ /**
39
+ * @var string
40
+ */
41
+ private $response;
42
+
43
  /**
44
  * @inheritDoc
45
  */
60
 
61
  $this->secret_key = md5($apbct->api_key);
62
 
63
+ $this->encryption_is_available = function_exists('openssl_encrypt') && function_exists('openssl_decrypt');
64
 
65
  $hooks_to_encode = array(
66
  'the_title',
120
  /**
121
  * Ajax handler for the apbct_decode_email action
122
  *
123
+ * @return void returns json string to the JS
124
  */
125
  public function ajaxDecodeEmailHandler()
126
  {
127
+ if (! defined('REST_REQUEST')) {
128
+ check_ajax_referer('ct_secret_stuff');
129
+ }
130
+
131
+ $this->response = $this->processDecodeRequest();
132
+
133
+ wp_send_json_success($this->response);
134
+ }
135
+
136
+ public function processDecodeRequest()
137
+ {
138
+ $this->decoded_email = $this->decodeEmailFromPost();
139
+ $allow_request = $this->checkRequest();
140
+ $this->response = $this->compileResponse($this->decoded_email, $allow_request);
141
+
142
+ return $this->response;
143
  }
144
 
145
  /**
146
  * Main logic of the decoding the encoded data.
147
  *
148
+ * @return string encoded email
149
+ */
150
+ public function decodeEmailFromPost()
151
+ {
152
+ $this->encoded_email = trim(Post::get('encodedEmail'));
153
+ $this->decoded_email = $this->decodeString($this->encoded_email, $this->secret_key);
154
+
155
+ return $this->decoded_email;
156
+ }
157
+
158
+ /**
159
+ * Ajax handler for the apbct_decode_email action
160
+ *
161
+ * @return bool returns json string to the JS
162
  */
163
+ protected function checkRequest()
164
  {
165
+ return true;
166
+ }
167
 
168
+ protected function compileResponse($decoded_email, $is_allowed)
169
+ {
170
+ return strip_tags($decoded_email, '<a>');
171
  }
172
 
173
  /**
180
  */
181
  private function encodeString($plain_string, $key)
182
  {
183
+ if ( $this->encryption_is_available ) {
184
  $encoded_email = htmlspecialchars(@openssl_encrypt($plain_string, 'aes-128-cbc', $key));
185
  } else {
186
  $encoded_email = htmlspecialchars(base64_encode(str_rot13($plain_string)));
198
  */
199
  private function decodeString($encoded_string, $key)
200
  {
201
+ if ( $this->encryption_is_available ) {
202
  $decoded_email = htmlspecialchars_decode(@openssl_decrypt($encoded_string, 'aes-128-cbc', $key));
203
  } else {
204
  $decoded_email = htmlspecialchars_decode(base64_decode($encoded_string));
239
  $encoded = $this->encodeString($email_str, $this->secret_key);
240
 
241
  return '<span
242
+ data-original-string="' . $encoded . '"
243
  class="apbct-email-encoder"
244
  title="' . esc_attr($this->getTooltip()) . '">' . $obfuscated . '</span>';
245
  }
lib/Cleantalk/Antispam/Integrations/FluentForm.php CHANGED
@@ -9,18 +9,15 @@ class FluentForm extends IntegrationBase
9
  {
10
  public function getDataForChecking($argument)
11
  {
12
- if ( Post::get('data') ) {
13
- parse_str(Post::get('data'), $form_data);
14
-
15
- parse_str($_POST['data'], $form_data_dirty);
16
- $email = $form_data_dirty['email'] ? Sanitize::cleanEmail($form_data_dirty['email']) : null;
17
 
18
  /**
19
  * Filter for POST
20
  */
21
  $input_array = apply_filters('apbct__filter_post', $form_data);
22
 
23
- return ct_get_fields_any($input_array, $email);
24
  }
25
 
26
  return null;
9
  {
10
  public function getDataForChecking($argument)
11
  {
12
+ if ( isset($_POST['data']) ) {
13
+ parse_str($_POST['data'], $form_data);
 
 
 
14
 
15
  /**
16
  * Filter for POST
17
  */
18
  $input_array = apply_filters('apbct__filter_post', $form_data);
19
 
20
+ return ct_get_fields_any($input_array);
21
  }
22
 
23
  return null;
lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Cleantalk\ApbctWP\Antispam;
4
+
5
+ use Cleantalk\ApbctWP\API;
6
+ use Cleantalk\ApbctWP\Helper;
7
+ use Cleantalk\Variables\Post;
8
+ use Cleantalk\Antispam\CleantalkRequest;
9
+ use Cleantalk\Antispam\Cleantalk;
10
+
11
+ class EmailEncoder extends \Cleantalk\Antispam\EmailEncoder
12
+ {
13
+ /**
14
+ * @var null|string Comment from API response
15
+ */
16
+ private $comment;
17
+
18
+ /**
19
+ * Check if the decoding is allowed
20
+ *
21
+ * Set properties
22
+ * this->api_response
23
+ * this->comment
24
+ *
25
+ * @return bool
26
+ */
27
+ protected function checkRequest()
28
+ {
29
+ global $apbct;
30
+
31
+ $browser_sign = hash('sha256', Post::get('browser_signature_params'));
32
+ $event_javascript_data = Helper::isJson(Post::get('event_javascript_data'))
33
+ ? Post::get('event_javascript_data')
34
+ : stripslashes(Post::get('event_javascript_data'));
35
+
36
+ $params = array(
37
+ 'auth_key' => $apbct->api_key, // Access key
38
+ 'event_token' => null, // Unique event ID
39
+ 'event_javascript_data' => $event_javascript_data, // JSON-string params to analysis
40
+ 'browser_sign' => $browser_sign, // Browser ID
41
+ 'sender_ip' => Helper::ipGet(), // IP address
42
+ 'event_type' => 'CONTACT_DECODING', // 'GENERAL_BOT_CHECK' || 'CONTACT_DECODING'
43
+ 'message_to_log' => $this->decoded_email, // Custom message
44
+ );
45
+
46
+ $ct_request = new CleantalkRequest($params);
47
+
48
+ $ct = new Cleantalk();
49
+
50
+ // Options store url without scheme because of DB error with ''://'
51
+ $config = ct_get_server();
52
+ $ct->server_url = APBCT_MODERATE_URL;
53
+ $ct->work_url = preg_match('/https:\/\/.+/', $config['ct_work_url']) ? $config['ct_work_url'] : null;
54
+ $ct->server_ttl = $config['ct_server_ttl'];
55
+ $ct->server_changed = $config['ct_server_changed'];
56
+ $api_response = $ct->checkBot($ct_request);
57
+
58
+ // Allow to see to the decoded contact if error occurred
59
+ // Send error as comment in this case
60
+ if ( ! empty($api_response->errstr)) {
61
+ $this->comment = $api_response->errstr;
62
+
63
+ return true;
64
+ }
65
+
66
+ // Deny
67
+ if ( $api_response->allow === 0) {
68
+ $this->comment = $api_response->comment;
69
+
70
+ return false;
71
+ }
72
+
73
+ return true;
74
+ }
75
+
76
+ /**
77
+ * Compile the response to pass it further
78
+ *
79
+ * @param $decoded_email
80
+ * @param $is_allowed
81
+ *
82
+ * @return array
83
+ */
84
+ protected function compileResponse($decoded_email, $is_allowed)
85
+ {
86
+ return [
87
+ 'is_allowed' => $is_allowed,
88
+ 'show_comment' => $is_allowed,
89
+ 'comment' => $this->comment,
90
+ 'decoded_email' => strip_tags($decoded_email, '<a>'),
91
+ ];
92
+ }
93
+ }
lib/Cleantalk/ApbctWP/Escape.php CHANGED
@@ -134,6 +134,7 @@ class Escape extends \Cleantalk\Common\Escape
134
  'class' => true,
135
  'onclick' => true,
136
  'style' => true,
 
137
  ),
138
  'hr' => array(
139
  'style' => true,
134
  'class' => true,
135
  'onclick' => true,
136
  'style' => true,
137
+ 'id' => true,
138
  ),
139
  'hr' => array(
140
  'style' => true,
lib/Cleantalk/ApbctWP/Helper.php CHANGED
@@ -246,4 +246,19 @@ class Helper extends \Cleantalk\Common\Helper
246
  ? static::bufferParseCsv($result)
247
  : $result;
248
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  }
246
  ? static::bufferParseCsv($result)
247
  : $result;
248
  }
249
+
250
+ /**
251
+ * Cast arrayObject to array.
252
+ * @param $object - An ArrayObject
253
+ * @return array
254
+ */
255
+ public static function arrayObjectToArray($object)
256
+ {
257
+ /** @psalm-suppress */
258
+ if ( !is_object($object) && !is_array($object) ) {
259
+ return $object;
260
+ }
261
+
262
+ return array_map('static::arrayObjectToArray', (array)$object);
263
+ }
264
  }
lib/Cleantalk/ApbctWP/RemoteCalls.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace Cleantalk\ApbctWP;
4
 
5
  use Cleantalk\ApbctWP\Variables\Request;
 
6
 
7
  class RemoteCalls
8
  {
@@ -225,6 +226,7 @@ class RemoteCalls
225
  $out['errors'] = $apbct->errors;
226
  $out['debug'] = $apbct->debug;
227
  $out['queue'] = get_option('cleantalk_sfw_update_queue');
 
228
  $out['servers_connection'] = apbct_test_connection();
229
 
230
  if ( APBCT_WPMS ) {
@@ -232,6 +234,15 @@ class RemoteCalls
232
  $out['network_data'] = $apbct->network_data;
233
  }
234
 
 
 
 
 
 
 
 
 
 
235
  if ( Request::equal('out', 'json') ) {
236
  die(json_encode($out));
237
  }
3
  namespace Cleantalk\ApbctWP;
4
 
5
  use Cleantalk\ApbctWP\Variables\Request;
6
+ use Cleantalk\ApbctWP\Variables\Get;
7
 
8
  class RemoteCalls
9
  {
226
  $out['errors'] = $apbct->errors;
227
  $out['debug'] = $apbct->debug;
228
  $out['queue'] = get_option('cleantalk_sfw_update_queue');
229
+ $out['connection_reports'] = get_option('cleantalk_connection_reports');
230
  $out['servers_connection'] = apbct_test_connection();
231
 
232
  if ( APBCT_WPMS ) {
234
  $out['network_data'] = $apbct->network_data;
235
  }
236
 
237
+ // Output only one option
238
+ $show_only = Get::get('show_only');
239
+ if ( $show_only && isset($out[$show_only]) ) {
240
+ /**
241
+ * @psalm-suppress InvalidArrayOffset
242
+ */
243
+ $out = [$show_only => $out[$show_only]];
244
+ }
245
+
246
  if ( Request::equal('out', 'json') ) {
247
  die(json_encode($out));
248
  }
lib/Cleantalk/ApbctWP/RestController.php CHANGED
@@ -74,7 +74,9 @@ class RestController extends \WP_REST_Controller
74
  register_rest_route($this->namespace, "/apbct_decode_email", array(
75
  array(
76
  'methods' => 'POST',
77
- 'callback' => array(\Cleantalk\Antispam\EmailEncoder::getInstance(), 'ajaxDecodeEmail'),
 
 
78
  'permission_callback' => function (WP_REST_Request $request) {
79
  return wp_verify_nonce($request->get_header('x_wp_nonce'), 'wp_rest');
80
  },
74
  register_rest_route($this->namespace, "/apbct_decode_email", array(
75
  array(
76
  'methods' => 'POST',
77
+ 'callback' => array(\Cleantalk\ApbctWP\Antispam\EmailEncoder::getInstance(),
78
+ 'ajaxDecodeEmailHandler'
79
+ ),
80
  'permission_callback' => function (WP_REST_Request $request) {
81
  return wp_verify_nonce($request->get_header('x_wp_nonce'), 'wp_rest');
82
  },
lib/Cleantalk/ApbctWP/State.php CHANGED
@@ -45,16 +45,11 @@ class State extends \Cleantalk\Common\State
45
  'forms__registrations_test' => 1,
46
  'forms__comments_test' => 1,
47
  'forms__contact_forms_test' => 1,
48
- 'forms__general_contact_forms_test' => 1,
49
- // Anti-Spam test for unsupported and untested contact forms
50
- 'forms__wc_checkout_test' => 1,
51
- // WooCommerce checkout default test
52
- 'forms__wc_register_from_order' => 1,
53
- // Woocommerce registration during checkout
54
- 'forms__wc_add_to_cart' => 0,
55
- // Woocommerce add to cart
56
- 'forms__search_test' => 1,
57
- // Test default WordPress form
58
  'forms__check_external' => 0,
59
  'forms__check_external__capture_buffer' => 0,
60
  'forms__check_internal' => 0,
@@ -64,30 +59,21 @@ class State extends \Cleantalk\Common\State
64
  'comments__disable_comments__posts' => 0,
65
  'comments__disable_comments__pages' => 0,
66
  'comments__disable_comments__media' => 0,
67
- 'comments__bp_private_messages' => 1,
68
- //buddyPress private messages test => ON
69
  'comments__check_comments_number' => 1,
70
  'comments__remove_old_spam' => 0,
71
- 'comments__remove_comments_links' => 0,
72
- // Removes links from approved comments
73
- 'comments__show_check_links' => 1,
74
- // Shows check link to Cleantalk's DB.
75
- 'comments__manage_comments_on_public_page' => 0,
76
- // Allows to control comments on public page.
77
- 'comments__hide_website_field' => 0,
78
- // Hide website field from comment form
79
 
80
  // Data processing
81
- 'data__protect_logged_in' => 1,
82
- // Do anti-spam tests to for logged in users.
83
  'data__use_ajax' => 0,
84
  'data__use_static_js_key' => -1,
85
- 'data__general_postdata_test' => 0,
86
- //CAPD
87
- 'data__set_cookies' => 3,
88
- // Cookies type: 0 - Off / 1 - Native cookies / 2 - Alt cookies / 3 - Auto
89
- 'data__ssl_on' => 0,
90
- // Secure connection to servers
91
  'data__pixel' => '3',
92
  'data__email_check_before_post' => 1,
93
  'data__honeypot_field' => 1,
@@ -103,8 +89,7 @@ class State extends \Cleantalk\Common\State
103
  'exclusions__roles' => array('Administrator'),
104
 
105
  // Administrator Panel
106
- 'admin_bar__show' => 1,
107
- // Show the admin bar.
108
  'admin_bar__all_time_counter' => 0,
109
  'admin_bar__daily_counter' => 0,
110
  'admin_bar__sfw_counter' => 0,
@@ -114,16 +99,11 @@ class State extends \Cleantalk\Common\State
114
  'gdpr__text' => 'By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.',
115
 
116
  // Misc
117
- 'misc__send_connection_reports' => 0,
118
- // Send connection reports to Cleantalk servers
119
  'misc__async_js' => 0,
120
  'misc__store_urls' => 1,
121
  'misc__complete_deactivation' => 0,
122
- 'misc__debug_ajax' => 0,
123
-
124
- // WordPress
125
- 'wp__use_builtin_http_api' => 1,
126
- // Using WordPress HTTP built in API
127
  'wp__comment_notify' => 1,
128
  'wp__comment_notify__roles' => array('administrator'),
129
  'wp__dashboard_widget__show' => 1,
@@ -134,14 +114,14 @@ class State extends \Cleantalk\Common\State
134
 
135
  // Plugin data
136
  'plugin_version' => APBCT_VERSION,
137
- 'js_keys' => array(), // Keys to do JavaScript antispam test
138
- 'js_keys_store_days' => 14, // JavaScript keys store days - 8 days now
139
- 'js_key_lifetime' => 86400, // JavaScript key life time in seconds - 1 day now
140
- 'last_remote_call' => 0, //Timestam of last remote call
141
- 'current_settings_template_id' => null, // Loaded settings template id
142
- 'current_settings_template_name' => null, // Loaded settings template name
143
  'ajax_type' => 'admin_ajax', // Ajax type - admin_ajax|REST
144
- 'cookies_type' => 'native', // Native / Alternative / None
145
 
146
  // Anti-Spam
147
  'spam_store_days' => 15, // Days before delete comments from folder Spam
@@ -189,12 +169,6 @@ class State extends \Cleantalk\Common\State
189
  'blocked' => 0,
190
  // 'since' => date('d M'),
191
  ),
192
- 'connection_reports' => array(
193
- 'success' => 0,
194
- 'negative' => 0,
195
- 'negative_report' => array(),
196
- // 'since' => date('d M'),
197
- ),
198
 
199
  // A-B tests
200
  'ab_test' => array(
@@ -320,6 +294,13 @@ class State extends \Cleantalk\Common\State
320
  'update_mode' => 0,
321
  );
322
 
 
 
 
 
 
 
 
323
  public $errors;
324
 
325
  protected function setDefinitions()
@@ -432,6 +413,11 @@ class State extends \Cleantalk\Common\State
432
  $option = is_array($option) ? array_merge($this->default_fw_stats, $option) : $this->default_fw_stats;
433
  }
434
 
 
 
 
 
 
435
  $this->$option_name = is_array($option) ? new ArrayObject($option) : $option;
436
  }
437
  }
@@ -496,8 +482,8 @@ class State extends \Cleantalk\Common\State
496
  public function save($option_name, $use_prefix = true, $autoload = true)
497
  {
498
  $option_name_to_save = $use_prefix ? $this->option_prefix . '_' . $option_name : $option_name;
499
- $arr = array();
500
- foreach ($this->$option_name as $key => $value) {
501
  $arr[$key] = $value;
502
  }
503
  update_option($option_name_to_save, $arr, $autoload);
@@ -557,6 +543,41 @@ class State extends \Cleantalk\Common\State
557
  }
558
  }
559
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  /**
561
  * Prepares an adds an error to the plugin's data
562
  *
@@ -750,18 +771,23 @@ class State extends \Cleantalk\Common\State
750
  // First check in storage
751
  if ( isset($this->storage[$name]) ) {
752
  $option = $this->storage[$name];
753
- // Then in data
754
- } elseif ( isset($this->storage['data'][$name]) ) {
 
 
 
755
  $this->$name = $this->storage['data'][$name];
756
  $option = $this->storage['data'][$name];
757
 
758
- // Otherwise, try to get it from db settings table
759
- // it will be arrayObject || scalar || null
 
 
760
  } else {
761
  $option = $this->getOption($name);
762
- }
763
 
764
- return $option;
 
765
  }
766
 
767
  public function __isset($name)
45
  'forms__registrations_test' => 1,
46
  'forms__comments_test' => 1,
47
  'forms__contact_forms_test' => 1,
48
+ 'forms__general_contact_forms_test' => 1, // Anti-Spam test for unsupported and untested contact forms
49
+ 'forms__wc_checkout_test' => 1, // WooCommerce checkout default test
50
+ 'forms__wc_register_from_order' => 1, // Woocommerce registration during checkout
51
+ 'forms__wc_add_to_cart' => 0, // Woocommerce add to cart
52
+ 'forms__search_test' => 1, // Test default WordPress form
 
 
 
 
 
53
  'forms__check_external' => 0,
54
  'forms__check_external__capture_buffer' => 0,
55
  'forms__check_internal' => 0,
59
  'comments__disable_comments__posts' => 0,
60
  'comments__disable_comments__pages' => 0,
61
  'comments__disable_comments__media' => 0,
62
+ 'comments__bp_private_messages' => 1, // BuddyPress private messages test => ON
 
63
  'comments__check_comments_number' => 1,
64
  'comments__remove_old_spam' => 0,
65
+ 'comments__remove_comments_links' => 0, // Remove links from approved comments
66
+ 'comments__show_check_links' => 1, // Shows check link to Cleantalk's DB.
67
+ 'comments__manage_comments_on_public_page' => 0, // Allows to control comments on public page.
68
+ 'comments__hide_website_field' => 0, // Hide website field from comment form
 
 
 
 
69
 
70
  // Data processing
71
+ 'data__protect_logged_in' => 1, // Do anti-spam tests to for logged-in users.
 
72
  'data__use_ajax' => 0,
73
  'data__use_static_js_key' => -1,
74
+ 'data__general_postdata_test' => 0, //CAPD
75
+ 'data__set_cookies' => 3, // Cookies type: 0 - Off / 1 - Native cookies / 2 - Alt cookies / 3 - Auto
76
+ 'data__ssl_on' => 0, // Secure connection to servers
 
 
 
77
  'data__pixel' => '3',
78
  'data__email_check_before_post' => 1,
79
  'data__honeypot_field' => 1,
89
  'exclusions__roles' => array('Administrator'),
90
 
91
  // Administrator Panel
92
+ 'admin_bar__show' => 1, // Show the admin bar.
 
93
  'admin_bar__all_time_counter' => 0,
94
  'admin_bar__daily_counter' => 0,
95
  'admin_bar__sfw_counter' => 0,
99
  'gdpr__text' => 'By using this form you agree with the storage and processing of your data by using the Privacy Policy on this website.',
100
 
101
  // Misc
 
 
102
  'misc__async_js' => 0,
103
  'misc__store_urls' => 1,
104
  'misc__complete_deactivation' => 0,
105
+ 'misc__debug_ajax' => 0, // WordPress
106
+ 'wp__use_builtin_http_api' => 1, // Using WordPress HTTP built in API
 
 
 
107
  'wp__comment_notify' => 1,
108
  'wp__comment_notify__roles' => array('administrator'),
109
  'wp__dashboard_widget__show' => 1,
114
 
115
  // Plugin data
116
  'plugin_version' => APBCT_VERSION,
117
+ 'js_keys' => array(), // Keys to do JavaScript antispam test
118
+ 'js_keys_store_days' => 14, // JavaScript keys store days - 8 days now
119
+ 'js_key_lifetime' => 86400, // JavaScript key lifetime in seconds - 1 day now
120
+ 'last_remote_call' => 0, // Timestamp of last remote call
121
+ 'current_settings_template_id' => null, // Loaded settings template id
122
+ 'current_settings_template_name' => null, // Loaded settings template name
123
  'ajax_type' => 'admin_ajax', // Ajax type - admin_ajax|REST
124
+ 'cookies_type' => 'native', // Native / Alternative / None
125
 
126
  // Anti-Spam
127
  'spam_store_days' => 15, // Days before delete comments from folder Spam
169
  'blocked' => 0,
170
  // 'since' => date('d M'),
171
  ),
 
 
 
 
 
 
172
 
173
  // A-B tests
174
  'ab_test' => array(
294
  'update_mode' => 0,
295
  );
296
 
297
+ private $default_connection_reports = array(
298
+ 'success' => 0,
299
+ 'negative' => 0,
300
+ 'negative_report' => array(),
301
+ 'since' => '',
302
+ );
303
+
304
  public $errors;
305
 
306
  protected function setDefinitions()
413
  $option = is_array($option) ? array_merge($this->default_fw_stats, $option) : $this->default_fw_stats;
414
  }
415
 
416
+ // Default connection reports
417
+ if ($this->option_prefix . '_' . $option_name === 'cleantalk_connection_reports') {
418
+ $option = is_array($option) ? array_merge($this->default_connection_reports, $option) : $this->default_connection_reports;
419
+ }
420
+
421
  $this->$option_name = is_array($option) ? new ArrayObject($option) : $option;
422
  }
423
  }
482
  public function save($option_name, $use_prefix = true, $autoload = true)
483
  {
484
  $option_name_to_save = $use_prefix ? $this->option_prefix . '_' . $option_name : $option_name;
485
+ $arr = array();
486
+ foreach ( $this->$option_name as $key => $value ) {
487
  $arr[$key] = $value;
488
  }
489
  update_option($option_name_to_save, $arr, $autoload);
543
  }
544
  }
545
 
546
+ /**
547
+ * Drop option to default value
548
+ *
549
+ * @param $option_name
550
+ *
551
+ * @return bool
552
+ */
553
+ public function drop($option_name)
554
+ {
555
+ $default_option_name = 'default_' . $option_name;
556
+
557
+ if ( isset($this->$default_option_name) ) {
558
+ $this->$option_name = new ArrayObject($this->$default_option_name);
559
+
560
+ // Additional initialization for special cases
561
+ switch ($option_name) {
562
+ // Connection report
563
+ case 'connection_reports':
564
+ $this->connection_reports['since'] = date('d M');
565
+ $this->save($option_name, true, false);
566
+
567
+ return true;
568
+ //break;
569
+
570
+ // Special treat for other options here
571
+ }
572
+
573
+ // Save dropped option
574
+ $this->save($option_name);
575
+
576
+ return true;
577
+ }
578
+
579
+ return false;
580
+ }
581
  /**
582
  * Prepares an adds an error to the plugin's data
583
  *
771
  // First check in storage
772
  if ( isset($this->storage[$name]) ) {
773
  $option = $this->storage[$name];
774
+
775
+ return $option;
776
+
777
+ // Then in data
778
+ } elseif (isset($this->storage['data'][$name])) {
779
  $this->$name = $this->storage['data'][$name];
780
  $option = $this->storage['data'][$name];
781
 
782
+ return $option;
783
+
784
+ // Otherwise, try to get it from db settings table
785
+ // it will be arrayObject || scalar || null
786
  } else {
787
  $option = $this->getOption($name);
 
788
 
789
+ return $option;
790
+ }
791
  }
792
 
793
  public function __isset($name)
lib/Cleantalk/ApbctWP/Variables/Cookie.php CHANGED
@@ -2,50 +2,42 @@
2
 
3
  namespace Cleantalk\ApbctWP\Variables;
4
 
5
- use Cleantalk\ApbctWP\Sanitize;
6
- use Cleantalk\ApbctWP\Validate;
7
-
8
  class Cookie extends \Cleantalk\Variables\Cookie
9
  {
 
 
10
  /**
11
  * @inheritDoc
12
  */
13
- public static function get($name, $validation_filter = null, $sanitize_filter = null)
14
  {
15
  global $apbct;
16
 
 
 
17
  // Return from memory. From $this->variables
18
- if (isset(static::$instance->variables[$name])) {
19
- $value = static::$instance->variables[$name];
20
- // Get from GLOBAL variable
21
- } else {
22
  // Getting by alternative way if enabled
23
- if ($apbct->data['cookies_type'] === 'alternative') {
24
  $value = AltSessions::get($name);
 
 
 
 
25
  // The old way
 
 
26
  } else {
27
- $name = apbct__get_cookie_prefix() . $name;
28
-
29
- $value = filter_input(INPUT_COOKIE, $name);
30
- }
31
-
32
- // Validate variable
33
- if ( $validation_filter && ! Validate::validate($value, $validation_filter) ) {
34
- return false;
35
- }
36
-
37
- if ( $sanitize_filter ) {
38
- $value = Sanitize::sanitize($value, $sanitize_filter);
39
  }
40
 
41
  // Remember for further calls
42
  static::getInstance()->rememberVariable($name, $value);
43
- }
44
 
45
- // Decoding
46
- $value = urldecode($value); // URL decode
47
 
48
- return $value;
49
  }
50
 
51
  /**
@@ -109,6 +101,10 @@ class Cookie extends \Cleantalk\Variables\Cookie
109
  $httponly = false,
110
  $samesite = 'Lax'
111
  ) {
 
 
 
 
112
  $secure = ! is_null($secure) ? $secure : Server::get('HTTPS') || Server::get('SERVER_PORT') == 443;
113
  // For PHP 7.3+ and above
114
  if ( version_compare(phpversion(), '7.3.0', '>=') ) {
2
 
3
  namespace Cleantalk\ApbctWP\Variables;
4
 
 
 
 
5
  class Cookie extends \Cleantalk\Variables\Cookie
6
  {
7
+ protected static $instance;
8
+
9
  /**
10
  * @inheritDoc
11
  */
12
+ public function getVariable($name)
13
  {
14
  global $apbct;
15
 
16
+ $name = apbct__get_cookie_prefix() . $name;
17
+
18
  // Return from memory. From $this->variables
19
+ if ( ! isset(static::$instance->variables[$name]) ) {
 
 
 
20
  // Getting by alternative way if enabled
21
+ if ( $apbct->data['cookies_type'] === 'alternative' ) {
22
  $value = AltSessions::get($name);
23
+ // Try to get it from native cookies ^_^
24
+ if ( empty($value) && isset($_COOKIE[$name]) ) {
25
+ $value = $this->getAndSanitize(urldecode($_COOKIE[$name]));
26
+ }
27
  // The old way
28
+ } elseif ( isset($_COOKIE[$name]) ) {
29
+ $value = $this->getAndSanitize(urldecode($_COOKIE[$name]));
30
  } else {
31
+ $value = '';
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
 
34
  // Remember for further calls
35
  static::getInstance()->rememberVariable($name, $value);
 
36
 
37
+ return $value;
38
+ }
39
 
40
+ return static::$instance->variables[$name];
41
  }
42
 
43
  /**
101
  $httponly = false,
102
  $samesite = 'Lax'
103
  ) {
104
+ if (headers_sent()) {
105
+ return;
106
+ }
107
+
108
  $secure = ! is_null($secure) ? $secure : Server::get('HTTPS') || Server::get('SERVER_PORT') == 443;
109
  // For PHP 7.3+ and above
110
  if ( version_compare(phpversion(), '7.3.0', '>=') ) {
lib/Cleantalk/Common/API.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace Cleantalk\Common;
4
 
 
 
5
  use Cleantalk\Common\HTTP\Request;
6
 
7
  /**
2
 
3
  namespace Cleantalk\Common;
4
 
5
+ use Cleantalk\Antispam\Cleantalk;
6
+ use Cleantalk\Antispam\CleantalkRequest;
7
  use Cleantalk\Common\HTTP\Request;
8
 
9
  /**
lib/Cleantalk/Common/HTTP/Request.php CHANGED
@@ -308,7 +308,7 @@ class Request
308
  {
309
  $return_value = [];
310
 
311
- // Cast to array to precess result from $this->requestSingle as $this->requestMulti results
312
  $responses = is_object($this->response)
313
  ? [$this->response]
314
  : $this->response;
308
  {
309
  $return_value = [];
310
 
311
+ // Cast to array to process result from $this->requestSingle as $this->requestMulti results
312
  $responses = is_object($this->response)
313
  ? [$this->response]
314
  : $this->response;
lib/Cleantalk/Common/State.php CHANGED
@@ -2,6 +2,16 @@
2
 
3
  namespace Cleantalk\Common;
4
 
 
 
 
 
 
 
 
 
 
 
5
  abstract class State
6
  {
7
  /**
2
 
3
  namespace Cleantalk\Common;
4
 
5
+ /**
6
+ * @property mixed data
7
+ * @property mixed settings
8
+ * @property mixed network_settings
9
+ * @property mixed network_data
10
+ * @property mixed errors
11
+ * @property mixed fw_stats
12
+ * @property mixed connection_reports
13
+ */
14
+
15
  abstract class State
16
  {
17
  /**
lib/Cleantalk/Variables/Cookie.php CHANGED
@@ -68,6 +68,10 @@ abstract class Cookie extends ServerVariables
68
  $httponly = false,
69
  $samesite = 'Lax'
70
  ) {
 
 
 
 
71
  $secure = ! is_null($secure) ? $secure : ! in_array(Server::get('HTTPS'), ['off', '']) || Server::get('SERVER_PORT') == 443;
72
 
73
  // For PHP 7.3+ and above
68
  $httponly = false,
69
  $samesite = 'Lax'
70
  ) {
71
+ if (headers_sent()) {
72
+ return;
73
+ }
74
+
75
  $secure = ! is_null($secure) ? $secure : ! in_array(Server::get('HTTPS'), ['off', '']) || Server::get('SERVER_PORT') == 443;
76
 
77
  // For PHP 7.3+ and above
lib/Cleantalk/Variables/Request.php CHANGED
@@ -35,12 +35,16 @@ abstract class Request extends ServerVariables
35
  $reflection_class = new \ReflectionClass($class_name);
36
  $namespace = $reflection_class->getNamespaceName();
37
 
38
- if ( $namespace . '\\' . Post::get($name) ) {
39
- $value = $namespace . '\\' . Post::get($name);
40
- } elseif ( $namespace . '\\' . Get::get($name) ) {
41
- $value = $namespace . '\\' . Get::get($name);
42
- } elseif ( $namespace . '\\' . Cookie::get($name) ) {
43
- $value = $namespace . '\\' . Cookie::get($name);
 
 
 
 
44
  }
45
 
46
  // Remember for further calls
35
  $reflection_class = new \ReflectionClass($class_name);
36
  $namespace = $reflection_class->getNamespaceName();
37
 
38
+ $post_class = $namespace . '\\Post';
39
+ $get_class = $namespace . '\\Get';
40
+ $cookie_class = $namespace . '\\Cookie';
41
+
42
+ if ( $post_class::get($name) ) {
43
+ $value = $post_class::get($name);
44
+ } elseif ( $get_class::get($name) ) {
45
+ $value = $get_class::get($name);
46
+ } elseif ( $cookie_class::get($name) ) {
47
+ $value = $cookie_class::get($name);
48
  }
49
 
50
  // Remember for further calls
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
- Stable tag: 5.182.2
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -38,7 +38,7 @@ No CAPTCHA, no questions, no animal counting, no puzzles, no math and no spam bo
38
  22. Block messages by languages, countries, networks.
39
  23. Email Address Encoder
40
 
41
- = Free trial then $8 per year =
42
  CleanTalk is an anti-spam plugin which works with the premium Cloud Anti-Spam service cleantalk.org. This plugin as a service <a href="https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted">https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted</a>
43
 
44
  = Public reviews =
@@ -602,6 +602,23 @@ If your website has forms that send data to external sources, you can enable opt
602
 
603
  == Changelog ==
604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  = 5.182.2 Aug 08 2022 =
606
  #### Server variables sanitizing fixed, js key getting fixed, internal forms catching fixed.
607
  * Fix: removed & in getAndSanitize()
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 5.183
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
38
  22. Block messages by languages, countries, networks.
39
  23. Email Address Encoder
40
 
41
+ = Free trial then $12 per year =
42
  CleanTalk is an anti-spam plugin which works with the premium Cloud Anti-Spam service cleantalk.org. This plugin as a service <a href="https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted">https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted</a>
43
 
44
  = Public reviews =
602
 
603
  == Changelog ==
604
 
605
+ = 5.183 Aug 18 2022 =
606
+ ##### Checking for bot while email encoder decode, negative reports improved, some integrations fixed and some minor issues fixed.
607
+ * New: Email Encoder. Check bot before decode.
608
+ * New. Storing big connection reports.
609
+ * Fix. Kses <a> tag fixed.
610
+ * Fix: Skipped login form for Wishlist Member
611
+ * Mod: Added headers_sent in Cookie::set
612
+ * Mod: Added aweber external form integration
613
+ * Fix. Server variables. Getting Request variable fixed.
614
+ * Fix. Connection reports. Getting data from options fixed.
615
+ * Fix. Connection reports. Saving data fixed.
616
+ * Fix. Connection reports. Displaying data fixed.
617
+ * Fix. Cookies. Getting cookies from alternative way fixed.
618
+ * Fix. Cookies. ApbctWP\Variables\Cookie getting fixed.
619
+ * Fix. Cookies. Cookie check parameter fixed.
620
+ * Fix: Fixed error with response from custom ajax requests
621
+
622
  = 5.182.2 Aug 08 2022 =
623
  #### Server variables sanitizing fixed, js key getting fixed, internal forms catching fixed.
624
  * Fix: removed & in getAndSanitize()