Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.132

Version Description

December 17 2019 = * Fix: PHP 7.4 compability * New: Settings and description for "disable comments" functionality. * Mod: WooCommerce settings moved to separate block. * Minor fixes. * Spam protection improved.

Download this release

Release Info

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

Code changes from version 5.131 to 5.132

cleantalk.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: Anti-Spam by CleanTalk
4
- Plugin URI: http://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
- Version: 5.131
7
  Author: СleanTalk <welcome@cleantalk.org>
8
- Author URI: http://cleantalk.org
9
  Text Domain: cleantalk
10
  Domain Path: /i18n
11
  */
@@ -18,7 +18,7 @@ $plugin_info = get_file_data(__FILE__, array('Version' => 'Version', 'Name' => '
18
  // Common params
19
  define('APBCT_NAME', $plugin_info['Name']);
20
  define('APBCT_VERSION', $plugin_info['Version']);
21
- define('APBCT_URL_PATH', plugins_url('', __FILE__)); //HTTP path. Plugin root folder without '/'.
22
  define('APBCT_DIR_PATH', dirname(__FILE__ ) . '/'); //System path. Plugin root folder with '/'.
23
  define('APBCT_PLUGIN_BASE_NAME', plugin_basename(__FILE__)); //Plugin base name.
24
  define('APBCT_CASERT_PATH', file_exists(ABSPATH . WPINC . '/certificates/ca-bundle.crt') ? ABSPATH . WPINC . '/certificates/ca-bundle.crt' : ''); // SSL Serttificate path
@@ -46,7 +46,7 @@ define('APBCT_REMOTE_CALL_SLEEP', 5); // Minimum time between remote call
46
  if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
47
 
48
  define('CLEANTALK_PLUGIN_DIR', dirname(__FILE__ ) . '/');
49
-
50
  // PHP functions patches
51
  require_once(CLEANTALK_PLUGIN_DIR . 'lib/cleantalk-php-patch.php'); // Pathces fpr different functions which not exists
52
 
@@ -71,7 +71,10 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
71
  require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkState.php'); // State class
72
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-pluggable.php'); // Pluggable functions
73
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-common.php');
74
-
 
 
 
75
  // Global ArrayObject with settings and other global varables
76
  global $apbct;
77
  $apbct = new CleantalkState('cleantalk', array('settings', 'data', 'debug', 'errors', 'remote_calls', 'stats'));
@@ -101,6 +104,12 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
101
  require_once( CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
102
  }
103
 
 
 
 
 
 
 
104
  // Passing JS key to frontend
105
  add_action('wp_ajax_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
106
  add_action('wp_ajax_nopriv_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
@@ -1102,7 +1111,7 @@ function apbct_rc__deactivate_plugin($plugin = null){
1102
 
1103
 
1104
  /**
1105
- * Uninstall plugin from wordpress catalog
1106
  *
1107
  * @param null $plugin
1108
  */
@@ -1271,7 +1280,7 @@ function apbct_rc__insert_auth_key($key, $plugin){
1271
  $result = CleantalkAPI::method__notice_paid_till(
1272
  $key,
1273
  preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1), // Site URL
1274
- 'antispam'
1275
  );
1276
 
1277
  if( empty( $result['error'] ) ) {
1
  <?php
2
  /*
3
  Plugin Name: Anti-Spam by CleanTalk
4
+ Plugin URI: https://cleantalk.org
5
  Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
6
+ Version: 5.132
7
  Author: СleanTalk <welcome@cleantalk.org>
8
+ Author URI: https://cleantalk.org
9
  Text Domain: cleantalk
10
  Domain Path: /i18n
11
  */
18
  // Common params
19
  define('APBCT_NAME', $plugin_info['Name']);
20
  define('APBCT_VERSION', $plugin_info['Version']);
21
+ define('APBCT_URL_PATH', plugins_url('', __FILE__)); //HTTP path. Plugin root folder without '/'.
22
  define('APBCT_DIR_PATH', dirname(__FILE__ ) . '/'); //System path. Plugin root folder with '/'.
23
  define('APBCT_PLUGIN_BASE_NAME', plugin_basename(__FILE__)); //Plugin base name.
24
  define('APBCT_CASERT_PATH', file_exists(ABSPATH . WPINC . '/certificates/ca-bundle.crt') ? ABSPATH . WPINC . '/certificates/ca-bundle.crt' : ''); // SSL Serttificate path
46
  if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
47
 
48
  define('CLEANTALK_PLUGIN_DIR', dirname(__FILE__ ) . '/');
49
+
50
  // PHP functions patches
51
  require_once(CLEANTALK_PLUGIN_DIR . 'lib/cleantalk-php-patch.php'); // Pathces fpr different functions which not exists
52
 
71
  require_once(CLEANTALK_PLUGIN_DIR . 'lib/CleantalkState.php'); // State class
72
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-pluggable.php'); // Pluggable functions
73
  require_once(CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-common.php');
74
+
75
+ // Autoloader
76
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib\autoloader.php');
77
+
78
  // Global ArrayObject with settings and other global varables
79
  global $apbct;
80
  $apbct = new CleantalkState('cleantalk', array('settings', 'data', 'debug', 'errors', 'remote_calls', 'stats'));
104
  require_once( CLEANTALK_PLUGIN_DIR . 'inc/cleantalk-widget.php');
105
  }
106
 
107
+ // Disabling comments
108
+ if($apbct->settings['disable_comments__all'] || $apbct->settings['disable_comments__posts'] || $apbct->settings['disable_comments__pages'] || $apbct->settings['disable_comments__media']){
109
+ require_once(CLEANTALK_PLUGIN_DIR . 'lib/Cleantalk/DisableComments.php');
110
+ \Cleantalk\DisableComments::getInstance();
111
+ }
112
+
113
  // Passing JS key to frontend
114
  add_action('wp_ajax_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
115
  add_action('wp_ajax_nopriv_apbct_js_keys__get', 'apbct_js_keys__get__ajax');
1111
 
1112
 
1113
  /**
1114
+ * Uninstall plugin from wordpress. Delete files.
1115
  *
1116
  * @param null $plugin
1117
  */
1280
  $result = CleantalkAPI::method__notice_paid_till(
1281
  $key,
1282
  preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1), // Site URL
1283
+ 'security'
1284
  );
1285
 
1286
  if( empty( $result['error'] ) ) {
i18n/cleantalk-ru_RU.mo CHANGED
Binary file
i18n/cleantalk-ru_RU.po CHANGED
@@ -2,26 +2,26 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Anti-Spam by CleanTalk\n"
4
  "POT-Creation-Date: 2019-10-27 16:02+0000\n"
5
- "PO-Revision-Date: 2019-10-27 16:39+0000\n"
6
  "Last-Translator: admin <ievlev@cleantalk.org>\n"
7
  "Language-Team: Русский\n"
8
  "Language: ru_RU\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Loco https://localise.biz/\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-WPHeader: cleantalk.php\n"
15
- "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
16
- "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
  "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
 
 
21
  "X-Poedit-SearchPath-0: .\n"
22
  "X-Poedit-SearchPathExcluded-0: *.js\n"
23
- "Report-Msgid-Bugs-To: \n"
24
- "X-Loco-Version: 2.3.0; wp-5.2.4"
25
 
26
  #: inc/classCleantalkComments.php:32 inc/cleantalk-comments.php:16
27
  #: inc/cleantalk-users.php:15
@@ -1046,8 +1046,8 @@ msgid ""
1046
  "Notify users with selected roles about new approved comments. Hold CTRL to "
1047
  "select multiple roles."
1048
  msgstr ""
1049
- "Уведомлять пользователей с выбранными ролями о новых одобренных комментариях."
1050
- " Удерживайте CTRL для выбора нескольких ролей."
1051
 
1052
  #: inc/cleantalk-settings.php:367
1053
  #, php-format
@@ -1238,8 +1238,8 @@ msgid ""
1238
  "email please %sGet Access Key Manually%s."
1239
  msgstr ""
1240
  "E-mail администратора (%s) будет использован для регистрации. Если вы хотите "
1241
- "использовать другой e-mail, пожлуйста, %sполучите ключ доступа "
1242
- "самостоятельно%s."
1243
 
1244
  #: inc/cleantalk-settings.php:862
1245
  #, php-format
@@ -1517,14 +1517,10 @@ msgstr ""
1517
  msgid "TRANSLATE"
1518
  msgstr "ПЕРЕВЕСТИ"
1519
 
1520
- #. Plugin Name of the plugin/theme
1521
- msgid "Anti-Spam by CleanTalk"
1522
- msgstr "Антиспам от CleanTalk"
1523
-
1524
  #. Description of the plugin/theme
1525
  msgid ""
1526
- "Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam,"
1527
- " no registration spam, no contact spam, protects any WordPress forms."
1528
  msgstr ""
1529
  "Максимальная эффективность, проверка всех форм, без Сaptcha, премиум "
1530
  "антиспам плагин. Нет спаму в комментариях, нет спаму в регистрациях, нету "
2
  msgstr ""
3
  "Project-Id-Version: Anti-Spam by CleanTalk\n"
4
  "POT-Creation-Date: 2019-10-27 16:02+0000\n"
5
+ "PO-Revision-Date: 2019-12-16 16:16+0500\n"
6
  "Last-Translator: admin <ievlev@cleantalk.org>\n"
7
  "Language-Team: Русский\n"
8
  "Language: ru_RU\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.6\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-WPHeader: cleantalk.php\n"
15
+ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
16
+ "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
  "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
+ "Report-Msgid-Bugs-To: \n"
22
+ "X-Loco-Version: 2.3.0; wp-5.2.4\n"
23
  "X-Poedit-SearchPath-0: .\n"
24
  "X-Poedit-SearchPathExcluded-0: *.js\n"
 
 
25
 
26
  #: inc/classCleantalkComments.php:32 inc/cleantalk-comments.php:16
27
  #: inc/cleantalk-users.php:15
1046
  "Notify users with selected roles about new approved comments. Hold CTRL to "
1047
  "select multiple roles."
1048
  msgstr ""
1049
+ "Уведомлять пользователей с выбранными ролями о новых одобренных "
1050
+ "комментариях. Удерживайте CTRL для выбора нескольких ролей."
1051
 
1052
  #: inc/cleantalk-settings.php:367
1053
  #, php-format
1238
  "email please %sGet Access Key Manually%s."
1239
  msgstr ""
1240
  "E-mail администратора (%s) будет использован для регистрации. Если вы хотите "
1241
+ "использовать другой e-mail, пожлуйста, %sполучите ключ доступа самостоятельно"
1242
+ "%s."
1243
 
1244
  #: inc/cleantalk-settings.php:862
1245
  #, php-format
1517
  msgid "TRANSLATE"
1518
  msgstr "ПЕРЕВЕСТИ"
1519
 
 
 
 
 
1520
  #. Description of the plugin/theme
1521
  msgid ""
1522
+ "Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment "
1523
+ "spam, no registration spam, no contact spam, protects any WordPress forms."
1524
  msgstr ""
1525
  "Максимальная эффективность, проверка всех форм, без Сaptcha, премиум "
1526
  "антиспам плагин. Нет спаму в комментариях, нет спаму в регистрациях, нету "
inc/cleantalk-admin.php CHANGED
@@ -235,7 +235,7 @@ function apbct_admin__register_plugin_links($links, $file){
235
  .'</a>';
236
 
237
  $links[] = '<a class="ct_meta_links" href="'.$apbct->settings_link.'" target="_blank">' . __( 'Start here','cleantalk' ) . '</a>';
238
- $links[] = '<a class="ct_meta_links ct_faq_links" href="http://wordpress.org/plugins/cleantalk-spam-protect/faq/" target="_blank">' . __( 'FAQ','cleantalk' ) . '</a>';
239
  $links[] = '<a class="ct_meta_links ct_support_links"href="https://wordpress.org/support/plugin/cleantalk-spam-protect" target="_blank">' . __( 'Support','cleantalk' ) . '</a>';
240
  $trial = apbct_admin__badge__get_premium(false);
241
  if(!empty($trial))
@@ -432,7 +432,7 @@ function apbct_admin__notice_message(){
432
  // Auto update notice
433
  /* Disabled at 09.09.2018
434
  if($apbct->notice_auto_update == 1 && $apbct->auto_update != -1 && empty($_COOKIE['apbct_update_banner_closed'])){
435
- $link = '<a href="http://cleantalk.org/help/cleantalk-auto-update" target="_blank">%s</a>';
436
  $button = sprintf($link, '<input type="button" class="button button-primary" value="'.__('Learn more', 'cleantalk').'" />');
437
  echo '<div class="error notice is-dismissible apbct_update_notice">'
438
  .'<h3>'
@@ -468,7 +468,7 @@ function apbct_admin__notice_message(){
468
  echo '<div class="error">
469
  <h3>' . sprintf(__("%s trial period ends, please upgrade to %s!", 'cleantalk'),
470
  "<a href='{$settings_link}'>".$apbct->plugin_name."</a>",
471
- "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token&cp_mode=antispam\" target=\"_blank\"><b>premium version</b></a>") .
472
  '</h3>
473
  <h4 style = "color: gray">If you already paid for the service, please, re-save the plugin settings (WP Dashboard —> Settings —> Anti-Spam by CleanTalk) to dismiss the notice.</h4>
474
  </div>';
@@ -478,7 +478,7 @@ function apbct_admin__notice_message(){
478
 
479
  //Renew notice from apbct_admin_init().api_method__notice_paid_till()
480
  if ($apbct->notice_show && $apbct->notice_renew == 1 && $apbct->moderate_ip == 0 && !$apbct->white_label) {
481
- $renew_link = "<a href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20renew$user_token&cp_mode=antispam\" target=\"_blank\">%s</a>";
482
  $button_html = sprintf($renew_link, '<input type="button" class="button button-primary" value="'.__('RENEW ANTI-SPAM', 'cleantalk').'" />');
483
  $link_html = sprintf($renew_link, "<b>".__('next year', 'cleantalk')."</b>");
484
 
@@ -579,7 +579,7 @@ function apbct_admin__admin_bar__add( $wp_admin_bar ) {
579
  .'<div style="margin: auto 7px;" class="ab-item alignright">'
580
  .'<div class="ab-label" id="ct_stats">'
581
  .($apbct->notice_trial == 1
582
- ? "<span><a style='color: red;' href=\"http://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial&user_token={$apbct->user_token}&cp_mode=antispam\" target=\"_blank\">Renew Anti-Spam</a></span>"
583
  : '<span style="color: white;" title="'.__('Allowed / Blocked submissions. The number of submissions is being counted since ', 'cleantalk').' '.$user_counter['since'].'">'.$user_counter_str.'</span> '.$daily_counter_str.$all_time_counter_str.$sfw_counter_str
584
  )
585
  .'</div>'
235
  .'</a>';
236
 
237
  $links[] = '<a class="ct_meta_links" href="'.$apbct->settings_link.'" target="_blank">' . __( 'Start here','cleantalk' ) . '</a>';
238
+ $links[] = '<a class="ct_meta_links ct_faq_links" href="https://wordpress.org/plugins/cleantalk-spam-protect/faq/" target="_blank">' . __( 'FAQ','cleantalk' ) . '</a>';
239
  $links[] = '<a class="ct_meta_links ct_support_links"href="https://wordpress.org/support/plugin/cleantalk-spam-protect" target="_blank">' . __( 'Support','cleantalk' ) . '</a>';
240
  $trial = apbct_admin__badge__get_premium(false);
241
  if(!empty($trial))
432
  // Auto update notice
433
  /* Disabled at 09.09.2018
434
  if($apbct->notice_auto_update == 1 && $apbct->auto_update != -1 && empty($_COOKIE['apbct_update_banner_closed'])){
435
+ $link = '<a href="https://cleantalk.org/help/cleantalk-auto-update" target="_blank">%s</a>';
436
  $button = sprintf($link, '<input type="button" class="button button-primary" value="'.__('Learn more', 'cleantalk').'" />');
437
  echo '<div class="error notice is-dismissible apbct_update_notice">'
438
  .'<h3>'
468
  echo '<div class="error">
469
  <h3>' . sprintf(__("%s trial period ends, please upgrade to %s!", 'cleantalk'),
470
  "<a href='{$settings_link}'>".$apbct->plugin_name."</a>",
471
+ "<a href=\"https://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial$user_token&cp_mode=antispam\" target=\"_blank\"><b>premium version</b></a>") .
472
  '</h3>
473
  <h4 style = "color: gray">If you already paid for the service, please, re-save the plugin settings (WP Dashboard —> Settings —> Anti-Spam by CleanTalk) to dismiss the notice.</h4>
474
  </div>';
478
 
479
  //Renew notice from apbct_admin_init().api_method__notice_paid_till()
480
  if ($apbct->notice_show && $apbct->notice_renew == 1 && $apbct->moderate_ip == 0 && !$apbct->white_label) {
481
+ $renew_link = "<a href=\"https://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%%20backend%%20renew$user_token&cp_mode=antispam\" target=\"_blank\">%s</a>";
482
  $button_html = sprintf($renew_link, '<input type="button" class="button button-primary" value="'.__('RENEW ANTI-SPAM', 'cleantalk').'" />');
483
  $link_html = sprintf($renew_link, "<b>".__('next year', 'cleantalk')."</b>");
484
 
579
  .'<div style="margin: auto 7px;" class="ab-item alignright">'
580
  .'<div class="ab-label" id="ct_stats">'
581
  .($apbct->notice_trial == 1
582
+ ? "<span><a style='color: red;' href=\"https://cleantalk.org/my/bill/recharge?utm_source=wp-backend&utm_medium=cpc&utm_campaign=WP%20backend%20trial&user_token={$apbct->user_token}&cp_mode=antispam\" target=\"_blank\">Renew Anti-Spam</a></span>"
583
  : '<span style="color: white;" title="'.__('Allowed / Blocked submissions. The number of submissions is being counted since ', 'cleantalk').' '.$user_counter['since'].'">'.$user_counter_str.'</span> '.$daily_counter_str.$all_time_counter_str.$sfw_counter_str
584
  )
585
  .'</div>'
inc/cleantalk-public.php CHANGED
@@ -1366,11 +1366,10 @@ function apbct_comment__Wordpress__doNotify($maybe_notify, $comment_ID){
1366
  * @return string
1367
  */
1368
  function apbct_comment__Wordpress__changeMailNotificationGroups($notify_message, $comment_id){
1369
- $website = parse_url(get_option('siteurl'),PHP_URL_HOST);
1370
  return $notify_message
1371
  .PHP_EOL
1372
  .'---'.PHP_EOL
1373
- .'Manage notifications settings: http://'.$website.'/wp-admin/options-general.php?page=cleantalk';
1374
  }
1375
 
1376
  /**
1366
  * @return string
1367
  */
1368
  function apbct_comment__Wordpress__changeMailNotificationGroups($notify_message, $comment_id){
 
1369
  return $notify_message
1370
  .PHP_EOL
1371
  .'---'.PHP_EOL
1372
+ .'Manage notifications settings: '.get_site_url().'/wp-admin/options-general.php?page=cleantalk';
1373
  }
1374
 
1375
  /**
inc/cleantalk-settings.php CHANGED
@@ -129,18 +129,6 @@ function apbct_settings__set_fileds( $fields ){
129
  'title' => __('Custom contact forms', 'cleantalk'),
130
  'description' => __('Anti spam test for any WordPress themes or contacts forms.', 'cleantalk'),
131
  ),
132
- 'wc_checkout_test' => array(
133
- 'title' => __('WooCommerce checkout form', 'cleantalk'),
134
- 'description' => __('Anti spam test for WooCommerce checkout form.', 'cleantalk'),
135
- 'childrens' => array('wc_register_from_order')
136
- ),
137
- 'wc_register_from_order' => array(
138
- 'title' => __('Spam test for registration during checkout', 'cleantalk'),
139
- 'description' => __('Enable anti spam test for registration process which during woocommerce\'s checkout.', 'cleantalk'),
140
- 'parent' => 'wc_checkout_test',
141
- 'class' => 'apbct_settings-field_wrapper--sub',
142
- 'reverse_trigger' => true
143
- ),
144
  'search_test' => array(
145
  'title' => __('Test default Wordpress search form for spam', 'cleantalk'),
146
  'description' => __('Spam protection for Search form.', 'cleantalk')
@@ -170,10 +158,60 @@ function apbct_settings__set_fileds( $fields ){
170
  ),
171
  ),
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  // Comments and Messages
174
  'comments_and_messages' => array(
175
  'title' => __('Comments and Messages', 'cleantalk'),
176
  'fields' => array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  'bp_private_messages' => array(
178
  'title' => __('BuddyPress Private Messages', 'cleantalk'),
179
  'description' => __('Check buddyPress private messages.', 'cleantalk'),
@@ -452,8 +490,8 @@ function apbct_settings__add_groups_and_fields( $fields ){
452
  'callback' => 'apbct_settings__field__draw',
453
  'type' => 'radio',
454
  'options' => array(
455
- array('val' => 1, 'label' => __('On'),),
456
- array('val' => 0, 'label' => __('Off'),),
457
  ),
458
  'def_class' => 'apbct_settings-field_wrapper',
459
  'class' => '',
@@ -536,7 +574,7 @@ function apbct_settings__display() {
536
  // .' <a href="https://community.cleantalk.org/viewforum.php?f=25" target="_blank">'.__("Tech forum", 'cleantalk').'</a>'
537
  // .($user_token ? ", <a href='https://cleantalk.org/my/support?user_token=$user_token&cp_mode=antispam' target='_blank'>".__("Service support ", 'cleantalk').'</a>' : '').
538
  .'<br>';
539
- echo __('Plugin Homepage at', 'cleantalk').' <a href="http://cleantalk.org" target="_blank">cleantalk.org</a>.<br/>';
540
  echo '<span id="apbct_gdpr_open_modal" style="text-decoration: underline;">'.__('GDPR compliance', 'cleantalk').'</span><br/>';
541
  echo __('Use s@cleantalk.org to test plugin in any WordPress form.', 'cleantalk').'<br>';
542
  echo __('CleanTalk is registered Trademark. All rights reserved.', 'cleantalk').'<br/>';
@@ -769,7 +807,7 @@ function apbct_settings__field__state(){
769
  // Autoupdate status
770
  if($apbct->notice_auto_update && (!$apbct->white_label || is_main_site())){
771
  echo '<img class="apbct_status_icon" src="'.($apbct->auto_update == 1 ? $img : ($apbct->auto_update == -1 ? $img_no : $img_no_gray)).'"/>'.__('Auto update', 'cleantalk')
772
- .' <sup><a href="http://cleantalk.org/help/cleantalk-auto-update" target="_blank">?</a></sup>';
773
  }
774
 
775
  // WooCommerce
@@ -1096,7 +1134,7 @@ function apbct_settings__field__draw($params = array()){
1096
  .' value="'.$option['val'].'"'
1097
  .($params['parent'] ? $disabled : '')
1098
  .($params['childrens']
1099
- ? ' onchange="apbctSettingsDependencies(\'' . $childrens . '\')"'
1100
  : ''
1101
  )
1102
  .($value == $option['val'] ? ' checked' : '')
129
  'title' => __('Custom contact forms', 'cleantalk'),
130
  'description' => __('Anti spam test for any WordPress themes or contacts forms.', 'cleantalk'),
131
  ),
 
 
 
 
 
 
 
 
 
 
 
 
132
  'search_test' => array(
133
  'title' => __('Test default Wordpress search form for spam', 'cleantalk'),
134
  'description' => __('Spam protection for Search form.', 'cleantalk')
158
  ),
159
  ),
160
 
161
+ // Comments and Messages
162
+ 'wc' => array(
163
+ 'title' => __('WooCommerce', 'cleantalk'),
164
+ 'fields' => array(
165
+ 'wc_checkout_test' => array(
166
+ 'title' => __('WooCommerce checkout form', 'cleantalk'),
167
+ 'description' => __('Anti spam test for WooCommerce checkout form.', 'cleantalk'),
168
+ 'childrens' => array('wc_register_from_order')
169
+ ),
170
+ 'wc_register_from_order' => array(
171
+ 'title' => __('Spam test for registration during checkout', 'cleantalk'),
172
+ 'description' => __('Enable anti spam test for registration process which during woocommerce\'s checkout.', 'cleantalk'),
173
+ 'parent' => 'wc_checkout_test',
174
+ 'class' => 'apbct_settings-field_wrapper--sub',
175
+ 'reverse_trigger' => true
176
+ ),
177
+ ),
178
+ ),
179
+
180
  // Comments and Messages
181
  'comments_and_messages' => array(
182
  'title' => __('Comments and Messages', 'cleantalk'),
183
  'fields' => array(
184
+ 'disable_comments__all' => array(
185
+ 'title' => __( 'Disable all comments', 'cleantalk' ),
186
+ 'description' => __( 'Disabling comments for all types of content.', 'cleantalk' ),
187
+ 'childrens' => array(
188
+ 'disable_comments__posts',
189
+ 'disable_comments__pages',
190
+ 'disable_comments__media',
191
+ ),
192
+ 'options' => array(
193
+ array( 'val' => 1, 'label' => __( 'On' ), 'childrens_enable' => 0, ),
194
+ array( 'val' => 0, 'label' => __( 'Off' ), 'childrens_enable' => 1, ),
195
+ ),
196
+ ),
197
+ 'disable_comments__posts' => array(
198
+ 'title' => __( 'Disable comments for all "posts"', 'cleantalk' ),
199
+ 'class' => 'apbct_settings-field_wrapper--sub',
200
+ 'parent' => 'disable_comments__all',
201
+ 'reverse_trigger' => true,
202
+ ),
203
+ 'disable_comments__pages' => array(
204
+ 'title' => __( 'Disable comments for all "pages"', 'cleantalk' ),
205
+ 'class' => 'apbct_settings-field_wrapper--sub',
206
+ 'parent' => 'disable_comments__all',
207
+ 'reverse_trigger' => true,
208
+ ),
209
+ 'disable_comments__media' => array(
210
+ 'title' => __( 'Disable comments for all "media"', 'cleantalk' ),
211
+ 'class' => 'apbct_settings-field_wrapper--sub',
212
+ 'parent' => 'disable_comments__all',
213
+ 'reverse_trigger' => true,
214
+ ),
215
  'bp_private_messages' => array(
216
  'title' => __('BuddyPress Private Messages', 'cleantalk'),
217
  'description' => __('Check buddyPress private messages.', 'cleantalk'),
490
  'callback' => 'apbct_settings__field__draw',
491
  'type' => 'radio',
492
  'options' => array(
493
+ array('val' => 1, 'label' => __('On'), 'childrens_enable' => 1, ),
494
+ array('val' => 0, 'label' => __('Off'), 'childrens_enable' => 0, ),
495
  ),
496
  'def_class' => 'apbct_settings-field_wrapper',
497
  'class' => '',
574
  // .' <a href="https://community.cleantalk.org/viewforum.php?f=25" target="_blank">'.__("Tech forum", 'cleantalk').'</a>'
575
  // .($user_token ? ", <a href='https://cleantalk.org/my/support?user_token=$user_token&cp_mode=antispam' target='_blank'>".__("Service support ", 'cleantalk').'</a>' : '').
576
  .'<br>';
577
+ echo __('Plugin Homepage at', 'cleantalk').' <a href="https://cleantalk.org" target="_blank">cleantalk.org</a>.<br/>';
578
  echo '<span id="apbct_gdpr_open_modal" style="text-decoration: underline;">'.__('GDPR compliance', 'cleantalk').'</span><br/>';
579
  echo __('Use s@cleantalk.org to test plugin in any WordPress form.', 'cleantalk').'<br>';
580
  echo __('CleanTalk is registered Trademark. All rights reserved.', 'cleantalk').'<br/>';
807
  // Autoupdate status
808
  if($apbct->notice_auto_update && (!$apbct->white_label || is_main_site())){
809
  echo '<img class="apbct_status_icon" src="'.($apbct->auto_update == 1 ? $img : ($apbct->auto_update == -1 ? $img_no : $img_no_gray)).'"/>'.__('Auto update', 'cleantalk')
810
+ .' <sup><a href="https://cleantalk.org/help/cleantalk-auto-update" target="_blank">?</a></sup>';
811
  }
812
 
813
  // WooCommerce
1134
  .' value="'.$option['val'].'"'
1135
  .($params['parent'] ? $disabled : '')
1136
  .($params['childrens']
1137
+ ? ' onchange="apbctSettingsDependencies(\'' . $childrens . '\', ' . $option['childrens_enable'] . ')"'
1138
  : ''
1139
  )
1140
  .($value == $option['val'] ? ' checked' : '')
inc/cleantalk-widget.php CHANGED
@@ -69,7 +69,7 @@ class cleantalk_widget extends WP_Widget
69
 
70
  // This is where you run the code and display the output
71
  echo '<div style="width:auto;">'
72
- .'<a href="http://cleantalk.org'.(!empty($instance['refid']) ? '?pid='.$instance['refid'] : '').'" target="_blank" title="'.__('CleanTalk\'s main page', 'cleantalk').'" style="'.$a_style.'">'
73
  .'<strong style="'.$strong_style.'"><b>'.$blocked.'</b> '.__('spam', 'cleantalk').'</strong> '.__('blocked by', 'cleantalk').' <strong>CleanTalk</strong>'
74
  .'</a>'
75
  .'</div>';
69
 
70
  // This is where you run the code and display the output
71
  echo '<div style="width:auto;">'
72
+ .'<a href="https://cleantalk.org'.(!empty($instance['refid']) ? '?pid='.$instance['refid'] : '').'" target="_blank" title="'.__('CleanTalk\'s main page', 'cleantalk').'" style="'.$a_style.'">'
73
  .'<strong style="'.$strong_style.'"><b>'.$blocked.'</b> '.__('spam', 'cleantalk').'</strong> '.__('blocked by', 'cleantalk').' <strong>CleanTalk</strong>'
74
  .'</a>'
75
  .'</div>';
js/apbct-public.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function apbct_js_keys__set_input_value(e,t,n,o){if(null!==document.getElementById(n.input_name)){var i=document.getElementById(n.input_name).value;document.getElementById(n.input_name).value=document.getElementById(n.input_name).value.replace(i,e.js_key)}}function apbct_sendAJAXRequest(o,t,n){var i=t.callback||null,a=t.notJson||null,e=t.timeout||15e3;n=n||null;o._ajax_nonce=ctPublic._ajax_nonce,jQuery.ajax({type:"POST",url:ctPublic._ajax_url,data:o,success:function(e){a||(e=JSON.parse(e)),e.error||i&&i(e,o,t,n)},error:function(e,t,n){console.log("APBCT_AJAX_ERROR"),console.log(o),console.log(e),console.log(t),console.log(n)},timeout:e})}!function(){var e=new Date,t=(new Date).getTime(),n=!0,o=[],i=0;function a(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/"}function c(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function r(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}a("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),a("ct_fkp_timestamp","0"),a("ct_pointer_data","0"),a("ct_timezone","0"),setTimeout(function(){a("ct_timezone",e.getTimezoneOffset()/60*-1)},1e3);var u=function(e){a("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),r(window,"mousedown",u),r(window,"keydown",u)},l=setInterval(function(){n=!0},150),m=setInterval(function(){a("ct_pointer_data",JSON.stringify(o))},1200),s=function(e){!0===n&&(o.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),n=!1,50<=++i&&(r(window,"mousemove",s),clearInterval(l),clearInterval(m)))};c(window,"mousemove",s),c(window,"mousedown",u),c(window,"keydown",u);var d,p,v,f,_,g,b=!0,w={orientation:{alpha:{},beta:{},gamma:{}},motion:{x:{},y:{},z:{}}};var y=setInterval(function(){var e=+new Date;w.orientation.alpha[e]=d,w.orientation.beta[e]=p,w.orientation.gamma[e]=v,w.motion.x[e]=f,w.motion.y[e]=_,w.motion.z[e]=g,a("abpct_hyro_acc_collect",JSON.stringify(w))},1e3);setTimeout(function(){clearInterval(y)},1e4),window.DeviceOrientationEvent&&c(window,"deviceorientation",function(e){var t,n,o,i=0,a=0,c=0;if(b)return i=e.alpha,a=e.beta,c=e.gamma,void(b=!1);t=e.alpha-i,n=e.beta-a,o=e.gamma-c,d=parseInt(t,10),p=parseInt(n,10),v=parseInt(o,10)}),window.DeviceMotionEvent&&c(window,"devicemotion",function(e){f=parseInt(e.accelerationIncludingGravity.x,10),_=parseInt(e.accelerationIncludingGravity.y,10),g=parseInt(e.accelerationIncludingGravity.z,10)}),c(window,"DOMContentLoaded",function(){a("apbct_visible_fields",0),a("apbct_visible_fields_count",0),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t=document.forms[e];t.onsubmit_prev=t.onsubmit,t.onsubmit=function(e){var t=[];for(var n in this.elements)isNaN(+n)||(t[n]=this.elements[n]);var o=(t=t.filter(function(o){return"none"!==getComputedStyle(o).display&&"hidden"!==getComputedStyle(o).visibility&&"0"!==getComputedStyle(o).opacity&&"hidden"!==o.getAttribute("type")&&"submit"!==o.getAttribute("type")&&""!==o.value&&null!==o.getAttribute("name")&&("radio"===o.getAttribute("type")&&t.forEach(function(e,t,n){o.getAttribute("name")!==e.getAttribute("name")||!1}),!0)})).length,i="";t.forEach(function(e,t,n){i+=" "+e.getAttribute("name")}),a("apbct_visible_fields",i=i.trim()),a("apbct_visible_fields_count",o),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)}}},1e3)})}(),jQuery(document).ajaxComplete(function(e,t,n){var o;t.responseText&&-1!==t.responseText.indexOf('"apbct')&&void 0!==(o=JSON.parse(t.responseText)).apbct&&(o=o.apbct).blocked&&alert(o.comment)});
2
- //# sourceMappingURL=apbct-public.min.js.map
1
+ function apbct_js_keys__set_input_value(e,t,n,o){if(null!==document.getElementById(n.input_name)){var i=document.getElementById(n.input_name).value;document.getElementById(n.input_name).value=document.getElementById(n.input_name).value.replace(i,e.js_key)}}if(function(){var e=new Date,t=(new Date).getTime(),n=!0,o=[],i=0;function a(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/"}function c(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function r(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}a("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),a("ct_fkp_timestamp","0"),a("ct_pointer_data","0"),a("ct_timezone","0"),setTimeout(function(){a("ct_timezone",e.getTimezoneOffset()/60*-1)},1e3);var u=function(e){a("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),r(window,"mousedown",u),r(window,"keydown",u)},l=setInterval(function(){n=!0},150),m=setInterval(function(){a("ct_pointer_data",JSON.stringify(o))},1200),s=function(e){!0===n&&(o.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),n=!1,50<=++i&&(r(window,"mousemove",s),clearInterval(l),clearInterval(m)))};c(window,"mousemove",s),c(window,"mousedown",u),c(window,"keydown",u);var d,p,f,v,_,g,b=!0,w={orientation:{alpha:{},beta:{},gamma:{}},motion:{x:{},y:{},z:{}}};var y=setInterval(function(){var e=+new Date;w.orientation.alpha[e]=d,w.orientation.beta[e]=p,w.orientation.gamma[e]=f,w.motion.x[e]=v,w.motion.y[e]=_,w.motion.z[e]=g,a("abpct_hyro_acc_collect",JSON.stringify(w))},1e3);setTimeout(function(){clearInterval(y)},1e4),window.DeviceOrientationEvent&&c(window,"deviceorientation",function(e){var t,n,o,i=0,a=0,c=0;if(b)return i=e.alpha,a=e.beta,c=e.gamma,void(b=!1);t=e.alpha-i,n=e.beta-a,o=e.gamma-c,d=parseInt(t,10),p=parseInt(n,10),f=parseInt(o,10)}),window.DeviceMotionEvent&&c(window,"devicemotion",function(e){v=parseInt(e.accelerationIncludingGravity.x,10),_=parseInt(e.accelerationIncludingGravity.y,10),g=parseInt(e.accelerationIncludingGravity.z,10)}),c(window,"DOMContentLoaded",function(){a("apbct_visible_fields",0),a("apbct_visible_fields_count",0),setTimeout(function(){for(var e=0;e<document.forms.length;e++){var t=document.forms[e];t.onsubmit_prev=t.onsubmit,t.onsubmit=function(e){var t=[];for(var n in this.elements)isNaN(+n)||(t[n]=this.elements[n]);var o=(t=t.filter(function(o){return"none"!==getComputedStyle(o).display&&"hidden"!==getComputedStyle(o).visibility&&"0"!==getComputedStyle(o).opacity&&"hidden"!==o.getAttribute("type")&&"submit"!==o.getAttribute("type")&&""!==o.value&&null!==o.getAttribute("name")&&("radio"===o.getAttribute("type")&&t.forEach(function(e,t,n){o.getAttribute("name")!==e.getAttribute("name")||!1}),!0)})).length,i="";t.forEach(function(e,t,n){i+=" "+e.getAttribute("name")}),a("apbct_visible_fields",i=i.trim()),a("apbct_visible_fields_count",o),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)}}},1e3)})}(),"undefined"!=typeof jQuery){function apbct_sendAJAXRequest(o,t,n){var i=t.callback||null,a=t.notJson||null,e=t.timeout||15e3;n=n||null;o._ajax_nonce=ctPublic._ajax_nonce,jQuery.ajax({type:"POST",url:ctPublic._ajax_url,data:o,success:function(e){a||(e=JSON.parse(e)),e.error||i&&i(e,o,t,n)},error:function(e,t,n){console.log("APBCT_AJAX_ERROR"),console.log(o),console.log(e),console.log(t),console.log(n)},timeout:e})}jQuery(document).ajaxComplete(function(e,t,n){var o;t.responseText&&-1!==t.responseText.indexOf('"apbct')&&void 0!==(o=JSON.parse(t.responseText)).apbct&&(o=o.apbct).blocked&&alert(o.comment)})}
2
+ //# sourceMappingURL=apbct-public.min.js.map
js/apbct-public.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["apbct-public.js"],"names":["apbct_js_keys__set_input_value","result","data","params","obj","document","getElementById","input_name","ct_input_value","value","replace","js_key","apbct_sendAJAXRequest","callback","notJson","timeout","_ajax_nonce","ctPublic","jQuery","ajax","type","url","_ajax_url","success","JSON","parse","error","jqXHR","textStatus","errorThrown","console","log","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctSetCookieSec","c_name","cookie","encodeURIComponent","apbct_attach_event_handler","elem","event","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","Math","floor","setTimeout","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","stringify","ctFunctionMouseMove","push","round","clientY","clientX","clearInterval","globalAlpha","globalBeta","globalGamma","globalAccX","globalAccY","globalAccZ","isFirstTimeHyro","output","orientation","alpha","beta","gamma","motion","x","y","z","collect","timestamp","DeviceOrientationEvent","alphaOffset","betaOffset","gammaOffset","parseInt","DeviceMotionEvent","accelerationIncludingGravity","i","forms","length","form","onsubmit_prev","onsubmit","elements","key","this","isNaN","visible_fields_count","filter","getComputedStyle","display","visibility","opacity","getAttribute","forEach","el","j","els","visible_fields","trim","target","Function","call","ajaxComplete","xhr","settings","response","responseText","indexOf","apbct","blocked","alert","comment"],"mappings":"AA4PA,SAASA,+BAA+BC,EAAQC,EAAMC,EAAQC,GAC7D,GAAmD,OAA/CC,SAASC,eAAeH,EAAOI,YAAsB,CACxD,IAAIC,EAAiBH,SAASC,eAAeH,EAAOI,YAAYE,MAChEJ,SAASC,eAAeH,EAAOI,YAAYE,MAAQJ,SAASC,eAAeH,EAAOI,YAAYE,MAAMC,QAAQF,EAAgBP,EAAOU,SAIrI,SAASC,sBAAsBV,EAAMC,EAAQC,GAG5C,IAAIS,EAAcV,EAAOU,UAAe,KACpCC,EAAcX,EAAOW,SAAe,KACpCC,EAAcZ,EAAOY,SAAe,KACpCX,EAAcA,GAAsB,KAExCF,EAAKc,YAAcC,SAASD,YAE5BE,OAAOC,KAAK,CACXC,KAAM,OACNC,IAAKJ,SAASK,UACdpB,KAAMA,EACNqB,QAAS,SAAStB,GACba,IAASb,EAASuB,KAAKC,MAAMxB,IAC9BA,EAAOyB,OAGNb,GACFA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GAEjD,IAEKC,EAHHF,EAAIG,eAAwD,IAAxCH,EAAIG,aAAaC,QAAQ,gBAElB,KADzBF,EAAWjG,KAAKC,MAAM8F,EAAIG,eACXE,QACdH,EAAWA,EAASG,OACZC,SACXC,MAAML,EAASM","file":"apbct-public.min.js","sourcesContent":["(function() {\r\n\r\n\tvar ct_date = new Date(),\r\n\t\tctTimeMs = new Date().getTime(),\r\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\r\n\t\tctMouseData = [],\r\n\t\tctMouseDataCounter = 0;\r\n\r\n\tfunction ctSetCookieSec(c_name, value) {\r\n\t\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/\";\r\n\t}\r\n\r\n\tfunction apbct_attach_event_handler(elem, event, callback){\r\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\r\n\t\telse elem.attachEvent(event, callback);\r\n\t}\r\n\r\n\tfunction apbct_remove_event_handler(elem, event, callback){\r\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\r\n\t\telse elem.detachEvent(event, callback);\r\n\t}\r\n\r\n\tctSetCookieSec(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\r\n\tctSetCookieSec(\"ct_fkp_timestamp\", \"0\");\r\n\tctSetCookieSec(\"ct_pointer_data\", \"0\");\r\n\tctSetCookieSec(\"ct_timezone\", \"0\");\r\n\r\n\tsetTimeout(function(){\r\n\t\tctSetCookieSec(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\r\n\t},1000);\r\n\r\n\t//Writing first key press timestamp\r\n\tvar ctFunctionFirstKey = function output(event){\r\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\r\n\t\tctSetCookieSec(\"ct_fkp_timestamp\", KeyTimestamp);\r\n\t\tctKeyStopStopListening();\r\n\t};\r\n\r\n\t//Reading interval\r\n\tvar ctMouseReadInterval = setInterval(function(){\r\n\t\tctMouseEventTimerFlag = true;\r\n\t}, 150);\r\n\r\n\t//Writting interval\r\n\tvar ctMouseWriteDataInterval = setInterval(function(){\r\n\t\tctSetCookieSec(\"ct_pointer_data\", JSON.stringify(ctMouseData));\r\n\t}, 1200);\r\n\r\n\t//Logging mouse position each 150 ms\r\n\tvar ctFunctionMouseMove = function output(event){\r\n\t\tif(ctMouseEventTimerFlag === true){\r\n\r\n\t\t\tctMouseData.push([\r\n\t\t\t\tMath.round(event.clientY),\r\n\t\t\t\tMath.round(event.clientX),\r\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\r\n\t\t\t]);\r\n\r\n\t\t\tctMouseDataCounter++;\r\n\t\t\tctMouseEventTimerFlag = false;\r\n\t\t\tif(ctMouseDataCounter >= 50){\r\n\t\t\t\tctMouseStopData();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t//Stop mouse observing function\r\n\tfunction ctMouseStopData(){\r\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\r\n\t\tclearInterval(ctMouseReadInterval);\r\n\t\tclearInterval(ctMouseWriteDataInterval);\r\n\t}\r\n\r\n\t//Stop key listening function\r\n\tfunction ctKeyStopStopListening(){\r\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\r\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\r\n\t}\r\n\r\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\r\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\r\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\r\n\r\n\t// Hyroscope && Accelerometer data\r\n\r\n var isFirstTimeHyro = true;\r\n\r\n var output = {\r\n 'orientation' : {\r\n 'alpha' : {},\r\n 'beta' : {},\r\n 'gamma' : {}\r\n },\r\n 'motion' : {\r\n 'x' : {},\r\n 'y' : {},\r\n 'z' : {}\r\n }\r\n };\r\n\r\n var globalAlpha, globalBeta, globalGamma, globalAccX, globalAccY, globalAccZ;\r\n\r\n function handleOrientation(event) {\r\n\r\n var alphaOffset = 0;\r\n var betaOffset = 0;\r\n var gammaOffset = 0;\r\n var alpha = 0;\r\n var beta = 0;\r\n var gamma = 0;\r\n if(isFirstTimeHyro){\r\n alphaOffset = event.alpha;\r\n betaOffset = event.beta;\r\n gammaOffset = event.gamma;\r\n isFirstTimeHyro = false;\r\n return;\r\n }\r\n\r\n alpha = event.alpha - alphaOffset;\r\n beta = event.beta - betaOffset;\r\n gamma = event.gamma - gammaOffset;\r\n globalAlpha = parseInt( alpha, 10 );\r\n globalBeta = parseInt( beta, 10 );\r\n globalGamma = parseInt( gamma, 10 );\r\n\r\n }\r\n\r\n function handleMotion(event) {\r\n\r\n globalAccX = parseInt( event.accelerationIncludingGravity.x, 10 );\r\n globalAccY = parseInt( event.accelerationIncludingGravity.y, 10 );\r\n globalAccZ = parseInt( event.accelerationIncludingGravity.z, 10 );\r\n\r\n }\r\n\r\n var collect = setInterval( function(){\r\n var timestamp = ( + new Date() );\r\n output.orientation.alpha[timestamp] = globalAlpha;\r\n output.orientation.beta[timestamp] = globalBeta;\r\n output.orientation.gamma[timestamp] = globalGamma;\r\n output.motion.x[timestamp] = globalAccX;\r\n output.motion.y[timestamp] = globalAccY;\r\n output.motion.z[timestamp] = globalAccZ;\r\n ctSetCookieSec(\"abpct_hyro_acc_collect\", JSON.stringify(output))\r\n }, 1000 );\r\n setTimeout( function(){\r\n clearInterval( collect );\r\n }, 10000 );\r\n\r\n if (window.DeviceOrientationEvent) {\r\n apbct_attach_event_handler(window, \"deviceorientation\", handleOrientation);\r\n }\r\n if (window.DeviceMotionEvent) {\r\n apbct_attach_event_handler(window, \"devicemotion\", handleMotion);\r\n }\r\n\r\n\t// Ready function\r\n\tfunction apbct_ready(){\r\n\t\tctSetCookieSec(\"apbct_visible_fields\", 0);\r\n\t\tctSetCookieSec(\"apbct_visible_fields_count\", 0);\r\n\t\tsetTimeout(function(){\r\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\r\n\t\t\t\tvar form = document.forms[i];\r\n\r\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\r\n\t\t\t\tform.onsubmit = function(event){\r\n\r\n\t\t\t\t\t// Get only fields\r\n\t\t\t\t\tvar elements = [];\r\n\t\t\t\t\tfor(var key in this.elements){\r\n\t\t\t\t\t\tif(!isNaN(+key))\r\n\t\t\t\t\t\t\telements[key] = this.elements[key];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Filter fields\r\n\t\t\t\t\telements = elements.filter(function(elem){\r\n\r\n\t\t\t\t\t\tvar pass = true;\r\n\r\n\t\t\t\t\t\t// Filter fields\r\n\t\t\t\t\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\r\n\t\t\t\t\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\r\n\t\t\t\t\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\r\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\r\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\r\n\t\t\t\t\t\t\telem.value === \"\" || // empty value\r\n\t\t\t\t\t\t\telem.getAttribute('name') === null\r\n\t\t\t\t\t\t){\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Filter elements with same names for type == radio\r\n\t\t\t\t\t\tif(elem.getAttribute(\"type\") === \"radio\"){\r\n\t\t\t\t\t\t\telements.forEach(function(el, j, els){\r\n\t\t\t\t\t\t\t\tif(elem.getAttribute('name') === el.getAttribute('name')){\r\n\t\t\t\t\t\t\t\t\tpass = false;\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t// Visible fields count\r\n\t\t\t\t\tvar visible_fields_count = elements.length;\r\n\r\n\t\t\t\t\t// Visible fields\r\n\t\t\t\t\tvar visible_fields = '';\r\n\t\t\t\t\telements.forEach(function(elem, i, elements){\r\n\t\t\t\t\t\tvisible_fields += \" \" + elem.getAttribute(\"name\");\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvisible_fields = visible_fields.trim();\r\n\r\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields\", visible_fields);\r\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields_count\", visible_fields_count);\r\n\r\n\t\t\t\t\t// Call previous submit action\r\n\t\t\t\t\tif(event.target.onsubmit_prev instanceof Function){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\r\n\t\t\t\t\t\t}, 500);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}, 1000);\r\n\t}\r\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\r\n\r\n\t//(function(open) {\r\n\t// XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {\r\n\t// this.addEventListener(\"readystatechange\", function() {\r\n\t// }, false);\r\n\t// open.call(this, method, url, async, user, pass);\r\n\t// };\r\n\t//})(XMLHttpRequest.prototype.open);\r\n\r\n}());\r\n\r\n// Capturing responses and output block message for unknown AJAX forms\r\njQuery(document).ajaxComplete(function(event, xhr, settings) {\r\n\tif(xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1){\r\n\t\tvar response = JSON.parse(xhr.responseText);\r\n\t\tif(typeof response.apbct !== 'undefined'){\r\n\t\t\tvar response = response.apbct;\r\n\t\t\tif(response.blocked){\r\n\t\t\t\talert(response.comment);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\r\n\tif (document.getElementById(params.input_name) !== null) {\r\n\t\tvar ct_input_value = document.getElementById(params.input_name).value;\r\n\t\tdocument.getElementById(params.input_name).value = document.getElementById(params.input_name).value.replace(ct_input_value, result.js_key);\r\n\t}\r\n}\r\n\r\nfunction apbct_sendAJAXRequest(data, params, obj){\r\n\r\n\t// Default params\r\n\tvar callback = params.callback || null;\r\n\tvar notJson = params.notJson || null;\r\n\tvar timeout = params.timeout || 15000;\r\n\tvar obj = obj || null;\r\n\r\n\tdata._ajax_nonce = ctPublic._ajax_nonce;\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\turl: ctPublic._ajax_url,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(!notJson) result = JSON.parse(result);\r\n\t\t\tif(result.error){\r\n\r\n\t\t\t}else{\r\n\t\t\t\tif(callback)\r\n\t\t\t\t\tcallback(result, data, params, obj);\r\n\t\t\t}\r\n\t\t},\r\n\t\terror: function(jqXHR, textStatus, errorThrown){\r\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\r\n\t\t\tconsole.log(data);\r\n\t\t\tconsole.log(jqXHR);\r\n\t\t\tconsole.log(textStatus);\r\n\t\t\tconsole.log(errorThrown);\r\n\t\t},\r\n\t\ttimeout: timeout\r\n\t});\r\n}"]}
1
+ {"version":3,"sources":["apbct-public.js"],"names":["apbct_js_keys__set_input_value","result","data","params","obj","document","getElementById","input_name","ct_input_value","value","replace","js_key","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctSetCookieSec","c_name","cookie","encodeURIComponent","apbct_attach_event_handler","elem","event","callback","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","Math","floor","setTimeout","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","JSON","stringify","ctFunctionMouseMove","push","round","clientY","clientX","clearInterval","globalAlpha","globalBeta","globalGamma","globalAccX","globalAccY","globalAccZ","isFirstTimeHyro","output","orientation","alpha","beta","gamma","motion","x","y","z","collect","timestamp","DeviceOrientationEvent","alphaOffset","betaOffset","gammaOffset","parseInt","DeviceMotionEvent","accelerationIncludingGravity","i","forms","length","form","onsubmit_prev","onsubmit","elements","key","this","isNaN","visible_fields_count","filter","getComputedStyle","display","visibility","opacity","getAttribute","forEach","el","j","els","visible_fields","trim","target","Function","call","jQuery","apbct_sendAJAXRequest","notJson","timeout","_ajax_nonce","ctPublic","ajax","type","url","_ajax_url","success","parse","error","jqXHR","textStatus","errorThrown","console","log","ajaxComplete","xhr","settings","response","responseText","indexOf","apbct","blocked","alert","comment"],"mappings":"AA+OA,SAASA,+BAA+BC,EAAQC,EAAMC,EAAQC,GAC7D,GAAmD,OAA/CC,SAASC,eAAeH,EAAOI,YAAsB,CACxD,IAAIC,EAAiBH,SAASC,eAAeH,EAAOI,YAAYE,MAChEJ,SAASC,eAAeH,EAAOI,YAAYE,MAAQJ,SAASC,eAAeH,EAAOI,YAAYE,MAAMC,QAAQF,EAAgBP,EAAOU,SAIrI,GAtPC,WAEA,IAAIC,EAAU,IAAIC,KACjBC,GAAW,IAAID,MAAOE,UACtBC,GAAwB,EACxBC,EAAc,GACdC,EAAqB,EAEtB,SAASC,EAAeC,EAAQX,GAC/BJ,SAASgB,OAASD,EAAS,IAAME,mBAAmBb,GAAS,WAG9D,SAASc,EAA2BC,EAAMC,EAAOC,GACV,mBAA5BC,OAAOC,iBAAiCJ,EAAKI,iBAAiBH,EAAOC,GAC7BF,EAAKK,YAAYJ,EAAOC,GAG3E,SAASI,EAA2BN,EAAMC,EAAOC,GACP,mBAA/BC,OAAOI,oBAAoCP,EAAKO,oBAAoBN,EAAOC,GAChCF,EAAKQ,YAAYP,EAAOC,GAG9EP,EAAe,kBAAmBc,KAAKC,OAAM,IAAIrB,MAAOE,UAAU,MAClEI,EAAe,mBAAoB,KACnCA,EAAe,kBAAmB,KAClCA,EAAe,cAAe,KAE9BgB,WAAW,WACVhB,EAAe,cAAeP,EAAQwB,oBAAoB,IAAK,IAC9D,KAGF,IAAIC,EAAqB,SAAgBZ,GAExCN,EAAe,mBADIc,KAAKC,OAAM,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I4Bd,OAGhCmB,EAAiB,GACrBf,EAASW,QAAQ,SAASnE,EAAMkD,EAAGM,GAClCe,GAAkB,IAAMvE,EAAKkE,aAAa,UAI3CvE,EAAe,uBAFf4E,EAAiBA,EAAeC,QAGhC7E,EAAe,6BAA8BiE,GAG1C3D,EAAMwE,OAAOnB,yBAAyBoB,UACxC/D,WAAW,WACVV,EAAMwE,OAAOnB,cAAcqB,KAAK1E,EAAMwE,OAAQxE,IAC5C,QAIJ,OAjOL,GAsPqB,oBAAX2E,OAAwB,CAejC,SAASC,sBAAsBnG,EAAMC,EAAQC,GAG5C,IAAIsB,EAAWvB,EAAOuB,UAAY,KAC9B4E,EAAUnG,EAAOmG,SAAW,KAC5BC,EAAUpG,EAAOoG,SAAW,KAC5BnG,EAAMA,GAAO,KAEjBF,EAAKsG,YAAcC,SAASD,YAE5BJ,OAAOM,KAAK,CACXC,KAAM,OACNC,IAAKH,SAASI,UACd3G,KAAMA,EACN4G,QAAS,SAAU7G,GACbqG,IAASrG,EAASwC,KAAKsE,MAAM9G,IAC9BA,EAAO+G,OAGNtF,GACHA,EAASzB,EAAQC,EAAMC,EAAQC,IAGlC4G,MAAO,SAAUC,EAAOC,EAAYC,GACnCC,QAAQC,IAAI,oBACZD,QAAQC,IAAInH,GACZkH,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEbZ,QAASA,IA1CXH,OAAO/F,UAAUiH,aAAa,SAAU7F,EAAO8F,EAAKC,GAElD,IAEKC,EAHFF,EAAIG,eAAwD,IAAxCH,EAAIG,aAAaC,QAAQ,gBAElB,KAD1BF,EAAWhF,KAAKsE,MAAMQ,EAAIG,eACVE,QACfH,EAAWA,EAASG,OACXC,SACZC,MAAML,EAASM","file":"apbct-public.min.js","sourcesContent":["(function() {\r\n\r\n\tvar ct_date = new Date(),\r\n\t\tctTimeMs = new Date().getTime(),\r\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\r\n\t\tctMouseData = [],\r\n\t\tctMouseDataCounter = 0;\r\n\r\n\tfunction ctSetCookieSec(c_name, value) {\r\n\t\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/\";\r\n\t}\r\n\r\n\tfunction apbct_attach_event_handler(elem, event, callback){\r\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\r\n\t\telse elem.attachEvent(event, callback);\r\n\t}\r\n\r\n\tfunction apbct_remove_event_handler(elem, event, callback){\r\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\r\n\t\telse elem.detachEvent(event, callback);\r\n\t}\r\n\r\n\tctSetCookieSec(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\r\n\tctSetCookieSec(\"ct_fkp_timestamp\", \"0\");\r\n\tctSetCookieSec(\"ct_pointer_data\", \"0\");\r\n\tctSetCookieSec(\"ct_timezone\", \"0\");\r\n\r\n\tsetTimeout(function(){\r\n\t\tctSetCookieSec(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\r\n\t},1000);\r\n\r\n\t//Writing first key press timestamp\r\n\tvar ctFunctionFirstKey = function output(event){\r\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\r\n\t\tctSetCookieSec(\"ct_fkp_timestamp\", KeyTimestamp);\r\n\t\tctKeyStopStopListening();\r\n\t};\r\n\r\n\t//Reading interval\r\n\tvar ctMouseReadInterval = setInterval(function(){\r\n\t\tctMouseEventTimerFlag = true;\r\n\t}, 150);\r\n\r\n\t//Writting interval\r\n\tvar ctMouseWriteDataInterval = setInterval(function(){\r\n\t\tctSetCookieSec(\"ct_pointer_data\", JSON.stringify(ctMouseData));\r\n\t}, 1200);\r\n\r\n\t//Logging mouse position each 150 ms\r\n\tvar ctFunctionMouseMove = function output(event){\r\n\t\tif(ctMouseEventTimerFlag === true){\r\n\r\n\t\t\tctMouseData.push([\r\n\t\t\t\tMath.round(event.clientY),\r\n\t\t\t\tMath.round(event.clientX),\r\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\r\n\t\t\t]);\r\n\r\n\t\t\tctMouseDataCounter++;\r\n\t\t\tctMouseEventTimerFlag = false;\r\n\t\t\tif(ctMouseDataCounter >= 50){\r\n\t\t\t\tctMouseStopData();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t//Stop mouse observing function\r\n\tfunction ctMouseStopData(){\r\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\r\n\t\tclearInterval(ctMouseReadInterval);\r\n\t\tclearInterval(ctMouseWriteDataInterval);\r\n\t}\r\n\r\n\t//Stop key listening function\r\n\tfunction ctKeyStopStopListening(){\r\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\r\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\r\n\t}\r\n\r\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\r\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\r\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\r\n\r\n\t// Hyroscope && Accelerometer data\r\n\r\n var isFirstTimeHyro = true;\r\n\r\n var output = {\r\n 'orientation' : {\r\n 'alpha' : {},\r\n 'beta' : {},\r\n 'gamma' : {}\r\n },\r\n 'motion' : {\r\n 'x' : {},\r\n 'y' : {},\r\n 'z' : {}\r\n }\r\n };\r\n\r\n var globalAlpha, globalBeta, globalGamma, globalAccX, globalAccY, globalAccZ;\r\n\r\n function handleOrientation(event) {\r\n\r\n var alphaOffset = 0;\r\n var betaOffset = 0;\r\n var gammaOffset = 0;\r\n var alpha = 0;\r\n var beta = 0;\r\n var gamma = 0;\r\n if(isFirstTimeHyro){\r\n alphaOffset = event.alpha;\r\n betaOffset = event.beta;\r\n gammaOffset = event.gamma;\r\n isFirstTimeHyro = false;\r\n return;\r\n }\r\n\r\n alpha = event.alpha - alphaOffset;\r\n beta = event.beta - betaOffset;\r\n gamma = event.gamma - gammaOffset;\r\n globalAlpha = parseInt( alpha, 10 );\r\n globalBeta = parseInt( beta, 10 );\r\n globalGamma = parseInt( gamma, 10 );\r\n\r\n }\r\n\r\n function handleMotion(event) {\r\n\r\n globalAccX = parseInt( event.accelerationIncludingGravity.x, 10 );\r\n globalAccY = parseInt( event.accelerationIncludingGravity.y, 10 );\r\n globalAccZ = parseInt( event.accelerationIncludingGravity.z, 10 );\r\n\r\n }\r\n\r\n var collect = setInterval( function(){\r\n var timestamp = ( + new Date() );\r\n output.orientation.alpha[timestamp] = globalAlpha;\r\n output.orientation.beta[timestamp] = globalBeta;\r\n output.orientation.gamma[timestamp] = globalGamma;\r\n output.motion.x[timestamp] = globalAccX;\r\n output.motion.y[timestamp] = globalAccY;\r\n output.motion.z[timestamp] = globalAccZ;\r\n ctSetCookieSec(\"abpct_hyro_acc_collect\", JSON.stringify(output))\r\n }, 1000 );\r\n setTimeout( function(){\r\n clearInterval( collect );\r\n }, 10000 );\r\n\r\n if (window.DeviceOrientationEvent) {\r\n apbct_attach_event_handler(window, \"deviceorientation\", handleOrientation);\r\n }\r\n if (window.DeviceMotionEvent) {\r\n apbct_attach_event_handler(window, \"devicemotion\", handleMotion);\r\n }\r\n\r\n\t// Ready function\r\n\tfunction apbct_ready(){\r\n\t\tctSetCookieSec(\"apbct_visible_fields\", 0);\r\n\t\tctSetCookieSec(\"apbct_visible_fields_count\", 0);\r\n\t\tsetTimeout(function(){\r\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\r\n\t\t\t\tvar form = document.forms[i];\r\n\r\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\r\n\t\t\t\tform.onsubmit = function(event){\r\n\r\n\t\t\t\t\t// Get only fields\r\n\t\t\t\t\tvar elements = [];\r\n\t\t\t\t\tfor(var key in this.elements){\r\n\t\t\t\t\t\tif(!isNaN(+key))\r\n\t\t\t\t\t\t\telements[key] = this.elements[key];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Filter fields\r\n\t\t\t\t\telements = elements.filter(function(elem){\r\n\r\n\t\t\t\t\t\tvar pass = true;\r\n\r\n\t\t\t\t\t\t// Filter fields\r\n\t\t\t\t\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\r\n\t\t\t\t\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\r\n\t\t\t\t\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\r\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\r\n\t\t\t\t\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\r\n\t\t\t\t\t\t\telem.value === \"\" || // empty value\r\n\t\t\t\t\t\t\telem.getAttribute('name') === null\r\n\t\t\t\t\t\t){\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Filter elements with same names for type == radio\r\n\t\t\t\t\t\tif(elem.getAttribute(\"type\") === \"radio\"){\r\n\t\t\t\t\t\t\telements.forEach(function(el, j, els){\r\n\t\t\t\t\t\t\t\tif(elem.getAttribute('name') === el.getAttribute('name')){\r\n\t\t\t\t\t\t\t\t\tpass = false;\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t// Visible fields count\r\n\t\t\t\t\tvar visible_fields_count = elements.length;\r\n\r\n\t\t\t\t\t// Visible fields\r\n\t\t\t\t\tvar visible_fields = '';\r\n\t\t\t\t\telements.forEach(function(elem, i, elements){\r\n\t\t\t\t\t\tvisible_fields += \" \" + elem.getAttribute(\"name\");\r\n\t\t\t\t\t});\r\n\t\t\t\t\tvisible_fields = visible_fields.trim();\r\n\r\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields\", visible_fields);\r\n\t\t\t\t\tctSetCookieSec(\"apbct_visible_fields_count\", visible_fields_count);\r\n\r\n\t\t\t\t\t// Call previous submit action\r\n\t\t\t\t\tif(event.target.onsubmit_prev instanceof Function){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\r\n\t\t\t\t\t\t}, 500);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}, 1000);\r\n\t}\r\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\r\n\r\n\t//(function(open) {\r\n\t// XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {\r\n\t// this.addEventListener(\"readystatechange\", function() {\r\n\t// }, false);\r\n\t// open.call(this, method, url, async, user, pass);\r\n\t// };\r\n\t//})(XMLHttpRequest.prototype.open);\r\n\r\n}());\r\n\r\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\r\n\tif (document.getElementById(params.input_name) !== null) {\r\n\t\tvar ct_input_value = document.getElementById(params.input_name).value;\r\n\t\tdocument.getElementById(params.input_name).value = document.getElementById(params.input_name).value.replace(ct_input_value, result.js_key);\r\n\t}\r\n}\r\n\r\nif(typeof jQuery !== 'undefined') {\r\n\r\n\t// Capturing responses and output block message for unknown AJAX forms\r\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\r\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\r\n\t\t\tvar response = JSON.parse(xhr.responseText);\r\n\t\t\tif (typeof response.apbct !== 'undefined') {\r\n\t\t\t\tvar response = response.apbct;\r\n\t\t\t\tif (response.blocked) {\r\n\t\t\t\t\talert(response.comment);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tfunction apbct_sendAJAXRequest(data, params, obj) {\r\n\r\n\t\t// Default params\r\n\t\tvar callback = params.callback || null;\r\n\t\tvar notJson = params.notJson || null;\r\n\t\tvar timeout = params.timeout || 15000;\r\n\t\tvar obj = obj || null;\r\n\r\n\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\r\n\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: ctPublic._ajax_url,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function (result) {\r\n\t\t\t\tif (!notJson) result = JSON.parse(result);\r\n\t\t\t\tif (result.error) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (callback)\r\n\t\t\t\t\t\tcallback(result, data, params, obj);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function (jqXHR, textStatus, errorThrown) {\r\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\r\n\t\t\t\tconsole.log(data);\r\n\t\t\t\tconsole.log(jqXHR);\r\n\t\t\t\tconsole.log(textStatus);\r\n\t\t\t\tconsole.log(errorThrown);\r\n\t\t\t},\r\n\t\t\ttimeout: timeout\r\n\t\t});\r\n\t}\r\n}"]}
js/cleantalk-admin-settings-page.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function apbct_get_elems(e){for(var t,n=0,c=(e=e.split(",")).length;n<c;n++)t=jQuery("#"+e[n]),e[n]=0===t.length?jQuery("."+e[n]):t;return e}function apbct_show_hide_elem(e){for(var t=0,n=(e=apbct_get_elems(e)).length;t<n;t++)e[t].each(function(e,t){var n=(t=jQuery(t)).next("label")||t.prev("label")||null;t.is(":visible")?(t.hide(),n&&n.hide()):(t.show(),n&&n.show())})}function apbctSettingsDependencies(e){for(var t=0,n=(e=apbct_get_elems(e)).length;t<n;t++)e[t].each(function(e,t){apbct_toggleAtrribute(jQuery(t),"disabled")})}function apbct_toggleAtrribute(e,t,n){n=n||t,void 0===e.attr(t)?e.attr(t,n):e.removeAttr(t)}function apbct_settings__showDescription(e,t){var i=function(e){void 0!==e&&(0!=jQuery(e.target).parent(".apbct_long_desc").length&&!jQuery(e.target).hasClass("apbct_long_desc__cancel")||jQuery(e.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",i))};i(),e.after("<div id='apbct_long_desc__"+t+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+t);n.append("<i class='icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:e.position().top-5,left:e.position().left+25}),apbct_sendAJAX({action:"apbct_settings__get_description",setting_id:t},{spinner:n.children("img"),callback:function(e,t,n,c){c.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+e.title+"</h3>").append("<p>"+e.desc+"</p>"),jQuery(document).on("click",i)}},n)}jQuery(document).ready(function(){jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var e=new Date;jQuery("#ct_admin_timezone").val(e.getTimezoneOffset()/60*-1),jQuery("#apbct_gdpr_open_modal").on("click",function(){jQuery("#gdpr_dialog").dialog({modal:!0,show:!0,position:{my:"center",at:"center",of:window},width:+jQuery("#wpbody").width()/100*70,height:"auto",title:"GDPR compliance",draggable:!1,resizable:!1,closeText:"Close"})}),jQuery(document).on("click",".apbct_settings-long_description---show",function(){self=jQuery(this),apbct_settings__showDescription(self,self.attr("setting"))})});
2
- //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
1
+ function apbct_get_elems(e){for(var t,n=0,i=(e=e.split(",")).length;n<i;n++)t=jQuery("#"+e[n]),e[n]=0===t.length?jQuery("."+e[n]):t;return e}function apbct_get_elems__native(e){"string"==typeof e&&(e=e.split(","));var c=[];return e.forEach(function(e,t,n){var i=document.getElementById(e);if(null===i){if(null!==(i=document.getElementsByClassName(e))&&0!==i.length)for(key in i)0<=+key&&c.push(i[key])}else c.push(i[key])}),c}function apbct_show_hide_elem(e){for(var t=0,n=(e=apbct_get_elems(e)).length;t<n;t++)e[t].each(function(e,t){var n=(t=jQuery(t)).next("label")||t.prev("label")||null;t.is(":visible")?(t.hide(),n&&n.hide()):(t.show(),n&&n.show())})}function apbctSettingsDependencies(e,a){a=+a||null,apbct_get_elems__native(e).forEach(function(e,t,n){function i(){console.log(e),e.setAttribute("disabled","disabled")}function c(){e.removeAttribute("disabled")}null!==a?1===a?c():i():null===e.getAttribute("disabled")?i():c()})}function apbct_settings__showDescription(e,t){var c=function(e){void 0!==e&&(0!=jQuery(e.target).parent(".apbct_long_desc").length&&!jQuery(e.target).hasClass("apbct_long_desc__cancel")||jQuery(e.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))};c(),e.after("<div id='apbct_long_desc__"+t+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+t);n.append("<i class='icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:e.position().top-5,left:e.position().left+25}),apbct_sendAJAX({action:"apbct_settings__get_description",setting_id:t},{spinner:n.children("img"),callback:function(e,t,n,i){i.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+e.title+"</h3>").append("<p>"+e.desc+"</p>"),jQuery(document).on("click",c)}},n)}jQuery(document).ready(function(){jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var e=new Date;jQuery("#ct_admin_timezone").val(e.getTimezoneOffset()/60*-1),jQuery("#apbct_gdpr_open_modal").on("click",function(){jQuery("#gdpr_dialog").dialog({modal:!0,show:!0,position:{my:"center",at:"center",of:window},width:+jQuery("#wpbody").width()/100*70,height:"auto",title:"GDPR compliance",draggable:!1,resizable:!1,closeText:"Close"})}),jQuery(document).on("click",".apbct_settings-long_description---show",function(){self=jQuery(this),apbct_settings__showDescription(self,self.attr("setting"))})});
2
+ //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
js/cleantalk-admin-settings-page.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["cleantalk-admin-settings-page.js"],"names":["apbct_get_elems","elems","tmp","i","len","split","length","jQuery","apbct_show_hide_elem","each","elem","label","next","prev","is","hide","show","apbctSettingsDependencies","apbct_toggleAtrribute","attribute","value","attr","removeAttr","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","document","off","after","obj","append","css","top","position","left","apbct_sendAJAX","action","spinner","children","callback","result","data","params","empty","title","desc","on","ready","val","this","fadeOut","d","Date","getTimezoneOffset","dialog","modal","my","at","of","window","width","height","draggable","resizable","closeText","self"],"mappings":"AAkCA,SAASA,gBAAgBC,GAErB,IAAK,IAA6BC,EAAzBC,EAAE,EAAGC,GADdH,EAAQA,EAAMI,MAAM,MACMC,OAAaH,EAAIC,EAAKD,IAC5CD,EAAMK,OAAO,IAAIN,EAAME,IACvBF,EAAME,GAAoB,IAAfD,EAAII,OAAeC,OAAO,IAAIN,EAAME,IAAMD,EAEzD,OAAOD,EAIX,SAASO,qBAAqBP,GAE1B,IAAK,IAAIE,EAAE,EAAGC,GADjBH,EAAQD,gBAAgBC,IACKK,OAAQH,EAAIC,EAAKD,IACvCF,EAAME,GAAGM,KAAK,SAAUN,EAAGO,GAEvB,IAAIC,GADJD,EAAOH,OAAOG,IACGE,KAAK,UAAYF,EAAKG,KAAK,UAAY,KACpDH,EAAKI,GAAG,aACRJ,EAAKK,OACDJ,GAAOA,EAAMI,SAEjBL,EAAKM,OACDL,GAAOA,EAAMK,UAWjC,SAASC,0BAA0BhB,GAE/B,IAAK,IAAIE,EAAE,EAAGC,GADdH,EAAQD,gBAAgBC,IACEK,OAAQH,EAAIC,EAAKD,IACvCF,EAAME,GAAGM,KAAK,SAAUN,EAAGO,GACvBQ,sBAAsBX,OAAOG,GAAO,cAYhD,SAASQ,sBAAsBR,EAAMS,EAAWC,GAC5CA,EAAQA,GAASD,OACkB,IAAzBT,EAAKW,KAAKF,GAChBT,EAAKW,KAAKF,EAAWC,GAErBV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C3CC,OAAQ,OACRjB,MAAO,kBACPkB,WAAW,EACXC,WAAW,EACXC,UAAW,YAIb9D,OAAOwB,UAAUoB,GAAG,QAAS,0CAA2C,WACvEmB,KAAO/D,OAAO+C,MACd/B,gCAAgC+C,KAAMA,KAAKjD,KAAK","file":"cleantalk-admin-settings-page.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\r\n // Show/Hide access key\r\n jQuery('#apbct_showApiKey').on('click', function(){\r\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\r\n jQuery('.apbct_setting---apikey+div').show();\r\n jQuery(this).fadeOut(300);\r\n });\r\n\r\n\tvar d = new Date();\r\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\r\n\t\r\n\t// GDPR modal window\r\n\tjQuery('#apbct_gdpr_open_modal').on('click', function(){\r\n\t\tjQuery('#gdpr_dialog').dialog({\r\n\t\t\tmodal:true, \r\n\t\t\tshow: true,\r\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\r\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\r\n\t\t\theight: 'auto',\r\n\t\t\ttitle: 'GDPR compliance',\r\n\t\t\tdraggable: false,\r\n\t\t\tresizable: false,\r\n\t\t\tcloseText: \"Close\",\r\n\t\t});\r\n\t});\r\n\r\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\r\n\t\tself = jQuery(this);\r\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\r\n\t});\r\n\r\n});\r\n\r\nfunction apbct_get_elems(elems){\r\n elems = elems.split(',');\r\n for( var i=0, len = elems.length, tmp; i < len; i++){\r\n tmp = jQuery('#'+elems[i]);\r\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\r\n }\r\n return elems;\r\n\r\n}\r\n\r\nfunction apbct_show_hide_elem(elems){\r\n\telems = apbct_get_elems(elems);\r\n for( var i=0, len = elems.length; i < len; i++){\r\n elems[i].each(function (i, elem) {\r\n elem = jQuery(elem);\r\n var label = elem.next('label') || elem.prev('label') || null;\r\n if (elem.is(\":visible\")) {\r\n elem.hide();\r\n if (label) label.hide();\r\n } else {\r\n elem.show();\r\n if (label) label.show();\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Settings dependences\r\n *\r\n * @param elems CSS selector\r\n */\r\nfunction apbctSettingsDependencies(elems){\r\n elems = apbct_get_elems(elems);\r\n for( var i=0, len = elems.length; i < len; i++){\r\n elems[i].each(function (i, elem) {\r\n apbct_toggleAtrribute(jQuery(elem), 'disabled');\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Toggle attribute 'disabled' for elements\r\n *\r\n * @param elem\r\n * @param attribute\r\n * @param value\r\n */\r\nfunction apbct_toggleAtrribute(elem, attribute, value){\r\n value = value || attribute;\r\n if(typeof elem.attr(attribute) === 'undefined')\r\n elem.attr(attribute, value);\r\n else\r\n elem.removeAttr(attribute);\r\n}\r\n\r\nfunction apbct_settings__showDescription(label, setting_id){\r\n\r\n\tvar remove_desc_func = function(e){\r\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\r\n\t\t\tjQuery('.apbct_long_desc').remove();\r\n\t\t\tjQuery(document).off('click', remove_desc_func);\r\n\t\t}\r\n\t};\r\n\r\n\tremove_desc_func();\r\n\r\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\r\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\r\n\tobj.append(\"<i class='icon-spin1 animate-spin'></i>\")\r\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\r\n\t\t.css({\r\n\t\t\ttop: label.position().top - 5,\r\n\t\t\tleft: label.position().left + 25\r\n\t\t});\r\n\r\n\r\n\tapbct_sendAJAX(\r\n\t\t{action: 'apbct_settings__get_description', setting_id: setting_id},\r\n\t\t{\r\n\t\t\tspinner: obj.children('img'),\r\n\t\t\tcallback: function(result, data, params, obj){\r\n\r\n\t\t\t\tobj.empty()\r\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\r\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel icon-cancel'></i>\")\r\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\r\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\r\n\r\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\r\n\t\t\t}\r\n\t\t},\r\n\t\tobj\r\n\t);\r\n}"]}
1
+ {"version":3,"sources":["cleantalk-admin-settings-page.js"],"names":["apbct_get_elems","elems","tmp","i","len","split","length","jQuery","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","getElementsByClassName","key","push","apbct_show_hide_elem","each","label","next","prev","is","hide","show","apbctSettingsDependencies","ids","enable","do_disable","console","log","setAttribute","do_enable","removeAttribute","getAttribute","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","obj","append","css","top","position","left","apbct_sendAJAX","action","spinner","children","callback","result","data","params","empty","title","desc","on","ready","val","attr","this","fadeOut","d","Date","getTimezoneOffset","dialog","modal","my","at","of","window","width","height","draggable","resizable","closeText","self"],"mappings":"AAyCA,SAASA,gBAAgBC,GAErB,IAAK,IAA6BC,EAAzBC,EAAE,EAAGC,GADdH,EAAQA,EAAMI,MAAM,MACMC,OAAaH,EAAIC,EAAKD,IAC5CD,EAAMK,OAAO,IAAIN,EAAME,IACvBF,EAAME,GAAoB,IAAfD,EAAII,OAAeC,OAAO,IAAIN,EAAME,IAAMD,EAEzD,OAAOD,EAUX,SAASO,wBAAwBP,GAGZ,iBAAVA,IACTA,EAAQA,EAAMI,MAAM,MAErB,IAAII,EAAM,GAuBV,OArBAR,EAAMS,QAAQ,SAASC,EAAMR,EAAGS,GAG/B,IAAIV,EAAMW,SAASC,eAAeH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IAAM,EAC5BE,KAAM/B,EAAM8B,WAAWC,KAAO,KAIhCC,eACC,CAACC,OAAQ,kCAAmChB,WAAYA,GACxD,CACCiB,QAASR,EAAIS,SAAS,OACtBC,SAAU,SAASC,EAAQC,EAAMC,EAAQb,GAExCA,EAAIc,QACFb,OAAO,8CACPA,OAAO,uDACPA,OAAO,sCAAsCU,EAAOI,MAAM,SAC1Dd,OAAO,MAAMU,EAAOK,KAAK,QAE3BvD,OAAOM,UAAUkD,GAAG,QAASzB,KAG/BQ,GA7KFvC,OAAOM,UAAUmD,MAAM,WAGnBzD,OAAO,qBAAqBwD,GAAG,QAAS,WACpCxD,OAAO,2BAA2B0D,IAAI1D,OAAO,2BAA2B2D,KAAK,QAC7E3D,OAAO,+BAA+BkB,OACtClB,OAAO4D,MAAMC,QAAQ,OAG5B,IAAIC,EAAI,IAAIC,KACZ/D,OAAO,sBAAsB0D,IAAII,EAAEE,oBAAoB,IAAK,GAG5DhE,OAAO,0BAA0BwD,GAAG,QAAS,WAC5CxD,OAAO,gBAAgBiE,OAAO,CAC7BC,OAAM,EACNhD,MAAM,EACNyB,SAAU,CAAEwB,GAAI,SAAUC,GAAI,SAAUC,GAAIC,QAC5CC,OAASvE,OAAO,WAAWuE,QAAU,IAAM,GAC3CC,OAAQ,OACRlB,MAAO,kBACPmB,WAAW,EACXC,WAAW,EACXC,UAAW,YAIb3E,OAAOM,UAAUkD,GAAG,QAAS,0CAA2C,WACvEoB,KAAO5E,OAAO4D,MACd/B,gCAAgC+C,KAAMA,KAAKjB,KAAK","file":"cleantalk-admin-settings-page.min.js","sourcesContent":["jQuery(document).ready(function(){\r\n\r\n // Show/Hide access key\r\n jQuery('#apbct_showApiKey').on('click', function(){\r\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\r\n jQuery('.apbct_setting---apikey+div').show();\r\n jQuery(this).fadeOut(300);\r\n });\r\n\r\n\tvar d = new Date();\r\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\r\n\t\r\n\t// GDPR modal window\r\n\tjQuery('#apbct_gdpr_open_modal').on('click', function(){\r\n\t\tjQuery('#gdpr_dialog').dialog({\r\n\t\t\tmodal:true, \r\n\t\t\tshow: true,\r\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\r\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\r\n\t\t\theight: 'auto',\r\n\t\t\ttitle: 'GDPR compliance',\r\n\t\t\tdraggable: false,\r\n\t\t\tresizable: false,\r\n\t\t\tcloseText: \"Close\",\r\n\t\t});\r\n\t});\r\n\r\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\r\n\t\tself = jQuery(this);\r\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\r\n\t});\r\n\r\n});\r\n\r\n/**\r\n * Select elems like #{selector} or .{selector}\r\n * Selector passed in string separated by ,\r\n *\r\n * @param elems\r\n * @returns {*}\r\n */\r\nfunction apbct_get_elems(elems){\r\n elems = elems.split(',');\r\n for( var i=0, len = elems.length, tmp; i < len; i++){\r\n tmp = jQuery('#'+elems[i]);\r\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\r\n }\r\n return elems;\r\n}\r\n\r\n/**\r\n * Select elems like #{selector} or .{selector}\r\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\r\n *\r\n * @param elems string|array\r\n * @returns array\r\n */\r\nfunction apbct_get_elems__native(elems){\r\n\r\n\t// Make array from a string\r\n\tif(typeof elems === 'string')\r\n\t\telems = elems.split(',');\r\n\r\n\tvar out = [];\r\n\r\n\telems.forEach(function(elem, i, arr) {\r\n\r\n\t\t// try to get elements with such IDs\r\n\t\tvar tmp = document.getElementById(elem);\r\n\t\tif (tmp !== null){\r\n\t\t\tout.push( tmp[key] );\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to get elements with such class name\r\n\t\t// write each elem from collection to new element of outpur array\r\n\t\ttmp = document.getElementsByClassName(elem);\r\n\t\tif (tmp !== null && tmp.length !==0 ){\r\n\t\t\tfor(key in tmp){\r\n\t\t\t\tif( +key >= 0 ){\r\n\t\t\t\t\tout.push( tmp[key] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\treturn out;\r\n}\r\n\r\nfunction apbct_show_hide_elem(elems){\r\n\telems = apbct_get_elems(elems);\r\n for( var i=0, len = elems.length; i < len; i++){\r\n elems[i].each(function (i, elem) {\r\n elem = jQuery(elem);\r\n var label = elem.next('label') || elem.prev('label') || null;\r\n if (elem.is(\":visible\")) {\r\n elem.hide();\r\n if (label) label.hide();\r\n } else {\r\n elem.show();\r\n if (label) label.show();\r\n }\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\r\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\r\n *\r\n * @param ids string|array Selectors\r\n * @param enable\r\n */\r\nfunction apbctSettingsDependencies(ids, enable){\r\n\r\n\tenable = +enable || null;\r\n\r\n\t// Get elements\r\n\tvar elems = apbct_get_elems__native( ids );\r\n\r\n\telems.forEach(function(elem, i, arr){\r\n\r\n\t\tvar do_disable = function(){console.log( elem ); elem.setAttribute('disabled', 'disabled');},\r\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\r\n\r\n\t\t// Set defined state\r\n\t\tif(enable !== null) // Set\r\n\t\t\tenable === 1 ? do_enable() : do_disable();\r\n\r\n\t\t// Toggle\r\n\t\telse{\r\n\t\t\telem.getAttribute('disabled') === null ? do_disable() : do_enable();\r\n\t\t}\r\n\r\n\t});\r\n}\r\n\r\nfunction apbct_settings__showDescription(label, setting_id){\r\n\r\n\tvar remove_desc_func = function(e){\r\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\r\n\t\t\tjQuery('.apbct_long_desc').remove();\r\n\t\t\tjQuery(document).off('click', remove_desc_func);\r\n\t\t}\r\n\t};\r\n\r\n\tremove_desc_func();\r\n\r\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\r\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\r\n\tobj.append(\"<i class='icon-spin1 animate-spin'></i>\")\r\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\r\n\t\t.css({\r\n\t\t\ttop: label.position().top - 5,\r\n\t\t\tleft: label.position().left + 25\r\n\t\t});\r\n\r\n\r\n\tapbct_sendAJAX(\r\n\t\t{action: 'apbct_settings__get_description', setting_id: setting_id},\r\n\t\t{\r\n\t\t\tspinner: obj.children('img'),\r\n\t\t\tcallback: function(result, data, params, obj){\r\n\r\n\t\t\t\tobj.empty()\r\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\r\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel icon-cancel'></i>\")\r\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\r\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\r\n\r\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\r\n\t\t\t}\r\n\t\t},\r\n\t\tobj\r\n\t);\r\n}"]}
lib/Cleantalk/Antispam/Helper.php CHANGED
@@ -75,7 +75,7 @@ class Helper
75
  if(isset($ips['remote_addr'])){
76
  $ip_type = self::ip__validate( isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' );
77
  if($ip_type){
78
- $ips['remote_addr'] = $ip_type == 'v6' ? self::ip__v6_normalize(isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' ) : isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '';
79
  }
80
  }
81
 
75
  if(isset($ips['remote_addr'])){
76
  $ip_type = self::ip__validate( isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' );
77
  if($ip_type){
78
+ $ips['remote_addr'] = ($ip_type == 'v6' ? self::ip__v6_normalize(isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' ) : isset( $_SERVER['REMOTE_ADDR'] )) ? $_SERVER['REMOTE_ADDR'] : '';
79
  }
80
  }
81
 
lib/CleantalkRequest.php CHANGED
@@ -177,9 +177,16 @@ class CleantalkRequest {
177
  $this->post_info = isset($params['post_info']) ? (string)json_encode($params['post_info']) : null;
178
  $this->sender_info = isset($params['sender_info']) ? (string)json_encode($params['sender_info']) : null;
179
 
180
- // Message
181
- $this->message = !empty($params['message']) ? serialize($params['message']) : null;
182
- $this->example = !empty($params['example']) ? serialize($params['example']) : null;
 
 
 
 
 
 
 
183
 
184
  // Feedback
185
  $this->feedback = !empty($params['feedback']) ? $params['feedback'] : null;
177
  $this->post_info = isset($params['post_info']) ? (string)json_encode($params['post_info']) : null;
178
  $this->sender_info = isset($params['sender_info']) ? (string)json_encode($params['sender_info']) : null;
179
 
180
+ $this->message = ! empty( $params['message'] )
181
+ ? ( ! is_scalar( $params['message'] )
182
+ ? serialize( $params['message'] )
183
+ : $params['message'] )
184
+ : null;
185
+ $this->example = ! empty( $params['example'] )
186
+ ? ( ! is_scalar( $params['example'] )
187
+ ? serialize( $params['example'] )
188
+ : $params['example'] )
189
+ : null;
190
 
191
  // Feedback
192
  $this->feedback = !empty($params['feedback']) ? $params['feedback'] : null;
lib/CleantalkState.php CHANGED
@@ -65,6 +65,10 @@ class CleantalkState
65
  'check_internal' => 0,
66
 
67
  /* Comments and messages */
 
 
 
 
68
  'bp_private_messages' => 1, //buddyPress private messages test => ON
69
  'check_comments_number' => 1,
70
  'remove_old_spam' => 0,
65
  'check_internal' => 0,
66
 
67
  /* Comments and messages */
68
+ 'disable_comments__all' => 0,
69
+ 'disable_comments__posts' => 0,
70
+ 'disable_comments__pages' => 0,
71
+ 'disable_comments__media' => 0,
72
  'bp_private_messages' => 1, //buddyPress private messages test => ON
73
  'check_comments_number' => 1,
74
  'remove_old_spam' => 0,
lib/cleantalk-php-patch.php CHANGED
@@ -49,23 +49,23 @@ if(!function_exists('utf8_decode')){
49
  $offset = 0;
50
  $stringlength = strlen($string);
51
  while ($offset < $stringlength) {
52
- if ((ord($string{$offset}) | 0x07) == 0xF7) {
53
- $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
54
- ((ord($string{($offset + 1)}) & 0x3F) << 12) &
55
- ((ord($string{($offset + 2)}) & 0x3F) << 6) &
56
- (ord($string{($offset + 3)}) & 0x3F);
57
  $offset += 4;
58
- } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
59
- $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
60
- ((ord($string{($offset + 1)}) & 0x3F) << 6) &
61
- (ord($string{($offset + 2)}) & 0x3F);
62
  $offset += 3;
63
- } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
64
- $charval = ((ord($string{($offset + 0)}) & 0x1F) << 6) &
65
- (ord($string{($offset + 1)}) & 0x3F);
66
  $offset += 2;
67
- } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
68
- $charval = ord($string{$offset});
69
  $offset += 1;
70
  } else {
71
  $charval = false;
49
  $offset = 0;
50
  $stringlength = strlen($string);
51
  while ($offset < $stringlength) {
52
+ if ((ord($string[$offset]) | 0x07) == 0xF7) {
53
+ $charval = ((ord($string[($offset + 0)]) & 0x07) << 18) &
54
+ ((ord($string[($offset + 1)]) & 0x3F) << 12) &
55
+ ((ord($string[($offset + 2)]) & 0x3F) << 6) &
56
+ (ord($string[($offset + 3)]) & 0x3F);
57
  $offset += 4;
58
+ } elseif ((ord($string[$offset]) | 0x0F) == 0xEF) {
59
+ $charval = ((ord($string[($offset + 0)]) & 0x0F) << 12) &
60
+ ((ord($string[($offset + 1)]) & 0x3F) << 6) &
61
+ (ord($string[($offset + 2)]) & 0x3F);
62
  $offset += 3;
63
+ } elseif ((ord($string[$offset]) | 0x1F) == 0xDF) {
64
+ $charval = ((ord($string[($offset + 0)]) & 0x1F) << 6) &
65
+ (ord($string[($offset + 1)]) & 0x3F);
66
  $offset += 2;
67
+ } elseif ((ord($string[$offset]) | 0x7F) == 0x7F) {
68
+ $charval = ord($string[$offset]);
69
  $offset += 1;
70
  } else {
71
  $charval = false;
readme.txt CHANGED
@@ -32,7 +32,8 @@ No CAPTCHA, no questions, no animal counting, no puzzles, no math and no spam bo
32
  14. Blocking disposable & temporary emails.
33
  15. No Spam - No Google Penalties. Give your SEO boost.
34
  16. Mobile friendly Anti Spam & FireWall.
35
- 16. Stops spam in Search Form.
 
36
 
37
  = Public reviews =
38
  > CleanTalk - Cloud-Based Anti-Spam Service to Keep Your Site Bot-Free.
@@ -262,6 +263,16 @@ CleanTalk Anti-Spam has the option to protect your website search form from spam
262
 
263
  You will always know what users were looking for on your site.
264
 
 
 
 
 
 
 
 
 
 
 
265
  = Translations =
266
  * Albanian (sq_AL) - thanks to fjalaime https://wordpress.org/support/users/fjalaime/
267
  * French (fr_FR) - thanks to Gilles Santacreu http://net-ik.net
@@ -568,6 +579,13 @@ If your website has forms that send data to external sources, you can enable opt
568
  10. Website's options.
569
 
570
  == Changelog ==
 
 
 
 
 
 
 
571
  = 5.131 December 6 2019 =
572
  * Fix: WooCommerce registration.
573
  * Fix: Auto update on Wordperss Multisite.
32
  14. Blocking disposable & temporary emails.
33
  15. No Spam - No Google Penalties. Give your SEO boost.
34
  16. Mobile friendly Anti Spam & FireWall.
35
+ 17. Stops spam in Search Form.
36
+ 18. Disable comments.
37
 
38
  = Public reviews =
39
  > CleanTalk - Cloud-Based Anti-Spam Service to Keep Your Site Bot-Free.
263
 
264
  You will always know what users were looking for on your site.
265
 
266
+ = Disable comments =
267
+
268
+ This option disables comments on your site. You can choose one or several options:
269
+
270
+ * Disable comments for posts
271
+ * Disable comments for pages
272
+ * Disable comments for media
273
+
274
+ When using Disables comments, existing comments will not be deleted and will remain on the pages.
275
+
276
  = Translations =
277
  * Albanian (sq_AL) - thanks to fjalaime https://wordpress.org/support/users/fjalaime/
278
  * French (fr_FR) - thanks to Gilles Santacreu http://net-ik.net
579
  10. Website's options.
580
 
581
  == Changelog ==
582
+ = 5.132 December 17 2019 =
583
+ * Fix: PHP 7.4 compability
584
+ * New: Settings and description for "disable comments" functionality.
585
+ * Mod: WooCommerce settings moved to separate block.
586
+ * Minor fixes.
587
+ * Spam protection improved.
588
+
589
  = 5.131 December 6 2019 =
590
  * Fix: WooCommerce registration.
591
  * Fix: Auto update on Wordperss Multisite.
templates/daily_report.php CHANGED
@@ -14,13 +14,13 @@ $msg_template = <<<EOT
14
  </div>
15
  <br />
16
  <div>
17
- <a class='ct_settings_button' href='http://%s/wp-admin/%s.php?page=cleantalk&from_report=1' target="_blank">%s</a>
18
  </div>
19
  <span>%s</span>
20
  <br />
21
  <br />
22
  <div style="color: #666;">
23
- The report is provided by <a href="http://%s/wp-admin/%s.php?page=cleantalk&from_report=1">%s</a>.
24
  </div>
25
  </center>
26
  </body>
14
  </div>
15
  <br />
16
  <div>
17
+ <a class='ct_settings_button' href='https://%s/wp-admin/%s.php?page=cleantalk&from_report=1' target="_blank">%s</a>
18
  </div>
19
  <span>%s</span>
20
  <br />
21
  <br />
22
  <div style="color: #666;">
23
+ The report is provided by <a href="https://%s/wp-admin/%s.php?page=cleantalk&from_report=1">%s</a>.
24
  </div>
25
  </center>
26
  </body>