Version Description
May 26 2021 = * New. Integration. WP Foro register system integration. * New. Integration. Elementor essentials LoginRegister integration implemented. * New: SQL-schema and updater for extended SpamFirewall logs. * New: Extended SpamFirewall logs. * New: Pixel. * Mod: Few improvements to SFW update. * Mod: add settings for hidding website field from comment form. * Mod: Few improvements to SFW update #2. * Mod: Possibility to send empty JSON object in API. * Mod: Extended SpamFirewall logs for AntiCrawler module. * Upd: SFW. Direct updating method implemented. * Upd. Settings. Network settings templates updated. * Upd: Firewall. Improvements to update system. * Upd: Firewall. Improvements to update system. * Fix: replace wp_die to die in ct_die(), refactoring ct_die() * Fix. Forms. Exclude field wp-editor-area from collecting visible fields. * Fix. Widget. Widget content logic fixed. * Fix: Forms. Nicknames detecting fixed #2. * Fix: Forms. Getting check_js key fixed. * Fix: update ct_die_extended() as ct_die(). * Fix. Code. Getting delay before js code get if async option enabled. * Fix. WPMU. Blog id added in settings templates list. * Fix. Integration. Elementor essentials LoginRegister login form protection skipped. * Fix. WPMU. Blog id added in settings templates list. * Fix. Readme. Required PHP version increased to 5.6. * Fix. Updater. 5_157_10 updating fixed #2. * Fix. JS. DOMContentLoaded used instead jQuery(document).ready(). * Fix: SpamFirewall. Update. "FW UPDATE INIT: KEY_EMPTY", "SFW UPDATE INIT: KEY_IS_NOT_VALID" errors. * Fix. Users checker. Export to the csv fixed. * Fix: SpamFirewall. Update. Error "WRONG_UPDATE_ID". * Fix: SpamFirewall. Update. "FW UPDATE INIT: KEY_EMPTY", "SFW UPDATE INIT: KEY_IS_NOT_VALID" errors. * Fix: SpamFirewall. Update. Error "WRONG_UPDATE_ID". * Fix: \Cleantalk\Common\Helper::http_request() consider only boolean false (empty string '' considering as good) as bad response. * Fix: SpamFirewall. Update. * Fix: SpamFirewall. Update #2. * Fix: WPMS empty apikey in options * Fix: "Mod: add settings for hidding website field from comment form". * Fix: Common/Helper::httpget_headers() fixed. * Fix: SpamFirewall admin bar counter. * Fix: "Fix: Common/Helper::httpget_headers() fixed." * Fix: Pixel. * Fix: "Pixel" setting description. * Fix: Extended SpamFirewall logs for AntiCrawler module. * Fix: Extended SpamFirewall logs for AntiCrawler module #2. * Fix: WPFroms. PHP notice. * Fix: Gravity Forms. PHP notice. * Revert: Fix: Code. getfields_any() notice fixed.
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.158 |
Comparing to | |
See all releases |
Code changes from version 5.157.2 to 5.158
- cleantalk.php +225 -75
- inc/cleantalk-admin.php +2 -29
- inc/cleantalk-autoloader.php +21 -21
- inc/cleantalk-common.php +61 -7
- inc/cleantalk-pluggable.php +11 -0
- inc/cleantalk-public.php +224 -44
- inc/cleantalk-settings.php +34 -11
- inc/cleantalk-updater.php +60 -0
- js/apbct-fingerprint.min.js +1 -1
- js/apbct-fingerprint.min.js.map +1 -1
- js/apbct-public--alt.min.js +1 -1
- js/apbct-public--alt.min.js.map +1 -1
- js/apbct-public.min.js +1 -1
- js/apbct-public.min.js.map +1 -1
- js/cleantalk-admin-settings-page.min.js +1 -1
- js/cleantalk-admin-settings-page.min.js.map +1 -1
- js/cleantalk-admin.min.js +1 -1
- js/cleantalk-admin.min.js.map +1 -1
- js/cleantalk-comments-checkspam.min.js +1 -1
- js/cleantalk-comments-checkspam.min.js.map +1 -1
- js/cleantalk-dashboard-widget.min.js +1 -1
- js/cleantalk-dashboard-widget.min.js.map +1 -1
- js/cleantalk-public-admin.min.js +1 -1
- js/cleantalk-public-admin.min.js.map +1 -1
- js/cleantalk-users-checkspam.min.js +1 -1
- js/cleantalk-users-checkspam.min.js.map +1 -1
- js/cleantalk-users-editscreen.min.js +1 -1
- js/cleantalk_collect_details.min.js +1 -1
- js/cleantalk_collect_details.min.js.map +1 -1
- js/cleantalk_external.min.js +1 -1
- js/cleantalk_external.min.js.map +1 -1
- js/cleantalk_internal.min.js +1 -1
- js/cleantalk_internal.min.js.map +1 -1
- js/cleantalk_nocache.min.js +1 -1
- js/cleantalk_nocache.min.js.map +1 -1
- lib/Cleantalk/Antispam/Cleantalk.php +1 -1
- lib/Cleantalk/Antispam/CleantalkRequest.php +14 -2
- lib/Cleantalk/Antispam/Integrations.php +112 -112
- lib/Cleantalk/Antispam/Integrations/ContactBank.php +22 -22
- lib/Cleantalk/Antispam/Integrations/EaelLoginRegister.php +20 -0
- lib/Cleantalk/Antispam/Integrations/FluentForm.php +30 -30
- lib/Cleantalk/Antispam/Integrations/HappyForm.php +29 -0
- lib/Cleantalk/Antispam/Integrations/IntegrationBase.php +10 -10
- lib/Cleantalk/ApbctWP/FindSpam/UsersChecker.php +3 -0
- lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php +64 -8
- lib/Cleantalk/ApbctWP/Firewall/SFW.php +174 -56
- lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html +1 -1
- lib/Cleantalk/ApbctWP/Helper.php +1 -1
- lib/Cleantalk/ApbctWP/RemoteCalls.php +2 -7
- lib/Cleantalk/ApbctWP/State.php +2 -0
- lib/Cleantalk/Common/API.php +8 -0
- lib/Cleantalk/Common/DNS.php +3 -2
- lib/Cleantalk/Common/Firewall.php +6 -1
- lib/Cleantalk/Common/Firewall/FirewallModule_abstract.php +4 -1
- lib/Cleantalk/Common/Helper.php +15 -2
- lib/Cleantalk/Common/Schema.php +6 -1
- readme.txt +51 -2
- templates/lock-pages/lock-page-ct-die.html +150 -0
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: https://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
-
Version: 5.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: https://cleantalk.org
|
9 |
Text Domain: cleantalk-spam-protect
|
@@ -217,6 +217,8 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
|
|
217 |
'WpMembers' => array( 'hook' => 'wpmem_pre_register_data', 'setting' => 'forms__registrations_test', 'ajax' => false ),
|
218 |
'Wpdiscuz' => array( 'hook' => array( 'wpdAddComment', 'wpdAddInlineComment' ), 'setting' => 'forms__comments_test', 'ajax' => true ),
|
219 |
'Forminator' => array( 'hook' => 'forminator_submit_form_custom-forms', 'setting' => 'forms__contact_forms_test', 'ajax' => true ),
|
|
|
|
|
220 |
);
|
221 |
new \Cleantalk\Antispam\Integrations( $apbct_active_integrations, (array) $apbct->settings );
|
222 |
|
@@ -263,6 +265,9 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
|
|
263 |
// Profile Builder integration
|
264 |
add_filter( 'wppb_output_field_errors_filter', 'apbct_form_profile_builder__check_register', 1, 3 );
|
265 |
|
|
|
|
|
|
|
266 |
// Public actions
|
267 |
if( ! is_admin() && ! apbct_is_ajax() && ! apbct_is_customize_preview() ){
|
268 |
|
@@ -471,7 +476,7 @@ if( !defined( 'CLEANTALK_PLUGIN_DIR' ) ){
|
|
471 |
// Short code for GDPR
|
472 |
if($apbct->settings['gdpr__enabled'])
|
473 |
add_shortcode('cleantalk_gdpr_form', 'apbct_shrotcode_handler__GDPR_public_notice__form');
|
474 |
-
|
475 |
}
|
476 |
|
477 |
|
@@ -516,7 +521,7 @@ function apbct_sfw__check()
|
|
516 |
APBCT_TBL_FIREWALL_LOG,
|
517 |
APBCT_TBL_FIREWALL_DATA,
|
518 |
array(
|
519 |
-
'
|
520 |
'api_key' => $apbct->api_key,
|
521 |
'apbct' => $apbct,
|
522 |
'cookie_domain' => parse_url( get_option( 'siteurl' ), PHP_URL_HOST ),
|
@@ -862,60 +867,96 @@ function apbct_sfw_update__init( $delay = 0 ){
|
|
862 |
}
|
863 |
|
864 |
// Key is empty
|
865 |
-
if( ! $apbct->
|
866 |
return array( 'error' => 'SFW UPDATE INIT: KEY_EMPTY' );
|
867 |
}
|
868 |
|
|
|
|
|
|
|
|
|
869 |
// Set a new update ID and an update time start
|
870 |
$apbct->fw_stats['firewall_updating_id'] = md5( rand( 0, 100000 ) );
|
871 |
$apbct->fw_stats['firewall_updating_last_start'] = time();
|
872 |
$apbct->save( 'fw_stats' );
|
873 |
-
|
874 |
-
|
|
|
|
|
|
|
|
|
875 |
'sfw_update__worker',
|
876 |
-
|
877 |
'delay' => $delay,
|
878 |
-
'firewall_updating_id' => $apbct->fw_stats['firewall_updating_id']
|
879 |
),
|
880 |
-
|
881 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
882 |
}
|
883 |
|
884 |
/**
|
885 |
* Called by sfw_update__worker remote call
|
886 |
* gather all process about SFW updating
|
887 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
888 |
* @return array|bool|int|string[]
|
|
|
889 |
*/
|
890 |
-
function apbct_sfw_update__worker(){
|
891 |
|
892 |
global $apbct;
|
893 |
|
894 |
-
|
895 |
-
|
896 |
-
$
|
897 |
-
$
|
898 |
-
$
|
|
|
|
|
899 |
|
900 |
$api_key = $apbct->api_key;
|
901 |
-
|
|
|
|
|
|
|
|
|
902 |
// Check if the update performs right now. Blocks remote calls with different ID
|
903 |
// This was done to make sure that we won't have multiple updates at a time
|
904 |
if( $updating_id !== $apbct->fw_stats['firewall_updating_id'] ){
|
905 |
return array( 'error' => 'WRONG_UPDATE_ID' );
|
906 |
}
|
907 |
-
|
908 |
-
// Key is empty
|
909 |
-
if( empty( $api_key ) ){
|
910 |
-
return array( 'error' => 'KEY_EMPTY' );
|
911 |
-
}
|
912 |
|
913 |
// First call. Getting files URL ( multifile )
|
914 |
if( ! $multifile_url ){
|
915 |
|
916 |
// Preparing database infrastructure
|
|
|
917 |
apbct_activation__create_tables( Schema::getSchema( 'sfw' ), $apbct->db_prefix );
|
918 |
-
|
|
|
|
|
|
|
|
|
919 |
|
920 |
return apbct_sfw_update__get_multifiles( $api_key, $updating_id );
|
921 |
|
@@ -943,47 +984,9 @@ function apbct_sfw_update__worker(){
|
|
943 |
|
944 |
// End of update
|
945 |
}else{
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
// REMOVE AND RENAME
|
950 |
-
$result = SFW::data_tables__delete( DB::getInstance(), APBCT_TBL_FIREWALL_DATA );
|
951 |
-
if( ! empty( $result['error'] ) )
|
952 |
-
return $result;
|
953 |
-
$result = SFW::rename_data_tables__from_temp_to_main( DB::getInstance(), APBCT_TBL_FIREWALL_DATA );
|
954 |
-
if( ! empty( $result['error'] ) )
|
955 |
-
return $result;
|
956 |
-
|
957 |
-
// Increment firewall entries
|
958 |
-
$apbct->fw_stats['firewall_update_percent'] = 0;
|
959 |
-
$apbct->fw_stats['firewall_updating_id'] = null;
|
960 |
-
$apbct->fw_stats['last_firewall_updated'] = time();
|
961 |
-
$apbct->save( 'fw_stats' );
|
962 |
-
|
963 |
-
$apbct->stats['sfw']['entries'] = $wpdb->get_var('SELECT COUNT(*) FROM ' . APBCT_TBL_FIREWALL_DATA );
|
964 |
-
$apbct->stats['sfw']['last_update_time'] = time();
|
965 |
-
$apbct->save( 'stats' );
|
966 |
-
|
967 |
-
$apbct->data['last_firewall_updated'] = current_time('timestamp');
|
968 |
-
$apbct->save('data'); // Unused
|
969 |
-
|
970 |
-
// Running sfw update once again in 12 min if entries is < 4000
|
971 |
-
if( ! $apbct->stats['sfw']['last_update_time'] &&
|
972 |
-
$apbct->stats['sfw']['entries'] < 4000
|
973 |
-
){
|
974 |
-
wp_schedule_single_event( time() + 720, 'apbct_sfw_update__init' );
|
975 |
-
}
|
976 |
-
|
977 |
-
// Delete update errors
|
978 |
-
$apbct->error_delete( 'sfw_update', 'save_settings' );
|
979 |
-
|
980 |
-
// Get update period for server
|
981 |
-
$update_period = \Cleantalk\Common\DNS::getServerTTL( 'spamfirewall-ttl.cleantalk.org' );
|
982 |
-
$update_period = (int)$update_period > 14400 ? (int) $update_period : 14400;
|
983 |
-
Cron::updateTask('sfw_update', 'apbct_sfw_update__init', $update_period );
|
984 |
-
|
985 |
-
return true;
|
986 |
-
|
987 |
}
|
988 |
}
|
989 |
|
@@ -995,7 +998,7 @@ function apbct_sfw_update__get_multifiles( $api_key, $updating_id ){
|
|
995 |
return array( 'error' => 'GET MULTIFILE: ' . $result['error'] );
|
996 |
}
|
997 |
|
998 |
-
|
999 |
'sfw_update__worker',
|
1000 |
array(
|
1001 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $result['multifile_url'] ),
|
@@ -1006,11 +1009,28 @@ function apbct_sfw_update__get_multifiles( $api_key, $updating_id ){
|
|
1006 |
),
|
1007 |
array( 'async' )
|
1008 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1009 |
}
|
1010 |
|
1011 |
function apbct_sfw_update__process_ua( $multifile_url, $url_count, $current_url, $updating_id, $useragent_url ){
|
1012 |
|
1013 |
-
|
1014 |
$result = AntiCrawler::update( 'https://' . $useragent_url );
|
1015 |
|
1016 |
if( ! empty( $result['error'] ) ){
|
@@ -1021,7 +1041,7 @@ function apbct_sfw_update__process_ua( $multifile_url, $url_count, $current_url,
|
|
1021 |
return array( 'error' => 'UPDATING UA LIST: : WRONG_RESPONSE AntiCrawler::update' );
|
1022 |
}
|
1023 |
|
1024 |
-
|
1025 |
'sfw_update__worker',
|
1026 |
array(
|
1027 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
@@ -1032,6 +1052,22 @@ function apbct_sfw_update__process_ua( $multifile_url, $url_count, $current_url,
|
|
1032 |
array( 'async' )
|
1033 |
);
|
1034 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1035 |
}
|
1036 |
|
1037 |
|
@@ -1051,17 +1087,34 @@ function apbct_sfw_update__process_file( $multifile_url, $url_count, $current_ur
|
|
1051 |
return array( 'error' => 'PROCESS FILE: WRONG RESPONSE FROM update__write_to_db' );
|
1052 |
}
|
1053 |
|
1054 |
-
|
1055 |
'sfw_update__worker',
|
1056 |
array(
|
1057 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
1058 |
'url_count' => $url_count,
|
1059 |
-
'current_url' =>
|
1060 |
'firewall_updating_id' => $updating_id,
|
1061 |
),
|
1062 |
array( 'async' )
|
1063 |
);
|
1064 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1065 |
}
|
1066 |
|
1067 |
function apbct_sfw_update__process_exclusions( $multifile_url, $updating_id ){
|
@@ -1079,7 +1132,7 @@ function apbct_sfw_update__process_exclusions( $multifile_url, $updating_id ){
|
|
1079 |
return array( 'error' => 'EXCLUSIONS: WRONG_RESPONSE update__write_to_db__exclusions' );
|
1080 |
}
|
1081 |
|
1082 |
-
|
1083 |
'sfw_update__worker',
|
1084 |
array(
|
1085 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
@@ -1087,6 +1140,76 @@ function apbct_sfw_update__process_exclusions( $multifile_url, $updating_id ){
|
|
1087 |
),
|
1088 |
array( 'async' )
|
1089 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1090 |
}
|
1091 |
|
1092 |
function ct_sfw_send_logs($api_key = '')
|
@@ -1561,14 +1684,41 @@ function apbct_maintance_mode__disable() {
|
|
1561 |
}
|
1562 |
}
|
1563 |
|
1564 |
-
function cleantalk_get_brief_data(){
|
1565 |
|
1566 |
global $apbct;
|
1567 |
-
|
1568 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1569 |
$apbct->saveData();
|
1570 |
-
|
1571 |
-
return;
|
1572 |
}
|
1573 |
|
1574 |
//Delete cookie for admin trial notice
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: https://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
+
Version: 5.158
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: https://cleantalk.org
|
9 |
Text Domain: cleantalk-spam-protect
|
217 |
'WpMembers' => array( 'hook' => 'wpmem_pre_register_data', 'setting' => 'forms__registrations_test', 'ajax' => false ),
|
218 |
'Wpdiscuz' => array( 'hook' => array( 'wpdAddComment', 'wpdAddInlineComment' ), 'setting' => 'forms__comments_test', 'ajax' => true ),
|
219 |
'Forminator' => array( 'hook' => 'forminator_submit_form_custom-forms', 'setting' => 'forms__contact_forms_test', 'ajax' => true ),
|
220 |
+
'HappyForm' => array( 'hook' => 'happyforms_validate_submission', 'setting' => 'forms__contact_forms_test', 'ajax' => false ),
|
221 |
+
'EaelLoginRegister' => array( 'hook' => 'eael/login-register/before-register', 'setting' => 'forms__registrations_test', 'ajax' => false ),
|
222 |
);
|
223 |
new \Cleantalk\Antispam\Integrations( $apbct_active_integrations, (array) $apbct->settings );
|
224 |
|
265 |
// Profile Builder integration
|
266 |
add_filter( 'wppb_output_field_errors_filter', 'apbct_form_profile_builder__check_register', 1, 3 );
|
267 |
|
268 |
+
// WP Foro register system integration
|
269 |
+
add_filter( 'wpforo_create_profile', 'wpforo_create_profile__check_register', 1, 1 );
|
270 |
+
|
271 |
// Public actions
|
272 |
if( ! is_admin() && ! apbct_is_ajax() && ! apbct_is_customize_preview() ){
|
273 |
|
476 |
// Short code for GDPR
|
477 |
if($apbct->settings['gdpr__enabled'])
|
478 |
add_shortcode('cleantalk_gdpr_form', 'apbct_shrotcode_handler__GDPR_public_notice__form');
|
479 |
+
|
480 |
}
|
481 |
|
482 |
|
521 |
APBCT_TBL_FIREWALL_LOG,
|
522 |
APBCT_TBL_FIREWALL_DATA,
|
523 |
array(
|
524 |
+
'sfw_counter' => $apbct->settings['admin_bar__sfw_counter'],
|
525 |
'api_key' => $apbct->api_key,
|
526 |
'apbct' => $apbct,
|
527 |
'cookie_domain' => parse_url( get_option( 'siteurl' ), PHP_URL_HOST ),
|
867 |
}
|
868 |
|
869 |
// Key is empty
|
870 |
+
if( ! $apbct->settings['apikey'] ){
|
871 |
return array( 'error' => 'SFW UPDATE INIT: KEY_EMPTY' );
|
872 |
}
|
873 |
|
874 |
+
if( ! $apbct->data['key_is_ok'] ){
|
875 |
+
return array( 'error' => 'SFW UPDATE INIT: KEY_IS_NOT_VALID' );
|
876 |
+
}
|
877 |
+
|
878 |
// Set a new update ID and an update time start
|
879 |
$apbct->fw_stats['firewall_updating_id'] = md5( rand( 0, 100000 ) );
|
880 |
$apbct->fw_stats['firewall_updating_last_start'] = time();
|
881 |
$apbct->save( 'fw_stats' );
|
882 |
+
|
883 |
+
// Delete update errors
|
884 |
+
$apbct->error_delete( 'sfw_update', 'save_data' );
|
885 |
+
$apbct->error_delete( 'sfw_update', 'save_data', 'cron' );
|
886 |
+
|
887 |
+
$result = \Cleantalk\ApbctWP\Helper::http__request__rc_to_host(
|
888 |
'sfw_update__worker',
|
889 |
+
array(
|
890 |
'delay' => $delay,
|
891 |
+
'firewall_updating_id' => $apbct->fw_stats['firewall_updating_id']
|
892 |
),
|
893 |
+
array( 'async' )
|
894 |
+
);
|
895 |
+
|
896 |
+
if( ! empty( $result['error'] ) ){
|
897 |
+
|
898 |
+
if( strpos( $result['error'], 'WRONG_SITE_RESPONSE' ) !== false ){
|
899 |
+
|
900 |
+
$result = apbct_sfw_update__worker( $apbct->fw_stats['firewall_updating_id'] );
|
901 |
+
if( ! empty( $result['error'] ) ){
|
902 |
+
apbct_sfw_update__cleanData();
|
903 |
+
}
|
904 |
+
|
905 |
+
return $result;
|
906 |
+
}
|
907 |
+
}
|
908 |
+
|
909 |
+
return $result;
|
910 |
}
|
911 |
|
912 |
/**
|
913 |
* Called by sfw_update__worker remote call
|
914 |
* gather all process about SFW updating
|
915 |
*
|
916 |
+
* @param string $updating_id
|
917 |
+
* @param string $multifile_url
|
918 |
+
* @param string $url_count
|
919 |
+
* @param string $current_url
|
920 |
+
* @param string $useragent_url
|
921 |
+
*
|
922 |
* @return array|bool|int|string[]
|
923 |
+
* @throws Exception
|
924 |
*/
|
925 |
+
function apbct_sfw_update__worker( $updating_id = null, $multifile_url = null, $url_count = null, $current_url = null, $useragent_url = null ){
|
926 |
|
927 |
global $apbct;
|
928 |
|
929 |
+
sleep(1);
|
930 |
+
|
931 |
+
$updating_id = $updating_id ?: Get::get( 'firewall_updating_id' );
|
932 |
+
$multifile_url = $multifile_url ?: Get::get( 'multifile_url' );
|
933 |
+
$url_count = $url_count ?: Get::get( 'url_count' );
|
934 |
+
$useragent_url = $useragent_url ?: Get::get( 'useragent_url' );
|
935 |
+
$current_url = isset( $current_url ) ? $current_url : Get::get( 'current_url' );
|
936 |
|
937 |
$api_key = $apbct->api_key;
|
938 |
+
|
939 |
+
if( ! $apbct->data['key_is_ok'] ){
|
940 |
+
return array( 'error' => 'KEY_IS_NOT_VALID' );
|
941 |
+
}
|
942 |
+
|
943 |
// Check if the update performs right now. Blocks remote calls with different ID
|
944 |
// This was done to make sure that we won't have multiple updates at a time
|
945 |
if( $updating_id !== $apbct->fw_stats['firewall_updating_id'] ){
|
946 |
return array( 'error' => 'WRONG_UPDATE_ID' );
|
947 |
}
|
|
|
|
|
|
|
|
|
|
|
948 |
|
949 |
// First call. Getting files URL ( multifile )
|
950 |
if( ! $multifile_url ){
|
951 |
|
952 |
// Preparing database infrastructure
|
953 |
+
// Creating SFW tables to make sure that they are exist
|
954 |
apbct_activation__create_tables( Schema::getSchema( 'sfw' ), $apbct->db_prefix );
|
955 |
+
|
956 |
+
// Preparing temporary tables
|
957 |
+
$result = SFW::create_temp_tables( DB::getInstance(), APBCT_TBL_FIREWALL_DATA );
|
958 |
+
if( ! empty( $result['error'] ) )
|
959 |
+
return $result;
|
960 |
|
961 |
return apbct_sfw_update__get_multifiles( $api_key, $updating_id );
|
962 |
|
984 |
|
985 |
// End of update
|
986 |
}else{
|
987 |
+
|
988 |
+
return apbct_sfw_update__end_of_update();
|
989 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
990 |
}
|
991 |
}
|
992 |
|
998 |
return array( 'error' => 'GET MULTIFILE: ' . $result['error'] );
|
999 |
}
|
1000 |
|
1001 |
+
$rc_result = Helper::http__request__rc_to_host(
|
1002 |
'sfw_update__worker',
|
1003 |
array(
|
1004 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $result['multifile_url'] ),
|
1009 |
),
|
1010 |
array( 'async' )
|
1011 |
);
|
1012 |
+
|
1013 |
+
if( ! empty( $rc_result['error'] ) ){
|
1014 |
+
|
1015 |
+
if( strpos( $rc_result['error'], 'WRONG_SITE_RESPONSE' ) !== false ){
|
1016 |
+
|
1017 |
+
return apbct_sfw_update__worker(
|
1018 |
+
$updating_id,
|
1019 |
+
str_replace( array( 'http://', 'https://' ), '', $result['multifile_url'] ),
|
1020 |
+
count( $result['file_urls'] ),
|
1021 |
+
0,
|
1022 |
+
str_replace( array( 'http://', 'https://' ), '', $result['useragent_url'] )
|
1023 |
+
);
|
1024 |
+
}
|
1025 |
+
|
1026 |
+
return array( 'error' => 'GET MULTIFILE: ' . $result['error'] );
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
return $result;
|
1030 |
}
|
1031 |
|
1032 |
function apbct_sfw_update__process_ua( $multifile_url, $url_count, $current_url, $updating_id, $useragent_url ){
|
1033 |
|
|
|
1034 |
$result = AntiCrawler::update( 'https://' . $useragent_url );
|
1035 |
|
1036 |
if( ! empty( $result['error'] ) ){
|
1041 |
return array( 'error' => 'UPDATING UA LIST: : WRONG_RESPONSE AntiCrawler::update' );
|
1042 |
}
|
1043 |
|
1044 |
+
$rc_result = Helper::http__request__rc_to_host(
|
1045 |
'sfw_update__worker',
|
1046 |
array(
|
1047 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
1052 |
array( 'async' )
|
1053 |
);
|
1054 |
|
1055 |
+
if( ! empty( $rc_result['error'] ) ){
|
1056 |
+
|
1057 |
+
if( strpos( $rc_result['error'], 'WRONG_SITE_RESPONSE' ) !== false ){
|
1058 |
+
|
1059 |
+
return apbct_sfw_update__worker(
|
1060 |
+
$updating_id,
|
1061 |
+
str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
1062 |
+
$url_count,
|
1063 |
+
$current_url
|
1064 |
+
);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
return array( 'error' => 'UPDATE UA LIST: ' . $result['error'] );
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
return $result;
|
1071 |
}
|
1072 |
|
1073 |
|
1087 |
return array( 'error' => 'PROCESS FILE: WRONG RESPONSE FROM update__write_to_db' );
|
1088 |
}
|
1089 |
|
1090 |
+
$rc_result = Helper::http__request__rc_to_host(
|
1091 |
'sfw_update__worker',
|
1092 |
array(
|
1093 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
1094 |
'url_count' => $url_count,
|
1095 |
+
'current_url' => $current_url + 1,
|
1096 |
'firewall_updating_id' => $updating_id,
|
1097 |
),
|
1098 |
array( 'async' )
|
1099 |
);
|
1100 |
|
1101 |
+
if( ! empty( $rc_result['error'] ) ){
|
1102 |
+
|
1103 |
+
if( strpos( $rc_result['error'], 'WRONG_SITE_RESPONSE' ) !== false ){
|
1104 |
+
|
1105 |
+
return apbct_sfw_update__worker(
|
1106 |
+
$updating_id,
|
1107 |
+
str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
1108 |
+
$url_count,
|
1109 |
+
$current_url + 1
|
1110 |
+
);
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
return array( 'error' => 'PROCESS FILE: ' . $result['error'] );
|
1114 |
+
}
|
1115 |
+
|
1116 |
+
return $result;
|
1117 |
+
|
1118 |
}
|
1119 |
|
1120 |
function apbct_sfw_update__process_exclusions( $multifile_url, $updating_id ){
|
1132 |
return array( 'error' => 'EXCLUSIONS: WRONG_RESPONSE update__write_to_db__exclusions' );
|
1133 |
}
|
1134 |
|
1135 |
+
$rc_result = Helper::http__request__rc_to_host(
|
1136 |
'sfw_update__worker',
|
1137 |
array(
|
1138 |
'multifile_url' => str_replace( array( 'http://', 'https://' ), '', $multifile_url ),
|
1140 |
),
|
1141 |
array( 'async' )
|
1142 |
);
|
1143 |
+
|
1144 |
+
if( ! empty( $rc_result['error'] ) ){
|
1145 |
+
|
1146 |
+
if( strpos( $rc_result['error'], 'WRONG_SITE_RESPONSE' ) !== false ){
|
1147 |
+
|
1148 |
+
return apbct_sfw_update__worker(
|
1149 |
+
$updating_id,
|
1150 |
+
str_replace( array( 'http://', 'https://' ), '', $multifile_url )
|
1151 |
+
);
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
return array( 'error' => 'EXCLUSIONS: ' . $result['error'] );
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
return $result;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
function apbct_sfw_update__end_of_update() {
|
1161 |
+
|
1162 |
+
global $apbct, $wpdb;
|
1163 |
+
|
1164 |
+
// REMOVE AND RENAME
|
1165 |
+
$result = SFW::data_tables__delete( DB::getInstance(), APBCT_TBL_FIREWALL_DATA );
|
1166 |
+
if( ! empty( $result['error'] ) )
|
1167 |
+
return $result;
|
1168 |
+
$result = SFW::rename_data_tables__from_temp_to_main( DB::getInstance(), APBCT_TBL_FIREWALL_DATA );
|
1169 |
+
if( ! empty( $result['error'] ) )
|
1170 |
+
return $result;
|
1171 |
+
|
1172 |
+
// Increment firewall entries
|
1173 |
+
$apbct->fw_stats['firewall_update_percent'] = 0;
|
1174 |
+
$apbct->fw_stats['firewall_updating_id'] = null;
|
1175 |
+
$apbct->fw_stats['last_firewall_updated'] = time();
|
1176 |
+
$apbct->save( 'fw_stats' );
|
1177 |
+
|
1178 |
+
$apbct->stats['sfw']['entries'] = $wpdb->get_var('SELECT COUNT(*) FROM ' . APBCT_TBL_FIREWALL_DATA );
|
1179 |
+
$apbct->stats['sfw']['last_update_time'] = time();
|
1180 |
+
$apbct->save( 'stats' );
|
1181 |
+
|
1182 |
+
$apbct->data['last_firewall_updated'] = current_time('timestamp');
|
1183 |
+
$apbct->save('data'); // Unused
|
1184 |
+
|
1185 |
+
// Running sfw update once again in 12 min if entries is < 4000
|
1186 |
+
if( ! $apbct->stats['sfw']['last_update_time'] &&
|
1187 |
+
$apbct->stats['sfw']['entries'] < 4000
|
1188 |
+
){
|
1189 |
+
wp_schedule_single_event( time() + 720, 'apbct_sfw_update__init' );
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
// Delete update errors
|
1193 |
+
$apbct->error_delete( 'sfw_update', 'save_settings' );
|
1194 |
+
|
1195 |
+
// Get update period for server
|
1196 |
+
$update_period = \Cleantalk\Common\DNS::getServerTTL( 'spamfirewall-ttl.cleantalk.org' );
|
1197 |
+
$update_period = (int)$update_period > 14400 ? (int) $update_period : 14400;
|
1198 |
+
Cron::updateTask('sfw_update', 'apbct_sfw_update__init', $update_period );
|
1199 |
+
|
1200 |
+
return true;
|
1201 |
+
|
1202 |
+
}
|
1203 |
+
|
1204 |
+
function apbct_sfw_update__cleanData(){
|
1205 |
+
|
1206 |
+
global $apbct;
|
1207 |
+
|
1208 |
+
SFW::data_tables__delete( DB::getInstance(), APBCT_TBL_FIREWALL_DATA . '_temp' );
|
1209 |
+
|
1210 |
+
$apbct->fw_stats['firewall_update_percent'] = 0;
|
1211 |
+
$apbct->fw_stats['firewall_updating_id'] = null;
|
1212 |
+
$apbct->save( 'fw_stats' );
|
1213 |
}
|
1214 |
|
1215 |
function ct_sfw_send_logs($api_key = '')
|
1684 |
}
|
1685 |
}
|
1686 |
|
1687 |
+
function cleantalk_get_brief_data( $api_key = null ){
|
1688 |
|
1689 |
global $apbct;
|
1690 |
+
|
1691 |
+
$api_key = is_null( $api_key ) ? $apbct->api_key : $api_key;
|
1692 |
+
|
1693 |
+
$apbct->data['brief_data'] = \Cleantalk\ApbctWP\API::method__get_antispam_report_breif( $api_key );
|
1694 |
+
|
1695 |
+
# expanding data about the country
|
1696 |
+
if(isset($apbct->data['brief_data']['top5_spam_ip']) && !empty($apbct->data['brief_data']['top5_spam_ip'])) {
|
1697 |
+
foreach ($apbct->data['brief_data']['top5_spam_ip'] as $key => $ip_data) {
|
1698 |
+
$ip = $ip_data[0];
|
1699 |
+
$ip_data[1] = array(
|
1700 |
+
'country_name' => 'Unknown',
|
1701 |
+
'country_code' => 'cleantalk'
|
1702 |
+
);
|
1703 |
+
|
1704 |
+
if(isset($ip)) {
|
1705 |
+
$country_data = \Cleantalk\ApbctWP\API::method__ip_info($ip);
|
1706 |
+
$country_data_clear = current($country_data);
|
1707 |
+
|
1708 |
+
if(is_array($country_data_clear) && isset($country_data_clear['country_name']) && isset($country_data_clear['country_code'])) {
|
1709 |
+
$ip_data[1] = array(
|
1710 |
+
'country_name' => $country_data_clear['country_name'],
|
1711 |
+
'country_code' => (!preg_match('/[^A-Za-z0-9]/', $country_data_clear['country_code'])) ? $country_data_clear['country_code'] : 'cleantalk'
|
1712 |
+
);
|
1713 |
+
}
|
1714 |
+
}
|
1715 |
+
|
1716 |
+
$apbct->data['brief_data']['top5_spam_ip'][$key] = $ip_data;
|
1717 |
+
}
|
1718 |
+
}
|
1719 |
+
|
1720 |
$apbct->saveData();
|
1721 |
+
|
|
|
1722 |
}
|
1723 |
|
1724 |
//Delete cookie for admin trial notice
|
@@ -16,7 +16,7 @@ add_action( 'admin_head','apbct_admin_set_cookie_for_anti_bot' );
|
|
16 |
|
17 |
function apbct_admin_set_cookie_for_anti_bot(){
|
18 |
global $apbct;
|
19 |
-
echo '<script ' . ( class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '' ) . '>var ctSecure = location.protocol === "https:" ? "; secure" : ""; document.cookie = "
|
20 |
}
|
21 |
|
22 |
function apbct_add_buttons_to_comments_and_users( $unused_argument ) {
|
@@ -177,34 +177,7 @@ function apbct_admin__init(){
|
|
177 |
|
178 |
// Getting dashboard widget statistics
|
179 |
if(!empty($_POST['ct_brief_refresh'])){
|
180 |
-
|
181 |
-
|
182 |
-
# expanding data about the country
|
183 |
-
if(isset($apbct->data['brief_data']['top5_spam_ip']) && !empty($apbct->data['brief_data']['top5_spam_ip'])) {
|
184 |
-
foreach ($apbct->data['brief_data']['top5_spam_ip'] as $key => $ip_data) {
|
185 |
-
$ip = $ip_data[0];
|
186 |
-
$ip_data[1] = array(
|
187 |
-
'country_name' => 'Unknown',
|
188 |
-
'country_code' => 'cleantalk'
|
189 |
-
);
|
190 |
-
|
191 |
-
if(isset($ip)) {
|
192 |
-
$country_data = \Cleantalk\ApbctWP\API::method__ip_info($ip);
|
193 |
-
$country_data_clear = current($country_data);
|
194 |
-
|
195 |
-
if(is_array($country_data_clear) && isset($country_data_clear['country_name']) && isset($country_data_clear['country_code'])) {
|
196 |
-
$ip_data[1] = array(
|
197 |
-
'country_name' => $country_data_clear['country_name'],
|
198 |
-
'country_code' => (!preg_match('/[^A-Za-z0-9]/', $country_data_clear['country_code'])) ? $country_data_clear['country_code'] : 'cleantalk'
|
199 |
-
);
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
$apbct->data['brief_data']['top5_spam_ip'][$key] = $ip_data;
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
$apbct->saveData();
|
208 |
}
|
209 |
|
210 |
// Getting key like hoster. Only once!
|
16 |
|
17 |
function apbct_admin_set_cookie_for_anti_bot(){
|
18 |
global $apbct;
|
19 |
+
echo '<script ' . ( class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '' ) . '>var ctSecure = location.protocol === "https:" ? "; secure" : ""; document.cookie = "wordpress_apbct_antibot=' . hash( 'sha256', $apbct->api_key . $apbct->data['salt'] ) . '; path=/; expires=0; samesite=lax" + ctSecure;</script>';
|
20 |
}
|
21 |
|
22 |
function apbct_add_buttons_to_comments_and_users( $unused_argument ) {
|
177 |
|
178 |
// Getting dashboard widget statistics
|
179 |
if(!empty($_POST['ct_brief_refresh'])){
|
180 |
+
cleantalk_get_brief_data( $apbct->api_key );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
|
183 |
// Getting key like hoster. Only once!
|
@@ -1,21 +1,21 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Autoloader for \Cleantalk\* classes
|
5 |
-
*
|
6 |
-
* @param string $class
|
7 |
-
*
|
8 |
-
* @return void
|
9 |
-
*/
|
10 |
-
function apbct_autoloader( $class ){
|
11 |
-
// Register class auto loader
|
12 |
-
// Custom modules
|
13 |
-
if( strpos( $class, 'cleantalk-spam-protect') !== false && ! class_exists( '\\' . $class )) {
|
14 |
-
$class_file = CLEANTALK_PLUGIN_DIR . 'lib' . DIRECTORY_SEPARATOR . $class . '.php';
|
15 |
-
if( file_exists( $class_file ) ){
|
16 |
-
require_once( $class_file );
|
17 |
-
}
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
spl_autoload_register( 'apbct_autoloader' );
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Autoloader for \Cleantalk\* classes
|
5 |
+
*
|
6 |
+
* @param string $class
|
7 |
+
*
|
8 |
+
* @return void
|
9 |
+
*/
|
10 |
+
function apbct_autoloader( $class ){
|
11 |
+
// Register class auto loader
|
12 |
+
// Custom modules
|
13 |
+
if( strpos( $class, 'cleantalk-spam-protect') !== false && ! class_exists( '\\' . $class )) {
|
14 |
+
$class_file = CLEANTALK_PLUGIN_DIR . 'lib' . DIRECTORY_SEPARATOR . $class . '.php';
|
15 |
+
if( file_exists( $class_file ) ){
|
16 |
+
require_once( $class_file );
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
spl_autoload_register( 'apbct_autoloader' );
|
@@ -149,6 +149,12 @@ function apbct_base_call($params = array(), $reg_flag = false){
|
|
149 |
$sender_info = !empty($params['sender_info'])
|
150 |
? \Cleantalk\ApbctWP\Helper::array_merge__save_numeric_keys__recursive(apbct_get_sender_info(), (array)$params['sender_info'])
|
151 |
: apbct_get_sender_info();
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
$default_params = array(
|
154 |
|
@@ -166,6 +172,7 @@ function apbct_base_call($params = array(), $reg_flag = false){
|
|
166 |
'agent' => APBCT_AGENT,
|
167 |
'sender_info' => $sender_info,
|
168 |
'submit_time' => apbct_get_submit_time(),
|
|
|
169 |
);
|
170 |
|
171 |
// Send $_SERVER if couldn't find IP
|
@@ -425,6 +432,8 @@ function apbct_get_sender_info() {
|
|
425 |
// Misc
|
426 |
'site_referer' => Cookie::get( 'apbct_site_referer' ) ?: null,
|
427 |
'source_url' => Cookie::get( 'apbct_urls' ) ? json_encode( Cookie::get( 'apbct_urls' ) ) : null,
|
|
|
|
|
428 |
// Debug stuff
|
429 |
'amp_detected' => $amp_detected,
|
430 |
'hook' => current_filter() ? current_filter() : 'no_hook',
|
@@ -816,7 +825,7 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
816 |
// Ultimate Form Builder
|
817 |
'form_data_%d_name',
|
818 |
);
|
819 |
-
|
820 |
// Reset $message if we have a sign-up data
|
821 |
$skip_message_post = array(
|
822 |
'edd_action', // Easy Digital Downloads
|
@@ -925,9 +934,9 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
925 |
in_array($key, $visible_fields_arr)
|
926 |
)
|
927 |
) {
|
928 |
-
preg_match("/(name.?)
|
929 |
-
preg_match("/(name.?)
|
930 |
-
preg_match("/(name.?)
|
931 |
|
932 |
if(count($match_forename) > 1)
|
933 |
$nickname['first'] = $value;
|
@@ -969,11 +978,11 @@ function ct_get_fields_any($arr, $message=array(), $email = null, $nickname = ar
|
|
969 |
break;
|
970 |
}
|
971 |
} unset($v);
|
972 |
-
|
973 |
//If top iteration, returns compiled name field. Example: "Nickname Firtsname Lastname".]
|
974 |
-
if(
|
975 |
-
$nickname_str = '';
|
976 |
if(!empty($nickname)){
|
|
|
977 |
foreach($nickname as $value){
|
978 |
$nickname_str .= ($value ? $value." " : "");
|
979 |
}unset($value);
|
@@ -1155,3 +1164,48 @@ function apbct_private_list_add( $ip ){
|
|
1155 |
|
1156 |
return false;
|
1157 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
$sender_info = !empty($params['sender_info'])
|
150 |
? \Cleantalk\ApbctWP\Helper::array_merge__save_numeric_keys__recursive(apbct_get_sender_info(), (array)$params['sender_info'])
|
151 |
: apbct_get_sender_info();
|
152 |
+
|
153 |
+
$honeypot_website = null;
|
154 |
+
|
155 |
+
if(isset($params['honeypot_website'])) {
|
156 |
+
$honeypot_website = $params['honeypot_website'];
|
157 |
+
}
|
158 |
|
159 |
$default_params = array(
|
160 |
|
172 |
'agent' => APBCT_AGENT,
|
173 |
'sender_info' => $sender_info,
|
174 |
'submit_time' => apbct_get_submit_time(),
|
175 |
+
'honeypot_website' => $honeypot_website
|
176 |
);
|
177 |
|
178 |
// Send $_SERVER if couldn't find IP
|
432 |
// Misc
|
433 |
'site_referer' => Cookie::get( 'apbct_site_referer' ) ?: null,
|
434 |
'source_url' => Cookie::get( 'apbct_urls' ) ? json_encode( Cookie::get( 'apbct_urls' ) ) : null,
|
435 |
+
'pixel_url' => Cookie::get('apbct_pixel_url'),
|
436 |
+
'pixel_setting' => $apbct->settings['data__pixel'],
|
437 |
// Debug stuff
|
438 |
'amp_detected' => $amp_detected,
|
439 |
'hook' => current_filter() ? current_filter() : 'no_hook',
|
825 |
// Ultimate Form Builder
|
826 |
'form_data_%d_name',
|
827 |
);
|
828 |
+
|
829 |
// Reset $message if we have a sign-up data
|
830 |
$skip_message_post = array(
|
831 |
'edd_action', // Easy Digital Downloads
|
934 |
in_array($key, $visible_fields_arr)
|
935 |
)
|
936 |
) {
|
937 |
+
preg_match("/(name.?(your|first|for)|(your|first|for).?name)/", $key, $match_forename);
|
938 |
+
preg_match("/(name.?(last|family|second|sur)|(last|family|second|sur).?name)/", $key, $match_surname);
|
939 |
+
preg_match("/(name.?(nick|user)|(nick|user).?name)/", $key, $match_nickname);
|
940 |
|
941 |
if(count($match_forename) > 1)
|
942 |
$nickname['first'] = $value;
|
978 |
break;
|
979 |
}
|
980 |
} unset($v);
|
981 |
+
|
982 |
//If top iteration, returns compiled name field. Example: "Nickname Firtsname Lastname".]
|
983 |
+
if($nickname_default && $prev_name === ''){
|
|
|
984 |
if(!empty($nickname)){
|
985 |
+
$nickname_str = '';
|
986 |
foreach($nickname as $value){
|
987 |
$nickname_str .= ($value ? $value." " : "");
|
988 |
}unset($value);
|
1164 |
|
1165 |
return false;
|
1166 |
}
|
1167 |
+
|
1168 |
+
/**
|
1169 |
+
* Hide website field from standard comments form
|
1170 |
+
*/
|
1171 |
+
add_filter( 'comment_form_default_fields', 'apbct__change_type_website_field' );
|
1172 |
+
function apbct__change_type_website_field( $fields ){
|
1173 |
+
|
1174 |
+
global $apbct, $commenter;
|
1175 |
+
|
1176 |
+
if(isset($apbct->settings['comments__hide_website_field']) && $apbct->settings['comments__hide_website_field']) {
|
1177 |
+
if(isset($fields['url']) && $fields['url']) {
|
1178 |
+
$fields['url'] = '<input id="url" name="url" type="hidden" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" />';
|
1179 |
+
}
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
return $fields;
|
1183 |
+
}
|
1184 |
+
|
1185 |
+
/**
|
1186 |
+
* Add styles if website field hidden
|
1187 |
+
*/
|
1188 |
+
add_action( 'wp_print_styles', 'apbct__styles_if_website_hidden' );
|
1189 |
+
function apbct__styles_if_website_hidden() {
|
1190 |
+
global $apbct;
|
1191 |
+
|
1192 |
+
if(isset($apbct->settings['comments__hide_website_field']) && $apbct->settings['comments__hide_website_field']) {
|
1193 |
+
$styles = "
|
1194 |
+
<style>
|
1195 |
+
.comment-form-cookies-consent {
|
1196 |
+
width:100%;
|
1197 |
+
overflow: hidden;
|
1198 |
+
}
|
1199 |
+
@media (min-width: 768px) {
|
1200 |
+
#respond .comment-form-email {
|
1201 |
+
margin-right: 0 !important;
|
1202 |
+
}
|
1203 |
+
#respond .comment-form-author, #respond .comment-form-email {
|
1204 |
+
width: 47.058% !important;
|
1205 |
+
}
|
1206 |
+
}
|
1207 |
+
</style>";
|
1208 |
+
|
1209 |
+
echo $styles;
|
1210 |
+
}
|
1211 |
+
}
|
@@ -514,6 +514,17 @@ function apbct_is_skip_request( $ajax = false ) {
|
|
514 |
{
|
515 |
return 'mylisting_theme_service_requests_skip';
|
516 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
|
518 |
break;
|
519 |
|
514 |
{
|
515 |
return 'mylisting_theme_service_requests_skip';
|
516 |
}
|
517 |
+
// HappyForms skip every requests. HappyForms have the direct integration
|
518 |
+
if( apbct_is_plugin_active( 'happyforms-upgrade/happyforms-upgrade.php' ) &&
|
519 |
+
( Post::get('happyforms_message_nonce') !== '' ) )
|
520 |
+
{
|
521 |
+
return 'happyform_skipped';
|
522 |
+
}
|
523 |
+
if( apbct_is_plugin_active( 'essential-addons-for-elementor-lite/essential_adons_elementor.php' ) &&
|
524 |
+
( Post::get('eael-login-submit') !== '' && Post::get('eael-user-login') !== '' ) )
|
525 |
+
{
|
526 |
+
return 'eael_login_skipped';
|
527 |
+
}
|
528 |
|
529 |
break;
|
530 |
|
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
|
|
|
3 |
use Cleantalk\Variables\Server;
|
4 |
|
5 |
/**
|
@@ -9,7 +10,25 @@ use Cleantalk\Variables\Server;
|
|
9 |
function apbct_init() {
|
10 |
|
11 |
global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $apbct, $test_external_forms, $cleantalk_executed, $wpdb;
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
//Check internal forms with such "action" http://wordpress.loc/contact-us/some_script.php
|
14 |
if((isset($_POST['action']) && $_POST['action'] == 'ct_check_internal') &&
|
15 |
$apbct->settings['forms__check_internal']
|
@@ -1040,29 +1059,43 @@ function apbct_hook__wp_footer() {
|
|
1040 |
|
1041 |
global $apbct;
|
1042 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1043 |
if( $apbct->settings['data__use_ajax'] ){
|
1044 |
|
|
|
|
|
1045 |
if( $apbct->use_rest_api ) {
|
1046 |
-
$html = "<script type=\"text/javascript\" " . ( class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '' ) . ">
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
|
|
|
|
1055 |
</script>";
|
1056 |
} else {
|
1057 |
-
$html = "<script type=\"text/javascript\" " . ( class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '' ) . ">
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
|
|
|
|
1066 |
</script>";
|
1067 |
}
|
1068 |
|
@@ -1495,6 +1528,15 @@ function ct_preprocess_comment($comment) {
|
|
1495 |
}
|
1496 |
}
|
1497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1498 |
$base_call_result = apbct_base_call(
|
1499 |
array(
|
1500 |
'message' => $comment['comment_content'],
|
@@ -1512,6 +1554,7 @@ function ct_preprocess_comment($comment) {
|
|
1512 |
'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
|
1513 |
))
|
1514 |
),
|
|
|
1515 |
)
|
1516 |
);
|
1517 |
$ct_result = $base_call_result['ct_result'];
|
@@ -1702,19 +1745,44 @@ function ct_die($comment_id, $comment_status) {
|
|
1702 |
|
1703 |
do_action( 'apbct_pre_block_page', $ct_comment );
|
1704 |
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1718 |
}
|
1719 |
|
1720 |
/**
|
@@ -1725,11 +1793,42 @@ function ct_die_extended($comment_body) {
|
|
1725 |
|
1726 |
global $ct_jp_comments;
|
1727 |
|
1728 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1729 |
if( ! $ct_jp_comments ) {
|
1730 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1731 |
}
|
1732 |
-
|
|
|
|
|
1733 |
}
|
1734 |
|
1735 |
/**
|
@@ -1920,6 +2019,10 @@ function apbct_login__scripts(){
|
|
1920 |
'_rest_nonce' => wp_create_nonce('wp_rest'),
|
1921 |
'_ajax_url' => admin_url('admin-ajax.php'),
|
1922 |
'_rest_url' => esc_url( get_rest_url() ),
|
|
|
|
|
|
|
|
|
1923 |
));
|
1924 |
|
1925 |
$apbct->public_script_loaded = true;
|
@@ -2843,15 +2946,56 @@ function apbct_form__WPForms__addField($form_data, $some, $title, $description,
|
|
2843 |
function apbct_from__WPForms__gatherData($entry, $form){
|
2844 |
|
2845 |
global $apbct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2846 |
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2853 |
|
2854 |
-
|
2855 |
|
2856 |
return $entry;
|
2857 |
}
|
@@ -2906,7 +3050,22 @@ function apbct_form__WPForms__testSpam() {
|
|
2906 |
|
2907 |
$checkjs = apbct_js_test('ct_checkjs_wpforms', $_POST);
|
2908 |
|
2909 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2910 |
|
2911 |
$sender_email = ($params['email'] ? $params['email'] : '');
|
2912 |
$sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
|
@@ -3585,7 +3744,9 @@ function ct_contact_form_validate() {
|
|
3585 |
apbct_is_in_uri('/settings/profile/') && isset($_POST['submit']) || // Buddypress integration
|
3586 |
apbct_is_in_uri('/settings/data/') && isset($_POST['submit']) || // Buddypress integration
|
3587 |
apbct_is_in_uri('/settings/delete-account/') && isset($_POST['submit']) || // Buddypress integration
|
3588 |
-
apbct_is_in_uri('/profile/') && isset($_POST['submit'])
|
|
|
|
|
3589 |
/* !! Do not add actions here. Use apbct_is_skip_request() function below !! */
|
3590 |
) {
|
3591 |
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
|
@@ -3987,6 +4148,10 @@ function ct_enqueue_scripts_public($hook){
|
|
3987 |
'_rest_url' => esc_url( get_rest_url() ),
|
3988 |
'data__set_cookies' => $apbct->settings['data__set_cookies'],
|
3989 |
'data__set_cookies__alt_sessions_type' => $apbct->settings['data__set_cookies__alt_sessions_type'],
|
|
|
|
|
|
|
|
|
3990 |
));
|
3991 |
}
|
3992 |
|
@@ -4254,3 +4419,18 @@ function apbct_form_profile_builder__check_register ( $errors, $fields, $global_
|
|
4254 |
return $errors;
|
4255 |
|
4256 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
|
3 |
+
use Cleantalk\ApbctWP\Helper;
|
4 |
use Cleantalk\Variables\Server;
|
5 |
|
6 |
/**
|
10 |
function apbct_init() {
|
11 |
|
12 |
global $ct_wplp_result_label, $ct_jp_comments, $ct_post_data_label, $ct_post_data_authnet_label, $apbct, $test_external_forms, $cleantalk_executed, $wpdb;
|
13 |
+
|
14 |
+
// Pixel
|
15 |
+
if( $apbct->settings['data__pixel'] ){
|
16 |
+
|
17 |
+
$pixel_hash = md5(
|
18 |
+
\Cleantalk\Common\Helper::ip__get()
|
19 |
+
. $apbct->api_key
|
20 |
+
. \Cleantalk\Common\Helper::time__get_interval_start( 3600 * 3 ) // Unique for every 3 hours
|
21 |
+
);
|
22 |
+
|
23 |
+
// Change server each 3 hours depending on current time interval
|
24 |
+
$servers = array_keys( \Cleantalk\Common\Helper::$cleantalks_moderate_servers );
|
25 |
+
$server_num = \Cleantalk\Common\Helper::time__get_interval_start( 3600 * 3 ) % count($servers);
|
26 |
+
$pixel_server = $servers[ $server_num ];
|
27 |
+
|
28 |
+
$apbct->pixel_url = 'https://' . $pixel_server . '/pixel/' . $pixel_hash . '.gif';
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
//Check internal forms with such "action" http://wordpress.loc/contact-us/some_script.php
|
33 |
if((isset($_POST['action']) && $_POST['action'] == 'ct_check_internal') &&
|
34 |
$apbct->settings['forms__check_internal']
|
1059 |
|
1060 |
global $apbct;
|
1061 |
|
1062 |
+
// Pixel
|
1063 |
+
if(
|
1064 |
+
$apbct->settings['data__pixel'] === '1' ||
|
1065 |
+
( $apbct->settings['data__pixel'] === '3' && ! apbct_is_cache_plugins_exists() )
|
1066 |
+
){
|
1067 |
+
echo '<img style="display: none; left: 99999px;" src="' . $apbct->pixel_url . '">';
|
1068 |
+
}
|
1069 |
+
|
1070 |
if( $apbct->settings['data__use_ajax'] ){
|
1071 |
|
1072 |
+
$timeout = $apbct->settings['misc__async_js'] ? 1000 : 0;
|
1073 |
+
|
1074 |
if( $apbct->use_rest_api ) {
|
1075 |
+
$html = "<script type=\"text/javascript\" " . ( class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '' ) . ">
|
1076 |
+
window.addEventListener('DOMContentLoaded', function () {
|
1077 |
+
setTimeout(function(){
|
1078 |
+
if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
|
1079 |
+
apbct_public_sendREST(
|
1080 |
+
'js_keys__get',
|
1081 |
+
{ callback: apbct_js_keys__set_input_value }
|
1082 |
+
)
|
1083 |
+
}
|
1084 |
+
},". $timeout .");
|
1085 |
+
});
|
1086 |
</script>";
|
1087 |
} else {
|
1088 |
+
$html = "<script type=\"text/javascript\" " . ( class_exists('Cookiebot_WP') ? 'data-cookieconsent="ignore"' : '' ) . ">
|
1089 |
+
window.addEventListener('DOMContentLoaded', function () {
|
1090 |
+
setTimeout(function(){
|
1091 |
+
if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
|
1092 |
+
apbct_public_sendAJAX(
|
1093 |
+
{ action: 'apbct_js_keys__get' },
|
1094 |
+
{ callback: apbct_js_keys__set_input_value, no_nonce: true }
|
1095 |
+
);
|
1096 |
+
}
|
1097 |
+
},". $timeout .");
|
1098 |
+
});
|
1099 |
</script>";
|
1100 |
}
|
1101 |
|
1528 |
}
|
1529 |
}
|
1530 |
|
1531 |
+
// Add honeypot_website field
|
1532 |
+
$honeypot_website = 0;
|
1533 |
+
|
1534 |
+
if(isset($apbct->settings['comments__hide_website_field']) && $apbct->settings['comments__hide_website_field']) {
|
1535 |
+
if(isset($_POST['url']) && !empty($_POST['url']) && $post_info['comment_type'] === 'comment' && isset($_POST['comment_post_ID'])) {
|
1536 |
+
$honeypot_website = 1;
|
1537 |
+
}
|
1538 |
+
}
|
1539 |
+
|
1540 |
$base_call_result = apbct_base_call(
|
1541 |
array(
|
1542 |
'message' => $comment['comment_content'],
|
1554 |
'page_url' => apbct_get_server_variable( 'HTTP_HOST' ) . apbct_get_server_variable( 'REQUEST_URI' ),
|
1555 |
))
|
1556 |
),
|
1557 |
+
'honeypot_website' => $honeypot_website
|
1558 |
)
|
1559 |
);
|
1560 |
$ct_result = $base_call_result['ct_result'];
|
1745 |
|
1746 |
do_action( 'apbct_pre_block_page', $ct_comment );
|
1747 |
|
1748 |
+
$message_title = __('Spam protection', 'cleantalk-spam-protect');
|
1749 |
+
if(defined('CLEANTALK_DISABLE_BLOCKING_TITLE') && CLEANTALK_DISABLE_BLOCKING_TITLE != true) {
|
1750 |
+
$message_title = '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . $message_title;
|
1751 |
+
}
|
1752 |
+
if(isset($_POST['et_pb_contact_email'])) {
|
1753 |
+
$message_title = 'Blacklisted';
|
1754 |
+
}
|
1755 |
+
|
1756 |
+
$back_link = '';
|
1757 |
+
$back_script = '';
|
1758 |
+
if( ! $ct_jp_comments ) {
|
1759 |
+
$back_script = '<script>setTimeout("history.back()", 5000);</script>';
|
1760 |
+
} else {
|
1761 |
+
$back_link = '<a href="' . $_SERVER['HTTP_REFERER'] . '">' . __('Back') . '</a>';
|
1762 |
+
}
|
1763 |
+
|
1764 |
+
if(file_exists(CLEANTALK_PLUGIN_DIR . "templates/lock-pages/lock-page-ct-die.html")){
|
1765 |
+
|
1766 |
+
$ct_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "templates/lock-pages/lock-page-ct-die.html");
|
1767 |
+
|
1768 |
+
// Translation
|
1769 |
+
$replaces = array(
|
1770 |
+
'{MESSAGE_TITLE}' => $message_title,
|
1771 |
+
'{MESSAGE}' => $ct_comment,
|
1772 |
+
'{BACK_LINK}' => $back_link,
|
1773 |
+
'{BACK_SCRIPT}' => $back_script
|
1774 |
+
);
|
1775 |
+
|
1776 |
+
foreach( $replaces as $place_holder => $replace ){
|
1777 |
+
$ct_die_page = str_replace( $place_holder, $replace, $ct_die_page );
|
1778 |
+
}
|
1779 |
+
|
1780 |
+
http_response_code(200);
|
1781 |
+
die($ct_die_page);
|
1782 |
+
}
|
1783 |
+
|
1784 |
+
http_response_code(200);
|
1785 |
+
die("Forbidden. Sender blacklisted. Blocked by Cleantalk");
|
1786 |
}
|
1787 |
|
1788 |
/**
|
1793 |
|
1794 |
global $ct_jp_comments;
|
1795 |
|
1796 |
+
$message_title = __('Spam protection', 'cleantalk-spam-protect');
|
1797 |
+
if(defined('CLEANTALK_DISABLE_BLOCKING_TITLE') && CLEANTALK_DISABLE_BLOCKING_TITLE != true) {
|
1798 |
+
$message_title = '<b style="color: #49C73B;">Clean</b><b style="color: #349ebf;">Talk.</b> ' . $message_title;
|
1799 |
+
}
|
1800 |
+
|
1801 |
+
$back_link = '';
|
1802 |
+
$back_script = '';
|
1803 |
if( ! $ct_jp_comments ) {
|
1804 |
+
$back_script = '<script>setTimeout("history.back()", 5000);</script>';
|
1805 |
+
} else {
|
1806 |
+
$back_link = '<a href="' . $_SERVER['HTTP_REFERER'] . '">' . __('Back') . '</a>';
|
1807 |
+
}
|
1808 |
+
|
1809 |
+
|
1810 |
+
if(file_exists(CLEANTALK_PLUGIN_DIR . "templates/lock-pages/lock-page-ct-die.html")){
|
1811 |
+
|
1812 |
+
$ct_die_page = file_get_contents(CLEANTALK_PLUGIN_DIR . "templates/lock-pages/lock-page-ct-die.html");
|
1813 |
+
|
1814 |
+
// Translation
|
1815 |
+
$replaces = array(
|
1816 |
+
'{MESSAGE_TITLE}' => $message_title,
|
1817 |
+
'{MESSAGE}' => $comment_body,
|
1818 |
+
'{BACK_LINK}' => $back_link,
|
1819 |
+
'{BACK_SCRIPT}' => $back_script
|
1820 |
+
);
|
1821 |
+
|
1822 |
+
foreach( $replaces as $place_holder => $replace ){
|
1823 |
+
$ct_die_page = str_replace( $place_holder, $replace, $ct_die_page );
|
1824 |
+
}
|
1825 |
+
|
1826 |
+
http_response_code(200);
|
1827 |
+
die($ct_die_page);
|
1828 |
}
|
1829 |
+
|
1830 |
+
http_response_code(200);
|
1831 |
+
die("Forbidden. Sender blacklisted. Blocked by Cleantalk");
|
1832 |
}
|
1833 |
|
1834 |
/**
|
2019 |
'_rest_nonce' => wp_create_nonce('wp_rest'),
|
2020 |
'_ajax_url' => admin_url('admin-ajax.php'),
|
2021 |
'_rest_url' => esc_url( get_rest_url() ),
|
2022 |
+
'pixel__setting' => $apbct->settings['data__pixel'],
|
2023 |
+
'pixel__enabled' => $apbct->settings['data__pixel'] === '2' ||
|
2024 |
+
( $apbct->settings['data__pixel'] === '3' && apbct_is_cache_plugins_exists() ),
|
2025 |
+
'pixel__url' => $apbct->pixel_url,
|
2026 |
));
|
2027 |
|
2028 |
$apbct->public_script_loaded = true;
|
2946 |
function apbct_from__WPForms__gatherData($entry, $form){
|
2947 |
|
2948 |
global $apbct;
|
2949 |
+
$handled_result = array();
|
2950 |
+
|
2951 |
+
$entry_fields_data = $entry['fields'] ?: array();
|
2952 |
+
$form_fields_info = $form['fields'] ?: array();
|
2953 |
+
|
2954 |
+
foreach ($form_fields_info as $form_field) {
|
2955 |
+
$field_id = $form_field['id'];
|
2956 |
+
$field_type = $form_field['type'];
|
2957 |
+
$field_label = $form_field['label'] ?: '';
|
2958 |
+
if( ! isset( $entry_fields_data[$field_id] ) ){
|
2959 |
+
continue;
|
2960 |
+
}
|
2961 |
+
$entry_field_value = $entry_fields_data[$field_id];
|
2962 |
+
|
2963 |
+
# search email field
|
2964 |
+
if($field_type === 'email') {
|
2965 |
+
if( ! isset($handled_result['email']) || empty($handled_result['email'])) {
|
2966 |
+
$handled_result['email'] = $entry_field_value;
|
2967 |
+
continue;
|
2968 |
+
}
|
2969 |
+
}
|
2970 |
+
|
2971 |
+
# search name
|
2972 |
+
if($field_type === 'name') {
|
2973 |
+
if( ! isset($handled_result['name']) || empty($handled_result['name'])) {
|
2974 |
+
if(is_array($entry_field_value)) {
|
2975 |
+
$handled_result['name'] = implode(' ', $entry_field_value);
|
2976 |
+
} else {
|
2977 |
+
$handled_result['name'] = array('nick' => $entry_field_value, 'first' => '', 'last' => '');
|
2978 |
+
}
|
2979 |
+
continue;
|
2980 |
+
}
|
2981 |
+
}
|
2982 |
|
2983 |
+
# Add field label as key for result array
|
2984 |
+
# add unique key if key exist
|
2985 |
+
if($field_label) {
|
2986 |
+
$field_label = trim(mb_strtolower($field_label));
|
2987 |
+
$field_label = str_replace(' ', '_', $field_label);
|
2988 |
+
$field_label = preg_replace('/\W/u', '', $field_label);
|
2989 |
+
|
2990 |
+
if( ! isset($handled_result[$field_label]) || empty($handled_result[$field_label])) {
|
2991 |
+
$handled_result[$field_label] = $entry_field_value;
|
2992 |
+
} else {
|
2993 |
+
$handled_result[$field_label . rand(0, 100)] = $entry_field_value;
|
2994 |
+
}
|
2995 |
+
}
|
2996 |
+
}
|
2997 |
|
2998 |
+
$apbct->form_data = $handled_result;
|
2999 |
|
3000 |
return $entry;
|
3001 |
}
|
3050 |
|
3051 |
$checkjs = apbct_js_test('ct_checkjs_wpforms', $_POST);
|
3052 |
|
3053 |
+
$email = $apbct->form_data['email'] ?: null;
|
3054 |
+
$nickname = $apbct->form_data['name'] ?: null;
|
3055 |
+
$form_data = $apbct->form_data;
|
3056 |
+
|
3057 |
+
if($email) {
|
3058 |
+
unset($form_data['email']);
|
3059 |
+
}
|
3060 |
+
if($nickname) {
|
3061 |
+
unset($form_data['name']);
|
3062 |
+
}
|
3063 |
+
|
3064 |
+
$params = ct_get_fields_any($apbct->form_data, array(), $email, $nickname);
|
3065 |
+
|
3066 |
+
if(is_array($params['nickname'])) {
|
3067 |
+
$params['nickname'] = implode(' ', $params['nickname']);
|
3068 |
+
}
|
3069 |
|
3070 |
$sender_email = ($params['email'] ? $params['email'] : '');
|
3071 |
$sender_nickname = ($params['nickname'] ? $params['nickname'] : '');
|
3744 |
apbct_is_in_uri('/settings/profile/') && isset($_POST['submit']) || // Buddypress integration
|
3745 |
apbct_is_in_uri('/settings/data/') && isset($_POST['submit']) || // Buddypress integration
|
3746 |
apbct_is_in_uri('/settings/delete-account/') && isset($_POST['submit']) || // Buddypress integration
|
3747 |
+
apbct_is_in_uri('/profile/') && isset($_POST['submit']) || // Buddypress integration
|
3748 |
+
( isset( $_POST['action'] ) && $_POST['action'] == 'bwfan_insert_abandoned_cart' ) || // Autonami Marketing Automations - WC Plugin - integration
|
3749 |
+
( isset( $_POST['action'] ) && $_POST['action'] == 'check_email_exists' ) // Handling an unknown action check_email_exists
|
3750 |
/* !! Do not add actions here. Use apbct_is_skip_request() function below !! */
|
3751 |
) {
|
3752 |
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST );
|
4148 |
'_rest_url' => esc_url( get_rest_url() ),
|
4149 |
'data__set_cookies' => $apbct->settings['data__set_cookies'],
|
4150 |
'data__set_cookies__alt_sessions_type' => $apbct->settings['data__set_cookies__alt_sessions_type'],
|
4151 |
+
'pixel__setting' => $apbct->settings['data__pixel'],
|
4152 |
+
'pixel__enabled' => $apbct->settings['data__pixel'] === '2' ||
|
4153 |
+
( $apbct->settings['data__pixel'] === '3' && apbct_is_cache_plugins_exists() ),
|
4154 |
+
'pixel__url' => $apbct->pixel_url,
|
4155 |
));
|
4156 |
}
|
4157 |
|
4419 |
return $errors;
|
4420 |
|
4421 |
}
|
4422 |
+
|
4423 |
+
// WP Foro register system integration
|
4424 |
+
function wpforo_create_profile__check_register( $user_fields ) {
|
4425 |
+
|
4426 |
+
global $ct_signup_done;
|
4427 |
+
|
4428 |
+
$ip = Helper::ip__get( 'real', false );
|
4429 |
+
$check = ct_test_registration( $user_fields['user_login'], $user_fields['user_email'], $ip );
|
4430 |
+
if( $check['allow'] == 0 ) {
|
4431 |
+
return array( 'error' => $check['comment'] );
|
4432 |
+
}
|
4433 |
+
|
4434 |
+
$ct_signup_done = true;
|
4435 |
+
return $user_fields;
|
4436 |
+
}
|
@@ -268,6 +268,11 @@ function apbct_settings__set_fileds( $fields ){
|
|
268 |
'description' => __('Allows administrators to manage comments on public post\'s pages with small interactive menu.', 'cleantalk-spam-protect'),
|
269 |
'display' => !$apbct->white_label,
|
270 |
),
|
|
|
|
|
|
|
|
|
|
|
271 |
),
|
272 |
),
|
273 |
|
@@ -344,6 +349,17 @@ function apbct_settings__set_fileds( $fields ){
|
|
344 |
'description' => __('Could help if you have blocked SpamFireWall tables in your database.', 'cleantalk-spam-protect'),
|
345 |
'parent' => 'sfw__enabled',
|
346 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
),
|
348 |
),
|
349 |
|
@@ -633,7 +649,14 @@ function apbct_settings__add_groups_and_fields( $fields ){
|
|
633 |
if(!empty($field['options_callback'])){
|
634 |
$options = call_user_func_array($field['options_callback'], !empty($field['options_callback_params']) ? $field['options_callback_params'] : array());
|
635 |
foreach ($options as &$option){
|
636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
} unset($option);
|
638 |
$field['options'] = $options;
|
639 |
}
|
@@ -1183,8 +1206,13 @@ function apbct_get_all_child_domains($except_main_site = false) {
|
|
1183 |
|
1184 |
if ($except_main_site) {
|
1185 |
foreach ($wp_blogs as $blog) {
|
1186 |
-
if ($blog->blog_id != $blog->site_id)
|
1187 |
-
$
|
|
|
|
|
|
|
|
|
|
|
1188 |
}
|
1189 |
}
|
1190 |
return $blogs;
|
@@ -1449,7 +1477,7 @@ function apbct_settings__validate($settings) {
|
|
1449 |
|
1450 |
$settings['apikey'] = !empty($settings['apikey']) ? trim($settings['apikey']) : '';
|
1451 |
$settings['apikey'] = defined( 'CLEANTALK_ACCESS_KEY') ? CLEANTALK_ACCESS_KEY : $settings['apikey'];
|
1452 |
-
$settings['apikey'] = ! is_main_site() && $apbct->white_label
|
1453 |
$settings['apikey'] = is_main_site() || $apbct->allow_custom_key || $apbct->white_label ? $settings['apikey'] : $apbct->network_settings['apikey'];
|
1454 |
$settings['apikey'] = is_main_site() || !$settings['multisite__white_label'] ? $settings['apikey'] : $apbct->settings['apikey'];
|
1455 |
|
@@ -1574,12 +1602,7 @@ function apbct_settings__sync( $direct_call = false ){
|
|
1574 |
|
1575 |
// SFW actions
|
1576 |
if( $apbct->settings['sfw__enabled'] == 1 ){
|
1577 |
-
|
1578 |
-
if( get_option( 'sfw_update_first' ) ) {
|
1579 |
-
add_option( 'sfw_sync_first', true );
|
1580 |
-
delete_option( 'sfw_update_first' );
|
1581 |
-
}
|
1582 |
-
|
1583 |
$result = apbct_sfw_update__init( 5 );
|
1584 |
if( ! empty( $result['error'] ) )
|
1585 |
$apbct->error_add( 'sfw_update', $result['error'] );
|
@@ -1591,7 +1614,7 @@ function apbct_settings__sync( $direct_call = false ){
|
|
1591 |
}
|
1592 |
|
1593 |
// Updating brief data for dashboard widget
|
1594 |
-
|
1595 |
|
1596 |
// Key is not valid
|
1597 |
}else{
|
268 |
'description' => __('Allows administrators to manage comments on public post\'s pages with small interactive menu.', 'cleantalk-spam-protect'),
|
269 |
'display' => !$apbct->white_label,
|
270 |
),
|
271 |
+
'comments__hide_website_field' => array(
|
272 |
+
'title' => __('Hide the "Website" field', 'cleantalk-spam-protect'),
|
273 |
+
'description' => __('This option hides the "Website" field on the comment form.', 'cleantalk-spam-protect'),
|
274 |
+
'display' => !$apbct->white_label,
|
275 |
+
),
|
276 |
),
|
277 |
),
|
278 |
|
349 |
'description' => __('Could help if you have blocked SpamFireWall tables in your database.', 'cleantalk-spam-protect'),
|
350 |
'parent' => 'sfw__enabled',
|
351 |
),
|
352 |
+
'data__pixel' => array(
|
353 |
+
'title' => __('Use attachment to improve IP-detection', 'cleantalk-spam-protect'),
|
354 |
+
'description' => __('Upload small graphic file from Cleantalk\'s server to improve IP-detection.', 'cleantalk-spam-protect')
|
355 |
+
. '<br>' . __('"Auto" use JavaScript option if cache solutions are found.', 'cleantalk-spam-protect'),
|
356 |
+
'options' => array(
|
357 |
+
array( 'val' => 1, 'label' => __( 'Via direct output', 'cleantalk-spam-protect' ), ),
|
358 |
+
array( 'val' => 2, 'label' => __( 'Via JavaScript', 'cleantalk-spam-protect' ), ),
|
359 |
+
array( 'val' => 3, 'label' => __( 'Auto', 'cleantalk-spam-protect' ), ),
|
360 |
+
array( 'val' => 0, 'label' => __( 'Off', 'cleantalk-spam-protect' ), ),
|
361 |
+
),
|
362 |
+
),
|
363 |
),
|
364 |
),
|
365 |
|
649 |
if(!empty($field['options_callback'])){
|
650 |
$options = call_user_func_array($field['options_callback'], !empty($field['options_callback_params']) ? $field['options_callback_params'] : array());
|
651 |
foreach ($options as &$option){
|
652 |
+
if( is_array( $option ) ) {
|
653 |
+
$option = array(
|
654 |
+
'val' => isset($option['val']) ? $option['val'] : current( $option ),
|
655 |
+
'label' => isset($option['label']) ? $option['label'] : end( $option )
|
656 |
+
);
|
657 |
+
} else {
|
658 |
+
$option = array('val' => $option, 'label' => $option);
|
659 |
+
}
|
660 |
} unset($option);
|
661 |
$field['options'] = $options;
|
662 |
}
|
1206 |
|
1207 |
if ($except_main_site) {
|
1208 |
foreach ($wp_blogs as $blog) {
|
1209 |
+
if ($blog->blog_id != $blog->site_id){
|
1210 |
+
$blog_details = get_blog_details( array( 'blog_id' => $blog->blog_id ) );
|
1211 |
+
$blogs[] = array(
|
1212 |
+
'val' => $blog_details->id,
|
1213 |
+
'label' => '#' . $blog_details->id . ' ' . $blog_details->blogname
|
1214 |
+
);
|
1215 |
+
}
|
1216 |
}
|
1217 |
}
|
1218 |
return $blogs;
|
1477 |
|
1478 |
$settings['apikey'] = !empty($settings['apikey']) ? trim($settings['apikey']) : '';
|
1479 |
$settings['apikey'] = defined( 'CLEANTALK_ACCESS_KEY') ? CLEANTALK_ACCESS_KEY : $settings['apikey'];
|
1480 |
+
$settings['apikey'] = ! is_main_site() && $apbct->white_label && $apbct->settings['apikey'] ? $apbct->settings['apikey'] : $settings['apikey'];
|
1481 |
$settings['apikey'] = is_main_site() || $apbct->allow_custom_key || $apbct->white_label ? $settings['apikey'] : $apbct->network_settings['apikey'];
|
1482 |
$settings['apikey'] = is_main_site() || !$settings['multisite__white_label'] ? $settings['apikey'] : $apbct->settings['apikey'];
|
1483 |
|
1602 |
|
1603 |
// SFW actions
|
1604 |
if( $apbct->settings['sfw__enabled'] == 1 ){
|
1605 |
+
|
|
|
|
|
|
|
|
|
|
|
1606 |
$result = apbct_sfw_update__init( 5 );
|
1607 |
if( ! empty( $result['error'] ) )
|
1608 |
$apbct->error_add( 'sfw_update', $result['error'] );
|
1614 |
}
|
1615 |
|
1616 |
// Updating brief data for dashboard widget
|
1617 |
+
cleantalk_get_brief_data( $apbct->settings['apikey'] );
|
1618 |
|
1619 |
// Key is not valid
|
1620 |
}else{
|
@@ -922,5 +922,65 @@ function apbct_update_to_5_157_0(){
|
|
922 |
$apbct->settings['data__set_cookies__alt_sessions_type'] = 1;
|
923 |
|
924 |
$apbct->save( 'settings' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
925 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
926 |
}
|
922 |
$apbct->settings['data__set_cookies__alt_sessions_type'] = 1;
|
923 |
|
924 |
$apbct->save( 'settings' );
|
925 |
+
|
926 |
+
cleantalk_get_brief_data( $apbct->api_key );
|
927 |
+
|
928 |
+
}
|
929 |
+
|
930 |
+
function apbct_update_to_5_158_0(){
|
931 |
+
|
932 |
+
global $apbct, $wpdb;
|
933 |
|
934 |
+
$sqls[] = 'ALTER TABLE `%scleantalk_sfw`'
|
935 |
+
. ' ADD COLUMN `source` TINYINT(1) NULL DEFAULT NULL AFTER `status`;';
|
936 |
+
|
937 |
+
$sqls[] = 'ALTER TABLE `%scleantalk_sfw_logs`'
|
938 |
+
. ' ADD COLUMN `source` TINYINT(1) NULL DEFAULT NULL AFTER `ua_name`,'
|
939 |
+
. ' ADD COLUMN `network` VARCHAR(20) NULL DEFAULT NULL AFTER `source`,'
|
940 |
+
. ' ADD COLUMN `first_url` VARCHAR(100) NULL DEFAULT NULL AFTER `network`,'
|
941 |
+
. ' ADD COLUMN `last_url` VARCHAR(100) NULL DEFAULT NULL AFTER `first_url`;';
|
942 |
+
|
943 |
+
if( APBCT_WPMS ){
|
944 |
+
// Getting all blog ids
|
945 |
+
$initial_blog = get_current_blog_id();
|
946 |
+
$blogs = array_keys($wpdb->get_results('SELECT blog_id FROM '. $wpdb->blogs, OBJECT_K));
|
947 |
+
|
948 |
+
foreach ($blogs as $blog) {
|
949 |
+
|
950 |
+
switch_to_blog($blog);
|
951 |
+
apbct_activation__create_tables($sqls);
|
952 |
+
}
|
953 |
+
|
954 |
+
// Restoring initial blog
|
955 |
+
switch_to_blog($initial_blog);
|
956 |
+
|
957 |
+
}else{
|
958 |
+
apbct_activation__create_tables($sqls);
|
959 |
+
}
|
960 |
+
|
961 |
+
// Update from fix branch
|
962 |
+
if(APBCT_WPMS && is_main_site()){
|
963 |
+
|
964 |
+
$wp_blogs = $wpdb->get_results('SELECT blog_id, site_id FROM '. $wpdb->blogs, OBJECT_K);
|
965 |
+
$current_sites_list = $apbct->settings['multisite__use_settings_template_apply_for_current_list_sites'];
|
966 |
+
|
967 |
+
if( is_array( $wp_blogs ) && is_array( $current_sites_list ) ) {
|
968 |
+
foreach ($wp_blogs as $blog) {
|
969 |
+
$blog_details = get_blog_details( array( 'blog_id' => $blog->blog_id ) );
|
970 |
+
$site_list_index = array_search( $blog_details->blogname, $current_sites_list, true );
|
971 |
+
if( $site_list_index !== false ) {
|
972 |
+
$current_sites_list[$site_list_index] = $blog_details->id;
|
973 |
+
}
|
974 |
+
}
|
975 |
+
$apbct->settings['multisite__use_settings_template_apply_for_current_list_sites'] = $current_sites_list;
|
976 |
+
$apbct->settings['comments__hide_website_field'] = '0';
|
977 |
+
$apbct->settings['data__pixel'] = '0';
|
978 |
+
$apbct->saveSettings();
|
979 |
+
}
|
980 |
+
|
981 |
+
}else{
|
982 |
+
$apbct->settings['comments__hide_website_field'] = '0';
|
983 |
+
$apbct->settings['data__pixel'] = '0';
|
984 |
+
$apbct->saveSettings();
|
985 |
+
}
|
986 |
}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(t,e){"undefined"!=typeof module&&module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Fingerprint=e()}(this,function(){"use strict";function t(t){var o=Array.prototype.forEach,e=Array.prototype.map;this.each=function(t,e,n){if(null!==t)if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(e.call(n,t[r],r,t)==={})return}else for(var a in t)if(t.hasOwnProperty(a)&&e.call(n,t[a],a,t)==={})return},this.map=function(t,r,i){var a=[];return null==t?a:e&&t.map===e?t.map(r,i):(this.each(t,function(t,e,n){a[a.length]=r.call(i,t,e,n)}),a)},"object"==typeof t?(this.hasher=t.hasher,this.screen_resolution=t.screen_resolution,this.screen_orientation=t.screen_orientation,this.canvas=t.canvas,this.ie_activex=t.ie_activex):"function"==typeof t&&(this.hasher=t)}return t.prototype={get:function(){var t,e=[];return e.push(navigator.userAgent),e.push(navigator.language),e.push(screen.colorDepth),!this.screen_resolution||void 0!==(t=this.getScreenResolution())&&e.push(t.join("x")),e.push((new Date).getTimezoneOffset()),e.push(this.hasSessionStorage()),e.push(this.hasLocalStorage()),e.push(this.hasIndexDb()),document.body?e.push(typeof document.body.addBehavior):e.push("undefined"),e.push(typeof window.openDatabase),e.push(navigator.cpuClass),e.push(navigator.platform),e.push(navigator.doNotTrack),e.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&e.push(this.getCanvasFingerprint()),this.hasher?this.hasher(e.join("###"),31):this.murmurhash3_32_gc(e.join("###"),31)},murmurhash3_32_gc:function(t,e){for(var n,r,i=3&t.length,a=t.length-i,o=e,s=3432918353,h=461845907,c=0;c<a;)r=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,o=27492+(65535&(n=5*(65535&(o=(o^=r=(65535&(r=(r=(65535&r)*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*h+(((r>>>16)*h&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(n>>>16)&65535)<<16);switch(r=0,i){case 3:r^=(255&t.charCodeAt(c+2))<<16;case 2:r^=(255&t.charCodeAt(c+1))<<8;case 1:o^=r=(65535&(r=(r=(65535&(r^=255&t.charCodeAt(c)))*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*h+(((r>>>16)*h&65535)<<16)&4294967295}return o^=t.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(t){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(t){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(t){var e=this.map(t,function(t){return[t.type,t.suffixes].join("~")}).join(",");return[t.name,t.description,e].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject)return this.map(["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"],function(t){try{return new ActiveXObject(t),t}catch(t){return null}}).join(";")
|
2 |
//# sourceMappingURL=apbct-fingerprint.min.js.map
|
1 |
+
!function(t,e){"undefined"!=typeof module&&module.exports?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Fingerprint=e()}(this,function(){"use strict";function t(t){var o=Array.prototype.forEach,e=Array.prototype.map;this.each=function(t,e,n){if(null!==t)if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(e.call(n,t[r],r,t)==={})return}else for(var a in t)if(t.hasOwnProperty(a)&&e.call(n,t[a],a,t)==={})return},this.map=function(t,r,i){var a=[];return null==t?a:e&&t.map===e?t.map(r,i):(this.each(t,function(t,e,n){a[a.length]=r.call(i,t,e,n)}),a)},"object"==typeof t?(this.hasher=t.hasher,this.screen_resolution=t.screen_resolution,this.screen_orientation=t.screen_orientation,this.canvas=t.canvas,this.ie_activex=t.ie_activex):"function"==typeof t&&(this.hasher=t)}return t.prototype={get:function(){var t,e=[];return e.push(navigator.userAgent),e.push(navigator.language),e.push(screen.colorDepth),!this.screen_resolution||void 0!==(t=this.getScreenResolution())&&e.push(t.join("x")),e.push((new Date).getTimezoneOffset()),e.push(this.hasSessionStorage()),e.push(this.hasLocalStorage()),e.push(this.hasIndexDb()),document.body?e.push(typeof document.body.addBehavior):e.push("undefined"),e.push(typeof window.openDatabase),e.push(navigator.cpuClass),e.push(navigator.platform),e.push(navigator.doNotTrack),e.push(this.getPluginsString()),this.canvas&&this.isCanvasSupported()&&e.push(this.getCanvasFingerprint()),this.hasher?this.hasher(e.join("###"),31):this.murmurhash3_32_gc(e.join("###"),31)},murmurhash3_32_gc:function(t,e){for(var n,r,i=3&t.length,a=t.length-i,o=e,s=3432918353,h=461845907,c=0;c<a;)r=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,o=27492+(65535&(n=5*(65535&(o=(o^=r=(65535&(r=(r=(65535&r)*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*h+(((r>>>16)*h&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(n>>>16)&65535)<<16);switch(r=0,i){case 3:r^=(255&t.charCodeAt(c+2))<<16;case 2:r^=(255&t.charCodeAt(c+1))<<8;case 1:o^=r=(65535&(r=(r=(65535&(r^=255&t.charCodeAt(c)))*s+(((r>>>16)*s&65535)<<16)&4294967295)<<15|r>>>17))*h+(((r>>>16)*h&65535)<<16)&4294967295}return o^=t.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(t){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(t){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,function(t){var e=this.map(t,function(t){return[t.type,t.suffixes].join("~")}).join(",");return[t.name,t.description,e].join("::")},this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){return this.map(["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"],function(t){try{return new ActiveXObject(t),t}catch(t){return null}}).join(";")}return""},getScreenResolution:function(){var t=!this.screen_orientation||screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height];return t},getCanvasFingerprint:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n="http://valve.github.io";return e.textBaseline="top",e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(n,4,17),t.toDataURL()}},t});
|
2 |
//# sourceMappingURL=apbct-fingerprint.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-fingerprint.min.js","sources":["apbct-fingerprint.js"],"sourcesContent":["/*\n* fingerprintJS 0.5.5 - Fast browser fingerprint library\n* https://github.com/Valve/fingerprintjs\n* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)\n* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n;(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }\n else if (typeof define === 'function' && define.amd) { define(definition); }\n else { context[name] = definition(); }\n})('Fingerprint', this, function () {\n 'use strict';\n\n var Fingerprint = function (options) {\n var nativeForEach, nativeMap;\n nativeForEach = Array.prototype.forEach;\n nativeMap = Array.prototype.map;\n\n this.each = function (obj, iterator, context) {\n if (obj === null) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === {}) return;\n }\n } else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (iterator.call(context, obj[key], key, obj) === {}) return;\n }\n }\n }\n };\n\n this.map = function(obj, iterator, context) {\n var results = [];\n // Not using strict equality so that this acts as a\n // shortcut to checking for `null` and `undefined`.\n if (obj == null) return results;\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n this.each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n if (typeof options == 'object'){\n this.hasher = options.hasher;\n this.screen_resolution = options.screen_resolution;\n this.screen_orientation = options.screen_orientation;\n this.canvas = options.canvas;\n this.ie_activex = options.ie_activex;\n } else if(typeof options == 'function'){\n this.hasher = options;\n }\n };\n\n Fingerprint.prototype = {\n get: function(){\n var keys = [];\n keys.push(navigator.userAgent);\n keys.push(navigator.language);\n keys.push(screen.colorDepth);\n if (this.screen_resolution) {\n var resolution = this.getScreenResolution();\n if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs\n keys.push(resolution.join('x'));\n }\n }\n keys.push(new Date().getTimezoneOffset());\n keys.push(this.hasSessionStorage());\n keys.push(this.hasLocalStorage());\n keys.push(this.hasIndexDb());\n //body might not be defined at this point or removed programmatically\n if(document.body){\n keys.push(typeof(document.body.addBehavior));\n } else {\n keys.push(typeof undefined);\n }\n keys.push(typeof(window.openDatabase));\n keys.push(navigator.cpuClass);\n keys.push(navigator.platform);\n keys.push(navigator.doNotTrack);\n keys.push(this.getPluginsString());\n if(this.canvas && this.isCanvasSupported()){\n keys.push(this.getCanvasFingerprint());\n }\n if(this.hasher){\n return this.hasher(keys.join('###'), 31);\n } else {\n return this.murmurhash3_32_gc(keys.join('###'), 31);\n }\n },\n\n /**\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\n *\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n *\n * @param {string} key ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n */\n\n murmurhash3_32_gc: function(key, seed) {\n var remainder, bytes, h1, h1b, c1, c2, k1, i;\n\n remainder = key.length & 3; // key.length % 4\n bytes = key.length - remainder;\n h1 = seed;\n c1 = 0xcc9e2d51;\n c2 = 0x1b873593;\n i = 0;\n\n while (i < bytes) {\n k1 =\n ((key.charCodeAt(i) & 0xff)) |\n ((key.charCodeAt(++i) & 0xff) << 8) |\n ((key.charCodeAt(++i) & 0xff) << 16) |\n ((key.charCodeAt(++i) & 0xff) << 24);\n ++i;\n\n k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n case 1: k1 ^= (key.charCodeAt(i) & 0xff);\n\n k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= key.length;\n\n h1 ^= h1 >>> 16;\n h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n },\n\n // https://bugzilla.mozilla.org/show_bug.cgi?id=781447\n hasLocalStorage: function () {\n try{\n return !!window.localStorage;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n hasSessionStorage: function () {\n try{\n return !!window.sessionStorage;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n hasIndexDb: function () {\n try{\n return !!window.indexedDB;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n isCanvasSupported: function () {\n var elem = document.createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n },\n\n isIE: function () {\n if(navigator.appName === 'Microsoft Internet Explorer') {\n return true;\n } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11\n return true;\n }\n return false;\n },\n\n getPluginsString: function () {\n if(this.isIE() && this.ie_activex){\n return this.getIEPluginsString();\n } else {\n return this.getRegularPluginsString();\n }\n },\n\n getRegularPluginsString: function () {\n return this.map(navigator.plugins, function (p) {\n var mimeTypes = this.map(p, function(mt){\n return [mt.type, mt.suffixes].join('~');\n }).join(',');\n return [p.name, p.description, mimeTypes].join('::');\n }, this).join(';');\n },\n\n getIEPluginsString: function () {\n if(window.ActiveXObject){\n var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin\n 'AcroPDF.PDF', // Adobe PDF reader 7+\n 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr\n 'QuickTime.QuickTime', // QuickTime\n // 5 versions of real players\n 'rmocx.RealPlayer G2 Control',\n 'rmocx.RealPlayer G2 Control.1',\n 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',\n 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',\n 'RealPlayer',\n 'SWCtl.SWCtl', // ShockWave player\n 'WMPlayer.OCX', // Windows media player\n 'AgControl.AgControl', // Silverlight\n 'Skype.Detection'];\n\n // starting to detect plugins in IE\n return this.map(names, function(name){\n try{\n new ActiveXObject(name);\n return name;\n } catch(e){\n return null;\n }\n }).join(';');\n } else {\n return \"\"; // behavior prior version 0.5.0, not breaking backwards compat.\n }\n },\n\n getScreenResolution: function () {\n var resolution;\n if(this.screen_orientation){\n resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];\n }else{\n resolution = [screen.height, screen.width];\n }\n return resolution;\n },\n\n getCanvasFingerprint: function () {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n // https://www.browserleaks.com/canvas#how-does-it-work\n var txt = 'http://valve.github.io';\n ctx.textBaseline = \"top\";\n ctx.font = \"14px 'Arial'\";\n ctx.textBaseline = \"alphabetic\";\n ctx.fillStyle = \"#f60\";\n ctx.fillRect(125,1,62,20);\n ctx.fillStyle = \"#069\";\n ctx.fillText(txt, 2, 15);\n ctx.fillStyle = \"rgba(102, 204, 0, 0.7)\";\n ctx.fillText(txt, 4, 17);\n return canvas.toDataURL();\n }\n };\n\n\n return Fingerprint;\n\n});"],"names":["context","definition","module","exports","define","amd","this","Fingerprint","options","nativeForEach","Array","prototype","forEach","nativeMap","map","each","obj","iterator","length","i","l","call","key","hasOwnProperty","results","value","index","list","hasher","screen_resolution","screen_orientation","canvas","ie_activex","get","resolution","keys","push","navigator","userAgent","language","screen","colorDepth","getScreenResolution","join","Date","getTimezoneOffset","hasSessionStorage","hasLocalStorage","hasIndexDb","document","body","window","cpuClass","platform","doNotTrack","getPluginsString","isCanvasSupported","getCanvasFingerprint","murmurhash3_32_gc","seed","h1b","k1","remainder","bytes","h1","c1","c2","charCodeAt","localStorage","e","sessionStorage","indexedDB","elem","createElement","getContext","isIE","appName","test","getIEPluginsString","getRegularPluginsString","plugins","p","mimeTypes","mt","type","suffixes","name","description","ActiveXObject","height","width","ctx","txt","textBaseline","font","fillStyle","fillRect","fillText","toDataURL"],"mappings":"CAkBC,SAAiBA,EAASC,GACH,oBAAXC,QAA0BA,OAAOC,QAAW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Y5E,KAAKQ,IAAImE,EAAG,SAASE,GACnC,MAAO,CAACA,EAAGC,KAAMD,EAAGE,UAAU1C,KAAK,OAClCA,KAAK,KACR,MAAO,CAACsC,EAAEK,KAAML,EAAEM,YAAaL,GAAWvC,KAAK,OAC9CrC,MAAMqC,KAAK,MAGhBmC,mBAAoB,WAClB,GAAG3B,OAAOqC,cAiBR,OAAOlF,KAAKQ,IAhBA,CAAC,gCACX,cACA,cACA,sBAEA,8BACA,gCACA,qDACA,mDACA,aACA,cACA,eACA,sBACA,mBAGqB,SAASwE,GAC9B,IAEE,OADA,IAAIE,cAAcF,GACXA,EACP,MAAMjB,GACN,OAAO,QAER1B,KAAK,KAER,MAAO,IAIXD,oBAAqB,WACnB,IAEGR,GADC5B,KAAKwB,oBACQU,OAAOiD,OAASjD,OAAOkD,MAExB,CAAClD,OAAOiD,OAAQjD,OAAOkD,OAF0C,CAAClD,OAAOkD,MAAOlD,OAAOiD,QAItG,OAAOvD,GAGVuB,qBAAsB,WACpB,IAAI1B,EAASkB,SAASwB,cAAc,UAChCkB,EAAM5D,EAAO2C,WAAW,MAExBkB,EAAM,yBAUV,OATAD,EAAIE,aAAe,MACnBF,EAAIG,KAAO,eACXH,EAAIE,aAAe,aACnBF,EAAII,UAAY,OAChBJ,EAAIK,SAAS,IAAI,EAAE,GAAG,IACtBL,EAAII,UAAY,OAChBJ,EAAIM,SAASL,EAAK,EAAG,IACrBD,EAAII,UAAY,yBAChBJ,EAAIM,SAASL,EAAK,EAAG,IACd7D,EAAOmE,cAKX3F"}
|
1 |
+
{"version":3,"file":"apbct-fingerprint.min.js","sources":["apbct-fingerprint.js"],"sourcesContent":["/*\n* fingerprintJS 0.5.5 - Fast browser fingerprint library\n* https://github.com/Valve/fingerprintjs\n* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)\n* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n;(function (name, context, definition) {\n if (typeof module !== 'undefined' && module.exports) { module.exports = definition(); }\n else if (typeof define === 'function' && define.amd) { define(definition); }\n else { context[name] = definition(); }\n})('Fingerprint', this, function () {\n 'use strict';\n\n var Fingerprint = function (options) {\n var nativeForEach, nativeMap;\n nativeForEach = Array.prototype.forEach;\n nativeMap = Array.prototype.map;\n\n this.each = function (obj, iterator, context) {\n if (obj === null) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === {}) return;\n }\n } else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n if (iterator.call(context, obj[key], key, obj) === {}) return;\n }\n }\n }\n };\n\n this.map = function(obj, iterator, context) {\n var results = [];\n // Not using strict equality so that this acts as a\n // shortcut to checking for `null` and `undefined`.\n if (obj == null) return results;\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n this.each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n if (typeof options == 'object'){\n this.hasher = options.hasher;\n this.screen_resolution = options.screen_resolution;\n this.screen_orientation = options.screen_orientation;\n this.canvas = options.canvas;\n this.ie_activex = options.ie_activex;\n } else if(typeof options == 'function'){\n this.hasher = options;\n }\n };\n\n Fingerprint.prototype = {\n get: function(){\n var keys = [];\n keys.push(navigator.userAgent);\n keys.push(navigator.language);\n keys.push(screen.colorDepth);\n if (this.screen_resolution) {\n var resolution = this.getScreenResolution();\n if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs\n keys.push(resolution.join('x'));\n }\n }\n keys.push(new Date().getTimezoneOffset());\n keys.push(this.hasSessionStorage());\n keys.push(this.hasLocalStorage());\n keys.push(this.hasIndexDb());\n //body might not be defined at this point or removed programmatically\n if(document.body){\n keys.push(typeof(document.body.addBehavior));\n } else {\n keys.push(typeof undefined);\n }\n keys.push(typeof(window.openDatabase));\n keys.push(navigator.cpuClass);\n keys.push(navigator.platform);\n keys.push(navigator.doNotTrack);\n keys.push(this.getPluginsString());\n if(this.canvas && this.isCanvasSupported()){\n keys.push(this.getCanvasFingerprint());\n }\n if(this.hasher){\n return this.hasher(keys.join('###'), 31);\n } else {\n return this.murmurhash3_32_gc(keys.join('###'), 31);\n }\n },\n\n /**\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\n *\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n *\n * @param {string} key ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n */\n\n murmurhash3_32_gc: function(key, seed) {\n var remainder, bytes, h1, h1b, c1, c2, k1, i;\n\n remainder = key.length & 3; // key.length % 4\n bytes = key.length - remainder;\n h1 = seed;\n c1 = 0xcc9e2d51;\n c2 = 0x1b873593;\n i = 0;\n\n while (i < bytes) {\n k1 =\n ((key.charCodeAt(i) & 0xff)) |\n ((key.charCodeAt(++i) & 0xff) << 8) |\n ((key.charCodeAt(++i) & 0xff) << 16) |\n ((key.charCodeAt(++i) & 0xff) << 24);\n ++i;\n\n k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n }\n\n k1 = 0;\n\n switch (remainder) {\n case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n case 1: k1 ^= (key.charCodeAt(i) & 0xff);\n\n k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= k1;\n }\n\n h1 ^= key.length;\n\n h1 ^= h1 >>> 16;\n h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n h1 ^= h1 >>> 13;\n h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n h1 ^= h1 >>> 16;\n\n return h1 >>> 0;\n },\n\n // https://bugzilla.mozilla.org/show_bug.cgi?id=781447\n hasLocalStorage: function () {\n try{\n return !!window.localStorage;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n hasSessionStorage: function () {\n try{\n return !!window.sessionStorage;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n hasIndexDb: function () {\n try{\n return !!window.indexedDB;\n } catch(e) {\n return true; // SecurityError when referencing it means it exists\n }\n },\n\n isCanvasSupported: function () {\n var elem = document.createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n },\n\n isIE: function () {\n if(navigator.appName === 'Microsoft Internet Explorer') {\n return true;\n } else if(navigator.appName === 'Netscape' && /Trident/.test(navigator.userAgent)){// IE 11\n return true;\n }\n return false;\n },\n\n getPluginsString: function () {\n if(this.isIE() && this.ie_activex){\n return this.getIEPluginsString();\n } else {\n return this.getRegularPluginsString();\n }\n },\n\n getRegularPluginsString: function () {\n return this.map(navigator.plugins, function (p) {\n var mimeTypes = this.map(p, function(mt){\n return [mt.type, mt.suffixes].join('~');\n }).join(',');\n return [p.name, p.description, mimeTypes].join('::');\n }, this).join(';');\n },\n\n getIEPluginsString: function () {\n if(window.ActiveXObject){\n var names = ['ShockwaveFlash.ShockwaveFlash',//flash plugin\n 'AcroPDF.PDF', // Adobe PDF reader 7+\n 'PDF.PdfCtrl', // Adobe PDF reader 6 and earlier, brrr\n 'QuickTime.QuickTime', // QuickTime\n // 5 versions of real players\n 'rmocx.RealPlayer G2 Control',\n 'rmocx.RealPlayer G2 Control.1',\n 'RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)',\n 'RealVideo.RealVideo(tm) ActiveX Control (32-bit)',\n 'RealPlayer',\n 'SWCtl.SWCtl', // ShockWave player\n 'WMPlayer.OCX', // Windows media player\n 'AgControl.AgControl', // Silverlight\n 'Skype.Detection'];\n\n // starting to detect plugins in IE\n return this.map(names, function(name){\n try{\n new ActiveXObject(name);\n return name;\n } catch(e){\n return null;\n }\n }).join(';');\n } else {\n return \"\"; // behavior prior version 0.5.0, not breaking backwards compat.\n }\n },\n\n getScreenResolution: function () {\n var resolution;\n if(this.screen_orientation){\n resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];\n }else{\n resolution = [screen.height, screen.width];\n }\n return resolution;\n },\n\n getCanvasFingerprint: function () {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n // https://www.browserleaks.com/canvas#how-does-it-work\n var txt = 'http://valve.github.io';\n ctx.textBaseline = \"top\";\n ctx.font = \"14px 'Arial'\";\n ctx.textBaseline = \"alphabetic\";\n ctx.fillStyle = \"#f60\";\n ctx.fillRect(125,1,62,20);\n ctx.fillStyle = \"#069\";\n ctx.fillText(txt, 2, 15);\n ctx.fillStyle = \"rgba(102, 204, 0, 0.7)\";\n ctx.fillText(txt, 4, 17);\n return canvas.toDataURL();\n }\n };\n\n\n return Fingerprint;\n\n});"],"names":["context","definition","module","exports","define","amd","this","Fingerprint","options","nativeForEach","Array","prototype","forEach","nativeMap","map","each","obj","iterator","length","i","l","call","key","hasOwnProperty","results","value","index","list","hasher","screen_resolution","screen_orientation","canvas","ie_activex","get","resolution","keys","push","navigator","userAgent","language","screen","colorDepth","getScreenResolution","join","Date","getTimezoneOffset","hasSessionStorage","hasLocalStorage","hasIndexDb","document","body","window","cpuClass","platform","doNotTrack","getPluginsString","isCanvasSupported","getCanvasFingerprint","murmurhash3_32_gc","seed","h1b","k1","remainder","bytes","h1","c1","c2","charCodeAt","localStorage","e","sessionStorage","indexedDB","elem","createElement","getContext","isIE","appName","test","getIEPluginsString","getRegularPluginsString","plugins","p","mimeTypes","mt","type","suffixes","name","description","ActiveXObject","height","width","ctx","txt","textBaseline","font","fillStyle","fillRect","fillText","toDataURL"],"mappings":"CAkBC,SAAiBA,EAASC,GACH,oBAAXC,QAA0BA,OAAOC,QAAWD,OAAOC,QAAUF,IAC7C,mBAAXG,QAAyBA,OAAOC,IAAOD,OAAOH,GACvDD,EAAY,YAAIC,IAHxB,CAIiBK,KAAM,wBAGJ,SAAdC,EAAwBC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AML,EAAEM,YAAaL,GAAWvC,KAAK,OAC9CrC,MAAMqC,KAAK,MAGhBmC,mBAAoB,WAClB,GAAG3B,OAAOqC,cAAc,CAiBtB,OAAOlF,KAAKQ,IAhBA,CAAC,gCACX,cACA,cACA,sBAEA,8BACA,gCACA,qDACA,mDACA,aACA,cACA,eACA,sBACA,mBAGqB,SAASwE,GAC9B,IAEE,OADA,IAAIE,cAAcF,GACXA,EACP,MAAMjB,GACN,OAAO,QAER1B,KAAK,KAER,MAAO,IAIXD,oBAAqB,WACnB,IAEGR,GADC5B,KAAKwB,oBACQU,OAAOiD,OAASjD,OAAOkD,MAExB,CAAClD,OAAOiD,OAAQjD,OAAOkD,OAF0C,CAAClD,OAAOkD,MAAOlD,OAAOiD,QAItG,OAAOvD,GAGVuB,qBAAsB,WACpB,IAAI1B,EAASkB,SAASwB,cAAc,UAChCkB,EAAM5D,EAAO2C,WAAW,MAExBkB,EAAM,yBAUV,OATAD,EAAIE,aAAe,MACnBF,EAAIG,KAAO,eACXH,EAAIE,aAAe,aACnBF,EAAII,UAAY,OAChBJ,EAAIK,SAAS,IAAI,EAAE,GAAG,IACtBL,EAAII,UAAY,OAChBJ,EAAIM,SAASL,EAAK,EAAG,IACrBD,EAAII,UAAY,yBAChBJ,EAAIM,SAASL,EAAK,EAAG,IACd7D,EAAOmE,cAKX3F"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
var apbct_fingerprint=new Fingerprint({canvas:!0,ie_activex:!0,hasher:apbct_md5}).get();function apbct_cookie__get(n,i){var s={};return"string"==typeof(n=n||null)&&(n=n.split()),"
|
2 |
//# sourceMappingURL=apbct-public--alt.min.js.map
|
1 |
+
var apbct_fingerprint=new Fingerprint({canvas:!0,ie_activex:!0,hasher:apbct_md5}).get();function apbct_cookie__get(n,i){var s={};return"string"==typeof(n=n||null)&&(n=n.split()),"none"==(i=i||["apbct_","ct_"])&&(i=null),"string"==typeof i&&(i=i.split()),document.cookie.split(";").forEach(function(o,e,c){var t=o.trim().split("=");n&&n.forEach(function(o,e,c){t[0]===o&&(s[t[0]]=t[1])}),i&&i.forEach(function(o,e,c){0===t[0].indexOf(o)&&(s[t[0]]=t[1])})}),s}function apbct_cookie__delete(n,i){var s=new Date(0);"string"==typeof(n=n||null)&&(n=n.split()),"none"==(i=i||["apbct_","ct_"])&&(i=null),"string"==typeof i&&(i=i.split()),document.cookie.split(";").forEach(function(o,e,c){var t=o.trim().split("=");n&&n.forEach(function(o,e,c){t[0]===o&&(document.cookie=t[0]+"=; path=/; expires="+s.toUTCString()+"; samesite=lax")}),i&&i.forEach(function(o,e,c){0===t[0].indexOf(o)&&(document.cookie=t[0]+"=; path=/; expires="+s.toUTCString()+"; samesite=lax")})})}jQuery(document).ready(function(){jQuery.ajax({type:"POST",url:apbctPublicAlt.ajax_url,data:{apbct_action:"get_sessions",apbct_secret:apbctPublicAlt.nonce,session_id:apbct_fingerprint},async:!0,success:function(o){if(console.log("success"),(o=JSON.parse(o)).result)for(cookie in console.log(o),o.cookies)console.log(cookie),document.cookie=cookie+"="+o.cookies[cookie]+"; path=/; samesite=lax";else console.log(o),console.log("APBCT SESSIONS GET ERROR")},error:function(o){console.log("err"),console.log(o)}}),window.onunload=function(){cookies=apbct_cookie__get(),console.log("leave"),jQuery.ajax({type:"POST",url:apbctPublicAlt.ajax_url,data:{apbct_action:"set_sessions",apbct_secret:apbctPublicAlt.nonce,session_id:apbct_fingerprint,data:cookies},async:!1,success:function(o){(o=JSON.parse(o)).result?(console.log("success"),console.log(o),apbct_cookie__delete(),console.log("cookie DELETED")):(console.log("APBCT SESSIONS GET ERROR"),console.log(o))},error:function(o){console.log("err"),console.log(o)}})}});
|
2 |
//# sourceMappingURL=apbct-public--alt.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public--alt.min.js","sources":["apbct-public--alt.js"],"sourcesContent":["// Fingerprint\nvar apbct_fingerprint = new Fingerprint({canvas: true, ie_activex: true, hasher: apbct_md5}).get();\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\n/* Function: Deletes cookie with prefix */\nfunction apbct_cookie__delete(names, prefixes){\n\tvar date = new Date(0);\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\t\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString() + '; samesite=lax';\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString() + '; samesite=lax';\n\t\t\t});\n\t\t}\n\t});\n}\n\njQuery(document).ready(function(){\n\t\n\t jQuery.ajax({\n\t\t type: \"POST\",\n\t\t url: apbctPublicAlt.ajax_url,\n\t\t data: {\n\t\t\t apbct_action: 'get_sessions',\n\t\t\t apbct_secret: apbctPublicAlt.nonce,\n\t\t\t session_id: apbct_fingerprint,\n\t\t },\n\t\t async: true,\n\t\t success: function(msg){\n\t\t\t console.log('success');\n\t\t\t msg = JSON.parse(msg);\n\t\t\t\n\t\t\t if(msg.result){\n\t\t\t\t console.log(msg);\n\t\t\t\t for(cookie in msg.cookies){\n\t\t\t\t\t console.log(cookie);\n//\t\t\t\t\t console.log(msg.cookies[cookie]);\n\t\t\t\t\t document.cookie = cookie + \"=\" + msg.cookies[cookie] + \"; path=/; samesite=lax\";\n\t\t\t\t };\n\t\t\t }else{\n\t\t\t\t console.log(msg);\n\t\t\t\t console.log('APBCT SESSIONS GET ERROR');\n\t\t\t }\n\t\t },\n\t\t error: function(err){\n\t\t\t console.log('err');\n\t\t\t console.log(err);\n\t\t }\n\t });\n\t\n\twindow.onunload = function(){\n\t\t\n\t\t// Getting ct_ and apbct_ cookies\n\t\t cookies = apbct_cookie__get();\n\t\t\n\t\tconsole.log('leave');\n\t\t\n\t\t jQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: apbctPublicAlt.ajax_url,\n\t\t\tdata: {\n\t\t\t\tapbct_action: 'set_sessions',\n\t\t\t\tapbct_secret: apbctPublicAlt.nonce,\n\t\t\t\tsession_id: apbct_fingerprint,\n\t\t\t\tdata: cookies,\n\t\t\t},\n\t\t\tasync: false,\n\t\t\tsuccess: function(msg){\n\t\t\t\tmsg = JSON.parse(msg);\n\t\t\t\tif(msg.result){\n\t\t\t\t\tconsole.log('success');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t\t// Deleting ct_ and apbct_ cookies on success\n\t\t\t\t\tapbct_cookie__delete();\n\t\t\t\t\tconsole.log('cookie DELETED');\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log('APBCT SESSIONS GET ERROR');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err){\n\t\t\t\tconsole.log('err');\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t}); \n\t}\n});"],"names":["apbct_fingerprint","Fingerprint","canvas","ie_activex","hasher","apbct_md5","get","apbct_cookie__get","names","prefixes","cookie","split","document","forEach","item","i","arr","curr","trim","name","all","prefix","indexOf","apbct_cookie__delete","date","Date","toUTCString","jQuery","ready","ajax","type","url","apbctPublicAlt","ajax_url","data","apbct_action","apbct_secret","nonce","session_id","async","success","msg","console","log","JSON","parse","result","cookies","error","err","window","onunload"],"mappings":"AACA,IAAIA,kBAAoB,IAAIC,YAAY,CAACC,QAAQ,EAAMC,YAAY,EAAMC,OAAQC,YAAYC,MAG7F,SAASC,kBAAkBC,EAAOC,GACjC,IAAIC,EAAS,GAuBb,MArBmB,iBADnBF,EAAQA,GAAS,QACYA,EAAQA,EAAMG,
|
1 |
+
{"version":3,"file":"apbct-public--alt.min.js","sources":["apbct-public--alt.js"],"sourcesContent":["// Fingerprint\nvar apbct_fingerprint = new Fingerprint({canvas: true, ie_activex: true, hasher: apbct_md5}).get();\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\n/* Function: Deletes cookie with prefix */\nfunction apbct_cookie__delete(names, prefixes){\n\tvar date = new Date(0);\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes == 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\t\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString() + '; samesite=lax';\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tdocument.cookie = curr[0] + \"=; path=/; expires=\" + date.toUTCString() + '; samesite=lax';\n\t\t\t});\n\t\t}\n\t});\n}\n\njQuery(document).ready(function(){\n\t\n\t jQuery.ajax({\n\t\t type: \"POST\",\n\t\t url: apbctPublicAlt.ajax_url,\n\t\t data: {\n\t\t\t apbct_action: 'get_sessions',\n\t\t\t apbct_secret: apbctPublicAlt.nonce,\n\t\t\t session_id: apbct_fingerprint,\n\t\t },\n\t\t async: true,\n\t\t success: function(msg){\n\t\t\t console.log('success');\n\t\t\t msg = JSON.parse(msg);\n\t\t\t\n\t\t\t if(msg.result){\n\t\t\t\t console.log(msg);\n\t\t\t\t for(cookie in msg.cookies){\n\t\t\t\t\t console.log(cookie);\n//\t\t\t\t\t console.log(msg.cookies[cookie]);\n\t\t\t\t\t document.cookie = cookie + \"=\" + msg.cookies[cookie] + \"; path=/; samesite=lax\";\n\t\t\t\t };\n\t\t\t }else{\n\t\t\t\t console.log(msg);\n\t\t\t\t console.log('APBCT SESSIONS GET ERROR');\n\t\t\t }\n\t\t },\n\t\t error: function(err){\n\t\t\t console.log('err');\n\t\t\t console.log(err);\n\t\t }\n\t });\n\t\n\twindow.onunload = function(){\n\t\t\n\t\t// Getting ct_ and apbct_ cookies\n\t\t cookies = apbct_cookie__get();\n\t\t\n\t\tconsole.log('leave');\n\t\t\n\t\t jQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: apbctPublicAlt.ajax_url,\n\t\t\tdata: {\n\t\t\t\tapbct_action: 'set_sessions',\n\t\t\t\tapbct_secret: apbctPublicAlt.nonce,\n\t\t\t\tsession_id: apbct_fingerprint,\n\t\t\t\tdata: cookies,\n\t\t\t},\n\t\t\tasync: false,\n\t\t\tsuccess: function(msg){\n\t\t\t\tmsg = JSON.parse(msg);\n\t\t\t\tif(msg.result){\n\t\t\t\t\tconsole.log('success');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t\t// Deleting ct_ and apbct_ cookies on success\n\t\t\t\t\tapbct_cookie__delete();\n\t\t\t\t\tconsole.log('cookie DELETED');\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log('APBCT SESSIONS GET ERROR');\n\t\t\t\t\tconsole.log(msg);\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(err){\n\t\t\t\tconsole.log('err');\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t}); \n\t}\n});"],"names":["apbct_fingerprint","Fingerprint","canvas","ie_activex","hasher","apbct_md5","get","apbct_cookie__get","names","prefixes","cookie","split","document","forEach","item","i","arr","curr","trim","name","all","prefix","indexOf","apbct_cookie__delete","date","Date","toUTCString","jQuery","ready","ajax","type","url","apbctPublicAlt","ajax_url","data","apbct_action","apbct_secret","nonce","session_id","async","success","msg","console","log","JSON","parse","result","cookies","error","err","window","onunload"],"mappings":"AACA,IAAIA,kBAAoB,IAAIC,YAAY,CAACC,QAAQ,EAAMC,YAAY,EAAMC,OAAQC,YAAYC,MAG7F,SAASC,kBAAkBC,EAAOC,G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S,SAASC,GAIjB,GAHAC,QAAQC,IAAI,YACZF,EAAMG,KAAKC,MAAMJ,IAEVK,OAEN,IAAIpC,UADJgC,QAAQC,IAAIF,GACEA,EAAIM,QACjBL,QAAQC,IAAIjC,QAEZE,SAASF,OAASA,OAAS,IAAM+B,EAAIM,QAAQrC,QAAU,8BAGxDgC,QAAQC,IAAIF,GACZC,QAAQC,IAAI,6BAGdK,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM,MAIfC,OAAOC,SAAW,WAGhBJ,QAAUxC,oBAEXmC,QAAQC,IAAI,SAEXhB,OAAOE,KAAK,CACZC,KAAM,OACNC,IAAKC,eAAeC,SACpBC,KAAM,CACLC,aAAc,eACdC,aAAcJ,eAAeK,MAC7BC,WAAYtC,kBACZkC,KAAMa,SAEPR,OAAO,EACPC,QAAS,SAASC,IACjBA,EAAMG,KAAKC,MAAMJ,IACVK,QACNJ,QAAQC,IAAI,WACZD,QAAQC,IAAIF,GAEZlB,uBACAmB,QAAQC,IAAI,oBAEZD,QAAQC,IAAI,4BACZD,QAAQC,IAAIF,KAGdO,MAAO,SAASC,GACfP,QAAQC,IAAI,OACZD,QAAQC,IAAIM"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
function ctSetCookie(e,t,n){var o;("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(o="ct_pointer_data"===e||"ct_user_info"===e,e=[[e,t,n]]),0==+ctPublic.data__set_cookies||(1==+ctPublic.data__set_cookies?e.forEach(function(e,t,n){var o=void 0!==e[2]?"expires="+o+"; ":"";document.cookie=e[0]+"="+encodeURIComponent(e[1])+"; "+o+"path=/; samesite=lax"}):2!=+ctPublic.data__set_cookies||o||(1==+ctPublic.data__set_cookies__alt_sessions_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):2==+ctPublic.data__set_cookies__alt_sessions_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{})))}function apbct_collect_visible_fields(e){var t,n=[],o="",i=0,s=[];for(t in e.elements)isNaN(+t)||(n[t]=e.elements[t]);return(n=n.filter(function(e){return
|
2 |
//# sourceMappingURL=apbct-public.min.js.map
|
1 |
+
function ctSetCookie(e,t,n){var o;("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(o="ct_pointer_data"===e||"ct_user_info"===e,e=[[e,t,n]]),0==+ctPublic.data__set_cookies||(1==+ctPublic.data__set_cookies?e.forEach(function(e,t,n){var o=void 0!==e[2]?"expires="+o+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=e[0]+"="+encodeURIComponent(e[1])+"; "+o+"path=/; samesite=lax"+i}):2!=+ctPublic.data__set_cookies||o||(1==+ctPublic.data__set_cookies__alt_sessions_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):2==+ctPublic.data__set_cookies__alt_sessions_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{})))}function apbct_collect_visible_fields(e){var t,n=[],o="",i=0,c="",s=0,a=[];for(t in e.elements)isNaN(+t)||(n[t]=e.elements[t]);return(n=n.filter(function(e){return-1===a.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(a.push(e.getAttribute("name")),!1))})).forEach(function(e,t,n){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(o+=" "+e.getAttribute("name"),i++):(c+=" "+e.getAttribute("name"),s++))}),c=c.trim(),{visible_fields:o=o.trim(),visible_fields_count:i,invisible_fields:c,invisible_fields_count:s}}function apbct_visible_fields_set_cookie(e){e="object"==typeof e&&null!==e?e:{};ctSetCookie("apbct_visible_fields",JSON.stringify(e))}function apbct_js_keys__set_input_value(e,t,n,o){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<i.length;c++)i[c].value=e.js_key}function apbct_public_sendAJAX(t,n,o){var i=n.callback||null,c=n.callback_context||null,s=n.callback_params||null,e=n.async||!0,a=n.notJson||null,l=n.timeout||15e3,o=o||null,r=n.button||null,u=n.spinner||null,_=n.progressbar||null,p=n.silent||null,d=n.no_nonce||null;"string"==typeof t?t=(t=!d?t+"&_ajax_nonce="+ctPublic._ajax_nonce:t)+"&no_cache="+Math.random():(d||(t._ajax_nonce=ctPublic._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:ctPublic._ajax_url,data:t,async:e,success:function(e){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),u&&jQuery(u).css("display","none"),(e=!a?JSON.parse(e):e).error?(setTimeout(function(){_&&_.fadeOut("slow")},1e3),console.log("Error happens: "+(e.error||"Unkown"))):i&&(s?i.apply(c,s.concat(e,t,n,o)):i(e,t,n,o))},error:function(e,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(e),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:l})}function apbct_public_sendREST(t,n){var o=n.callback||null,e=n.data||[],i=n.method||"POST";jQuery.ajax({type:i,url:ctPublic._rest_url+"cleantalk-antispam/v1/"+t,data:e,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ctPublic._rest_nonce)},success:function(e){e.error?console.log("Error happens: "+(e.error||"Unknown")):o&&o(e,t,n,null)},error:function(e,t,n){n&&(console.log("APBCT_REST_ERROR"),console.log(e),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/"))}})}!function(){var e=new Date,t=(new Date).getTime(),n=!0,o=[],i=0;function c(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function s(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}ctSetCookie([["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",e.getTimezoneOffset()/60*-1],["apbct_visible_fields","0"]]);var a=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),s(window,"mousedown",a),s(window,"keydown",a)},l=setInterval(function(){n=!0},150),r=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(o))},1200),u=function(e){!0===n&&(o.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),n=!1,50<=++i&&(s(window,"mousemove",u),clearInterval(l),clearInterval(r)))};c(window,"mousemove",u),c(window,"mousedown",a),c(window,"keydown",a),c(window,"DOMContentLoaded",function(){+ctPublic.pixel__setting&&(ctSetCookie("apbct_pixel_url",ctPublic.pixel__url),+ctPublic.pixel__enabled&&jQuery("body").append('<img style="display: none; left: 99999px;" src="'+ctPublic.pixel__url+'">')),setTimeout(function(){for(var e={},t=0;t<document.forms.length;t++){var n=document.forms[t];n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"==n.id||n.name.classList&&n.name.classList.contains("tinkoffPayRow")||n.name.classList&&n.name.classList.contains("give-form ")||(e[t]=apbct_collect_visible_fields(n),n.onsubmit_prev=n.onsubmit,n.onsubmit=function(e){var t={};t[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}apbct_visible_fields_set_cookie(e)},1e3)})}(),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,n){!t.responseText||-1===t.responseText.indexOf('"apbct')||void 0!==(t=JSON.parse(t.responseText)).apbct&&(t=t.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t.comment}})),cleantalkModal.loaded=t.comment,cleantalkModal.open(),1==+t.stop_script&&window.stop())});
|
2 |
//# sourceMappingURL=apbct-public.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public.min.js","sources":["apbct-public.js"],"sourcesContent":["(function() {\n\n\tvar ct_date = new Date(),\n\t\tctTimeMs = new Date().getTime(),\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\n\t\tctMouseData = [],\n\t\tctMouseDataCounter = 0;\n\n\tfunction apbct_attach_event_handler(elem, event, callback){\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\t\telse elem.attachEvent(event, callback);\n\t}\n\n\tfunction apbct_remove_event_handler(elem, event, callback){\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\t\telse elem.detachEvent(event, callback);\n\t}\n\n\tctSetCookie(\n\t\t[\n\t\t\t[ \"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000) ],\n\t\t\t[ \"ct_fkp_timestamp\", \"0\" ],\n\t\t\t[ \"ct_pointer_data\", \"0\" ],\n\t\t\t[ \"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t\t[ \"apbct_visible_fields\", \"0\" ],\n\t\t]\n\t);\n\n\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\t\tctKeyStopStopListening();\n\t};\n\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n\n\t//Logging mouse position each 150 ms\n\tvar ctFunctionMouseMove = function output(event){\n\t\tif(ctMouseEventTimerFlag === true){\n\n\t\t\tctMouseData.push([\n\t\t\t\tMath.round(event.clientY),\n\t\t\t\tMath.round(event.clientX),\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t\t]);\n\n\t\t\tctMouseDataCounter++;\n\t\t\tctMouseEventTimerFlag = false;\n\t\t\tif(ctMouseDataCounter >= 50){\n\t\t\t\tctMouseStopData();\n\t\t\t}\n\t\t}\n\t};\n\n\t//Stop mouse observing function\n\tfunction ctMouseStopData(){\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\t\tclearInterval(ctMouseReadInterval);\n\t\tclearInterval(ctMouseWriteDataInterval);\n\t}\n\n\t//Stop key listening function\n\tfunction ctKeyStopStopListening(){\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\t}\n\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\n\t\tsetTimeout(function(){\n\n\t\t\tvar visible_fields_collection = {};\n\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\t\tvar form = document.forms[i];\n\n\t\t\t\t//Exclusion for forms\n\t\t\t\tif (\n\t\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t\t(form.id && form.id == 'caspioform') || //Caspio Form\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('give-form ')) // GiveWP\n\t\t\t\t)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvisible_fields_collection[i] = apbct_collect_visible_fields( form );\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\t\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields );\n\n\t\t\t\t\t// Call previous submit action\n\t\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tapbct_visible_fields_set_cookie( visible_fields_collection );\n\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction ctSetCookie( cookies, value, expires ){\n\n\tif( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n\t\tvar skip_alt = cookies === 'ct_pointer_data' || cookies === 'ct_user_info';\n\t\tcookies = [ [ cookies, value, expires ] ];\n\t}\n\n\t// Cookies disabled\n\tif( +ctPublic.data__set_cookies === 0 ){\n\t\treturn;\n\n\t// Using traditional cookies\n\t}else if( +ctPublic.data__set_cookies === 1 ){\n\t\tcookies.forEach( function (item, i, arr\t) {\n\t\t\tvar expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n\t\t\tdocument.cookie = item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\";\n\t\t});\n\n\t// Using alternative cookies\n\t}else if( +ctPublic.data__set_cookies === 2 && ! skip_alt ){\n\n\t\t// Using REST API handler\n\t\tif( +ctPublic.data__set_cookies__alt_sessions_type === 1 ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'alt_sessions',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: { cookies: cookies }\n\t\t\t\t}\n\t\t\t);\n\n\t\t// Using AJAX request and handler\n\t\t}else if( +ctPublic.data__set_cookies__alt_sessions_type === 2 ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_alt_session__save__AJAX',\n\t\t\t\t\tcookies: cookies,\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter fields\n\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\t//elem.value === \"\" || // empty value\n\t\t\telem.getAttribute('name') === null ||\n\t\t\tinputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 // name already added\n\t\t){\n\t\t\treturn false;\n\t\t}\n\n\t\t// Visible fields count\n\t\tinputs_visible_count++;\n\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t});\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\tvar silent = params.silent || null;\n\tvar no_nonce = params.no_nonce || null;\n\n\tif(typeof (data) === 'string') {\n\t\tif( ! no_nonce )\n\t\t\tdata = data + '&_ajax_nonce=' + ctPublic._ajax_nonce;\n\t\tdata = data + '&no_cache=' + Math.random()\n\t} else {\n\t\tif( ! no_nonce )\n\t\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctPublic._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\tconsole.log('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif( errorThrown && ! silent ) {\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n\tvar callback = params.callback || null;\n\tvar data = params.data || [];\n\tvar method = params.method || 'POST';\n\n\tjQuery.ajax({\n\t\ttype: method,\n\t\turl: ctPublic._rest_url + 'cleantalk-antispam/v1/' + route,\n\t\tdata: data,\n\t\tbeforeSend : function ( xhr ) {\n\t\t\txhr.setRequestHeader( 'X-WP-Nonce', ctPublic._rest_nonce );\n\t\t},\n\t\tsuccess: function(result){\n\t\t\tif(result.error){\n\t\t\t\talert('Error happens: ' + (result.error || 'Unknown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tvar obj = null;\n\t\t\t\t\tcallback(result, route, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif( errorThrown ) {\n\t\t\t\tconsole.log('APBCT_REST_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin REST API error: ' + errorThrown + ' Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t});\n\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tif (typeof response.apbct !== 'undefined') {\n\t\t\t\tresponse = response.apbct;\n\t\t\t\tif (response.blocked) {\n\t\t\t\t\tdocument.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\t\t\tcleantalkModal.open();\n\n\t\t\t\t\tif(+response.stop_script == 1)\n\t\t\t\t\t\twindow.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}"],"names":["ctSetCookie","cookies","value","expires","skip_alt","ctPublic","data__set_cookies","forEach","item","i","arr","document","cookie","encodeURIComponent","data__set_cookies__alt_sessions_type","apbct_public_sendREST","method","data","apbct_public_sendAJAX","action","apbct_collect_visible_fields","form","key","inputs","inputs_visible","inputs_visible_count","inputs_with_duplicate_names","elements","isNaN","filter","elem","getComputedStyle","display","visibility","opacity","getAttribute","indexOf","push","visible_fields","trim","visible_fields_count","apbct_visible_fields_set_cookie","visible_fields_collection","collection","JSON","stringify","apbct_js_keys__set_input_value","result","params","obj","querySelectorAll","length","js_key","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","silent","no_nonce","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","removeAttribute","parse","error","setTimeout","fadeOut","console","log","apply","concat","jqXHR","textStatus","errorThrown","route","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","alert","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","apbct_attach_event_handler","event","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","floor","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","round","clientY","clientX","clearInterval","forms","classList","contains","parentElement","toString","id","name","onsubmit_prev","onsubmit","this","target","Function","call","ajaxComplete","settings","responseText","response","apbct","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","comment","cleantalkModal","loaded","open","stop_script","stop"],"mappings":"AA+HA,SAASA,YAAaC,EAASC,EAAOC,GAErC,IACKC,GADkB,iBAAZH,GAAyC,iBAAVC,GAAuC,iBAAVA,KAClEE,EAAuB,oBAAZH,GAA6C,iBAAZA,EAChDA,EAAU,CAAE,CAAEA,EAASC,EAAOC,KAIK,IAA/BE,SAASC,oBAI4B,IAA/BD,SAASC,kBACnBL,EAAQM,QAAS,SAAUC,EAAMC,EAAGC,GACnC,IAAIP,OAA6B,IAAZK,EAAK,GAAqB,WAAaL,EAAU,KAAO,GAC7EQ,SAASC,OAASJ,EAAK,GAAK,IAAMK,mBAAmBL,EAAK,IAAM,KAAOL,EAAU,yBAIzC,IAA/BE,SAASC,mBAA6BF,IAGO,IAAlDC,SAASS,qCACbC,sBACC,eACA,CACCC,OAAQ,OACRC,KAAM,CAAEhB,QAASA,KAKyC,IAAlDI,SAASS,sCACnBI,sBACC,CACCC,OAAQ,gCACRlB,QAASA,GAEV,MAMJ,SAASmB,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U6H,aAAa,SAAU/B,EAAOZ,EAAK4C,IAC/C5C,EAAI6C,eAAwD,IAAxC7C,EAAI6C,aAAatG,QAAQ,gBAElB,KAD1BuG,EAAW/F,KAAKmC,MAAMc,EAAI6C,eACVE,QACnBD,EAAWA,EAASC,OACPC,UACZlI,SAASmI,cACR,IAAIC,YAAa,qBAAsB,CACtCC,SAAS,EACTC,OAAQ,CAAEC,QAASP,EAASQ,YAK9BC,eAAeC,OAASV,EAASQ,QACjCC,eAAeE,OAEa,IAAxBX,EAASY,aACZ7C,OAAO8C"}
|
1 |
+
{"version":3,"file":"apbct-public.min.js","sources":["apbct-public.js"],"sourcesContent":["(function() {\n\n\tvar ct_date = new Date(),\n\t\tctTimeMs = new Date().getTime(),\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\n\t\tctMouseData = [],\n\t\tctMouseDataCounter = 0;\n\n\tfunction apbct_attach_event_handler(elem, event, callback){\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\t\telse elem.attachEvent(event, callback);\n\t}\n\n\tfunction apbct_remove_event_handler(elem, event, callback){\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\t\telse elem.detachEvent(event, callback);\n\t}\n\n\tctSetCookie(\n\t\t[\n\t\t\t[ \"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000) ],\n\t\t\t[ \"ct_fkp_timestamp\", \"0\" ],\n\t\t\t[ \"ct_pointer_data\", \"0\" ],\n\t\t\t[ \"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t\t[ \"apbct_visible_fields\", \"0\" ],\n\t\t]\n\t);\n\n\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\t\tctKeyStopStopListening();\n\t};\n\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n\n\t//Logging mouse position each 150 ms\n\tvar ctFunctionMouseMove = function output(event){\n\t\tif(ctMouseEventTimerFlag === true){\n\n\t\t\tctMouseData.push([\n\t\t\t\tMath.round(event.clientY),\n\t\t\t\tMath.round(event.clientX),\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t\t]);\n\n\t\t\tctMouseDataCounter++;\n\t\t\tctMouseEventTimerFlag = false;\n\t\t\tif(ctMouseDataCounter >= 50){\n\t\t\t\tctMouseStopData();\n\t\t\t}\n\t\t}\n\t};\n\n\t//Stop mouse observing function\n\tfunction ctMouseStopData(){\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\t\tclearInterval(ctMouseReadInterval);\n\t\tclearInterval(ctMouseWriteDataInterval);\n\t}\n\n\t//Stop key listening function\n\tfunction ctKeyStopStopListening(){\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\t}\n\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\n\t\tif( +ctPublic.pixel__setting ){\n\t\t\tctSetCookie( 'apbct_pixel_url', ctPublic.pixel__url );\n\t\t\tif( +ctPublic.pixel__enabled ){\n\t\t\t\tjQuery('body').append( '<img style=\"display: none; left: 99999px;\" src=\"' + ctPublic.pixel__url + '\">' );\n\t\t\t}\n\t\t}\n\n\t\tsetTimeout(function(){\n\n\t\t\tvar visible_fields_collection = {};\n\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\t\tvar form = document.forms[i];\n\n\t\t\t\t//Exclusion for forms\n\t\t\t\tif (\n\t\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t\t(form.id && form.id == 'caspioform') || //Caspio Form\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('give-form ')) // GiveWP\n\t\t\t\t)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvisible_fields_collection[i] = apbct_collect_visible_fields( form );\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\t\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields );\n\n\t\t\t\t\t// Call previous submit action\n\t\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tapbct_visible_fields_set_cookie( visible_fields_collection );\n\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction ctSetCookie( cookies, value, expires ){\n\n\tif( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n\t\tvar skip_alt = cookies === 'ct_pointer_data' || cookies === 'ct_user_info';\n\t\tcookies = [ [ cookies, value, expires ] ];\n\t}\n\n\t// Cookies disabled\n\tif( +ctPublic.data__set_cookies === 0 ){\n\t\treturn;\n\n\t// Using traditional cookies\n\t}else if( +ctPublic.data__set_cookies === 1 ){\n\t\tcookies.forEach( function (item, i, arr\t) {\n\t\t\tvar expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\tdocument.cookie = item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n\t\t});\n\n\t// Using alternative cookies\n\t}else if( +ctPublic.data__set_cookies === 2 && ! skip_alt ){\n\n\t\t// Using REST API handler\n\t\tif( +ctPublic.data__set_cookies__alt_sessions_type === 1 ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'alt_sessions',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: { cookies: cookies }\n\t\t\t\t}\n\t\t\t);\n\n\t\t// Using AJAX request and handler\n\t\t}else if( +ctPublic.data__set_cookies__alt_sessions_type === 2 ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_alt_session__save__AJAX',\n\t\t\t\t\tcookies: cookies,\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\tvar silent = params.silent || null;\n\tvar no_nonce = params.no_nonce || null;\n\n\tif(typeof (data) === 'string') {\n\t\tif( ! no_nonce )\n\t\t\tdata = data + '&_ajax_nonce=' + ctPublic._ajax_nonce;\n\t\tdata = data + '&no_cache=' + Math.random()\n\t} else {\n\t\tif( ! no_nonce )\n\t\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctPublic._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\tconsole.log('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif( errorThrown && ! silent ) {\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n\tvar callback = params.callback || null;\n\tvar data = params.data || [];\n\tvar method = params.method || 'POST';\n\n\tjQuery.ajax({\n\t\ttype: method,\n\t\turl: ctPublic._rest_url + 'cleantalk-antispam/v1/' + route,\n\t\tdata: data,\n\t\tbeforeSend : function ( xhr ) {\n\t\t\txhr.setRequestHeader( 'X-WP-Nonce', ctPublic._rest_nonce );\n\t\t},\n\t\tsuccess: function(result){\n\t\t\tif(result.error){\n\t\t\t\tconsole.log('Error happens: ' + (result.error || 'Unknown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tvar obj = null;\n\t\t\t\t\tcallback(result, route, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif( errorThrown ) {\n\t\t\t\tconsole.log('APBCT_REST_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin REST API error: ' + errorThrown + ' Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t});\n\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tif (typeof response.apbct !== 'undefined') {\n\t\t\t\tresponse = response.apbct;\n\t\t\t\tif (response.blocked) {\n\t\t\t\t\tdocument.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\t\t\tcleantalkModal.open();\n\n\t\t\t\t\tif(+response.stop_script == 1)\n\t\t\t\t\t\twindow.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}"],"names":["ctSetCookie","cookies","value","expires","skip_alt","ctPublic","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_collect_visible_fields","form","key","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","elements","isNaN","filter","elem","indexOf","getAttribute","push","getComputedStyle","display","visibility","opacity","classList","contains","trim","visible_fields","visible_fields_count","invisible_fields","invisible_fields_count","apbct_visible_fields_set_cookie","visible_fields_collection","collection","JSON","stringify","apbct_js_keys__set_input_value","result","params","obj","querySelectorAll","length","js_key","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","silent","no_nonce","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","removeAttribute","parse","error","setTimeout","fadeOut","console","log","apply","concat","jqXHR","textStatus","errorThrown","route","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","apbct_attach_event_handler","event","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","floor","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","round","clientY","clientX","clearInterval","pixel__setting","pixel__url","pixel__enabled","append","forms","parentElement","toString","id","name","onsubmit_prev","onsubmit","this","target","Function","call","ajaxComplete","settings","responseText","response","apbct","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","comment","cleantalkModal","loaded","open","stop_script","stop"],"mappings":"AAsIA,SAASA,YAAaC,EAASC,EAAOC,GAErC,IACKC,GADkB,iBAAZH,GAAyC,iBAAVC,GAAuC,iBAAVA,KAClEE,EAAuB,oBAAZH,GAA6C,iBAAZA,EAChDA,EAAU,CAAE,CAAEA,EAASC,EAAOC,KAIK,IAA/BE,SAASC,oBAI4B,IAA/BD,SAASC,kBACnBL,EAAQM,QAAS,SAAUC,EAAMC,EAAGC,GACnC,IAAIP,OAA6B,IAAZK,EAAK,GAAqB,WAAaL,EAAU,KAAO,GACzEQ,EAAiC,WAAtBC,SAASC,SAAwB,WAAa,GAC7DC,SAASC,OAASP,EAAK,GAAK,IAAMQ,mBAAmBR,EAAK,IAAM,KAAOL,EAAU,uBAAyBQ,IAIlE,IAA/BN,SAASC,mBAA6BF,IAGO,IAAlDC,SAASY,qCACbC,sBACC,eACA,CACCC,OAAQ,OACRC,KAAM,CAAEnB,QAASA,KAKyC,IAAlDI,SAASY,sCACnBI,sBACC,CACCC,OAAQ,gCACRrB,QAASA,GAEV,MAMJ,SAASsB,6BAA8BC,GAGtC,IAOQC,EAPJC,EAAS,GACZC,EAAiB,GACjBC,EAAuB,EACvBC,EAAmB,GACnBC,EAAyB,EACzBC,EAA8B,GAE/B,IAAQN,KAAOD,EAAKQ,SACfC,OAAOR,KACVC,EAAOD,GAAOD,EAAKQ,SAASP,IAsD9B,OAlDAC,EAASA,EAAOQ,OAAO,SAASC,GAG/B,OAA0E,IAAtEJ,EAA4BK,QAASD,EAAKE,aAAa,YAItD,IAAM,CAAC,QAAS,Y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B,oBAAX6B,QAGTA,OAAOlE,UAAUoI,aAAa,SAAUjC,EAAOX,EAAK6C,IAC/C7C,EAAI8C,eAAwD,IAAxC9C,EAAI8C,aAAahH,QAAQ,gBAElB,KAD1BiH,EAAWhG,KAAKmC,MAAMc,EAAI8C,eACVE,QACnBD,EAAWA,EAASC,OACPC,UACZzI,SAAS0I,cACR,IAAIC,YAAa,qBAAsB,CACtCC,SAAS,EACTC,OAAQ,CAAEC,QAASP,EAASQ,YAK9BC,eAAeC,OAASV,EAASQ,QACjCC,eAAeE,OAEa,IAAxBX,EAASY,aACZ/C,OAAOgD"}
|
@@ -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("#apbct_renew_notice").length&&jQuery("#apbct_renew_notice").hide("slow"),jQuery("#apbct_trial_notice").length&&jQuery("#apbct_trial_notice").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){console.log(t.getAttribute("id"));var a;
|
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("#apbct_renew_notice").length&&jQuery("#apbct_renew_notice").hide("slow"),jQuery("#apbct_trial_notice").length&&jQuery("#apbct_trial_notice").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){console.log(t.getAttribute("id"));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='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_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 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("#apbct_renew_notice").length||jQuery("#apbct_trial_notice").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 +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('#apbct_renew_notice').length || jQuery('#apbct_trial_notice').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('#apbct_renew_notice').length)\n\t\t\t\t\t\t\tjQuery('#apbct_renew_notice').hide('slow');\n\t\t\t\t\t\tif (jQuery('#apbct_trial_notice').length)\n\t\t\t\t\t\t\tjQuery('#apbct_trial_notice').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 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\tconsole.log( elem.getAttribute('id') );\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_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","console","log","getAttribute","state","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","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,uBAAuBC,QACjCD,OAAO,uBAAuBE,KAAK,QAChCF,OAAO,uBAAuBC,QACjCD,OAAO,uBAAuBE,KAAK,QACpCC,cAAcb,QAKhB,KAUJ,SAASc,gBAAgBC,GAErB,IAAK,IAA6BC,EAAzBC,EAAE,EAAGC,GADdH,EAAQA,EAAMI,MAAM,MACMR,OAAaM,EAAIC,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,SAAS6D,KAAK,yCAAyC/E,OAE7E1B,OAAOiE,MAAMrB,SAASA,SAAS6D,KAAK,yCAAyCvG"}
|
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('#apbct_renew_notice').length || jQuery('#apbct_trial_notice').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('#apbct_renew_notice').length)\n\t\t\t\t\t\t\tjQuery('#apbct_renew_notice').hide('slow');\n\t\t\t\t\t\tif (jQuery('#apbct_trial_notice').length)\n\t\t\t\t\t\t\tjQuery('#apbct_trial_notice').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 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\tconsole.log( elem.getAttribute('id') );\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_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","console","log","getAttribute","state","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","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find"],"mappings":"AA0NA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAAC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AAeC,aAClBtG,OAAO,uBAAuBuG,QAE/BvG,OAAOe,UAAU4C,GAAG,QAAS,0CAA2C,WACvE6C,KAAOxG,OAAOiE,MACd1B,gCAAgCiE,KAAMA,KAAKxC,KAAK,eAG7ChE,OAAO,uBAAuBC,QAAUD,OAAO,uBAAuBC,SACzEZ,qBAEDW,OAAOe,UAAU4C,GAAG,SAAU,mCAAmC,WAE7B,iBADd3D,OAAO,kBAAmBiE,MAC3BrE,KAAK,MACxBI,OAAOiE,MAAMrB,SAASA,SAAS6D,KAAK,yCAAyC/E,OAE7E1B,OAAOiE,MAAMrB,SAASA,SAAS6D,KAAK,yCAAyCvG"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
function apbct_admin_sendAJAX(n,o,t){var a=o.callback||null,l=o.callback_context||null,c=o.callback_params||null,e=o.async||!0,r=o.notJson||null,s=o.timeout||15e3,t=t||null,u=o.button||null,i=o.spinner||null,p=o.progressbar||null;"string"==typeof n?n=n+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(n._ajax_nonce=ctAdminCommon._ajax_nonce,n.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:ctAdminCommon._ajax_url,data:n,async:e,success:function(e){u&&(u.removeAttribute("disabled"),u.style.cursor="pointer"),i&&jQuery(i).css("display","none"),(e
|
2 |
//# sourceMappingURL=cleantalk-admin.min.js.map
|
1 |
+
function apbct_admin_sendAJAX(n,o,t){var a=o.callback||null,l=o.callback_context||null,c=o.callback_params||null,e=o.async||!0,r=o.notJson||null,s=o.timeout||15e3,t=t||null,u=o.button||null,i=o.spinner||null,p=o.progressbar||null;"string"==typeof n?n=n+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(n._ajax_nonce=ctAdminCommon._ajax_nonce,n.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:ctAdminCommon._ajax_url,data:n,async:e,success:function(e){u&&(u.removeAttribute("disabled"),u.style.cursor="pointer"),i&&jQuery(i).css("display","none"),r||(e=JSON.parse(e)),e.error?(setTimeout(function(){p&&p.fadeOut("slow")},1e3),alert("Error happens: "+(e.error||"Unkown"))):a&&(c?a.apply(l,c.concat(e,n,o,t)):a(e,n,o,t))},error:function(e,n,o){u&&(u.removeAttribute("disabled"),u.style.cursor="pointer"),i&&jQuery(i).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(n),console.log(o)},timeout:s})}jQuery(document).ready(function(){jQuery(".apbct_update_notice").on("click","button",function(){var e=new Date((new Date).getTime()+2592e6),n="https:"===location.protocol?"; secure":"";document.cookie="apbct_update_banner_closed=1; path=/; expires="+e.toUTCString()+"; samesite=lax"+n}),jQuery('li a[href="options-general.php?page=cleantalk"]').css("white-space","nowrap")});
|
2 |
//# sourceMappingURL=cleantalk-admin.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Auto update banner close handler\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString() + \"; samesite=lax\" + ctSecure;\n\t});\n\t\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap');\n\t\n});\nfunction apbct_admin_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\n\tif(typeof (data) === 'string') {\n\t\tdata = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n\t} else {\n\t\tdata._ajax_nonce = ctAdminCommon._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctAdminCommon._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}"],"names":["apbct_admin_sendAJAX","data","params","obj","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","ctAdminCommon","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","document","ready","on","ct_date","Date","getTime","ctSecure","location","protocol","cookie","toUTCString"],"mappings":"AAYA,SAASA,qBAAqBC,EAAMC,EAAQC,GAG3C,IAAIC,EAAcF,EAAOE,UAAe,KACpCC,EAAmBH,EAAOG,kBAAoB,KAC9CC,EAAkBJ,EAAOI,iBAAmB,KAC5CC,EAAQL,EAAOK,QAAS,EACxBC,EAAcN,EAAOM,SAAe,KACpCC,EAAcP,EAAOO,SAAe,KACpCN,EAAcA,GAAsB,KACpCO,EAAcR,EAAOQ,QAAe,KACpCC,EAAcT,EAAOS,SAAe,KACpCC,EAAcV,EAAOU,aAAe,KAEnB,iBAAX,EACTX,EAAOA,EAAO,gBAAkBY,cAAcC,YAAc,aAAeC,KAAKC,UAEhFf,EAAKa,YAAcD,cAAcC,YACjCb,EAAKgB,SAAWF,KAAKC,UAGnBN,IAAUA,EAAOQ,aAAa,WAAY,YAAaR,EAAOS,MAAMC,OAAS,eAC7ET,GAASU,OAAOV,GAASW,IAAI,UAAW,UAE3CD,OAAOE,KAAK,CACXC,KAAM,OACNC,IAAKZ,cAAca,UACnBzB,KAAMA,EACNM,MAAOA,EACPoB,QAAS,SAASC,GACdlB,IAAUA,EAAOmB,gBAAgB,YAAanB,EAAOS,MAAMC,OAAS,WACpET,GAAUU,OAAOV,GAASW,IAAI,UAAW,
|
1 |
+
{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Auto update banner close handler\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString() + \"; samesite=lax\" + ctSecure;\n\t});\n\t\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap');\n\t\n});\nfunction apbct_admin_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\n\tif(typeof (data) === 'string') {\n\t\tdata = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n\t} else {\n\t\tdata._ajax_nonce = ctAdminCommon._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctAdminCommon._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}"],"names":["apbct_admin_sendAJAX","data","params","obj","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","ctAdminCommon","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","document","ready","on","ct_date","Date","getTime","ctSecure","location","protocol","cookie","toUTCString"],"mappings":"AAYA,SAASA,qBAAqBC,EAAMC,EAAQC,GAG3C,IAAIC,EAAcF,EAAOE,UAAe,KACpCC,EAAmBH,EAAOG,kBAAoB,KAC9CC,EAAkBJ,EAAOI,iBAAmB,KAC5CC,EAAQL,EAAOK,QAAS,EACxBC,EAAcN,EAAOM,SAAe,KACpCC,EAAcP,EAAOO,SAAe,KACpCN,EAAcA,GAAsB,KACpCO,EAAcR,EAAOQ,QAAe,KACpCC,EAAcT,EAAOS,SAAe,KACpCC,EAAcV,EAAOU,aAAe,KAEnB,iBAAX,EACTX,EAAOA,EAAO,gBAAkBY,cAAcC,YAAc,aAAeC,KAAKC,UAEhFf,EAAKa,YAAcD,cAAcC,YACjCb,EAAKgB,SAAWF,KAAKC,UAGnBN,IAAUA,EAAOQ,aAAa,WAAY,YAAaR,EAAOS,MAAMC,OAAS,eAC7ET,GAASU,OAAOV,GAASW,IAAI,UAAW,UAE3CD,OAAOE,KAAK,CACXC,KAAM,OACNC,IAAKZ,cAAca,UACnBzB,KAAMA,EACNM,MAAOA,EACPoB,QAAS,SAASC,GACdlB,IAAUA,EAAOmB,gBAAgB,YAAanB,EAAOS,MAAMC,OAAS,WACpET,GAAUU,OAAOV,GAASW,IAAI,UAAW,QACxCd,IAASoB,EAASE,KAAKC,MAAMH,IAC9BA,EAAOI,OACTC,WAAW,WAAerB,GAAaA,EAAYsB,QAAQ,SAAY,KACvEC,MAAM,mBAAqBP,EAAOI,OAAS,YAExC5B,IACEE,EACHF,EAASgC,MAAO/B,EAAkBC,EAAgB+B,OAAQT,EAAQ3B,EAAMC,EAAQC,IAEhFC,EAASwB,EAAQ3B,EAAMC,EAAQC,KAInC6B,MAAO,SAASM,EAAOC,EAAYC,GAC/B9B,IAAUA,EAAOmB,gBAAgB,YAAanB,EAAOS,MAAMC,OAAS,WACpET,GAASU,OAAOV,GAASW,IAAI,UAAW,QAC3CmB,QAAQC,IAAI,oBACZD,QAAQC,IAAIJ,GACZG,QAAQC,IAAIH,GACZE,QAAQC,IAAIF,IAEb/B,QAASA,IAjEXY,OAAOsB,UAAUC,MAAM,WAGtBvB,OAAO,wBAAwBwB,GAAG,QAAS,SAAU,WACpD,IAAIC,EAAU,IAAIC,MAAK,IAAIA,MAAOC,UAAY,QAC1CC,EAAiC,WAAtBC,SAASC,SAAwB,WAAa,GAC7DR,SAASS,OAAS,iDAAmDN,EAAQO,cAAgB,iBAAmBJ,IAGjH5B,OAAO,mDAAmDC,IAAI,cAAc"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
var ct_working=!(String.prototype.printf=function(){var e
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
1 |
+
var ct_working=!(String.prototype.printf=function(){var e=this;for(var t in arguments)var c=e.substring(0,e.indexOf("%s",0)),a=e.substring(e.indexOf("%s",0)+2,e.length),e=c+arguments[t]+a;return e}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e=0,t=0;jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val());var c={action:"ajax_clear_comments",security:ct_ajax_nonce,from:e,till:t};jQuery.ajax({type:"POST",url:ajaxurl,data:c,success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){if(!0!==ct_cooling_down_flag){if(ct_max_requests<=ct_requests_counter)return setTimeout(ct_cooling_down_toggle,ct_cool_down_time),void(ct_cooling_down_flag=!(ct_requests_counter=0));ct_requests_counter++;var e={action:"ajax_check_comments",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked};ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t,c;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_comments():(t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||!0===ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_comments_checked+=e.checked,ct_comments_spam+=e.spam,ct_comments_bad+=e.bad,ct_unchecked=ct_comments_total-ct_comments_checked-ct_comments_bad,c=(c=String(ctCommentsCheck.ct_status_string)).printf(ct_comments_checked,ct_comments_spam,ct_comments_bad),0<parseInt(ct_comments_spam)&&(c+=ctCommentsCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(c),jQuery("#ct_error_message").hide(),+ct_comments_total<ct_comments_checked+ct_comments_bad&&(document.cookie="ct_comments_start_check=1; path=/; samesite=lax",document.cookie="ct_comments_safe_check=1; path=/; samesite=lax",location.href="edit-comments.php?page=ct_check_spam"),ct_send_comments()))},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_send_comments(),3e3)},timeout:25e3})}}function ct_show_info(){if(ct_working){if(1==ct_cooling_down_flag)return jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),void jQuery("#ct_cooling_notice").show();var e;jQuery("#ct_cooling_notice").hide(),ct_comments_total||(e={action:"ajax_info_comments",security:ct_ajax_nonce},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_comments_total=e.total,ct_comments_spam=e.spam,ct_comments_checked=e.checked,ct_comments_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_show_info(),3e3)},timeout:15e3}))}}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_trash_all(a){var e={action:"ajax_trash_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_trash_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_trash_all(a),3e3)},timeout:25e3})}function ct_spam_all(a){var e={action:"ajax_spam_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_spam_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_spam_all(a),3e3)},timeout:25e3})}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_spam_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_spam_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var _=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),a=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);_.not(this).datepicker("option",t,a),document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""==ct_date_from||""==ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,e?(ct_show_info(),ct_send_comments()):ct_clear_comments())}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_spam_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),"1"===ctCommentsCheck.start&&(document.cookie="ct_comments_start_check=0; expires="+new Date(0).toUTCString()+"; path=/; samesite=lax",jQuery("#ct_check_spam_button").click()),jQuery(".ct_trash_all").click(function(e){return!!confirm(ctCommentsCheck.ct_confirm_trash_all)&&void ct_trash_all(e)}),jQuery(".ct_spam_all").click(function(e){return!!confirm(ctCommentsCheck.ct_confirm_spam_all)&&void ct_spam_all(e)})});
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_safe_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});"],"names":["ct_working","String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","is","val","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","new_href","parseJSON","parseInt","error","confirm","error_message","location","href","end","document","cookie","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,IAClEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,GAAG,EAAGL,EAAUO,QACnFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,IAKVQ,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,gBAAgBD,iBACnCE,aAAeD,gBAAgBC,aAC/BC,aAAeF,gBAAgBE,aAE5BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,gBAAgBM,cACnCC,kBAAoB,EACpBC,oBAAsB,EACtBC,iBAAmB,EACnBC,gBAAkB,EAClBC,aAAe,QACfC,aAAe,EACfC,aAAe,EAEhB,SAASC,gBAAgBC,EAAGC,GACxBpB,iBACK,IAAJmB,EACFE,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,EAAEE,KAGnBC,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,GAAIE,KAItBpB,kBAAiB,EAInB,SAASuB,oBAER,IAAIC,EAAO,EAAGC,EAAO,EAClBJ,OAAO,wBAAwBK,GAAG,cACpCF,EAAOH,OAAO,uBAAuBM,MACrCF,EAAOJ,OAAO,uBAAuBM,OAElCC,EAAO,CACVC,OAAa,sBACbC,SAAapB,cACbc,KAAaA,EACbC,KAAaA,GAGdJ,OAAOU,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLN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ExB,IAAhBX,cAAsC,IAAhBC,cAC1BwF,MAAM,kCAKLpF,OAAO,sBAAsBK,GAAG,cAClCzB,mBAAoB,GAGrBoB,OAAO,eAAeiC,OACtBjC,OAAO,uBAAuB4C,OAC9B5C,OAAO,iBAAiB4C,OACxB5C,OAAO,aAAa4C,OAEpBhF,YAAW,EAERuH,GACFnE,eACAC,oBAEAf,qBAKFF,OAAO,yBAAyBqF,MAAM,WAErCH,IADAnD,SAASC,OAAS,mDAGnBhC,OAAO,4BAA4BqF,MAAM,WACxCH,GAAe,KAIhBlF,OAAO,aAAa8D,GAAG,QAAS,WAC/BjF,UAAW,EACX,IAAIyG,EAAW,CACdC,SAAY3G,kBACZuB,KAAYR,aACZS,KAAYR,cAEbmC,SAASC,OAAS,wBAA0BwD,KAAKC,UAAUH,GAAY,2BAI3C,MAA1BvG,gBAAgB2G,QAClB3D,SAASC,OAAS,sCAAwC,IAAI2D,KAAK,GAAGC,cAAgB,yBACtF5F,OAAO,yBAAyBqF,SAIjCrF,OAAO,iBAAiBqF,MAAM,SAAU9B,GAEvC,QAAK7B,QAAQ3C,gBAAgB8G,4BAG7BvC,aAAcC,KAKfvD,OAAO,gBAAgBqF,MAAM,SAAU9B,GAEtC,QAAK7B,QAAQ3C,gBAAgB+G,2BAG7BlC,YAAaL"}
|
1 |
+
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_safe_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});"],"names":["ct_working","String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","is","val","data","action","security","ajax","type","url","ajaxurl","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","new_href","status_string","parseJSON","parseInt","error","confirm","error_message","location","href","end","document","cookie","hide","checked","spam","bad","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","total","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAClB,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,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,EAAW,CACdC,SAAY3G,kBACZuB,KAAYR,aACZS,KAAYR,cAEboC,SAASC,OAAS,wBAA0BuD,KAAKC,UAAUH,GAAY,2BAI3C,MAA1BvG,gBAAgB2G,QAClB1D,SAASC,OAAS,sCAAwC,IAAI0D,KAAK,GAAGC,cAAgB,yBACtF5F,OAAO,yBAAyBqF,SAIjCrF,OAAO,iBAAiBqF,MAAM,SAAU9B,GAEvC,QAAK5B,QAAQ5C,gBAAgB8G,4BAG7BvC,aAAcC,KAKfvD,OAAO,gBAAgBqF,MAAM,SAAU9B,GAEtC,QAAK5B,QAAQ5C,gBAAgB+G,2BAG7BlC,YAAaL"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
jQuery(document).ready(function(){jQuery(".ct_widget_refresh_link").on("click",function(){jQuery(".ct_preloader").show(),setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),setTimeout(function(){jQuery("#ct_refresh_form").submit()},2500)}),"#ct_widget"==location.hash&&setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),jQuery("#ct_widget_wrapper").parent().css("padding",0);var a=document.getElementById("ct_widget_chart"),o=navigator.language||navigator.userLanguage;google.charts.load("current",{packages:["corechart","bar"]}),google.charts.setOnLoadCallback(function(){var t=new google.visualization.DataTable;t.addColumn("string","Spam Blocked"),t.addColumn("number","Frequency"),function(t){var e=new Intl.DateTimeFormat(o,{month:"short",day:"numeric"});t.sort(function(t,e){return new Date(t[0])-new Date(e[0])}),t.forEach(function(t){t[0]=Date.parse(t[0]),t[0]=e.format(t[0])})}(apbctDashboardWidget.data),t.addRows(apbctDashboardWidget.data);var e={width:jQuery(".ct_widget_block").first().width(),height:300,colors:["steelblue"],legend:"none",bar:{groupWidth:"95%"},chartArea:{left:30,top:20,width:"93%",height:"80%"},vAxis:{gridlines:{count:5}}};a&&new google.visualization.ColumnChart(a).draw(t,e)})});
|
2 |
//# sourceMappingURL=cleantalk-dashboard-widget.min.js.map
|
1 |
+
jQuery(document).ready(function(){jQuery(".ct_widget_refresh_link").on("click",function(){jQuery(".ct_preloader").show(),setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),setTimeout(function(){jQuery("#ct_refresh_form").submit()},2500)}),"#ct_widget"==location.hash&&setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),jQuery("#ct_widget_wrapper").parent().css("padding",0);var a=document.getElementById("ct_widget_chart"),o=navigator.language||navigator.userLanguage;google.charts.load("current",{packages:["corechart","bar"]}),google.charts.setOnLoadCallback(function(){var t=new google.visualization.DataTable;t.addColumn("string","Spam Blocked"),t.addColumn("number","Frequency"),function(t){var e=new Intl.DateTimeFormat(o,{month:"short",day:"numeric"});t.sort(function(t,e){return new Date(t[0])-new Date(e[0])}),t.forEach(function(t){t[0]=Date.parse(t[0]),t[0]=e.format(t[0])})}(apbctDashboardWidget.data),t.addRows(apbctDashboardWidget.data);var e={width:jQuery(".ct_widget_block").first().width(),height:300,colors:["steelblue"],legend:"none",bar:{groupWidth:"95%"},chartArea:{left:30,top:20,width:"93%",height:"80%"},vAxis:{gridlines:{count:5}}};{a&&new google.visualization.ColumnChart(a).draw(t,e)}})});
|
2 |
//# sourceMappingURL=cleantalk-dashboard-widget.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-dashboard-widget.min.js","sources":["cleantalk-dashboard-widget.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set \"refresh\" link handler\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.ct_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\n\t});\n\t\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\n\t\n\t// Fixing default wrapper style\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\n\t\n\t// Chart \n\tvar ct_chart = document.getElementById('ct_widget_chart'),\n\t\tlocale = navigator.language || navigator.userLanguage;\n\t\t\n\tfunction ctParseData(date){\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\t\tmonth: \"short\",\n\t\t\tday: \"numeric\"\n\t\t});\t\n\t\tdate.sort(function(a,b){\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \n\t\t});\t\t\t\n\t\tdate.forEach(function(d){\t\n\t\t\td[0] = Date.parse(d[0]);\n\t\t\td[0] = date_formatter.format(d[0]);\n\t\t});\t\t\n\t}\n\t\t\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\n\tgoogle.charts.setOnLoadCallback(drawStuff);\n\n\tfunction drawStuff() {\n\t\tvar data = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Spam Blocked');\n\t\tdata.addColumn('number', 'Frequency');\n\t\t\n\t\tctParseData(apbctDashboardWidget.data);\n\t\tdata.addRows(apbctDashboardWidget.data);\n\t\n\t\tvar options = {\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\n\t\t\theight: 300,\n\t\t\tcolors: ['steelblue'],\n\t\t\tlegend: 'none',\n\t\t\tbar: {groupWidth: '95%'},\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\n\t\t\tvAxis: { gridlines: { count: 5 } }\n\t\t};\n\n\t\tif(ct_chart){\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\n\t\t\tchart.draw(data, options);\n\t\t}\n\t};\t\n});"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","ctParseData","apbctDashboardWidget","addRows","options","width","first","height","colors","legend","bar","groupWidth","chartArea","left","vAxis","gridlines","count","ColumnChart","draw"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGtBF,OAAO,2BAA2BG,GAAG,QAAS,WAC7CH,OAAO,iBAAiBI,OACxBC,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsBQ,SAASC,IAAM,MAAQ,GAC7FJ,WAAW,WAAWL,OAAO,oBAAoBU,UAAY,QAG1C,cAAjBC,SAASC,MACXP,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsBQ,SAASC,IAAM,MAAQ,GAG9FT,OAAO,sBAAsBa,SAASC,IAAI,UAAW,GAGrD,IAAIC,EAAWd,SAASe,eAAe,mBACtCC,EAASC,UAAUC,UAAYD,UAAUE,aAgB1CC,OAAOC,OAAOC,KAAK,UAAW,CAACC,SAAS,CAAC,YAAa,SACtDH,OAAOC,OAAOG,kBAEd,WACC,IAAIC,EAAO,IAAIL,OAAOM,cAAcC,UACpCF,EAAKG,UAAU,SAAU,gBACzBH,EAAKG,UAAU,SAAU,aApB1B,SAAqBC,GACpB,IAAIC,EAAiB,IAAIC,KAAKC,eAAehB,EAAQ,CACpDiB,MAAO,QACPC,IAAK,YAENL,EAAKM,KAAK,SAASC,EAAEC,GACpB,OAAO,IAAIC,KAAKF,EAAE,IAAM,IAAIE,KAAKD,EAAE,MAEpCR,EAAKU,QAAQ,SAASC,GACrBA,EAAE,GAAKF,KAAKG,MAAMD,EAAE,IACpBA,EAAE,GAAKV,EAAeY,OAAOF,EAAE,MAYhCG,CAAYC,qBAAqBnB,MACjCA,EAAKoB,QAAQD,qBAAqBnB,MAElC,IAAIqB,EAAU,CACbC,MAAOhD,OAAO,oBAAoBiD,QAAQD,QAC1CE,OAAQ,IACRC,OAAQ,CAAC,aACTC,OAAQ,OACRC,IAAK,CAACC,WAAY,OAClBC,UAAU,CAACC,KAAK,GAAG/C,IAAI,GAAGuC,MAAM,MAAME,OAAO,OAC7CO,MAAO,CAAEC,UAAW,CAAEC,MAAO,
|
1 |
+
{"version":3,"file":"cleantalk-dashboard-widget.min.js","sources":["cleantalk-dashboard-widget.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set \"refresh\" link handler\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.ct_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\n\t});\n\t\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\n\t\n\t// Fixing default wrapper style\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\n\t\n\t// Chart \n\tvar ct_chart = document.getElementById('ct_widget_chart'),\n\t\tlocale = navigator.language || navigator.userLanguage;\n\t\t\n\tfunction ctParseData(date){\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\t\tmonth: \"short\",\n\t\t\tday: \"numeric\"\n\t\t});\t\n\t\tdate.sort(function(a,b){\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \n\t\t});\t\t\t\n\t\tdate.forEach(function(d){\t\n\t\t\td[0] = Date.parse(d[0]);\n\t\t\td[0] = date_formatter.format(d[0]);\n\t\t});\t\t\n\t}\n\t\t\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\n\tgoogle.charts.setOnLoadCallback(drawStuff);\n\n\tfunction drawStuff() {\n\t\tvar data = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Spam Blocked');\n\t\tdata.addColumn('number', 'Frequency');\n\t\t\n\t\tctParseData(apbctDashboardWidget.data);\n\t\tdata.addRows(apbctDashboardWidget.data);\n\t\n\t\tvar options = {\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\n\t\t\theight: 300,\n\t\t\tcolors: ['steelblue'],\n\t\t\tlegend: 'none',\n\t\t\tbar: {groupWidth: '95%'},\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\n\t\t\tvAxis: { gridlines: { count: 5 } }\n\t\t};\n\n\t\tif(ct_chart){\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\n\t\t\tchart.draw(data, options);\n\t\t}\n\t};\t\n});"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","ctParseData","apbctDashboardWidget","addRows","options","width","first","height","colors","legend","bar","groupWidth","chartArea","left","vAxis","gridlines","count","ColumnChart","draw"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGtBF,OAAO,2BAA2BG,GAAG,QAAS,WAC7CH,OAAO,iBAAiBI,OACxBC,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsBQ,SAASC,IAAM,MAAQ,GAC7FJ,WAAW,WAAWL,OAAO,oBAAoBU,UAAY,QAG1C,cAAjBC,SAASC,MACXP,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsBQ,SAASC,IAAM,MAAQ,GAG9FT,OAAO,sBAAsBa,SAASC,IAAI,UAAW,GAGrD,IAAIC,EAAWd,SAASe,eAAe,mBACtCC,EAASC,UAAUC,UAAYD,UAAUE,aAgB1CC,OAAOC,OAAOC,KAAK,UAAW,CAACC,SAAS,CAAC,YAAa,SACtDH,OAAOC,OAAOG,kBAEd,WACC,IAAIC,EAAO,IAAIL,OAAOM,cAAcC,UACpCF,EAAKG,UAAU,SAAU,gBACzBH,EAAKG,UAAU,SAAU,aApB1B,SAAqBC,GACpB,IAAIC,EAAiB,IAAIC,KAAKC,eAAehB,EAAQ,CACpDiB,MAAO,QACPC,IAAK,YAENL,EAAKM,KAAK,SAASC,EAAEC,GACpB,OAAO,IAAIC,KAAKF,EAAE,IAAM,IAAIE,KAAKD,EAAE,MAEpCR,EAAKU,QAAQ,SAASC,GACrBA,EAAE,GAAKF,KAAKG,MAAMD,EAAE,IACpBA,EAAE,GAAKV,EAAeY,OAAOF,EAAE,MAYhCG,CAAYC,qBAAqBnB,MACjCA,EAAKoB,QAAQD,qBAAqBnB,MAElC,IAAIqB,EAAU,CACbC,MAAOhD,OAAO,oBAAoBiD,QAAQD,QAC1CE,OAAQ,IACRC,OAAQ,CAAC,aACTC,OAAQ,OACRC,IAAK,CAACC,WAAY,OAClBC,UAAU,CAACC,KAAK,GAAG/C,IAAI,GAAGuC,MAAM,MAAME,OAAO,OAC7CO,MAAO,CAAEC,UAAW,CAAEC,MAAO,KAG9B,CAAG5C,GACU,IAAIM,OAAOM,cAAciC,YAAY7C,GAC3C8C,KAAKnC,EAAMqB"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
jQuery(document).ready(function(){jQuery(".ct_comment_info").parents().each(function(){if(0<(e=jQuery(this).css("background-color")).length&&"rgba(0, 0, 0, 0)"!=e)return jQuery(".ct_comment_info").css("background",e),!1});var c=jQuery(".ct_comment_info").prev().last().css("float");jQuery(".ct_comment_info").css("float",c);
|
2 |
//# sourceMappingURL=cleantalk-public-admin.min.js.map
|
1 |
+
jQuery(document).ready(function(){jQuery(".ct_comment_info").parents().each(function(){if(0<(e=jQuery(this).css("background-color")).length&&"rgba(0, 0, 0, 0)"!=e)return jQuery(".ct_comment_info").css("background",e),!1});var c=jQuery(".ct_comment_info").prev().last().css("float");jQuery(".ct_comment_info").css("float",c);var t=jQuery(".ct_comment_info");jQuery(t).each(function(e,c){curr_elem=jQuery(c),curr_elem.parent().prepend(curr_elem)}),jQuery(".ct_this_is").on("click",function(){var t=jQuery(this),a=jQuery(this).siblings(".ct_feedback_wrap"),s=jQuery(".ct_feedback_msg"),n=t.hasClass("ct_this_is_spam")?"spam":"approve",e={action:"ct_feedback_comment",security:ctPublicAdmin.ct_ajax_nonce,comment_id:t.attr("commentid"),comment_status:n,change_status:1};jQuery.ajax({type:"POST",url:ctPublicAdmin.ajaxurl,data:e,success:function(e){t.hide(),t.siblings("span.ct_this_is").show(),jQuery(".ct_feedback_result").hide(),"approve"==n?jQuery(".ct_feedback_result_not_spam").show():jQuery(".ct_feedback_result_spam").show(),1==e?(s.addClass("ct_feedback_success"),s.html(ctPublicAdmin.ct_feedback_msg)):0==e?(s.addClass("ct_feedback_error"),s.html(ctPublicAdmin.ct_feedback_error)):"no_hash"==e&&(s.addClass("ct_feedback_no_hash"),s.html(ctPublicAdmin.ct_feedback_no_hash)),a.show(),a.css("display","inline-block");var c=a.data("interval_id");clearInterval(c),c=setTimeout(function(){a.fadeOut(1e3)},5e3),a.data("interval_id",c)},error:function(e,c,t){console.log(e),console.log(c),console.log(t)},timeout:5e3})})});
|
2 |
//# sourceMappingURL=cleantalk-public-admin.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-public-admin.min.js","sources":["cleantalk-public-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set background-color similar to parents\njQuery('.ct_comment_info').parents().each(function() {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \n \tjQuery('.ct_comment_info').css('background', e);\n \treturn false;\n }\n});\n\t\n\t// Set same float style with article\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\n\t\n\tvar ct_posts = jQuery('.ct_comment_info');\n\t\n\tjQuery(ct_posts).each(function(indx, elem){\n\t\tcurr_elem = jQuery(elem);\n\t\tcurr_elem.parent().prepend(curr_elem);\n\t});\n\t\n\t// Handler for buttons\n\tjQuery('.ct_this_is').on('click', function(){\n\t\t\n\t\tvar ct_current_button = jQuery(this),\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\n\t\t\tct_comment_status;\n\t\t\t\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\n\t\t\tct_comment_status = 'spam';\n\t\telse\n\t\t\tct_comment_status = 'approve';\n\t\t\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\n\t\t\t'comment_status': ct_comment_status,\n\t\t\t'change_status': 1\n\t\t};\n\t\t\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublicAdmin.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_current_button.hide();\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\n\t\t\t\t\n\t\t\t\tjQuery('.ct_feedback_result').hide();\n\t\t\t\tif(ct_comment_status == 'approve')\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\n\t\t\t\telse\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\n\t\t\t\t\n\t\t\t\tif(msg == 1){\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n\t\t\t\t}else if(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n\t\t\t\t}else if(msg == 'no_hash'){\n\t\t\t\t\t// No hash for this comment\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n\t\t\t\t}\n\t\t\t\t// Hidding feedback message for every message type\n\t\t\t\tct_feedback_wrap.show();\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\n\t\t\t\t\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\n\t\t\t\tclearInterval(ct_timeout_id);\n\t\t\t\tct_timeout_id = setTimeout(function(){\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\n\t\t\t\t}, 5000);\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t});\n\t\n});"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","ct_comment_status","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGvBF,OAAO,oBAAoBG,UAAUC,KAAK,WACxC,GAAwD,GAAnDC,EAAIL,OAAOM,MAAMC,IAAI,qBAAqBC,QAAmB,oBAALH,EAE5D,OADAL,OAAO,oBAAoBO,IAAI,aAAcF,IACtC,IAKT,IAAII,EAAgBT,OAAO,oBAAoBU,OAAOC,OAAOJ,IAAI,SACjEP,OAAO,oBAAoBO,IAAI,QAASE,
|
1 |
+
{"version":3,"file":"cleantalk-public-admin.min.js","sources":["cleantalk-public-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set background-color similar to parents\njQuery('.ct_comment_info').parents().each(function() {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \n \tjQuery('.ct_comment_info').css('background', e);\n \treturn false;\n }\n});\n\t\n\t// Set same float style with article\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\n\t\n\tvar ct_posts = jQuery('.ct_comment_info');\n\t\n\tjQuery(ct_posts).each(function(indx, elem){\n\t\tcurr_elem = jQuery(elem);\n\t\tcurr_elem.parent().prepend(curr_elem);\n\t});\n\t\n\t// Handler for buttons\n\tjQuery('.ct_this_is').on('click', function(){\n\t\t\n\t\tvar ct_current_button = jQuery(this),\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\n\t\t\tct_comment_status;\n\t\t\t\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\n\t\t\tct_comment_status = 'spam';\n\t\telse\n\t\t\tct_comment_status = 'approve';\n\t\t\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\n\t\t\t'comment_status': ct_comment_status,\n\t\t\t'change_status': 1\n\t\t};\n\t\t\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublicAdmin.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_current_button.hide();\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\n\t\t\t\t\n\t\t\t\tjQuery('.ct_feedback_result').hide();\n\t\t\t\tif(ct_comment_status == 'approve')\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\n\t\t\t\telse\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\n\t\t\t\t\n\t\t\t\tif(msg == 1){\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n\t\t\t\t}else if(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n\t\t\t\t}else if(msg == 'no_hash'){\n\t\t\t\t\t// No hash for this comment\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n\t\t\t\t}\n\t\t\t\t// Hidding feedback message for every message type\n\t\t\t\tct_feedback_wrap.show();\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\n\t\t\t\t\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\n\t\t\t\tclearInterval(ct_timeout_id);\n\t\t\t\tct_timeout_id = setTimeout(function(){\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\n\t\t\t\t}, 5000);\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t});\n\t\n});"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","ct_comment_status","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,UAAUC,MAAM,WAGvBF,OAAO,oBAAoBG,UAAUC,KAAK,WACxC,GAAwD,GAAnDC,EAAIL,OAAOM,MAAMC,IAAI,qBAAqBC,QAAmB,oBAALH,EAE5D,OADAL,OAAO,oBAAoBO,IAAI,aAAcF,IACtC,IAKT,IAAII,EAAgBT,OAAO,oBAAoBU,O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|
|
1 |
-
String.prototype.printf=function(){var e
|
2 |
//# sourceMappingURL=cleantalk-users-checkspam.min.js.map
|
1 |
+
String.prototype.printf=function(){var e=this;for(var t in arguments)var c=e.substring(0,e.indexOf("%s",0)),a=e.substring(e.indexOf("%s",0)+2,e.length),e=c+arguments[t]+a;return e};var ct_working=!(document.cookie="ct_check_users__amount=100; path=/; samesite=lax"),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctUsersCheck.ct_prev_accurate,ct_prev_from=ctUsersCheck.ct_prev_from,ct_prev_till=ctUsersCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctUsersCheck.ct_ajax_nonce,ct_users_total=0,ct_users_checked=0,ct_users_spam=0,ct_users_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function apbct_cookie__get(_,r){var s={};return"string"==typeof(_=_||null)&&(_=_.split()),"none"===(r=r||["apbct_","ct_"])&&(r=null),"string"==typeof r&&(r=r.split()),document.cookie.split(";").forEach(function(e,t,c){var a=e.trim().split("=");_&&_.forEach(function(e,t,c){a[0]===e&&(s[a[0]]=a[1])}),r&&r.forEach(function(e,t,c){0===a[0].indexOf(e)&&(s[a[0]]=a[1])})}),s}function apbct_get_cookie(e){var t=apbct_cookie__get(e,e);return"object"==typeof t&&void 0!==t[e]?t[e]:null}function animate_comment(e,t){ct_close_animate?.3===e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_users(){var e=0,t=0;jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val());var c={action:"ajax_clear_users",security:ct_ajax_nonce,from:e,till:t,no_cache:Math.random()};jQuery.ajax({type:"POST",url:ajaxurl,data:c,success:function(e){ct_show_users_info(),ct_send_users()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_users(),ct_show_users_info()}function ct_send_users(){if(!0!==ct_cooling_down_flag){if(ct_max_requests<=ct_requests_counter)return setTimeout(ct_cooling_down_toggle,ct_cool_down_time),void(ct_cooling_down_flag=!(ct_requests_counter=0));ct_requests_counter++;var a=apbct_get_cookie("ct_check_users__amount"),e={action:"ajax_check_users",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,amount:a,no_cache:Math.random()};ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t,c;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_users():(t="users.php?page=ct_check_users",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||1==ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_users_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="users.php?page=ct_check_users&ct_worked=1",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_users_checked=parseInt(ct_users_checked)+parseInt(e.checked),ct_users_spam=parseInt(ct_users_spam)+parseInt(e.spam),ct_users_bad=parseInt(ct_users_bad)+parseInt(e.bad),ct_unchecked=ct_users_total-ct_users_checked-ct_users_bad,c=(c=String(ctUsersCheck.ct_status_string)).printf(ct_users_checked,ct_users_spam,ct_users_bad),0<parseInt(ct_users_spam)&&(c+=ctUsersCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(c),jQuery("#ct_error_message").hide(),ct_send_users()))},error:function(e,t,c){20<a&&(a-=20,document.cookie="ct_check_users__amount="+a+"; path=/; samesite=lax"),jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check users"),setTimeout(ct_send_users(),3e3)},timeout:25e3})}}function ct_show_users_info(){if(ct_working){if(!0===ct_cooling_down_flag)return void jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)").show();var e;jQuery("#ct_cooling_notice").hide(),ct_users_total||(e={action:"ajax_info_users",security:ct_ajax_nonce,no_cache:Math.random()},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_users_spam=e.spam,ct_users_checked=e.checked,ct_users_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Show users"),setTimeout(ct_show_users_info(),3e3)},timeout:15e3}))}}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_start_check(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""===ct_date_from||""===ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,e?(ct_show_users_info(),ct_send_users()):ct_clear_users())}function ct_delete_all_users(a){var t={action:"ajax_delete_all_users",security:ct_ajax_nonce,no_cache:Math.random()};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:t,success:function(e){0<e?(jQuery("#cleantalk_users_left").html(e),ct_delete_all_users(a,t)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="users.php?page=ct_check_users")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("All users deleteion"),setTimeout(ct_delete_all_users(a),3e3)},timeout:25e3})}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_users_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_users_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_users_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_users_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var _=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),a=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);_.not(this).datepicker("option",t,a),document.cookie="ct_users_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_users_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function t(t){t=t||null;var e={action:"ajax_insert_users",security:ct_ajax_nonce,no_cache:Math.random()};t&&(e.delete=!0),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){t?alert("Deleted "+e+" users"):alert("Inserted "+e+" users")}})}jQuery("#ct_check_spam_button").click(function(){ct_start_check(!(document.cookie="ct_paused_users_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){ct_start_check(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_users_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),jQuery(".cleantalk_delete_from_list_button").click(function(){ct_id=jQuery(this).attr("data-id");var e={action:"ajax_ct_approve_user",security:ct_ajax_nonce,id:ct_id,no_cache:Math.random()};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){jQuery("#comment-"+ct_id).fadeOut("slow",function(){jQuery("#comment-"+ct_id).remove()})}});e={action:"ct_feedback_user",security:ct_ajax_nonce,user_id:ct_id,status:"approve",no_cache:Math.random()};jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){},error:function(e,t,c){},timeout:5e3})}),jQuery(".ct_get_csv_file").click(function(a){var e={action:"ajax_ct_get_csv_file",security:ct_ajax_nonce,filename:ctUsersCheck.ct_csv_filename,no_cache:Math.random()};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t,c;0===parseInt(e)?alert(ctUsersCheck.ct_bad_csv):(t=URL.createObjectURL(new Blob([e])),(c=document.createElement("a")).href=t,c.download=ctUsersCheck.ct_csv_filename+".csv",document.body.appendChild(c),c.click()),jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden")}})}),jQuery(".ct_insert_users").click(function(e){t()}),jQuery(".ct_insert_users__delete").click(function(e){t(!0)}),jQuery(".ct_delete_all_users").click(function(e){return!!confirm(ctUsersCheck.ct_confirm_deletion_all)&&void ct_delete_all_users(e)})});
|
2 |
//# sourceMappingURL=cleantalk-users-checkspam.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes === 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to === 0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random()\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( ct_users_bad ) + parseInt( msg.bad );\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\t\n\tif( ct_working ){\n\t\t\n\t\tif(ct_cooling_down_flag === true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif( ! ct_users_total ){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce,\n\t\t\t\t'no_cache': Math.random()\n\t\t\t};\n\t\t\t\n\t\t\tif( ct_date_from && ct_date_till ){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert('Please, specify a date range.');\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\t\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\t\t\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve',\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t\t\n\t});\n\t\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tjQuery('.spinner').css('visibility', 'visible');\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif( parseInt(msg) === 0 ) {\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t}\n\t\t});\n\t}\n\n});"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","is","val","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","setTimeout","check_amount","new_check","unchecked","amount","new_href","parseJSON","parseInt","error","confirm","error_message","location","href","end","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_delete_all_users","e","target","addClass","css","removeClass","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_insert_users","delete_accounts","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","remove","user_id","status","filename","ct_csv_filename","ct_bad_csv","URL","createObjectURL","Blob","dummy","createElement","download","body","appendChild","ct_confirm_deletion_all"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,I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K,CACXC,KAAM,OACNC,IAAKC,QACLT,KAAMA,EACNU,QAAS,SAASC,KAWlBY,MAAO,SAASc,EAAOC,EAAYC,KAGnCE,QAAS,QAMXhD,OAAO,oBAAoBwF,MAAM,SAAU5B,GAC1C,IAAIrD,EAAO,CACVC,OAAU,uBACVC,SAAYlC,cACZ2H,SAAYjI,aAAakI,gBACzBzF,SAAYC,KAAKC,UAElBZ,OAAO,IAAM4D,EAAEC,OAAO9D,IAAI+D,SAAS,YACnC9D,OAAO,YAAY+D,IAAI,aAAc,WACrC/D,OAAOa,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLT,KAAMA,EACNU,QAAS,SAASC,GACjB,IAGKH,EAHiB,IAAlBc,SAASX,GACZwC,MAAMzF,aAAamI,aAEfrF,EAAMsF,IAAIC,gBAAgB,IAAIC,KAAK,CAACrF,MAEpCsF,EAAQ/I,SAASgJ,cAAc,MAC7BvE,KAAOnB,EACbyF,EAAME,SAAWzI,aAAakI,gBAAkB,OAEhD1I,SAASkJ,KAAKC,YAAYJ,GAC1BA,EAAMhB,SAEPxF,OAAO,IAAM4D,EAAEC,OAAO9D,IAAIiE,YAAY,YACtChE,OAAO,YAAY+D,IAAI,aAAc,eAMxC/D,OAAO,oBAAoBwF,MAAM,SAAU5B,GAC1C0B,MAIDtF,OAAO,4BAA4BwF,MAAM,SAAU5B,GAClD0B,GAAiB,KAIlBtF,OAAO,wBAAwBwF,MAAM,SAAU5B,GAE9C,QAAO7B,QAAS9D,aAAa4I,+BAG7BlD,oBAAqBC"}
|
1 |
+
{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes === 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to === 0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random()\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( ct_users_bad ) + parseInt( msg.bad );\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\t\n\tif( ct_working ){\n\t\t\n\t\tif(ct_cooling_down_flag === true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif( ! ct_users_total ){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce,\n\t\t\t\t'no_cache': Math.random()\n\t\t\t};\n\t\t\t\n\t\t\tif( ct_date_from && ct_date_till ){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert('Please, specify a date range.');\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\t\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\t\t\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve',\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t\t\n\t});\n\t\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tjQuery('.spinner').css('visibility', 'visible');\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif( parseInt(msg) === 0 ) {\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t}\n\t\t});\n\t}\n\n});"],"names":["String","prototype","printf","formatted","this","arg","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","is","val","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","setTimeout","check_amount","new_check","unchecked","amount","new_href","status_string","parseJSON","parseInt","error","confirm","error_message","location","href","end","hide","checked","spam","bad","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_delete_all_users","e","target","addClass","css","removeClass","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_insert_users","delete_accounts","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","remove","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","createElement","download","body","appendChild","ct_confirm_deletion_all"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IAAIC,EAAYC,KAChB,IAAK,IAAIC,KAAOC,UAClB,IAAIC,EAAmBJ,EAAUK,UAAU,EAAGL,EAAUM,QAAQ,KAAM,IAClEC,EAAmBP,EAAUK,UAAUL,EAAUM,QAAQ,KAAM,GAAG,EAAGN,EAAUQ,QACnFR,EAAYI,EAAmBD,UAAUD,GAAOK,EAE9C,OAAOP,GAOX,IAAIS,aAHJC,SAASC,OAAS,oDAIjBC,cAAe,EACfC,sBAAuB,EACvB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BACzBzF,SAAYC,KAAKC,UAElBZ,OAAO,IAAM4D,EAAEC,OAAO9D,IAAI+D,SAAS,YACnC9D,OAAO,YAAY+D,IAAI,aAAc,WACrC/D,OAAOa,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLT,KAAMA,EACNU,QAAS,SAASC,GACjB,IAGKH,EAEAqF,EALiB,IAAlBtE,SAASZ,GACZwC,MAAMzF,aAAaoI,aAEftF,EAAMuF,IAAIC,gBAAgB,IAAIC,KAAK,CAACtF,MAEpCkF,EAAQ3I,SAASgJ,cAAc,MAC7BtE,KAAOpB,EACbqF,EAAMM,SAAWzI,aAAakI,gBAAkB,OAEhD1I,SAASkJ,KAAKC,YAAYR,GAC1BA,EAAMZ,SAEPxF,OAAO,IAAM4D,EAAEC,OAAO9D,IAAIiE,YAAY,YACtChE,OAAO,YAAY+D,IAAI,aAAc,eAMxC/D,OAAO,oBAAoBwF,MAAM,SAAU5B,GAC1C0B,MAIDtF,OAAO,4BAA4BwF,MAAM,SAAU5B,GAClD0B,GAAiB,KAIlBtF,OAAO,wBAAwBwF,MAAM,SAAU5B,GAE9C,QAAO5B,QAAS/D,aAAa4I,+BAG7BlD,oBAAqBC"}
|
@@ -1,2 +1,2 @@
|
|
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(' <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}),
|
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(' <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,2 +1,2 @@
|
|
1 |
-
var ctCollectDetails;function ct_getCookie(e){
|
2 |
//# sourceMappingURL=cleantalk_collect_details.min.js.map
|
1 |
+
var ctCollectDetails;function ct_getCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0}function ct_setCookie(t,i){var e,n;return ctNocache.set_cookies_flag&&(e="https:"===location.protocol?"; secure":"",document.cookie=t+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; samesite=lax"+e,document.cookie=t+" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; samesite=lax"+e,(n=new Date).setDate(n.getDate()+1),setTimeout(function(){var e="https:"===location.protocol?"; secure":"";document.cookie=t+"="+i+"; expires="+n.toUTCString()+"; path = /; samesite=lax"+e},500)),null}if(void 0===ctCollectDetails&&(ctCollectDetails={set_cookies_flag:!0}),Date.now||(Date.now=function(){return(new Date).getTime()}),void 0===ct_collect_details){var ct_collect_details=!0,cleantalk_user_info={},cleantalk_screen_info={};for(var prop in screen)navigator[prop]instanceof Object||""===screen[prop]||(cleantalk_screen_info[prop]=screen[prop]);cleantalk_user_info.screen=cleantalk_screen_info;for(var prev,cleantalk_plugins=Array(),cnt=0,i=0;i<navigator.plugins.length;i++){var plugin=navigator.plugins[i];prev!=(plugin=plugin.name+" "+(plugin.version||""))&&(cleantalk_plugins[cnt]=plugin,cnt++,prev=plugin)}cleantalk_user_info.plugins=cleantalk_plugins,cleantalk_user_info.timezone_offset=-(new Date).getTimezoneOffset()/60,cleantalk_user_info.datetime=Math.round((new Date).getTime()/1e3),cleantalk_user_info.browser_x=document.documentElement.clientWidth,cleantalk_user_info.browser_y=document.documentElement.clientHeight;var ua=navigator.userAgent.toLowerCase(),flashInstalled=0;if(void 0!==navigator.plugins&&"object"==typeof navigator.plugins["Shockwave Flash"])flashInstalled=1;else if(void 0!==window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(flashInstalled=1)}catch(e){}cleantalk_user_info.is_flash=flashInstalled,isVisitedMain=-1,location.href!="http://"+location.hostname+"/"&&location.href!="https://"+location.hostname+"/"||(isVisitedMain=1,setTimeout(function(){ct_setCookie("ct_visited_main","1")},1500)),ct_visited_main=ct_getCookie("ct_visited_main"),isVisitedMain=null==ct_visited_main&&-1==isVisitedMain?0:1,cleantalk_user_info.is_main=isVisitedMain,setTimeout(function(){ctSetCookie("ct_user_info",escape(JSON.stringify(cleantalk_user_info)))},1500)}
|
2 |
//# sourceMappingURL=cleantalk_collect_details.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk_collect_details.min.js","sources":["cleantalk_collect_details.js"],"sourcesContent":["/*\n Assign default values for backend variables.\n*/\nif (typeof ctCollectDetails === 'undefined') {\n var ctCollectDetails = {};\n ctCollectDetails.set_cookies_flag = true;\n}\n\nfunction ct_getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ct_setCookie(name, value)\n{\n if (ctNocache.set_cookies_flag) {\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; samesite=lax\" + ctSecure;\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; samesite=lax\" + ctSecure;\n\n var date = new Date;\n date.setDate(date.getDate() + 1);\n setTimeout(function() {\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = name+\"=\" + value + \"; expires=\" + date.toUTCString() + \"; path = /; samesite=lax\" + ctSecure;\n }, 500);\n }\n\n return null;\n}\n\nif (!Date.now) {\n Date.now = function() { return new Date().getTime(); }\n}\n\nif( ct_collect_details === undefined )\n{\n var ct_collect_details = true;\n\n var cleantalk_user_info={};\n\n var cleantalk_screen_info={};\n\n for(var prop in screen)\n {\n if (navigator[prop] instanceof Object || screen[prop]==='')\n continue;\n cleantalk_screen_info[prop]=screen[prop];\n }\n\n cleantalk_user_info.screen=cleantalk_screen_info;\n\n var cleantalk_plugins=Array();\n var prev;\n var cnt=0;\n for(var i=0;i<navigator.plugins.length;i++)\n {\n var plugin = navigator.plugins[i];\n var plugin = plugin.name+\" \"+(plugin.version || '')\n if (prev == plugin ) continue;\n cleantalk_plugins[cnt]=plugin;\n cnt++;\n prev = plugin;\n }\n cleantalk_user_info.plugins=cleantalk_plugins;\n\n cleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;\n cleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);\n\n cleantalk_user_info.browser_x=document.documentElement.clientWidth;\n cleantalk_user_info.browser_y=document.documentElement.clientHeight;\n\n var ua = navigator.userAgent.toLowerCase();\n var flashInstalled = 0;\n if (typeof(navigator.plugins)!=\"undefined\"&&typeof(navigator.plugins[\"Shockwave Flash\"])==\"object\")\n {\n flashInstalled = 1;\n }\n else if (typeof window.ActiveXObject != \"undefined\")\n {\n try\n {\n if (new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"))\n {\n flashInstalled = 1;\n }\n } catch(e) {};\n };\n\n cleantalk_user_info.is_flash=flashInstalled;\n\n isVisitedMain=-1;\n if(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')\n {\n isVisitedMain=1;\n setTimeout(function () {\n ct_setCookie('ct_visited_main',\n '1')\n }, 1500);\n }\n\n\n ct_visited_main = ct_getCookie('ct_visited_main');\n if(ct_visited_main==undefined && isVisitedMain==-1)\n {\n isVisitedMain=0;\n }\n else\n {\n isVisitedMain=1;\n }\n\n cleantalk_user_info.is_main=isVisitedMain;\n\n setTimeout(function () {\n ctSetCookie(\n 'ct_user_info',\n escape(JSON.stringify(cleantalk_user_info)));\n }, 1500);\n\n}"],"names":["ctCollectDetails","ct_getCookie","name","matches","document","cookie","match","RegExp","replace","decodeURIComponent","undefined","ct_setCookie","value","ctSecure","date","ctNocache","set_cookies_flag","location","protocol","Date","setDate","getDate","setTimeout","toUTCString","now","getTime","ct_collect_details","
|
1 |
+
{"version":3,"file":"cleantalk_collect_details.min.js","sources":["cleantalk_collect_details.js"],"sourcesContent":["/*\n Assign default values for backend variables.\n*/\nif (typeof ctCollectDetails === 'undefined') {\n var ctCollectDetails = {};\n ctCollectDetails.set_cookies_flag = true;\n}\n\nfunction ct_getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ct_setCookie(name, value)\n{\n if (ctNocache.set_cookies_flag) {\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; path = /; samesite=lax\" + ctSecure;\n document.cookie = name+\" =; expires=Thu, 01 Jan 1970 00:00:01 GMT; samesite=lax\" + ctSecure;\n\n var date = new Date;\n date.setDate(date.getDate() + 1);\n setTimeout(function() {\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = name+\"=\" + value + \"; expires=\" + date.toUTCString() + \"; path = /; samesite=lax\" + ctSecure;\n }, 500);\n }\n\n return null;\n}\n\nif (!Date.now) {\n Date.now = function() { return new Date().getTime(); }\n}\n\nif( ct_collect_details === undefined )\n{\n var ct_collect_details = true;\n\n var cleantalk_user_info={};\n\n var cleantalk_screen_info={};\n\n for(var prop in screen)\n {\n if (navigator[prop] instanceof Object || screen[prop]==='')\n continue;\n cleantalk_screen_info[prop]=screen[prop];\n }\n\n cleantalk_user_info.screen=cleantalk_screen_info;\n\n var cleantalk_plugins=Array();\n var prev;\n var cnt=0;\n for(var i=0;i<navigator.plugins.length;i++)\n {\n var plugin = navigator.plugins[i];\n var plugin = plugin.name+\" \"+(plugin.version || '')\n if (prev == plugin ) continue;\n cleantalk_plugins[cnt]=plugin;\n cnt++;\n prev = plugin;\n }\n cleantalk_user_info.plugins=cleantalk_plugins;\n\n cleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;\n cleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);\n\n cleantalk_user_info.browser_x=document.documentElement.clientWidth;\n cleantalk_user_info.browser_y=document.documentElement.clientHeight;\n\n var ua = navigator.userAgent.toLowerCase();\n var flashInstalled = 0;\n if (typeof(navigator.plugins)!=\"undefined\"&&typeof(navigator.plugins[\"Shockwave Flash\"])==\"object\")\n {\n flashInstalled = 1;\n }\n else if (typeof window.ActiveXObject != \"undefined\")\n {\n try\n {\n if (new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"))\n {\n flashInstalled = 1;\n }\n } catch(e) {};\n };\n\n cleantalk_user_info.is_flash=flashInstalled;\n\n isVisitedMain=-1;\n if(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')\n {\n isVisitedMain=1;\n setTimeout(function () {\n ct_setCookie('ct_visited_main',\n '1')\n }, 1500);\n }\n\n\n ct_visited_main = ct_getCookie('ct_visited_main');\n if(ct_visited_main==undefined && isVisitedMain==-1)\n {\n isVisitedMain=0;\n }\n else\n {\n isVisitedMain=1;\n }\n\n cleantalk_user_info.is_main=isVisitedMain;\n\n setTimeout(function () {\n ctSetCookie(\n 'ct_user_info',\n escape(JSON.stringify(cleantalk_user_info)));\n }, 1500);\n\n}"],"names":["ctCollectDetails","ct_getCookie","name","matches","document","cookie","match","RegExp","replace","decodeURIComponent","undefined","ct_setCookie","value","ctSecure","date","ctNocache","set_cookies_flag","location","protocol","Date","setDate","getDate","setTimeout","toUTCString","now","getTime","ct_collect_details","cleantalk_user_info","cleantalk_screen_info","prop","screen","navigator","Object","prev","cleantalk_plugins","Array","cnt","i","plugins","length","plugin","version","timezone_offset","getTimezoneOffset","datetime","Math","round","browser_x","documentElement","clientWidth","browser_y","clientHeight","ua","userAgent","toLowerCase","flashInstalled","window","ActiveXObject","e","is_flash","isVisitedMain","href","hostname","ct_visited_main","is_main","ctSetCookie","escape","JSON","stringify"],"mappings":"AAGA,IACQA,iBAIR,SAASC,aAAaC,GAClB,IAAIC,EAAUC,SAASC,OAAOC,MAAM,IAAIC,OACpC,WAAaL,EAAKM,QAAQ,+BAAgC,QAAU,aAExE,OAAOL,EAAUM,mBAAmBN,EAAQ,SAAMO,EAGtD,SAASC,aAAaT,EAAMU,GAExB,IACQC,EAIAC,EAQR,OAbIC,UAAUC,mBACNH,EAAiC,WAAtBI,SAASC,SAAwB,WAAa,GAC7Dd,SAASC,OAASH,EAAK,oEAAsEW,EAC7FT,SAASC,OAASH,EAAK,0DAA4DW,GAE/EC,EA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7BK,eAAe,EACZ3C,SAAS4C,MAAM,UAAU5C,SAAS6C,SAAS,KAAO7C,SAAS4C,MAAM,WAAW5C,SAAS6C,SAAS,MAE7FF,cAAc,EACdtC,WAAW,WACPX,aAAa,kBACT,MACL,OAIPoD,gBAAkB9D,aAAa,mBAG3B2D,cAFgBlD,MAAjBqD,kBAA8C,GAAhBH,cAEf,EAIA,EAGlBjC,oBAAoBqC,QAAQJ,cAE5BtC,WAAW,WACP2C,YACI,eACAC,OAAOC,KAAKC,UAAUzC,wBAC3B"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
function ct_protect_external(){for(var e,t,
|
2 |
//# sourceMappingURL=cleantalk_external.min.js.map
|
1 |
+
function ct_protect_external(){for(var e,o,t,c,l,n,a,r,i=0;i<document.forms.length;i++){null==document.forms[i].cleantalk_hidden_action&&null==document.forms[i].cleantalk_hidden_method&&"string"==typeof document.forms[i].action&&(-1!==(e=document.forms[i].action).indexOf("activehosted.com")||-1!==e.indexOf("app.convertkit.com")||void 0!==document.forms[i].firstChild.classList&&document.forms[i].firstChild.classList.contains("cb-form-group")?(jQuery(document.forms[i]).before('<i class="cleantalk_placeholder" style="display: none;"></i>'),o=jQuery(document.forms[i]).prev(),t=document.forms[i].outerHTML,c=jQuery(document.forms[i]).detach(),l=i,o.after(t),(n=document.createElement("input")).name="action",n.value="cleantalk_force_ajax_check",n.type="hidden",document.forms[i].appendChild(n),document.forms[i].onsubmit=function(a){a.preventDefault();var e={};e[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(e);var n={},t=a.target.elements;(t=Array.prototype.slice.call(t)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,n,o){var c;+o.apbct.blocked||(apbct_replace_inputs_values_from_other_form(jQuery(a.target).detach(),n),t.after(n),0!==(c=jQuery(n).find("button[type=submit]")).length&&c[0].click(),0!==(c=jQuery(n).find('button[data-element="submit"]')).length&&c[0].click())},callback_context:null,callback_params:[l,o,c]})}):-1===e.indexOf("http://")&&-1===e.indexOf("https://")||e.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((a=document.createElement("input")).name="cleantalk_hidden_action",a.value=e,a.type="hidden",document.forms[i].appendChild(a),(r=document.createElement("input")).name="cleantalk_hidden_method",r.value=document.forms[i].method,r.type="hidden",document.forms[i].method="POST",document.forms[i].appendChild(r),document.forms[i].action=document.location))}}function apbct_replace_inputs_values_from_other_form(e,t){var n=jQuery(e).find("button, input, textarea, select"),a=jQuery(t).find("button, input, textarea, select");n.each(function(e,o){var c=jQuery(o);a.each(function(e,t){var n=jQuery(t);o.outerHTML===t.outerHTML&&n.val(c.val())})})}window.onload=function(){setTimeout(function(){ct_protect_external()},1500)};
|
2 |
//# sourceMappingURL=cleantalk_external.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk_external.min.js","sources":["cleantalk_external.js"],"sourcesContent":["function ct_protect_external(){\n\n\tfor(var i = 0; i < document.forms.length; i++){\n\n\t\tif (document.forms[i].cleantalk_hidden_action == undefined && document.forms[i].cleantalk_hidden_method == undefined) {\n\n\t\t\tif(typeof(document.forms[i].action) == 'string'){\n\n\t\t\t\tvar action = document.forms[i].action;\n\n\t\t\t\tif(\n\t\t\t\t\taction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n\t\t\t\t\taction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n\t\t\t\t\t( document.forms[i].firstChild.classList !== undefined && document.forms[i].firstChild.classList.contains('cb-form-group') ) // Convertbox form\n\t\t\t\t) {\n\n\t\t\t\t\tjQuery( document.forms[i] ).before('<i class=\"cleantalk_placeholder\" style=\"display: none;\"></i>');\n\n\t\t\t\t\t// Deleting form to prevent submit event\n\t\t\t\t\tvar prev = jQuery(document.forms[i]).prev(),\n\t\t\t\t\t\tform_html = document.forms[i].outerHTML,\n\t\t\t\t\t\tform_original = jQuery(document.forms[i]).detach(),\n\t\t\t\t\t\tindex = i;\n\n\t\t\t\t\tprev.after( form_html );\n\n\t\t\t\t\tvar force_action = document.createElement(\"input\");\n\t\t\t\t\tforce_action.name = 'action';\n\t\t\t\t\tforce_action.value = 'cleantalk_force_ajax_check';\n\t\t\t\t\tforce_action.type = 'hidden';\n\t\t\t\t\tdocument.forms[i].appendChild(force_action);\n\n\t\t\t\t\tdocument.forms[i].onsubmit = function ( event ){\n\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Get visible fields and set cookie\n\t\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields );\n\n\t\t\t\t\t\tvar data = {};\n\t\t\t\t\t\tvar elems = event.target.elements;\n\t\t\t\t\t\telems = Array.prototype.slice.call(elems);\n\n\t\t\t\t\t\telems.forEach( function( elem, y ) {\n\t\t\t\t\t\t\tif( elem.name === '' ) {\n\t\t\t\t\t\t\t\tdata['input_' + y] = elem.value;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdata[elem.name] = elem.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tapbct_public_sendAJAX(\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\t\tcallback: function( index, prev, form_original, result ){\n\n\t\t\t\t\t\t\t\t\tif( ! +result.apbct.blocked ) {\n\n\t\t\t\t\t\t\t\t\t\tvar form_new = jQuery(event.target).detach();\n\n\t\t\t\t\t\t\t\t\t\tapbct_replace_inputs_values_from_other_form(form_new, form_original);\n\n\t\t\t\t\t\t\t\t\t\tprev.after( form_original );\n\n\t\t\t\t\t\t\t\t\t\t// Common click event\n\t\t\t\t\t\t\t\t\t\tvar subm_button = jQuery(form_original).find('button[type=submit]');\n\t\t\t\t\t\t\t\t\t\tif( subm_button.length !== 0 ) {\n\t\t\t\t\t\t\t\t\t\t\tsubm_button[0].click();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// ConvertKit direct integration\n\t\t\t\t\t\t\t\t\t\tsubm_button = jQuery(form_original).find('button[data-element=\"submit\"]');\n\t\t\t\t\t\t\t\t\t\tif( subm_button.length !== 0 ) {\n\t\t\t\t\t\t\t\t\t\t\tsubm_button[0].click();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcallback_context: null,\n\t\t\t\t\t\t\t\tcallback_params: [index, prev, form_original],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t};\n\n\t\t\t\t// Common flow\n\t\t\t\t}else if(action.indexOf('http://') !== -1 || action.indexOf('https://') !== -1){\n\n\t\t\t\t\tvar tmp = action.split('//');\n\t\t\t\t\ttmp = tmp[1].split('/');\n\t\t\t\t\tvar host = tmp[0].toLowerCase();\n\n\t\t\t\t\tif(host !== location.hostname.toLowerCase()){\n\n\t var ct_action = document.createElement(\"input\");\n\t ct_action.name = 'cleantalk_hidden_action';\n\t\t\t\t\t\tct_action.value = action;\n\t\t\t\t\t\tct_action.type = 'hidden';\n\t\t\t\t\t\tdocument.forms[i].appendChild(ct_action);\n\n\t var ct_method = document.createElement(\"input\");\n\t ct_method.name = 'cleantalk_hidden_method';\n\t\t\t\t\t\tct_method.value = document.forms[i].method;\n\t\t\t\t\t\tct_method.type = 'hidden';\n\n\t\t\t\t\t\tdocument.forms[i].method = 'POST';\n\t\t\t\t\t\tdocument.forms[i].appendChild(ct_method);\n\n\t\t\t\t\t\tdocument.forms[i].action = document.location;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n\tvar\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n\t\tinputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n\tinputs_source.each( function( index, elem_source ){\n\n\t\tvar source = jQuery( elem_source );\n\n\t\tinputs_target.each( function( index2, elem_target ){\n\n\t\t\tvar target = jQuery( elem_target );\n\n\t\t\tif( elem_source.outerHTML === elem_target.outerHTML ){\n\n\t\t\t\ttarget.val( source.val() );\n\t\t\t}\n\t\t});\n\t});\n\n}\nwindow.onload = function () {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};"],"names":["ct_protect_external","action","prev","form_original","index","ct_method","i","document","forms","length","undefined","cleantalk_hidden_action","cleantalk_hidden_method","indexOf","firstChild","classList","contains","jQuery","before","
|
1 |
+
{"version":3,"file":"cleantalk_external.min.js","sources":["cleantalk_external.js"],"sourcesContent":["function ct_protect_external(){\n\n\tfor(var i = 0; i < document.forms.length; i++){\n\n\t\tif (document.forms[i].cleantalk_hidden_action == undefined && document.forms[i].cleantalk_hidden_method == undefined) {\n\n\t\t\tif(typeof(document.forms[i].action) == 'string'){\n\n\t\t\t\tvar action = document.forms[i].action;\n\n\t\t\t\tif(\n\t\t\t\t\taction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n\t\t\t\t\taction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n\t\t\t\t\t( document.forms[i].firstChild.classList !== undefined && document.forms[i].firstChild.classList.contains('cb-form-group') ) // Convertbox form\n\t\t\t\t) {\n\n\t\t\t\t\tjQuery( document.forms[i] ).before('<i class=\"cleantalk_placeholder\" style=\"display: none;\"></i>');\n\n\t\t\t\t\t// Deleting form to prevent submit event\n\t\t\t\t\tvar prev = jQuery(document.forms[i]).prev(),\n\t\t\t\t\t\tform_html = document.forms[i].outerHTML,\n\t\t\t\t\t\tform_original = jQuery(document.forms[i]).detach(),\n\t\t\t\t\t\tindex = i;\n\n\t\t\t\t\tprev.after( form_html );\n\n\t\t\t\t\tvar force_action = document.createElement(\"input\");\n\t\t\t\t\tforce_action.name = 'action';\n\t\t\t\t\tforce_action.value = 'cleantalk_force_ajax_check';\n\t\t\t\t\tforce_action.type = 'hidden';\n\t\t\t\t\tdocument.forms[i].appendChild(force_action);\n\n\t\t\t\t\tdocument.forms[i].onsubmit = function ( event ){\n\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Get visible fields and set cookie\n\t\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields );\n\n\t\t\t\t\t\tvar data = {};\n\t\t\t\t\t\tvar elems = event.target.elements;\n\t\t\t\t\t\telems = Array.prototype.slice.call(elems);\n\n\t\t\t\t\t\telems.forEach( function( elem, y ) {\n\t\t\t\t\t\t\tif( elem.name === '' ) {\n\t\t\t\t\t\t\t\tdata['input_' + y] = elem.value;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdata[elem.name] = elem.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tapbct_public_sendAJAX(\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\t\tcallback: function( index, prev, form_original, result ){\n\n\t\t\t\t\t\t\t\t\tif( ! +result.apbct.blocked ) {\n\n\t\t\t\t\t\t\t\t\t\tvar form_new = jQuery(event.target).detach();\n\n\t\t\t\t\t\t\t\t\t\tapbct_replace_inputs_values_from_other_form(form_new, form_original);\n\n\t\t\t\t\t\t\t\t\t\tprev.after( form_original );\n\n\t\t\t\t\t\t\t\t\t\t// Common click event\n\t\t\t\t\t\t\t\t\t\tvar subm_button = jQuery(form_original).find('button[type=submit]');\n\t\t\t\t\t\t\t\t\t\tif( subm_button.length !== 0 ) {\n\t\t\t\t\t\t\t\t\t\t\tsubm_button[0].click();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// ConvertKit direct integration\n\t\t\t\t\t\t\t\t\t\tsubm_button = jQuery(form_original).find('button[data-element=\"submit\"]');\n\t\t\t\t\t\t\t\t\t\tif( subm_button.length !== 0 ) {\n\t\t\t\t\t\t\t\t\t\t\tsubm_button[0].click();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcallback_context: null,\n\t\t\t\t\t\t\t\tcallback_params: [index, prev, form_original],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t};\n\n\t\t\t\t// Common flow\n\t\t\t\t}else if(action.indexOf('http://') !== -1 || action.indexOf('https://') !== -1){\n\n\t\t\t\t\tvar tmp = action.split('//');\n\t\t\t\t\ttmp = tmp[1].split('/');\n\t\t\t\t\tvar host = tmp[0].toLowerCase();\n\n\t\t\t\t\tif(host !== location.hostname.toLowerCase()){\n\n\t var ct_action = document.createElement(\"input\");\n\t ct_action.name = 'cleantalk_hidden_action';\n\t\t\t\t\t\tct_action.value = action;\n\t\t\t\t\t\tct_action.type = 'hidden';\n\t\t\t\t\t\tdocument.forms[i].appendChild(ct_action);\n\n\t var ct_method = document.createElement(\"input\");\n\t ct_method.name = 'cleantalk_hidden_method';\n\t\t\t\t\t\tct_method.value = document.forms[i].method;\n\t\t\t\t\t\tct_method.type = 'hidden';\n\n\t\t\t\t\t\tdocument.forms[i].method = 'POST';\n\t\t\t\t\t\tdocument.forms[i].appendChild(ct_method);\n\n\t\t\t\t\t\tdocument.forms[i].action = document.location;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n\tvar\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n\t\tinputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n\tinputs_source.each( function( index, elem_source ){\n\n\t\tvar source = jQuery( elem_source );\n\n\t\tinputs_target.each( function( index2, elem_target ){\n\n\t\t\tvar target = jQuery( elem_target );\n\n\t\t\tif( elem_source.outerHTML === elem_target.outerHTML ){\n\n\t\t\t\ttarget.val( source.val() );\n\t\t\t}\n\t\t});\n\t});\n\n}\nwindow.onload = function () {\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};"],"names":["ct_protect_external","action","prev","form_html","form_original","index","force_action","ct_action","ct_method","i","document","forms","length","undefined","cleantalk_hidden_action","cleantalk_hidden_method","indexOf","firstChild","classList","contains","jQuery","before","outerHTML","detach","after","createElement","name","value","type","appendChild","onsubmit","event","preventDefault","visible_fields","apbct_collect_visible_fields","this","apbct_visible_fields_set_cookie","data","elems","target","elements","Array","prototype","slice","call","forEach","elem","y","apbct_public_sendAJAX","async","callback","result","subm_button","apbct","blocked","apbct_replace_inputs_values_from_other_form","find","click","callback_context","callback_params","split","toLowerCase","location","hostname","method","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","val","window","onload","setTimeout"],"mappings":"AAAA,SAASA,sBAER,IAAI,IAMGC,EAWCC,EACHC,EACAC,EACAC,EAIGC,EAuEgBC,EAMAC,EArGhBC,EAAI,EAAGA,EAAIC,SAASC,MAAMC,OAAQH,IAAI,CAEII,MAA7CH,SAASC,MAAMF,GAAGK,yBAAqFD,MAA7CH,SAASC,MAAMF,GAAGM,yBAExC,iBAA7BL,SAASC,MAAMF,GAAS,UAKQ,KAHrCR,EAASS,SAASC,MAAMF,GAAGR,QAGvBe,QAAQ,sBAC2B,IAA1Cf,EAAOe,QAAQ,4BAC8BH,IAA3CH,SAASC,MAAMF,GAAGQ,WAAWC,WAA2BR,SAASC,MAAMF,GAAGQ,WAAWC,UAAUC,SAAS,kBAG1GC,OAAQV,SAASC,MAAMF,IAAKY,OAAO,gEAG/BnB,EAAOkB,OAAOV,SAASC,MAAMF,IAAIP,OACpCC,EAAYO,SAASC,MAAMF,GAAGa,UAC9BlB,EAAgBgB,OAAOV,SAASC,MAAMF,IAAIc,SAC1ClB,EAAQI,E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pCxD,EAAUoB,KAAO,SAEjBlB,SAASC,MAAMF,GAAGuD,OAAS,OAC3BtD,SAASC,MAAMF,GAAGoB,YAAYrB,GAE9BE,SAASC,MAAMF,GAAGR,OAASS,SAASoD,YAO1C,SAASP,4CAA6CU,EAAaC,GAElE,IAAIC,EAAgB/C,OAAQ6C,GAAcT,KAAM,mCAC/CY,EAAgBhD,OAAQ8C,GAAcV,KAAM,mCAE7CW,EAAcE,KAAM,SAAUhE,EAAOiE,GAEpC,IAAIC,EAASnD,OAAQkD,GAErBF,EAAcC,KAAM,SAAUG,EAAQC,GAErC,IAAIlC,EAASnB,OAAQqD,GAEjBH,EAAYhD,YAAcmD,EAAYnD,WAEzCiB,EAAOmC,IAAKH,EAAOG,WAMvBC,OAAOC,OAAS,WACZC,WAAW,WACP7E,uBACD"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
function ct_check_internal(t){var e
|
2 |
//# sourceMappingURL=cleantalk_internal.min.js.map
|
1 |
+
function ct_check_internal(t){var e={},n=t.elements;for(var c in n)"submit"!=n[c].type&&null!=n[c].value&&""!=n[c].value&&(e[n[c].name]=t.elements[c].value);e.action="ct_check_internal",jQuery.ajax({type:"POST",url:ctNocache.blog_home,datatype:"text",data:e,success:function(e){if("true"!=e)return alert(e),!1;t.submit()},error:function(){t.submit()}})}window.addEventListener("DOMContentLoaded",function(){var e="",t="";for(i=0;i<document.forms.length;i++)"string"==typeof document.forms[i].action&&(-1==(e=(t=document.forms[i]).action).indexOf("http://")&&-1==e.indexOf("https://")||-1!=e.search(/\/wp-content\/themes.*\.php$/)&&-1!=e.indexOf(ctNocache.blog_home)&&(ctPrevHandler=t.click,jQuery(t).off("**"),jQuery(t).off(),jQuery(t).on("submit",function(){return ct_check_internal(t),!1})))});
|
2 |
//# sourceMappingURL=cleantalk_internal.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk_internal.min.js","sources":["cleantalk_internal.js"],"sourcesContent":["function ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n//AJAX Request\n jQuery.ajax({\n type: 'POST',\n url: ctNocache.blog_home,\n datatype : 'text',\n data: ct_data,\n success: function(data){\n if(data == 'true'){\n currForm.submit();\n }else{\n alert(data);\n return false;\n }\n },\n error: function(){\n currForm.submit();\n }\n }); \n}\n
|
1 |
+
{"version":3,"file":"cleantalk_internal.min.js","sources":["cleantalk_internal.js"],"sourcesContent":["function ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n//AJAX Request\n jQuery.ajax({\n type: 'POST',\n url: ctNocache.blog_home,\n datatype : 'text',\n data: ct_data,\n success: function(data){\n if(data == 'true'){\n currForm.submit();\n }else{\n alert(data);\n return false;\n }\n },\n error: function(){\n currForm.submit();\n }\n }); \n}\n\nwindow.addEventListener('DOMContentLoaded', function () {\n var ct_currAction = '',\n ct_currForm = '';\n for(i=0;i<document.forms.length;i++){\n if(typeof(document.forms[i].action)=='string'){\n ct_currForm = document.forms[i];\n ct_currAction = ct_currForm.action;\n if(ct_currAction.indexOf('http://')!=-1||ct_currAction.indexOf('https://')!=-1){\n if(ct_currAction.search(/\\/wp-content\\/themes.*\\.php$/) != (-1) && ct_currAction.indexOf(ctNocache.blog_home) != (-1)){\n ctPrevHandler = ct_currForm.click;\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(){\n ct_check_internal(ct_currForm);\n return false;\n });\n }\n }\n }\n }\n});"],"names":["ct_check_internal","currForm","ct_data","elems","elements","key","type","undefined","value","name","jQuery","ajax","url","ctNocache","blog_home","datatype","data","success","alert","submit","error","window","addEventListener","ct_currAction","ct_currForm","i","document","forms","length","action","indexOf","search","ctPrevHandler","click","off","on"],"mappings":"AAAA,SAASA,kBAAkBC,GAGvB,IAAIC,EAAU,GACVC,EAAQF,EAASG,SAErB,IAAK,IAAIC,KAAOF,EACU,UAAnBA,EAAME,GAAKC,MAAwCC,MAApBJ,EAAME,GAAKG,OAA0C,IAApBL,EAAME,GAAKG,QAE9EN,EAAQC,EAAME,GAAKI,MAAQR,EAASG,SAASC,GAAKG,OAEtDN,EAAgB,OAAI,oBAGpBQ,OAAOC,KAAK,CACRL,KAAM,OACNM,IAAKC,UAAUC,UACfC,SAAW,OACXC,KAAMd,EACNe,QAAS,SAASD,GACd,GAAW,QAARA,EAIC,OADAE,MAAMF,IACC,EAHPf,EAASkB,UAMjBC,MAAO,WACHnB,EAASkB,YAKrBE,OAAOC,iBAAiB,mBAAoB,WACxC,IAAIC,EAAgB,GAChBC,EAAc,GAClB,IAAIC,EAAE,EAAEA,EAAEC,SAASC,MAAMC,OAAOH,IACS,iBAA3BC,SAASC,MAAMF,GAAS,UAGQ,IADtCF,GADAC,EAAcE,SAASC,MAAMF,IACDI,QACXC,QAAQ,aAAoD,GAApCP,EAAcO,QAAQ,cACE,GAA1DP,EAAcQ,OAAO,kCAA2F,GAAhDR,EAAcO,QAAQjB,UAAUC,aAC/FkB,cAAgBR,EAAYS,MAC5BvB,OAAOc,GAAaU,IAAI,MACxBxB,OAAOc,GAAaU,MACpBxB,OAAOc,GAAaW,GAAG,SAAU,WAE7B,OADAnC,kBAAkBwB,IACX"}
|
@@ -1,2 +1,2 @@
|
|
1 |
-
var ctNocache;function sendRequest(e,t,n){var c,i=createXMLHTTPObject();i&&(c=n?"POST":"GET",e="https:"===location.protocol?e.replace("http:","https:"):e.replace("https:","http:"),i.open(c,e,!0),n&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onreadystatechange=function(){4==i.readyState&&(200!=i.status&&304!=i.status||t(i))},4!=i.readyState&&i.send(n))}void 0===ctNocache&&(ctNocache={set_cookies_flag:!0,ajaxurl:"/wp-admin/admin-ajax.php"});var XMLHttpFactories=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject(){for(var e=!1,t=0;t<XMLHttpFactories.length;t++){try{e=XMLHttpFactories[t]()}catch(e){continue}break}return e}function ct_getCookie(e){
|
2 |
//# sourceMappingURL=cleantalk_nocache.min.js.map
|
1 |
+
var ctNocache;function sendRequest(e,t,n){var c,i=createXMLHTTPObject();i&&(c=n?"POST":"GET",e="https:"===location.protocol?e.replace("http:","https:"):e.replace("https:","http:"),i.open(c,e,!0),n&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.onreadystatechange=function(){4==i.readyState&&(200!=i.status&&304!=i.status||t(i))},4!=i.readyState&&i.send(n))}void 0===ctNocache&&(ctNocache={set_cookies_flag:!0,ajaxurl:"/wp-admin/admin-ajax.php"});var XMLHttpFactories=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}];function createXMLHTTPObject(){for(var e=!1,t=0;t<XMLHttpFactories.length;t++){try{e=XMLHttpFactories[t]()}catch(e){continue}break}return e}function ct_getCookie(e){var t=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return t?decodeURIComponent(t[1]):void 0}function ct_callback(t){ct_cookie=t.responseText.trim();var n=new Date;for(n.setDate(n.getDate()+1),ctSetCookie("ct_checkjs",ct_cookie,n.toUTCString()),i=0;i<document.forms.length;i++)for(f=document.forms[i],j=0;j<f.elements.length;j++)e=f.elements[j],void 0!==e.name&&-1!=e.name.indexOf("ct_checkjs")&&(e.value=ct_cookie)}if(Date.now||(Date.now=function(){return(new Date).getTime()}),null==ct_nocache_executed){var ct_nocache_executed=!0,checkjs_cookie=ct_getCookie("ct_checkjs");if(null!=checkjs_cookie)for(i=0;i<document.forms.length;i++)for(f=document.forms[i],j=0;j<f.elements.length;j++)e=f.elements[j],void 0!==e.name&&-1!=e.name.indexOf("ct_checkjs")&&(e.value=checkjs_cookie);if(null==checkjs_cookie&&sendRequest(ctNocache.ajaxurl+"?"+Math.random(),ct_callback,"action=ct_get_cookie"),void 0!==ctNocache.info_flag&&ctNocache.info_flag){var cleantalk_user_info={},cleantalk_screen_info={};for(var prop in screen)navigator[prop]instanceof Object||""===screen[prop]||(cleantalk_screen_info[prop]=screen[prop]);cleantalk_user_info.screen=cleantalk_screen_info;for(var prev,cleantalk_plugins=Array(),cnt=0,i=0;i<navigator.plugins.length;i++){var plugin=navigator.plugins[i];prev!=(plugin=plugin.name+" "+(plugin.version||""))&&(cleantalk_plugins[cnt]=plugin,cnt++,prev=plugin)}cleantalk_user_info.plugins=cleantalk_plugins,cleantalk_user_info.timezone_offset=-(new Date).getTimezoneOffset()/60,cleantalk_user_info.datetime=Math.round((new Date).getTime()/1e3),cleantalk_user_info.browser_x=document.documentElement.clientWidth,cleantalk_user_info.browser_y=document.documentElement.clientHeight;var ua=navigator.userAgent.toLowerCase(),flashInstalled=0;if(void 0!==navigator.plugins&&"object"==typeof navigator.plugins["Shockwave Flash"])flashInstalled=1;else if(void 0!==window.ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(flashInstalled=1)}catch(e){}cleantalk_user_info.is_flash=flashInstalled,isVisitedMain=-1,location.href!="http://"+location.hostname+"/"&&location.href!="https://"+location.hostname+"/"||(isVisitedMain=1,setTimeout(function(){ctSetCookie("ct_visited_main","1")},1500)),ct_visited_main=ct_getCookie("ct_visited_main"),isVisitedMain=null==ct_visited_main&&-1==isVisitedMain?0:1,cleantalk_user_info.is_main=isVisitedMain,setTimeout(function(){ctSetCookie("ct_user_info",escape(JSON.stringify(cleantalk_user_info)))},1500)}}
|
2 |
//# sourceMappingURL=cleantalk_nocache.min.js.map
|
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk_nocache.min.js","sources":["cleantalk_nocache.js"],"sourcesContent":["/*\n Assign default values for backend variables.\n*/\nif (typeof ctNocache === 'undefined') {\n\tvar ctNocache = {};\n\tctNocache.set_cookies_flag = true;\n ctNocache.ajaxurl = '/wp-admin/admin-ajax.php';\n}\n\nfunction sendRequest(url,callback,postData) {\n var req = createXMLHTTPObject();\n if (!req) return;\n var method = (postData) ? \"POST\" : \"GET\";\n \n var protocol = location.protocol;\n if (protocol === 'https:') {\n url = url.replace('http:', 'https:');\n } else {\n url = url.replace('https:', 'http:');\n }\n \n req.open(method,url,true);\n if (postData)\n req.setRequestHeader('Content-type','application/x-www-form-urlencoded');\n req.onreadystatechange = function () {\n if (req.readyState != 4) return;\n if (req.status != 200 && req.status != 304) {\n// alert('HTTP error ' + req.status);\n return;\n }\n callback(req);\n };\n if (req.readyState == 4) return;\n req.send(postData);\n}\n\nvar XMLHttpFactories = [\n function () {return new XMLHttpRequest()},\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\n];\n\nfunction createXMLHTTPObject() {\n var xmlhttp = false;\n for (var i=0;i<XMLHttpFactories.length;i++) {\n try {\n xmlhttp = XMLHttpFactories[i]();\n }\n catch (e) {\n continue;\n }\n break;\n }\n return xmlhttp;\n}\n\nfunction ct_getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ct_callback(req)\n{\n\tct_cookie = req.responseText.trim();\n\t//alert('Key value: ' + ct_cookie);\n\n\tvar date = new Date;\n\tdate.setDate(date.getDate() + 1);\n\tctSetCookie('ct_checkjs', ct_cookie, date.toUTCString());\n\t\n\tfor(i=0;i<document.forms.length;i++)\n\t{\n\t\tf=document.forms[i];\n\t\tfor(j=0;j<f.elements.length;j++)\n\t\t{\n\t\t\te=f.elements[j];\n\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\n\t\t\t{\n\t\t\t\te.value=ct_cookie;\n\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\n\t\t\t}\n\t\t}\n\t}\n\n\t//alert('Set cookie: \\n' + document.cookie);\n}\n\nif (!Date.now) {\n\tDate.now = function() { return new Date().getTime(); }\n}\n\nif(ct_nocache_executed==undefined)\n{\n\tvar ct_nocache_executed=true;\n\t\n\tvar checkjs_cookie=ct_getCookie('ct_checkjs');\n\t\n\tif(checkjs_cookie!=undefined)\n\t{\n\t\tfor(i=0;i<document.forms.length;i++)\n\t\t{\n\t\t\tf=document.forms[i];\n\t\t\tfor(j=0;j<f.elements.length;j++)\n\t\t\t{\n\t\t\t\te=f.elements[j];\n\t\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\n\t\t\t\t{\n\t\t\t\t\te.value=checkjs_cookie;\n\t\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\tif(checkjs_cookie==undefined) //86400 is 24 hours\n\t{\n\t\tsendRequest(ctNocache.ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');\n\t}\n\t\n\tif(typeof ctNocache.info_flag !== 'undefined' && ctNocache.info_flag)\n\t{\n\t\n\t\tvar cleantalk_user_info={};\n\t\t\n\t\tvar cleantalk_screen_info={};\n\t\tfor(var prop in screen)\n\t\t{\n\t\t\tif (navigator[prop] instanceof Object || screen[prop]==='')\n\t\t\t\tcontinue;\n\t\t\tcleantalk_screen_info[prop]=screen[prop];\n\t\t}\n\t\t\n\t\tcleantalk_user_info.screen=cleantalk_screen_info;\n\t\t\n\t\tvar cleantalk_plugins=Array();\n\t\tvar prev;\n\t\tvar cnt=0;\n\t\tfor(var i=0;i<navigator.plugins.length;i++)\n\t\t{\n\t\t\tvar plugin = navigator.plugins[i];\n\t\t\tvar plugin = plugin.name+\" \"+(plugin.version || '')\n\t\t\tif (prev == plugin ) continue;\n\t\t\tcleantalk_plugins[cnt]=plugin;\n\t\t\tcnt++;\n\t\t\tprev = plugin;\n\t\t}\n\t\tcleantalk_user_info.plugins=cleantalk_plugins;\n\t\t\n\t\tcleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;\n\t\tcleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);\n\t\t\n\t\tcleantalk_user_info.browser_x=document.documentElement.clientWidth;\n\t\tcleantalk_user_info.browser_y=document.documentElement.clientHeight;\n\t\t\n\t\tvar ua = navigator.userAgent.toLowerCase();\n\t\tvar flashInstalled = 0;\n\t\tif (typeof(navigator.plugins)!=\"undefined\"&&typeof(navigator.plugins[\"Shockwave Flash\"])==\"object\")\n\t\t{\n\t\t\tflashInstalled = 1;\n\t\t}\n\t\telse if (typeof window.ActiveXObject != \"undefined\")\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"))\n\t\t\t\t{\n\t\t\t\t\tflashInstalled = 1;\n\t\t\t\t}\n\t\t\t} catch(e) {};\n\t\t};\n\t\t\n\t\tcleantalk_user_info.is_flash=flashInstalled;\n\t\t\n\t\tisVisitedMain=-1;\n\t\tif(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')\n\t\t{\n\t\t\tisVisitedMain=1;\n\t\t\tsetTimeout(function () {\n\t\t\t\tctSetCookie('ct_visited_main', '1');\n\t\t\t}, 1500);\n\t\t}\n\t\t\n\t\t\n\t\tct_visited_main = ct_getCookie('ct_visited_main');\n\t\tif(ct_visited_main==undefined && isVisitedMain==-1)\n\t\t{\n\t\t\tisVisitedMain=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tisVisitedMain=1;\n\t\t}\n\t\t\n\t\tcleantalk_user_info.is_main=isVisitedMain;\n\n\t\tsetTimeout(function () {\n\t\t\tctSetCookie( 'ct_user_info',\tescape(JSON.stringify(cleantalk_user_info) ) );\n\t\t}, 1500);\n\t}\n}"],"names":["ctNocache","sendRequest","url","callback","postData","method","req","createXMLHTTPObject","location","protocol","replace","open","setRequestHeader","onreadystatechange","readyState","status","send","set_cookies_flag","ajaxurl","XMLHttpFactories","XMLHttpRequest","ActiveXObject","xmlhttp","i","length","e","ct_getCookie","name","matches","document","cookie","match","RegExp","decodeURIComponent","undefined","ct_callback","ct_cookie","responseText","trim","date","Date","setDate","getDate","ctSetCookie","toUTCString","forms","f","j","elements","indexOf","value","now","getTime","ct_nocache_executed","checkjs_cookie","Math","random","info_flag","
|
1 |
+
{"version":3,"file":"cleantalk_nocache.min.js","sources":["cleantalk_nocache.js"],"sourcesContent":["/*\n Assign default values for backend variables.\n*/\nif (typeof ctNocache === 'undefined') {\n\tvar ctNocache = {};\n\tctNocache.set_cookies_flag = true;\n ctNocache.ajaxurl = '/wp-admin/admin-ajax.php';\n}\n\nfunction sendRequest(url,callback,postData) {\n var req = createXMLHTTPObject();\n if (!req) return;\n var method = (postData) ? \"POST\" : \"GET\";\n \n var protocol = location.protocol;\n if (protocol === 'https:') {\n url = url.replace('http:', 'https:');\n } else {\n url = url.replace('https:', 'http:');\n }\n \n req.open(method,url,true);\n if (postData)\n req.setRequestHeader('Content-type','application/x-www-form-urlencoded');\n req.onreadystatechange = function () {\n if (req.readyState != 4) return;\n if (req.status != 200 && req.status != 304) {\n// alert('HTTP error ' + req.status);\n return;\n }\n callback(req);\n };\n if (req.readyState == 4) return;\n req.send(postData);\n}\n\nvar XMLHttpFactories = [\n function () {return new XMLHttpRequest()},\n function () {return new ActiveXObject(\"Msxml2.XMLHTTP\")},\n function () {return new ActiveXObject(\"Msxml3.XMLHTTP\")},\n function () {return new ActiveXObject(\"Microsoft.XMLHTTP\")}\n];\n\nfunction createXMLHTTPObject() {\n var xmlhttp = false;\n for (var i=0;i<XMLHttpFactories.length;i++) {\n try {\n xmlhttp = XMLHttpFactories[i]();\n }\n catch (e) {\n continue;\n }\n break;\n }\n return xmlhttp;\n}\n\nfunction ct_getCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ct_callback(req)\n{\n\tct_cookie = req.responseText.trim();\n\t//alert('Key value: ' + ct_cookie);\n\n\tvar date = new Date;\n\tdate.setDate(date.getDate() + 1);\n\tctSetCookie('ct_checkjs', ct_cookie, date.toUTCString());\n\t\n\tfor(i=0;i<document.forms.length;i++)\n\t{\n\t\tf=document.forms[i];\n\t\tfor(j=0;j<f.elements.length;j++)\n\t\t{\n\t\t\te=f.elements[j];\n\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\n\t\t\t{\n\t\t\t\te.value=ct_cookie;\n\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\n\t\t\t}\n\t\t}\n\t}\n\n\t//alert('Set cookie: \\n' + document.cookie);\n}\n\nif (!Date.now) {\n\tDate.now = function() { return new Date().getTime(); }\n}\n\nif(ct_nocache_executed==undefined)\n{\n\tvar ct_nocache_executed=true;\n\t\n\tvar checkjs_cookie=ct_getCookie('ct_checkjs');\n\t\n\tif(checkjs_cookie!=undefined)\n\t{\n\t\tfor(i=0;i<document.forms.length;i++)\n\t\t{\n\t\t\tf=document.forms[i];\n\t\t\tfor(j=0;j<f.elements.length;j++)\n\t\t\t{\n\t\t\t\te=f.elements[j];\n\t\t\t\tif(e.name!==undefined&&e.name.indexOf('ct_checkjs')!=-1)\n\t\t\t\t{\n\t\t\t\t\te.value=checkjs_cookie;\n\t\t\t\t\t//alert('Form #' + i + ', field ' + e.name + ' = ' + ct_cookie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\tif(checkjs_cookie==undefined) //86400 is 24 hours\n\t{\n\t\tsendRequest(ctNocache.ajaxurl+'?'+Math.random(),ct_callback,'action=ct_get_cookie');\n\t}\n\t\n\tif(typeof ctNocache.info_flag !== 'undefined' && ctNocache.info_flag)\n\t{\n\t\n\t\tvar cleantalk_user_info={};\n\t\t\n\t\tvar cleantalk_screen_info={};\n\t\tfor(var prop in screen)\n\t\t{\n\t\t\tif (navigator[prop] instanceof Object || screen[prop]==='')\n\t\t\t\tcontinue;\n\t\t\tcleantalk_screen_info[prop]=screen[prop];\n\t\t}\n\t\t\n\t\tcleantalk_user_info.screen=cleantalk_screen_info;\n\t\t\n\t\tvar cleantalk_plugins=Array();\n\t\tvar prev;\n\t\tvar cnt=0;\n\t\tfor(var i=0;i<navigator.plugins.length;i++)\n\t\t{\n\t\t\tvar plugin = navigator.plugins[i];\n\t\t\tvar plugin = plugin.name+\" \"+(plugin.version || '')\n\t\t\tif (prev == plugin ) continue;\n\t\t\tcleantalk_plugins[cnt]=plugin;\n\t\t\tcnt++;\n\t\t\tprev = plugin;\n\t\t}\n\t\tcleantalk_user_info.plugins=cleantalk_plugins;\n\t\t\n\t\tcleantalk_user_info.timezone_offset = -new Date().getTimezoneOffset()/60;\n\t\tcleantalk_user_info.datetime = Math.round((new Date().getTime())/1000);\n\t\t\n\t\tcleantalk_user_info.browser_x=document.documentElement.clientWidth;\n\t\tcleantalk_user_info.browser_y=document.documentElement.clientHeight;\n\t\t\n\t\tvar ua = navigator.userAgent.toLowerCase();\n\t\tvar flashInstalled = 0;\n\t\tif (typeof(navigator.plugins)!=\"undefined\"&&typeof(navigator.plugins[\"Shockwave Flash\"])==\"object\")\n\t\t{\n\t\t\tflashInstalled = 1;\n\t\t}\n\t\telse if (typeof window.ActiveXObject != \"undefined\")\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (new ActiveXObject(\"ShockwaveFlash.ShockwaveFlash\"))\n\t\t\t\t{\n\t\t\t\t\tflashInstalled = 1;\n\t\t\t\t}\n\t\t\t} catch(e) {};\n\t\t};\n\t\t\n\t\tcleantalk_user_info.is_flash=flashInstalled;\n\t\t\n\t\tisVisitedMain=-1;\n\t\tif(location.href=='http://'+location.hostname+'/' || location.href=='https://'+location.hostname+'/')\n\t\t{\n\t\t\tisVisitedMain=1;\n\t\t\tsetTimeout(function () {\n\t\t\t\tctSetCookie('ct_visited_main', '1');\n\t\t\t}, 1500);\n\t\t}\n\t\t\n\t\t\n\t\tct_visited_main = ct_getCookie('ct_visited_main');\n\t\tif(ct_visited_main==undefined && isVisitedMain==-1)\n\t\t{\n\t\t\tisVisitedMain=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tisVisitedMain=1;\n\t\t}\n\t\t\n\t\tcleantalk_user_info.is_main=isVisitedMain;\n\n\t\tsetTimeout(function () {\n\t\t\tctSetCookie( 'ct_user_info',\tescape(JSON.stringify(cleantalk_user_info) ) );\n\t\t}, 1500);\n\t}\n}"],"names":["ctNocache","sendRequest","url","callback","postData","method","req","createXMLHTTPObject","location","protocol","replace","open","setRequestHeader","onreadystatechange","readyState","status","send","set_cookies_flag","ajaxurl","XMLHttpFactories","XMLHttpRequest","ActiveXObject","xmlhttp","i","length","e","ct_getCookie","name","matches","document","cookie","match","RegExp","decodeURIComponent","undefined","ct_callback","ct_cookie","responseText","trim","date","Date","setDate","getDate","ctSetCookie","toUTCString","forms","f","j","elements","indexOf","value","now","getTime","ct_nocache_executed","checkjs_cookie","Math","random","info_flag","cleantalk_user_info","cleantalk_screen_info","prop","screen","navigator","Object","prev","cleantalk_plugins","Array","cnt","plugins","plugin","version","timezone_offset","getTimezoneOffset","datetime","round","browser_x","documentElement","clientWidth","browser_y","clientHeight","ua","userAgent","toLowerCase","flashInstalled","window","is_flash","isVisitedMain","href","hostname","setTimeout","ct_visited_main","is_main","escape","JSON","stringify"],"mappings":"AAGA,IACKA,UAKL,SAASC,YAAYC,EAAIC,EAASC,GAC9B,IAEIC,EAFAC,EAAMC,sBACLD,IACDD,EAAS,EAAa,OAAS,MAI/BH,EADa,WADFM,SAASC,SAEdP,EAAIQ,QAAQ,QAAS,UAErBR,EAAIQ,QAAQ,SAAU,SAGhCJ,EAAIK,KAAKN,EAAOH,GAAI,GAChBE,GACAE,EAAIM,iBAAiB,eAAe,qCACxCN,EAAIO,mBAAqB,WACC,GAAlBP,EAAIQ,aACU,KAAdR,EAAIS,QAA+B,KAAdT,EAAIS,QAI7BZ,EAASG,KAES,GAAlBA,EAAIQ,YACRR,EAAIU,KAAKZ,SA9BY,IAAdJ,YACNA,UAAY,CAChBiB,kBAA6B,EAC1BC,QAAoB,6BA8BxB,IAAIC,iBAAmB,CACnB,WAAa,OAAO,IAAIC,gBACxB,WAAa,OAAO,IAAIC,cAAc,mBACtC,WAAa,OAAO,IAAIA,cAAc,mBACtC,WAAa,OAAO,IAAIA,cAAc,uBAG1C,SAASd,sBAEL,IADA,IAAIe,GAAU,EACLC,EAAE,EAAEA,EAAEJ,iBAAiBK,OAAOD,IAAK,CACxC,IACID,EAAUH,iBAAiBI,KAE/B,MAAOE,GACH,SAEJ,MAEJ,OAAOH,EAGX,SAASI,aAAaC,GACpB,IAAIC,EAAUC,SAASC,OAAOC,MAAM,IAAIC,OACtC,WAAaL,EAAKjB,QAAQ,+BAAgC,QAAU,aAEtE,OAAOkB,EAAUK,mBAAmBL,EAAQ,SAAMM,EAGpD,SAASC,YAAY7B,GAEpB8B,UAAY9B,EAAI+B,aAAaC,OAG7B,IAAIC,EAAO,IAAIC,KAIf,IAHAD,EAAKE,QAAQF,EAAKG,UAAY,GAC9BC,YAAY,aAAcP,UAAWG,EAAKK,eAEtCrB,EAAE,EAAEA,EAAEM,SAASgB,MAAMrB,OAAOD,IA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I/B,MAAOgC,oBAAoB,GACtEd,oBAAoBe,SAAWlB,KAAKmB,OAAO,IAAIlC,MAAOY,UAAW,KAEjEM,oBAAoBiB,UAAU9C,SAAS+C,gBAAgBC,YACvDnB,oBAAoBoB,UAAUjD,SAAS+C,gBAAgBG,aAEvD,IAAIC,GAAKlB,UAAUmB,UAAUC,cACzBC,eAAiB,EACrB,QAA+B,IAApBrB,UAAiB,SAA8D,iBAAvCA,UAAUM,QAAQ,mBAEpEe,eAAiB,OAEb,QAAmC,IAAxBC,OAAO/D,cAEtB,IAEK,IAAIA,cAAc,mCAErB8D,eAAiB,GAEjB,MAAM1D,IAGTiC,oBAAoB2B,SAASF,eAE7BG,eAAe,EACZ9E,SAAS+E,MAAM,UAAU/E,SAASgF,SAAS,KAAOhF,SAAS+E,MAAM,WAAW/E,SAASgF,SAAS,MAEhGF,cAAc,EACdG,WAAW,WACV9C,YAAY,kBAAmB,MAC7B,OAIJ+C,gBAAkBhE,aAAa,mBAG9B4D,cAFmBpD,MAAjBwD,kBAA8C,GAAhBJ,cAElB,EAIA,EAGf5B,oBAAoBiC,QAAQL,cAE5BG,WAAW,WACV9C,YAAa,eAAgBiD,OAAOC,KAAKC,UAAUpC,wBACjD"}
|
@@ -206,7 +206,7 @@ class Cleantalk {
|
|
206 |
'/\s?ct_cookies_test=.*?[^;]*;?/',
|
207 |
'/\s?ct_ps_timestamp=.*?[^;]*;?/',
|
208 |
'/\s?ct_fkp_timestamp=\d*?[^;]*;?/',
|
209 |
-
'/\s?
|
210 |
'/\s?apbct_page_hits=\d*?[^;]*;?/',
|
211 |
'/\s?apbct_visible_fields_count=\d*?[^;]*;?/',
|
212 |
'/\s?apbct_visible_fields=%7B.*%7D[^;]*;?/',
|
206 |
'/\s?ct_cookies_test=.*?[^;]*;?/',
|
207 |
'/\s?ct_ps_timestamp=.*?[^;]*;?/',
|
208 |
'/\s?ct_fkp_timestamp=\d*?[^;]*;?/',
|
209 |
+
'/\s?wordpress_ct_sfw_pass_key=\d*?[^;]*;?/',
|
210 |
'/\s?apbct_page_hits=\d*?[^;]*;?/',
|
211 |
'/\s?apbct_visible_fields_count=\d*?[^;]*;?/',
|
212 |
'/\s?apbct_visible_fields=%7B.*%7D[^;]*;?/',
|
@@ -155,9 +155,14 @@ class CleantalkRequest {
|
|
155 |
* Method name
|
156 |
* @var string
|
157 |
*/
|
158 |
-
public $method_name = 'check_message';
|
159 |
|
160 |
-
|
|
|
|
|
|
|
|
|
|
|
161 |
* Fill params with constructor
|
162 |
* @param type $params
|
163 |
*/
|
@@ -172,12 +177,19 @@ class CleantalkRequest {
|
|
172 |
$this->agent = isset($params['agent']) ? (string)$params['agent'] : null;
|
173 |
$this->auth_key = isset($params['auth_key']) ? (string)$params['auth_key'] : null;
|
174 |
$this->sender_email = isset($params['sender_email']) ? (string)$params['sender_email'] : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
$this->sender_nickname = !empty($params['sender_nickname']) ? (string)$params['sender_nickname'] : null;
|
176 |
$this->phone = !empty($params['phone']) ? (string)$params['phone'] : null;
|
177 |
$this->js_on = isset($params['js_on']) ? (int)$params['js_on'] : null;
|
178 |
$this->submit_time = isset($params['submit_time']) ? (int)$params['submit_time'] : null;
|
179 |
$this->post_info = isset($params['post_info']) ? (string)json_encode($params['post_info']) : null;
|
180 |
$this->sender_info = isset($params['sender_info']) ? (string)json_encode($params['sender_info']) : null;
|
|
|
181 |
|
182 |
$this->message = ! empty( $params['message'] )
|
183 |
? ( ! is_scalar( $params['message'] )
|
155 |
* Method name
|
156 |
* @var string
|
157 |
*/
|
158 |
+
public $method_name = 'check_message';
|
159 |
|
160 |
+
/**
|
161 |
+
* @var int|null
|
162 |
+
*/
|
163 |
+
public $honeypot_website;
|
164 |
+
|
165 |
+
/**
|
166 |
* Fill params with constructor
|
167 |
* @param type $params
|
168 |
*/
|
177 |
$this->agent = isset($params['agent']) ? (string)$params['agent'] : null;
|
178 |
$this->auth_key = isset($params['auth_key']) ? (string)$params['auth_key'] : null;
|
179 |
$this->sender_email = isset($params['sender_email']) ? (string)$params['sender_email'] : null;
|
180 |
+
|
181 |
+
// crunch for "PHP Notice: Array to string conversion". Error appears only on Gravity forms
|
182 |
+
// @todo fix gat_fields_any
|
183 |
+
if( isset( $params['sender_nickname'] ) && is_array( $params['sender_nickname'] ) )
|
184 |
+
$params['sender_nickname'] = current( $params['sender_nickname'] );
|
185 |
+
|
186 |
$this->sender_nickname = !empty($params['sender_nickname']) ? (string)$params['sender_nickname'] : null;
|
187 |
$this->phone = !empty($params['phone']) ? (string)$params['phone'] : null;
|
188 |
$this->js_on = isset($params['js_on']) ? (int)$params['js_on'] : null;
|
189 |
$this->submit_time = isset($params['submit_time']) ? (int)$params['submit_time'] : null;
|
190 |
$this->post_info = isset($params['post_info']) ? (string)json_encode($params['post_info']) : null;
|
191 |
$this->sender_info = isset($params['sender_info']) ? (string)json_encode($params['sender_info']) : null;
|
192 |
+
$this->honeypot_website = isset($params['honeypot_website']) ? (int)$params['honeypot_website'] : null;
|
193 |
|
194 |
$this->message = ! empty( $params['message'] )
|
195 |
? ( ! is_scalar( $params['message'] )
|
@@ -1,113 +1,113 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace Cleantalk\Antispam;
|
5 |
-
|
6 |
-
|
7 |
-
class Integrations
|
8 |
-
{
|
9 |
-
|
10 |
-
private $integrations = array();
|
11 |
-
|
12 |
-
private $integration;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Integrations constructor.
|
16 |
-
*
|
17 |
-
* @param array $integrations
|
18 |
-
* @param array $settings
|
19 |
-
*/
|
20 |
-
public function __construct( $integrations, $settings )
|
21 |
-
{
|
22 |
-
$this->integrations = $integrations;
|
23 |
-
|
24 |
-
foreach( $this->integrations as $integration_name => $integration_info ){
|
25 |
-
|
26 |
-
if( empty( $settings[ $integration_info['setting'] ] ) )
|
27 |
-
continue;
|
28 |
-
|
29 |
-
if( $integration_info['ajax'] ) {
|
30 |
-
if( is_array( $integration_info['hook'] ) ) {
|
31 |
-
foreach( $integration_info['hook'] as $hook ) {
|
32 |
-
add_action( 'wp_ajax_' . $hook, array( $this, 'checkSpam' ), 1 );
|
33 |
-
add_action( 'wp_ajax_nopriv_' . $hook, array( $this, 'checkSpam' ), 1 );
|
34 |
-
}
|
35 |
-
} else {
|
36 |
-
add_action( 'wp_ajax_' . $integration_info['hook'], array( $this, 'checkSpam' ), 1 );
|
37 |
-
add_action( 'wp_ajax_nopriv_' . $integration_info['hook'], array( $this, 'checkSpam' ), 1 );
|
38 |
-
}
|
39 |
-
} else {
|
40 |
-
add_action( $integration_info['hook'], array( $this, 'checkSpam' ) );
|
41 |
-
}
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
public function checkSpam( $argument )
|
46 |
-
{
|
47 |
-
global $cleantalk_executed;
|
48 |
-
|
49 |
-
// Getting current integration name
|
50 |
-
$current_integration = $this->get_current_integration_triggered( current_filter() );
|
51 |
-
if( $current_integration ) {
|
52 |
-
// Instantiate the integration object
|
53 |
-
$class = '\\Cleantalk\\Antispam\\Integrations\\' . $current_integration;
|
54 |
-
if( class_exists( $class )) {
|
55 |
-
$this->integration = new $class();
|
56 |
-
if( ! ( $this->integration instanceof \Cleantalk\Antispam\Integrations\IntegrationBase ) ) {
|
57 |
-
// @ToDo have to handle an error
|
58 |
-
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, array('Integration is not instanse of IntegrationBase class.') );
|
59 |
-
return;
|
60 |
-
}
|
61 |
-
// Run data collecting for spam checking
|
62 |
-
$data = $this->integration->getDataForChecking( $argument );
|
63 |
-
if( ! is_null( $data ) ) {
|
64 |
-
// Go spam checking
|
65 |
-
$base_call_result = apbct_base_call(
|
66 |
-
array(
|
67 |
-
'message' => !empty( $data['message'] ) ? json_encode( $data['message'] ) : '',
|
68 |
-
'sender_email' => !empty( $data['email'] ) ? $data['email'] : '',
|
69 |
-
'sender_nickname' => !empty( $data['nickname'] ) ? $data['nickname'] : '',
|
70 |
-
'post_info' => array(
|
71 |
-
'comment_type' => 'contact_form_wordpress_' . strtolower($current_integration),
|
72 |
-
'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ), // Page URL must be an previous page
|
73 |
-
),
|
74 |
-
),
|
75 |
-
isset( $data['register'] ) ? true : false
|
76 |
-
);
|
77 |
-
|
78 |
-
$ct_result = $base_call_result['ct_result'];
|
79 |
-
|
80 |
-
$cleantalk_executed = true;
|
81 |
-
|
82 |
-
if ($ct_result->allow == 0) {
|
83 |
-
// Do blocking if it is a spam
|
84 |
-
$this->integration->doBlock( $ct_result->comment );
|
85 |
-
}
|
86 |
-
} else {
|
87 |
-
// @ToDo have to handle an error
|
88 |
-
return;
|
89 |
-
}
|
90 |
-
}
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
private function get_current_integration_triggered( $hook )
|
95 |
-
{
|
96 |
-
if( $hook !== false ) {
|
97 |
-
foreach( $this->integrations as $integration_name => $integration_info ) {
|
98 |
-
if( is_array( $integration_info['hook'] ) ) {
|
99 |
-
foreach( $integration_info['hook'] as $integration_hook ) {
|
100 |
-
if( strpos( $hook, $integration_hook ) !== false ) {
|
101 |
-
return $integration_name;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
} else {
|
105 |
-
if( strpos( $hook, $integration_info['hook'] ) !== false ) {
|
106 |
-
return $integration_name;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
}
|
110 |
-
}
|
111 |
-
return false;
|
112 |
-
}
|
113 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace Cleantalk\Antispam;
|
5 |
+
|
6 |
+
|
7 |
+
class Integrations
|
8 |
+
{
|
9 |
+
|
10 |
+
private $integrations = array();
|
11 |
+
|
12 |
+
private $integration;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Integrations constructor.
|
16 |
+
*
|
17 |
+
* @param array $integrations
|
18 |
+
* @param array $settings
|
19 |
+
*/
|
20 |
+
public function __construct( $integrations, $settings )
|
21 |
+
{
|
22 |
+
$this->integrations = $integrations;
|
23 |
+
|
24 |
+
foreach( $this->integrations as $integration_name => $integration_info ){
|
25 |
+
|
26 |
+
if( empty( $settings[ $integration_info['setting'] ] ) )
|
27 |
+
continue;
|
28 |
+
|
29 |
+
if( $integration_info['ajax'] ) {
|
30 |
+
if( is_array( $integration_info['hook'] ) ) {
|
31 |
+
foreach( $integration_info['hook'] as $hook ) {
|
32 |
+
add_action( 'wp_ajax_' . $hook, array( $this, 'checkSpam' ), 1 );
|
33 |
+
add_action( 'wp_ajax_nopriv_' . $hook, array( $this, 'checkSpam' ), 1 );
|
34 |
+
}
|
35 |
+
} else {
|
36 |
+
add_action( 'wp_ajax_' . $integration_info['hook'], array( $this, 'checkSpam' ), 1 );
|
37 |
+
add_action( 'wp_ajax_nopriv_' . $integration_info['hook'], array( $this, 'checkSpam' ), 1 );
|
38 |
+
}
|
39 |
+
} else {
|
40 |
+
add_action( $integration_info['hook'], array( $this, 'checkSpam' ) );
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
public function checkSpam( $argument )
|
46 |
+
{
|
47 |
+
global $cleantalk_executed;
|
48 |
+
|
49 |
+
// Getting current integration name
|
50 |
+
$current_integration = $this->get_current_integration_triggered( current_filter() );
|
51 |
+
if( $current_integration ) {
|
52 |
+
// Instantiate the integration object
|
53 |
+
$class = '\\Cleantalk\\Antispam\\Integrations\\' . $current_integration;
|
54 |
+
if( class_exists( $class )) {
|
55 |
+
$this->integration = new $class();
|
56 |
+
if( ! ( $this->integration instanceof \Cleantalk\Antispam\Integrations\IntegrationBase ) ) {
|
57 |
+
// @ToDo have to handle an error
|
58 |
+
do_action( 'apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, array('Integration is not instanse of IntegrationBase class.') );
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
// Run data collecting for spam checking
|
62 |
+
$data = $this->integration->getDataForChecking( $argument );
|
63 |
+
if( ! is_null( $data ) ) {
|
64 |
+
// Go spam checking
|
65 |
+
$base_call_result = apbct_base_call(
|
66 |
+
array(
|
67 |
+
'message' => !empty( $data['message'] ) ? json_encode( $data['message'] ) : '',
|
68 |
+
'sender_email' => !empty( $data['email'] ) ? $data['email'] : '',
|
69 |
+
'sender_nickname' => !empty( $data['nickname'] ) ? $data['nickname'] : '',
|
70 |
+
'post_info' => array(
|
71 |
+
'comment_type' => 'contact_form_wordpress_' . strtolower($current_integration),
|
72 |
+
'post_url' => apbct_get_server_variable( 'HTTP_REFERER' ), // Page URL must be an previous page
|
73 |
+
),
|
74 |
+
),
|
75 |
+
isset( $data['register'] ) ? true : false
|
76 |
+
);
|
77 |
+
|
78 |
+
$ct_result = $base_call_result['ct_result'];
|
79 |
+
|
80 |
+
$cleantalk_executed = true;
|
81 |
+
|
82 |
+
if ($ct_result->allow == 0) {
|
83 |
+
// Do blocking if it is a spam
|
84 |
+
$this->integration->doBlock( $ct_result->comment );
|
85 |
+
}
|
86 |
+
} else {
|
87 |
+
// @ToDo have to handle an error
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
private function get_current_integration_triggered( $hook )
|
95 |
+
{
|
96 |
+
if( $hook !== false ) {
|
97 |
+
foreach( $this->integrations as $integration_name => $integration_info ) {
|
98 |
+
if( is_array( $integration_info['hook'] ) ) {
|
99 |
+
foreach( $integration_info['hook'] as $integration_hook ) {
|
100 |
+
if( strpos( $hook, $integration_hook ) !== false ) {
|
101 |
+
return $integration_name;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
} else {
|
105 |
+
if( strpos( $hook, $integration_info['hook'] ) !== false ) {
|
106 |
+
return $integration_name;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
return false;
|
112 |
+
}
|
113 |
}
|
@@ -1,23 +1,23 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace Cleantalk\Antispam\Integrations;
|
5 |
-
|
6 |
-
|
7 |
-
class ContactBank extends IntegrationBase
|
8 |
-
{
|
9 |
-
|
10 |
-
function getDataForChecking( $argument )
|
11 |
-
{
|
12 |
-
if( isset( $_REQUEST['param'] ) ) {
|
13 |
-
parse_str( isset( $_REQUEST['data'] ) ? base64_decode( $_REQUEST['data'] ) : '', $form_data );
|
14 |
-
return ct_get_fields_any($form_data);
|
15 |
-
}
|
16 |
-
return null;
|
17 |
-
}
|
18 |
-
|
19 |
-
function doBlock( $message )
|
20 |
-
{
|
21 |
-
die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $message,)), JSON_HEX_QUOT | JSON_HEX_TAG));
|
22 |
-
}
|
23 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace Cleantalk\Antispam\Integrations;
|
5 |
+
|
6 |
+
|
7 |
+
class ContactBank extends IntegrationBase
|
8 |
+
{
|
9 |
+
|
10 |
+
function getDataForChecking( $argument )
|
11 |
+
{
|
12 |
+
if( isset( $_REQUEST['param'] ) ) {
|
13 |
+
parse_str( isset( $_REQUEST['data'] ) ? base64_decode( $_REQUEST['data'] ) : '', $form_data );
|
14 |
+
return ct_get_fields_any($form_data);
|
15 |
+
}
|
16 |
+
return null;
|
17 |
+
}
|
18 |
+
|
19 |
+
function doBlock( $message )
|
20 |
+
{
|
21 |
+
die(json_encode(array('apbct' => array('blocked' => true, 'comment' => $message,)), JSON_HEX_QUOT | JSON_HEX_TAG));
|
22 |
+
}
|
23 |
}
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace Cleantalk\Antispam\Integrations;
|
5 |
+
|
6 |
+
|
7 |
+
class EaelLoginRegister extends IntegrationBase {
|
8 |
+
|
9 |
+
public function getDataForChecking( $argument ) {
|
10 |
+
$data = ct_get_fields_any( $_POST );
|
11 |
+
$data['register'] = true;
|
12 |
+
return $data;
|
13 |
+
}
|
14 |
+
|
15 |
+
public function doBlock( $message ) {
|
16 |
+
global $ct_comment;
|
17 |
+
$ct_comment = $message;
|
18 |
+
ct_die( null, null );
|
19 |
+
}
|
20 |
+
}
|
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace Cleantalk\Antispam\Integrations;
|
5 |
-
|
6 |
-
|
7 |
-
class FluentForm extends IntegrationBase
|
8 |
-
{
|
9 |
-
|
10 |
-
function getDataForChecking( $argument )
|
11 |
-
{
|
12 |
-
if( isset( $_POST['data'] ) ) {
|
13 |
-
parse_str( $_POST['data'], $form_data );
|
14 |
-
return ct_get_fields_any($form_data);
|
15 |
-
}
|
16 |
-
return null;
|
17 |
-
}
|
18 |
-
|
19 |
-
function doBlock($message)
|
20 |
-
{
|
21 |
-
wp_send_json(
|
22 |
-
array(
|
23 |
-
'errors' => array(
|
24 |
-
'restricted' => array(
|
25 |
-
$message
|
26 |
-
)
|
27 |
-
)
|
28 |
-
), 422
|
29 |
-
);
|
30 |
-
}
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace Cleantalk\Antispam\Integrations;
|
5 |
+
|
6 |
+
|
7 |
+
class FluentForm extends IntegrationBase
|
8 |
+
{
|
9 |
+
|
10 |
+
function getDataForChecking( $argument )
|
11 |
+
{
|
12 |
+
if( isset( $_POST['data'] ) ) {
|
13 |
+
parse_str( $_POST['data'], $form_data );
|
14 |
+
return ct_get_fields_any($form_data);
|
15 |
+
}
|
16 |
+
return null;
|
17 |
+
}
|
18 |
+
|
19 |
+
function doBlock($message)
|
20 |
+
{
|
21 |
+
wp_send_json(
|
22 |
+
array(
|
23 |
+
'errors' => array(
|
24 |
+
'restricted' => array(
|
25 |
+
$message
|
26 |
+
)
|
27 |
+
)
|
28 |
+
), 422
|
29 |
+
);
|
30 |
+
}
|
31 |
}
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace Cleantalk\Antispam\Integrations;
|
5 |
+
|
6 |
+
|
7 |
+
class HappyForm extends IntegrationBase {
|
8 |
+
|
9 |
+
public function getDataForChecking( $argument ) {
|
10 |
+
if( isset( $_POST['happyforms_form_id'] ) ) {
|
11 |
+
$data = array();
|
12 |
+
foreach( $_POST as $key => $value ) {
|
13 |
+
if( strpos( $key, $_POST['happyforms_form_id'] ) !== false ) {
|
14 |
+
$data[$key] = $value;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
return ! empty( $data ) ? ct_get_fields_any($data) : null;
|
18 |
+
}
|
19 |
+
return null;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function doBlock( $message ) {
|
23 |
+
|
24 |
+
add_filter( 'happyforms_validate_submission', function( $is_valid, $request, $form ){
|
25 |
+
return false;
|
26 |
+
}, 1, 3 );
|
27 |
+
|
28 |
+
}
|
29 |
+
}
|
@@ -1,11 +1,11 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace Cleantalk\Antispam\Integrations;
|
5 |
-
|
6 |
-
|
7 |
-
abstract class IntegrationBase
|
8 |
-
{
|
9 |
-
abstract function getDataForChecking( $argument );
|
10 |
-
abstract function doBlock( $message );
|
11 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
namespace Cleantalk\Antispam\Integrations;
|
5 |
+
|
6 |
+
|
7 |
+
abstract class IntegrationBase
|
8 |
+
{
|
9 |
+
abstract public function getDataForChecking( $argument );
|
10 |
+
abstract public function doBlock( $message );
|
11 |
}
|
@@ -493,6 +493,9 @@ class UsersChecker extends Checker
|
|
493 |
'key' => 'ct_marked_as_spam',
|
494 |
'compare' => '1'
|
495 |
),
|
|
|
|
|
|
|
496 |
),
|
497 |
'orderby' => 'registered',
|
498 |
'order' => 'ASC',
|
493 |
'key' => 'ct_marked_as_spam',
|
494 |
'compare' => '1'
|
495 |
),
|
496 |
+
array(
|
497 |
+
'key' => 'ct_checked_now'
|
498 |
+
),
|
499 |
),
|
500 |
'orderby' => 'registered',
|
501 |
'order' => 'ASC',
|
@@ -94,6 +94,49 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
94 |
return array('error' => 'UAL_UPDATE_ERROR: '. $lines['error'] );
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
private static function clear_data_table($db, $db__table__data) {
|
98 |
|
99 |
$db->execute( "TRUNCATE TABLE {$db__table__data};" );
|
@@ -164,7 +207,7 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
164 |
}
|
165 |
|
166 |
// Skip by cookie
|
167 |
-
if( Cookie::get('
|
168 |
if( Cookie::get( 'apbct_anticrawler_passed' ) == 1 ){
|
169 |
if( ! headers_sent() )
|
170 |
Cookie::set( 'apbct_anticrawler_passed', '0', time() - 86400, '/', null, null, true, 'Lax' );
|
@@ -192,7 +235,7 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
192 |
);
|
193 |
if( isset( $result['ip'] ) ){
|
194 |
|
195 |
-
if( Cookie::get('
|
196 |
|
197 |
$results[] = array( 'ip' => $current_ip, 'is_personal' => false, 'status' => 'DENY_ANTICRAWLER', );
|
198 |
|
@@ -211,7 +254,7 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
211 |
|
212 |
}else{
|
213 |
|
214 |
-
if( ! Cookie::get('
|
215 |
add_action( 'template_redirect', array( & $this, 'update_ac_log' ), 999 );
|
216 |
}
|
217 |
|
@@ -252,7 +295,7 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
252 |
|
253 |
public static function set_cookie(){
|
254 |
global $apbct;
|
255 |
-
echo '<script>var ctSecure = location.protocol === "https:" ? "; secure" : ""; document.cookie = "
|
256 |
}
|
257 |
|
258 |
/**
|
@@ -281,7 +324,9 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
281 |
blocked_entries = " . ( strpos( $status, 'DENY' ) !== false ? 1 : 0 ) . ",
|
282 |
entries_timestamp = '" . intval( $time ) . "',
|
283 |
ua_id = " . $this->ua_id . ",
|
284 |
-
ua_name = %s
|
|
|
|
|
285 |
ON DUPLICATE KEY
|
286 |
UPDATE
|
287 |
status = '$status',
|
@@ -289,9 +334,20 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule{
|
|
289 |
blocked_entries = blocked_entries" . ( strpos( $status, 'DENY' ) !== false ? ' + 1' : '' ) . ",
|
290 |
entries_timestamp = '" . intval( $time ) . "',
|
291 |
ua_id = " . $this->ua_id . ",
|
292 |
-
ua_name = %s
|
293 |
-
|
294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
$this->db->execute( $this->db->get_query() );
|
296 |
}
|
297 |
|
94 |
return array('error' => 'UAL_UPDATE_ERROR: '. $lines['error'] );
|
95 |
}
|
96 |
|
97 |
+
public static function direct_update( array $useragents ) {
|
98 |
+
|
99 |
+
$result__clear_db = self::clear_data_table( \Cleantalk\ApbctWP\DB::getInstance(), APBCT_TBL_AC_UA_BL );
|
100 |
+
|
101 |
+
if( empty( $result__clear_db['error'] ) ){
|
102 |
+
|
103 |
+
for( $count_result = 0; current($useragents) !== false; ) {
|
104 |
+
|
105 |
+
$query = "INSERT INTO " . APBCT_TBL_AC_UA_BL . " (id, ua_template, ua_status) VALUES ";
|
106 |
+
|
107 |
+
for( $i = 0, $values = array(); APBCT_WRITE_LIMIT !== $i && current( $useragents ) !== false; $i ++, $count_result ++, next( $useragents ) ){
|
108 |
+
|
109 |
+
$entry = current($useragents);
|
110 |
+
|
111 |
+
if(empty($entry))
|
112 |
+
continue;
|
113 |
+
|
114 |
+
if ( APBCT_WRITE_LIMIT !== $i ) {
|
115 |
+
|
116 |
+
// Cast result to int
|
117 |
+
// @ToDo check the output $entry
|
118 |
+
$ua_id = preg_replace('/[^\d]*/', '', $entry[0]);
|
119 |
+
$ua_template = isset($entry[1]) && apbct_is_regexp($entry[1]) ? Helper::db__prepare_param( $entry[1] ) : 0;
|
120 |
+
$ua_status = isset($entry[2]) ? $entry[2] : 0;
|
121 |
+
|
122 |
+
}
|
123 |
+
|
124 |
+
$values[] = '('. $ua_id .','. $ua_template .','. $ua_status .')';
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
if( ! empty( $values ) ){
|
129 |
+
$query = $query . implode( ',', $values ) . ';';
|
130 |
+
\Cleantalk\ApbctWP\DB::getInstance()->execute( $query );
|
131 |
+
}
|
132 |
+
|
133 |
+
}
|
134 |
+
return $count_result;
|
135 |
+
}else
|
136 |
+
return $result__clear_db;
|
137 |
+
|
138 |
+
}
|
139 |
+
|
140 |
private static function clear_data_table($db, $db__table__data) {
|
141 |
|
142 |
$db->execute( "TRUNCATE TABLE {$db__table__data};" );
|
207 |
}
|
208 |
|
209 |
// Skip by cookie
|
210 |
+
if( Cookie::get('wordpress_apbct_antibot') == hash( 'sha256', $this->api_key . $this->apbct->data['salt'] ) ) {
|
211 |
if( Cookie::get( 'apbct_anticrawler_passed' ) == 1 ){
|
212 |
if( ! headers_sent() )
|
213 |
Cookie::set( 'apbct_anticrawler_passed', '0', time() - 86400, '/', null, null, true, 'Lax' );
|
235 |
);
|
236 |
if( isset( $result['ip'] ) ){
|
237 |
|
238 |
+
if( Cookie::get('wordpress_apbct_antibot') !== hash( 'sha256', $this->api_key . $this->apbct->data['salt'] ) ){
|
239 |
|
240 |
$results[] = array( 'ip' => $current_ip, 'is_personal' => false, 'status' => 'DENY_ANTICRAWLER', );
|
241 |
|
254 |
|
255 |
}else{
|
256 |
|
257 |
+
if( ! Cookie::get('wordpress_apbct_antibot') ) {
|
258 |
add_action( 'template_redirect', array( & $this, 'update_ac_log' ), 999 );
|
259 |
}
|
260 |
|
295 |
|
296 |
public static function set_cookie(){
|
297 |
global $apbct;
|
298 |
+
echo '<script>var ctSecure = location.protocol === "https:" ? "; secure" : ""; document.cookie = "wordpress_apbct_antibot=' . hash( 'sha256', $apbct->api_key . $apbct->data['salt'] ) . '; path=/; expires=0; samesite=lax" + ctSecure;</script>';
|
299 |
}
|
300 |
|
301 |
/**
|
324 |
blocked_entries = " . ( strpos( $status, 'DENY' ) !== false ? 1 : 0 ) . ",
|
325 |
entries_timestamp = '" . intval( $time ) . "',
|
326 |
ua_id = " . $this->ua_id . ",
|
327 |
+
ua_name = %s,
|
328 |
+
first_url = %s,
|
329 |
+
last_url = %s
|
330 |
ON DUPLICATE KEY
|
331 |
UPDATE
|
332 |
status = '$status',
|
334 |
blocked_entries = blocked_entries" . ( strpos( $status, 'DENY' ) !== false ? ' + 1' : '' ) . ",
|
335 |
entries_timestamp = '" . intval( $time ) . "',
|
336 |
ua_id = " . $this->ua_id . ",
|
337 |
+
ua_name = %s,
|
338 |
+
last_url = %s";
|
339 |
+
|
340 |
+
$this->db->prepare(
|
341 |
+
$query,
|
342 |
+
array(
|
343 |
+
Server::get('HTTP_USER_AGENT'),
|
344 |
+
substr( Server::get( 'HTTP_HOST' ) . Server::get( 'REQUEST_URI' ), 0, 100 ),
|
345 |
+
substr( Server::get( 'HTTP_HOST' ) . Server::get( 'REQUEST_URI' ), 0, 100 ),
|
346 |
+
|
347 |
+
Server::get('HTTP_USER_AGENT'),
|
348 |
+
substr( Server::get( 'HTTP_HOST' ) . Server::get( 'REQUEST_URI' ), 0, 100 ),
|
349 |
+
)
|
350 |
+
);
|
351 |
$this->db->execute( $this->db->get_query() );
|
352 |
}
|
353 |
|
@@ -86,9 +86,21 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
86 |
if( Cookie::get( 'ct_sfw_passed' ) ){
|
87 |
|
88 |
if( ! headers_sent() ){
|
89 |
-
\Cleantalk\ApbctWP\Variables\Cookie::set(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
} else {
|
91 |
-
$results[] = array(
|
|
|
|
|
|
|
|
|
92 |
}
|
93 |
|
94 |
// Do logging an one passed request
|
@@ -106,7 +118,11 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
106 |
}
|
107 |
|
108 |
if( $status ) {
|
109 |
-
$results[] = array(
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
|
112 |
return $results;
|
@@ -125,66 +141,93 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
125 |
$needles = array_unique( $needles );
|
126 |
|
127 |
$db_results = $this->db->fetch_all("SELECT
|
128 |
-
network, mask, status
|
129 |
FROM " . $this->db__table__data . "
|
130 |
WHERE network IN (". implode( ',', $needles ) .")
|
131 |
AND network = " . $current_ip_v4 . " & mask
|
132 |
AND " . rand( 1, 100000 ) . "
|
133 |
ORDER BY status DESC");
|
134 |
-
|
|
|
135 |
if( ! empty( $db_results ) ){
|
136 |
|
137 |
foreach( $db_results as $db_result ){
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
|
|
|
|
145 |
|
146 |
}
|
147 |
|
148 |
}else{
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
|
|
152 |
}
|
|
|
|
|
153 |
}
|
154 |
|
155 |
return $results;
|
156 |
}
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
|
|
166 |
|
167 |
$id = md5( $ip . $this->module_name );
|
168 |
$time = time();
|
169 |
-
|
170 |
-
$
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
$this->db->execute( $this->db->get_query() );
|
189 |
}
|
190 |
|
@@ -317,7 +360,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
317 |
* @return array|bool array('error' => STRING)
|
318 |
*/
|
319 |
public static function send_log( $db, $log_table, $ct_key, $use_delete_command ) {
|
320 |
-
|
321 |
//Getting logs
|
322 |
$query = "SELECT * FROM " . $log_table . ";";
|
323 |
$db->fetch_all( $query );
|
@@ -326,7 +369,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
326 |
|
327 |
//Compile logs
|
328 |
$data = array();
|
329 |
-
foreach( $db->result as $key =>
|
330 |
|
331 |
// Converting statuses to API format
|
332 |
$value['status'] = $value['status'] === 'DENY_ANTICRAWLER' ? 'BOT_PROTECTION' : $value['status'];
|
@@ -339,10 +382,24 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
339 |
$value['status'] = $value['status'] === 'DENY_ANTIFLOOD_UA' ? 'FLOOD_PROTECTION' : $value['status'];
|
340 |
$value['status'] = $value['status'] === 'PASS_ANTIFLOOD_UA' ? 'FLOOD_PROTECTION' : $value['status'];
|
341 |
|
342 |
-
$value['status'] = $value['status'] === 'PASS_SFW__BY_COOKIE' ?
|
343 |
-
$value['status'] = $value['status'] === 'PASS_SFW' ?
|
344 |
-
$value['status'] = $value['status'] === 'DENY_SFW' ?
|
345 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
$data[] = array(
|
347 |
trim( $value['ip'] ), // IP
|
348 |
$value['blocked_entries'], // Count showing of block pages
|
@@ -351,6 +408,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
351 |
$value['status'], // Status
|
352 |
$value['ua_name'], // User-Agent name
|
353 |
$value['ua_id'], // User-Agent ID
|
|
|
354 |
);
|
355 |
|
356 |
}
|
@@ -382,6 +440,66 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
382 |
return array( 'rows' => 0 );
|
383 |
}
|
384 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
|
386 |
/**
|
387 |
* Gets multifile with data to update Firewall.
|
@@ -434,7 +552,7 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
434 |
|
435 |
for( $count_result = 0; current($data) !== false; ) {
|
436 |
|
437 |
-
$query = "INSERT INTO ".$db__table__data." (network, mask, status) VALUES ";
|
438 |
|
439 |
for( $i = 0, $values = array(); APBCT_WRITE_LIMIT !== $i && current( $data ) !== false; $i ++, $count_result ++, next( $data ) ){
|
440 |
|
@@ -444,16 +562,16 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule {
|
|
444 |
continue;
|
445 |
|
446 |
if ( APBCT_WRITE_LIMIT !== $i ) {
|
447 |
-
|
448 |
// Cast result to int
|
449 |
-
$ip
|
450 |
-
$mask
|
451 |
-
$
|
|
|
452 |
|
|
|
453 |
}
|
454 |
|
455 |
-
$values[] = '('. $ip .','. $mask .','. $private .')';
|
456 |
-
|
457 |
}
|
458 |
|
459 |
if( ! empty( $values ) ){
|
86 |
if( Cookie::get( 'ct_sfw_passed' ) ){
|
87 |
|
88 |
if( ! headers_sent() ){
|
89 |
+
\Cleantalk\ApbctWP\Variables\Cookie::set(
|
90 |
+
'ct_sfw_passed',
|
91 |
+
'0',
|
92 |
+
time() + 86400 * 3,
|
93 |
+
'/',
|
94 |
+
null,
|
95 |
+
null,
|
96 |
+
true,
|
97 |
+
'Lax' );
|
98 |
} else {
|
99 |
+
$results[] = array(
|
100 |
+
'ip' => $current_ip,
|
101 |
+
'is_personal' => false,
|
102 |
+
'status' => 'PASS_SFW__BY_COOKIE'
|
103 |
+
);
|
104 |
}
|
105 |
|
106 |
// Do logging an one passed request
|
118 |
}
|
119 |
|
120 |
if( $status ) {
|
121 |
+
$results[] = array(
|
122 |
+
'ip' => $current_ip,
|
123 |
+
'is_personal' => false,
|
124 |
+
'status' => 'PASS_SFW__BY_WHITELIST'
|
125 |
+
);
|
126 |
}
|
127 |
|
128 |
return $results;
|
141 |
$needles = array_unique( $needles );
|
142 |
|
143 |
$db_results = $this->db->fetch_all("SELECT
|
144 |
+
network, mask, status, source
|
145 |
FROM " . $this->db__table__data . "
|
146 |
WHERE network IN (". implode( ',', $needles ) .")
|
147 |
AND network = " . $current_ip_v4 . " & mask
|
148 |
AND " . rand( 1, 100000 ) . "
|
149 |
ORDER BY status DESC");
|
150 |
+
|
151 |
+
|
152 |
if( ! empty( $db_results ) ){
|
153 |
|
154 |
foreach( $db_results as $db_result ){
|
155 |
+
|
156 |
+
$result_entry = array(
|
157 |
+
'ip' => $current_ip,
|
158 |
+
'network' => long2ip( $db_result['network'] ) . '/' . Helper::ip__mask__long_to_number( $db_result['mask'] ),
|
159 |
+
'is_personal' => $db_result['source'],
|
160 |
+
);
|
161 |
+
|
162 |
+
if( (int) $db_result['status'] === 1 ) { $result_entry['status'] = 'PASS_SFW__BY_WHITELIST'; break; }
|
163 |
+
if( (int) $db_result['status'] === 0 ) { $result_entry['status'] = 'DENY_SFW'; }
|
164 |
|
165 |
}
|
166 |
|
167 |
}else{
|
168 |
+
|
169 |
+
$result_entry = array(
|
170 |
+
'ip' => $current_ip,
|
171 |
+
'is_personal' => null,
|
172 |
+
'status' => 'PASS_SFW',
|
173 |
+
);
|
174 |
+
|
175 |
}
|
176 |
+
|
177 |
+
$results[] = $result_entry;
|
178 |
}
|
179 |
|
180 |
return $results;
|
181 |
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Add entry to SFW log.
|
185 |
+
* Writes to database.
|
186 |
+
*
|
187 |
+
* @param string $ip
|
188 |
+
* @param $status
|
189 |
+
* @param string $network
|
190 |
+
* @param string $source
|
191 |
+
*/
|
192 |
+
public function update_log( $ip, $status, $network = 'NULL', $source = 'NULL' ) {
|
193 |
|
194 |
$id = md5( $ip . $this->module_name );
|
195 |
$time = time();
|
196 |
+
|
197 |
+
$this->db->prepare( "INSERT INTO " . $this->db__table__logs . "
|
198 |
+
SET
|
199 |
+
id = '$id',
|
200 |
+
ip = '$ip',
|
201 |
+
status = '$status',
|
202 |
+
all_entries = 1,
|
203 |
+
blocked_entries = " . ( strpos( $status, 'DENY' ) !== false ? 1 : 0 ) . ",
|
204 |
+
entries_timestamp = '" . $time . "',
|
205 |
+
ua_name = %s,
|
206 |
+
source = $source,
|
207 |
+
network = %s,
|
208 |
+
first_url = %s,
|
209 |
+
last_url = %s
|
210 |
+
ON DUPLICATE KEY
|
211 |
+
UPDATE
|
212 |
+
status = '$status',
|
213 |
+
source = $source,
|
214 |
+
all_entries = all_entries + 1,
|
215 |
+
blocked_entries = blocked_entries" . ( strpos( $status, 'DENY' ) !== false ? ' + 1' : '' ) . ",
|
216 |
+
entries_timestamp = '" . intval( $time ) . "',
|
217 |
+
ua_name = %s,
|
218 |
+
network = %s,
|
219 |
+
last_url = %s",
|
220 |
+
array(
|
221 |
+
Server::get('HTTP_USER_AGENT'),
|
222 |
+
$network,
|
223 |
+
substr( Server::get( 'HTTP_HOST' ) . Server::get( 'REQUEST_URI' ), 0, 100 ),
|
224 |
+
substr( Server::get( 'HTTP_HOST' ) . Server::get( 'REQUEST_URI' ), 0, 100 ),
|
225 |
+
|
226 |
+
Server::get('HTTP_USER_AGENT') ,
|
227 |
+
$network,
|
228 |
+
substr( Server::get( 'HTTP_HOST' ) . Server::get( 'REQUEST_URI' ), 0, 100 ),
|
229 |
+
)
|
230 |
+
);
|
231 |
$this->db->execute( $this->db->get_query() );
|
232 |
}
|
233 |
|
360 |
* @return array|bool array('error' => STRING)
|
361 |
*/
|
362 |
public static function send_log( $db, $log_table, $ct_key, $use_delete_command ) {
|
363 |
+
|
364 |
//Getting logs
|
365 |
$query = "SELECT * FROM " . $log_table . ";";
|
366 |
$db->fetch_all( $query );
|
369 |
|
370 |
//Compile logs
|
371 |
$data = array();
|
372 |
+
foreach( $db->result as $key => &$value ){
|
373 |
|
374 |
// Converting statuses to API format
|
375 |
$value['status'] = $value['status'] === 'DENY_ANTICRAWLER' ? 'BOT_PROTECTION' : $value['status'];
|
382 |
$value['status'] = $value['status'] === 'DENY_ANTIFLOOD_UA' ? 'FLOOD_PROTECTION' : $value['status'];
|
383 |
$value['status'] = $value['status'] === 'PASS_ANTIFLOOD_UA' ? 'FLOOD_PROTECTION' : $value['status'];
|
384 |
|
385 |
+
$value['status'] = $value['status'] === 'PASS_SFW__BY_COOKIE' ? 'DB_MATCH' : $value['status'];
|
386 |
+
$value['status'] = $value['status'] === 'PASS_SFW' ? 'DB_MATCH' : $value['status'];
|
387 |
+
$value['status'] = $value['status'] === 'DENY_SFW' ? 'DB_MATCH' : $value['status'];
|
388 |
+
|
389 |
+
$value['status'] = $value['source'] ? 'PERSONAL_LIST_MATCH' : $value['status'];
|
390 |
+
|
391 |
+
$additional = array();
|
392 |
+
if( $value['network'] ){
|
393 |
+
$additional['nd'] = $value['network'];
|
394 |
+
}
|
395 |
+
if( $value['first_url'] ){
|
396 |
+
$additional['fu'] = $value['first_url'];
|
397 |
+
}
|
398 |
+
if( $value['last_url'] ){
|
399 |
+
$additional['lu'] = $value['last_url'];
|
400 |
+
}
|
401 |
+
$additional = $additional ?: 'EMPTY_ASSOCIATIVE_ARRAY';
|
402 |
+
|
403 |
$data[] = array(
|
404 |
trim( $value['ip'] ), // IP
|
405 |
$value['blocked_entries'], // Count showing of block pages
|
408 |
$value['status'], // Status
|
409 |
$value['ua_name'], // User-Agent name
|
410 |
$value['ua_id'], // User-Agent ID
|
411 |
+
$additional // Network, first URL, last URL
|
412 |
);
|
413 |
|
414 |
}
|
440 |
return array( 'rows' => 0 );
|
441 |
}
|
442 |
}
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Gets multifile with data to update Firewall.
|
446 |
+
*
|
447 |
+
* @param string $api_key API key
|
448 |
+
*
|
449 |
+
* @return array
|
450 |
+
*/
|
451 |
+
public static function direct_update__get_db( $api_key ){
|
452 |
+
|
453 |
+
// Getting remote file name
|
454 |
+
$result = API::method__get_2s_blacklists_db( $api_key, null, '3_0' );
|
455 |
+
|
456 |
+
if( empty( $result['error'] ) ){
|
457 |
+
|
458 |
+
return array(
|
459 |
+
'blacklist' => $result['data'],
|
460 |
+
'useragents' => $result['data_user_agents'],
|
461 |
+
);
|
462 |
+
|
463 |
+
}else
|
464 |
+
return $result;
|
465 |
+
}
|
466 |
+
|
467 |
+
public static function direct_update( $db, $db__table__data, array $blacklists ){
|
468 |
+
|
469 |
+
for( $count_result = 0; current($blacklists) !== false; ) {
|
470 |
+
|
471 |
+
$query = "INSERT INTO ".$db__table__data." (network, mask, status) VALUES ";
|
472 |
+
|
473 |
+
for( $i = 0, $values = array(); APBCT_WRITE_LIMIT !== $i && current( $blacklists ) !== false; $i ++, $count_result ++, next( $blacklists ) ){
|
474 |
+
|
475 |
+
$entry = current($blacklists);
|
476 |
+
|
477 |
+
if(empty($entry))
|
478 |
+
continue;
|
479 |
+
|
480 |
+
if ( APBCT_WRITE_LIMIT !== $i ) {
|
481 |
+
|
482 |
+
// Cast result to int
|
483 |
+
$ip = preg_replace('/[^\d]*/', '', $entry[0]);
|
484 |
+
$mask = preg_replace('/[^\d]*/', '', $entry[1]);
|
485 |
+
$private = isset($entry[2]) ? $entry[2] : 0;
|
486 |
+
|
487 |
+
}
|
488 |
+
|
489 |
+
$values[] = '('. $ip .','. $mask .','. $private .')';
|
490 |
+
|
491 |
+
}
|
492 |
+
|
493 |
+
if( ! empty( $values ) ){
|
494 |
+
$query .= implode( ',', $values ) . ';';
|
495 |
+
$db->execute( $query );
|
496 |
+
}
|
497 |
+
|
498 |
+
}
|
499 |
+
|
500 |
+
return $count_result;
|
501 |
+
|
502 |
+
}
|
503 |
|
504 |
/**
|
505 |
* Gets multifile with data to update Firewall.
|
552 |
|
553 |
for( $count_result = 0; current($data) !== false; ) {
|
554 |
|
555 |
+
$query = "INSERT INTO ".$db__table__data." (network, mask, status, source) VALUES ";
|
556 |
|
557 |
for( $i = 0, $values = array(); APBCT_WRITE_LIMIT !== $i && current( $data ) !== false; $i ++, $count_result ++, next( $data ) ){
|
558 |
|
562 |
continue;
|
563 |
|
564 |
if ( APBCT_WRITE_LIMIT !== $i ) {
|
565 |
+
|
566 |
// Cast result to int
|
567 |
+
$ip = preg_replace( '/[^\d]*/', '', $entry[0] );
|
568 |
+
$mask = preg_replace( '/[^\d]*/', '', $entry[1] );
|
569 |
+
$status = isset( $entry[2] ) ? $entry[2] : 0;
|
570 |
+
$source = isset( $entry[3] ) ? (int) $entry[3] : 'NULL';
|
571 |
|
572 |
+
$values[] = '('. $ip .','. $mask .','. $status .','. $source .')';
|
573 |
}
|
574 |
|
|
|
|
|
575 |
}
|
576 |
|
577 |
if( ! empty( $values ) ){
|
@@ -231,7 +231,7 @@
|
|
231 |
document.getElementById('curr_date').innerHTML = ct_date.toGMTString();
|
232 |
|
233 |
setTimeout( function(){
|
234 |
-
set_spamFireWallCookie('
|
235 |
set_spamFireWallCookie('apbct_anticrawler_passed','{COOKIE_ANTICRAWLER_PASSED}');
|
236 |
}, 2500 );
|
237 |
|
231 |
document.getElementById('curr_date').innerHTML = ct_date.toGMTString();
|
232 |
|
233 |
setTimeout( function(){
|
234 |
+
set_spamFireWallCookie('wordpress_apbct_antibot', '{COOKIE_ANTICRAWLER}');
|
235 |
set_spamFireWallCookie('apbct_anticrawler_passed','{COOKIE_ANTICRAWLER_PASSED}');
|
236 |
}, 2500 );
|
237 |
|
@@ -139,7 +139,7 @@ class Helper extends \Cleantalk\Common\Helper
|
|
139 |
|
140 |
// Considering empty response as error
|
141 |
if( $result === '' ){
|
142 |
-
$result = array( 'error' => 'EMPTY_RESPONSE' );
|
143 |
|
144 |
// Wrap and pass error
|
145 |
}elseif( ! empty( $result['error'] ) ){
|
139 |
|
140 |
// Considering empty response as error
|
141 |
if( $result === '' ){
|
142 |
+
$result = array( 'error' => 'WRONG_SITE_RESPONSE TEST ACTION : ' . $rc_action . ' ERROR: EMPTY_RESPONSE' );
|
143 |
|
144 |
// Wrap and pass error
|
145 |
}elseif( ! empty( $result['error'] ) ){
|
@@ -133,13 +133,8 @@ class RemoteCalls
|
|
133 |
$apbct->error_toggle( ! empty( $result['error'] ), 'sfw_update', $result);
|
134 |
|
135 |
if( ! empty( $result['error'] ) ){
|
136 |
-
|
137 |
-
|
138 |
-
SFW::data_tables__delete( DB::getInstance(), APBCT_TBL_FIREWALL_DATA . '_temp' );
|
139 |
-
|
140 |
-
$apbct->fw_stats['firewall_update_percent'] = 0;
|
141 |
-
$apbct->fw_stats['firewall_updating_id'] = null;
|
142 |
-
$apbct->save( 'fw_stats' );
|
143 |
|
144 |
die( 'FAIL ' . json_encode( array( 'error' => $result['error'] ) ) );
|
145 |
}
|
133 |
$apbct->error_toggle( ! empty( $result['error'] ), 'sfw_update', $result);
|
134 |
|
135 |
if( ! empty( $result['error'] ) ){
|
136 |
+
|
137 |
+
apbct_sfw_update__cleanData();
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
die( 'FAIL ' . json_encode( array( 'error' => $result['error'] ) ) );
|
140 |
}
|
@@ -94,6 +94,7 @@ class State
|
|
94 |
'comments__remove_comments_links' => 0, // Removes links from approved comments
|
95 |
'comments__show_check_links' => 1, // Shows check link to Cleantalk's DB.
|
96 |
'comments__manage_comments_on_public_page' => 0, // Allows to control comments on public page.
|
|
|
97 |
|
98 |
// Data processing
|
99 |
'data__protect_logged_in' => 1, // Do anti-spam tests to for logged in users.
|
@@ -103,6 +104,7 @@ class State
|
|
103 |
'data__set_cookies' => 1, // Set cookies: Disable - 0 / Enable - 1 / Use Alternative cookies - 2.
|
104 |
'data__set_cookies__alt_sessions_type' => 1, // Alternative cookies handler type: REST API - 1 / AJAX - 2
|
105 |
'data__ssl_on' => 0, // Secure connection to servers
|
|
|
106 |
|
107 |
// Exclusions
|
108 |
'exclusions__urls' => '',
|
94 |
'comments__remove_comments_links' => 0, // Removes links from approved comments
|
95 |
'comments__show_check_links' => 1, // Shows check link to Cleantalk's DB.
|
96 |
'comments__manage_comments_on_public_page' => 0, // Allows to control comments on public page.
|
97 |
+
'comments__hide_website_field' => 0, // Hide website field from comment form
|
98 |
|
99 |
// Data processing
|
100 |
'data__protect_logged_in' => 1, // Do anti-spam tests to for logged in users.
|
104 |
'data__set_cookies' => 1, // Set cookies: Disable - 0 / Enable - 1 / Use Alternative cookies - 2.
|
105 |
'data__set_cookies__alt_sessions_type' => 1, // Alternative cookies handler type: REST API - 1 / AJAX - 2
|
106 |
'data__ssl_on' => 0, // Secure connection to servers
|
107 |
+
'data__pixel' => '0',
|
108 |
|
109 |
// Exclusions
|
110 |
'exclusions__urls' => '',
|
@@ -254,6 +254,8 @@ class API
|
|
254 |
'rows' => count($data),
|
255 |
'timestamp' => time()
|
256 |
);
|
|
|
|
|
257 |
|
258 |
$result = static::send_request($request);
|
259 |
$result = $do_check ? static::check_response($result, 'sfw_logs') : $result;
|
@@ -907,6 +909,12 @@ class API
|
|
907 |
? true
|
908 |
: array( 'error' => 'COULDNT_ADD_WL_IP');
|
909 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
910 |
|
911 |
default:
|
912 |
return isset($result['data']) && is_array($result['data'])
|
254 |
'rows' => count($data),
|
255 |
'timestamp' => time()
|
256 |
);
|
257 |
+
|
258 |
+
$request['data'] = str_replace( '"EMPTY_ASSOCIATIVE_ARRAY"', '{}', $request['data'] );
|
259 |
|
260 |
$result = static::send_request($request);
|
261 |
$result = $do_check ? static::check_response($result, 'sfw_logs') : $result;
|
909 |
? true
|
910 |
: array( 'error' => 'COULDNT_ADD_WL_IP');
|
911 |
break;
|
912 |
+
|
913 |
+
case '2s_blacklists_db':
|
914 |
+
return isset( $result['data'] ) && isset( $result['data_user_agents'] )
|
915 |
+
? $result
|
916 |
+
: $result['data'];
|
917 |
+
break;
|
918 |
|
919 |
default:
|
920 |
return isset($result['data']) && is_array($result['data'])
|
@@ -29,9 +29,10 @@ class DNS {
|
|
29 |
|
30 |
// Get DNS records about URL
|
31 |
if( function_exists( 'dns_get_record' ) ){
|
|
|
32 |
$records = $type
|
33 |
-
? dns_get_record( $host, $type )
|
34 |
-
: dns_get_record( $host );
|
35 |
if( $records !== false ){
|
36 |
$servers = array();
|
37 |
foreach( $records as $server ){
|
29 |
|
30 |
// Get DNS records about URL
|
31 |
if( function_exists( 'dns_get_record' ) ){
|
32 |
+
// Localhosts generates errors. block these by @
|
33 |
$records = $type
|
34 |
+
? @dns_get_record( $host, $type )
|
35 |
+
: @dns_get_record( $host );
|
36 |
if( $records !== false ){
|
37 |
$servers = array();
|
38 |
foreach( $records as $server ){
|
@@ -133,7 +133,12 @@ class Firewall
|
|
133 |
if( in_array( $result['status'], array( 'PASS_SFW__BY_WHITELIST', 'PASS_SFW', 'PASS_ANTIFLOOD', 'PASS_ANTICRAWLER', 'PASS_ANTICRAWLER_UA', 'PASS_ANTIFLOOD_UA' ) ) ){
|
134 |
continue;
|
135 |
}
|
136 |
-
$module->update_log(
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
138 |
}
|
139 |
}
|
133 |
if( in_array( $result['status'], array( 'PASS_SFW__BY_WHITELIST', 'PASS_SFW', 'PASS_ANTIFLOOD', 'PASS_ANTICRAWLER', 'PASS_ANTICRAWLER_UA', 'PASS_ANTIFLOOD_UA' ) ) ){
|
134 |
continue;
|
135 |
}
|
136 |
+
$module->update_log(
|
137 |
+
$result['ip'],
|
138 |
+
$result['status'],
|
139 |
+
isset( $result['network'] ) ? $result['network'] : null,
|
140 |
+
isset( $result['is_personal'] ) ? $result['is_personal'] : null
|
141 |
+
);
|
142 |
}
|
143 |
}
|
144 |
}
|
@@ -15,7 +15,10 @@ namespace Cleantalk\Common\Firewall;
|
|
15 |
abstract class FirewallModule_abstract {
|
16 |
|
17 |
public $module_name;
|
18 |
-
|
|
|
|
|
|
|
19 |
protected $db;
|
20 |
protected $db__table__logs;
|
21 |
protected $db__table__data;
|
15 |
abstract class FirewallModule_abstract {
|
16 |
|
17 |
public $module_name;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var \Cleantalk\ApbctWP\DB
|
21 |
+
*/
|
22 |
protected $db;
|
23 |
protected $db__table__logs;
|
24 |
protected $db__table__data;
|
@@ -39,6 +39,19 @@ class Helper
|
|
39 |
'0:0:0:0:0:0:a:1/128', // ::ffff:127.0.0.1
|
40 |
),
|
41 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
/**
|
44 |
* @var array Set of CleanTalk servers
|
@@ -624,7 +637,7 @@ class Helper
|
|
624 |
return true;
|
625 |
}
|
626 |
|
627 |
-
if( $result
|
628 |
|
629 |
if( strpos( $result, PHP_EOL ) !== false && ! in_array( 'dont_split_to_array', $presets ) ){
|
630 |
$result = explode( PHP_EOL, $result );
|
@@ -932,7 +945,7 @@ class Helper
|
|
932 |
if(count($key_parts) > 0 and strlen($server_key) > 2){
|
933 |
foreach($key_parts as $part_index => $part){
|
934 |
|
935 |
-
if( $part_index === '' ){
|
936 |
continue;
|
937 |
}
|
938 |
|
39 |
'0:0:0:0:0:0:a:1/128', // ::ffff:127.0.0.1
|
40 |
),
|
41 |
);
|
42 |
+
|
43 |
+
public static $cleantalks_moderate_servers = array(
|
44 |
+
// MODERATE
|
45 |
+
'moderate1.cleantalk.org' => '162.243.144.175',
|
46 |
+
'moderate2.cleantalk.org' => '159.203.121.181',
|
47 |
+
'moderate3.cleantalk.org' => '88.198.153.60',
|
48 |
+
'moderate4.cleantalk.org' => '159.69.51.30',
|
49 |
+
'moderate5.cleantalk.org' => '95.216.200.119',
|
50 |
+
'moderate6.cleantalk.org' => '138.68.234.8',
|
51 |
+
// 'moderate7.cleantalk.org' => '168.119.82.149',
|
52 |
+
'moderate8.cleantalk.org' => '188.34.154.26',
|
53 |
+
'moderate9.cleantalk.org' => '51.81.55.251',
|
54 |
+
);
|
55 |
|
56 |
/**
|
57 |
* @var array Set of CleanTalk servers
|
637 |
return true;
|
638 |
}
|
639 |
|
640 |
+
if( $result !== false ){
|
641 |
|
642 |
if( strpos( $result, PHP_EOL ) !== false && ! in_array( 'dont_split_to_array', $presets ) ){
|
643 |
$result = explode( PHP_EOL, $result );
|
945 |
if(count($key_parts) > 0 and strlen($server_key) > 2){
|
946 |
foreach($key_parts as $part_index => $part){
|
947 |
|
948 |
+
if( $part_index === '' || $part === '' ){
|
949 |
continue;
|
950 |
}
|
951 |
|
@@ -15,6 +15,7 @@ class Schema
|
|
15 |
`network` int(11) unsigned NOT NULL,
|
16 |
`mask` int(11) unsigned NOT NULL,
|
17 |
`status` TINYINT(1) NOT NULL DEFAULT 0,
|
|
|
18 |
PRIMARY KEY (`id`),
|
19 |
INDEX ( `network` , `mask` )
|
20 |
);',
|
@@ -33,7 +34,11 @@ class Schema
|
|
33 |
`blocked_entries` INT NOT NULL,
|
34 |
`entries_timestamp` INT NOT NULL,
|
35 |
`ua_id` INT(11) NULL DEFAULT NULL,
|
36 |
-
`ua_name` VARCHAR(1024) NOT NULL,
|
|
|
|
|
|
|
|
|
37 |
PRIMARY KEY (`id`));',
|
38 |
'ac_logs' => 'CREATE TABLE IF NOT EXISTS `%scleantalk_ac_log` (
|
39 |
`id` VARCHAR(40) NOT NULL,
|
15 |
`network` int(11) unsigned NOT NULL,
|
16 |
`mask` int(11) unsigned NOT NULL,
|
17 |
`status` TINYINT(1) NOT NULL DEFAULT 0,
|
18 |
+
`source` TINYINT(1) NULL DEFAULT NULL,
|
19 |
PRIMARY KEY (`id`),
|
20 |
INDEX ( `network` , `mask` )
|
21 |
);',
|
34 |
`blocked_entries` INT NOT NULL,
|
35 |
`entries_timestamp` INT NOT NULL,
|
36 |
`ua_id` INT(11) NULL DEFAULT NULL,
|
37 |
+
`ua_name` VARCHAR(1024) NOT NULL,
|
38 |
+
`source` TINYINT(1) NULL DEFAULT NULL,
|
39 |
+
`network` VARCHAR(20) NULL DEFAULT NULL,
|
40 |
+
`first_url` VARCHAR(100) NULL DEFAULT NULL,
|
41 |
+
`last_url` VARCHAR(100) NULL DEFAULT NULL,
|
42 |
PRIMARY KEY (`id`));',
|
43 |
'ac_logs' => 'CREATE TABLE IF NOT EXISTS `%scleantalk_ac_log` (
|
44 |
`id` VARCHAR(40) NOT NULL,
|
@@ -3,8 +3,8 @@ Contributors: safronik
|
|
3 |
Tags: spam, antispam, anti-spam, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.7
|
6 |
-
Requires PHP: 5.
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -580,6 +580,55 @@ If your website has forms that send data to external sources, you can enable opt
|
|
580 |
|
581 |
== Changelog ==
|
582 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
= 5.157.2 May 05 2021 =
|
584 |
* Fix: Code. get_fields_any() notice fixed.
|
585 |
* Fix: Integration. Gravity Forms integration fixed.
|
3 |
Tags: spam, antispam, anti-spam, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.7
|
6 |
+
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.158
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
580 |
|
581 |
== Changelog ==
|
582 |
|
583 |
+
= 5.158 May 26 2021 =
|
584 |
+
* New. Integration. WP Foro register system integration.
|
585 |
+
* New. Integration. Elementor essentials LoginRegister integration implemented.
|
586 |
+
* New: SQL-schema and updater for extended SpamFirewall logs.
|
587 |
+
* New: Extended SpamFirewall logs.
|
588 |
+
* New: Pixel.
|
589 |
+
* Mod: Few improvements to SFW update.
|
590 |
+
* Mod: add settings for hidding website field from comment form.
|
591 |
+
* Mod: Few improvements to SFW update #2.
|
592 |
+
* Mod: Possibility to send empty JSON object in API.
|
593 |
+
* Mod: Extended SpamFirewall logs for AntiCrawler module.
|
594 |
+
* Upd: SFW. Direct updating method implemented.
|
595 |
+
* Upd. Settings. Network settings templates updated.
|
596 |
+
* Upd: Firewall. Improvements to update system.
|
597 |
+
* Upd: Firewall. Improvements to update system.
|
598 |
+
* Fix: replace wp_die to die in ct_die(), refactoring ct_die()
|
599 |
+
* Fix. Forms. Exclude field wp-editor-area from collecting visible fields.
|
600 |
+
* Fix. Widget. Widget content logic fixed.
|
601 |
+
* Fix: Forms. Nicknames detecting fixed #2.
|
602 |
+
* Fix: Forms. Getting check_js key fixed.
|
603 |
+
* Fix: update ct_die_extended() as ct_die().
|
604 |
+
* Fix. Code. Getting delay before js code get if async option enabled.
|
605 |
+
* Fix. WPMU. Blog id added in settings templates list.
|
606 |
+
* Fix. Integration. Elementor essentials LoginRegister login form protection skipped.
|
607 |
+
* Fix. WPMU. Blog id added in settings templates list.
|
608 |
+
* Fix. Readme. Required PHP version increased to 5.6.
|
609 |
+
* Fix. Updater. 5_157_10 updating fixed #2.
|
610 |
+
* Fix. JS. DOMContentLoaded used instead jQuery(document).ready().
|
611 |
+
* Fix: SpamFirewall. Update. "FW UPDATE INIT: KEY_EMPTY", "SFW UPDATE INIT: KEY_IS_NOT_VALID" errors.
|
612 |
+
* Fix. Users checker. Export to the csv fixed.
|
613 |
+
* Fix: SpamFirewall. Update. Error "WRONG_UPDATE_ID".
|
614 |
+
* Fix: SpamFirewall. Update. "FW UPDATE INIT: KEY_EMPTY", "SFW UPDATE INIT: KEY_IS_NOT_VALID" errors.
|
615 |
+
* Fix: SpamFirewall. Update. Error "WRONG_UPDATE_ID".
|
616 |
+
* Fix: \Cleantalk\Common\Helper::http__request() consider only boolean false (empty string '' considering as good) as bad response.
|
617 |
+
* Fix: SpamFirewall. Update.
|
618 |
+
* Fix: SpamFirewall. Update #2.
|
619 |
+
* Fix: WPMS empty apikey in options
|
620 |
+
* Fix: "Mod: add settings for hidding website field from comment form".
|
621 |
+
* Fix: Common/Helper::http__get_headers() fixed.
|
622 |
+
* Fix: SpamFirewall admin bar counter.
|
623 |
+
* Fix: "Fix: Common/Helper::http__get_headers() fixed."
|
624 |
+
* Fix: Pixel.
|
625 |
+
* Fix: "Pixel" setting description.
|
626 |
+
* Fix: Extended SpamFirewall logs for AntiCrawler module.
|
627 |
+
* Fix: Extended SpamFirewall logs for AntiCrawler module #2.
|
628 |
+
* Fix: WPFroms. PHP notice.
|
629 |
+
* Fix: Gravity Forms. PHP notice.
|
630 |
+
* Revert: Fix: Code. get_fields_any() notice fixed.
|
631 |
+
|
632 |
= 5.157.2 May 05 2021 =
|
633 |
* Fix: Code. get_fields_any() notice fixed.
|
634 |
* Fix: Integration. Gravity Forms integration fixed.
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang='en'>
|
3 |
+
<head>
|
4 |
+
<meta charset='utf-8' />
|
5 |
+
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
6 |
+
<meta http-equiv="cache-control" content="no-cache">
|
7 |
+
<meta http-equiv="cache-control" content="private">
|
8 |
+
<meta http-equiv="cache-control" content="max-age=0, must-revalidate">
|
9 |
+
<meta http-equiv="cache-control" content="max-age=0, proxy-revalidate">
|
10 |
+
<meta http-equiv="expires" content="0" />
|
11 |
+
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
|
12 |
+
<meta http-equiv="pragma" content="no-cache" />
|
13 |
+
|
14 |
+
<!--[if lt IE 9]>
|
15 |
+
<script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script>
|
16 |
+
<![endif]-->
|
17 |
+
<style>
|
18 |
+
html{font-size: 14pt;}
|
19 |
+
h1{text-align:center}
|
20 |
+
h1.main{margin-top: 1em;margin-bottom: 3em;}
|
21 |
+
div.container {text-align:center;}
|
22 |
+
div.container p.js_notice{width: 60%; display: inline-block;}
|
23 |
+
div.footer {color: #666; text-align: center;}
|
24 |
+
div.footer a {color: #666; vertical-align:bottom; text-align: center;}
|
25 |
+
.message {
|
26 |
+
margin-bottom: 40px;
|
27 |
+
}
|
28 |
+
|
29 |
+
html {
|
30 |
+
background: #f1f1f1;
|
31 |
+
}
|
32 |
+
body {
|
33 |
+
background: #fff;
|
34 |
+
border: 1px solid #ccd0d4;
|
35 |
+
color: #444;
|
36 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
37 |
+
margin: 2em auto;
|
38 |
+
padding: 1em 2em;
|
39 |
+
max-width: 700px;
|
40 |
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
|
41 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
|
42 |
+
}
|
43 |
+
h1 {
|
44 |
+
border-bottom: 1px solid #dadada;
|
45 |
+
clear: both;
|
46 |
+
color: #666;
|
47 |
+
font-size: 24px;
|
48 |
+
margin: 30px 0 0 0;
|
49 |
+
padding: 0;
|
50 |
+
padding-bottom: 7px;
|
51 |
+
}
|
52 |
+
#error-page {
|
53 |
+
margin-top: 50px;
|
54 |
+
}
|
55 |
+
#error-page p,
|
56 |
+
#error-page .wp-die-message {
|
57 |
+
font-size: 14px;
|
58 |
+
line-height: 1.5;
|
59 |
+
margin: 25px 0 20px;
|
60 |
+
}
|
61 |
+
#error-page code {
|
62 |
+
font-family: Consolas, Monaco, monospace;
|
63 |
+
}
|
64 |
+
ul li {
|
65 |
+
margin-bottom: 10px;
|
66 |
+
font-size: 14px ;
|
67 |
+
}
|
68 |
+
a {
|
69 |
+
color: #0073aa;
|
70 |
+
}
|
71 |
+
a:hover,
|
72 |
+
a:active {
|
73 |
+
color: #006799;
|
74 |
+
}
|
75 |
+
a:focus {
|
76 |
+
color: #124964;
|
77 |
+
-webkit-box-shadow:
|
78 |
+
0 0 0 1px #5b9dd9,
|
79 |
+
0 0 2px 1px rgba(30, 140, 190, 0.8);
|
80 |
+
box-shadow:
|
81 |
+
0 0 0 1px #5b9dd9,
|
82 |
+
0 0 2px 1px rgba(30, 140, 190, 0.8);
|
83 |
+
outline: none;
|
84 |
+
}
|
85 |
+
.button {
|
86 |
+
background: #f3f5f6;
|
87 |
+
border: 1px solid #016087;
|
88 |
+
color: #016087;
|
89 |
+
display: inline-block;
|
90 |
+
text-decoration: none;
|
91 |
+
font-size: 13px;
|
92 |
+
line-height: 2;
|
93 |
+
height: 28px;
|
94 |
+
margin: 0;
|
95 |
+
padding: 0 10px 1px;
|
96 |
+
cursor: pointer;
|
97 |
+
-webkit-border-radius: 3px;
|
98 |
+
-webkit-appearance: none;
|
99 |
+
border-radius: 3px;
|
100 |
+
white-space: nowrap;
|
101 |
+
-webkit-box-sizing: border-box;
|
102 |
+
-moz-box-sizing: border-box;
|
103 |
+
box-sizing: border-box;
|
104 |
+
|
105 |
+
vertical-align: top;
|
106 |
+
}
|
107 |
+
|
108 |
+
.button.button-large {
|
109 |
+
line-height: 2.30769231;
|
110 |
+
min-height: 32px;
|
111 |
+
padding: 0 12px;
|
112 |
+
}
|
113 |
+
|
114 |
+
.button:hover,
|
115 |
+
.button:focus {
|
116 |
+
background: #f1f1f1;
|
117 |
+
}
|
118 |
+
|
119 |
+
.button:focus {
|
120 |
+
background: #f3f5f6;
|
121 |
+
border-color: #007cba;
|
122 |
+
-webkit-box-shadow: 0 0 0 1px #007cba;
|
123 |
+
box-shadow: 0 0 0 1px #007cba;
|
124 |
+
color: #016087;
|
125 |
+
outline: 2px solid transparent;
|
126 |
+
outline-offset: 0;
|
127 |
+
}
|
128 |
+
|
129 |
+
.button:active {
|
130 |
+
background: #f3f5f6;
|
131 |
+
border-color: #7e8993;
|
132 |
+
-webkit-box-shadow: none;
|
133 |
+
box-shadow: none;
|
134 |
+
}
|
135 |
+
</style>
|
136 |
+
</head>
|
137 |
+
|
138 |
+
<body>
|
139 |
+
<div class='container'>
|
140 |
+
|
141 |
+
<h1 class='main'>{MESSAGE_TITLE}</h1>
|
142 |
+
|
143 |
+
<div class="message">{MESSAGE}</div>
|
144 |
+
|
145 |
+
{BACK_LINK}
|
146 |
+
|
147 |
+
</div>
|
148 |
+
{BACK_SCRIPT}
|
149 |
+
</body>
|
150 |
+
</html>
|