Spam protection, AntiSpam, FireWall by CleanTalk - Version 5.164

Version Description

Oct 21 2021 = * New: Integration. UsersWP plugin integration implemented. * New. SFW. Incompatibility WP-Rocket notice added. * New: Settings. Advanced settings navigation implemented. * New: Server variables. isSSL method added. * Mod: Added the functionality of changing the mail when receiving the key during the initial installation. * Mod: Custom admin email. Added minified js and css files * Mod: validate api key before save settings for new accounts * Mod: Antispam. Comments check. Send feedback with hash:01:url data only if post_info->post_url is empty. * Fix: State. Option prefix field is public now. * Fix: Using get_option('home') for getting the blog url instead get_option('siteurl'). * Fix: State. Magic _get notice fixed. * Fix. State. Exclamation mark fixed. * Fix. Common. Getting REST url fixed. * Fix: SFW. Update percents fixed. * Fix: DB. isTableExists method fixed. * Fix. State. $errors field added. * Fix: Server::getDomain(). Fixed regexp. * Fix: skip log-in request wpstg. * Fix: SFW. Work on hosting licenses fixed. * Fix: set prefix_name for cleantalk-icons css. * Fix: Helper. Hard use https for the curl requests. * Fix: Helper. Home url slash added. * Fix: SFW. Using direct updating if remote calls not working. * Fix: Settings. Save button z-index added. * Fix: Admin bar. Exclamation mark style fixed. * Fix: Settings. Api key description on active IP license added. * Fix: Sender info. Getting pageurl on ajax/rest requests fixed.

Download this release

Release Info

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

Code changes from version 5.163.1 to 5.164

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.163.1
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
@@ -666,7 +666,7 @@ function apbct_sfw__check()
666
  'sfw_counter' => $apbct->settings['admin_bar__sfw_counter'],
667
  'api_key' => $apbct->api_key,
668
  'apbct' => $apbct,
669
- 'cookie_domain' => parse_url(get_option('siteurl'), PHP_URL_HOST),
670
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
671
  )
672
  )
@@ -848,7 +848,15 @@ function apbct_sfw_update__init($delay = 0)
848
  $apbct->fw_stats['updating_folder'] = APBCT_DIR_PATH . DIRECTORY_SEPARATOR . 'fw_files_for_blog_' . get_current_blog_id() . DIRECTORY_SEPARATOR;
849
 
850
  $prepare_dir__result = apbct_prepare_upd_dir();
851
- if ( ! empty($prepare_dir__result['error']) ) {
 
 
 
 
 
 
 
 
852
  return apbct_sfw_direct_update();
853
  }
854
 
@@ -992,7 +1000,7 @@ function apbct_sfw_update__get_multifiles()
992
  $urls[] = $value[0];
993
  }
994
 
995
- $apbct->fw_stats['firewall_update_percent'] = 100 / count($urls);
996
  $apbct->save('fw_stats');
997
 
998
  return array(
@@ -1112,7 +1120,7 @@ function apbct_sfw_update__process_files()
1112
  return $result;
1113
  }
1114
 
1115
- $apbct->fw_stats['firewall_update_percent'] = round(100 / count($files), 2) * 100;
1116
  $apbct->save('fw_stats');
1117
 
1118
  return array(
@@ -1826,7 +1834,7 @@ function apbct_rc__update()
1826
  );
1827
  }
1828
 
1829
- $httpResponseCode = Helper::httpRequest(get_option('siteurl'), array(), 'get_code');
1830
 
1831
  if ( strpos($httpResponseCode, '200') === false ) {
1832
  apbct_maintenance_mode__enable(30);
@@ -1850,7 +1858,7 @@ function apbct_rc__update()
1850
  $response = array(
1851
  'error' => 'BAD_HTTP_CODE',
1852
  'http_code' => $httpResponseCode,
1853
- 'output' => substr(file_get_contents(get_option('siteurl')), 0, 900),
1854
  'rollback_result' => $rollback->apbct_result,
1855
  );
1856
 
@@ -1910,7 +1918,7 @@ function apbct_rc__insert_auth_key($key, $plugin)
1910
  if ( $key && preg_match('/^[a-z\d]{3,15}$/', $key) ) {
1911
  $result = API::methodNoticePaidTill(
1912
  $key,
1913
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1), // Site URL
1914
  'security'
1915
  );
1916
 
@@ -2057,7 +2065,7 @@ function apbct_store__urls()
2057
  // Get current url
2058
  $current_url = Server::get('HTTP_HOST') . Server::get('REQUEST_URI');
2059
  $current_url = $current_url ? substr($current_url, 0, 128) : 'UNKNOWN';
2060
- $site_url = parse_url(get_option('siteurl'), PHP_URL_HOST);
2061
 
2062
  // Get already stored URLs
2063
  $urls = Cookie::get('apbct_urls', array(), 'array');
@@ -2242,7 +2250,7 @@ function ct_account_status_check($api_key = null, $process_errors = true)
2242
  $api_key = $api_key ?: $apbct->api_key;
2243
  $result = API::methodNoticePaidTill(
2244
  $api_key,
2245
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
2246
  ! is_main_site() && $apbct->white_label ? 'anti-spam-hosting' : 'antispam'
2247
  );
2248
 
@@ -2328,7 +2336,7 @@ function ct_mail_send_connection_report()
2328
  $message .= '</table></body></html>';
2329
 
2330
  $headers = "Content-type: text/html; charset=windows-1251 \r\n";
2331
- $headers .= 'From: ' . get_option('admin_email');
2332
  mail($to, $subject, $message, $headers);
2333
  }
2334
 
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.164
8
  Author: СleanTalk <welcome@cleantalk.org>
9
  Author URI: https://cleantalk.org
10
  Text Domain: cleantalk-spam-protect
666
  'sfw_counter' => $apbct->settings['admin_bar__sfw_counter'],
667
  'api_key' => $apbct->api_key,
668
  'apbct' => $apbct,
669
+ 'cookie_domain' => parse_url(get_option('home'), PHP_URL_HOST),
670
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
671
  )
672
  )
848
  $apbct->fw_stats['updating_folder'] = APBCT_DIR_PATH . DIRECTORY_SEPARATOR . 'fw_files_for_blog_' . get_current_blog_id() . DIRECTORY_SEPARATOR;
849
 
850
  $prepare_dir__result = apbct_prepare_upd_dir();
851
+ $test_rc_result = Helper::httpRequestRcToHostTest(
852
+ 'sfw_update__worker',
853
+ array(
854
+ 'spbc_remote_call_token' => md5($apbct->api_key),
855
+ 'spbc_remote_call_action' => 'sfw_update__worker',
856
+ 'plugin_name' => 'apbct'
857
+ )
858
+ );
859
+ if ( ! empty($prepare_dir__result['error']) || ! empty($test_rc_result['error']) ) {
860
  return apbct_sfw_direct_update();
861
  }
862
 
1000
  $urls[] = $value[0];
1001
  }
1002
 
1003
+ $apbct->fw_stats['firewall_update_percent'] = round(100 / count($urls), 2);
1004
  $apbct->save('fw_stats');
1005
 
1006
  return array(
1120
  return $result;
1121
  }
1122
 
1123
+ $apbct->fw_stats['firewall_update_percent'] = round(100 / count($files), 2);
1124
  $apbct->save('fw_stats');
1125
 
1126
  return array(
1834
  );
1835
  }
1836
 
1837
+ $httpResponseCode = Helper::httpRequest(get_option('home'), array(), 'get_code');
1838
 
1839
  if ( strpos($httpResponseCode, '200') === false ) {
1840
  apbct_maintenance_mode__enable(30);
1858
  $response = array(
1859
  'error' => 'BAD_HTTP_CODE',
1860
  'http_code' => $httpResponseCode,
1861
+ 'output' => substr(file_get_contents(get_option('home')), 0, 900),
1862
  'rollback_result' => $rollback->apbct_result,
1863
  );
1864
 
1918
  if ( $key && preg_match('/^[a-z\d]{3,15}$/', $key) ) {
1919
  $result = API::methodNoticePaidTill(
1920
  $key,
1921
+ preg_replace('/http[s]?:\/\//', '', get_option('home'), 1), // Site URL
1922
  'security'
1923
  );
1924
 
2065
  // Get current url
2066
  $current_url = Server::get('HTTP_HOST') . Server::get('REQUEST_URI');
2067
  $current_url = $current_url ? substr($current_url, 0, 128) : 'UNKNOWN';
2068
+ $site_url = parse_url(get_option('home'), PHP_URL_HOST);
2069
 
2070
  // Get already stored URLs
2071
  $urls = Cookie::get('apbct_urls', array(), 'array');
2250
  $api_key = $api_key ?: $apbct->api_key;
2251
  $result = API::methodNoticePaidTill(
2252
  $api_key,
2253
+ preg_replace('/http[s]?:\/\//', '', get_option('home'), 1),
2254
  ! is_main_site() && $apbct->white_label ? 'anti-spam-hosting' : 'antispam'
2255
  );
2256
 
2336
  $message .= '</table></body></html>';
2337
 
2338
  $headers = "Content-type: text/html; charset=windows-1251 \r\n";
2339
+ $headers .= 'From: ' . ct_get_admin_email();
2340
  mail($to, $subject, $message, $headers);
2341
  }
2342
 
css/cleantalk-admin-settings-page.min.css CHANGED
@@ -1 +1 @@
1
- .apbct_settings-field_content,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio{width:70%}.apbct_settings-field_title--radio{display:inline-block;margin:0;width:210px;padding-right:10px;font-size:14px;vertical-align:top}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-field--api_key{font-size:14pt}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#cleantalk-modal-content,.ct_rate_block{text-align:center}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;color:rgba(120,200,230,1);margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}#cleantalk-modal-content>*{display:block;width:100%}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}
1
+ .apbct_settings-field_content,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%}.apbct_settings-field_title--radio{display:inline-block;margin:0;width:210px;padding-right:10px;font-size:14px;vertical-align:top}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-field--api_key{font-size:14pt}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#cleantalk-modal-content,.ct_rate_block{text-align:center}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;color:rgba(120,200,230,1);margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}#cleantalk-modal-content>*{display:block;width:100%}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:20px}#apbct_settings__after_advanced_settings{margin-bottom:20px}#apbct_settings__button_section{position:fixed;z-index:9999;width:100%;padding-bottom:20px}
css/cleantalk-admin.min.css CHANGED
@@ -1 +1 @@
1
- :disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.ct_translate_links{color:rgba(150,150,20,1)}.ct_support_links{color:rgba(150,20,20,1)}.ct_faq_links{color:rgba(20,150,20,1)}.ct_setting_links{color:rgba(20,20,150,1)}.ct_translate_links:hover{color:rgba(210,210,20,1)!important}.ct_support_links:hover{color:rgba(250,20,20,1)!important}.ct_faq_links:hover{color:rgba(20,250,20,1)!important}.ct_setting_links:hover{color:rgba(20,20,250,1)!important}.ct_link_new_tab img{float:none!important;margin:0 2px;border:0}#negative_reports_table tr td{padding:7px 5px!important}#apbct_gdpr_open_modal:hover{cursor:pointer}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div{cursor:not-allowed!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}
1
+ :disabled{cursor:not-allowed!important}.apbct_color--gray{color:gray}.apbct_display--none{display:none}.ct_translate_links{color:rgba(150,150,20,1)}.ct_support_links{color:rgba(150,20,20,1)}.ct_faq_links{color:rgba(20,150,20,1)}.ct_setting_links{color:rgba(20,20,150,1)}.ct_translate_links:hover{color:rgba(210,210,20,1)!important}.ct_support_links:hover{color:rgba(250,20,20,1)!important}.ct_faq_links:hover{color:rgba(20,250,20,1)!important}.ct_setting_links:hover{color:rgba(20,20,250,1)!important}.ct_link_new_tab img{float:none!important;margin:0 2px;border:0}#negative_reports_table tr td{padding:7px 5px!important}#apbct_gdpr_open_modal:hover{cursor:pointer}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node span{display:inline-block}#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}.cleantalk_admin_bar__blocked div{cursor:not-allowed!important}.cleantalk_admin_bar__blocked div a{color:#777!important}.cleantalk_admin_bar__title{vertical-align:top}.cleantalk_admin_bar__separator{height:0!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}
css/cleantalk-icons.min.css CHANGED
@@ -1 +1 @@
1
- @font-face{font-family:fontello;src:url(./fonts/icons/icons.eot);src:url(./fonts/icons/icons.eot) format('embedded-opentype'),url(./fonts/icons/icons.woff2) format('woff2'),url(./fonts/icons/icons.woff) format('woff'),url(./fonts/icons/icons.ttf) format('truetype'),url(./fonts/icons/icons.svg) format('svg');font-weight:400;font-style:normal}[class*=" icon-"]:before,[class^=icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-download:before{content:'\e800'}.icon-glass:before{content:'\e801'}.icon-emo-happy:before{content:'\e802'}.icon-search:before{content:'\e803'}.icon-emo-unhappy:before{content:'\e804'}.icon-mail:before{content:'\e805'}.icon-info-circled:before{content:'\e806'}.icon-help-circled:before{content:'\e807'}.icon-heart:before{content:'\e808'}.icon-heart-empty:before{content:'\e809'}.icon-star:before{content:'\e80a'}.icon-star-empty:before{content:'\e80b'}.icon-user:before{content:'\e80c'}.icon-users:before{content:'\e80d'}.icon-th-large:before{content:'\e80e'}.icon-th:before{content:'\e80f'}.icon-th-list:before{content:'\e810'}.icon-to-end:before{content:'\e811'}.icon-to-start:before{content:'\e812'}.icon-fast-fw:before{content:'\e813'}.icon-fast-bw:before{content:'\e814'}.icon-off:before{content:'\e815'}.icon-chart-bar:before{content:'\e816'}.icon-home:before{content:'\e817'}.icon-link-1:before{content:'\e818'}.icon-lock-open:before{content:'\e819'}.icon-eye:before{content:'\e81a'}.icon-eye-off:before{content:'\e81b'}.icon-download-1:before{content:'\e81c'}.icon-chat:before{content:'\e81d'}.icon-comment:before{content:'\e81e'}.icon-doc:before{content:'\e81f'}.icon-lock:before{content:'\e820'}.icon-emo-wink2:before{content:'\e821'}.icon-plus:before{content:'\e822'}.icon-upload:before{content:'\e823'}.icon-picture:before{content:'\e824'}.icon-ok:before{content:'\e825'}.icon-cancel:before{content:'\e826'}.icon-pencil:before{content:'\e827'}.icon-edit:before{content:'\e828'}.icon-forward:before{content:'\e829'}.icon-export:before{content:'\e82a'}.icon-trash-empty:before{content:'\e82b'}.icon-down-dir:before{content:'\e82c'}.icon-up-dir:before{content:'\e82d'}.icon-left-dir:before{content:'\e82e'}.icon-right-dir:before{content:'\e82f'}.icon-spin1:before{content:'\e830'}.icon-spin2:before{content:'\e831'}.icon-mobile:before{content:'\e832'}.icon-bell:before{content:'\e833'}.icon-ccw:before{content:'\e834'}.icon-wrench:before{content:'\e835'}.icon-stop-1:before{content:'\e837'}.icon-spin5:before{content:'\e838'}.icon-pause-1:before{content:'\e839'}.icon-play-1:before{content:'\e83a'}.icon-link-ext:before{content:'\f08e'}.icon-menu:before{content:'\f0c9'}.icon-sort:before{content:'\f0dc'}.icon-mail-alt:before{content:'\f0e0'}.icon-lightbulb:before{content:'\f0eb'}.icon-exchange:before{content:'\f0ec'}.icon-upload-cloud:before{content:'\f0ee'}.icon-bell-alt:before{content:'\f0f3'}.icon-doc-text:before{content:'\f0f6'}.icon-angle-double-left:before{content:'\f100'}.icon-angle-double-right:before{content:'\f101'}.icon-angle-double-up:before{content:'\f102'}.icon-angle-double-down:before{content:'\f103'}.icon-desktop:before{content:'\f108'}.icon-laptop:before{content:'\f109'}.icon-tablet:before{content:'\f10a'}.icon-circle-empty:before{content:'\f10c'}.icon-circle:before{content:'\f111'}.icon-unlink:before{content:'\f127'}.icon-help:before{content:'\f128'}.icon-info:before{content:'\f129'}.icon-attention-alt:before{content:'\f12a'}.icon-ellipsis:before{content:'\f141'}.icon-ellipsis-vert:before{content:'\f142'}.icon-euro:before{content:'\f153'}.icon-pound:before{content:'\f154'}.icon-dollar:before{content:'\f155'}.icon-rupee:before{content:'\f156'}.icon-yen:before{content:'\f157'}.icon-rouble:before{content:'\f158'}.icon-won:before{content:'\f159'}.icon-bitcoin:before{content:'\f15a'}.icon-sort-alt-up:before{content:'\f160'}.icon-sort-alt-down:before{content:'\f161'}.icon-bug:before{content:'\f188'}.icon-try:before{content:'\f195'}.icon-wordpress:before{content:'\f19a'}.icon-cubes:before{content:'\f1b3'}.icon-database:before{content:'\f1c0'}.icon-circle-thin:before{content:'\f1db'}.icon-sliders:before{content:'\f1de'}.icon-share:before{content:'\f1e0'}.icon-plug:before{content:'\f1e6'}.icon-trash:before{content:'\f1f8'}.icon-chart-line:before{content:'\f201'}.icon-shekel:before{content:'\f20b'}.icon-user-secret:before{content:'\f21b'}.icon-user-plus:before{content:'\f234'}.icon-user-times:before{content:'\f235'}.icon-viacoin:before{content:'\f237'}.icon-safari:before{content:'\f267'}.icon-chrome:before{content:'\f268'}.icon-firefox:before{content:'\f269'}.icon-opera:before{content:'\f26a'}.icon-internet-explorer:before{content:'\f26b'}.icon-television:before{content:'\f26c'}.icon-percent:before{content:'\f295'}
1
+ @font-face{font-family:fontello;src:url(./fonts/icons/icons.eot);src:url(./fonts/icons/icons.eot) format('embedded-opentype'),url(./fonts/icons/icons.woff2) format('woff2'),url(./fonts/icons/icons.woff) format('woff'),url(./fonts/icons/icons.ttf) format('truetype'),url(./fonts/icons/icons.svg) format('svg');font-weight:400;font-style:normal}[class*=" apbct-icon-"]:before,[class^=apbct-icon-]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.apbct-icon-download:before{content:'\e800'}.apbct-icon-glass:before{content:'\e801'}.apbct-icon-emo-happy:before{content:'\e802'}.apbct-icon-search:before{content:'\e803'}.apbct-icon-emo-unhappy:before{content:'\e804'}.apbct-icon-mail:before{content:'\e805'}.apbct-icon-info-circled:before{content:'\e806'}.apbct-icon-help-circled:before{content:'\e807'}.apbct-icon-heart:before{content:'\e808'}.apbct-icon-heart-empty:before{content:'\e809'}.apbct-icon-star:before{content:'\e80a'}.apbct-icon-star-empty:before{content:'\e80b'}.apbct-icon-user:before{content:'\e80c'}.apbct-icon-users:before{content:'\e80d'}.apbct-icon-th-large:before{content:'\e80e'}.apbct-icon-th:before{content:'\e80f'}.apbct-icon-th-list:before{content:'\e810'}.apbct-icon-to-end:before{content:'\e811'}.apbct-icon-to-start:before{content:'\e812'}.apbct-icon-fast-fw:before{content:'\e813'}.apbct-icon-fast-bw:before{content:'\e814'}.apbct-icon-off:before{content:'\e815'}.apbct-icon-chart-bar:before{content:'\e816'}.apbct-icon-home:before{content:'\e817'}.apbct-icon-link-1:before{content:'\e818'}.apbct-icon-lock-open:before{content:'\e819'}.apbct-icon-eye:before{content:'\e81a'}.apbct-icon-eye-off:before{content:'\e81b'}.apbct-icon-download-1:before{content:'\e81c'}.apbct-icon-chat:before{content:'\e81d'}.apbct-icon-comment:before{content:'\e81e'}.apbct-icon-doc:before{content:'\e81f'}.apbct-icon-lock:before{content:'\e820'}.apbct-icon-emo-wink2:before{content:'\e821'}.apbct-icon-plus:before{content:'\e822'}.apbct-icon-upload:before{content:'\e823'}.apbct-icon-picture:before{content:'\e824'}.apbct-icon-ok:before{content:'\e825'}.apbct-icon-cancel:before{content:'\e826'}.apbct-icon-pencil:before{content:'\e827'}.apbct-icon-edit:before{content:'\e828'}.apbct-icon-forward:before{content:'\e829'}.apbct-icon-export:before{content:'\e82a'}.apbct-icon-trash-empty:before{content:'\e82b'}.apbct-icon-down-dir:before{content:'\e82c'}.apbct-icon-up-dir:before{content:'\e82d'}.apbct-icon-left-dir:before{content:'\e82e'}.apbct-icon-right-dir:before{content:'\e82f'}.apbct-icon-spin1:before{content:'\e830'}.apbct-icon-spin2:before{content:'\e831'}.apbct-icon-mobile:before{content:'\e832'}.apbct-icon-bell:before{content:'\e833'}.apbct-icon-ccw:before{content:'\e834'}.apbct-icon-wrench:before{content:'\e835'}.apbct-icon-stop-1:before{content:'\e837'}.apbct-icon-spin5:before{content:'\e838'}.apbct-icon-pause-1:before{content:'\e839'}.apbct-icon-play-1:before{content:'\e83a'}.apbct-icon-link-ext:before{content:'\f08e'}.apbct-icon-menu:before{content:'\f0c9'}.apbct-icon-sort:before{content:'\f0dc'}.apbct-icon-mail-alt:before{content:'\f0e0'}.apbct-icon-lightbulb:before{content:'\f0eb'}.apbct-icon-exchange:before{content:'\f0ec'}.apbct-icon-upload-cloud:before{content:'\f0ee'}.apbct-icon-bell-alt:before{content:'\f0f3'}.apbct-icon-doc-text:before{content:'\f0f6'}.apbct-icon-angle-double-left:before{content:'\f100'}.apbct-icon-angle-double-right:before{content:'\f101'}.apbct-icon-angle-double-up:before{content:'\f102'}.apbct-icon-angle-double-down:before{content:'\f103'}.apbct-icon-desktop:before{content:'\f108'}.apbct-icon-laptop:before{content:'\f109'}.apbct-icon-tablet:before{content:'\f10a'}.apbct-icon-circle-empty:before{content:'\f10c'}.apbct-icon-circle:before{content:'\f111'}.apbct-icon-unlink:before{content:'\f127'}.apbct-icon-help:before{content:'\f128'}.apbct-icon-info:before{content:'\f129'}.apbct-icon-attention-alt:before{content:'\f12a'}.apbct-icon-ellipsis:before{content:'\f141'}.apbct-icon-ellipsis-vert:before{content:'\f142'}.apbct-icon-euro:before{content:'\f153'}.apbct-icon-pound:before{content:'\f154'}.apbct-icon-dollar:before{content:'\f155'}.apbct-icon-rupee:before{content:'\f156'}.apbct-icon-yen:before{content:'\f157'}.apbct-icon-rouble:before{content:'\f158'}.apbct-icon-won:before{content:'\f159'}.apbct-icon-bitcoin:before{content:'\f15a'}.apbct-icon-sort-alt-up:before{content:'\f160'}.apbct-icon-sort-alt-down:before{content:'\f161'}.apbct-icon-bug:before{content:'\f188'}.apbct-icon-try:before{content:'\f195'}.apbct-icon-wordpress:before{content:'\f19a'}.apbct-icon-cubes:before{content:'\f1b3'}.apbct-icon-database:before{content:'\f1c0'}.apbct-icon-circle-thin:before{content:'\f1db'}.apbct-icon-sliders:before{content:'\f1de'}.apbct-icon-share:before{content:'\f1e0'}.apbct-icon-plug:before{content:'\f1e6'}.apbct-icon-trash:before{content:'\f1f8'}.apbct-icon-chart-line:before{content:'\f201'}.apbct-icon-shekel:before{content:'\f20b'}.apbct-icon-user-secret:before{content:'\f21b'}.apbct-icon-user-plus:before{content:'\f234'}.apbct-icon-user-times:before{content:'\f235'}.apbct-icon-viacoin:before{content:'\f237'}.apbct-icon-safari:before{content:'\f267'}.apbct-icon-chrome:before{content:'\f268'}.apbct-icon-firefox:before{content:'\f269'}.apbct-icon-opera:before{content:'\f26a'}.apbct-icon-internet-explorer:before{content:'\f26b'}.apbct-icon-television:before{content:'\f26c'}.apbct-icon-percent:before{content:'\f295'}
inc/cleantalk-admin.php CHANGED
@@ -302,6 +302,8 @@ function apbct_admin__init()
302
 
303
  add_action('wp_ajax_apbct_get_key_auto', 'apbct_settings__get_key_auto');
304
 
 
 
305
  // Settings Templates
306
  if (
307
  ! is_multisite() ||
@@ -644,7 +646,7 @@ function apbct_admin__admin_bar__add_structure($wp_admin_bar)
644
  ) . '</a></span>'
645
  : '<span><a>' . __('Anti-Spam', 'cleantalk-spam-protect') . '</a></span>';
646
 
647
- $attention_mark = $apbct->notice_show ? '<i class="icon-attention-alt"></i>' : '';
648
  $title = $title . $attention_mark;
649
 
650
  $wp_admin_bar->add_node(array(
@@ -775,7 +777,7 @@ function apbct_admin__admin_bar__add_child_nodes($wp_admin_bar)
775
  {
776
  global $apbct;
777
 
778
- $attention_mark = $apbct->notice_show ? '<i class="icon-attention-alt"></i>' : '';
779
 
780
  $wp_admin_bar->add_node(array(
781
  'parent' => 'apbct__parent_node',
@@ -791,7 +793,7 @@ function apbct_admin__admin_bar__add_child_nodes($wp_admin_bar)
791
  . __('Since', 'cleantalk-spam-protect') . '&nbsp;' . $apbct->counter__user['since'] . ': '
792
  . '<span style="color: green;">' . $apbct->counter__user['accepted'] . '</span> / '
793
  . '<span style="color: red;">' . $apbct->counter__user['blocked'] . '</span>'
794
- . '<i class="icon-help-circled" title="'
795
  . __(
796
  'Shows amount of alllowed and blocked requests since the date.',
797
  'cleantalk-spam-protect'
@@ -811,7 +813,7 @@ function apbct_admin__admin_bar__add_child_nodes($wp_admin_bar)
811
  . '<span style="color: green;">' . $apbct->counter__all_time['accepted'] . '</span> / '
812
  . '<span style="color: red;">' . $apbct->counter__all_time['blocked'] . '</span>'
813
  . '</span>'
814
- . '<i class="icon-help-circled" title="' . __(
815
  'All / Allowed / Blocked submissions. The number of submissions is being counted since CleanTalk plugin installation.',
816
  'cleantalk-spam-protect'
817
  ) . '"></i>'
@@ -830,7 +832,7 @@ function apbct_admin__admin_bar__add_child_nodes($wp_admin_bar)
830
  . '<span style="color: green;">' . $apbct->counter__daily['accepted'] . '</span> / '
831
  . '<span style="color: red;">' . $apbct->counter__daily['blocked'] . '</span>'
832
  . '</span>'
833
- . '<i class="icon-help-circled" title="' . __(
834
  'Allowed / Blocked submissions. The number of submissions for past 24 hours. ',
835
  'cleantalk-spam-protect'
836
  ) . '"></i>'
@@ -849,7 +851,7 @@ function apbct_admin__admin_bar__add_child_nodes($wp_admin_bar)
849
  . '<span style="color: white;">' . $apbct->counter__sfw['all'] . '</span> / '
850
  . '<span style="color: red;">' . $apbct->counter__sfw['blocked'] . '</span>'
851
  . '</span>'
852
- . '<i class="icon-help-circled" title="' . __(
853
  'All / Blocked events. Access attempts triggered by SpamFireWall counted since the last plugin activation.',
854
  'cleantalk-spam-protect'
855
  ) . '"></i>'
@@ -970,7 +972,7 @@ function apbct_spbc_admin__admin_bar__add_child_nodes($wp_admin_bar)
970
  . '<b style="color: green;">' . 0 . '</b> / '
971
  . '<b style="color: red;">' . 0 . '</b>'
972
  . '</span>'
973
- . '<i class="icon-help-circled" title="' . __(
974
  'Blocked login attempts in the local database for past 24 hours.',
975
  'cleantalk-spam-protect'
976
  ) . '"></i>'
@@ -988,7 +990,7 @@ function apbct_spbc_admin__admin_bar__add_child_nodes($wp_admin_bar)
988
  . '<b style="color: green;">' . 0 . '</b> / '
989
  . '<b style="color: red;">' . 0 . '</b>'
990
  . '</b>'
991
- . '<i class="icon-help-circled" title="' . __(
992
  'Passed / Blocked requests by Security Firewall for past 24 hours.',
993
  'cleantalk-spam-protect'
994
  ) . '"></i>'
@@ -1003,7 +1005,7 @@ function apbct_spbc_admin__admin_bar__add_child_nodes($wp_admin_bar)
1003
  'title' => '<a>'
1004
  . '<span>' . __('Users online:', 'cleantalk-spam-protect') . '</span>'
1005
  . '&nbsp;<b class="spbc-admin_bar--user_counter">' . 0 . '</b>'
1006
- . '<i class="icon-help-circled" title="' . __(
1007
  'Shows amount of currently logged in administrators. Updates each 10 seconds.',
1008
  'cleantalk-spam-protect'
1009
  ) . '"></i>'
302
 
303
  add_action('wp_ajax_apbct_get_key_auto', 'apbct_settings__get_key_auto');
304
 
305
+ add_action('wp_ajax_apbct_update_account_email', 'apbct_settings__update_account_email');
306
+
307
  // Settings Templates
308
  if (
309
  ! is_multisite() ||
646
  ) . '</a></span>'
647
  : '<span><a>' . __('Anti-Spam', 'cleantalk-spam-protect') . '</a></span>';
648
 
649
+ $attention_mark = $apbct->notice_show ? '<i class="apbct-icon-attention-alt"></i>' : '';
650
  $title = $title . $attention_mark;
651
 
652
  $wp_admin_bar->add_node(array(
777
  {
778
  global $apbct;
779
 
780
+ $attention_mark = $apbct->notice_show ? '<i class="apbct-icon-attention-alt"></i>' : '';
781
 
782
  $wp_admin_bar->add_node(array(
783
  'parent' => 'apbct__parent_node',
793
  . __('Since', 'cleantalk-spam-protect') . '&nbsp;' . $apbct->counter__user['since'] . ': '
794
  . '<span style="color: green;">' . $apbct->counter__user['accepted'] . '</span> / '
795
  . '<span style="color: red;">' . $apbct->counter__user['blocked'] . '</span>'
796
+ . '<i class="apbct-icon-help-circled" title="'
797
  . __(
798
  'Shows amount of alllowed and blocked requests since the date.',
799
  'cleantalk-spam-protect'
813
  . '<span style="color: green;">' . $apbct->counter__all_time['accepted'] . '</span> / '
814
  . '<span style="color: red;">' . $apbct->counter__all_time['blocked'] . '</span>'
815
  . '</span>'
816
+ . '<i class="apbct-icon-help-circled" title="' . __(
817
  'All / Allowed / Blocked submissions. The number of submissions is being counted since CleanTalk plugin installation.',
818
  'cleantalk-spam-protect'
819
  ) . '"></i>'
832
  . '<span style="color: green;">' . $apbct->counter__daily['accepted'] . '</span> / '
833
  . '<span style="color: red;">' . $apbct->counter__daily['blocked'] . '</span>'
834
  . '</span>'
835
+ . '<i class="apbct-icon-help-circled" title="' . __(
836
  'Allowed / Blocked submissions. The number of submissions for past 24 hours. ',
837
  'cleantalk-spam-protect'
838
  ) . '"></i>'
851
  . '<span style="color: white;">' . $apbct->counter__sfw['all'] . '</span> / '
852
  . '<span style="color: red;">' . $apbct->counter__sfw['blocked'] . '</span>'
853
  . '</span>'
854
+ . '<i class="apbct-icon-help-circled" title="' . __(
855
  'All / Blocked events. Access attempts triggered by SpamFireWall counted since the last plugin activation.',
856
  'cleantalk-spam-protect'
857
  ) . '"></i>'
972
  . '<b style="color: green;">' . 0 . '</b> / '
973
  . '<b style="color: red;">' . 0 . '</b>'
974
  . '</span>'
975
+ . '<i class="apbct-icon-help-circled" title="' . __(
976
  'Blocked login attempts in the local database for past 24 hours.',
977
  'cleantalk-spam-protect'
978
  ) . '"></i>'
990
  . '<b style="color: green;">' . 0 . '</b> / '
991
  . '<b style="color: red;">' . 0 . '</b>'
992
  . '</b>'
993
+ . '<i class="apbct-icon-help-circled" title="' . __(
994
  'Passed / Blocked requests by Security Firewall for past 24 hours.',
995
  'cleantalk-spam-protect'
996
  ) . '"></i>'
1005
  'title' => '<a>'
1006
  . '<span>' . __('Users online:', 'cleantalk-spam-protect') . '</span>'
1007
  . '&nbsp;<b class="spbc-admin_bar--user_counter">' . 0 . '</b>'
1008
+ . '<i class="apbct-icon-help-circled" title="' . __(
1009
  'Shows amount of currently logged in administrators. Updates each 10 seconds.',
1010
  'cleantalk-spam-protect'
1011
  ) . '"></i>'
inc/cleantalk-common.php CHANGED
@@ -456,7 +456,7 @@ function apbct_get_sender_info()
456
  'remote_addr' => \Cleantalk\ApbctWP\Helper::ipGet('remote_addr', false),
457
  'REFFERRER' => apbct_get_server_variable('HTTP_REFERER'),
458
  'USER_AGENT' => apbct_get_server_variable('HTTP_USER_AGENT'),
459
- 'page_url' => apbct_get_server_variable('SERVER_NAME') . apbct_get_server_variable('REQUEST_URI'),
460
  'cms_lang' => substr(get_locale(), 0, 2),
461
  'ct_options' => json_encode($apbct->settings),
462
  'fields_number' => sizeof($_POST),
@@ -495,9 +495,7 @@ function apbct_get_sender_info()
495
  'headers_sent' => ! empty($apbct->headers_sent) ? $apbct->headers_sent : false,
496
  'headers_sent__hook' => ! empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : 'no_hook',
497
  'headers_sent__where' => ! empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
498
- 'request_type' => apbct_get_server_variable('REQUEST_METHOD') ? apbct_get_server_variable(
499
- 'REQUEST_METHOD'
500
- ) : 'UNKNOWN',
501
  'email_check' => Cookie::get('ct_checked_emails') ? json_encode(
502
  Cookie::get('ct_checked_emails')
503
  ) : null,
@@ -506,6 +504,17 @@ function apbct_get_sender_info()
506
  );
507
  }
508
 
 
 
 
 
 
 
 
 
 
 
 
509
  /**
510
  * Process visible fields for specific form to match the fields from request
511
  *
@@ -678,7 +687,20 @@ function apbct_is_cache_plugins_exists()
678
  */
679
  function ct_get_admin_email()
680
  {
681
- return get_option('admin_email');
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  }
683
 
684
  /**
@@ -964,6 +986,13 @@ function apbct_api_key__is_correct($api_key = null)
964
  return $api_key && preg_match('/^[a-z\d]{3,15}$/', $api_key) ? true : false;
965
  }
966
 
 
 
 
 
 
 
 
967
  function apbct_add_async_attribute($tag, $handle)
968
  {
969
  global $apbct;
456
  'remote_addr' => \Cleantalk\ApbctWP\Helper::ipGet('remote_addr', false),
457
  'REFFERRER' => apbct_get_server_variable('HTTP_REFERER'),
458
  'USER_AGENT' => apbct_get_server_variable('HTTP_USER_AGENT'),
459
+ 'page_url' => apbct_sender_info___get_page_url(),
460
  'cms_lang' => substr(get_locale(), 0, 2),
461
  'ct_options' => json_encode($apbct->settings),
462
  'fields_number' => sizeof($_POST),
495
  'headers_sent' => ! empty($apbct->headers_sent) ? $apbct->headers_sent : false,
496
  'headers_sent__hook' => ! empty($apbct->headers_sent__hook) ? $apbct->headers_sent__hook : 'no_hook',
497
  'headers_sent__where' => ! empty($apbct->headers_sent__where) ? $apbct->headers_sent__where : false,
498
+ 'request_type' => apbct_get_server_variable('REQUEST_METHOD') ?: 'UNKNOWN',
 
 
499
  'email_check' => Cookie::get('ct_checked_emails') ? json_encode(
500
  Cookie::get('ct_checked_emails')
501
  ) : null,
504
  );
505
  }
506
 
507
+ function apbct_sender_info___get_page_url()
508
+ {
509
+ if (
510
+ ( apbct_is_ajax() || apbct_is_rest() )
511
+ && Server::get('HTTP_REFERER')
512
+ ) {
513
+ return Server::get('HTTP_REFERER');
514
+ }
515
+ return Server::get('SERVER_NAME') . Server::get('REQUEST_URI');
516
+ }
517
+
518
  /**
519
  * Process visible fields for specific form to match the fields from request
520
  *
687
  */
688
  function ct_get_admin_email()
689
  {
690
+ global $apbct;
691
+
692
+ // Not WPMS
693
+ if (!is_multisite()) {
694
+ return $apbct->data['account_email'] ?: get_option('admin_email');
695
+ }
696
+
697
+ // Main site, common account
698
+ if (is_main_site() || $apbct->network_settings['multisite__work_mode'] != 3) {
699
+ return $apbct->data['account_email'] ?: get_site_option('admin_email');
700
+ }
701
+
702
+ // Individual account, individual key
703
+ return $apbct->data['account_email'] ?: get_blog_option(get_current_blog_id(), 'admin_email');
704
  }
705
 
706
  /**
986
  return $api_key && preg_match('/^[a-z\d]{3,15}$/', $api_key) ? true : false;
987
  }
988
 
989
+ function apbct__is_hosting_license()
990
+ {
991
+ global $apbct;
992
+
993
+ return $apbct->data['moderate_ip'] && $apbct->data['ip_license'];
994
+ }
995
+
996
  function apbct_add_async_attribute($tag, $handle)
997
  {
998
  global $apbct;
inc/cleantalk-pluggable.php CHANGED
@@ -130,7 +130,7 @@ function apbct_get_rest_url($blog_id = null, $path = '/', $scheme = 'rest')
130
  $path = '/' . ltrim($path, '/');
131
 
132
  if ( is_multisite() && (get_blog_option($blog_id, 'permalink_structure') || get_option('permalink_structure')) ) {
133
- if ( $wp_rewrite->using_index_permalinks() ) {
134
  $url = get_home_url($blog_id, $wp_rewrite->index . '/' . rest_get_url_prefix(), $scheme);
135
  } else {
136
  $url = get_home_url($blog_id, rest_get_url_prefix(), $scheme);
130
  $path = '/' . ltrim($path, '/');
131
 
132
  if ( is_multisite() && (get_blog_option($blog_id, 'permalink_structure') || get_option('permalink_structure')) ) {
133
+ if ( !is_null($wp_rewrite) && $wp_rewrite->using_index_permalinks() ) {
134
  $url = get_home_url($blog_id, $wp_rewrite->index . '/' . rest_get_url_prefix(), $scheme);
135
  } else {
136
  $url = get_home_url($blog_id, rest_get_url_prefix(), $scheme);
inc/cleantalk-public-integrations.php CHANGED
@@ -1086,7 +1086,7 @@ function ct_preprocess_comment($comment)
1086
  }
1087
 
1088
  // Change comment flow only for new authors
1089
- if ( ! empty($new_user) || $ct_result->stop_words !== null || $ct_result->spam == 1 ) {
1090
  add_action('comment_post', 'ct_set_meta', 10, 2);
1091
  }
1092
 
@@ -3187,3 +3187,18 @@ function apbct_custom_forms_trappings()
3187
 
3188
  return false;
3189
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1086
  }
1087
 
1088
  // Change comment flow only for new authors
1089
+ if ( empty( $base_call_data['post_info']['post_url'] ) ) {
1090
  add_action('comment_post', 'ct_set_meta', 10, 2);
1091
  }
1092
 
3187
 
3188
  return false;
3189
  }
3190
+
3191
+ /**
3192
+ * UsersWP plugin integration
3193
+ */
3194
+ function apbct_form__uwp_validate($result, $_type, $data)
3195
+ {
3196
+ if ( isset($data['username'], $data['email']) ) {
3197
+ $check = ct_test_registration($data['username'], $data['email'], Helper::ipGet());
3198
+ if ( $check['allow'] == 0 ) {
3199
+ return new WP_Error('invalid_email', $check['comment']);
3200
+ }
3201
+ }
3202
+
3203
+ return $result;
3204
+ }
inc/cleantalk-public-validate.php CHANGED
@@ -364,7 +364,8 @@ function ct_contact_form_validate_postdata()
364
  apbct_is_in_uri('xmlrpc.php?for=jetpack') ||
365
  apbct_is_in_uri('connector=bridge&task=put_sql') ||
366
  Server::inUri('cleantalk-antispam/v1/alt_sessions') || // Skip test for alt sessions
367
- (apbct_is_in_uri('bvMethod=') && apbct_is_in_uri('bvVersion=') && isset($_POST['apipage']) && $_POST['apipage'] === 'blogvault')
 
368
  ) {
369
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
370
 
364
  apbct_is_in_uri('xmlrpc.php?for=jetpack') ||
365
  apbct_is_in_uri('connector=bridge&task=put_sql') ||
366
  Server::inUri('cleantalk-antispam/v1/alt_sessions') || // Skip test for alt sessions
367
+ (apbct_is_in_uri('bvMethod=') && apbct_is_in_uri('bvVersion=') && isset($_POST['apipage']) && $_POST['apipage'] === 'blogvault') ||
368
+ (isset($_POST['wpstg-username'], $_POST['wpstg-pass'], $_POST['wpstg-submit']) && $_POST['wpstg-submit'] == 'Log In') //Accept Stripe Payments
369
  ) {
370
  do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
371
 
inc/cleantalk-public.php CHANGED
@@ -324,6 +324,9 @@ function apbct_init()
324
  return $pmpro_required_user_fields;
325
  });
326
 
 
 
 
327
  //
328
  // Load JS code to website footer
329
  //
@@ -401,7 +404,7 @@ function apbct_buffer_modify_by_string()
401
  {
402
  global $apbct, $wp;
403
 
404
- $site_url = get_option('siteurl');
405
  $site__host = parse_url($site_url, PHP_URL_HOST);
406
 
407
  preg_match_all('/<form\s*.*>\s*.*<\/form>/', $apbct->buffer, $matches, PREG_SET_ORDER);
@@ -438,7 +441,7 @@ function apbct_buffer_modify_by_dom()
438
  {
439
  global $apbct, $wp;
440
 
441
- $site_url = get_option('siteurl');
442
  $site__host = parse_url($site_url, PHP_URL_HOST);
443
 
444
  $dom = new DOMDocument();
@@ -519,7 +522,7 @@ function apbct_hook__wp_footer()
519
  if ( $apbct->settings['data__use_ajax'] ) {
520
  $timeout = $apbct->settings['misc__async_js'] ? 1000 : 0;
521
 
522
- if ( $apbct->settings['data__use_ajax__type'] == 0 ) {
523
  $html =
524
  "<script type=\"text/javascript\" " . (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '')
525
  . ">
@@ -535,7 +538,7 @@ function apbct_hook__wp_footer()
535
  });
536
  </script>";
537
  } else {
538
- $use_cleantalk_ajax = $apbct->settings['data__use_ajax__type'] == 1 ? 1 : 0;
539
  $html =
540
  "<script type=\"text/javascript\" " . (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '')
541
  . ">
@@ -544,7 +547,7 @@ function apbct_hook__wp_footer()
544
  if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
545
  apbct_public_sendAJAX(
546
  { action: 'apbct_js_keys__get' },
547
- { callback: apbct_js_keys__set_input_value, apbct_ajax: " . $use_cleantalk_ajax . " }
548
  )
549
  }
550
  }," . $timeout . ")
@@ -1306,7 +1309,7 @@ function apbct_enqueue_and_localize_public_scripts()
1306
  '_rest_url' => esc_url(apbct_get_rest_url()),
1307
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
1308
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
1309
- 'data__set_cookies__alt_sessions_type' => $apbct->settings['data__set_cookies__alt_sessions_type'],
1310
  ));
1311
 
1312
  wp_localize_script('ct_public', 'ctPublic', array(
324
  return $pmpro_required_user_fields;
325
  });
326
 
327
+ // UsersWP plugin integration
328
+ add_filter('uwp_validate_result', 'apbct_form__uwp_validate', 3, 10);
329
+
330
  //
331
  // Load JS code to website footer
332
  //
404
  {
405
  global $apbct, $wp;
406
 
407
+ $site_url = get_option('home');
408
  $site__host = parse_url($site_url, PHP_URL_HOST);
409
 
410
  preg_match_all('/<form\s*.*>\s*.*<\/form>/', $apbct->buffer, $matches, PREG_SET_ORDER);
441
  {
442
  global $apbct, $wp;
443
 
444
+ $site_url = get_option('home');
445
  $site__host = parse_url($site_url, PHP_URL_HOST);
446
 
447
  $dom = new DOMDocument();
522
  if ( $apbct->settings['data__use_ajax'] ) {
523
  $timeout = $apbct->settings['misc__async_js'] ? 1000 : 0;
524
 
525
+ if ( $apbct->data['ajax_type'] == 'rest' ) {
526
  $html =
527
  "<script type=\"text/javascript\" " . (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '')
528
  . ">
538
  });
539
  </script>";
540
  } else {
541
+ $use_cleantalk_ajax = $apbct->data['ajax_type'] == 'custom_ajax' ? 'custom_ajax' : 'rest';
542
  $html =
543
  "<script type=\"text/javascript\" " . (class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '')
544
  . ">
547
  if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
548
  apbct_public_sendAJAX(
549
  { action: 'apbct_js_keys__get' },
550
+ { callback: apbct_js_keys__set_input_value, apbct_ajax: '" . $use_cleantalk_ajax . "' }
551
  )
552
  }
553
  }," . $timeout . ")
1309
  '_rest_url' => esc_url(apbct_get_rest_url()),
1310
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
1311
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
1312
+ 'data__ajax_type' => $apbct->data['ajax_type'],
1313
  ));
1314
 
1315
  wp_localize_script('ct_public', 'ctPublic', array(
inc/cleantalk-settings.php CHANGED
@@ -149,12 +149,15 @@ function apbct_settings__set_fileds()
149
  'description' => '',
150
  'html_before' => '<hr><br>'
151
  . '<span id="ct_adv_showhide">'
152
- . '<a href="#" class="apbct_color--gray" onclick="event.preventDefault(); apbct_show_hide_elem(\'apbct_settings__davanced_settings\');">'
153
  . __('Advanced settings', 'cleantalk-spam-protect')
154
  . '</a>'
155
  . '</span>'
156
- . '<div id="apbct_settings__davanced_settings" style="display: none;">',
 
 
157
  'html_after' => '',
 
158
  'fields' => array(
159
  'forms__registrations_test' => array(
160
  'title' => __('Registration Forms', 'cleantalk-spam-protect'),
@@ -222,6 +225,7 @@ function apbct_settings__set_fileds()
222
  // Comments and Messages
223
  'wc' => array(
224
  'title' => __('WooCommerce', 'cleantalk-spam-protect'),
 
225
  'fields' => array(
226
  'forms__wc_checkout_test' => array(
227
  'title' => __('WooCommerce checkout form', 'cleantalk-spam-protect'),
@@ -280,6 +284,7 @@ function apbct_settings__set_fileds()
280
  // Comments and Messages
281
  'comments_and_messages' => array(
282
  'title' => __('Comments and Messages', 'cleantalk-spam-protect'),
 
283
  'fields' => array(
284
  'comments__disable_comments__all' => array(
285
  'title' => __('Disable all comments', 'cleantalk-spam-protect'),
@@ -357,6 +362,7 @@ function apbct_settings__set_fileds()
357
  // Data Processing
358
  'data_processing' => array(
359
  'title' => __('Data Processing', 'cleantalk-spam-protect'),
 
360
  'fields' => array(
361
  'data__protect_logged_in' => array(
362
  'title' => __("Protect logged in Users", 'cleantalk-spam-protect'),
@@ -378,6 +384,11 @@ function apbct_settings__set_fileds()
378
  'Options helps protect WordPress against spam with any caching plugins. Turn this option on to avoid issues with caching plugins. Turn off this option and SpamFireWall to be compatible with Accelerated mobile pages (AMP).',
379
  'cleantalk-spam-protect'
380
  ),
 
 
 
 
 
381
  ),
382
  'data__use_static_js_key' => array(
383
  'title' => __('Use static keys for JavaScript check', 'cleantalk-spam-protect'),
@@ -441,9 +452,9 @@ function apbct_settings__set_fileds()
441
  'childrens_enable' => 1,
442
  ),
443
  ),
444
- 'childrens' => array('data__set_cookies__alt_sessions_type')
445
  ),
446
- 'data__set_cookies__alt_sessions_type' => array(
447
  'display' => $apbct->settings['data__set_cookies'] == 2,
448
  'callback' => 'apbct_settings__check_alt_cookies_types'
449
  ),
@@ -501,6 +512,7 @@ function apbct_settings__set_fileds()
501
  // Exclusions
502
  'exclusions' => array(
503
  'title' => __('Exclusions', 'cleantalk-spam-protect'),
 
504
  'fields' => array(
505
  'exclusions__urls' => array(
506
  'type' => 'textarea',
@@ -545,6 +557,7 @@ function apbct_settings__set_fileds()
545
  'description' => '',
546
  'html_before' => '',
547
  'html_after' => '',
 
548
  'fields' => array(
549
  'admin_bar__show' => array(
550
  'title' => __('Show statistics in admin bar', 'cleantalk-spam-protect'),
@@ -595,6 +608,7 @@ function apbct_settings__set_fileds()
595
  'description' => '',
596
  'html_before' => '',
597
  'html_after' => '',
 
598
  'fields' => array(
599
  'sfw__random_get' => array(
600
  'type' => 'radio',
@@ -654,7 +668,8 @@ function apbct_settings__set_fileds()
654
  // Misc
655
  'misc' => array(
656
  'title' => __('Miscellaneous', 'cleantalk-spam-protect'),
657
- 'html_after' => '</div><br>',
 
658
  'fields' => array(
659
  'misc__collect_details' => array(
660
  'type' => 'checkbox',
@@ -762,7 +777,7 @@ function apbct_settings__set_fileds__network($fields)
762
  . '</a>'
763
  . '</span>'
764
  . '<div id="apbct_settings__dwpms_settings" style="display: block;">',
765
- 'html_after' => '</div><br>',
766
  'fields' => array(
767
  'multisite__work_mode' => array(
768
  'type' => 'select',
@@ -1072,10 +1087,13 @@ function apbct_settings__display()
1072
  }
1073
  }
1074
 
1075
- if ( apbct_api_key__is_correct() && ($apbct->network_settings['multisite__work_mode'] != 2 || is_main_site()) ) {
 
 
 
1076
  // Sync button
1077
  echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="Synchronizing account status, SpamFireWall database, all kind of journals.">'
1078
- . '<i class="icon-upload-cloud"></i>&nbsp;&nbsp;'
1079
  . __('Synchronize with Cloud', 'cleantalk-spam-protect')
1080
  . '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . APBCT_URL_PATH . '/inc/images/preloader2.gif" />'
1081
  . '<img style="margin-left: 10px;" class="apbct_success --hide" src="' . APBCT_URL_PATH . '/inc/images/yes.png" />'
@@ -1098,18 +1116,42 @@ function apbct_settings__display()
1098
  settings_fields('cleantalk_settings');
1099
  do_settings_fields('cleantalk', 'cleantalk_section_settings_main');
1100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1101
  foreach ( $apbct->settings_fields_in_groups as $group_name => $group ) {
1102
  echo ! empty($group['html_before']) ? $group['html_before'] : '';
1103
- echo ! empty($group['title']) ? '<h3 style="margin-left: 220px;">' . $group['title'] . '</h3>' : '';
1104
 
1105
  do_settings_fields('cleantalk', 'apbct_section__' . $group_name);
1106
 
 
 
 
 
1107
  echo ! empty($group['html_after']) ? $group['html_after'] : '';
1108
  }
1109
 
 
 
 
 
 
1110
  echo '<br>';
1111
- echo '<button name="submit" class="cleantalk_link cleantalk_link-manual" value="save_changes">' .
1112
- __('Save Changes') . '</button>';
1113
 
1114
  echo "</form>";
1115
 
@@ -1393,6 +1435,9 @@ function apbct_settings__field__state()
1393
  }
1394
  if ( $apbct->moderate_ip ) {
1395
  print "<br /><br />The anti-spam service is paid by your hosting provider. License #" . $apbct->data['ip_license'] . ".<br />";
 
 
 
1396
  }
1397
 
1398
  print "</div>";
@@ -1469,11 +1514,14 @@ function apbct_settings__field__apikey()
1469
  // Warnings and GDPR
1470
  printf(
1471
  __(
1472
- 'Admin e-mail (%s) will be used for registration, if you want to use other email please %sGet Access Key Manually%s.',
1473
  'cleantalk-spam-protect'
1474
  ),
1475
- ct_get_admin_email(),
1476
- '<a class="apbct_color--gray" target="__blank" href="'
 
 
 
1477
  . sprintf(
1478
  'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
1479
  urlencode(ct_get_admin_email()),
@@ -1564,6 +1612,10 @@ function apbct_settings__field__action_buttons()
1564
  echo $link . '&nbsp;&nbsp;&nbsp;&nbsp;';
1565
  }
1566
  echo '</div>';
 
 
 
 
1567
  }
1568
 
1569
  echo '</div>';
@@ -1769,7 +1821,7 @@ function apbct_settings__field__draw($params = array())
1769
  . $params['title']
1770
  . '</label>';
1771
  echo isset($params['long_description'])
1772
- ? '<i setting="' . $params['name'] . '" class="apbct_settings-long_description---show icon-help-circled"></i>'
1773
  : '';
1774
  echo '<div class="apbct_settings-field_description">'
1775
  . $params['description']
@@ -1785,7 +1837,7 @@ function apbct_settings__field__draw($params = array())
1785
 
1786
  // Popup description
1787
  echo isset($params['long_description'])
1788
- ? '<i setting="' . $params['name'] . '" class="apbct_settings-long_description---show icon-help-circled"></i>'
1789
  : '';
1790
 
1791
  echo '<div class="apbct_settings-field_content apbct_settings-field_content--' . $params['type'] . '">';
@@ -1852,7 +1904,7 @@ function apbct_settings__field__draw($params = array())
1852
 
1853
  echo '</select>';
1854
  echo isset($params['long_description'])
1855
- ? '<i setting="' . $params['name'] . '" class="apbct_settings-long_description---show icon-help-circled"></i>'
1856
  : '';
1857
  echo isset($params['description'])
1858
  ? '<div class="apbct_settings-field_description">' . $params['description'] . '</div>'
@@ -2061,6 +2113,22 @@ function apbct_settings__validate($settings)
2061
  return $settings;
2062
  }
2063
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2064
  $apbct->save('data');
2065
 
2066
  // WPMS Logic.
@@ -2095,32 +2163,6 @@ function apbct_settings__validate($settings)
2095
  \Cleantalk\ApbctWP\Variables\AltSessions::wipe();
2096
  }
2097
 
2098
- // @ToDo combine selecting of the ajax handler type
2099
- // Set type of the alt cookies
2100
- $settings['data__set_cookies__alt_sessions_type'] = $apbct->settings['data__set_cookies__alt_sessions_type'];
2101
- if ( $apbct->settings['data__set_cookies'] != 2 && $settings['data__set_cookies'] == 2 ) {
2102
- $alt_cookies_type = apbct_settings__get_alt_cookies_type();
2103
- if ( $alt_cookies_type === false ) {
2104
- // There is no available alt cookies types. Cookies will be disabled.
2105
- $settings['data__set_cookies'] = 0;
2106
- } else {
2107
- $settings['data__set_cookies__alt_sessions_type'] = $alt_cookies_type;
2108
- }
2109
- }
2110
-
2111
- // @ToDo combine selecting of the ajax handler type
2112
- // Set type of the AJAX getting of js
2113
- $settings['data__use_ajax__type'] = $apbct->settings['data__use_ajax__type'];
2114
- if ( $apbct->settings['data__use_ajax'] != 1 && $settings['data__use_ajax'] == 1 ) {
2115
- $ajax_type = apbct_settings__get_alt_cookies_type();
2116
- if ( $ajax_type === false ) {
2117
- // There is no available ajax types. AJAX js will be disabled.
2118
- $settings['data__use_ajax'] = 0;
2119
- } else {
2120
- $settings['data__use_ajax__type'] = $ajax_type;
2121
- }
2122
- }
2123
-
2124
  return $settings;
2125
  }
2126
 
@@ -2247,7 +2289,7 @@ function apbct_settings__get_key_auto($direct_call = false)
2247
 
2248
  global $apbct;
2249
 
2250
- $website = parse_url(get_option('siteurl'), PHP_URL_HOST) . parse_url(get_option('siteurl'), PHP_URL_PATH);
2251
  $platform = 'wordpress';
2252
  $user_ip = \Cleantalk\ApbctWP\Helper::ipGet('real', false);
2253
  $timezone = filter_input(INPUT_POST, 'ct_admin_timezone');
@@ -2255,12 +2297,8 @@ function apbct_settings__get_key_auto($direct_call = false)
2255
  $wpms = APBCT_WPMS && defined('SUBDOMAIN_INSTALL') && ! SUBDOMAIN_INSTALL ? true : false;
2256
  $white_label = $apbct->network_settings['multisite__white_label'] ? true : false;
2257
  $hoster_api_key = $apbct->network_settings['multisite__hoster_api_key'];
2258
- $admin_email = $apbct->network_settings['multisite__work_mode'] == 1 ? get_site_option(
2259
- 'admin_email'
2260
- ) : get_option('admin_email');
2261
- if ( function_exists('is_multisite') && is_multisite() && $apbct->white_label ) {
2262
- $admin_email = get_site_option('admin_email');
2263
- }
2264
  $result = \Cleantalk\ApbctWP\API::methodGetApiKey(
2265
  'antispam',
2266
  $admin_email,
@@ -2324,6 +2362,65 @@ function apbct_settings__get_key_auto($direct_call = false)
2324
  }
2325
  }
2326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2327
  function apbct_update_blogs_options($settings)
2328
  {
2329
  global $wpdb;
@@ -2456,28 +2553,28 @@ function apbct_settings__check_renew_banner()
2456
  }
2457
 
2458
  /**
2459
- * Checking availability of the handlers and return alt cookies type
2460
  *
2461
- * @return int|false
2462
  */
2463
- function apbct_settings__get_alt_cookies_type()
2464
  {
2465
- // Check custom ajax availability
2466
  $res_custom_ajax = Helper::httpRequestGetResponseCode(esc_url(APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php'));
2467
  if ( $res_custom_ajax == 400 ) {
2468
- return 1;
2469
  }
2470
 
2471
- // Check rest availability
2472
  $res_rest = Helper::httpRequestGetResponseCode(esc_url(apbct_get_rest_url()));
2473
  if ( $res_rest == 200 ) {
2474
- return 0;
2475
  }
2476
 
2477
- // Check WP ajax availability
2478
  $res_ajax = Helper::httpRequestGetResponseCode(admin_url('admin-ajax.php'));
2479
  if ( $res_ajax == 400 ) {
2480
- return 2;
2481
  }
2482
 
2483
  return false;
@@ -2487,14 +2584,14 @@ function apbct_settings__check_alt_cookies_types()
2487
  {
2488
  global $apbct;
2489
 
2490
- switch ( $apbct->settings['data__set_cookies__alt_sessions_type'] ) {
2491
- case '0':
2492
  $alt_cookies_type = esc_html__('REST API', 'cleantalk-spam-protect');
2493
  break;
2494
- case '1':
2495
  $alt_cookies_type = esc_html__('CleanTalk AJAX handler', 'cleantalk-spam-protect');
2496
  break;
2497
- case '2':
2498
  $alt_cookies_type = esc_html__('WP AJAX handler', 'cleantalk-spam-protect');
2499
  break;
2500
  default:
@@ -2510,3 +2607,58 @@ function apbct_settings__check_alt_cookies_types()
2510
 
2511
  echo '</div>';
2512
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  'description' => '',
150
  'html_before' => '<hr><br>'
151
  . '<span id="ct_adv_showhide">'
152
+ . '<a href="#" class="apbct_color--gray" onclick="event.preventDefault(); apbct_show_hide_elem(\'apbct_settings__advanced_settings\');">'
153
  . __('Advanced settings', 'cleantalk-spam-protect')
154
  . '</a>'
155
  . '</span>'
156
+ . '<div id="apbct_settings__before_advanced_settings"></div>'
157
+ . '<div id="apbct_settings__advanced_settings" style="display: none;">'
158
+ . '<div id="apbct_settings__advanced_settings_inner">',
159
  'html_after' => '',
160
+ 'section' => 'hidden_section',
161
  'fields' => array(
162
  'forms__registrations_test' => array(
163
  'title' => __('Registration Forms', 'cleantalk-spam-protect'),
225
  // Comments and Messages
226
  'wc' => array(
227
  'title' => __('WooCommerce', 'cleantalk-spam-protect'),
228
+ 'section' => 'hidden_section',
229
  'fields' => array(
230
  'forms__wc_checkout_test' => array(
231
  'title' => __('WooCommerce checkout form', 'cleantalk-spam-protect'),
284
  // Comments and Messages
285
  'comments_and_messages' => array(
286
  'title' => __('Comments and Messages', 'cleantalk-spam-protect'),
287
+ 'section' => 'hidden_section',
288
  'fields' => array(
289
  'comments__disable_comments__all' => array(
290
  'title' => __('Disable all comments', 'cleantalk-spam-protect'),
362
  // Data Processing
363
  'data_processing' => array(
364
  'title' => __('Data Processing', 'cleantalk-spam-protect'),
365
+ 'section' => 'hidden_section',
366
  'fields' => array(
367
  'data__protect_logged_in' => array(
368
  'title' => __("Protect logged in Users", 'cleantalk-spam-protect'),
384
  'Options helps protect WordPress against spam with any caching plugins. Turn this option on to avoid issues with caching plugins. Turn off this option and SpamFireWall to be compatible with Accelerated mobile pages (AMP).',
385
  'cleantalk-spam-protect'
386
  ),
387
+ 'childrens' => array('data__ajax_type_checking_js')
388
+ ),
389
+ 'data__ajax_type_checking_js' => array(
390
+ 'display' => $apbct->settings['data__use_ajax'] == 1,
391
+ 'callback' => 'apbct_settings__ajax_handler_type_notification'
392
  ),
393
  'data__use_static_js_key' => array(
394
  'title' => __('Use static keys for JavaScript check', 'cleantalk-spam-protect'),
452
  'childrens_enable' => 1,
453
  ),
454
  ),
455
+ 'childrens' => array('data__ajax_type')
456
  ),
457
+ 'data__ajax_type' => array(
458
  'display' => $apbct->settings['data__set_cookies'] == 2,
459
  'callback' => 'apbct_settings__check_alt_cookies_types'
460
  ),
512
  // Exclusions
513
  'exclusions' => array(
514
  'title' => __('Exclusions', 'cleantalk-spam-protect'),
515
+ 'section' => 'hidden_section',
516
  'fields' => array(
517
  'exclusions__urls' => array(
518
  'type' => 'textarea',
557
  'description' => '',
558
  'html_before' => '',
559
  'html_after' => '',
560
+ 'section' => 'hidden_section',
561
  'fields' => array(
562
  'admin_bar__show' => array(
563
  'title' => __('Show statistics in admin bar', 'cleantalk-spam-protect'),
608
  'description' => '',
609
  'html_before' => '',
610
  'html_after' => '',
611
+ 'section' => 'hidden_section',
612
  'fields' => array(
613
  'sfw__random_get' => array(
614
  'type' => 'radio',
668
  // Misc
669
  'misc' => array(
670
  'title' => __('Miscellaneous', 'cleantalk-spam-protect'),
671
+ 'section' => 'hidden_section',
672
+ 'html_after' => '</div><div id="apbct_hidden_section_nav">{HIDDEN_SECTION_NAV}</div></div>',
673
  'fields' => array(
674
  'misc__collect_details' => array(
675
  'type' => 'checkbox',
777
  . '</a>'
778
  . '</span>'
779
  . '<div id="apbct_settings__dwpms_settings" style="display: block;">',
780
+ 'html_after' => '</div>',
781
  'fields' => array(
782
  'multisite__work_mode' => array(
783
  'type' => 'select',
1087
  }
1088
  }
1089
 
1090
+ if (
1091
+ (apbct_api_key__is_correct() || apbct__is_hosting_license()) &&
1092
+ ($apbct->network_settings['multisite__work_mode'] != 2 || is_main_site())
1093
+ ) {
1094
  // Sync button
1095
  echo '<button type="button" class="cleantalk_link cleantalk_link-auto" id="apbct_button__sync" title="Synchronizing account status, SpamFireWall database, all kind of journals.">'
1096
+ . '<i class="apbct-icon-upload-cloud"></i>&nbsp;&nbsp;'
1097
  . __('Synchronize with Cloud', 'cleantalk-spam-protect')
1098
  . '<img style="margin-left: 10px;" class="apbct_preloader_button" src="' . APBCT_URL_PATH . '/inc/images/preloader2.gif" />'
1099
  . '<img style="margin-left: 10px;" class="apbct_success --hide" src="' . APBCT_URL_PATH . '/inc/images/yes.png" />'
1116
  settings_fields('cleantalk_settings');
1117
  do_settings_fields('cleantalk', 'cleantalk_section_settings_main');
1118
 
1119
+ // Disabled save button if key empty
1120
+ $disabled = '';
1121
+ if (! $apbct->key_is_ok) {
1122
+ $disabled = 'disabled';
1123
+ }
1124
+
1125
+ $hidden_groups = '<ul>';
1126
+ foreach ( $apbct->settings_fields_in_groups as $group_name => $group ) {
1127
+ if ( isset($group['section']) && $group['section'] === 'hidden_section' ) {
1128
+ $hidden_groups .= '<li><a href="#apbct_setting_group__' . $group_name . '">' . $group['title'] . '</a></li>';
1129
+ }
1130
+ }
1131
+ $hidden_groups .= '</ul>';
1132
+ $hidden_groups .= '<div id="apbct_settings__button_section"><button name="submit" class="cleantalk_link cleantalk_link-manual" value="save_changes" ' . $disabled . '>'
1133
+ . __('Save Changes')
1134
+ . '</button></div>';
1135
+
1136
  foreach ( $apbct->settings_fields_in_groups as $group_name => $group ) {
1137
  echo ! empty($group['html_before']) ? $group['html_before'] : '';
1138
+ echo ! empty($group['title']) ? '<h3 style="margin-left: 220px;" id="apbct_setting_group__' . $group_name . '">' . $group['title'] . '</h3>' : '';
1139
 
1140
  do_settings_fields('cleantalk', 'apbct_section__' . $group_name);
1141
 
1142
+ if ( ! empty($group['html_after']) && strpos($group['html_after'], '{HIDDEN_SECTION_NAV}') !== false ) {
1143
+ $group['html_after'] = str_replace('{HIDDEN_SECTION_NAV}', $hidden_groups, $group['html_after']);
1144
+ }
1145
+
1146
  echo ! empty($group['html_after']) ? $group['html_after'] : '';
1147
  }
1148
 
1149
+ echo '<div id="apbct_settings__after_advanced_settings"></div>';
1150
+
1151
+ echo '<button id="apbct_settings__main_save_button" name="submit" class="cleantalk_link cleantalk_link-manual" value="save_changes" ' . $disabled . '>'
1152
+ . __('Save Changes')
1153
+ . '</button>';
1154
  echo '<br>';
 
 
1155
 
1156
  echo "</form>";
1157
 
1435
  }
1436
  if ( $apbct->moderate_ip ) {
1437
  print "<br /><br />The anti-spam service is paid by your hosting provider. License #" . $apbct->data['ip_license'] . ".<br />";
1438
+ if ( $apbct->api_key ) {
1439
+ print esc_html__('The access key is not required.', 'cleantalk-spam-protect');
1440
+ }
1441
  }
1442
 
1443
  print "</div>";
1514
  // Warnings and GDPR
1515
  printf(
1516
  __(
1517
+ 'Admin e-mail %s %s will be used for registration оr click here to %sGet Access Key Manually%s.',
1518
  'cleantalk-spam-protect'
1519
  ),
1520
+ '<span id="apbct-account-email">'
1521
+ . ct_get_admin_email() .
1522
+ '</span>',
1523
+ apbct_settings__btn_change_account_email_html(),
1524
+ '<a class="apbct_color--gray" target="__blank" id="apbct-key-manually-link" href="'
1525
  . sprintf(
1526
  'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
1527
  urlencode(ct_get_admin_email()),
1612
  echo $link . '&nbsp;&nbsp;&nbsp;&nbsp;';
1613
  }
1614
  echo '</div>';
1615
+ } elseif ( apbct__is_hosting_license() ) {
1616
+ echo '<a href="#" class="ct_support_link" onclick="apbct_show_hide_elem(\'apbct_statistics\')">'
1617
+ . __('Statistics & Reports', 'cleantalk-spam-protect')
1618
+ . '</a>';
1619
  }
1620
 
1621
  echo '</div>';
1821
  . $params['title']
1822
  . '</label>';
1823
  echo isset($params['long_description'])
1824
+ ? '<i setting="' . $params['name'] . '" class="apbct_settings-long_description---show apbct-icon-help-circled"></i>'
1825
  : '';
1826
  echo '<div class="apbct_settings-field_description">'
1827
  . $params['description']
1837
 
1838
  // Popup description
1839
  echo isset($params['long_description'])
1840
+ ? '<i setting="' . $params['name'] . '" class="apbct_settings-long_description---show apbct-icon-help-circled"></i>'
1841
  : '';
1842
 
1843
  echo '<div class="apbct_settings-field_content apbct_settings-field_content--' . $params['type'] . '">';
1904
 
1905
  echo '</select>';
1906
  echo isset($params['long_description'])
1907
+ ? '<i setting="' . $params['name'] . '" class="apbct_settings-long_description---show apbct-icon-help-circled"></i>'
1908
  : '';
1909
  echo isset($params['description'])
1910
  ? '<div class="apbct_settings-field_description">' . $params['description'] . '</div>'
2113
  return $settings;
2114
  }
2115
 
2116
+ // Ajax type
2117
+ $available_ajax_type = apbct_settings__get_ajax_type();
2118
+ $apbct->data['ajax_type'] = $available_ajax_type;
2119
+
2120
+ if (
2121
+ (isset($settings['data__set_cookies']) && $settings['data__set_cookies'] == 2) ||
2122
+ (isset($settings['data__use_ajax']) && $settings['data__use_ajax'] == 1)
2123
+ ) {
2124
+ if ( $available_ajax_type === false ) {
2125
+ // There is no available alt cookies types. Cookies will be disabled.
2126
+ // There is no available ajax types. AJAX js will be disabled.
2127
+ $settings['data__set_cookies'] = 0;
2128
+ $settings['data__use_ajax'] = 0;
2129
+ }
2130
+ }
2131
+
2132
  $apbct->save('data');
2133
 
2134
  // WPMS Logic.
2163
  \Cleantalk\ApbctWP\Variables\AltSessions::wipe();
2164
  }
2165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2166
  return $settings;
2167
  }
2168
 
2289
 
2290
  global $apbct;
2291
 
2292
+ $website = parse_url(get_option('home'), PHP_URL_HOST) . parse_url(get_option('home'), PHP_URL_PATH);
2293
  $platform = 'wordpress';
2294
  $user_ip = \Cleantalk\ApbctWP\Helper::ipGet('real', false);
2295
  $timezone = filter_input(INPUT_POST, 'ct_admin_timezone');
2297
  $wpms = APBCT_WPMS && defined('SUBDOMAIN_INSTALL') && ! SUBDOMAIN_INSTALL ? true : false;
2298
  $white_label = $apbct->network_settings['multisite__white_label'] ? true : false;
2299
  $hoster_api_key = $apbct->network_settings['multisite__hoster_api_key'];
2300
+ $admin_email = ct_get_admin_email();
2301
+
 
 
 
 
2302
  $result = \Cleantalk\ApbctWP\API::methodGetApiKey(
2303
  'antispam',
2304
  $admin_email,
2362
  }
2363
  }
2364
 
2365
+ function apbct_settings__update_account_email()
2366
+ {
2367
+ global $apbct;
2368
+
2369
+ $account_email = Post::get('accountEmail');
2370
+
2371
+ // not valid email
2372
+ if (!$account_email || !filter_var($_POST['accountEmail'], FILTER_VALIDATE_EMAIL)) {
2373
+ die(
2374
+ json_encode(
2375
+ array(
2376
+ 'error' => 'Please, enter valid email.'
2377
+ )
2378
+ )
2379
+ );
2380
+ }
2381
+
2382
+ // protection against accidental request from a child site in the shared account mode
2383
+ if (!is_main_site() && isset($apbct->network_settings['multisite__work_mode']) && $apbct->network_settings['multisite__work_mode'] != 3) {
2384
+ die(
2385
+ json_encode(
2386
+ array(
2387
+ 'error' => 'Please, enter valid email.'
2388
+ )
2389
+ )
2390
+ );
2391
+ }
2392
+
2393
+ // email not changed
2394
+ if (isset($apbct->data['account_email']) && $account_email === $apbct->data['account_email']) {
2395
+ die(
2396
+ json_encode(
2397
+ array(
2398
+ 'success' => 'ok'
2399
+ )
2400
+ )
2401
+ );
2402
+ }
2403
+
2404
+ $apbct->data['account_email'] = $account_email;
2405
+ $apbct->saveData();
2406
+
2407
+ // Link GET ACCESS KEY MANUALLY
2408
+ $manually_link = sprintf(
2409
+ 'https://cleantalk.org/register?platform=wordpress&email=%s&website=%s',
2410
+ urlencode(ct_get_admin_email()),
2411
+ urlencode(get_bloginfo('url'))
2412
+ );
2413
+
2414
+ die(
2415
+ json_encode(
2416
+ array(
2417
+ 'success' => 'ok',
2418
+ 'manuallyLink' => $manually_link
2419
+ )
2420
+ )
2421
+ );
2422
+ }
2423
+
2424
  function apbct_update_blogs_options($settings)
2425
  {
2426
  global $wpdb;
2553
  }
2554
 
2555
  /**
2556
+ * Checking availability of the handlers and return ajax type
2557
  *
2558
+ * @return string|false
2559
  */
2560
+ function apbct_settings__get_ajax_type()
2561
  {
2562
+ // Check custom ajax availability - 1
2563
  $res_custom_ajax = Helper::httpRequestGetResponseCode(esc_url(APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php'));
2564
  if ( $res_custom_ajax == 400 ) {
2565
+ return 'custom_ajax';
2566
  }
2567
 
2568
+ // Check rest availability - 0
2569
  $res_rest = Helper::httpRequestGetResponseCode(esc_url(apbct_get_rest_url()));
2570
  if ( $res_rest == 200 ) {
2571
+ return 'rest';
2572
  }
2573
 
2574
+ // Check WP ajax availability - 2
2575
  $res_ajax = Helper::httpRequestGetResponseCode(admin_url('admin-ajax.php'));
2576
  if ( $res_ajax == 400 ) {
2577
+ return 'admin_ajax';
2578
  }
2579
 
2580
  return false;
2584
  {
2585
  global $apbct;
2586
 
2587
+ switch ( $apbct->data['ajax_type'] ) {
2588
+ case 'rest':
2589
  $alt_cookies_type = esc_html__('REST API', 'cleantalk-spam-protect');
2590
  break;
2591
+ case 'custom_ajax':
2592
  $alt_cookies_type = esc_html__('CleanTalk AJAX handler', 'cleantalk-spam-protect');
2593
  break;
2594
+ case 'admin_ajax':
2595
  $alt_cookies_type = esc_html__('WP AJAX handler', 'cleantalk-spam-protect');
2596
  break;
2597
  default:
2607
 
2608
  echo '</div>';
2609
  }
2610
+
2611
+ function apbct_settings__ajax_handler_type_notification()
2612
+ {
2613
+ global $apbct;
2614
+
2615
+ switch ( $apbct->data['ajax_type'] ) {
2616
+ case 'rest':
2617
+ $alt_cookies_type = esc_html__('REST API', 'cleantalk-spam-protect');
2618
+ break;
2619
+ case 'custom_ajax':
2620
+ $alt_cookies_type = esc_html__('CleanTalk AJAX handler', 'cleantalk-spam-protect');
2621
+ break;
2622
+ case 'admin_ajax':
2623
+ $alt_cookies_type = esc_html__('WP AJAX handler', 'cleantalk-spam-protect');
2624
+ break;
2625
+ default:
2626
+ $alt_cookies_type = esc_html__('UNKNOWN', 'cleantalk-spam-protect');
2627
+ break;
2628
+ }
2629
+
2630
+ echo '<div class="apbct_settings-field_wrapper apbct_settings-field_wrapper--sub">';
2631
+ echo sprintf(
2632
+ esc_html__('JavaScript check was set on %s', 'cleantalk-spam-protect'),
2633
+ '<strong>' . $alt_cookies_type . '</strong><br>'
2634
+ );
2635
+
2636
+ echo '</div>';
2637
+ }
2638
+
2639
+ /**
2640
+ * Show button for changed account email
2641
+ */
2642
+ function apbct_settings__btn_change_account_email_html()
2643
+ {
2644
+ global $apbct;
2645
+
2646
+ if (
2647
+ ! is_main_site() &&
2648
+ isset($apbct->network_settings['multisite__work_mode']) &&
2649
+ $apbct->network_settings['multisite__work_mode'] == 1) {
2650
+ return '';
2651
+ }
2652
+
2653
+ return '(<button type="button"
2654
+ id="apbct-change-account-email"
2655
+ class="apbct-btn-as-link"
2656
+ data-default-text="'
2657
+ . __('change email', 'cleantalk-spam-protect') .
2658
+ '"
2659
+ data-save-text="'
2660
+ . __('save', 'cleantalk-spam-protect') .
2661
+ '">'
2662
+ . __('change email', 'cleantalk-spam-protect') .
2663
+ '</button>)';
2664
+ }
inc/cleantalk-updater.php CHANGED
@@ -637,7 +637,7 @@ function apbct_update_to_5_138_0()
637
 
638
  $result = \Cleantalk\ApbctWP\API::methodNoticePaidTill(
639
  $settings['api_key'],
640
- preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
641
  ! is_main_site() && $net_settings['white_label'] ? 'anti-spam-hosting' : 'antispam'
642
  );
643
 
@@ -1124,9 +1124,10 @@ function apbct_update_to_5_157_0()
1124
  if ( ! empty($apbct->settings['data__set_cookies__sessions']) ) {
1125
  $apbct->settings['data__set_cookies'] = 2;
1126
  }
1127
- $apbct->settings['data__set_cookies__alt_sessions_type'] = 0;
1128
 
1129
  $apbct->save('settings');
 
1130
 
1131
  cleantalk_get_brief_data($apbct->api_key);
1132
  }
@@ -1443,15 +1444,16 @@ function apbct_update_to_5_161_2()
1443
  // There is no available alt cookies types. Cookies will be disabled.
1444
  $apbct->settings['data__set_cookies'] = 0;
1445
  } else {
1446
- $apbct->settings['data__set_cookies__alt_sessions_type'] = 2;
1447
  }
1448
  } else {
1449
- $apbct->settings['data__set_cookies__alt_sessions_type'] = 0;
1450
  }
1451
  } else {
1452
- $apbct->settings['data__set_cookies__alt_sessions_type'] = 1;
1453
  }
1454
  $apbct->saveSettings();
 
1455
  }
1456
  }
1457
 
@@ -1497,15 +1499,16 @@ function apbct_update_to_5_162_1()
1497
  // There is no available alt cookies types. Cookies will be disabled.
1498
  $apbct->settings['data__use_ajax'] = 0;
1499
  } else {
1500
- $apbct->settings['data__use_ajax__type'] = 2;
1501
  }
1502
  } else {
1503
- $apbct->settings['data__use_ajax__type'] = 0;
1504
  }
1505
  } else {
1506
- $apbct->settings['data__use_ajax__type'] = 1;
1507
  }
1508
  $apbct->saveSettings();
 
1509
  }
1510
 
1511
  // Migrate old WPMS to the new wpms mode
@@ -1518,3 +1521,30 @@ function apbct_update_to_5_162_1()
1518
  $apbct->saveNetworkSettings();
1519
  }
1520
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
 
638
  $result = \Cleantalk\ApbctWP\API::methodNoticePaidTill(
639
  $settings['api_key'],
640
+ preg_replace('/http[s]?:\/\//', '', get_option('home'), 1),
641
  ! is_main_site() && $net_settings['white_label'] ? 'anti-spam-hosting' : 'antispam'
642
  );
643
 
1124
  if ( ! empty($apbct->settings['data__set_cookies__sessions']) ) {
1125
  $apbct->settings['data__set_cookies'] = 2;
1126
  }
1127
+ $apbct->data['ajax_type'] = 'rest';
1128
 
1129
  $apbct->save('settings');
1130
+ $apbct->save('data');
1131
 
1132
  cleantalk_get_brief_data($apbct->api_key);
1133
  }
1444
  // There is no available alt cookies types. Cookies will be disabled.
1445
  $apbct->settings['data__set_cookies'] = 0;
1446
  } else {
1447
+ $apbct->data['ajax_type'] = 'admin_ajax';
1448
  }
1449
  } else {
1450
+ $apbct->data['ajax_type'] = 'rest';
1451
  }
1452
  } else {
1453
+ $apbct->data['ajax_type'] = 'custom_ajax';
1454
  }
1455
  $apbct->saveSettings();
1456
+ $apbct->saveData();
1457
  }
1458
  }
1459
 
1499
  // There is no available alt cookies types. Cookies will be disabled.
1500
  $apbct->settings['data__use_ajax'] = 0;
1501
  } else {
1502
+ $apbct->data['ajax_type'] = 'admin_ajax';
1503
  }
1504
  } else {
1505
+ $apbct->data['ajax_type'] = 'rest';
1506
  }
1507
  } else {
1508
+ $apbct->data['ajax_type'] = 'custom_ajax';
1509
  }
1510
  $apbct->saveSettings();
1511
+ $apbct->saveData();
1512
  }
1513
 
1514
  // Migrate old WPMS to the new wpms mode
1521
  $apbct->saveNetworkSettings();
1522
  }
1523
  }
1524
+
1525
+ /**
1526
+ * 5.164
1527
+ */
1528
+ function apbct_update_to_5_164_0()
1529
+ {
1530
+ global $apbct;
1531
+
1532
+ $alt_cookies_type = isset($apbct->settings['data__set_cookies__alt_sessions_type'])
1533
+ ? $apbct->settings['data__set_cookies__alt_sessions_type']
1534
+ : false;
1535
+
1536
+ switch ((int)$alt_cookies_type) {
1537
+ case 0:
1538
+ $alt_cookies_type = 'rest';
1539
+ break;
1540
+ case 1:
1541
+ $alt_cookies_type = 'custom_ajax';
1542
+ break;
1543
+ case 2:
1544
+ $alt_cookies_type = 'admin_ajax';
1545
+ break;
1546
+ }
1547
+
1548
+ $apbct->data['ajax_type'] = $alt_cookies_type;
1549
+ $apbct->saveData();
1550
+ }
js/apbct-public--functions.min.js CHANGED
@@ -1,2 +1,2 @@
1
- function ctSetCookie(o,t,n){var e;("string"==typeof o&&"string"==typeof t||"number"==typeof t)&&(e="ct_pointer_data"===o||"ct_user_info"===o,o=[[o,t,n]]),0==+ctPublicFunctions.data__set_cookies||(1==+ctPublicFunctions.data__set_cookies?o.forEach(function(o,t,n){var e=void 0!==o[2]?"expires="+e+"; ":"",c="https:"===location.protocol?"; secure":"";document.cookie=o[0]+"="+encodeURIComponent(o[1])+"; "+e+"path=/; samesite=lax"+c}):2!=+ctPublicFunctions.data__set_cookies||e||(0==+ctPublicFunctions.data__set_cookies__alt_sessions_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:o}}):1==+ctPublicFunctions.data__set_cookies__alt_sessions_type?apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:o},{apbct_ajax:1,notJson:1}):2==+ctPublicFunctions.data__set_cookies__alt_sessions_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:o},{notJson:1})))}function apbct_public_sendAJAX(t,n,e){var c=n.callback||null,s=n.callback_context||null,a=n.callback_params||null,o=n.async||!0,l=n.notJson||null,i=n.timeout||15e3,e=e||null,r=n.button||null,u=n.spinner||null,_=n.progressbar||null,p=n.silent||null,b=n.no_nonce||null,d=n.apbct_ajax||null;"string"==typeof t?t=(t=!b?t+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce:t)+"&no_cache="+Math.random():(b||(t._ajax_nonce=ctPublicFunctions._ajax_nonce),t.no_cache=Math.random()),r&&(r.setAttribute("disabled","disabled"),r.style.cursor="not-allowed"),u&&jQuery(u).css("display","inline"),jQuery.ajax({type:"POST",url:d?ctPublicFunctions._apbct_ajax_url:ctPublicFunctions._ajax_url,data:t,async:o,success:function(o){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),u&&jQuery(u).css("display","none"),(o=!l?JSON.parse(o):o).error?(setTimeout(function(){_&&_.fadeOut("slow")},1e3),console.log("Error happens: "+(o.error||"Unkown"))):c&&(a?c.apply(s,a.concat(o,t,n,e)):c(o,t,n,e))},error:function(o,t,n){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),u&&jQuery(u).css("display","none"),n&&!p&&(console.log("APBCT_AJAX_ERROR"),console.log(o),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+n+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:i})}function apbct_public_sendREST(t,n){var e=n.callback||null,o=n.data||[],c=n.method||"POST";jQuery.ajax({type:c,url:ctPublicFunctions._rest_url+"cleantalk-antispam/v1/"+t,data:o,beforeSend:function(o){o.setRequestHeader("X-WP-Nonce",ctPublicFunctions._rest_nonce)},success:function(o){o.error?console.log("Error happens: "+(o.error||"Unknown")):e&&e(o,t,n,null)},error:function(o,t,n){n&&(console.log("APBCT_REST_ERROR"),console.log(o),console.log(t),console.log("Anti-spam by Cleantalk plugin REST API error: "+n+" Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}
2
  //# sourceMappingURL=apbct-public--functions.min.js.map
1
+ function ctSetCookie(t,o,n){var e;("string"==typeof t&&"string"==typeof o||"number"==typeof o)&&(e="ct_pointer_data"===t||"ct_user_info"===t,t=[[t,o,n]]),0==+ctPublicFunctions.data__set_cookies||(1==+ctPublicFunctions.data__set_cookies?t.forEach(function(t,o,n){var e=void 0!==t[2]?"expires="+e+"; ":"",a="https:"===location.protocol?"; secure":"";document.cookie=t[0]+"="+encodeURIComponent(t[1])+"; "+e+"path=/; samesite=lax"+a}):2!=+ctPublicFunctions.data__set_cookies||e||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:t}}):"custom_ajax"===ctPublicFunctions.data__ajax_type?apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:t},{apbct_ajax:1,notJson:1}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:t},{notJson:1})))}function apbct_public_sendAJAX(o,n,e){var a=n.callback||null,c=n.callback_context||null,s=n.callback_params||null,t=n.async||!0,l=n.notJson||null,r=n.timeout||15e3,e=e||null,u=n.button||null,i=n.spinner||null,_=n.progressbar||null,p=n.silent||null,b=n.no_nonce||null,d=n.apbct_ajax||null;"string"==typeof o?o=(o=!b?o+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce:o)+"&no_cache="+Math.random():(b||(o._ajax_nonce=ctPublicFunctions._ajax_nonce),o.no_cache=Math.random()),u&&(u.setAttribute("disabled","disabled"),u.style.cursor="not-allowed"),i&&jQuery(i).css("display","inline"),jQuery.ajax({type:"POST",url:d?ctPublicFunctions._apbct_ajax_url:ctPublicFunctions._ajax_url,data:o,async:t,success:function(t){u&&(u.removeAttribute("disabled"),u.style.cursor="pointer"),i&&jQuery(i).css("display","none"),(t=!l?JSON.parse(t):t).error?(setTimeout(function(){_&&_.fadeOut("slow")},1e3),console.log("Error happens: "+(t.error||"Unkown"))):a&&(s?a.apply(c,s.concat(t,o,n,e)):a(t,o,n,e))},error:function(t,o,n){u&&(u.removeAttribute("disabled"),u.style.cursor="pointer"),i&&jQuery(i).css("display","none"),n&&!p&&(console.log("APBCT_AJAX_ERROR"),console.log(t),console.log(o),console.log("Anti-spam by Cleantalk plugin error: "+n+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:r})}function apbct_public_sendREST(o,n){var e=n.callback||null,t=n.data||[],a=n.method||"POST";jQuery.ajax({type:a,url:ctPublicFunctions._rest_url+"cleantalk-antispam/v1/"+o,data:t,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",ctPublicFunctions._rest_nonce)},success:function(t){t.error?console.log("Error happens: "+(t.error||"Unknown")):e&&e(t,o,n,null)},error:function(t,o,n){n&&(console.log("APBCT_REST_ERROR"),console.log(t),console.log(o),console.log("Anti-spam by Cleantalk plugin REST API error: "+n+" Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}
2
  //# sourceMappingURL=apbct-public--functions.min.js.map
js/apbct-public--functions.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"apbct-public--functions.min.js","sources":["apbct-public--functions.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' || cookies === 'ct_user_info';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( +ctPublicFunctions.data__set_cookies === 0 ){\n return;\n\n // Using traditional cookies\n }else if( +ctPublicFunctions.data__set_cookies === 1 ){\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 = item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( +ctPublicFunctions.data__set_cookies === 2 && ! skip_alt ){\n\n // Using REST API handler\n if( +ctPublicFunctions.data__set_cookies__alt_sessions_type === 0 ){\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__set_cookies__alt_sessions_type === 1 ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n apbct_ajax: 1,\n notJson: 1,\n }\n );\n } else if( +ctPublicFunctions.data__set_cookies__alt_sessions_type === 2 ) {\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\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 var apbct_ajax = params.apbct_ajax || 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: apbct_ajax ? ctPublicFunctions._apbct_ajax_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, callback_params.concat( result, data, params, obj ) );\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}\n"],"names":["ctSetCookie","cookies","value","expires","skip_alt","ctPublicFunctions","data__set_cookies","forEach","item","i","arr","ctSecure","location","protocol","document","cookie","encodeURIComponent","data__set_cookies__alt_sessions_type","apbct_public_sendREST","method","data","apbct_public_sendAJAX","action","apbct_ajax","notJson","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","_apbct_ajax_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"],"mappings":"AAAA,SAASA,YAAaC,EAASC,EAAOC,GAElC,IACQC,GADe,iBAAZH,GAAyC,iBAAVC,GAAuC,iBAAVA,KAC/DE,EAAuB,oBAAZH,GAA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AE9C7B,GAECA,EAASyB,EAAQc,EAAOzC,EADd,OAKtB+B,MAAO,SAASO,EAAOC,EAAYC,GAC3BA,IACAN,QAAQC,IAAI,oBACZD,QAAQC,IAAIG,GACZJ,QAAQC,IAAII,GACZL,QAAQC,IAAI,iDAAmDK,EAAc"}
1
+ {"version":3,"file":"apbct-public--functions.min.js","sources":["apbct-public--functions.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' || cookies === 'ct_user_info';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( +ctPublicFunctions.data__set_cookies === 0 ){\n return;\n\n // Using traditional cookies\n }else if( +ctPublicFunctions.data__set_cookies === 1 ){\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 = item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( +ctPublicFunctions.data__set_cookies === 2 && ! 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 === 'custom_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n apbct_ajax: 1,\n notJson: 1,\n }\n );\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\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 var apbct_ajax = params.apbct_ajax || 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: apbct_ajax ? ctPublicFunctions._apbct_ajax_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, callback_params.concat( result, data, params, obj ) );\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}\n"],"names":["ctSetCookie","cookies","value","expires","skip_alt","ctPublicFunctions","data__set_cookies","forEach","item","i","arr","ctSecure","location","protocol","document","cookie","encodeURIComponent","data__ajax_type","apbct_public_sendREST","method","data","apbct_public_sendAJAX","action","apbct_ajax","notJson","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","_apbct_ajax_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"],"mappings":"AAAA,SAASA,YAAaC,EAASC,EAAOC,GAElC,IACQC,GADe,iBAAZH,GAAyC,iBAAVC,GAAuC,iBAAVA,KAC/DE,EAAuB,oBAAZH,GAA6C,iBAAZA,EAChDA,EAAU,CAAE,CAAEA,EAASC,EAAOC,KAIW,IAAxCE,kBAAkBC,oBAI4B,IAAxCD,kBAAkBC,kBACzBL,EAAQM,QAAS,SAAUC,EAAMC,EAAGC,GAChC,IAAIP,OAA6B,IAAZK,EAAK,GAAqB,WAAaL,EAAU,KAAO,GAC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js CHANGED
@@ -1,2 +1,2 @@
1
- function apbct_banner_check(){var c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbct_get_elems(t){for(var e,n=0,a=(t=t.split(",")).length;n<a;n++)e=jQuery("#"+t[n]),t[n]=0===e.length?jQuery("."+t[n]):e;return t}function apbct_get_elems__native(t){"string"==typeof t&&(t=t.split(","));var c=[];return t.forEach(function(t,e,n){var a=document.getElementById(t);if(null===a){if(null!==(a=document.getElementsByClassName(t))&&0!==a.length)for(key in a)0<=+key&&c.push(a[key])}else c.push(a[key])}),c}function apbct_show_hide_elem(t){for(var e=0,n=(t=apbct_get_elems(t)).length;e<n;e++)t[e].each(function(t,e){var n=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),n&&n.hide()):(e.show(),n&&n.show())})}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbct_get_elems__native(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null===t.getAttribute("apbct_children")||null!==(a=apbctSettingsDependencies_getState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependencies_getState(t){var e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbct_settings__showDescription(t,e){function c(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))}c(),t.after("<div id='apbct_long_desc__"+e+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+e);n.append("<i class='icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.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'>"+t.title+"</h3>").append("<p>"+t.desc+"</p>"),jQuery(document).on("click",c)}},n)}jQuery(document).ready(function(){document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),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 t=new Date;jQuery("#ct_admin_timezone").val(t.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("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto"},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var c,t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0!==t.data("id")?(t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")},c=this,apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})):console.log('Attribute "data-id" not set for the option.')}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");if(e.css("border-color","inherit"),void 0!==t.data("id")){if("new_template"===t.data("id")){var n=e.val();if(""===n)return void e.css("border-color","red");n={template_name:n}}else n={template_id:t.data("id")};var c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}else console.log('Attribute "data-id" not set for the option.')}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){var c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&document.location.reload()}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){self=jQuery(this),apbct_settings__showDescription(self,self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbct_banner_check(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()})});
2
  //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
1
+ function apbct_banner_check(){var c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbct_get_elems(t){for(var e,n=0,a=(t=t.split(",")).length;n<a;n++)e=jQuery("#"+t[n]),t[n]=0===e.length?jQuery("."+t[n]):e;return t}function apbct_get_elems__native(t){"string"==typeof t&&(t=t.split(","));var c=[];return t.forEach(function(t,e,n){var a=document.getElementById(t);if(null===a){if(null!==(a=document.getElementsByClassName(t))&&0!==a.length)for(key in a)0<=+key&&c.push(a[key])}else c.push(a[key])}),c}function apbct_show_hide_elem(t){for(var e=0,n=(t=apbct_get_elems(t)).length;e<n;e++)t[e].each(function(t,e){var n=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),n&&n.hide()):(e.show(),n&&n.show())})}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbct_get_elems__native(t).forEach(function(t,e,n){var a;null===c&&(c=null===t.getAttribute("disabled")?0:1),1===c?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null===t.getAttribute("apbct_children")||null!==(a=apbctSettingsDependencies_getState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependencies_getState(t){var e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbct_settings__showDescription(t,e){var c=function(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))};c(),t.after("<div id='apbct_long_desc__"+e+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+e);n.append("<i class= 'apbct-icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+t.title+"</h3>").append("<p>"+t.desc+"</p>"),jQuery(document).on("click",c)}},n)}function apbct_save_button_position(){var t,e,n,a,c,s,o,i;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,o=(s=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,i=s.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t<o+i+c?(a.style.bottom="",a.style.top=o+i+20+"px"):(a.style.bottom=0,a.style.top="")):jQuery("#apbct_settings__main_save_button").show(),s.style.top=n<=0?30-n+"px":0)}jQuery(document).ready(function(){document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),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 t=new Date;jQuery("#ct_admin_timezone").val(t.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("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto"},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var t,c,e=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0!==e.data("id")?(t={template_id:e.data("id"),template_name:e.data("name"),settings:e.data("settings")},c=this,apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})):console.log('Attribute "data-id" not set for the option.')}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");if(e.css("border-color","inherit"),void 0!==t.data("id")){if("new_template"===t.data("id")){var n=e.val();if(""===n)return void e.css("border-color","red");var a={template_name:n}}else a={template_id:t.data("id")};var c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:a},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}else console.log('Attribute "data-id" not set for the option.')}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){var c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&document.location.reload()}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){self=jQuery(this),apbct_settings__showDescription(self,self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbct_banner_check(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbct_save_button_position(),window.addEventListener("scroll",apbct_save_button_position),jQuery("#ct_adv_showhide a").on("click",apbct_save_button_position),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var e=jQuery(this),n=jQuery("#apbct-account-email"),a=n.text();e.toggleClass("active"),e.hasClass("active")?(e.text(e.data("save-text")),n.attr("contenteditable","true"),n.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),n.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:a},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),n.attr("contenteditable","false"),e.text(e.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();if(""===t||null===t.match(/^[a-z\d]{3,15}$/))return jQuery("#apbct_button__get_key_auto").show(),void jQuery('button.cleantalk_link[value="save_changes"]').prop("disabled",!0);jQuery("#apbct_button__get_key_auto").hide(),jQuery('button.cleantalk_link[value="save_changes"]').prop("disabled",!1)})});
2
  //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
js/cleantalk-admin-settings-page.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Crunch for Right to Left direction languages\n\tif(document.getElementsByClassName('apbct_settings-title')[0]) {\n\t\tif(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){\n\t\t\tjQuery('.apbct_switchers').css('text-align', 'right');\n\t\t}\n\t}\n\n\t// Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\t\n\t// GDPR modal window\n\tjQuery('#apbct_gdpr_open_modal').on('click', function(){\n\t\tjQuery('#gdpr_dialog').dialog({\n\t\t\tmodal:true, \n\t\t\tshow: true,\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\n\t\t\theight: 'auto',\n\t\t\ttitle: 'GDPR compliance',\n\t\t\tdraggable: false,\n\t\t\tresizable: false,\n\t\t\tcloseText: \"Close\",\n\t\t});\n\t});\n\n\t// Key KEY automatically\n\tjQuery('#apbct_button__get_key_auto').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__get_key_auto' ),\n\t\t\t\tspinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tcleantalkModal.loaded = result.getTemplates;\n\t\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\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\t// Import settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_import_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\t'template_id' : optionSelected.data('id'),\n\t\t\t'template_name' : optionSelected.data('name'),\n\t\t\t'settings' : optionSelected.data('settings')\n\t\t};\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_import', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Export settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_export_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tif( optionSelected.data('id') === 'new_template' ) {\n\t\t\tvar templateName = templateNameInput.val();\n\t\t\tif( templateName === '' ) {\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar data = {\n\t\t\t\t'template_name' : templateName\n\t\t\t}\n\t\t} else {\n\t\t\tvar data = {\n\t\t\t\t'template_id' : optionSelected.data('id')\n\t\t\t}\n\t\t}\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_export', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Reset settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_reset'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Sync button\n\tjQuery('#apbct_button__sync').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__sync' ),\n\t\t\t\tspinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__sync .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\tif( ctSettingsPage.key_changed )\n\t\tjQuery('#apbct_button__sync').click();\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)\n\t\tapbct_banner_check();\n\n\tjQuery(document).on('change', '#apbct_settings_templates_export',function(){\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n\t\t}\n\t});\n\t\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_renew').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_renew').hide('slow');\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_trial').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_trial').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of output array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\n\tenable = ! isNaN(enable) ? enable : null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable === null) // Set\n\t\t\tenable = elem.getAttribute('disabled') === null ? 0 : 1;\n\n\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\tif( elem.getAttribute('apbct_children') !== null){\n\t\t\tvar state = apbctSettingsDependencies_getState( elem ) && enable;\n\t\t\tif( state !== null ) {\n\t\t\t\tapbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n\t\t\t}\n\t\t}\n\n\t});\n}\n\nfunction apbctSettingsDependencies_getState( elem ){\n\n\tvar state;\n\n\tswitch ( elem.getAttribute( 'type' ) ){\n\t\tcase 'checkbox':\n\t\t\tstate = +elem.checked;\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\t\tstate = +(+elem.getAttribute('value') === 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate = null;\n\t}\n\n\treturn state;\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class='icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_admin_sendAJAX(\n\t\t{action: 'apbct_settings__get__long_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","getElementsByClassName","key","push","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependencies_getState","checked","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","ready","getComputedStyle","direction","val","attr","this","fadeOut","d","Date","getTimezoneOffset","dialog","modal","my","at","of","window","width","height","draggable","resizable","closeText","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","template_id","template_name","settings","notJson","success","insertAfter","close","console","log","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find"],"mappings":"AA0NA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAACC,OAAQ,sCACT,CACCC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACpCH,EAAOI,qBACNC,OAAO,2BAA2BC,QACrCD,OAAO,2BAA2BE,KAAK,QACpCF,OAAO,2BAA2BC,QACrCD,OAAO,2BAA2BE,KAAK,QACxCC,cAAcb,QAKhB,KAUJ,SAASc,gBAAgBC,GAErB,IAAK,IAA6BC,EAAzBC,EAAE,EAAGC,GADdH,EAAQA,EAAMI,MAAM,MACMR,OAAaM,EAAIC,EAAKD,IAC5CD,EAAMN,OAAO,IAAIK,EAAME,IACvBF,EAAME,GAAoB,IAAfD,EAAIL,OAAeD,OAAO,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antalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Crunch for Right to Left direction languages\n\tif(document.getElementsByClassName('apbct_settings-title')[0]) {\n\t\tif(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){\n\t\t\tjQuery('.apbct_switchers').css('text-align', 'right');\n\t\t}\n\t}\n\n\t// Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\t\n\t// GDPR modal window\n\tjQuery('#apbct_gdpr_open_modal').on('click', function(){\n\t\tjQuery('#gdpr_dialog').dialog({\n\t\t\tmodal:true, \n\t\t\tshow: true,\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\n\t\t\theight: 'auto',\n\t\t\ttitle: 'GDPR compliance',\n\t\t\tdraggable: false,\n\t\t\tresizable: false,\n\t\t\tcloseText: \"Close\",\n\t\t});\n\t});\n\n\t// Key KEY automatically\n\tjQuery('#apbct_button__get_key_auto').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__get_key_auto' ),\n\t\t\t\tspinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tcleantalkModal.loaded = result.getTemplates;\n\t\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\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\t// Import settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_import_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\t'template_id' : optionSelected.data('id'),\n\t\t\t'template_name' : optionSelected.data('name'),\n\t\t\t'settings' : optionSelected.data('settings')\n\t\t};\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_import', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Export settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_export_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tif( optionSelected.data('id') === 'new_template' ) {\n\t\t\tvar templateName = templateNameInput.val();\n\t\t\tif( templateName === '' ) {\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar data = {\n\t\t\t\t'template_name' : templateName\n\t\t\t}\n\t\t} else {\n\t\t\tvar data = {\n\t\t\t\t'template_id' : optionSelected.data('id')\n\t\t\t}\n\t\t}\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_export', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Reset settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_reset'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Sync button\n\tjQuery('#apbct_button__sync').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__sync' ),\n\t\t\t\tspinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__sync .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\tif( ctSettingsPage.key_changed )\n\t\tjQuery('#apbct_button__sync').click();\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)\n\t\tapbct_banner_check();\n\n\tjQuery(document).on('change', '#apbct_settings_templates_export',function(){\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n\t\t}\n\t});\n\n\tapbct_save_button_position();\n\twindow.addEventListener('scroll', apbct_save_button_position);\n\tjQuery('#ct_adv_showhide a').on('click', apbct_save_button_position);\n\n\n\t/**\n\t * Change cleantalk account email\n\t */\n\tjQuery('#apbct-change-account-email').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tvar $this = jQuery(this);\n\t\tvar accountEmailField = jQuery('#apbct-account-email');\n\t\tvar accountEmail = accountEmailField.text();\n\n\t\t$this.toggleClass('active');\n\n\t\tif ($this.hasClass('active')) {\n\t\t\t$this.text($this.data('save-text'));\n\t\t\taccountEmailField.attr('contenteditable', 'true');\n\t\t\taccountEmailField.on('keydown', function (e) {\n\t\t\t\tif (e.code === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t\taccountEmailField.on('input', function (e) {\n\t\t\t\tif (e.inputType === 'insertParagraph') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tapbct_admin_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_update_account_email',\n\t\t\t\t\taccountEmail: accountEmail\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttimeout: 5000,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tif (result.success !== undefined && result.success === 'ok') {\n\t\t\t\t\t\t\tif (result.manuallyLink !== undefined) {\n\t\t\t\t\t\t\t\tjQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (result.error !== undefined) {\n\t\t\t\t\t\t\tjQuery('#apbct-account-email').css('border-color', 'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\taccountEmailField.attr('contenteditable', 'false');\n\t\t\t$this.text($this.data('default-text'));\n\t\t}\n\t});\n\n\t/**\n\t * Validate apkikey and hide get auto btn\n\t */\n\tjQuery('#apbct_setting_apikey').on('input', function () {\n\t\tvar enteredValue = jQuery(this).val();\n\n\t\tif (enteredValue === '' || enteredValue.match(/^[a-z\\d]{3,15}$/) === null) {\n\t\t\tjQuery('#apbct_button__get_key_auto').show();\n\t\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').prop('disabled', true);\n\t\t\treturn;\n\t\t}\n\n\t\tjQuery('#apbct_button__get_key_auto').hide();\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').prop('disabled', false);\n\t});\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_renew').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_renew').hide('slow');\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_trial').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_trial').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of output array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\n\tenable = ! isNaN(enable) ? enable : null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable === null) // Set\n\t\t\tenable = elem.getAttribute('disabled') === null ? 0 : 1;\n\n\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\tif( elem.getAttribute('apbct_children') !== null){\n\t\t\tvar state = apbctSettingsDependencies_getState( elem ) && enable;\n\t\t\tif( state !== null ) {\n\t\t\t\tapbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n\t\t\t}\n\t\t}\n\n\t});\n}\n\nfunction apbctSettingsDependencies_getState( elem ){\n\n\tvar state;\n\n\tswitch ( elem.getAttribute( 'type' ) ){\n\t\tcase 'checkbox':\n\t\t\tstate = +elem.checked;\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\t\tstate = +(+elem.getAttribute('value') === 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate = null;\n\t}\n\n\treturn state;\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class= 'apbct-icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_admin_sendAJAX(\n\t\t{action: 'apbct_settings__get__long_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\nfunction apbct_save_button_position() {\n\tif (\n\t\tdocument.getElementById('apbct_settings__before_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__after_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__button_section') === null ||\n\t\tdocument.getElementById('apbct_settings__advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_hidden_section_nav') === null\n\t) {\n\t\treturn;\n\t}\n\tvar docInnerHeight = window.innerHeight;\n\tvar advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n\tvar advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n\tvar buttonBlock = document.getElementById('apbct_settings__button_section');\n\tvar buttonHeight = buttonBlock.getBoundingClientRect().height;\n\tvar navBlock = document.getElementById('apbct_hidden_section_nav');\n\tvar navBlockOffset = navBlock.getBoundingClientRect().top;\n\tvar navBlockHeight = navBlock.getBoundingClientRect().height;\n\n\t// Set Save button position\n\tif ( getComputedStyle(advSettingsBlock).display !== \"none\" ) {\n\t\tjQuery('#apbct_settings__main_save_button').hide();\n\t\tif ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n\t\t\tbuttonBlock.style.bottom = '';\n\t\t\tbuttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n\t\t} else {\n\t\t\tbuttonBlock.style.bottom = 0;\n\t\t\tbuttonBlock.style.top = '';\n\t\t}\n\t} else {\n\t\tjQuery('#apbct_settings__main_save_button').show();\n\t}\n\n\t// Set nav position\n\tif ( advSettingsOffset <= 0 ) {\n\t\tnavBlock.style.top = - advSettingsOffset + 30 + 'px';\n\t} else {\n\t\tnavBlock.style.top = 0;\n\t}\n}"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","getElementsByClassName","key","push","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependencies_getState","checked","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","apbct_save_button_position","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","display","style","bottom","ready","direction","val","attr","this","fadeOut","d","Date","getTimezoneOffset","dialog","modal","my","at","of","width","draggable","resizable","closeText","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","template_id","template_name","settings","notJson","success","insertAfter","close","console","log","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","preventDefault","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","prop"],"mappings":"AAkSA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAACC,OAAQ,sCACT,CACCC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACpCH,EAAOI,qBACNC,OAAO,2BAA2BC,QACrCD,OAAO,2BAA2BE,KAAK,QACpCF,OAAO,2BAA2BC,QACrCD,OAAO,2BAA2BE,KAAK,QACxCC,cAAcb,QAKhB,KAUJ,SAASc,gBAAgBC,GAErB,IAAK,IAA6BC,EAAzBC,EAAE,EAAGC,GADdH,EAAQA,EAAMI,MAAM,MACMR,OAAaM,EAAIC,EAAKD,IAC5CD,EAAMN,OAAO,IAAIK,EAAME,IACvBF,EAAME,GAAoB,IAAfD,EAAIL,OAAeD,OAAO,IAAIK,EAAME,IAAMD,EAEzD,OAAOD,EAUX,SAASK,wBAAwBL,GAGZ,iBAAVA,IACTA,EAAQA,EAAMI,MAAM,MAErB,IAAIE,EAAM,GAuBV,OArBAN,EAAMO,QAAQ,SAASC,EAAMN,EAAGO,GAG/B,IAAIR,EAAMS,SAASC,eAAeH,GAClC,GAAY,OAARP,GAQJ,GAAY,QADZA,EAAMS,SAASE,uBAAuBJ,KACJ,IAAdP,EAAIL,OACvB,IAAIiB,OAAOZ,EACE,IAAPY,KACJP,EAAIQ,KAAMb,EAAIY,WAVhBP,EAAIQ,KAAMb,EAAIY,QAgBTP,EAGR,SAASS,qBAAqBf,GAE1B,IAAK,IAAIE,EAAE,EAAGC,GADjBH,EAAQD,gBAAgBC,IACKJ,OAAQM,EAAIC,EAAKD,IACvCF,EAAME,GAAGc,KAAK,SAAUd,EAAGM,GAEvB,IAAIS,GADJT,EAAOb,OAAOa,IACGU,KAAK,UAAYV,EAAKW,KAAK,UAAY,KACpDX,EAAKY,GAAG,aACRZ,EAAKX,OACDoB,GAAOA,EAAMpB,SAEjBW,EAAKa,OACDJ,GAA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*\..*/)}function ct_is_ip(e){return e.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)}jQuery(document).ready(function(){parseInt(ctUsersScreen.ct_show_check_links)&&(jQuery(".column-email a").each(function(){var e=jQuery(this).html();-1!==ct_is_email(e)&&jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+e+'" target="_blank" title="https://cleantalk.org/blacklists/'+e+'" class="ct_link_new_tab"><img src="'+ctUsersScreen.ct_img_src_new_tab+'"></a>')}),jQuery(".username.column-username").each(function(){var e=jQuery(this).siblings(".apbct_status").children("span"),t=e.attr("id"),c=e.text(),r=jQuery("<span>",{text:c}),s=jQuery("<i>",{class:"icon-ok"}),a=jQuery("<i>",{class:"icon-cancel",css:{color:"red"}});"apbct_not_checked"===t&&jQuery(this).children(".row-actions").before(s).before(r),"apbct_checked_not_spam"===t&&(s.attr("style","color:green;"),jQuery(this).children(".row-actions").before(s).before(r)),"apbct_checked_spam"===t&&jQuery(this).children(".row-actions").before(a).before(r)}))});
2
  //# sourceMappingURL=cleantalk-users-editscreen.min.js.map
1
+ function ct_is_email(e){return e.search(/.*@.*\..*/)}function ct_is_ip(e){return e.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)}jQuery(document).ready(function(){parseInt(ctUsersScreen.ct_show_check_links)&&(jQuery(".column-email a").each(function(){var e=jQuery(this).html();-1!==ct_is_email(e)&&jQuery(this).after('&nbsp;<a href="https://cleantalk.org/blacklists/'+e+'" target="_blank" title="https://cleantalk.org/blacklists/'+e+'" class="ct_link_new_tab"><img src="'+ctUsersScreen.ct_img_src_new_tab+'"></a>')}),jQuery(".username.column-username").each(function(){var e=jQuery(this).siblings(".apbct_status").children("span"),t=e.attr("id"),c=e.text(),r=jQuery("<span>",{text:c}),s=jQuery("<i>",{class:"apbct-icon-ok"}),a=jQuery("<i>",{class:"apbct-icon-cancel",css:{color:"red"}});"apbct_not_checked"===t&&jQuery(this).children(".row-actions").before(s).before(r),"apbct_checked_not_spam"===t&&(s.attr("style","color:green;"),jQuery(this).children(".row-actions").before(s).before(r)),"apbct_checked_spam"===t&&jQuery(this).children(".row-actions").before(a).before(r)}))});
2
  //# sourceMappingURL=cleantalk-users-editscreen.min.js.map
js/cleantalk-users-editscreen.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cleantalk-users-editscreen.min.js","sources":["cleantalk-users-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\n\tif(parseInt(ctUsersScreen.ct_show_check_links)) {\n\n\t\t/* Shows link to blacklists near every email and IP address */\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif( ct_is_email(ct_curr_str) !== -1 ){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\n\t\t/* Show checked ico near avatar */\n\t\tjQuery('.username.column-username').each(function(){\n\n\t\t\tvar apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');\n\t\t\tvar apbct_checking_status = apbct_checking_el.attr('id');\n\t\t\tvar apbct_checking_status_text = apbct_checking_el.text();\n\n\t\t\tvar apbct_add_text_element = jQuery('<span>', {\n\t\t\t\ttext : apbct_checking_status_text\n\t\t\t});\n\t\t\tvar apbct_add_ico_ok = jQuery('<i>', {\n\t\t\t\tclass : 'icon-ok'\n\t\t\t});\n\t\t\tvar apbct_add_ico_cancel = jQuery('<i>', {\n\t\t\t\tclass : 'icon-cancel',\n\t\t\t\tcss : {\n\t\t\t\t\tcolor : 'red'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif( apbct_checking_status ==='apbct_not_checked' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_not_spam' ) {\n\t\t\t\tapbct_add_ico_ok.attr('style', 'color:green;');\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_spam' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);\n\t\t\t}\n\n\t\t});\n\n\t}\n\n});"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab","apbct_checking_el","siblings","children","apbct_checking_status","attr","apbct_checking_status_text","text","apbct_add_text_element","apbct_add_ico_ok","class","apbct_add_ico_cancel","css","color","before"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCAGnBE,OAAOC,UAAUC,MAAM,WAGnBC,SAASC,cAAcC,uBAGzBL,OAAO,mBAAmBM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,MAAMC,QACG,IAA9Bb,YAAYW,IACfP,OAAOQ,MAAME,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB,YAKrOX,OAAO,6BAA6BM,KAAK,WAExC,IAAIM,EAAoBZ,OAAOQ,MAAMK,SAAS,iBAAiBC,SAAS,QACpEC,EAAwBH,EAAkBI,KAAK,MAC/CC,EAA6BL,EAAkBM,OAE/CC,EAAyBnB,OAAO,SAAU,CAC7CkB,KAAOD,IAEJG,EAAmBpB,OAAO,MAAO,CACpCqB,MAAQ,YAELC,EAAuBtB,OAAO,MAAO,CACxCqB,MAAQ,cACRE,IAAM,CACLC,MAAQ,SAImB,sBAAzBT,GACHf,OAAOQ,MAAMM,SAAS,gBAAgBW,OAAOL,GAAkBK,OAAON,GAE1C,2BAAzBJ,IACHK,EAAiBJ,KAAK,QAAS,gBAC/BhB,OAAOQ,MAAMM,SAAS,gBAAgBW,OAAOL,GAAkBK,OAAON,IAE1C,uBAAzBJ,GACHf,OAAOQ,MAAMM,SAAS,gBAAgBW,OAAOH,GAAsBG,OAAON"}
1
+ {"version":3,"file":"cleantalk-users-editscreen.min.js","sources":["cleantalk-users-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\n\tif(parseInt(ctUsersScreen.ct_show_check_links)) {\n\n\t\t/* Shows link to blacklists near every email and IP address */\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif( ct_is_email(ct_curr_str) !== -1 ){\n\t\t\t\tjQuery(this).after('&nbsp;<a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\n\t\t/* Show checked ico near avatar */\n\t\tjQuery('.username.column-username').each(function(){\n\n\t\t\tvar apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');\n\t\t\tvar apbct_checking_status = apbct_checking_el.attr('id');\n\t\t\tvar apbct_checking_status_text = apbct_checking_el.text();\n\n\t\t\tvar apbct_add_text_element = jQuery('<span>', {\n\t\t\t\ttext : apbct_checking_status_text\n\t\t\t});\n\t\t\tvar apbct_add_ico_ok = jQuery('<i>', {\n\t\t\t\tclass : 'apbct-icon-ok'\n\t\t\t});\n\t\t\tvar apbct_add_ico_cancel = jQuery('<i>', {\n\t\t\t\tclass : 'apbct-icon-cancel',\n\t\t\t\tcss : {\n\t\t\t\t\tcolor : 'red'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif( apbct_checking_status ==='apbct_not_checked' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_not_spam' ) {\n\t\t\t\tapbct_add_ico_ok.attr('style', 'color:green;');\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_spam' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);\n\t\t\t}\n\n\t\t});\n\n\t}\n\n});"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab","apbct_checking_el","siblings","children","apbct_checking_status","attr","apbct_checking_status_text","text","apbct_add_text_element","apbct_add_ico_ok","class","apbct_add_ico_cancel","css","color","before"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,aAEnB,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,wCAGnBE,OAAOC,UAAUC,MAAM,WAGnBC,SAASC,cAAcC,uBAGzBL,OAAO,mBAAmBM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,MAAMC,QACG,IAA9Bb,YAAYW,IACfP,OAAOQ,MAAME,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB,YAKrOX,OAAO,6BAA6BM,KAAK,WAExC,IAAIM,EAAoBZ,OAAOQ,MAAMK,SAAS,iBAAiBC,SAAS,QACpEC,EAAwBH,EAAkBI,KAAK,MAC/CC,EAA6BL,EAAkBM,OAE/CC,EAAyBnB,OAAO,SAAU,CAC7CkB,KAAOD,IAEJG,EAAmBpB,OAAO,MAAO,CACpCqB,MAAS,kBAENC,EAAuBtB,OAAO,MAAO,CACxCqB,MAAS,oBACTE,IAAM,CACLC,MAAQ,SAImB,sBAAzBT,GACHf,OAAOQ,MAAMM,SAAS,gBAAgBW,OAAOL,GAAkBK,OAAON,GAE1C,2BAAzBJ,IACHK,EAAiBJ,KAAK,QAAS,gBAC/BhB,OAAOQ,MAAMM,SAAS,gBAAgBW,OAAOL,GAAkBK,OAAON,IAE1C,uBAAzBJ,GACHf,OAAOQ,MAAMM,SAAS,gBAAgBW,OAAOH,GAAsBG,OAAON"}
lib/Cleantalk/ApbctWP/AdminNotices.php CHANGED
@@ -118,7 +118,7 @@ class AdminNotices
118
  if ( $this->apbct->notice_show && ! empty($this->apbct->errors['key_get']) && ! $this->apbct->white_label ) {
119
  $register_link =
120
  'https://cleantalk.org/register?platform=wordpress&email=' . urlencode(ct_get_admin_email()) .
121
- '&website=' . urlencode(get_option('siteurl'));
122
  $content =
123
  sprintf(
124
  __("Unable to get Access key automatically: %s", 'cleantalk-spam-protect'),
@@ -294,7 +294,7 @@ class AdminNotices
294
  public function addAttentionMark($after)
295
  {
296
  if ( $this->apbct->notice_show ) {
297
- return $after . '<i class="icon-attention-alt"></i>';
298
  }
299
 
300
  return $after;
118
  if ( $this->apbct->notice_show && ! empty($this->apbct->errors['key_get']) && ! $this->apbct->white_label ) {
119
  $register_link =
120
  'https://cleantalk.org/register?platform=wordpress&email=' . urlencode(ct_get_admin_email()) .
121
+ '&website=' . urlencode(get_option('home'));
122
  $content =
123
  sprintf(
124
  __("Unable to get Access key automatically: %s", 'cleantalk-spam-protect'),
294
  public function addAttentionMark($after)
295
  {
296
  if ( $this->apbct->notice_show ) {
297
+ return $after . '<i class="apbct-icon-attention-alt"></i>';
298
  }
299
 
300
  return $after;
lib/Cleantalk/ApbctWP/Ajax.php CHANGED
@@ -76,13 +76,13 @@ class Ajax
76
  break;
77
  case 'apbct_alt_session__save__AJAX':
78
  // Using alternative sessions with ajax
79
- if ( $apbct->settings['data__set_cookies'] == 2 && $apbct->settings['data__set_cookies__alt_sessions_type'] == 1 ) {
80
  apbct_alt_session__save__AJAX();
81
  }
82
  break;
83
  case 'apbct_alt_session__get__AJAX':
84
  // Using alternative sessions with ajax
85
- if ( $apbct->settings['data__set_cookies'] == 2 && $apbct->settings['data__set_cookies__alt_sessions_type'] == 1 ) {
86
  apbct_alt_session__get__AJAX();
87
  }
88
  break;
76
  break;
77
  case 'apbct_alt_session__save__AJAX':
78
  // Using alternative sessions with ajax
79
+ if ( $apbct->settings['data__set_cookies'] == 2 && $apbct->data['ajax_type'] === 'custom_ajax' ) {
80
  apbct_alt_session__save__AJAX();
81
  }
82
  break;
83
  case 'apbct_alt_session__get__AJAX':
84
  // Using alternative sessions with ajax
85
+ if ( $apbct->settings['data__set_cookies'] == 2 && $apbct->data['ajax_type'] === 'custom_ajax' ) {
86
  apbct_alt_session__get__AJAX();
87
  }
88
  break;
lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php CHANGED
@@ -493,7 +493,7 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule
493
  '_rest_url' => esc_url(get_rest_url()),
494
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
495
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
496
- 'data__set_cookies__alt_sessions_type' => $apbct->settings['data__set_cookies__alt_sessions_type'],
497
  'sfw__random_get' => $apbct->settings['sfw__random_get'] === '1' ||
498
  ($apbct->settings['sfw__random_get'] === '-1' && apbct_is_cache_plugins_exists())
499
  );
493
  '_rest_url' => esc_url(get_rest_url()),
494
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
495
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
496
+ 'data__ajax_type' => $apbct->data['ajax_type'],
497
  'sfw__random_get' => $apbct->settings['sfw__random_get'] === '1' ||
498
  ($apbct->settings['sfw__random_get'] === '-1' && apbct_is_cache_plugins_exists())
499
  );
lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php CHANGED
@@ -262,7 +262,7 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule
262
  '_rest_url' => esc_url(get_rest_url()),
263
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
264
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
265
- 'data__set_cookies__alt_sessions_type' => $apbct->settings['data__set_cookies__alt_sessions_type'],
266
  'sfw__random_get' => $apbct->settings['sfw__random_get'] === '1' ||
267
  ($apbct->settings['sfw__random_get'] === '-1' && apbct_is_cache_plugins_exists())
268
  );
262
  '_rest_url' => esc_url(get_rest_url()),
263
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
264
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
265
+ 'data__ajax_type' => $apbct->data['ajax_type'],
266
  'sfw__random_get' => $apbct->settings['sfw__random_get'] === '1' ||
267
  ($apbct->settings['sfw__random_get'] === '-1' && apbct_is_cache_plugins_exists())
268
  );
lib/Cleantalk/ApbctWP/Firewall/SFW.php CHANGED
@@ -415,7 +415,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule
415
  '_rest_url' => esc_url(get_rest_url()),
416
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
417
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
418
- 'data__set_cookies__alt_sessions_type' => $apbct->settings['data__set_cookies__alt_sessions_type'],
419
  'sfw__random_get' => $apbct->settings['sfw__random_get'] === '1' ||
420
  ($apbct->settings['sfw__random_get'] === '-1' && apbct_is_cache_plugins_exists())
421
  );
415
  '_rest_url' => esc_url(get_rest_url()),
416
  '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php',
417
  'data__set_cookies' => $apbct->settings['data__set_cookies'],
418
+ 'data__ajax_type' => $apbct->data['ajax_type'],
419
  'sfw__random_get' => $apbct->settings['sfw__random_get'] === '1' ||
420
  ($apbct->settings['sfw__random_get'] === '-1' && apbct_is_cache_plugins_exists())
421
  );
lib/Cleantalk/ApbctWP/Helper.php CHANGED
@@ -109,7 +109,7 @@ class Helper extends \Cleantalk\Common\Helper
109
  }
110
 
111
  static::httpRequest(
112
- get_option('siteurl'),
113
  $request_params,
114
  $patterns
115
  );
@@ -135,7 +135,7 @@ class Helper extends \Cleantalk\Common\Helper
135
  }
136
 
137
  $result = static::httpRequest(
138
- get_option('siteurl'),
139
  array_merge($request_params, array('test' => 'test')),
140
  $patterns
141
  );
109
  }
110
 
111
  static::httpRequest(
112
+ substr(get_option('home'), -1) === '/' ? get_option('home') : get_option('home') . '/',
113
  $request_params,
114
  $patterns
115
  );
135
  }
136
 
137
  $result = static::httpRequest(
138
+ substr(get_option('home'), -1) === '/' ? get_option('home') : get_option('home') . '/',
139
  array_merge($request_params, array('test' => 'test')),
140
  $patterns
141
  );
lib/Cleantalk/ApbctWP/State.php CHANGED
@@ -83,14 +83,11 @@ class State extends \Cleantalk\Common\State
83
  'data__protect_logged_in' => 1,
84
  // Do anti-spam tests to for logged in users.
85
  'data__use_ajax' => 1,
86
- 'data__use_ajax__type' => 1,
87
  // Ajax handler type: REST API - 0 / custom AJAX - 1 / WP AJAX - 2
88
  'data__use_static_js_key' => -1,
89
  'data__general_postdata_test' => 0,
90
  //CAPD
91
  'data__set_cookies' => 1,
92
- // Set cookies: Disable - 0 / Enable - 1 / Use Alternative cookies - 2.
93
- 'data__set_cookies__alt_sessions_type' => 0,
94
  // Alternative cookies handler type: REST API - 0 / custom AJAX - 1 / WP AJAX - 2
95
  'data__ssl_on' => 0,
96
  // Secure connection to servers
@@ -144,6 +141,7 @@ class State extends \Cleantalk\Common\State
144
  'last_remote_call' => 0, //Timestam of last remote call
145
  'current_settings_template_id' => null, // Loaded settings template id
146
  'current_settings_template_name' => null, // Loaded settings template name
 
147
 
148
  // Antispam
149
  'spam_store_days' => 15, // Days before delete comments from folder Spam
@@ -151,6 +149,7 @@ class State extends \Cleantalk\Common\State
151
  'notice_api_errors' => 0, // Send API error notices to WP admin
152
 
153
  // Account data
 
154
  'service_id' => 0,
155
  'moderate' => 0,
156
  'moderate_ip' => 0,
@@ -307,6 +306,8 @@ class State extends \Cleantalk\Common\State
307
  'update_mode' => 0,
308
  );
309
 
 
 
310
  protected function setDefinitions()
311
  {
312
  global $wpdb;
@@ -430,7 +431,7 @@ class State extends \Cleantalk\Common\State
430
  // Standalone or main site
431
  $this->api_key = $this->settings['apikey'];
432
  $this->dashboard_link = 'https://cleantalk.org/my/' . ($this->user_token ? '?user_token=' . $this->user_token : '');
433
- $this->notice_show = $this->data['notice_trial'] || $this->data['notice_renew'] || $this->isHaveErrors();
434
 
435
  // Network with Mutual key
436
  if ( ! is_main_site() && $this->network_settings['multisite__work_mode'] == 2 ) {
@@ -692,7 +693,7 @@ class State extends \Cleantalk\Common\State
692
  *
693
  * @return mixed
694
  */
695
- public function __get($name)
696
  {
697
  // First check in storage
698
  if (isset($this->storage[$name])) {
83
  'data__protect_logged_in' => 1,
84
  // Do anti-spam tests to for logged in users.
85
  'data__use_ajax' => 1,
 
86
  // Ajax handler type: REST API - 0 / custom AJAX - 1 / WP AJAX - 2
87
  'data__use_static_js_key' => -1,
88
  'data__general_postdata_test' => 0,
89
  //CAPD
90
  'data__set_cookies' => 1,
 
 
91
  // Alternative cookies handler type: REST API - 0 / custom AJAX - 1 / WP AJAX - 2
92
  'data__ssl_on' => 0,
93
  // Secure connection to servers
141
  'last_remote_call' => 0, //Timestam of last remote call
142
  'current_settings_template_id' => null, // Loaded settings template id
143
  'current_settings_template_name' => null, // Loaded settings template name
144
+ 'ajax_type' => false, // Ajax type
145
 
146
  // Antispam
147
  'spam_store_days' => 15, // Days before delete comments from folder Spam
149
  'notice_api_errors' => 0, // Send API error notices to WP admin
150
 
151
  // Account data
152
+ 'account_email' => '',
153
  'service_id' => 0,
154
  'moderate' => 0,
155
  'moderate_ip' => 0,
306
  'update_mode' => 0,
307
  );
308
 
309
+ public $errors;
310
+
311
  protected function setDefinitions()
312
  {
313
  global $wpdb;
431
  // Standalone or main site
432
  $this->api_key = $this->settings['apikey'];
433
  $this->dashboard_link = 'https://cleantalk.org/my/' . ($this->user_token ? '?user_token=' . $this->user_token : '');
434
+ $this->notice_show = $this->data['notice_trial'] || $this->data['notice_renew'] || $this->data['notice_incompatibility'] || $this->isHaveErrors();
435
 
436
  // Network with Mutual key
437
  if ( ! is_main_site() && $this->network_settings['multisite__work_mode'] == 2 ) {
693
  *
694
  * @return mixed
695
  */
696
+ public function &__get($name)
697
  {
698
  // First check in storage
699
  if (isset($this->storage[$name])) {
lib/Cleantalk/Common/Compatibility.php CHANGED
@@ -23,6 +23,9 @@ class Compatibility
23
  'w3_total_cache' => array(
24
  'callback' => 'w3tcCheckLateInitCallback',
25
  ),
 
 
 
26
  );
27
 
28
  public function __construct()
@@ -52,6 +55,10 @@ class Compatibility
52
  'w3_total_cache' => __(
53
  'Current W3 Total Cache cache mode is not compatible with SpamFireWall. Please read the instructions on how to fix this issue in <a href="https://cleantalk.org/help/cleantalk-and-w3-total-cache" > the article.</a>'
54
  ),
 
 
 
 
55
  );
56
 
57
  $this->notices[$plugin] = $messages[$plugin];
@@ -87,4 +94,19 @@ class Compatibility
87
 
88
  return false;
89
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
23
  'w3_total_cache' => array(
24
  'callback' => 'w3tcCheckLateInitCallback',
25
  ),
26
+ 'wp_rocket_cache' => array(
27
+ 'callback' => 'wpRocketCallback',
28
+ ),
29
  );
30
 
31
  public function __construct()
55
  'w3_total_cache' => __(
56
  'Current W3 Total Cache cache mode is not compatible with SpamFireWall. Please read the instructions on how to fix this issue in <a href="https://cleantalk.org/help/cleantalk-and-w3-total-cache" > the article.</a>'
57
  ),
58
+ 'wp_rocket_cache' => esc_html__(
59
+ 'SpamFireWall is not compatible with active WP Rocket cache plugin.',
60
+ 'cleantalk-spam-protect'
61
+ )
62
  );
63
 
64
  $this->notices[$plugin] = $messages[$plugin];
94
 
95
  return false;
96
  }
97
+
98
+ /**
99
+ * WP Rocket existing checking
100
+ *
101
+ * @return boolean
102
+ * @psalm-suppress PossiblyUnusedMethod
103
+ */
104
+ public function wpRocketCallback()
105
+ {
106
+ global $apbct;
107
+ return
108
+ $apbct->settings['sfw__enabled'] &&
109
+ is_plugin_active('wp-rocket/wp-rocket.php') &&
110
+ defined('WP_ROCKET_VERSION');
111
+ }
112
  }
lib/Cleantalk/Common/DB.php CHANGED
@@ -147,6 +147,6 @@ class DB
147
  */
148
  public function isTableExists($table_name)
149
  {
150
- return (bool)$this->execute('SHOW TABLES LIKE "' . $table_name . '"');
151
  }
152
  }
147
  */
148
  public function isTableExists($table_name)
149
  {
150
+ return (bool)$this->execute("SHOW TABLES LIKE '" . $table_name . "'");
151
  }
152
  }
lib/Cleantalk/Common/Helper.php CHANGED
@@ -622,7 +622,9 @@ class Helper
622
  {
623
  $url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?') . 'cleantalk_no_cache=' . rand(0, getrandmax());
624
 
625
- $url = str_replace('http:', 'https:', $url);
 
 
626
 
627
  if (function_exists('curl_init')) {
628
  $ch = curl_init();
622
  {
623
  $url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?') . 'cleantalk_no_cache=' . rand(0, getrandmax());
624
 
625
+ if ( method_exists(Server::class, 'isSSL') && Server::isSSL() ) {
626
+ $url = str_replace('http:', 'https:', $url);
627
+ }
628
 
629
  if (function_exists('curl_init')) {
630
  $ch = curl_init();
lib/Cleantalk/Common/State.php CHANGED
@@ -7,7 +7,7 @@ abstract class State
7
  /**
8
  * @var string
9
  */
10
- protected $option_prefix = '';
11
 
12
  /**
13
  * @var array
7
  /**
8
  * @var string
9
  */
10
+ public $option_prefix = '';
11
 
12
  /**
13
  * @var array
lib/Cleantalk/Variables/Server.php CHANGED
@@ -88,7 +88,7 @@ class Server extends ServerVariables
88
  */
89
  public static function getDomain()
90
  {
91
- preg_match('@\.(\S+)\/?$@', self::get('HTTP_HOST'), $matches);
92
 
93
  return isset($matches[1]) ? $matches[1] : false;
94
  }
@@ -127,4 +127,16 @@ class Server extends ServerVariables
127
  {
128
  return self::get('REQUEST_METHOD') === 'GET';
129
  }
 
 
 
 
 
 
 
 
 
 
 
 
130
  }
88
  */
89
  public static function getDomain()
90
  {
91
+ preg_match('@\S+\.(\S+)\/?$@', self::get('HTTP_HOST'), $matches);
92
 
93
  return isset($matches[1]) ? $matches[1] : false;
94
  }
127
  {
128
  return self::get('REQUEST_METHOD') === 'GET';
129
  }
130
+
131
+ /**
132
+ * Determines if SSL is used.
133
+ *
134
+ * @return bool True if SSL, otherwise false.
135
+ */
136
+ public static function isSSL()
137
+ {
138
+ return self::get('HTTPS') === 'on' ||
139
+ self::get('HTTPS') === '1' ||
140
+ self::get('SERVER_PORT') == '443';
141
+ }
142
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
4
  Requires at least: 3.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
- Stable tag: 5.163.1
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
@@ -595,6 +595,35 @@ If your website has forms that send data to external sources, you can enable opt
595
 
596
  == Changelog ==
597
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
598
  = 5.163.1 Oct 12 2021 =
599
  * Fix: Queue. Errors of each try fixed.
600
  * Fix: SFW. Sleep before deleting tables was reduced.
4
  Requires at least: 3.0
5
  Tested up to: 5.8
6
  Requires PHP: 5.6
7
+ Stable tag: 5.164
8
  License: GPLv2
9
 
10
  Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
595
 
596
  == Changelog ==
597
 
598
+ = 5.164 Oct 21 2021 =
599
+ * New: Integration. UsersWP plugin integration implemented.
600
+ * New. SFW. Incompatibility WP-Rocket notice added.
601
+ * New: Settings. Advanced settings navigation implemented.
602
+ * New: Server variables. isSSL method added.
603
+ * Mod: Added the functionality of changing the mail when receiving the key during the initial installation.
604
+ * Mod: Custom admin email. Added minified js and css files
605
+ * Mod: validate api key before save settings for new accounts
606
+ * Mod: Antispam. Comments check. Send feedback with hash:01:url data only if post_info->post_url is empty.
607
+ * Fix: State. Option prefix field is public now.
608
+ * Fix: Using get_option('home') for getting the blog url instead get_option('siteurl').
609
+ * Fix: State. Magic __get notice fixed.
610
+ * Fix. State. Exclamation mark fixed.
611
+ * Fix. Common. Getting REST url fixed.
612
+ * Fix: SFW. Update percents fixed.
613
+ * Fix: DB. isTableExists method fixed.
614
+ * Fix. State. $errors field added.
615
+ * Fix: Server::getDomain(). Fixed regexp.
616
+ * Fix: skip log-in request wpstg.
617
+ * Fix: SFW. Work on hosting licenses fixed.
618
+ * Fix: set prefix_name for cleantalk-icons css.
619
+ * Fix: Helper. Hard use https for the curl requests.
620
+ * Fix: Helper. Home url slash added.
621
+ * Fix: SFW. Using direct updating if remote calls not working.
622
+ * Fix: Settings. Save button z-index added.
623
+ * Fix: Admin bar. Exclamation mark style fixed.
624
+ * Fix: Settings. Api key description on active IP license added.
625
+ * Fix: Sender info. Getting page_url on ajax/rest requests fixed.
626
+
627
  = 5.163.1 Oct 12 2021 =
628
  * Fix: Queue. Errors of each try fixed.
629
  * Fix: SFW. Sleep before deleting tables was reduced.