diff --git a/css/spbc-table.min.css b/css/spbc-table.min.css index f497c5752..a277bd750 100644 --- a/css/spbc-table.min.css +++ b/css/spbc-table.min.css @@ -1 +1 @@ -#spbc_tbl__scanner_frontend_malware th,tbody td{position:relative}[disabled]:hover{cursor:not-allowed}.tbl-width--50px{width:50px}.tbl-width--100px{width:100px}.tbl-width--sma{width:7em}.tbl-widtqh--mid{width:6em}.tbl-min_width--big{width:12em}tr .row-actions{left:0}.tbl-row_action:hover{cursor:pointer;text-decoration:underline}tr .row-actions span{color:gray}tr:hover .row-actions span.tbl-row_action{color:#0073aa}tr:hover .row-actions span.tbl-row_action--delete,tr:hover .row-actions span.tbl-row_action--replace{color:#a00}tr:hover .row-actions span.tbl-row_action--approve{color:#0a0}.tbl-row_action--hide{color:gray}.tbl-sorting_indicator{margin-left:10px;visibility:hidden}.tbl-sorting_indicator--sorted{color:rgba(0,0,0,.6);visibility:visible}.tbl-column-sortable:hover{cursor:pointer}.tbl-column-sortable:hover .tbl-sorting_indicator{visibility:visible;color:rgba(0,0,0,1)}.spbc_hint--icon{color:#999}.spbc_hint--icon:hover{color:#000}.spbc_hint--icon:hover+.spbc_hint--text{display:block}.spbc_hint--text{display:none;color:#999}.tbl-button{display:inline-block;line-height:20px;height:30px;margin:0;padding:0 10px 1px;cursor:pointer;border:1px solid #ccc;border-radius:3px;color:#555;background:#f7f7f7;vertical-align:top}.tbl-button---white_blue{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}.tbl-select{padding:2px;line-height:20px!important;height:25px!important}.tbl-preloader--small{display:none;width:15px;height:15px;margin:0 5px;vertical-align:middle}.tbl-preloader--tiny{display:none;width:10px;height:10px;margin:0 5px}.tbl-preloader--in_button{margin:0 0 0 8px}.tbl-bulk_actions--wrapper{display:inline-block;margin:5px 0}.tbl-bulk_actions--apply,.tbl-pagination--button,.tbl-pagination--total{margin:0 5px}.tbl-pagination--wrapper{display:inline-block;padding:5px 0;vertical-align:middle}.tbl-pagination--total{vertical-align:baseline}.tbl-pagination--curr_page{width:36px;padding:3px 5px;font-size:13px;text-align:center}@media screen and (max-width:782px){#spbc_tbl__secuirty_logs .wp-list-table tr,#spbc_tbl__traffic_control_logs .wp-list-table tr{margin:0 0 1rem}#spbc_tbl__traffic_control_logs .wp-list-table,#spbc_tbl__traffic_control_logs .wp-list-table thead,tbody,td,tr{display:block}#spbc_tbl__traffic_control_logs .wp-list-table thead tr{position:absolute;top:-9999px;left:-9999px}#spbc_tbl__traffic_control_logs .wp-list-table td{display:flex;align-items:center;border:none;border-bottom:1px solid #eee;position:relative;padding-left:50%;height:100%;padding-top:10px;padding-bottom:10px}#spbc_tbl__traffic_control_logs .wp-list-table td:before{position:absolute;top:0;left:6px;width:45%;padding-right:10px;white-space:nowrap;height:inherit;display:grid;align-items:center}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(1):before{content:"IP"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(2):before{content:"Country"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(3):before{content:"Last Request"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(4):before{content:"Status"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(5):before{content:"Requests"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(6):before{content:"Requests per 5 minutes"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(7):before{content:"Page"}#spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(8):before{content:"User Agent"}#spbc_tbl__secuirty_logs .wp-list-table,#spbc_tbl__secuirty_logs .wp-list-table thead,tbody,td,tr{display:block}#spbc_tbl__secuirty_logs .wp-list-table thead tr{position:absolute;top:-9999px;left:-9999px}#spbc_tbl__secuirty_logs .wp-list-table td{display:flex;align-items:center;border:none;border-bottom:1px solid #eee;position:relative;padding-left:50%;height:100%;padding-top:10px;padding-bottom:10px}#spbc_tbl__secuirty_logs .wp-list-table td:before{position:absolute;top:0;left:6px;width:45%;padding-right:10px;white-space:nowrap;height:inherit;display:grid;align-items:center}#spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(1):before{content:"User"}#spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(2):before{content:"IP"}#spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(3):before{content:"Date"}#spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(4):before{content:"Action"}#spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(5):before{content:"Page"}.spbcShortTextBlock{width:100%}#spbc_tbl__secuirty_logs .wp-list-table .mob_entries,#spbc_tbl__traffic_control_logs .wp-list-table .mob_entries{display:none}} \ No newline at end of file +#spbc_tbl__scanner_frontend_malware th,tbody td{position:relative}[disabled]:hover{cursor:not-allowed}.tbl-width--50px{width:50px}.tbl-width--100px{width:100px}.tbl-width--sma{width:7em}.tbl-widtqh--mid{width:6em}.tbl-min_width--big{width:12em}tr .row-actions{left:0}.tbl-row_action:hover{cursor:pointer;text-decoration:underline}tr .row-actions span{color:gray}tr:hover .row-actions span.tbl-row_action{color:#0073aa}tr:hover .row-actions span.tbl-row_action--delete,tr:hover .row-actions span.tbl-row_action--replace{color:#a00}tr:hover .row-actions span.tbl-row_action--approve{color:#0a0}.tbl-row_action--hide{color:gray}.tbl-sorting_indicator{margin-left:10px;visibility:hidden}.tbl-sorting_indicator--sorted{color:rgba(0,0,0,.6);visibility:visible}.tbl-column-sortable:hover{cursor:pointer}.tbl-column-sortable:hover .tbl-sorting_indicator{visibility:visible;color:rgba(0,0,0,1)}.spbc_hint--icon{color:#999}.spbc_hint--icon:hover{color:#000}.spbc_hint--icon:hover+.spbc_hint--text{display:block}.spbc_hint--text{display:none;color:#999}.tbl-button{display:inline-block;line-height:20px;height:30px;margin:0;padding:0 10px 1px;cursor:pointer;border:1px solid #ccc;border-radius:3px;color:#555;background:#f7f7f7;vertical-align:top}.tbl-button---white_blue{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff}.tbl-select{padding:2px;line-height:20px!important;height:25px!important}.tbl-preloader--small{display:none;width:15px;height:15px;margin:0 5px;vertical-align:middle}.tbl-preloader--tiny{display:none;width:10px;height:10px;margin:0 5px}.tbl-preloader--in_button{margin:0 0 0 8px}.tbl-bulk_actions--wrapper{display:inline-block;margin:5px 0}.tbl-bulk_actions--apply,.tbl-pagination--button,.tbl-pagination--total{margin:0 5px}.tbl-pagination--wrapper{display:inline-block;padding:5px 0;vertical-align:middle}.tbl-pagination--total{vertical-align:baseline}.tbl-pagination--curr_page{width:36px;padding:3px 5px;font-size:13px;text-align:center}@media screen and (max-width:782px){#spbc_settings_form .wp-list-table,#spbc_settings_form .wp-list-table thead,tbody,td,tr{display:block}#spbc_settings_form .wp-list-table thead tr{position:absolute;top:-9999px;left:-9999px}#spbc_settings_form .wp-list-table tr{margin:0 0 1rem}#spbc_settings_form .wp-list-table td{display:block;position:relative;height:100%;padding:10px 0 10px 35%}#spbc_settings_form .wp-list-table tbody td:before{content:attr(data-before)!important;position:absolute;left:10px}#spbc_settings_form .spbcShortTextBlock{width:100%}#spbc_settings_form .wp-list-table tbody .mob_entries{display:none}#spbc_settings_form .wp-list-table tbody .mob_table_active{display:block}} \ No newline at end of file diff --git a/css/src/spbc-table.css b/css/src/spbc-table.css index c91ec5814..7e6af55cf 100644 --- a/css/src/spbc-table.css +++ b/css/src/spbc-table.css @@ -78,100 +78,39 @@ tr:hover .row-actions span.tbl-row_action--approve{color: #0a0;} } @media screen and (max-width: 782px) { - #spbc_tbl__traffic_control_logs .wp-list-table { + #spbc_settings_form .wp-list-table { display: block; } - #spbc_tbl__traffic_control_logs .wp-list-table thead, tbody, td, tr { + #spbc_settings_form .wp-list-table thead, tbody, td, tr { display: block; } - #spbc_tbl__traffic_control_logs .wp-list-table thead tr { + #spbc_settings_form .wp-list-table thead tr { position: absolute; top: -9999px; left: -9999px; } - #spbc_tbl__traffic_control_logs .wp-list-table tr { + #spbc_settings_form .wp-list-table tr { margin: 0 0 1rem 0; } - #spbc_tbl__traffic_control_logs .wp-list-table td { - display: flex; - align-items: center; - border: none; - border-bottom: 1px solid #eee; - position: relative; - padding-left: 50%; - height: 100%; - padding-top: 10px; - padding-bottom: 10px; - } - #spbc_tbl__traffic_control_logs .wp-list-table td:before { - position: absolute; - top: 0; - left: 6px; - width: 45%; - padding-right: 10px; - white-space: nowrap; - height: inherit; - display: grid; - align-items: center; - } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(1):before { content: "IP"; } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(2):before { content: "Country"; } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(3):before { content: "Last Request"; } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(4):before { content: "Status"; } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(5):before { content: "Requests";} - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(6):before { content: "Requests per 5 minutes"; } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(7):before { content: "Page"; } - #spbc_tbl__traffic_control_logs .wp-list-table td:nth-of-type(8):before { content: "User Agent"; } - .spbcShortTextBlock { - width: 100%; - } - - #spbc_tbl__secuirty_logs .wp-list-table { + #spbc_settings_form .wp-list-table td { display: block; - } - #spbc_tbl__secuirty_logs .wp-list-table thead, tbody, td, tr { - display: block; - } - #spbc_tbl__secuirty_logs .wp-list-table thead tr { - position: absolute; - top: -9999px; - left: -9999px; - } - #spbc_tbl__secuirty_logs .wp-list-table tr { - margin: 0 0 1rem 0; - } - #spbc_tbl__secuirty_logs .wp-list-table td { - display: flex; - align-items: center; - border: none; - border-bottom: 1px solid #eee; position: relative; - padding-left: 50%; height: 100%; - padding-top: 10px; - padding-bottom: 10px; + padding: 10px 0 10px 35%; } - #spbc_tbl__secuirty_logs .wp-list-table td:before { + #spbc_settings_form .wp-list-table tbody td:before { + content: attr(data-before) !important; position: absolute; - top: 0; - left: 6px; - width: 45%; - padding-right: 10px; - white-space: nowrap; - height: inherit; - display: grid; - align-items: center; + left: 10px; } - #spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(1):before { content: "User"; } - #spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(2):before { content: "IP"; } - #spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(3):before { content: "Date"; } - #spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(4):before { content: "Action"; } - #spbc_tbl__secuirty_logs .wp-list-table td:nth-of-type(5):before { content: "Page";} - .spbcShortTextBlock { + #spbc_settings_form .spbcShortTextBlock { width: 100%; } - - #spbc_tbl__traffic_control_logs .wp-list-table .mob_entries, #spbc_tbl__secuirty_logs .wp-list-table .mob_entries { + #spbc_settings_form .wp-list-table tbody .mob_entries { display: none; } + + #spbc_settings_form .wp-list-table tbody .mob_table_active { + display: block; + } } \ No newline at end of file diff --git a/inc/fw-update.php b/inc/fw-update.php index f32438620..21b2047e0 100644 --- a/inc/fw-update.php +++ b/inc/fw-update.php @@ -25,6 +25,10 @@ function spbc_security_firewall_update__init($delay = null) sleep((int)$delay); + $spbc->fw_stats['last_update_log'] = []; + + spbc_security_firewall_update_log(__FUNCTION__); + // Prevent start an update if update is already running and started less than 2 minutes ago if ( $spbc->fw_stats['updating_id'] && @@ -44,9 +48,11 @@ function spbc_security_firewall_update__init($delay = null) // Delete temporary tables FW::dataTablesDeleteTemporary(DB::getInstance(), array( - SPBC_TBL_FIREWALL_DATA, - SPBC_TBL_FIREWALL_DATA__IPS, - SPBC_TBL_FIREWALL_DATA__COUNTRIES, + SPBC_TBL_FIREWALL_DATA_V4, + SPBC_TBL_FIREWALL_DATA_V6, + SPBC_TBL_FIREWALL_DATA__IPS_V4, + SPBC_TBL_FIREWALL_DATA__IPS_V6, + SPBC_TBL_FIREWALL_DATA__COUNTRIES )); $wp_upload_dir = wp_upload_dir(); @@ -74,8 +80,13 @@ function spbc_security_firewall_update__init($delay = null) ) ); - // Make a direct update if folder creation or test RC fail - if ( ! empty($prepare_dir__result['error']) || ! empty($test_rc_result['error'])) { + // Make a direct update if folder creation, test RC fail or force const exist + if ( ! empty($prepare_dir__result['error']) || + ! empty($test_rc_result['error']) || + (defined('SPBCT_FORCE_DIRECT_SECFW_UPDATE') && SPBCT_FORCE_DIRECT_SECFW_UPDATE) + ) { + spbc_security_firewall_update_log('go to direct update'); + return spbc_security_firewall_update_direct(); } @@ -91,6 +102,10 @@ function spbc_security_firewall_update__init($delay = null) array( 'async' ) ); + if ( ! empty($result['error']) ) { + spbc_security_firewall_update_log(json_encode($result['error'])); + } + return ( ! empty($result['error']) && $queue->isQueueFinished() ) ? $result : true; } @@ -105,6 +120,8 @@ function spbc_security_firewall_update__worker($checker_work = null) { global $spbc; + spbc_security_firewall_update_log(__FUNCTION__); + if ( ! $spbc->key_is_ok ) { return array( 'error' => 'KEY_IS_NOT_VALID' ); } @@ -133,6 +150,7 @@ function spbc_security_firewall_update__worker($checker_work = null) // Queue is already empty. Exit. $queue = new Queue('fw_update', 'update_security_firewall__worker'); if ( $queue->isQueueFinished() ) { + spbc_security_firewall_update_log('is queue finished'); return true; } @@ -144,11 +162,11 @@ function spbc_security_firewall_update__worker($checker_work = null) sleep(1); $queue->refreshQueue(); if ( ! $queue->isQueueInProgress() ) { - // The stage executed, break waiting and continue sfw_update__worker process + spbc_security_firewall_update_log('The stage executed, break waiting and continue sfw_update__worker process'); break; } if ( $i >= 4 ) { - // The stage still not executed, exit from sfw_update__worker + spbc_security_firewall_update_log('The stage still not executed, exit from sfw_update__worker'); return true; } } @@ -174,6 +192,8 @@ function spbc_security_firewall_update__worker($checker_work = null) // This is the repeat stage request, do not generate any new RC if ( stripos(Request::get('stage'), 'Repeat') !== false ) { + spbc_security_firewall_update_log('repeat request'); + return true; } @@ -183,6 +203,10 @@ function spbc_security_firewall_update__worker($checker_work = null) array( 'async' ) ); + if ( ! empty($result['error']) ) { + $spbc->error_add('firewall_update', current(array_column($queue->queue['stages'], 'error'))); + } + return ! empty($result['error']) && $queue->isQueueFinished() ? $result : true; } @@ -331,16 +355,20 @@ function spbc_security_firewall_update__prepare() global $wpdb; // Make sure that the table exists. Creating it if not. $db_tables_creator = new \CleantalkSP\SpbctWP\DB\TablesCreator(); - $db_tables_creator->createTable($wpdb->base_prefix . 'spbc_firewall_data'); - $db_tables_creator->createTable($wpdb->prefix . 'spbc_firewall__personal_ips'); - $db_tables_creator->createTable($wpdb->prefix . 'spbc_firewall__personal_countries'); + $db_tables_creator->createTable(SPBC_TBL_FIREWALL_DATA_V4); + $db_tables_creator->createTable(SPBC_TBL_FIREWALL_DATA_V6); + $db_tables_creator->createTable(SPBC_TBL_FIREWALL_DATA__IPS_V4); + $db_tables_creator->createTable(SPBC_TBL_FIREWALL_DATA__IPS_V6); + $db_tables_creator->createTable(SPBC_TBL_FIREWALL_DATA__COUNTRIES); // Update only personal tables for daughter blogs $result = FW::dataTablesCreateTemporaryTablesForTables( DB::getInstance(), array( - SPBC_TBL_FIREWALL_DATA, - SPBC_TBL_FIREWALL_DATA__IPS, + SPBC_TBL_FIREWALL_DATA_V4, + SPBC_TBL_FIREWALL_DATA_V6, + SPBC_TBL_FIREWALL_DATA__IPS_V4, + SPBC_TBL_FIREWALL_DATA__IPS_V6, SPBC_TBL_FIREWALL_DATA__COUNTRIES ) ); @@ -350,9 +378,13 @@ function spbc_security_firewall_update__prepare() } // Copying data without country code - $result = FW::dataTablesCopyCountiesDataFromMainTable(DB::getInstance(), SPBC_TBL_FIREWALL_DATA); - if ( ! empty($result['error']) ) { - return $result; + $result_v4 = FW::dataTablesCopyCountiesDataFromMainTable(DB::getInstance(), SPBC_TBL_FIREWALL_DATA_V4); + $result_v6 = FW::dataTablesCopyCountiesDataFromMainTable(DB::getInstance(), SPBC_TBL_FIREWALL_DATA_V6); + if ( ! empty($result_v4['error']) ) { + return $result_v4; + } + if ( ! empty($result_v6['error']) ) { + return $result_v6; } $spbc->fw_stats['update_percent'] = 15; @@ -487,8 +519,10 @@ function spbc_security_firewall_update__end_of_update() //Increment firewall entries $tables_to_work_with = array( - SPBC_TBL_FIREWALL_DATA, - SPBC_TBL_FIREWALL_DATA__IPS, + SPBC_TBL_FIREWALL_DATA_V4, + SPBC_TBL_FIREWALL_DATA_V6, + SPBC_TBL_FIREWALL_DATA__IPS_V4, + SPBC_TBL_FIREWALL_DATA__IPS_V6, SPBC_TBL_FIREWALL_DATA__COUNTRIES ); @@ -512,9 +546,13 @@ function spbc_security_firewall_update__end_of_update() $spbc->fw_stats['updating_last_start'] = 0; $spbc->fw_stats['last_updated'] = current_time('timestamp'); $spbc->fw_stats['is_on_maintenance'] = false; // Remove maintenance mode - $spbc->fw_stats['entries'] = - $wpdb->get_var('SELECT COUNT(*) FROM ' . SPBC_TBL_FIREWALL_DATA) + - $wpdb->get_var('SELECT COUNT(*) FROM ' . SPBC_TBL_FIREWALL_DATA__IPS); + + $sql_count_networks = "SELECT SUM(cnt) FROM ( + SELECT COUNT(*) as cnt FROM " . SPBC_TBL_FIREWALL_DATA_V4 . " + UNION SELECT COUNT(*) FROM " . SPBC_TBL_FIREWALL_DATA_V6 . " + UNION SELECT COUNT(*) FROM " . SPBC_TBL_FIREWALL_DATA__IPS_V4 . " + UNION SELECT COUNT(*) FROM " . SPBC_TBL_FIREWALL_DATA__IPS_V6 . ") cnt"; + $spbc->fw_stats['entries'] = $wpdb->get_var($sql_count_networks); $spbc->save('fw_stats', true, false); @@ -625,6 +663,7 @@ function spbc_security_firewall_update_direct() // process_file foreach ( $urls as $url ) { + spbc_security_firewall_update_log('process ' . $url); $result_process_file = spbc_security_firewall_update__process_file($url); if ( ! empty($result_process_file['error']) ) { return $result_process_file; @@ -647,3 +686,19 @@ function spbc_security_firewall_update_direct() return $result_end_of_update; } + +/** + * Log steps + * + * @param string $step + * @return void + */ +function spbc_security_firewall_update_log($step) +{ + global $spbc; + + $time = date('Y-m-d H:i:s', time()); + $spbc->fw_stats['last_update_log'][] = [$time, $step]; + + $spbc->save('fw_stats', true, false); +} diff --git a/inc/spbc-admin.php b/inc/spbc-admin.php index a10f3271f..d7c6d26a1 100644 --- a/inc/spbc-admin.php +++ b/inc/spbc-admin.php @@ -105,8 +105,8 @@ function spbc_admin_init() add_action('wp_ajax_spbc_send_traffic_control', 'spbc_send_firewall_logs', 1, 0); add_action('wp_ajax_spbc_send_security_log', 'spbc_send_logs', 1, 0); - // WAF. Notification about blocked file. - add_action('wp_ajax_spbc_check_file_block', array(WAF::class, 'wafFileGetLastBlockedInfo')); + // UploadChecker. Notification about blocked file. + add_action('wp_ajax_spbc_check_file_block', array(\CleantalkSP\SpbctWP\Firewall\UploadChecker::class, 'uploadCheckerGetLastBlockInfo')); // Backups add_action('wp_ajax_spbc_rollback', 'spbc_rollback'); @@ -286,7 +286,7 @@ function spbc_enqueue_scripts($hook) 'data__set_cookies__alt_sessions_type' => $spbc->settings['data__set_cookies__alt_sessions_type'], )); - if ($spbc->settings['waf__file_check'] && in_array($hook, array('upload.php', 'media-new.php'))) { + if ($spbc->settings['upload_checker__file_check'] && in_array($hook, array('upload.php', 'media-new.php'))) { wp_enqueue_script('spbc-upload-js', SPBC_PATH . '/js/spbc-upload.min.js', array('jquery'), SPBC_VERSION, false); } @@ -441,7 +441,7 @@ function ($key) { 'waf__enabled' => __('Bla bla', 'security-malware-firewall'), 'waf__xss_check' => __('Cross-Site Scripting (XSS) — prevents malicious code to be executed/sent to any user. As a result malicious scripts can not get access to the cookie files, session tokens and any other confidential information browsers use and store. Such scripts can even overwrite content of HTML pages. CleanTalk WAF monitors for patterns of these parameters and block them.', 'security-malware-firewall'), 'waf__sql_check' => __('SQL Injection — one of the most popular ways to hack websites and programs that work with databases. It is based on injection of a custom SQL code into database queries. It could transmit data through GET, POST requests or cookie files in an SQL code. If a website is vulnerable and execute such injections then it would allow attackers to apply changes to the website\'s MySQL database.', 'security-malware-firewall'), - 'waf__file_check' => __('The option checks each uploaded file to a website for malicious code. If it\'s possible for visitors to upload files to a website, for instance a work resume, then attackers could abuse it and upload an infected file to execute it later and get access to your website.', 'security-malware-firewall'), + 'upload_checker__file_check' => __('The option checks each uploaded file to a website for malicious code. If it\'s possible for visitors to upload files to a website, for instance a work resume, then attackers could abuse it and upload an infected file to execute it later and get access to your website.', 'security-malware-firewall'), 'traffic_control__enabled' => __('It analyzes quantity of requests towards website from any IP address for a certain period of time. For example, for an ordinary visitor it\'s impossible to generate 2000 requests within 1 hour. Big amount of requests towards website from the same IP address indicates that there is a high chance of presence of a malicious program.', 'security-malware-firewall'), 'scanner__outbound_links' => __('This option allows you to know the number of outgoing links on your website and website addresses they lead to. These websites addresses will be checked with the CleanTalk Database and the results will show if they were used in spam messages. The option\'s purpose is to check your website and find hidden, forgotten and spam links. You should always remember if you have links to other websites which have a bad reputation, it could affect your visitors\' trust and your SEO.', 'security-malware-firewall'), 'scanner__heuristic_analysis' => __('Often, authors of malicious code disguise their code which makes it difficult to identify it by their signatures. The malicious code itself can be placed anywhere on the site, for example the obfuscated PHP-code in the "logo.png" file, and the code itself is called by one inconspicuous line in "index.php". Therefore, the usage of plugins to search for malicious code is preferable. Heuristic analysis can indicate suspicious PHP constructions in a file that you should pay attention to.', 'security-malware-firewall'), @@ -806,7 +806,8 @@ function spbc_set_malware_scan_warns() $query = 'SELECT COUNT(*) FROM ' . SPBC_TBL_SCAN_FILES . ' WHERE (STATUS = "INFECTED" AND severity = "CRITICAL" AND analysis_status IS NULL) - OR STATUS = "DENIED_BY_CLOUD"'; + OR STATUS = "DENIED_BY_CLOUD" + OR STATUS = "DENIED_BY_CT"'; $critical_count = (int)$wpdb->get_var($query) > 0; $query = 'SELECT COUNT(*) @@ -822,7 +823,8 @@ function spbc_set_malware_scan_warns() $query = 'SELECT COUNT(*) FROM ' . SPBC_TBL_SCAN_FILES . ' - WHERE pscan_status = "DANGEROUS" OR analysis_status = "DANGEROUS" OR status = "DENIED_BY_CT"'; + WHERE pscan_status = "DANGEROUS" OR analysis_status = "DANGEROUS" OR + (status = "DENIED_BY_CT" AND last_sent IS NOT NULL)'; $analysis_has_dangerous = (int)$wpdb->get_var($query) > 0; $query = 'SELECT COUNT(*) diff --git a/inc/spbc-scanner.php b/inc/spbc-scanner.php index b54d4a2c8..b6514bd5b 100644 --- a/inc/spbc-scanner.php +++ b/inc/spbc-scanner.php @@ -274,6 +274,13 @@ function spbc_scanner_file_send($direct_call = false, $file_id = null, $do_resca $mixed_result = Arr::mergeWithSavingNumericKeysRecursive((array)$result_heur, (array)$result_sign); + if ( isset($mixed_result['weak_spots']) && + is_array($mixed_result['weak_spots']) && + isset($mixed_result['weak_spots'][0]) && + count($mixed_result['weak_spots']) > 1 ) { + unset($mixed_result['weak_spots'][0]); + } + $wpdb->update( SPBC_TBL_SCAN_FILES, array( @@ -581,7 +588,7 @@ function spbc_scanner_file_approve($direct_call = false, $file_id = null) $wpdb->update( SPBC_TBL_SCAN_FILES, array( - 'status' => 'APROVED', + 'status' => 'APPROVED_BY_USER', 'previous_state' => $previous, 'pscan_status' => null, 'pscan_processing_status' => null, @@ -763,6 +770,7 @@ function spbc_scanner_pscan_check_analysis_status($direct_call = false, $file_id . ' SET ' . ' pscan_processing_status = "DONE",' . ' pscan_status = %s ,' + . ' severity = "CRITICAL",' . ' pscan_balls = %s,' . ' status = "DENIED_BY_CLOUD"' . ' WHERE pscan_file_id = %s', @@ -1017,7 +1025,7 @@ function spbc_scanner_file_send_for_analysis__bulk($fast_hashes_list = array()) $sql_result = $wpdb->get_results( 'SELECT fast_hash FROM ' . SPBC_TBL_SCAN_FILES . ' WHERE last_sent IS NULL - AND status NOT IN ("OK","APROVED","APPROVED_BY_CT","APPROVED_BY_CLOUD")', + AND status NOT IN ("OK","APPROVED_BY_USER","APPROVED_BY_CT","APPROVED_BY_CLOUD")', ARRAY_A ); @@ -1069,10 +1077,10 @@ function spbc_get_sql_where_addiction_for_table_of_category($category) case 'critical': $res = ' WHERE status IN ("DENIED_BY_CLOUD", "DENIED_BY_CT") OR ( - severity IN("CRITICAL") + severity = "CRITICAL" AND ( status <> "QUARANTINED" AND - status <> "APROVED" AND + status <> "APPROVED_BY_USER" AND status <> "APPROVED_BY_CT" ) AND ( @@ -1085,24 +1093,25 @@ function spbc_get_sql_where_addiction_for_table_of_category($category) case 'suspicious': $res = ' WHERE severity <> "CRITICAL" AND last_sent IS NULL AND - (status = "MODIFIED" AND severity IS NOT NULL) - OR (status = "INFECTED" AND severity IN ("SUSPICIOUS","DANGER") )'; + (status = "MODIFIED" AND source_type IS NOT NULL) + OR (status = "INFECTED" AND severity = "SUSPICIOUS")'; break; case 'approved': - $res = ' WHERE ( status = "APROVED" OR status = "APPROVED_BY_CT" OR status = "APPROVED_BY_CLOUD") AND source_type IS NULL'; + $res = ' WHERE ( status = "APPROVED_BY_USER" OR status = "APPROVED_BY_CT" OR status = "APPROVED_BY_CLOUD") AND source_type IS NULL'; break; case 'analysis_log': $res = ' WHERE last_sent IS NOT NULL'; break; case 'unknown': - $res = ' WHERE status NOT IN ("APROVED","APPROVED_BY_CT","APPROVED_BY_CLOUD","DENIED_BY_CT") AND + $res = ' WHERE status NOT IN ("APPROVED_BY_USER","APPROVED_BY_CT","APPROVED_BY_CLOUD","DENIED_BY_CT") AND detected_at >= ' . (time() - $spbc->settings['scanner__list_unknown__older_than'] * 86400) . ' AND source IS NULL AND + source_type IS NULL AND path NOT LIKE "%wp-content%themes%" AND path NOT LIKE "%wp-content%plugins%" AND path NOT LIKE "%wp-content%cache%" AND path NOT LIKE "%wp-config.php" AND - (severity IS NULL OR severity NOT IN ("CRITICAL", "DANGER", "SUSPICIOUS")) AND + (severity IS NULL OR severity NOT IN ("CRITICAL", "SUSPICIOUS")) AND last_sent IS NULL'; break; case 'quarantined': @@ -1288,14 +1297,16 @@ function spbc_scanner_page_view($direct_call = false, $page_url = false) $page_text = array(); + $page_url_sql = str_replace('.', '%', $page_url); + // Getting file info. $sql_result = $wpdb->get_results( $wpdb->prepare( 'SELECT weak_spots' . ' FROM ' . SPBC_TBL_SCAN_FRONTEND - . ' WHERE url = %s' + . ' WHERE url LIKE %s' . ' LIMIT 1', - $page_url + $page_url_sql ), ARRAY_A ); @@ -1972,6 +1983,10 @@ function spbc_scanner_save_to_pdf($direct_call = false) $pdf->drawFilesListByType('critical_files'); + $pdf->AddPage(); + + $pdf->drawFilesListByType('suspicious_files'); + $pdf->Output(); } diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php index 7dac8841e..21844c0a9 100644 --- a/inc/spbc-settings.php +++ b/inc/spbc-settings.php @@ -1,5 +1,7 @@ array( 'waf__xss_check', 'waf__sql_check', - 'waf__file_check', 'waf__exploit_check', 'waf_blocker__enabled' ), @@ -445,21 +446,6 @@ function spbc_settings__register() 'long_description' => true, 'parent' => 'waf__enabled', ), - 'waf__file_check' => array( - 'type' => 'field', - 'title' => __('Check uploaded files', 'security-malware-firewall'), - 'description' => __('Check uploaded files for malicious code.', 'security-malware-firewall'), - 'long_description' => true, - 'parent' => 'waf__enabled', - 'children' => array('waf__file_check__uploaded_plugins') - ), - 'waf__file_check__uploaded_plugins' => array( - 'type' => 'field', - 'title' => __('Check plugins and themes while uploading', 'security-malware-firewall'), - 'description' => __('Check the plugins and themes uploaded via WordPress built in interface with heuristic and signature analysis.', 'security-malware-firewall'), - 'parent' => 'waf__file_check', - 'class' => 'spbc_sub2_setting', - ), 'waf__exploit_check' => array( 'type' => 'field', 'title' => __('Check for exploits', 'security-malware-firewall'), @@ -472,6 +458,20 @@ function spbc_settings__register() 'description' => __('Blocking a visitor for 24 hours after several WAF detected brute force attempts.', 'security-malware-firewall'), 'parent' => 'waf__enabled', ), + 'upload_checker__file_check' => array( + 'type' => 'field', + 'title' => __('Run the Upload Checker module for uploaded files', 'security-malware-firewall'), + 'description' => __('The plugin will scan files uploaded to the WordPress media library for known malicious code with heuristic and signature analysis. If malware found, upload will stop.', 'security-malware-firewall'), + 'long_description' => true, + 'children' => array('upload_checker__do_check_wordpress_modules') + ), + 'upload_checker__do_check_wordpress_modules' => array( + 'type' => 'field', + 'title' => __('Check plugins and themes archives before install', 'security-malware-firewall'), + 'description' => __('Check the plugins and themes uploaded via WordPress built in interface with heuristic and signature analysis.', 'security-malware-firewall'), + 'parent' => 'upload_checker__file_check', + 'class' => 'spbc_sub2_setting', + ), 'traffic_control__enabled' => array( 'type' => 'field', 'title' => __('Traffic Control', 'security-malware-firewall'), @@ -536,6 +536,12 @@ function spbc_settings__register() 'options' => spbc_settings_field__secfw__get_ip__get_labels(), 'title' => __('Get visitors IP from additional headers', 'security-malware-firewall'), 'description' => spbc_settings_field__secfw__get_ip__get_description(), + 'long_description' => true, + ), + 'secfw__get_ip__enable_cdn_auto_self_check' => array( + 'type' => 'field', + 'title' => __('Enable automatic CDN headers checker', 'security-malware-firewall'), + 'description' => CDNHeadersChecker::getOptionDescriptionText(), ), ), ), @@ -1649,6 +1655,16 @@ function spbc_field_statistics() : __('Unknown last PHP log sending time.', 'security-malware-firewall')); } + echo '
'; + + + //cdn checker data + add_filter('safe_style_css', function ($styles) { + $styles[] = 'display'; + return $styles; + }); + echo Escape::escKsesPreset(CDNHeadersChecker::getSummaryBlockHTML(), 'spbc_cdn_checker_table'); + echo '
'; echo 'Plugin version: ' . SPBC_VERSION; echo ''; @@ -2168,7 +2184,7 @@ function spbc_field_traffic_control_logs__prepare_data(&$table) break; case 'DENY_BY_WAF_FILE': $status = '' - . __('Blocked by Web Application Firewall: ', 'security-malware-firewall') + . __('Blocked by Upload Checker module: ', 'security-malware-firewall') . '' . __('Malicious files upload.', 'security-malware-firewall') . '' @@ -2474,22 +2490,6 @@ function spbc_field_scanner__prepare_data__files(&$table) $ws_string .= '

'; } } - if ( ! empty($weak_spots['DANGER'])) { - // collecting all kinds of code - $all_unique_weak_spots = array(); - foreach ($weak_spots['DANGER'] as $_string => $weak_spot_in_string) { - $all_unique_weak_spots[] = $weak_spot_in_string[0]; - } - $all_unique_weak_spots = array_unique($all_unique_weak_spots); - foreach ($all_unique_weak_spots as $weak_spot_in_string) { - $ws_string .= '

Danger: ' - . (strlen($weak_spot_in_string) > 30 - ? substr($weak_spot_in_string, 0, 30) . '...' - : $weak_spot_in_string); - - $ws_string .= '

'; - } - } } $table->items[ $key ]['weak_spots'] = $ws_string; @@ -2577,7 +2577,7 @@ function spbc_field_scanner__prepare_data__analysis_log(&$table) $analysis_comment = __('Quarantined by user', 'security-malware-firewall'); } - if ( isset($row->status) && $row->status === 'APROVED' ) { + if ( isset($row->status) && $row->status === 'APPROVED_BY_USER' ) { $pscan_status = 'APPROVED'; $analysis_comment = __('Approved by user', 'security-malware-firewall'); } @@ -3187,11 +3187,9 @@ function spbc_list_table__get_args_by_type($table_type) 'mtime' => array('heading' => 'Last Modified',), ), 'actions' => array( - 'delete' => array('name' => 'Delete',), 'view' => array('name' => 'View', 'handler' => 'spbc_scanner_button_file_view_event(this);',), ), 'bulk_actions' => array( - 'delete' => array('name' => 'Delete',), ), 'sortable' => array('path', 'size', 'perms', 'mtime',), 'pagination' => array( @@ -3560,10 +3558,12 @@ function spbc_list_table__get_args_by_type($table_type) ), 'if_empty_items' => false, 'actions' => array( + 'delete' => array('name' => 'Delete',), 'approve' => array('name' => 'Approve',), 'view' => array('name' => 'View',), ), 'bulk_actions' => array( + 'delete' => array('name' => 'Delete',), 'approve' => array('name' => 'Approve',), ), 'sql' => array( @@ -4513,7 +4513,7 @@ function spbc_settings__get_description() 'title' => __('SQL-injection check', 'security-malware-firewall'), 'desc' => __('SQL Injection — one of the most popular ways to hack websites and programs that work with databases. It is based on injection of a custom SQL code into database queries. It could transmit data through GET, POST requests or cookie files in an SQL code. If a website is vulnerable and execute such injections then it would allow attackers to apply changes to the website\'s MySQL database.', 'security-malware-firewall') ), - 'waf__file_check' => array( + 'upload_checker__file_check' => array( 'title' => __('Check uploaded files', 'security-malware-firewall'), 'desc' => __('The option checks each uploaded file to a website for malicious code. If it\'s possible for visitors to upload files to a website, for instance a work resume, then attackers could abuse it and upload an infected file to execute it later and get access to your website.', 'security-malware-firewall') ), @@ -4721,6 +4721,10 @@ function spbc_settings__get_description() 'desc' => __('The file hash is in denied list. It means that the Security analysts have marked this file as critically dangerous early. We do recommend you to order the Security Audit service.', 'security-malware-firewall') ), + 'secfw__get_ip' => array( + 'title' => IP::getOptionLongDescriptionArray()['title'], + 'desc' => IP::getOptionLongDescriptionArray()['desc'], + ), 'no_description' => array( 'title' => esc_html($setting_id), 'desc' => __('No description provided yet for this item. We are sorry about this. Please, contact support@cleantalk.org for further help.', 'security-malware-firewall'), @@ -4995,6 +4999,17 @@ function spbc__send_local_settings_to_api($settings) API::methodSendLocalSettings($api_key, $hostname, $settings); } +add_action('spbc_before_returning_settings', 'spbc_cdn_checker__run_check_on_settings_change'); + +function spbc_cdn_checker__run_check_on_settings_change($settings) +{ + if ( isset($settings['secfw__get_ip__enable_cdn_auto_self_check']) && $settings['secfw__get_ip__enable_cdn_auto_self_check'] != 0) { + CDNHeadersChecker::sendCDNCheckerRequest(); + SpbcCron::updateTask('cdn_check', 'spbc_cdn_checker__send_request', 86400, time() + 86400); + } +} + + /** * */ @@ -5037,24 +5052,10 @@ function spbc_settings_field__secfw__get_ip__get_description() function spbc_settings_field__secfw__get_ip__get_labels() { - $available_header = array( - 2 => array('slug' => 'remote_addr', 'name' => 'Remote Addr'), - 3 => array('slug' => 'x_forwarded_for', 'name' => 'X-Forwarder-For'), - 4 => array('slug' => 'x_real_ip', 'name' => 'X-Real-Ip'), - 5 => array('slug' => 'incapsula', 'name' => 'Incap-Client-Ip'), - 6 => array('slug' => 'ico_x_forwarded_for', 'name' => 'Ico-X-Forwarded-For'), - 7 => array('slug' => 'stackpath', 'name' => 'X-Sp-Forwarded-Ip'), - 8 => array('slug' => 'x_forwarded_by', 'name' => 'X-Client-Ip'), - 9 => array('slug' => 'sucury', 'name' => 'X-Sucuri-Clientip'), - 10 => array('slug' => 'ezoic', 'name' => 'X-Middleton-Ip'), - 11 => array('slug' => 'gtranslate', 'name' => 'X-Gt-Viewer-Ip'), - 12 => array('slug' => 'cloud_flare', 'name' => 'Cf-Connecting-Ip'), - 13 => array('slug' => 'ovh', 'name' => 'Remote-Ip'), - ); $options = array(); $options[] = array('val' => 1, 'label' => __('Auto', 'security-malware-firewall'),); - foreach ( $available_header as $key => $header ) { + foreach (IP::$known_headers_collection as $key => $header ) { IP::get($header['slug'], [], true); $option_value = $header['name']; $option_value .= isset(IP::getInstance()->ips_stored[$header['slug']]) @@ -5225,7 +5226,7 @@ function spbc__get_security_status_license_html() // Security license expires if ((int)$spbc->data['notice_show'] === 1) { return '' - . __('Security license expires in next 7 days', 'security-malware-firewall') + . __('Security license expires in next 30 days', 'security-malware-firewall') . ''; } } diff --git a/js/spbc-admin.min.js b/js/spbc-admin.min.js index 243396084..815b463b8 100644 --- a/js/spbc-admin.min.js +++ b/js/spbc-admin.min.js @@ -1,2 +1,2 @@ -function spbcGetGoogleQrCode(){var e={},c={};return e.security=spbcSettings.ajax_nonce,e.action="spbc_get_google_qr_code",jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){c=e}}),c}function spbcCheckGoogleCode(){var e={};e.security=spbcSettings.ajax_nonce,e.action="spbc_check_google_code",e.code=jQuery("#spbct-google-qr-code input").val(),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(jQuery("#spbct-google-qr-code").dialog("close"),document.location.reload()):alert(e.data)}})}function spbcDisableG2fa(e){var c={};c.security=spbcSettings.ajax_nonce,c.action="spbc_disable_google_2fa",c.user_id=jQuery(e).data("user-id"),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:c,success:function(e){e.success?document.location.reload():alert(e.data)}})}jQuery(document).ready(function(){jQuery(".spbc_update_notice").on("click","button",function(){spbc_setCookie("spbc_update_banner_closed",1,2592e3)}),jQuery(document).on("click","#spbc-g2fa-enable",function(e){e.preventDefault();e=spbcGetGoogleQrCode();e.success?(jQuery("#spbct-google-qr-code-img").html(e.data.img+"

"+e.data.code+"

"),jQuery("#spbct-google-qr-code input").val(""),jQuery("#spbct-google-qr-code").dialog({modal:!0,title:"Google authenticator activation",buttons:{Cancel:function(){jQuery(this).dialog("close")},Ok:function(){spbcCheckGoogleCode()}},draggable:!1,resizable:!1})):alert(spbcGetGoogleQrCode.data)}),jQuery(document).on("click","#spbc-g2fa-disable",function(e){e.preventDefault(),confirm("Are you sure?")&&spbcDisableG2fa(this)});function e(e,c,t){setTimeout(function(){null!==e&&(jQuery(".spbc-admin_bar--user_counter").html(e.count),e.count<=3?(jQuery("#wp-admin-bar-spbc_admin_bar__online_admins").show(),jQuery(".spbc-admin_bar--online_admins").html(e.users.join(", "))):jQuery("#wp-admin-bar-spbc_admin_bar__online_admins").hide()),spbc_sendAJAXRequest(c,t)},15e3)}1==+spbcSettings.admin_bar__admins_online_counter&&e(null,{action:"spbc_get_authorized_admins"},{callback:e}),jQuery("body").on("click",".spbc-notice .notice-dismiss",function(e){e=jQuery(e.target).parent(".notice").attr("id");e&&spbc_sendAJAXRequest({action:"spbc_dismiss_banner",banner_id:e},{callback:null})}),1==+spbcSettings.needToWhitelist&&spbc_sendAJAXRequest({action:"spbc_private_list_add"},{callback:null})}); +function spbcGetGoogleQrCode(){var e={},c={};return e.security=spbcSettings.ajax_nonce,e.action="spbc_get_google_qr_code",jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){c=e}}),c}function spbcCheckGoogleCode(){var e={};e.security=spbcSettings.ajax_nonce,e.action="spbc_check_google_code",e.code=jQuery("#spbct-google-qr-code input").val(),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(jQuery("#spbct-google-qr-code").dialog("close"),document.location.reload()):alert(e.data)}})}function spbcDisableG2fa(e){var c={};c.security=spbcSettings.ajax_nonce,c.action="spbc_disable_google_2fa",c.user_id=jQuery(e).data("user-id"),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:c,success:function(e){e.success?document.location.reload():alert(e.data)}})}function spbcSummaryShowCDNCheckerTable(){event.preventDefault();var e=document.getElementById("spbc_stats_cdn_checker_table");void 0!==e&&("block"===e.style.display?e.style.display="none":e.style.display="block")}jQuery(document).ready(function(){jQuery(".spbc_update_notice").on("click","button",function(){spbc_setCookie("spbc_update_banner_closed",1,2592e3)}),jQuery(document).on("click","#spbc-g2fa-enable",function(e){e.preventDefault();e=spbcGetGoogleQrCode();e.success?(jQuery("#spbct-google-qr-code-img").html(e.data.img+"

"+e.data.code+"

"),jQuery("#spbct-google-qr-code input").val(""),jQuery("#spbct-google-qr-code").dialog({modal:!0,title:"Google authenticator activation",buttons:{Cancel:function(){jQuery(this).dialog("close")},Ok:function(){spbcCheckGoogleCode()}},draggable:!1,resizable:!1})):alert(spbcGetGoogleQrCode.data)}),jQuery(document).on("click","#spbc-g2fa-disable",function(e){e.preventDefault(),confirm("Are you sure?")&&spbcDisableG2fa(this)});function e(e,c,t){setTimeout(function(){null!==e&&(jQuery(".spbc-admin_bar--user_counter").html(e.count),e.count<=3?(jQuery("#wp-admin-bar-spbc_admin_bar__online_admins").show(),jQuery(".spbc-admin_bar--online_admins").html(e.users.join(", "))):jQuery("#wp-admin-bar-spbc_admin_bar__online_admins").hide()),spbc_sendAJAXRequest(c,t)},15e3)}1==+spbcSettings.admin_bar__admins_online_counter&&e(null,{action:"spbc_get_authorized_admins"},{callback:e}),jQuery("body").on("click",".spbc-notice .notice-dismiss",function(e){e=jQuery(e.target).parent(".notice").attr("id");e&&spbc_sendAJAXRequest({action:"spbc_dismiss_banner",banner_id:e},{callback:null})}),1==+spbcSettings.needToWhitelist&&spbc_sendAJAXRequest({action:"spbc_private_list_add"},{callback:null})}); //# sourceMappingURL=spbc-admin.min.js.map diff --git a/js/spbc-admin.min.js.map b/js/spbc-admin.min.js.map index 231f47dd9..f58bb3713 100644 --- a/js/spbc-admin.min.js.map +++ b/js/spbc-admin.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-admin.min.js","sources":["spbc-admin.js"],"sourcesContent":["function spbcGetGoogleQrCode() {\r\n\tvar data = {};\r\n\tvar res = {};\r\n\tdata.security = spbcSettings.ajax_nonce;\r\n\tdata.action = 'spbc_get_google_qr_code';\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: false,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tres = result;\r\n\t\t},\r\n\t});\r\n\treturn res;\r\n}\r\n\r\nfunction spbcCheckGoogleCode() {\r\n\tvar data = {};\r\n\tdata.security = spbcSettings.ajax_nonce;\r\n\tdata.action = 'spbc_check_google_code';\r\n\tdata.code = jQuery('#spbct-google-qr-code input').val();\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: false,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(result.success) {\r\n\t\t\t\tjQuery('#spbct-google-qr-code').dialog( \"close\" );\r\n\t\t\t\tdocument.location.reload();\r\n\t\t\t} else {\r\n\t\t\t\talert(result.data);\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}\r\n\r\nfunction spbcDisableG2fa( element ) {\r\n\tvar data = {};\r\n\tdata.security = spbcSettings.ajax_nonce;\r\n\tdata.action = 'spbc_disable_google_2fa';\r\n data.user_id = jQuery(element).data('user-id');\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: false,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(result.success) {\r\n\t\t\t\tdocument.location.reload();\r\n\t\t\t} else {\r\n\t\t\t\talert(result.data);\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\t\r\n\t// Auto update banner close handler \r\n\tjQuery('.spbc_update_notice').on('click', 'button', function(){\r\n\t\tspbc_setCookie('spbc_update_banner_closed', 1, 86400 * 30);\r\n\t});\r\n\r\n\t// Enable G2FA from user profile page\r\n\tjQuery(document).on('click', '#spbc-g2fa-enable', function(e){\r\n\r\n\t\te.preventDefault();\r\n\t\tvar spbcGoogleQrCode = spbcGetGoogleQrCode();\r\n\r\n\t\tif( spbcGoogleQrCode.success ) {\r\n\t\t\tvar qr_code_div = jQuery('#spbct-google-qr-code-img');\r\n\t\t\tqr_code_div.html(spbcGoogleQrCode.data.img + '

' + spbcGoogleQrCode.data.code + '

');\r\n\t\t\tjQuery('#spbct-google-qr-code input').val('');\r\n\t\t\tjQuery('#spbct-google-qr-code').dialog({\r\n\t\t\t\tmodal: true,\r\n\t\t\t\ttitle: 'Google authenticator activation',\r\n\t\t\t\tbuttons: {\r\n\t\t\t\t\tCancel: function() {\r\n\t\t\t\t\t\tjQuery( this ).dialog( \"close\" );\r\n\t\t\t\t\t},\r\n\t\t\t\t\tOk: function() {\r\n\t\t\t\t\t\tspbcCheckGoogleCode();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdraggable: false,\r\n\t\t\t\tresizable: false,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\talert(spbcGetGoogleQrCode.data);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t// Disable G2FA from user profile page\r\n\tjQuery(document).on('click', '#spbc-g2fa-disable', function(e){\r\n\r\n\t\te.preventDefault();\r\n\t\tif( confirm( 'Are you sure?' ) ) {\r\n\t\t\tspbcDisableG2fa( this );\r\n\t\t}\r\n\r\n\t});\r\n\r\n\tvar refresh_user_online_counter = function( result, data, params ){\r\n\t\tsetTimeout(function () {\r\n\t\t\tif( result !== null ){\r\n\t\t\t\tjQuery('.spbc-admin_bar--user_counter').html(result.count);\r\n\t\t\t\tif( result.count <= 3 ) {\r\n\t\t\t\t\tjQuery('#wp-admin-bar-spbc_admin_bar__online_admins').show();\r\n\t\t\t\t\tjQuery('.spbc-admin_bar--online_admins').html(result.users.join(', '));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tjQuery('#wp-admin-bar-spbc_admin_bar__online_admins').hide();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tspbc_sendAJAXRequest( data, params );\r\n\t\t}, 15000 );\r\n\t};\r\n\r\n\tif( +spbcSettings.admin_bar__admins_online_counter === 1 ) {\r\n\t\trefresh_user_online_counter(null, {action: 'spbc_get_authorized_admins'}, {callback: refresh_user_online_counter});\r\n\t}\r\n\r\n\t// Dismiss admin banner\r\n\tjQuery('body').on('click', '.spbc-notice .notice-dismiss', function(e){\r\n\t\tvar bannerId = jQuery(e.target).parent('.notice').attr('id');\r\n\t\tif( bannerId ) {\r\n\t\t\tspbc_sendAJAXRequest( { 'action' : 'spbc_dismiss_banner', 'banner_id' : bannerId }, { 'callback' : null } );\r\n\t\t}\r\n\t});\r\n\r\n\tif (+spbcSettings.needToWhitelist === 1) {\r\n\t\tspbc_sendAJAXRequest( { 'action' : 'spbc_private_list_add' }, { 'callback' : null } );\r\n\t}\r\n});"],"names":["spbcGetGoogleQrCode","data","res","security","spbcSettings","ajax_nonce","action","jQuery","ajax","type","async","url","ajaxurl","success","result","spbcCheckGoogleCode","code","val","dialog","document","location","reload","alert","spbcDisableG2fa","element","user_id","ready","on","spbc_setCookie","e","preventDefault","spbcGoogleQrCode","html","img","modal","title","buttons","Cancel","this","Ok","draggable","resizable","confirm","refresh_user_online_counter","params","setTimeout","count","show","users","join","hide","spbc_sendAJAXRequest","admin_bar__admins_online_counter","callback","bannerId","target","parent","attr","banner_id","needToWhitelist"],"mappings":"AAAA,SAASA,sBACR,IAAIC,EAAO,GACPC,EAAM,GAaV,OAZAD,EAAKE,SAAWC,aAAaC,WAC7BJ,EAAKK,OAAS,0BAEdC,OAAOC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,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-admin.min.js","sources":["spbc-admin.js"],"sourcesContent":["function spbcGetGoogleQrCode() {\n\tvar data = {};\n\tvar res = {};\n\tdata.security = spbcSettings.ajax_nonce;\n\tdata.action = 'spbc_get_google_qr_code';\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: false,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result){\n\t\t\tres = result;\n\t\t},\n\t});\n\treturn res;\n}\n\nfunction spbcCheckGoogleCode() {\n\tvar data = {};\n\tdata.security = spbcSettings.ajax_nonce;\n\tdata.action = 'spbc_check_google_code';\n\tdata.code = jQuery('#spbct-google-qr-code input').val();\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: false,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result){\n\t\t\tif(result.success) {\n\t\t\t\tjQuery('#spbct-google-qr-code').dialog( \"close\" );\n\t\t\t\tdocument.location.reload();\n\t\t\t} else {\n\t\t\t\talert(result.data);\n\t\t\t}\n\t\t},\n\t});\n}\n\nfunction spbcDisableG2fa( element ) {\n\tvar data = {};\n\tdata.security = spbcSettings.ajax_nonce;\n\tdata.action = 'spbc_disable_google_2fa';\n data.user_id = jQuery(element).data('user-id');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: false,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result){\n\t\t\tif(result.success) {\n\t\t\t\tdocument.location.reload();\n\t\t\t} else {\n\t\t\t\talert(result.data);\n\t\t\t}\n\t\t},\n\t});\n}\n\njQuery(document).ready(function(){\n\t\n\t// Auto update banner close handler \n\tjQuery('.spbc_update_notice').on('click', 'button', function(){\n\t\tspbc_setCookie('spbc_update_banner_closed', 1, 86400 * 30);\n\t});\n\n\t// Enable G2FA from user profile page\n\tjQuery(document).on('click', '#spbc-g2fa-enable', function(e){\n\n\t\te.preventDefault();\n\t\tvar spbcGoogleQrCode = spbcGetGoogleQrCode();\n\n\t\tif( spbcGoogleQrCode.success ) {\n\t\t\tvar qr_code_div = jQuery('#spbct-google-qr-code-img');\n\t\t\tqr_code_div.html(spbcGoogleQrCode.data.img + '

' + spbcGoogleQrCode.data.code + '

');\n\t\t\tjQuery('#spbct-google-qr-code input').val('');\n\t\t\tjQuery('#spbct-google-qr-code').dialog({\n\t\t\t\tmodal: true,\n\t\t\t\ttitle: 'Google authenticator activation',\n\t\t\t\tbuttons: {\n\t\t\t\t\tCancel: function() {\n\t\t\t\t\t\tjQuery( this ).dialog( \"close\" );\n\t\t\t\t\t},\n\t\t\t\t\tOk: function() {\n\t\t\t\t\t\tspbcCheckGoogleCode();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdraggable: false,\n\t\t\t\tresizable: false,\n\t\t\t});\n\t\t} else {\n\t\t\talert(spbcGetGoogleQrCode.data);\n\t\t}\n\n\t});\n\n\t// Disable G2FA from user profile page\n\tjQuery(document).on('click', '#spbc-g2fa-disable', function(e){\n\n\t\te.preventDefault();\n\t\tif( confirm( 'Are you sure?' ) ) {\n\t\t\tspbcDisableG2fa( this );\n\t\t}\n\n\t});\n\n\tvar refresh_user_online_counter = function( result, data, params ){\n\t\tsetTimeout(function () {\n\t\t\tif( result !== null ){\n\t\t\t\tjQuery('.spbc-admin_bar--user_counter').html(result.count);\n\t\t\t\tif( result.count <= 3 ) {\n\t\t\t\t\tjQuery('#wp-admin-bar-spbc_admin_bar__online_admins').show();\n\t\t\t\t\tjQuery('.spbc-admin_bar--online_admins').html(result.users.join(', '));\n\t\t\t\t}else{\n\t\t\t\t\tjQuery('#wp-admin-bar-spbc_admin_bar__online_admins').hide();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tspbc_sendAJAXRequest( data, params );\n\t\t}, 15000 );\n\t};\n\n\tif( +spbcSettings.admin_bar__admins_online_counter === 1 ) {\n\t\trefresh_user_online_counter(null, {action: 'spbc_get_authorized_admins'}, {callback: refresh_user_online_counter});\n\t}\n\n\t// Dismiss admin banner\n\tjQuery('body').on('click', '.spbc-notice .notice-dismiss', function(e){\n\t\tvar bannerId = jQuery(e.target).parent('.notice').attr('id');\n\t\tif( bannerId ) {\n\t\t\tspbc_sendAJAXRequest( { 'action' : 'spbc_dismiss_banner', 'banner_id' : bannerId }, { 'callback' : null } );\n\t\t}\n\t});\n\n\tif (+spbcSettings.needToWhitelist === 1) {\n\t\tspbc_sendAJAXRequest( { 'action' : 'spbc_private_list_add' }, { 'callback' : null } );\n\t}\n});"],"names":["spbcGetGoogleQrCode","data","res","security","spbcSettings","ajax_nonce","action","jQuery","ajax","type","async","url","ajaxurl","success","result","spbcCheckGoogleCode","code","val","dialog","document","location","reload","alert","spbcDisableG2fa","element","user_id","ready","on","spbc_setCookie","e","preventDefault","spbcGoogleQrCode","html","img","modal","title","buttons","Cancel","this","Ok","draggable","resizable","confirm","refresh_user_online_counter","params","setTimeout","count","show","users","join","hide","spbc_sendAJAXRequest","admin_bar__admins_online_counter","callback","bannerId","target","parent","attr","banner_id","needToWhitelist"],"mappings":"AAAA,SAASA,sBACR,IAAIC,EAAO,GACPC,EAAM,GAaV,OAZAD,EAAKE,SAAWC,aAAaC,WAC7BJ,EAAKK,OAAS,0BAEdC,OAAOC,KAAK,CACXC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKP,aAAaQ,QAClBX,KAAMA,EACNY,QAAS,SAASC,GACjBZ,EAAMY,CACP,CACD,CAAC,EACMZ,CACR,CAEA,SAASa,sBACR,IAAId,EAAO,GACXA,EAAKE,SAAWC,aAAaC,WAC7BJ,EAAKK,OAAS,yBACdL,EAAKe,KAAOT,OAAO,6BAA6B,EAAEU,IAAI,EAEtDV,OAAOC,KAAK,CACXC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKP,aAAaQ,QAClBX,KAAMA,EACNY,QAAS,SAASC,GACdA,EAAOD,SACTN,OAAO,uBAAuB,EAAEW,OAAQ,OA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,CAAC,EAEiC,SAA9BK,EAAwC7B,EAAQb,EAAM2C,GACzDC,WAAW,WACK,OAAX/B,IACHP,OAAO,+BAA+B,EAAEyB,KAAKlB,EAAOgC,KAAK,EACrDhC,EAAOgC,OAAS,GACnBvC,OAAO,6CAA6C,EAAEwC,KAAK,EAC3DxC,OAAO,gCAAgC,EAAEyB,KAAKlB,EAAOkC,MAAMC,KAAK,IAAI,CAAC,GAErE1C,OAAO,6CAA6C,EAAE2C,KAAK,GAI7DC,qBAAsBlD,EAAM2C,CAAO,CACpC,EAAG,IAAM,CACV,CAEuD,GAAnD,CAACxC,aAAagD,kCACjBT,EAA4B,KAAM,CAACrC,OAAQ,4BAA4B,EAAG,CAAC+C,SAAUV,CAA2B,CAAC,EAIlHpC,OAAO,MAAM,EAAEoB,GAAG,QAAS,+BAAgC,SAASE,GAC/DyB,EAAW/C,OAAOsB,EAAE0B,MAAM,EAAEC,OAAO,SAAS,EAAEC,KAAK,IAAI,EACvDH,GACHH,qBAAsB,CAAE7C,OAAW,sBAAuBoD,UAAcJ,CAAS,EAAG,CAAED,SAAa,IAAK,CAAE,CAE5G,CAAC,EAEqC,GAAlC,CAACjD,aAAauD,iBACjBR,qBAAsB,CAAE7C,OAAW,uBAAwB,EAAG,CAAE+C,SAAa,IAAK,CAAE,CAEtF,CAAC"} \ No newline at end of file diff --git a/js/spbc-common.min.js.map b/js/spbc-common.min.js.map index e8dc83bd2..2c18e12d3 100644 --- a/js/spbc-common.min.js.map +++ b/js/spbc-common.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-common.min.js","sources":["spbc-common.js"],"sourcesContent":["function spbc_timestamp(){\r\n\treturn Math.floor(+new Date() / 1000);\r\n}\r\n\r\n// Hightlights element\r\nfunction spbcHighlightElement(id, times){\r\n\ttimes = times-1 || 0;\r\n\tjQuery(\"html, body\").animate({ scrollTop: jQuery(jQuery('#'+id)).offset().top - 100 }, \"slow\");\r\n\tjQuery('#'+id).addClass('spbc_highlighted');\r\n\tjQuery('#'+id).animate({outlineColor: \"rgba(255, 0, 0, 1.0)\" }, 400, 'linear', function(){\r\n\t\tjQuery('#'+id).animate({outlineColor: \"rgba(255, 0, 0, 0.0)\" }, 400, 'linear', function(){\r\n\t\t\tif(times>0){\r\n\t\t\t\tspbcHighlightElement(id, times);\r\n\t\t\t}else{\r\n\t\t\t\tjQuery('#'+id).removeClass('spbc_highlighted');\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}\r\n\r\nfunction spbc_sendAJAXRequest(data, params, obj){\r\n\r\n\tvar dataType = params.notJson ? 'text' : 'json';\r\n\r\n\t// Default params\r\n\tvar button = params.button || null;\r\n\tvar spinner = params.spinner || null;\r\n\tvar progressbar = params.progressbar || null;\r\n\tvar callback = params.callback || null;\r\n\tvar notJson = params.notJson || null;\r\n\tvar timeout = params.timeout || 15000;\r\n\tvar obj = obj || null;\r\n\tvar context = params.context || this;\r\n\r\n\t// Button and spinner\r\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\r\n\tif(spinner) jQuery(spinner).css('display', 'inline');\r\n\r\n\t// Adding security code\r\n\tdata.security = spbcSettings.ajax_nonce;\r\n\tdata.no_cache = Math.random();\r\n\r\n\t// Using passed successCallback() or default\r\n\tvar success = params.success || function(result){\r\n\t\tif(button){\r\n\t\t\tbutton.removeAttribute('disabled');\r\n\t\t\tbutton.style.cursor = 'pointer';\r\n\t\t}\r\n\r\n\t\tif(spinner) {\r\n\t\t\tjQuery(spinner).css('display', 'none');\r\n\t\t}\r\n\r\n\t\tif(!notJson && typeof result !== 'object'){\r\n\t\t\tresult = JSON.parse(result);\r\n\t\t}\r\n\r\n\t\tif(result.error){\r\n\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\r\n\t\t\tlet error_comment = typeof result.error_comment !== 'undefined' ? result.error_comment : null;\r\n\t\t\terrorOutput( result.error, error_comment );\r\n\t\t}else if(callback){\r\n\t\t\t\tcallback(result, data, params, obj);\r\n\t\t}\r\n\t};\r\n\r\n\t// Using passed successCallback() or default\r\n\tvar error = params.error || function(jqXHR, textStatus, errorThrown){\r\n\t\tif(button){\r\n\t\t\tbutton.removeAttribute('disabled');\r\n\t\t\tbutton.style.cursor = 'pointer';\r\n\t\t}\r\n\t\tif(spinner){\r\n\t\t\tjQuery(spinner).css('display', 'none');\r\n\t\t}\r\n\r\n\t\tconsole.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\r\n\t\tconsole.log( textStatus );\r\n\t\tconsole.log( errorThrown );\r\n\t\tconsole.log( jqXHR );\r\n\r\n\t\terrorOutput( textStatus );\r\n\t};\r\n\r\n\tvar errorOutput = params.errorOutput || function( msg ){};\r\n\r\n\tjQuery.ajax({\r\n\t\tcontext: context,\r\n\t\ttype: \"POST\",\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tdataType: dataType,\r\n\t\tsuccess: success,\r\n\t\terror: error,\r\n\t\ttimeout: timeout,\r\n\t});\r\n}"],"names":["spbc_timestamp","Math","floor","Date","spbcHighlightElement","id","times","jQuery","animate","scrollTop","offset","top","addClass","outlineColor","removeClass","spbc_sendAJAXRequest","data","params","obj","dataType","notJson","button","spinner","progressbar","callback","timeout","context","this","success","setAttribute","style","cursor","css","security","spbcSettings","ajax_nonce","no_cache","random","result","error_comment","removeAttribute","JSON","parse","error","setTimeout","fadeOut","errorOutput","jqXHR","textStatus","errorThrown","console","log","msg","ajax","type","url","ajaxurl"],"mappings":"AAAA,SAASA,iBACR,OAAOC,KAAKC,MAAM,CAAC,IAAIC,KAAS,GAAI,CACrC,CAGA,SAASC,qBAAqBC,EAAIC,GACjCA,EAAQA,EAAM,GAAK,EACnBC,OAAO,YAAY,EAAEC,QAAQ,CAAEC,UAAWF,OAAOA,OAAO,IAAIF,CAAE,CAAC,EAAEK,OAAO,EAAEC,IAAM,GAAI,EAAG,MAAM,EAC7FJ,OAAO,IAAIF,CAAE,EAAEO,SAAS,kBAAkB,EAC1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AErC,GAGIyB,EAAQ1B,EAAO0B,OAAS,SAASI,EAAOC,EAAYC,GACpD5B,IACFA,EAAOmB,gBAAgB,UAAU,EACjCnB,EAAOS,MAAMC,OAAS,WAEpBT,GACFf,OAAOe,CAAO,EAAEU,IAAI,UAAW,MAAM,EAGtCkB,QAAQC,IAAK,sBAAuB,aAAc,EAClDD,QAAQC,IAAKH,CAAW,EACxBE,QAAQC,IAAKF,CAAY,EACzBC,QAAQC,IAAKJ,CAAM,EAEnBD,EAAaE,CAAW,CACzB,EAEIF,EAAc7B,EAAO6B,aAAe,SAAUM,KAElD7C,OAAO8C,KAAK,CACX3B,QAAUA,EACV4B,KAAU,OACVC,IAAUrB,aAAasB,QACvBxC,KAAUA,EACVG,SAAUA,EACVS,QAAUA,EACVe,MAAUA,EACVlB,QAAUA,CACX,CAAC,CACF"} \ No newline at end of file +{"version":3,"file":"spbc-common.min.js","sources":["spbc-common.js"],"sourcesContent":["function spbc_timestamp(){\n\treturn Math.floor(+new Date() / 1000);\n}\n\n// Hightlights element\nfunction spbcHighlightElement(id, times){\n\ttimes = times-1 || 0;\n\tjQuery(\"html, body\").animate({ scrollTop: jQuery(jQuery('#'+id)).offset().top - 100 }, \"slow\");\n\tjQuery('#'+id).addClass('spbc_highlighted');\n\tjQuery('#'+id).animate({outlineColor: \"rgba(255, 0, 0, 1.0)\" }, 400, 'linear', function(){\n\t\tjQuery('#'+id).animate({outlineColor: \"rgba(255, 0, 0, 0.0)\" }, 400, 'linear', function(){\n\t\t\tif(times>0){\n\t\t\t\tspbcHighlightElement(id, times);\n\t\t\t}else{\n\t\t\t\tjQuery('#'+id).removeClass('spbc_highlighted');\n\t\t\t}\n\t\t});\n\t});\n}\n\nfunction spbc_sendAJAXRequest(data, params, obj){\n\n\tvar dataType = params.notJson ? 'text' : 'json';\n\n\t// Default params\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\tvar callback = params.callback || null;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar context = params.context || this;\n\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\t// Adding security code\n\tdata.security = spbcSettings.ajax_nonce;\n\tdata.no_cache = Math.random();\n\n\t// Using passed successCallback() or default\n\tvar success = params.success || function(result){\n\t\tif(button){\n\t\t\tbutton.removeAttribute('disabled');\n\t\t\tbutton.style.cursor = 'pointer';\n\t\t}\n\n\t\tif(spinner) {\n\t\t\tjQuery(spinner).css('display', 'none');\n\t\t}\n\n\t\tif(!notJson && typeof result !== 'object'){\n\t\t\tresult = JSON.parse(result);\n\t\t}\n\n\t\tif(result.error){\n\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\tlet error_comment = typeof result.error_comment !== 'undefined' ? result.error_comment : null;\n\t\t\terrorOutput( result.error, error_comment );\n\t\t}else if(callback){\n\t\t\t\tcallback(result, data, params, obj);\n\t\t}\n\t};\n\n\t// Using passed successCallback() or default\n\tvar error = params.error || function(jqXHR, textStatus, errorThrown){\n\t\tif(button){\n\t\t\tbutton.removeAttribute('disabled');\n\t\t\tbutton.style.cursor = 'pointer';\n\t\t}\n\t\tif(spinner){\n\t\t\tjQuery(spinner).css('display', 'none');\n\t\t}\n\n\t\tconsole.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\n\t\tconsole.log( textStatus );\n\t\tconsole.log( errorThrown );\n\t\tconsole.log( jqXHR );\n\n\t\terrorOutput( textStatus );\n\t};\n\n\tvar errorOutput = params.errorOutput || function( msg ){};\n\n\tjQuery.ajax({\n\t\tcontext: context,\n\t\ttype: \"POST\",\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tdataType: dataType,\n\t\tsuccess: success,\n\t\terror: error,\n\t\ttimeout: timeout,\n\t});\n}"],"names":["spbc_timestamp","Math","floor","Date","spbcHighlightElement","id","times","jQuery","animate","scrollTop","offset","top","addClass","outlineColor","removeClass","spbc_sendAJAXRequest","data","params","obj","dataType","notJson","button","spinner","progressbar","callback","timeout","context","this","success","setAttribute","style","cursor","css","security","spbcSettings","ajax_nonce","no_cache","random","result","error_comment","removeAttribute","JSON","parse","error","setTimeout","fadeOut","errorOutput","jqXHR","textStatus","errorThrown","console","log","msg","ajax","type","url","ajaxurl"],"mappings":"AAAA,SAASA,iBACR,OAAOC,KAAKC,MAAM,CAAC,IAAIC,KAAS,GAAI,CACrC,CAGA,SAASC,qBAAqBC,EAAIC,GACjCA,EAAQA,EAAM,GAAK,EACnBC,OAAO,YAAY,EAAEC,QAAQ,CAAEC,UAAWF,OAAOA,OAAO,IAAIF,CAAE,CAAC,EAAEK,OAAO,EAAEC,IAAM,GAAI,EAAG,MAAM,EAC7FJ,OAAO,IAAIF,CAAE,EAAEO,SAAS,kBAAkB,EAC1CL,OAAO,IAAIF,CAAE,EAAEG,QAAQ,CAACK,aAAc,sBAAuB,EAAG,IAAK,SAAU,WAC9EN,OAAO,IAAIF,CAAE,EAAEG,QAAQ,CAACK,aAAc,sBAAuB,EAAG,IAAK,SAAU,WACrE,EAANP,EACFF,qBAAqBC,EAAIC,CAAK,EAE9BC,OAAO,IAAIF,CAAE,EAAES,YAAY,kBAAkB,CAE/C,CAAC,CACF,CAAC,CACF,CAEA,SAASC,qBAAqBC,EAAMC,EAAQC,GAE3C,IAAIC,EAAcF,EAAOG,QAAU,OAAS,OAGxCC,EAAcJ,EAAOI,QAAe,KACpCC,EAAcL,EAAOK,SAAe,KACpCC,EAAcN,EAAOM,aAAe,KACpCC,EAAcP,EAAOO,UAAe,KACpCJ,EAAcH,EAAOG,SAAe,KACpCK,EAAcR,EAAOQ,SAAe,KACpCP,EAAcA,GAAsB,KACpCQ,EAAcT,EAAOS,SAAeC,KAWpCC,GARDP,IAAUA,EAAOQ,aAAa,WAAY,UAAU,EAAGR,EAAOS,MAAMC,OAAS,eAC7ET,GAASf,OAAOe,CAAO,EAAEU,IAAI,UAAW,QAAQ,EAGnDhB,EAAKiB,SAAWC,aAAaC,WAC7BnB,EAAKoB,SAAWnC,KAAKoC,OAAO,EAGdpB,EAAOW,SAAW,SAASU,GAcxC,IAEKC,EAfFlB,IACFA,EAAOmB,gBAAgB,UAAU,EACjCnB,EAAOS,MAAMC,OAAS,WAGpBT,GACFf,OAAOe,CAAO,EAAEU,IAAI,UAAW,MAAM,GAIrCM,EADGlB,GAA6B,UAAlB,OAAOkB,EAInBA,EAHOG,KAAKC,MAAMJ,CAAM,GAGjBK,OACTC,WAAW,WAAerB,GAAaA,EAAYsB,QAAQ,MAAM,CAAG,EAAG,GAAI,EACvEN,EAAgD,KAAA,IAAzBD,EAAOC,cAAgCD,EAAOC,cAAgB,KACzFO,EAAaR,EAAOK,MAAOJ,CAAc,GACjCf,GACPA,EAASc,EAAQtB,EAAMC,EAAQC,CAAG,CAErC,GAGIyB,EAAQ1B,EAAO0B,OAAS,SAASI,EAAOC,EAAYC,GACpD5B,IACFA,EAAOmB,gBAAgB,UAAU,EACjCnB,EAAOS,MAAMC,OAAS,WAEpBT,GACFf,OAAOe,CAAO,EAAEU,IAAI,UAAW,MAAM,EAGtCkB,QAAQC,IAAK,sBAAuB,aAAc,EAClDD,QAAQC,IAAKH,CAAW,EACxBE,QAAQC,IAAKF,CAAY,EACzBC,QAAQC,IAAKJ,CAAM,EAEnBD,EAAaE,CAAW,CACzB,EAEIF,EAAc7B,EAAO6B,aAAe,SAAUM,KAElD7C,OAAO8C,KAAK,CACX3B,QAAUA,EACV4B,KAAU,OACVC,IAAUrB,aAAasB,QACvBxC,KAAUA,EACVG,SAAUA,EACVS,QAAUA,EACVe,MAAUA,EACVlB,QAAUA,CACX,CAAC,CACF"} \ No newline at end of file diff --git a/js/spbc-cookie.min.js.map b/js/spbc-cookie.min.js.map index 8065c4002..a8796bfe5 100644 --- a/js/spbc-cookie.min.js.map +++ b/js/spbc-cookie.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-cookie.min.js","sources":["spbc-cookie.js"],"sourcesContent":["function spbc_setCookie( cookies, value, expires ){\r\n\r\n if( typeof cookies === 'string' && ( typeof value === 'string' || typeof value === 'number' ) ){\r\n cookies = [ [ cookies, value, expires ] ];\r\n }\r\n\r\n // Cookies disabled\r\n if( +spbcPublic.data__set_cookies === 0 ){\r\n return;\r\n\r\n // Using traditional cookies\r\n }else if( +spbcPublic.data__set_cookies === 1 ){\r\n cookies.forEach( function (item, i, arr\t) {\r\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\r\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\r\n document.cookie = item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\r\n });\r\n\r\n // Using alternative cookies\r\n }else if( +spbcPublic.data__set_cookies === 2 ){\r\n\r\n // Using REST API handler\r\n if( +spbcPublic.data__set_cookies__alt_sessions_type === 1 ){\r\n spbc_sendRESTRequest(\r\n 'alt_sessions',\r\n {\r\n method: 'POST',\r\n data: { cookies: cookies }\r\n }\r\n );\r\n\r\n }\r\n // Using AJAX request and handler\r\n // }else if( +spbcPublic.data__set_cookies__alt_sessions_type === 2 ) {\r\n // apbct_public_sendAJAX(\r\n // {\r\n // action: 'apbct_alt_session__save__AJAX',\r\n // cookies: cookies,\r\n // },\r\n // {\r\n // apbct_ajax: 1,\r\n // notJson: 1,\r\n // }\r\n // );\r\n // }\r\n }\r\n}\r\n\r\nfunction spbc_sendRESTRequest( route, params ) {\r\n\r\n var callback = params.callback || null;\r\n var data = params.data || [];\r\n var method = params.method || 'POST';\r\n\r\n jQuery.ajax({\r\n type: method,\r\n url: spbcPublic._rest_url + 'cleantalk-security/v1/' + route,\r\n data: data,\r\n beforeSend : function ( xhr ) {\r\n xhr.setRequestHeader( 'X-WP-Nonce', spbcPublic._rest_nonce );\r\n },\r\n success: function(result){\r\n if(result.error){\r\n console.log('Security by Cleantalk. Error: ' + (result.error || 'Unknown'));\r\n }else{\r\n if(callback) {\r\n var obj = null;\r\n callback(result, route, params, obj);\r\n }\r\n }\r\n },\r\n error: function(jqXHR, textStatus, errorThrown){\r\n if( errorThrown ) {\r\n console.log('SPBCT_REST_ERROR');\r\n console.log(jqXHR);\r\n console.log(textStatus);\r\n console.log('Security by Cleantalk plugin REST API error: ' + errorThrown + ' Please, contact Cleantalk tech support https://wordpress.org/support/plugin/security-malware-firewall/');\r\n }\r\n },\r\n });\r\n\r\n}"],"names":["spbc_setCookie","cookies","value","expires","spbcPublic","data__set_cookies","forEach","item","i","arr","ctSecure","location","protocol","document","cookie","encodeURIComponent","data__set_cookies__alt_sessions_type","spbc_sendRESTRequest","method","data","route","params","callback","jQuery","ajax","type","url","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","success","result","error","console","log","jqXHR","textStatus","errorThrown"],"mappings":"AAAA,SAASA,eAAgBC,EAASC,EAAOC,GAEd,UAAnB,OAAOF,GAA2C,UAAjB,OAAOC,GAAuC,UAAjB,OAAOA,IACrED,EAAU,CAAE,CAAEA,EAASC,EAAOC,KAII,GAAlC,CAACC,WAAWC,oBAI4B,GAAlC,CAACD,WAAWC,kBAClBJ,EAAQK,QAAS,SAAUC,EAAMC,EAAGC,GAChC,IAAIN,EAA6B,KAAA,IAAZI,EAAK,GAAqB,WAAaJ,EAAU,KAAO,GACzEO,EAAiC,WAAtBC,SAASC,SAAwB,WAAa,GAC7DC,SAASC,OAASP,EAAK,GAAK,IAAMQ,mBAAmBR,EAAK,EAAE,EAAI,KAAOJ,EAAU,uBAAyBO,CAC9G,CAAC,EAGuC,GAAlC,CAACN,WAAWC,mBAGuC,GAArD,CAACD,WAAWY,sCACZC,qBACI,eACA,CACIC,OAAQ,OACRC,KAAM,CAAElB,QAASA,CAAQ,CAC7B,CACJ,EAiBZ,CAEA,SAASgB,qBAAsBG,EAAOC,GAElC,IAAIC,EAAWD,EAAOC,UAAY,KAC9BH,EAAWE,EAAOF,MAAQ,GAC1BD,EAAWG,EAAOH,QAAU,OAEhCK,OAAOC,KAAK,CACRC,KAAMP,EACNQ,IAAKtB,WAAWuB,UAAY,yBAA2BP,EACvDD,KAAMA,EACNS,WAAa,SAAWC,GACpBA,EAAIC,iBAAkB,aAAc1B,WAAW2B,WAAY,CAC/D,EACAC,QAAS,SAASC,GACXA,EAAOC,MACNC,QAAQC,IAAI,kCAAoCH,EAAOC,OAAS,UAAU,EAEvEZ,GAECA,EAASW,EAAQb,EAAOC,EADd,IACyB,CAG/C,EACAa,MAAO,SAASG,EAAOC,EAAYC,GAC3BA,IACAJ,QAAQC,IAAI,kBAAkB,EAC9BD,QAAQC,IAAIC,CAAK,EACjBF,QAAQC,IAAIE,CAAU,EACtBH,QAAQC,IAAI,gDAAkDG,EAAc,yGAAyG,EAE7L,CACJ,CAAC,CAEL"} \ No newline at end of file +{"version":3,"file":"spbc-cookie.min.js","sources":["spbc-cookie.js"],"sourcesContent":["function spbc_setCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && ( typeof value === 'string' || typeof value === 'number' ) ){\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( +spbcPublic.data__set_cookies === 0 ){\n return;\n\n // Using traditional cookies\n }else if( +spbcPublic.data__set_cookies === 1 ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( +spbcPublic.data__set_cookies === 2 ){\n\n // Using REST API handler\n if( +spbcPublic.data__set_cookies__alt_sessions_type === 1 ){\n spbc_sendRESTRequest(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n }\n // Using AJAX request and handler\n // }else if( +spbcPublic.data__set_cookies__alt_sessions_type === 2 ) {\n // apbct_public_sendAJAX(\n // {\n // action: 'apbct_alt_session__save__AJAX',\n // cookies: cookies,\n // },\n // {\n // apbct_ajax: 1,\n // notJson: 1,\n // }\n // );\n // }\n }\n}\n\nfunction spbc_sendRESTRequest( route, params ) {\n\n var callback = params.callback || null;\n var data = params.data || [];\n var method = params.method || 'POST';\n\n jQuery.ajax({\n type: method,\n url: spbcPublic._rest_url + 'cleantalk-security/v1/' + route,\n data: data,\n beforeSend : function ( xhr ) {\n xhr.setRequestHeader( 'X-WP-Nonce', spbcPublic._rest_nonce );\n },\n success: function(result){\n if(result.error){\n console.log('Security by Cleantalk. Error: ' + (result.error || 'Unknown'));\n }else{\n if(callback) {\n var obj = null;\n callback(result, route, params, obj);\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown){\n if( errorThrown ) {\n console.log('SPBCT_REST_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log('Security by Cleantalk plugin REST API error: ' + errorThrown + ' Please, contact Cleantalk tech support https://wordpress.org/support/plugin/security-malware-firewall/');\n }\n },\n });\n\n}"],"names":["spbc_setCookie","cookies","value","expires","spbcPublic","data__set_cookies","forEach","item","i","arr","ctSecure","location","protocol","document","cookie","encodeURIComponent","data__set_cookies__alt_sessions_type","spbc_sendRESTRequest","method","data","route","params","callback","jQuery","ajax","type","url","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","success","result","error","console","log","jqXHR","textStatus","errorThrown"],"mappings":"AAAA,SAASA,eAAgBC,EAASC,EAAOC,GAEd,UAAnB,OAAOF,GAA2C,UAAjB,OAAOC,GAAuC,UAAjB,OAAOA,IACrED,EAAU,CAAE,CAAEA,EAASC,EAAOC,KAII,GAAlC,CAACC,WAAWC,oBAI4B,GAAlC,CAACD,WAAWC,kBAClBJ,EAAQK,QAAS,SAAUC,EAAMC,EAAGC,GAChC,IAAIN,EAA6B,KAAA,IAAZI,EAAK,GAAqB,WAAaJ,EAAU,KAAO,GACzEO,EAAiC,WAAtBC,SAASC,SAAwB,WAAa,GAC7DC,SAASC,OAASP,EAAK,GAAK,IAAMQ,mBAAmBR,EAAK,EAAE,EAAI,KAAOJ,EAAU,uBAAyBO,CAC9G,CAAC,EAGuC,GAAlC,CAACN,WAAWC,mBAGuC,GAArD,CAACD,WAAWY,sCACZC,qBACI,eACA,CACIC,OAAQ,OACRC,KAAM,CAAElB,QAASA,CAAQ,CAC7B,CACJ,EAiBZ,CAEA,SAASgB,qBAAsBG,EAAOC,GAElC,IAAIC,EAAWD,EAAOC,UAAY,KAC9BH,EAAWE,EAAOF,MAAQ,GAC1BD,EAAWG,EAAOH,QAAU,OAEhCK,OAAOC,KAAK,CACRC,KAAMP,EACNQ,IAAKtB,WAAWuB,UAAY,yBAA2BP,EACvDD,KAAMA,EACNS,WAAa,SAAWC,GACpBA,EAAIC,iBAAkB,aAAc1B,WAAW2B,WAAY,CAC/D,EACAC,QAAS,SAASC,GACXA,EAAOC,MACNC,QAAQC,IAAI,kCAAoCH,EAAOC,OAAS,UAAU,EAEvEZ,GAECA,EAASW,EAAQb,EAAOC,EADd,IACyB,CAG/C,EACAa,MAAO,SAASG,EAAOC,EAAYC,GAC3BA,IACAJ,QAAQC,IAAI,kBAAkB,EAC9BD,QAAQC,IAAIC,CAAK,EACjBF,QAAQC,IAAIE,CAAU,EACtBH,QAAQC,IAAI,gDAAkDG,EAAc,yGAAyG,EAE7L,CACJ,CAAC,CAEL"} \ No newline at end of file diff --git a/js/spbc-dashboard-widget.min.js.map b/js/spbc-dashboard-widget.min.js.map index 199eb6815..313dfb739 100644 --- a/js/spbc-dashboard-widget.min.js.map +++ b/js/spbc-dashboard-widget.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-dashboard-widget.min.js","sources":["spbc-dashboard-widget.js"],"sourcesContent":["jQuery(document).ready(function(){\r\n\r\n\t// Set \"refresh\" link handler\r\n\tjQuery(\".spbc_widget_refresh_link\").on('click', function(){\r\n\t\tjQuery('.spbc_preloader').show();\r\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#spbc_widget_wrapper').offset().top - 130);}, 1);\r\n\t\tsetTimeout(function(){jQuery(\"#spbc_refresh_form\").submit();}, 2500);\r\n\t});\r\n\r\n\tif(location.hash == '#ct_widget')\r\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#spbc_widget_wrapper').offset().top - 130);}, 1);\r\n\r\n\t// Fixing default wrapper style\r\n\tjQuery(\"#spbc_widget_wrapper\").parent().css('padding', 0);\r\n\r\n\tlocale = navigator.language || navigator.userLanguage;\r\n\r\n\tvar date_formatter = new Intl.DateTimeFormat(locale, {\r\n\t\tmonth: \"short\",\r\n\t\tday: \"numeric\"\r\n\t});\r\n\r\n\tfunction reformatWidgetData(spbcDashboardWidget){\r\n\t\tlet widgetData = {'labels':[],'counts':[]}\r\n\t\tfor (let i = 0; i < spbcDashboardWidget.length; i++) {\r\n\t\t\twidgetData.labels.push(date_formatter.format(new Date(spbcDashboardWidget[i]['0'])))\r\n\t\t\twidgetData.counts.push(spbcDashboardWidget[i]['1'])\r\n\t\t}\r\n\t\treturn widgetData\r\n\t}\r\n\r\n\tconst ctx = document.getElementById('spbc_widget_chart')\r\n\t//let widgetData = reformatWidgetData(spbcDashboardWidget['data'])\r\n\tlet widgetDataFW = reformatWidgetData(spbcDashboardWidget['data_fw'])\r\n\tlet widgetDataBFP = reformatWidgetData(spbcDashboardWidget['data_bfp'])\r\n\r\n\tnew Chart(ctx, {\r\n\t\ttype: 'bar',\r\n\t\tdata: {\r\n\t\t\tlabels: widgetDataFW.labels,\r\n\t\t\tdatasets: [\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Visitors blocked by Bruteforce Protection',\r\n\t\t\t\t\tdata: widgetDataBFP.counts,\r\n\t\t\t\t\tborderWidth: 1,\r\n\t\t\t\t\tbackgroundColor: 'gray'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Visitors blocked by Firewall',\r\n\t\t\t\t\tdata: widgetDataFW.counts,\r\n\t\t\t\t\tborderWidth: 1,\r\n\t\t\t\t\tbackgroundColor: 'steelblue'\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\toptions: {\r\n\t\t\tlegend: {\r\n\t\t\t\tdisplay: false\r\n\t\t\t},\r\n\t\t\tmaintainAspectRatio: false,\r\n\t\t\tresponsive: true,\r\n\t\t\tscales: {\r\n\t\t\t\ty: {\r\n\t\t\t\t\tticks: {\r\n\t\t\t\t\t\tprecision: 0\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t\ttitle: {\r\n\t\t\t\tdisplay: true,\r\n\t\t\t\ttext: 'Blocked attacks',\r\n\t\t\t\tfontSize: 18\r\n\t\t\t},\r\n\t\t\tplugins: {\r\n\t\t\t\tlegend: {\r\n\t\t\t\t\tdisplay: false\r\n\t\t\t\t},\r\n\t\t\t\ttitle: {\r\n\t\t\t\t\tdisplay: true,\r\n\t\t\t\t\ttext: 'Blocked attacks',\r\n\t\t\t\t\tfont: {\r\n\t\t\t\t\t\tsize: 18,\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t\telements: {\r\n\t\t\t\tbar:{\r\n\t\t\t\t\tbackgroundColor: 'steelblue'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tanimations: {\r\n\t\t\t\ttension: {\r\n\t\t\t\t\tduration: 1000,\r\n\t\t\t\t\teasing: 'linear',\r\n\t\t\t\t\tfrom: 1,\r\n\t\t\t\t\tto: 0,\r\n\t\t\t\t\tloop: true\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t}\r\n\t});\r\n\r\n});\r\n"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","locale","navigator","language","userLanguage","date_formatter","Intl","DateTimeFormat","month","day","reformatWidgetData","spbcDashboardWidget","let","widgetData","labels","counts","i","length","push","format","Date","ctx","getElementById","widgetDataFW","widgetDataBFP","Chart","type","data","datasets","label","borderWidth","backgroundColor","options","legend","display","maintainAspectRatio","responsive","scales","y","ticks","precision","title","text","fontSize","plugins","font","size","elements","bar","animations","tension","duration","easing","from","to","loop"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAGtBF,OAAO,2BAA2B,EAAEG,GAAG,QAAS,WAC/CH,OAAO,iBAAiB,EAAEI,KAAK,EAC/BC,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsB,EAAEQ,OAAO,EAAEC,IAAM,GAAG,CAAE,EAAG,CAAC,EAChGJ,WAAW,WAAWL,OAAO,oBAAoB,EAAEU,OAAO,CAAE,EAAG,IAAI,CACpE,CAAC,EAEmB,cAAjBC,SAASC,MACXP,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsB,EAAEQ,OAAO,EAAEC,IAAM,GAAG,CAAE,EAAG,CAAC,EAGjGT,OAAO,sBAAsB,EAAEa,OAAO,EAAEC,IAAI,UAAW,CAAC,EAExDC,OAASC,UAAUC,UAAYD,UAAUE,aAEzC,IAAIC,EAAiB,IAAIC,KAAKC,eAAeN,OAAQ,CACpDO,MAAO,QACPC,IAAK,SACN,CAAC,EAED,SAASC,EAAmBC,GAC3BC,IAAIC,EAAa,CAACC,OAAS,GAAGC,OAAS,EAAE,EACzC,IAAKH,IAAII,EAAI,EAAGA,EAAIL,EAAoBM,OAAQD,CAAC,GAChDH,EAAWC,OAAOI,KAAKb,EAAec,OAAO,IAAIC,KAAKT,EAAoBK,GAAG,EAAI,CAAC,CAAC,EACnFH,EAAWE,OAAOG,KAAKP,EAAoBK,GAAG,EAAI,EAEnD,OAAOH,CACR,CAEA,IAAMQ,EAAMlC,SAASmC,eAAe,mBAAmB,EAEnDC,EAAeb,EAAmBC,oBAA6B,OAAC,EAChEa,EAAgBd,EAAmBC,oBAA8B,QAAC,EAEtE,IAAIc,MAAMJ,EAAK,CACdK,KAAM,MACNC,KAAM,CACLb,OAAQS,EAAaT,OACrBc,SAAU,CACT,CACCC,MAAO,4CACPF,KAAMH,EAAcT,OACpBe,YAAa,EACbC,gBAAiB,MAClB,EACA,CACCF,MAAO,+BACPF,KAAMJ,EAAaR,OACnBe,YAAa,EACbC,gBAAiB,WAClB,EAEF,EACAC,QAAS,CACRC,OAAQ,CACPC,QAAS,CAAA,CACV,EACAC,oBAAqB,CAAA,EACrBC,WAAY,CAAA,EACZC,OAAQ,CACPC,EAAG,CACFC,MAAO,CACNC,UAAW,CACZ,CACD,CACD,EACAC,MAAO,CACNP,QAAS,CAAA,EACTQ,KAAM,kBACNC,SAAU,EACX,EACAC,QAAS,CACRX,OAAQ,CACPC,QAAS,CAAA,CACV,EACAO,MAAO,CACNP,QAAS,CAAA,EACTQ,KAAM,kBACNG,KAAM,CACLC,KAAM,EACP,CACD,CACD,EACAC,SAAU,CACTC,IAAI,CACHjB,gBAAiB,WAClB,CACD,EACAkB,WAAY,CACXC,QAAS,CACRC,SAAU,IACVC,OAAQ,SACRC,KAAM,EACNC,GAAI,EACJC,KAAM,CAAA,CACP,CACD,CAED,CACD,CAAC,CAEF,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-dashboard-widget.min.js","sources":["spbc-dashboard-widget.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Set \"refresh\" link handler\n\tjQuery(\".spbc_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.spbc_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#spbc_widget_wrapper').offset().top - 130);}, 1);\n\t\tsetTimeout(function(){jQuery(\"#spbc_refresh_form\").submit();}, 2500);\n\t});\n\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#spbc_widget_wrapper').offset().top - 130);}, 1);\n\n\t// Fixing default wrapper style\n\tjQuery(\"#spbc_widget_wrapper\").parent().css('padding', 0);\n\n\tlocale = navigator.language || navigator.userLanguage;\n\n\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\tmonth: \"short\",\n\t\tday: \"numeric\"\n\t});\n\n\tfunction reformatWidgetData(spbcDashboardWidget){\n\t\tlet widgetData = {'labels':[],'counts':[]}\n\t\tfor (let i = 0; i < spbcDashboardWidget.length; i++) {\n\t\t\twidgetData.labels.push(date_formatter.format(new Date(spbcDashboardWidget[i]['0'])))\n\t\t\twidgetData.counts.push(spbcDashboardWidget[i]['1'])\n\t\t}\n\t\treturn widgetData\n\t}\n\n\tconst ctx = document.getElementById('spbc_widget_chart')\n\t//let widgetData = reformatWidgetData(spbcDashboardWidget['data'])\n\tlet widgetDataFW = reformatWidgetData(spbcDashboardWidget['data_fw'])\n\tlet widgetDataBFP = reformatWidgetData(spbcDashboardWidget['data_bfp'])\n\n\tnew Chart(ctx, {\n\t\ttype: 'bar',\n\t\tdata: {\n\t\t\tlabels: widgetDataFW.labels,\n\t\t\tdatasets: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Visitors blocked by Bruteforce Protection',\n\t\t\t\t\tdata: widgetDataBFP.counts,\n\t\t\t\t\tborderWidth: 1,\n\t\t\t\t\tbackgroundColor: 'gray'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Visitors blocked by Firewall',\n\t\t\t\t\tdata: widgetDataFW.counts,\n\t\t\t\t\tborderWidth: 1,\n\t\t\t\t\tbackgroundColor: 'steelblue'\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\toptions: {\n\t\t\tlegend: {\n\t\t\t\tdisplay: false\n\t\t\t},\n\t\t\tmaintainAspectRatio: false,\n\t\t\tresponsive: true,\n\t\t\tscales: {\n\t\t\t\ty: {\n\t\t\t\t\tticks: {\n\t\t\t\t\t\tprecision: 0\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\ttitle: {\n\t\t\t\tdisplay: true,\n\t\t\t\ttext: 'Blocked attacks',\n\t\t\t\tfontSize: 18\n\t\t\t},\n\t\t\tplugins: {\n\t\t\t\tlegend: {\n\t\t\t\t\tdisplay: false\n\t\t\t\t},\n\t\t\t\ttitle: {\n\t\t\t\t\tdisplay: true,\n\t\t\t\t\ttext: 'Blocked attacks',\n\t\t\t\t\tfont: {\n\t\t\t\t\t\tsize: 18,\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\telements: {\n\t\t\t\tbar:{\n\t\t\t\t\tbackgroundColor: 'steelblue'\n\t\t\t\t}\n\t\t\t},\n\t\t\tanimations: {\n\t\t\t\ttension: {\n\t\t\t\t\tduration: 1000,\n\t\t\t\t\teasing: 'linear',\n\t\t\t\t\tfrom: 1,\n\t\t\t\t\tto: 0,\n\t\t\t\t\tloop: true\n\t\t\t\t}\n\t\t\t},\n\n\t\t}\n\t});\n\n});\n"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","locale","navigator","language","userLanguage","date_formatter","Intl","DateTimeFormat","month","day","reformatWidgetData","spbcDashboardWidget","let","widgetData","labels","counts","i","length","push","format","Date","ctx","getElementById","widgetDataFW","widgetDataBFP","Chart","type","data","datasets","label","borderWidth","backgroundColor","options","legend","display","maintainAspectRatio","responsive","scales","y","ticks","precision","title","text","fontSize","plugins","font","size","elements","bar","animations","tension","duration","easing","from","to","loop"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAGtBF,OAAO,2BAA2B,EAAEG,GAAG,QAAS,WAC/CH,OAAO,iBAAiB,EAAEI,KAAK,EAC/BC,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsB,EAAEQ,OAAO,EAAEC,IAAM,GAAG,CAAE,EAAG,CAAC,EAChGJ,WAAW,WAAWL,OAAO,oBAAoB,EAAEU,OAAO,CAAE,EAAG,IAAI,CACpE,CAAC,EAEmB,cAAjBC,SAASC,MACXP,WAAW,WAAWC,OAAOC,SAAS,EAAGP,OAAO,sBAAsB,EAAEQ,OAAO,EAAEC,IAAM,GAAG,CAAE,EAAG,CAAC,EAGjGT,OAAO,sBAAsB,EAAEa,OAAO,EAAEC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AQ,SACRC,KAAM,EACNC,GAAI,EACJC,KAAM,CAAA,CACP,CACD,CAED,CACD,CAAC,CAEF,CAAC"} \ No newline at end of file diff --git a/js/spbc-modal.min.js.map b/js/spbc-modal.min.js.map index e4f811fc8..6ee61daa4 100644 --- a/js/spbc-modal.min.js.map +++ b/js/spbc-modal.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-modal.min.js","sources":["spbc-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\r\nspbcModal = {\r\n\r\n // Flags\r\n loaded: false,\r\n loading: false,\r\n opened: false,\r\n opening: false,\r\n\r\n // Methods\r\n load: function( action ) {\r\n if( ! this.loaded ) {\r\n this.loading = true;\r\n callback = function( result, data, params, obj ) {\r\n spbcModal.loading = false;\r\n spbcModal.loaded = result;\r\n document.dispatchEvent(\r\n new CustomEvent( \"spbcModalContentLoaded\", {\r\n bubbles: true,\r\n } )\r\n );\r\n };\r\n if( typeof spbc_sendAJAXRequest === \"function\" ) {\r\n spbc_sendAJAXRequest( { 'action' : action }, { 'callback': callback, 'notJson': true } );\r\n }\r\n\r\n }\r\n },\r\n\r\n putError: function( errorText ){\r\n var html = '

The error occurred

'\r\n + '

' + errorText + '

'\r\n + 'Contact tech support';\r\n this.put(html);\r\n },\r\n\r\n put: function ( html ) {\r\n spbcModal.loading = false;\r\n spbcModal.loaded = html;\r\n document.dispatchEvent(\r\n new CustomEvent( \"spbcModalContentLoaded\", {\r\n bubbles: true,\r\n } )\r\n );\r\n },\r\n\r\n open: function () {\r\n /* Cleantalk Modal CSS start */\r\n var renderCss = function () {\r\n var cssStr = '';\r\n for ( key in this.styles ) {\r\n cssStr += key + ':' + this.styles[key] + ';';\r\n }\r\n return cssStr;\r\n };\r\n var overlayCss = {\r\n styles: {\r\n \"z-index\": \"9999\",\r\n \"position\": \"fixed\",\r\n \"top\": \"0\",\r\n \"left\": \"0\",\r\n \"width\": \"100%\",\r\n \"height\": \"100%\",\r\n \"background\": \"rgba(0,0,0,0.5)\",\r\n \"display\": \"flex\",\r\n \"justify-content\" : \"center\",\r\n \"align-items\" : \"center\",\r\n },\r\n toString: renderCss\r\n };\r\n var innerCss = {\r\n styles: {\r\n \"position\" : \"relative\",\r\n \"padding\" : \"20px\",\r\n \"max-width\" : \"550px\",\r\n \"max-height\" : \"500px\",\r\n \"background\" : \"#FFF\",\r\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\r\n \"border-radius\" : \"4px\",\r\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\r\n },\r\n toString: renderCss\r\n };\r\n var closeCss = {\r\n styles: {\r\n \"position\" : \"absolute\",\r\n \"background\" : \"#FFF\",\r\n \"width\" : \"20px\",\r\n \"height\" : \"20px\",\r\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\r\n \"border-radius\" : \"15px\",\r\n \"cursor\" : \"pointer\",\r\n \"top\" : \"-8px\",\r\n \"right\" : \"-8px\",\r\n },\r\n toString: renderCss\r\n };\r\n var closeCssBefore = {\r\n styles: {\r\n \"content\" : \"\\\"\\\"\",\r\n \"display\" : \"block\",\r\n \"position\" : \"absolute\",\r\n \"background\" : \"#000\",\r\n \"border-radius\" : \"1px\",\r\n \"width\" : \"2px\",\r\n \"height\" : \"16px\",\r\n \"top\" : \"2px\",\r\n \"left\" : \"9px\",\r\n \"transform\" : \"rotate(45deg)\",\r\n },\r\n toString: renderCss\r\n };\r\n var closeCssAfter = {\r\n styles: {\r\n \"content\" : \"\\\"\\\"\",\r\n \"display\" : \"block\",\r\n \"position\" : \"absolute\",\r\n \"background\" : \"#000\",\r\n \"border-radius\" : \"1px\",\r\n \"width\" : \"2px\",\r\n \"height\" : \"16px\",\r\n \"top\" : \"2px\",\r\n \"left\" : \"9px\",\r\n \"transform\" : \"rotate(-45deg)\",\r\n },\r\n toString: renderCss\r\n };\r\n var contentCss = {\r\n styles: {\r\n \"overflow-y\": \"auto\",\r\n \"max-height\": \"460px\",\r\n \"overflow-x\": \"hidden\",\r\n },\r\n toString: renderCss\r\n };\r\n var bodyCss = {\r\n styles: {\r\n \"overflow\" : \"hidden\",\r\n },\r\n toString: renderCss\r\n };\r\n var spbcModalStyle = document.createElement( 'style' );\r\n spbcModalStyle.setAttribute( 'id', 'spbc-modal-styles' );\r\n spbcModalStyle.innerHTML = 'body.spbc-modal-opened{' + bodyCss + '}';\r\n spbcModalStyle.innerHTML += '#spbc-modal-overlay{' + overlayCss + '}';\r\n spbcModalStyle.innerHTML += '#spbc-modal-close{' + closeCss + '}';\r\n spbcModalStyle.innerHTML += '#spbc-modal-close:before{' + closeCssBefore + '}';\r\n spbcModalStyle.innerHTML += '#spbc-modal-close:after{' + closeCssAfter + '}';\r\n spbcModalStyle.innerHTML += '#spbc-modal-content{' + contentCss + '}';\r\n document.body.append( spbcModalStyle );\r\n /* Cleantalk Modal CSS end */\r\n\r\n var overlay = document.createElement( 'div' );\r\n overlay.setAttribute( 'id', 'spbc-modal-overlay' );\r\n document.body.append( overlay );\r\n\r\n document.body.classList.add( 'spbc-modal-opened' );\r\n\r\n var inner = document.createElement( 'div' );\r\n inner.setAttribute( 'id', 'spbc-modal-inner' );\r\n inner.setAttribute( 'style', innerCss );\r\n overlay.append( inner );\r\n\r\n var close = document.createElement( 'div' );\r\n close.setAttribute( 'id', 'spbc-modal-close' );\r\n inner.append( close );\r\n\r\n var content = document.createElement( 'div' );\r\n if ( this.loaded ) {\r\n content.innerHTML = this.loaded;\r\n } else {\r\n content.innerHTML = 'Loading...';\r\n }\r\n content.setAttribute( 'id', 'spbc-modal-content' );\r\n inner.append( content );\r\n\r\n this.opened = true;\r\n\r\n return this;\r\n },\r\n\r\n close: function () {\r\n spbcModal.loaded = '';\r\n spbcModal.loading = false;\r\n document.body.classList.remove( 'spbc-modal-opened' );\r\n document.getElementById( 'spbc-modal-overlay' ).remove();\r\n document.getElementById( 'spbc-modal-styles' ).remove();\r\n document.dispatchEvent(\r\n new CustomEvent( \"spbcModalClosed\", {\r\n bubbles: true,\r\n } )\r\n );\r\n }\r\n\r\n};\r\n\r\n/* Cleantalk Modal helpers */\r\ndocument.addEventListener('click',function( e ){\r\n if( e.target && e.target.id === 'spbc-modal-overlay' || e.target.id === 'spbc-modal-close' ){\r\n spbcModal.close();\r\n }\r\n});\r\ndocument.addEventListener(\"spbcModalContentLoaded\", function( e ) {\r\n if( spbcModal.opened && spbcModal.loaded ) {\r\n document.getElementById( 'spbc-modal-content' ).innerHTML = spbcModal.loaded;\r\n }\r\n});"],"names":["spbcModal","loaded","loading","opened","opening","load","action","this","callback","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","spbc_sendAJAXRequest","notJson","putError","errorText","put","html","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","max-width","max-height","border","border-radius","box-shadow","closeCss","cursor","right","closeCssBefore","content","transform","closeCssAfter","contentCss","overflow-y","overflow-x","bodyCss","overflow","spbcModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,UAAY,CAGRC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,OAAQ,CAAA,EACRC,QAAS,CAAA,EAGTC,KAAM,SAAUC,GACNC,KAAKN,SACPM,KAAKL,QAAU,CAAA,EACfM,SAAW,SAAUC,EAAQC,EAAMC,EAAQC,GACvCZ,UAAUE,QAAU,CAAA,EACpBF,UAAUC,OAASQ,EACnBI,SAASC,cACL,IAAIC,YAAa,yBAA0B,CACvCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,EACoC,YAAhC,OAAOC,sBACPA,qBAAsB,CAAEX,OAAWA,CAAO,EAAG,CAAEE,SAAYA,SAAUU,QAAW,CAAA,CAAK,CAAE,EAInG,EAEAC,SAAU,SAAUC,GAIhBb,KAAKc,IAHM,iCACGD,EACR,mKACO,CACjB,EAEAC,IAAK,SAAWC,GACZtB,UAAUE,QAAU,CAAA,EACpBF,UAAUC,OAASqB,EACnBT,S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,CAEJ,EAGAH,SAAS2D,iBAAiB,QAAQ,SAAUC,IACpCA,EAAEC,QAA0B,uBAAhBD,EAAEC,OAAOC,IAA+C,qBAAhBF,EAAEC,OAAOC,KAC7D3E,UAAUqE,MAAM,CAExB,CAAC,EACDxD,SAAS2D,iBAAiB,yBAA0B,SAAUC,GACtDzE,UAAUG,QAAUH,UAAUC,SAC9BY,SAAS0D,eAAgB,oBAAqB,EAAER,UAAY/D,UAAUC,OAE9E,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-modal.min.js","sources":["spbc-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\nspbcModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n spbcModal.loading = false;\n spbcModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"spbcModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof spbc_sendAJAXRequest === \"function\" ) {\n spbc_sendAJAXRequest( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n putError: function( errorText ){\n var html = '

The error occurred

'\n + '

' + errorText + '

'\n + 'Contact tech support';\n this.put(html);\n },\n\n put: function ( html ) {\n spbcModal.loading = false;\n spbcModal.loaded = html;\n document.dispatchEvent(\n new CustomEvent( \"spbcModalContentLoaded\", {\n bubbles: true,\n } )\n );\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"20px\",\n \"max-width\" : \"550px\",\n \"max-height\" : \"500px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var contentCss = {\n styles: {\n \"overflow-y\": \"auto\",\n \"max-height\": \"460px\",\n \"overflow-x\": \"hidden\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var spbcModalStyle = document.createElement( 'style' );\n spbcModalStyle.setAttribute( 'id', 'spbc-modal-styles' );\n spbcModalStyle.innerHTML = 'body.spbc-modal-opened{' + bodyCss + '}';\n spbcModalStyle.innerHTML += '#spbc-modal-overlay{' + overlayCss + '}';\n spbcModalStyle.innerHTML += '#spbc-modal-close{' + closeCss + '}';\n spbcModalStyle.innerHTML += '#spbc-modal-close:before{' + closeCssBefore + '}';\n spbcModalStyle.innerHTML += '#spbc-modal-close:after{' + closeCssAfter + '}';\n spbcModalStyle.innerHTML += '#spbc-modal-content{' + contentCss + '}';\n document.body.append( spbcModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'spbc-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'spbc-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'spbc-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'spbc-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n }\n content.setAttribute( 'id', 'spbc-modal-content' );\n inner.append( content );\n\n this.opened = true;\n\n return this;\n },\n\n close: function () {\n spbcModal.loaded = '';\n spbcModal.loading = false;\n document.body.classList.remove( 'spbc-modal-opened' );\n document.getElementById( 'spbc-modal-overlay' ).remove();\n document.getElementById( 'spbc-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"spbcModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'spbc-modal-overlay' || e.target.id === 'spbc-modal-close' ){\n spbcModal.close();\n }\n});\ndocument.addEventListener(\"spbcModalContentLoaded\", function( e ) {\n if( spbcModal.opened && spbcModal.loaded ) {\n document.getElementById( 'spbc-modal-content' ).innerHTML = spbcModal.loaded;\n }\n});"],"names":["spbcModal","loaded","loading","opened","opening","load","action","this","callback","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","spbc_sendAJAXRequest","notJson","putError","errorText","put","html","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","max-width","max-height","border","border-radius","box-shadow","closeCss","cursor","right","closeCssBefore","content","transform","closeCssAfter","contentCss","overflow-y","overflow-x","bodyCss","overflow","spbcModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,UAAY,CAGRC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,OAAQ,CAAA,EACRC,QAAS,CAAA,EAGTC,KAAM,SAAUC,GACNC,KAAKN,SACPM,KAAKL,QAAU,CAAA,EACfM,SAAW,SAAUC,EAAQC,EAAMC,EAAQC,GACvCZ,UAAUE,QAAU,CAAA,EACpBF,UAAUC,OAASQ,EACnBI,SAASC,cACL,IAAIC,YAAa,yBAA0B,CACvCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,EACoC,YAAhC,OAAOC,sBACPA,qBAAsB,CAAEX,OAAWA,CAAO,EAAG,CAAEE,SAAYA,SAAUU,QAAW,CAAA,CAAK,CAAE,EAInG,EAEAC,SAAU,SAAUC,GAIhBb,KAAKc,IAHM,iCACGD,EACR,mKACO,CACjB,EAEAC,IAAK,SAAWC,GACZtB,UAAUE,QAAU,CAAA,EACpBF,UAAUC,OAASqB,EACnBT,SAASC,cACL,IAAIC,YAAa,yBAA0B,CACvCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,EAEAO,KAAM,WAEc,SAAZC,IACA,IAAIC,EAAS,GACb,IAAMC,OAAOnB,KAAKoB,OACdF,GAAUC,IAAM,IAAMnB,KAAKoB,OAAOD,KAAO,IAE7C,OAAOD,CACX,CANA,IAOIG,EAAa,CACbD,OAAQ,CACJE,UAAW,OACXC,SAAY,QACZC,IAAO,IACPC,KAAQ,IACRC,MAAS,OACTC,OAAU,OACVC,WAAc,kBACdC,QAAW,OACXC,kBAAoB,SACpBC,cAAgB,QACpB,EACAC,SAAUf,CACd,EACIgB,EAA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,KAAM,oBAAqB,EACjDjD,SAASmD,KAAKC,OAAQJ,CAAQ,EAE9BhD,SAASmD,KAAKG,UAAUC,IAAK,mBAAoB,EAErCvD,SAAS+C,cAAe,KAAM,GAKtCS,GAJJH,EAAMJ,aAAc,KAAM,kBAAmB,EAC7CI,EAAMJ,aAAc,QAAStB,CAAS,EACtCqB,EAAQI,OAAQC,CAAM,EAEVrD,SAAS+C,cAAe,KAAM,GAItCT,GAHJkB,EAAMP,aAAc,KAAM,kBAAmB,EAC7CI,EAAMD,OAAQI,CAAM,EAENxD,SAAS+C,cAAe,KAAM,GAW5C,OAVKrD,KAAKN,OACNkD,EAAQY,UAAYxD,KAAKN,OAEzBkD,EAAQY,UAAY,aAExBZ,EAAQW,aAAc,KAAM,oBAAqB,EACjDI,EAAMD,OAAQd,CAAQ,EAEtB5C,KAAKJ,OAAS,CAAA,EAEPI,IACX,EAEA8D,MAAO,WACHrE,UAAUC,OAAS,GACnBD,UAAUE,QAAU,CAAA,EACpBW,SAASmD,KAAKG,UAAUG,OAAQ,mBAAoB,EACpDzD,SAAS0D,eAAgB,oBAAqB,EAAED,OAAO,EACvDzD,SAAS0D,eAAgB,mBAAoB,EAAED,OAAO,EACtDzD,SAASC,cACL,IAAIC,YAAa,kBAAmB,CAChCC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,CAEJ,EAGAH,SAAS2D,iBAAiB,QAAQ,SAAUC,IACpCA,EAAEC,QAA0B,uBAAhBD,EAAEC,OAAOC,IAA+C,qBAAhBF,EAAEC,OAAOC,KAC7D3E,UAAUqE,MAAM,CAExB,CAAC,EACDxD,SAAS2D,iBAAiB,yBAA0B,SAAUC,GACtDzE,UAAUG,QAAUH,UAAUC,SAC9BY,SAAS0D,eAAgB,oBAAqB,EAAER,UAAY/D,UAAUC,OAE9E,CAAC"} \ No newline at end of file diff --git a/js/spbc-scanner-plugin.min.js.map b/js/spbc-scanner-plugin.min.js.map index fdf718653..1b349cdef 100644 --- a/js/spbc-scanner-plugin.min.js.map +++ b/js/spbc-scanner-plugin.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-scanner-plugin.min.js","sources":["spbc-scanner-plugin.js"],"sourcesContent":["'use strict';\r\n\r\nclass spbcMalwareScanner{\r\n\r\n\tfirst_start = true;\r\n\r\n\tactive = false;\r\n\r\n\troot = '';\r\n\tsettings = [];\r\n\tstates = [\r\n\t\t'get_cms_hashes',\r\n\t\t'get_modules_hashes',\r\n\t\t'clean_results',\r\n\t\t'file_system_analysis',\r\n\t\t'get_approved_hashes',\r\n\t\t'get_denied_hashes',\r\n\t\t'signature_analysis',\r\n\t\t'heuristic_analysis',\r\n\t\t'schedule_send_heuristic_critical_files',\r\n\t\t'auto_cure_backup',\r\n\t\t'auto_cure',\r\n\t\t'outbound_links',\r\n\t\t'frontend_analysis',\r\n\t\t'important_files_listing',\r\n\t\t'send_results',\r\n\t];\r\n\tstate = null;\r\n\toffset = 0;\r\n\tamount = 0;\r\n\tamount_coefficient = 1;\r\n\ttotal_scanned = 0;\r\n\tscan_percent = 0;\r\n\tpercent_completed = 0;\r\n\r\n\tpaused = false;\r\n\r\n\tbutton = null;\r\n\tspinner = null;\r\n\r\n\tprogress_overall = null;\r\n\tprogressbar = null;\r\n\tprogressbar_text = null;\r\n\r\n\ttimeout = 60000;\r\n\r\n\tstate_timer = 0;\r\n\r\n\tconstructor ( properties ) {\r\n\r\n\t\tconsole.log('init');\r\n\t\tif (jQuery('#spbcscan-results-log-module').length) {\r\n\t\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden')\r\n\t\t}\r\n\r\n\t\t// Crunch for cure backups\r\n\t\tif( typeof properties['settings']['auto_cure'] !== 'undefined' ){\r\n\t\t\tproperties['settings']['scanner__auto_cure_backup'] = '1';\r\n\t\t}\r\n\r\n\t\tfor( let key in properties ){\r\n\t\t\tif( typeof this[key] !== 'undefined' ){\r\n\t\t\t\tthis[key] = properties[key];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tactionControl(){\r\n\r\n\t\tif(this.state === null){\r\n\t\t\tthis.start();\r\n\r\n\t\t}else if(this.paused){\r\n\t\t\tthis.resume();\r\n\t\t\tthis.controller();\r\n\r\n\t\t}else{\r\n\t\t\tthis.pause();\r\n\t\t}\r\n\t};\r\n\r\n\tstart(){\r\n\r\n\t\tthis.active = true;\r\n\t\tthis.state_timer = Math.round(new Date().getTime() /1000);\r\n\r\n\t\tthis.state = this.getNextState( null );\r\n\r\n\t\tthis.setPercents( 0 );\r\n\t\tthis.scan_percent = 0;\r\n\t\tthis.offset = 0;\r\n\t\tthis.progress_overall.children('span')\r\n\t\t\t.removeClass('spbc_bold')\r\n\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\r\n\t\t\t.addClass('spbc_bold');\r\n\r\n\t\tthis.progressbar.show(500);\r\n\t\tthis.progress_overall.show(500);\r\n\t\tthis.button.html(spbcScaner.button_scan_pause);\r\n\t\tthis.spinner.css({display: 'inline'});\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tthis.controller();\r\n\t\t}, 1000);\r\n\r\n\t};\r\n\r\n\tpause( result, data, opt ){\r\n\t\tconsole.log('PAUSE');\r\n\t\tthis.button.html(spbcScaner.button_scan_resume);\r\n\t\tthis.spinner.css({display: 'none'});\r\n\t\tthis.paused = true;\r\n\t\tthis.active = false;\r\n\t};\r\n\r\n\tresume( opt ){\r\n\t\tconsole.log('RESUME');\r\n\t\tthis.button.html(spbcScaner.button_scan_pause);\r\n\t\tthis.spinner.css({display: 'inline'});\r\n\t\tthis.paused = false;\r\n\t\tthis.active = true;\r\n\t};\r\n\r\n\tend( reload ){\r\n\r\n\t\tthis.progressbar.hide(500);\r\n\t\tthis.progress_overall.hide(500);\r\n\t\tthis.button.html(spbcScaner.button_scan_perform);\r\n\t\tthis.spinner.css({display: 'none'});\r\n\t\tthis.state = null;\r\n\t\tthis.total_links = 0;\r\n\t\tthis.plug = false;\r\n\t\tthis.total_scanned = 0;\r\n\t\tthis.active = false;\r\n\r\n\t\tif(reload){\r\n\t\t\tdocument.location = document.location;\r\n\t\t}else{\r\n\t\t\tspbc_sendAJAXRequest(\r\n\t\t\t\t{action: 'spbc_scanner_tab__reload_accordion'},\r\n\t\t\t\t{\r\n\t\t\t\t\tnotJson: true,\r\n\t\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\t\tjQuery(obj).accordion('destroy')\r\n\t\t\t\t\t\t\t.html(result)\r\n\t\t\t\t\t\t\t.accordion({\r\n\t\t\t\t\t\t\t\theader: 'h3',\r\n\t\t\t\t\t\t\t\theightStyle: 'content',\r\n\t\t\t\t\t\t\t\tcollapsible: true,\r\n\t\t\t\t\t\t\t\tactive: false,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\tspbc_tbl__bulk_actions__listen();\r\n\t\t\t\t\t\tspbc_tbl__row_actions__listen();\r\n\t\t\t\t\t\tspbc_tbl__pagination__listen();\r\n\t\t\t\t\t\tspbc_tbl__sort__listen();\r\n\t\t\t\t\t\tspbcStartShowHide();\r\n\t\t\t\t\t\tspbc_scanner__reload_scan_info();\r\n\t\t\t\t\t},\r\n\t\t\t\t},\r\n\t\t\t\tjQuery('#spbc_scan_accordion')\r\n\t\t\t);\r\n\r\n\t\t\tif (!jQuery('#spbc_scanner_clear').length) {\r\n\t\t\t\tlet clear_link = '

Clear scanner logs


';\r\n\t\t\t\tjQuery(clear_link).insertBefore('#spbcscan-scanner-caption');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t};\r\n\r\n\tcontroller( result ) {\r\n\r\n\t\tconsole.log(this.state);\r\n\r\n\t\t// The current stage is over. Switching to the new one\r\n\t\tif( typeof result !== 'undefined' && result.end ){\r\n\r\n\t\t\tthis.state = this.getNextState( this.state );\r\n\r\n\t\t\t// End condition\r\n\t\t\tif (typeof this.state === 'undefined'){\r\n\t\t\t\tthis.end();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Set percent to 0\r\n\t\t\tthis.setPercents( 0 );\r\n\t\t\tthis.scan_percent = 0;\r\n\t\t\tthis.offset = 0;\r\n\r\n\t\t\t// Changing visualizing of the current stage\r\n\t\t\tthis.progress_overall.children('span')\r\n\t\t\t\t.removeClass('spbc_bold')\r\n\t\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\r\n\t\t\t\t.addClass('spbc_bold');\r\n\t\t}\r\n\r\n\t\t// Break execution if paused\r\n\t\tif( this.paused === true )\r\n\t\t\treturn;\r\n\r\n\t\t// // AJAX params\r\n\t\tlet data = {\r\n\t\t\taction: 'spbc_scanner_controller_front',\r\n\t\t\tmethod: this.state,\r\n\t\t\toffset: this.offset,\r\n\t\t};\r\n\r\n\t\tvar params = {\r\n\t\t\ttype: 'GET',\r\n\t\t\tsuccess: this.success,\r\n\t\t\tcallback: this.successCallback,\r\n\t\t\terror: this.error,\r\n\t\t\terrorOutput: this.errorOutput,\r\n\t\t\tcomplete: null,\r\n\t\t\tcontext: this,\r\n\t\t\ttimeout: 120000\r\n\t\t};\r\n\r\n\t\tswitch (this.state) {\r\n\t\t\tcase 'get_modules_hashes': this.amount = 2; break;\r\n\t\t\tcase 'clear_table': this.amount = 10000; break;\r\n\t\t\tcase 'file_system_analysis': this.amount = 700; break;\r\n\t\t\tcase 'auto_cure': this.amount = 5; break;\r\n\t case 'outbound_links': this.amount = 10; break;\r\n\t case 'frontend_analysis': this.amount = spbcSettings.frontendAnalysisAmount; break;\r\n\t\t\tcase 'signature_analysis': this.amount = 10; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\r\n\t\t\tcase 'heuristic_analysis': this.amount = 4; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\r\n\t\t\tcase 'schedule_send_heuristic_critical_files': this.amount = 1; break;\r\n\t\t}\r\n\r\n\t\tdata.amount = Math.round(this.amount * this.amount_coefficient);\r\n\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\tdata,\r\n\t\t\tparams,\r\n\t\t\tjQuery('#spbc_scan_accordion')\r\n\t\t);\r\n\r\n\t};\r\n\r\n\tsetCoefficients( state ) {\r\n\t\tlet coefficient = this.amount_coefficient;\r\n\t\tswitch (state) {\r\n\t\t\tcase 'file_system_analysis': coefficient *= 1.5; break;\r\n\t\t}\r\n\t\tthis.amount_coefficient = coefficient;\r\n\t};\r\n\r\n\tgetNextState( state ) {\r\n\r\n\t\tstate = state === null ? this.states[0] : this.states[ this.states.indexOf( state ) + 1 ];\r\n\r\n\t\tif (typeof this.settings[ 'scanner__' + state ] !== 'undefined' && +this.settings[ 'scanner__' + state ] === 0)\r\n\t\t\tstate = this.getNextState( state );\r\n\r\n\t\treturn state;\r\n\t};\r\n\r\n\tsetPercents( percents ){\r\n\t\tthis.percent_completed = Math.floor( percents * 100 ) / 100;\r\n\t\tthis.progressbar.progressbar( 'option', 'value', this.percent_completed );\r\n\t\tthis.progressbar_text.text( spbcScaner[ 'progressbar_' + this.state ] + ' - ' + this.percent_completed + '%' );\r\n\t};\r\n\r\n\tsuccess( response ){\r\n\r\n\t\tif( !! response.error ){\r\n\r\n\t\t\tthis.error(\r\n\t\t\t\t{status: 200, responseText: response.error},\r\n\t\t\t\tresponse.error,\r\n\t\t\t\tresponse.msg\r\n\t\t\t);\r\n\r\n\t\t}else{\r\n\t\t\tif( this.successCallback )\r\n\t\t\t\tthis.successCallback( response, this.data, this.obj );\r\n\t\t}\r\n\r\n\t};\r\n\r\n\t// Processing response from backend\r\n\tsuccessCallback( result ){\r\n\r\n\t\tconsole.log( result );\r\n\r\n\t\tif( typeof result.total !== 'undefined' )\r\n\t\t\tthis.scan_percent = 100 / result.total;\r\n\r\n\t\tif( typeof result.processed_items !== 'undefined'){\r\n\r\n\t\t\tif( this.state === 'heuristic_analysis' && typeof result.total !== 0 )\r\n\t\t\t\tthis.logRaw('

Heuristic Analysis

');\r\n\t\t\tif( this.state === 'signature_analysis' && typeof result.total !== 0 )\r\n\t\t\t\tthis.logRaw('

Signature Analysis

');\r\n\r\n\t\t\tthis.logFileEntry( result.processed_items );\r\n\t\t}\r\n\r\n\t\tif( typeof result.stage_data_for_logging !== 'undefined'){\r\n\t\t\tthis.logStageEntry( result.stage_data_for_logging );\r\n\t\t}\r\n\r\n\t\t// Add link on shuffle salt if cured\r\n\t\tif (result.cured !== 'undefined' && Number(result.cured) > 0) {\r\n\t\t\tthis.showLinkForShuffleSalts(result.message);\r\n\t\t}\r\n\r\n\t\tif( result.end !== true && result.end !== 1 ){\r\n\t\t\tthis.setPercents( this.percent_completed + result.processed * this.scan_percent );\r\n\t\t\tthis.offset = this.offset + result.processed;\r\n\t\t\tthis.controller( result );\r\n\t\t}else{\r\n\t\t\tconsole.log( this.state + \" stage took \" + ( Math.round(new Date().getTime() /1000) - this.state_timer ) + \" seconds to complete\" );\r\n\t\t\tthis.state_timer = Math.round(new Date().getTime()/1000);\r\n\t\t\tthis.setPercents( 100 );\r\n\t\t\tthis.scan_percent = 0;\r\n\t\t\tthis.offset = 0;\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.controller( result );\r\n\t\t\t}, 300);\r\n\t\t}\r\n\t};\r\n\r\n\terror( xhr, status, error ){\r\n\r\n\t\tlet errorOutput = this.errorOutput;\r\n\r\n\t\tconsole.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\r\n\t\tconsole.log( status );\r\n\t\tconsole.log( error );\r\n\t\tconsole.log( xhr );\r\n\r\n\t\tif (status == 'error' && (error == '' || error == 'Not found')) {\r\n if (!this.tryCount) {\r\n this.tryCount = 0;\r\n this.retryLimit = 30;\r\n }\r\n\t\t\tthis.tryCount++;\r\n\t\t\tconsole.log('Try #' + this.tryCount);\r\n\t\t\tthis.setCoefficients(this.state);\r\n\t\t\tif (this.tryCount <= this.retryLimit) {\r\n\t\t\t\tthis.pause();\r\n this.resume();\r\n this.controller();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( xhr.status === 200 ){\r\n\t\t\tif( status === 'parsererror' ){\r\n\t\t\t\terrorOutput( 'Unexpected response from server. See console for details.', this.state );\r\n\t\t\t\tconsole.log( '%c ' + xhr.responseText, 'color: pink;' );\r\n\t\t\t}else{\r\n\t\t\t\tlet error_string = status;\r\n\t\t\t\tif( typeof error !== 'undefined' )\r\n\t\t\t\t\terror_string += ' Additional info: ' + error;\r\n\t\t\t\terrorOutput( error_string, this.state );\r\n\t\t\t}\r\n\t\t}else if(xhr.status === 500){\r\n\t\t\terrorOutput( 'Internal server error.', this.state);\r\n\t\t}else\r\n\t\t\terrorOutput('Unexpected response code: ' + xhr.status + '. Error: ' + status, this.state);\r\n\r\n\t\tif( this.progressbar )\r\n\t\t\tthis.progressbar.fadeOut('slow');\r\n\r\n\t\tthis.end();\r\n\t};\r\n\r\n\terrorOutput( error_msg, stage ){\r\n\t\tspbcModal.open().putError( error_msg + '
Stage: ' + stage);\r\n\t};\r\n\r\n\tlogRaw(message_to_log ){\r\n\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\r\n\t\tjQuery('.spbc_log-wrapper').removeClass('spbc---hidden');\r\n\t\tjQuery('.spbc_log-wrapper .panel-body').prepend( message_to_log );\r\n\t};\r\n\r\n\tlogFileEntry(items){\r\n\t\tfor ( var key in items ){\r\n\t\t\tthis.logRaw( '

' + this.getSiteUTCShiftedTimeString() + ' - ' + items[ key ].path + ': ' + items[ key ].status + '

' );\r\n\t\t}\r\n\t};\r\n\r\n\tlogStageEntry(data){\r\n\t\tthis.logRaw( '

' + this.getSiteUTCShiftedTimeString() + ' - ' + '' + data.title + ' ' + '' + data.description + '

' );\r\n\t};\r\n\r\n\tshowLinkForShuffleSalts(message) {\r\n\t\tjQuery('#spbc_notice_about_shuffle_link').remove();\r\n\t\tjQuery(jQuery('.spbc_tab--active .spbc_wrapper_field p')[1])\r\n\t\t\t.after(\r\n\t\t\t\t'
' +\r\n\t\t\t\t'' +\r\n\t\t\t\tmessage +\r\n\t\t\t\t'' +\r\n\t\t\t\t'
'\r\n\t\t\t);\r\n\t}\r\n\r\n\tgetSiteUTCShiftedTimeString(){\r\n\t\tvar utc_shifted_ts = false;\r\n\t\t//gettings current system/browser offset\r\n\t\tvar current_browser_offset = new Date().getTimezoneOffset();\r\n\t\tcurrent_browser_offset = current_browser_offset * -1 * 1000 * 60;\r\n\t\t//chek if global ct object is defined\r\n\t\tif (typeof spbcScaner !== \"undefined\"\r\n\t\t\t&& typeof spbcScaner.timezone_shift !== \"undefined\"\r\n\t\t\t&& spbcScaner.timezone_shift !== false){\r\n\t\t\tutc_shifted_ts = Date.now() - current_browser_offset + (spbcScaner.timezone_shift * 1000);\r\n\t\t}\r\n\t\tvar ct_date = utc_shifted_ts ? new Date(utc_shifted_ts) : new Date();\r\n\t\t//construct date string\r\n\t\tvar shortMonthName = new Intl.DateTimeFormat(\"en-US\", { month: \"short\" }).format;\r\n\t\tvar minutes = String(ct_date.getMinutes()).padStart(2, '0');\r\n\t\tvar seconds = String(ct_date.getSeconds()).padStart(2, '0');\r\n\t\treturn shortMonthName(ct_date) + ' ' + ct_date.getDate() + ' ' + ct_date.getFullYear() + ' ' + ct_date.getHours() + ':' + minutes + ':' + seconds\r\n\t}\r\n\r\n}\r\n"],"names":["spbcMalwareScanner","first_start","active","root","settings","states","state","offset","amount","amount_coefficient","total_scanned","scan_percent","percent_completed","paused","button","spinner","progress_overall","progressbar","progressbar_text","timeout","state_timer","constructor","properties","let","key","console","log","jQuery","length","removeClass","this","actionControl","start","resume","controller","pause","Math","round","Date","getTime","getNextState","setPercents","children","filter","addClass","show","html","spbcScaner","button_scan_pause","css","display","setTimeout","result","data","opt","button_scan_resume","end","reload","hide","button_scan_perform","total_links","plug","document","location","spbc_sendAJAXRequest","action","notJson","callback","params","obj","accordion","header","heightStyle","collapsible","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","spbc_scanner__reload_scan_info","insertBefore","method","type","success","successCallback","error","errorOutput","complete","context","spbcSettings","frontendAnalysisAmount","status","setCoefficients","coefficient","indexOf","percents","floor","text","response","responseText","msg","total","processed_items","logRaw","logFileEntry","stage_data_for_logging","logStageEntry","cured","Number","showLinkForShuffleSalts","message","processed","xhr","tryCount","retryLimit","error_string","fadeOut","error_msg","stage","spbcModal","open","putError","message_to_log","prepend","items","getSiteUTCShiftedTimeString","path","title","description","remove","after","utc_shifted_ts","current_browser_offset","getTimezoneOffset","ct_date","timezone_shift","now","shortMonthName","Intl","DateTimeFormat","month","format","minutes","String","getMinutes","padStart","seconds","getSeconds","getDate","getFullYear","getHours"],"mappings":"AAAA,mBAEMA,mBAELC,YAAc,CAAA,EAEdC,OAAS,CAAA,EAETC,KAAQ,GACRC,SAAW,GACXC,OAAS,CACR,iBACA,qBACA,gBACA,uBACA,sBACA,oBACA,qBACA,qBACA,yCACA,mBACA,YACA,iBACA,oBACA,0BACA,gBAEDC,MAAQ,KACRC,OAAS,EACTC,OAAS,EACTC,mBAAqB,EACrBC,cAAgB,EAChBC,aAAe,EACfC,kBAAoB,EAEpBC,OAAS,CAAA,EAETC,OAAS,KACTC,QAAU,KAEVC,iBAAmB,KACnBC,YAAc,KACdC,iBAAmB,KAEnBC,QAAU,IAEVC,YAAc,EAEdC,YAAcC,GAYb,IAAKC,IAAIC,KAVTC,QAAQC,IAAI,MAAM,EACdC,OAAO,8BAA8B,EAAEC,QAC1CD,OAAO,sBAAsB,EAAEE,YAAY,eAAe,EAIR,KAAA,IAAxCP,EAAqB,SAAa,YAC5CA,EAAqB,SAA6B,0BAAI,KAGvCA,EACU,KAAA,IAAdQ,KAAKN,KACfM,KAAKN,GAAOF,EAAWE,GAI1B,CAEAO,gBAEmB,OAAfD,KAAKxB,MACPwB,KAAKE,MAAM,EAEHF,KAAKjB,QACbiB,KAAKG,OAAO,EACZH,KAAKI,WAAW,GAGhBJ,KAAKK,MAAM,CAEb,CAEAH,QAECF,KAAK5B,OAAS,CAAA,EACd4B,KAAKV,YAAcgB,KAAKC,OAAM,IAAIC,MAAOC,QAAQ,EAAG,GA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class spbcMalwareScanner{\n\n\tfirst_start = true;\n\n\tactive = false;\n\n\troot = '';\n\tsettings = [];\n\tstates = [\n\t\t'get_cms_hashes',\n\t\t'get_modules_hashes',\n\t\t'clean_results',\n\t\t'file_system_analysis',\n\t\t'get_approved_hashes',\n\t\t'get_denied_hashes',\n\t\t'signature_analysis',\n\t\t'heuristic_analysis',\n\t\t'schedule_send_heuristic_critical_files',\n\t\t'auto_cure_backup',\n\t\t'auto_cure',\n\t\t'outbound_links',\n\t\t'frontend_analysis',\n\t\t'important_files_listing',\n\t\t'send_results',\n\t];\n\tstate = null;\n\toffset = 0;\n\tamount = 0;\n\tamount_coefficient = 1;\n\ttotal_scanned = 0;\n\tscan_percent = 0;\n\tpercent_completed = 0;\n\n\tpaused = false;\n\n\tbutton = null;\n\tspinner = null;\n\n\tprogress_overall = null;\n\tprogressbar = null;\n\tprogressbar_text = null;\n\n\ttimeout = 60000;\n\n\tstate_timer = 0;\n\n\tconstructor ( properties ) {\n\n\t\tconsole.log('init');\n\t\tif (jQuery('#spbcscan-results-log-module').length) {\n\t\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden')\n\t\t}\n\n\t\t// Crunch for cure backups\n\t\tif( typeof properties['settings']['auto_cure'] !== 'undefined' ){\n\t\t\tproperties['settings']['scanner__auto_cure_backup'] = '1';\n\t\t}\n\n\t\tfor( let key in properties ){\n\t\t\tif( typeof this[key] !== 'undefined' ){\n\t\t\t\tthis[key] = properties[key];\n\t\t\t}\n\t\t}\n\n\t};\n\n\tactionControl(){\n\n\t\tif(this.state === null){\n\t\t\tthis.start();\n\n\t\t}else if(this.paused){\n\t\t\tthis.resume();\n\t\t\tthis.controller();\n\n\t\t}else{\n\t\t\tthis.pause();\n\t\t}\n\t};\n\n\tstart(){\n\n\t\tthis.active = true;\n\t\tthis.state_timer = Math.round(new Date().getTime() /1000);\n\n\t\tthis.state = this.getNextState( null );\n\n\t\tthis.setPercents( 0 );\n\t\tthis.scan_percent = 0;\n\t\tthis.offset = 0;\n\t\tthis.progress_overall.children('span')\n\t\t\t.removeClass('spbc_bold')\n\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\n\t\t\t.addClass('spbc_bold');\n\n\t\tthis.progressbar.show(500);\n\t\tthis.progress_overall.show(500);\n\t\tthis.button.html(spbcScaner.button_scan_pause);\n\t\tthis.spinner.css({display: 'inline'});\n\n\t\tsetTimeout(() => {\n\t\t\tthis.controller();\n\t\t}, 1000);\n\n\t};\n\n\tpause( result, data, opt ){\n\t\tconsole.log('PAUSE');\n\t\tthis.button.html(spbcScaner.button_scan_resume);\n\t\tthis.spinner.css({display: 'none'});\n\t\tthis.paused = true;\n\t\tthis.active = false;\n\t};\n\n\tresume( opt ){\n\t\tconsole.log('RESUME');\n\t\tthis.button.html(spbcScaner.button_scan_pause);\n\t\tthis.spinner.css({display: 'inline'});\n\t\tthis.paused = false;\n\t\tthis.active = true;\n\t};\n\n\tend( reload ){\n\n\t\tthis.progressbar.hide(500);\n\t\tthis.progress_overall.hide(500);\n\t\tthis.button.html(spbcScaner.button_scan_perform);\n\t\tthis.spinner.css({display: 'none'});\n\t\tthis.state = null;\n\t\tthis.total_links = 0;\n\t\tthis.plug = false;\n\t\tthis.total_scanned = 0;\n\t\tthis.active = false;\n\n\t\tif(reload){\n\t\t\tdocument.location = document.location;\n\t\t}else{\n\t\t\tspbc_sendAJAXRequest(\n\t\t\t\t{action: 'spbc_scanner_tab__reload_accordion'},\n\t\t\t\t{\n\t\t\t\t\tnotJson: true,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tjQuery(obj).accordion('destroy')\n\t\t\t\t\t\t\t.html(result)\n\t\t\t\t\t\t\t.accordion({\n\t\t\t\t\t\t\t\theader: 'h3',\n\t\t\t\t\t\t\t\theightStyle: 'content',\n\t\t\t\t\t\t\t\tcollapsible: true,\n\t\t\t\t\t\t\t\tactive: false,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tspbc_tbl__bulk_actions__listen();\n\t\t\t\t\t\tspbc_tbl__row_actions__listen();\n\t\t\t\t\t\tspbc_tbl__pagination__listen();\n\t\t\t\t\t\tspbc_tbl__sort__listen();\n\t\t\t\t\t\tspbcStartShowHide();\n\t\t\t\t\t\tspbc_scanner__reload_scan_info();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tjQuery('#spbc_scan_accordion')\n\t\t\t);\n\n\t\t\tif (!jQuery('#spbc_scanner_clear').length) {\n\t\t\t\tlet clear_link = '

Clear scanner logs


';\n\t\t\t\tjQuery(clear_link).insertBefore('#spbcscan-scanner-caption');\n\t\t\t}\n\t\t}\n\n\t};\n\n\tcontroller( result ) {\n\n\t\tconsole.log(this.state);\n\n\t\t// The current stage is over. Switching to the new one\n\t\tif( typeof result !== 'undefined' && result.end ){\n\n\t\t\tthis.state = this.getNextState( this.state );\n\n\t\t\t// End condition\n\t\t\tif (typeof this.state === 'undefined'){\n\t\t\t\tthis.end();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set percent to 0\n\t\t\tthis.setPercents( 0 );\n\t\t\tthis.scan_percent = 0;\n\t\t\tthis.offset = 0;\n\n\t\t\t// Changing visualizing of the current stage\n\t\t\tthis.progress_overall.children('span')\n\t\t\t\t.removeClass('spbc_bold')\n\t\t\t\t.filter('.spbc_overall_scan_status_' + this.state)\n\t\t\t\t.addClass('spbc_bold');\n\t\t}\n\n\t\t// Break execution if paused\n\t\tif( this.paused === true )\n\t\t\treturn;\n\n\t\t// // AJAX params\n\t\tlet data = {\n\t\t\taction: 'spbc_scanner_controller_front',\n\t\t\tmethod: this.state,\n\t\t\toffset: this.offset,\n\t\t};\n\n\t\tvar params = {\n\t\t\ttype: 'GET',\n\t\t\tsuccess: this.success,\n\t\t\tcallback: this.successCallback,\n\t\t\terror: this.error,\n\t\t\terrorOutput: this.errorOutput,\n\t\t\tcomplete: null,\n\t\t\tcontext: this,\n\t\t\ttimeout: 120000\n\t\t};\n\n\t\tswitch (this.state) {\n\t\t\tcase 'get_modules_hashes': this.amount = 2; break;\n\t\t\tcase 'clear_table': this.amount = 10000; break;\n\t\t\tcase 'file_system_analysis': this.amount = 700; break;\n\t\t\tcase 'auto_cure': this.amount = 5; break;\n\t case 'outbound_links': this.amount = 10; break;\n\t case 'frontend_analysis': this.amount = spbcSettings.frontendAnalysisAmount; break;\n\t\t\tcase 'signature_analysis': this.amount = 10; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\n\t\t\tcase 'heuristic_analysis': this.amount = 4; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED'; break;\n\t\t\tcase 'schedule_send_heuristic_critical_files': this.amount = 1; break;\n\t\t}\n\n\t\tdata.amount = Math.round(this.amount * this.amount_coefficient);\n\n\t\tspbc_sendAJAXRequest(\n\t\t\tdata,\n\t\t\tparams,\n\t\t\tjQuery('#spbc_scan_accordion')\n\t\t);\n\n\t};\n\n\tsetCoefficients( state ) {\n\t\tlet coefficient = this.amount_coefficient;\n\t\tswitch (state) {\n\t\t\tcase 'file_system_analysis': coefficient *= 1.5; break;\n\t\t}\n\t\tthis.amount_coefficient = coefficient;\n\t};\n\n\tgetNextState( state ) {\n\n\t\tstate = state === null ? this.states[0] : this.states[ this.states.indexOf( state ) + 1 ];\n\n\t\tif (typeof this.settings[ 'scanner__' + state ] !== 'undefined' && +this.settings[ 'scanner__' + state ] === 0)\n\t\t\tstate = this.getNextState( state );\n\n\t\treturn state;\n\t};\n\n\tsetPercents( percents ){\n\t\tthis.percent_completed = Math.floor( percents * 100 ) / 100;\n\t\tthis.progressbar.progressbar( 'option', 'value', this.percent_completed );\n\t\tthis.progressbar_text.text( spbcScaner[ 'progressbar_' + this.state ] + ' - ' + this.percent_completed + '%' );\n\t};\n\n\tsuccess( response ){\n\n\t\tif( !! response.error ){\n\n\t\t\tthis.error(\n\t\t\t\t{status: 200, responseText: response.error},\n\t\t\t\tresponse.error,\n\t\t\t\tresponse.msg\n\t\t\t);\n\n\t\t}else{\n\t\t\tif( this.successCallback )\n\t\t\t\tthis.successCallback( response, this.data, this.obj );\n\t\t}\n\n\t};\n\n\t// Processing response from backend\n\tsuccessCallback( result ){\n\n\t\tconsole.log( result );\n\n\t\tif( typeof result.total !== 'undefined' )\n\t\t\tthis.scan_percent = 100 / result.total;\n\n\t\tif( typeof result.processed_items !== 'undefined'){\n\n\t\t\tif( this.state === 'heuristic_analysis' && typeof result.total !== 0 )\n\t\t\t\tthis.logRaw('

Heuristic Analysis

');\n\t\t\tif( this.state === 'signature_analysis' && typeof result.total !== 0 )\n\t\t\t\tthis.logRaw('

Signature Analysis

');\n\n\t\t\tthis.logFileEntry( result.processed_items );\n\t\t}\n\n\t\tif( typeof result.stage_data_for_logging !== 'undefined'){\n\t\t\tthis.logStageEntry( result.stage_data_for_logging );\n\t\t}\n\n\t\t// Add link on shuffle salt if cured\n\t\tif (result.cured !== 'undefined' && Number(result.cured) > 0) {\n\t\t\tthis.showLinkForShuffleSalts(result.message);\n\t\t}\n\n\t\tif( result.end !== true && result.end !== 1 ){\n\t\t\tthis.setPercents( this.percent_completed + result.processed * this.scan_percent );\n\t\t\tthis.offset = this.offset + result.processed;\n\t\t\tthis.controller( result );\n\t\t}else{\n\t\t\tconsole.log( this.state + \" stage took \" + ( Math.round(new Date().getTime() /1000) - this.state_timer ) + \" seconds to complete\" );\n\t\t\tthis.state_timer = Math.round(new Date().getTime()/1000);\n\t\t\tthis.setPercents( 100 );\n\t\t\tthis.scan_percent = 0;\n\t\t\tthis.offset = 0;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.controller( result );\n\t\t\t}, 300);\n\t\t}\n\t};\n\n\terror( xhr, status, error ){\n\n\t\tlet errorOutput = this.errorOutput;\n\n\t\tconsole.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\n\t\tconsole.log( status );\n\t\tconsole.log( error );\n\t\tconsole.log( xhr );\n\n\t\tif (status == 'error' && (error == '' || error == 'Not found')) {\n if (!this.tryCount) {\n this.tryCount = 0;\n this.retryLimit = 30;\n }\n\t\t\tthis.tryCount++;\n\t\t\tconsole.log('Try #' + this.tryCount);\n\t\t\tthis.setCoefficients(this.state);\n\t\t\tif (this.tryCount <= this.retryLimit) {\n\t\t\t\tthis.pause();\n this.resume();\n this.controller();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif( xhr.status === 200 ){\n\t\t\tif( status === 'parsererror' ){\n\t\t\t\terrorOutput( 'Unexpected response from server. See console for details.', this.state );\n\t\t\t\tconsole.log( '%c ' + xhr.responseText, 'color: pink;' );\n\t\t\t}else{\n\t\t\t\tlet error_string = status;\n\t\t\t\tif( typeof error !== 'undefined' )\n\t\t\t\t\terror_string += ' Additional info: ' + error;\n\t\t\t\terrorOutput( error_string, this.state );\n\t\t\t}\n\t\t}else if(xhr.status === 500){\n\t\t\terrorOutput( 'Internal server error.', this.state);\n\t\t}else\n\t\t\terrorOutput('Unexpected response code: ' + xhr.status + '. Error: ' + status, this.state);\n\n\t\tif( this.progressbar )\n\t\t\tthis.progressbar.fadeOut('slow');\n\n\t\tthis.end();\n\t};\n\n\terrorOutput( error_msg, stage ){\n\t\tspbcModal.open().putError( error_msg + '
Stage: ' + stage);\n\t};\n\n\tlogRaw(message_to_log ){\n\t\tjQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n\t\tjQuery('.spbc_log-wrapper').removeClass('spbc---hidden');\n\t\tjQuery('.spbc_log-wrapper .panel-body').prepend( message_to_log );\n\t};\n\n\tlogFileEntry(items){\n\t\tfor ( var key in items ){\n\t\t\tthis.logRaw( '

' + this.getSiteUTCShiftedTimeString() + ' - ' + items[ key ].path + ': ' + items[ key ].status + '

' );\n\t\t}\n\t};\n\n\tlogStageEntry(data){\n\t\tthis.logRaw( '

' + this.getSiteUTCShiftedTimeString() + ' - ' + '' + data.title + ' ' + '' + data.description + '

' );\n\t};\n\n\tshowLinkForShuffleSalts(message) {\n\t\tjQuery('#spbc_notice_about_shuffle_link').remove();\n\t\tjQuery(jQuery('.spbc_tab--active .spbc_wrapper_field p')[1])\n\t\t\t.after(\n\t\t\t\t'
' +\n\t\t\t\t'' +\n\t\t\t\tmessage +\n\t\t\t\t'' +\n\t\t\t\t'
'\n\t\t\t);\n\t}\n\n\tgetSiteUTCShiftedTimeString(){\n\t\tvar utc_shifted_ts = false;\n\t\t//gettings current system/browser offset\n\t\tvar current_browser_offset = new Date().getTimezoneOffset();\n\t\tcurrent_browser_offset = current_browser_offset * -1 * 1000 * 60;\n\t\t//chek if global ct object is defined\n\t\tif (typeof spbcScaner !== \"undefined\"\n\t\t\t&& typeof spbcScaner.timezone_shift !== \"undefined\"\n\t\t\t&& spbcScaner.timezone_shift !== false){\n\t\t\tutc_shifted_ts = Date.now() - current_browser_offset + (spbcScaner.timezone_shift * 1000);\n\t\t}\n\t\tvar ct_date = utc_shifted_ts ? new Date(utc_shifted_ts) : new Date();\n\t\t//construct date string\n\t\tvar shortMonthName = new Intl.DateTimeFormat(\"en-US\", { month: \"short\" }).format;\n\t\tvar minutes = String(ct_date.getMinutes()).padStart(2, '0');\n\t\tvar seconds = String(ct_date.getSeconds()).padStart(2, '0');\n\t\treturn shortMonthName(ct_date) + ' ' + ct_date.getDate() + ' ' + ct_date.getFullYear() + ' ' + ct_date.getHours() + ':' + minutes + ':' + seconds\n\t}\n\n}\n"],"names":["spbcMalwareScanner","first_start","active","root","settings","states","state","offset","amount","amount_coefficient","total_scanned","scan_percent","percent_completed","paused","button","spinner","progress_overall","progressbar","progressbar_text","timeout","state_timer","constructor","properties","let","key","console","log","jQuery","length","removeClass","this","actionControl","start","resume","controller","pause","Math","round","Date","getTime","getNextState","setPercents","children","filter","addClass","show","html","spbcScaner","button_scan_pause","css","display","setTimeout","result","data","opt","button_scan_resume","end","reload","hide","button_scan_perform","total_links","plug","document","location","spbc_sendAJAXRequest","action","notJson","callback","params","obj","accordion","header","heightStyle","collapsible","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","spbc_scanner__reload_scan_info","insertBefore","method","type","success","successCallback","error","errorOutput","complete","context","spbcSettings","frontendAnalysisAmount","status","setCoefficients","coefficient","indexOf","percents","floor","text","response","responseText","msg","total","processed_items","logRaw","logFileEntry","stage_data_for_logging","logStageEntry","cured","Number","showLinkForShuffleSalts","message","processed","xhr","tryCount","retryLimit","error_string","fadeOut","error_msg","stage","spbcModal","open","putError","message_to_log","prepend","items","getSiteUTCShiftedTimeString","path","title","description","remove","after","utc_shifted_ts","current_browser_offset","getTimezoneOffset","ct_date","timezone_shift","now","shortMonthName","Intl","DateTimeFormat","month","format","minutes","String","getMinutes","padStart","seconds","getSeconds","getDate","getFullYear","getHours"],"mappings":"AAAA,mBAEMA,mBAELC,YAAc,CAAA,EAEdC,OAAS,CAAA,EAETC,KAAQ,GACRC,SAAW,GACXC,OAAS,CACR,iBACA,qBACA,gBACA,uBACA,sBACA,oBACA,qBACA,qBACA,yCACA,mBACA,YACA,iBACA,oBACA,0BACA,gBAEDC,MAAQ,KACRC,OAAS,EACTC,OAAS,EACTC,mBAAqB,EACrBC,cAAgB,EAChBC,aAAe,EACfC,kBAAoB,EAEpBC,OAAS,CAAA,EAETC,OAAS,KACTC,QAAU,KAEVC,iBAAmB,KACnBC,YAAc,KACdC,iBAAmB,KAEnBC,QAAU,IAEVC,YAAc,EAEdC,YAAcC,GAYb,IAAKC,IAAIC,KAVTC,QAAQC,IAAI,MAAM,EACdC,OAAO,8BAA8B,EAAEC,QAC1CD,OAAO,sBAAsB,EAAEE,YAAY,eAAe,EAIR,KAAA,IAAxCP,EAAqB,SAAa,YAC5CA,EAAqB,SAA6B,0BAAI,KAGvCA,EACU,KAAA,IAAdQ,KAAKN,KACfM,KAAKN,GAAOF,EAAWE,GAI1B,CAEAO,gBAEmB,OAAfD,KAAKxB,MACPwB,KAAKE,MAAM,EAEHF,KAAKjB,QACbiB,KAAKG,OAAO,EACZH,KAAKI,WAAW,GAGhBJ,KAAKK,MAAM,CAEb,CAEAH,QAECF,K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No newline at end of file diff --git a/js/spbc-settings.min.js.map b/js/spbc-settings.min.js.map index 96d6b2f03..0e4bdf068 100644 --- a/js/spbc-settings.min.js.map +++ b/js/spbc-settings.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings.min.js","sources":["spbc-settings.js"],"sourcesContent":["// Printf for JS\r\nString.prototype.printf = function(){\r\n var formatted = this;\r\n for( var arg in arguments ) {\r\n var before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\r\n var after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\r\n formatted = before_formatted + arguments[arg] + after_formatted;\r\n }\r\n return formatted;\r\n};\r\n\r\n// Switching tabs\r\nfunction spbc_switchTab(tab, params){\r\n\r\n\tvar tab_name = tab.classList[1].replace('spbc_tab_nav-', '');\r\n\r\n\t// update url \r\n\tvar searchParams = new URLSearchParams(window.location.search)\r\n searchParams.set(\"spbc_tab\", tab_name);\r\n\tvar hashParam = window.location.hash;\r\n var newRelativePathQuery = window.location.pathname + '?' + searchParams.toString() + hashParam;\r\n\r\n history.replaceState(null, '', newRelativePathQuery);\r\n\r\n\t// Hiding a tab 'Backups' if exist\r\n if(searchParams.get('spbc_tab') !== 'backups') {\r\n \tjQuery('.spbc_tab_nav-backups').hide();\r\n }\r\n\r\n // update active tab\r\n\tjQuery('.spbc_tab_nav').removeClass('spbc_tab_nav--active');\r\n\tjQuery('.spbc_tab').removeClass('spbc_tab--active');\r\n\tjQuery(tab).addClass('spbc_tab_nav--active');\r\n\tjQuery('.spbc_tab-'+tab_name).addClass('spbc_tab--active');\r\n\r\n\tif(!jQuery(tab).data('loaded')){\r\n\t\tvar data = {\r\n\t\t\taction: 'spbc_settings__draw_elements',\r\n\t\t\ttab_name: tab_name,\r\n\t\t\tsecurity: spbcSettings.ajax_nonce\r\n\t\t};\r\n\t\tvar params = {\r\n\t\t\tcallback: spbc_draw_settings_callback,\r\n\t\t\tnotJson: true,\r\n additional: params || null,\r\n\t\t};\r\n\t\tspbc_sendAJAXRequest( data, params, tab );\r\n\t}else if(params && params.action){\r\n switch (params.action){\r\n case 'highlight':\r\n spbcHighlightElement(params.target, params.times);\r\n break;\r\n case 'click':\r\n setTimeout(function(){\r\n jQuery('#'+params.additional.target).click();\r\n }, 500);\r\n break;\r\n }\r\n\t}\r\n}\r\n\r\nfunction spbc_draw_settings_callback(result, data, params, obj){\r\n\r\n\tjQuery(obj).data('loaded', true);\r\n\tjQuery('.spbc_tab-'+data.tab_name).replaceWith(result);\r\n\tvar tab = jQuery('.spbc_tab-'+data.tab_name);\r\n\ttab.addClass('spbc_tab--active');\r\n\r\n\tjQuery(document).off( 'click', '.spbc_long_description__show');\r\n\tjQuery(document).on('click', '.spbc_long_description__show', function(){\r\n\t\tself = jQuery(this);\r\n\t\tspbc_settings__show_description(self, self.attr('setting'));\r\n\t});\r\n\r\n\tjQuery(document).off( 'click', '.spbc_long_recommendation__show');\r\n\tjQuery(document).on('click', '.spbc_long_recommendation__show', function(){\r\n\t\tself = jQuery(this);\r\n\t\tspbc_settings__show_recommendation(self, self.attr('setting'));\r\n\t});\r\n\r\n\tif(params.additional){\r\n\t switch (params.additional.action) {\r\n case 'highlight':\r\n\t\t spbcHighlightElement(params.additional.target, params.additional.times);\r\n break;\r\n case 'click':\r\n setTimeout(function(){\r\n\t\t jQuery('#'+params.additional.target).click();\r\n }, 500);\r\n break;\r\n }\r\n }\r\n\r\n\tjQuery(tab).on('click', '.spbc_hint-send_'+data.tab_name, function(){\r\n\t\t\tjQuery('.spbc_hint-send_'+data.tab_name).hide();\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_send_'+data.tab_name, tab_name: data.tab_name},\r\n\t\t\t{callback: spbc_send_logs_callback}\r\n\t\t);\r\n\t});\r\n\r\n\t// scroll to anchor\r\n\tif (window.location.hash) {\r\n\t\tdocument.getElementById(window.location.hash.substring(1)).scrollIntoView();\r\n\t}\r\n}\r\n\r\nfunction spbc_send_logs_callback(result, data, params, obj){\r\n\tjQuery('.spbc_tab_nav-'+data.tab_name).data('loaded', false);\r\n\tspbc_switchTab(document.getElementsByClassName('spbc_tab_nav-'+data.tab_name)[0]);\r\n}\r\n\r\n// Settings dependences\r\nfunction spbcSettingsDependenciesbyId(settingsIDs, enable){\r\n\r\n\tif(typeof settingsIDs === 'string'){\r\n\t\ttmp = [];\r\n\t\ttmp.push(settingsIDs);\r\n\t\tsettingsIDs = tmp;\r\n\t}\r\n\r\n\tenable = typeof enable === 'undefined' ? null : +enable;\r\n\r\n\tsettingsIDs.forEach(function(settingID, i, arr){\r\n\r\n\t\tvar elem = document.getElementById('spbc_setting_'+settingID),\r\n do_disable = function(){elem.setAttribute('disabled', 'disabled');},\r\n do_enable = function(){elem.removeAttribute('disabled');};\r\n\r\n if(enable !== null) // Set\r\n enable === 1 ? do_enable() : do_disable();\r\n else // Switch\r\n elem.getAttribute('disabled') === null ? do_disable() : do_enable();\r\n\r\n\t});\r\n}\r\n\r\n/**\r\n * Recursive in case children found!\r\n *\r\n * Settings dependencies\r\n *\r\n */\r\nfunction spbcSettingsDependencies(settingNames, enable){\r\n\r\n\t// Cast settingNames to array\r\n\tsettingNames = typeof settingNames === 'string' ? settingNames.split(',') : settingNames;\r\n\tenable = typeof enable === 'undefined' ? +event.target.checked : +enable;\r\n\r\n\tsettingNames.forEach(function(settingName, i, arr){\r\n\r\n\t\tdocument.getElementsByName('spbc_settings['+settingName+']')\r\n\t\t\t.forEach(function( elem, i, arr ){\r\n\r\n\t\t\t\tvar\tdo_disable = function(){elem.setAttribute('disabled', 'disabled');},\r\n\t\t\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\r\n\t\t\t\tif(enable !== null) // Set\r\n\t\t\t\t\tenable === 1 ? do_enable() : do_disable();\r\n\t\t\t\telse // Switch\r\n\t\t\t\t\telem.getAttribute('disabled') === null ? do_disable() : do_enable();\r\n\r\n\t\t\t\tvar children = elem.getAttribute('children');\r\n\t\t\t\tif( children !== null ){\r\n\t\t\t\t\tspbcSettingsDependencies(children, enable && elem.checked);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t});\r\n}\r\n\r\nfunction spbc_settings__show_description(label, setting_id){\r\n\t\r\n\tvar remove_desc_func = function(e){\r\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.spbc_long_desc').length == 0 || jQuery(e.target).hasClass('spbc_long_desc__cancel')) && !jQuery(e.target).hasClass('spbc_long_description__show'))){\r\n\t\t\tjQuery('.spbc_long_desc').remove();\r\n\t\t\tjQuery(document).off('click', remove_desc_func);\r\n\t\t}\r\n\t};\r\n\t\r\n\tremove_desc_func();\r\n\t\r\n\tlabel.after(\"
\");\r\n\tvar obj = jQuery('#spbc_long_desc__'+setting_id);\r\n\tobj.append(\"\")\r\n\t\t.append(\"
\")\r\n\t\t.css({\r\n\t\t\ttop: label.position().top + 25,\r\n\t\t\tleft: label.position().left + 5\r\n\t\t});\r\n\r\n\t\r\n\tspbc_sendAJAXRequest(\r\n\t\t{action: 'spbc_settings__get_description', setting_id: setting_id},\r\n\t\t{\r\n\t\t\tspinner: obj.children('img'),\r\n\t\t\tcallback: function(result, data, params, obj){\r\n\r\n\t\t\t\tobj.empty()\r\n\t\t\t\t\t.append(\"
\")\r\n\t\t\t\t\t.append(\"\")\r\n\t\t\t\t\t.append(\"

\"+result.title+\"

\")\r\n\t\t\t\t\t.append(\"

\"+result.desc+\"

\");\r\n\r\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\r\n\t\t\t}\r\n\t\t},\r\n\t\tobj\r\n\t);\r\n}\r\n\r\nfunction spbc_settings__show_recommendation(label, setting_id){\r\n\t\r\n\tvar remove_recommendation_func = function(e){\r\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.spbc_long_desc').length == 0 || jQuery(e.target).hasClass('spbc_long_desc__cancel')) && !jQuery(e.target).hasClass('spbc_long_recommendation__show'))){\r\n\t\t\tjQuery('.spbc_long_desc').remove();\r\n\t\t\tjQuery(document).off('click', remove_recommendation_func);\r\n\t\t}\r\n\t};\r\n\t\r\n\tremove_recommendation_func();\r\n\t\r\n\tlabel.after(\"
\");\r\n\tvar obj = jQuery('#spbc_long_desc__'+setting_id);\r\n\tobj.append(\"\")\r\n\t\t.append(\"
\")\r\n\t\t.css({\r\n\t\t\ttop: label.position().top + 25,\r\n\t\t\tleft: label.position().left + 5\r\n\t\t});\r\n\r\n\t\r\n\tspbc_sendAJAXRequest(\r\n\t\t{action: 'spbc_settings__get_recommendation', setting_id: setting_id},\r\n\t\t{\r\n\t\t\tspinner: obj.children('img'),\r\n\t\t\tcallback: function(result, data, params, obj){\r\n\r\n\t\t\t\tobj.empty()\r\n\t\t\t\t\t.append(\"
\")\r\n\t\t\t\t\t.append(\"\")\r\n\t\t\t\t\t.append(\"

\"+result.title+\"

\")\r\n\t\t\t\t\t.append(\"

\"+result.desc+\"

\");\r\n\r\n\t\t\t\tjQuery(document).on('click', remove_recommendation_func);\r\n\t\t\t}\r\n\t\t},\r\n\t\tobj\r\n\t);\r\n}\r\n\r\n// Shows/hides full text\r\nfunction spbcStartShowHide(){\r\n\tjQuery('.spbcShortText')\r\n\t\t.off('mouseover' )\r\n\t\t.on('mouseover', function(){ jQuery(this).next().show(); })\r\n\t\t.off('mouseout' )\r\n\t\t.on('mouseout', function(){ jQuery(this).next().hide(); });\r\n\tjQuery('.spbcFullText')\r\n\t\t.off('mouseout' )\r\n\t\t.on('mouseout', function(){ jQuery(this).hide(); })\r\n\t\t.off('mouseover' )\r\n\t\t.on('mouseover', function(){ jQuery(this).show(); })\r\n}\r\n\r\n// Generate and save confirmation code\r\nfunction spbctGenerateConfirmationCode() {\r\n\r\n\tvar data = {};\r\n\tvar res = {};\r\n\tres.success = false;\r\n\tdata.security = spbcSettings.ajax_nonce;\r\n\tdata.action = 'spbc_generate_confirmation_code';\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: false,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(result.success) {\r\n\t\t\t\tres.success = true;\r\n\t\t\t} else {\r\n\t\t\t\tres.text = result.data;\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n\treturn res;\r\n}\r\n// Check confirmation code\r\nfunction spbctCheckConfirmationCode( radioButton, timeout, timer ) {\r\n\r\n\tvar element = radioButton;\r\n\tvar data = {};\r\n\tdata.security = spbcSettings.ajax_nonce;\r\n\tdata.action = 'spbc_check_confirmation_code';\r\n\tdata.code = jQuery('#confirmation-code input').val();\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: false,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result){\r\n\t\t\tif(result.success) {\r\n\t\t\t\tjQuery('[name *= 2fa__enable]').attr(\"checked\", \"\");\r\n\t\t\t\telement.checked = true;\r\n\t\t\t\tjQuery('#spbc_setting_2fa__roles').removeAttr('disabled');\r\n\t\t\t\tjQuery('#spbc_setting_2fa__roles > option:first').attr('selected','selected');\r\n\t\t\t\tclearTimeout( timeout );\r\n\t\t\t\ttimer.remove();\r\n\t\t\t\tjQuery('#confirmation-code').dialog( \"close\" );\r\n\t\t\t} else {\r\n\t\t\t\talert('Code verification failed!');\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n\r\n}\r\n\r\n/**\r\n * Checking current account status for renew notice\r\n */\r\nfunction spbc_banner_check() {\r\n\tvar bannerChecker = setInterval( function() {\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_settings__check_renew_banner'},\r\n\t\t\t{\r\n\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\tif (result.close_renew_banner) {\r\n\t\t\t\t\t\tif (jQuery('#spbc_renew_notice').length)\r\n\t\t\t\t\t\t\tjQuery('#spbc_renew_notice').hide('slow');\r\n\t\t\t\t\t\tif (jQuery('#spbc_trial_notice').length)\r\n\t\t\t\t\t\t\tjQuery('#spbc_trial_notice').hide('slow');\r\n\t\t\t\t\t\tclearInterval(bannerChecker);\r\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t}, 60000);\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\t\r\n\tjQuery('#spbc_gdpr_open_modal').on('click', function(){\r\n\t\tjQuery('#gdpr_dialog').dialog({\r\n\t\t\tmodal:true, \r\n\t\t\tshow: true,\r\n\t\t\tposition: { my: \"center\", at: \"center\", of: window },\r\n\t\t\twidth: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\r\n\t\t\theight: 'auto',\r\n\t\t\ttitle: 'GDPR compliance',\r\n\t\t\tdraggable: false,\r\n\t\t\tresizable: false,\r\n\t\t\tcloseText: \"Close\",\r\n\t\t});\r\n\t});\r\n\r\n\t// Checking email receiving possibility for activation 2FA\r\n\tjQuery(document).on('click', '[name*=fa__enable]:not([value=0]),#confirmation-code--resend', function(e){\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tjQuery('#confirmation-code--resend').attr('disabled', 'disabled')\r\n\t\t\t.append('
');\r\n\t\tvar enableResend = setTimeout(function(){\r\n\t\t\tjQuery('#confirmation-code--resend').removeAttr('disabled');\r\n\t\t\tjQuery('#confirmation-code--resend>.circle').remove();\r\n\t\t}, 30000);\r\n\r\n\t\tvar res = spbctGenerateConfirmationCode();\r\n\t\tif( res.success ) {\r\n\t\t\tjQuery('#confirmation-code input').val('');\r\n\t\t\tjQuery('#confirmation-code').dialog({\r\n\t\t\t\tmodal: true,\r\n\t\t\t\ttitle: 'Confirmation code',\r\n\t\t\t\twidth: 310,\r\n\t\t\t\tbuttons: {\r\n\t\t\t\t\tCancel: function() {\r\n\t\t\t\t\t\tjQuery( this ).dialog( \"close\" );\r\n\t\t\t\t\t\tclearTimeout( enableResend );\r\n\t\t\t\t\t\tjQuery('#confirmation-code--resend>.circle').remove();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tOk: function() {\r\n\t\t\t\t\t\tspbctCheckConfirmationCode(e.target, enableResend, jQuery('#confirmation-code--resend>.circle'));\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tdraggable: false,\r\n\t\t\t\tresizable: false,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\talert(res.text);\r\n\t\t}\r\n\t});\r\n\t\r\n\tif (jQuery('#spbc_renew_notice').length || jQuery('#spbc_trial_notice').length) {\r\n\t\tspbc_banner_check();\r\n\t}\r\n\r\n\t// Sync button\r\n\tjQuery('#spbc_button__sync').on('click', function(){\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_sync'},\r\n\t\t\t{\r\n\t\t\t\ttimeout: 25000,\r\n\t\t\t\tbutton: document.getElementById('spbc_button__sync' ),\r\n\t\t\t\tspinner: jQuery('#spbc_button__sync .spbc_preloader_button' ),\r\n\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\tjQuery('#spbc_button__sync .spbc_success').show(300);\r\n\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_button__sync .spbc_success').hide(300);}, 2000);\r\n\t\t\t\t\tif(result.reload)\r\n\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t});\r\n\r\n\tif( spbcSettings.key_changed ){\r\n\t\tjQuery('#spbc_button__sync').click();\r\n\t}\r\n\r\n\t// Get Key Auto button\r\n\tjQuery(document).on('click', '#spbc_setting_get_key_auto', function(){\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_get_key_auto'},\r\n\t\t\t{\r\n\t\t\t\ttimeout: 25000,\r\n\t\t\t\tbutton: document.getElementById('spbc_setting_get_key_auto' ),\r\n\t\t\t\tspinner: jQuery('#spbc_setting_get_key_auto .spbc_preloader_button' ),\r\n\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\tjQuery('#spbc_setting_get_key_auto .spbc_success').show(300);\r\n\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_setting_get_key_auto .spbc_success').hide(300);}, 2000);\r\n\t\t\t\t\tif(result.reload)\r\n\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\tif(result.msg) {\r\n\t\t\t\t\t\tspbcModal.open().putError(result.msg);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(result.getTemplates) {\r\n\t\t\t\t\t\tspbcModal.loaded = result.getTemplates;\r\n\t\t\t\t\t\tspbcModal.open();\r\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\r\n\t\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t});\r\n\r\n\t// Import settings\r\n\tjQuery( document ).on('click', '#spbc_settings_templates_import_button', function(){\r\n\t\tjQuery('#spbc-ajax-result').remove();\r\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_import'));\r\n\t\tvar templateNameInput = jQuery('#spbc_settings_templates_import_name');\r\n\t\ttemplateNameInput.css('border-color', 'inherit');\r\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\r\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar data = {\r\n\t\t\t'template_id' : optionSelected.data('id'),\r\n\t\t\t'template_name' : optionSelected.data('name'),\r\n\t\t\t'settings' : optionSelected.data('settings')\r\n\t\t};\r\n\t\tvar button = this;\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_settings_templates_import', data: data},\r\n\t\t\t{\r\n\t\t\t\ttimeout: 25000,\r\n\t\t\t\tbutton: button,\r\n\t\t\t\tspinner: jQuery('#spbc_settings_templates_import_button .spbc_preloader_button' ),\r\n\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\tif(result.success) {\r\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\r\n\t\t\t\t\t\tjQuery('#spbc_settings_templates_import_button .spbc_success').show(300);\r\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_settings_templates_import_button .spbc_success').hide(300);}, 2000);\r\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\r\n\t\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tsetTimeout(function(){spbcModal.close()}, 2000);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t});\r\n\r\n\t// Export settings\r\n\tjQuery( document ).on('click', '#spbc_settings_templates_export_button', function(){\r\n\t\tjQuery('#spbc-ajax-result').remove();\r\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_export'));\r\n\t\tvar templateNameInput = jQuery('#spbc_settings_templates_export_name');\r\n\t\ttemplateNameInput.css('border-color', 'inherit');\r\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\r\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif( optionSelected.data('id') === 'new_template' ) {\r\n\t\t\tvar templateName = templateNameInput.val();\r\n\t\t\tif( templateName === '' ) {\r\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar data = {\r\n\t\t\t\t'template_name' : templateName\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar data = {\r\n\t\t\t\t'template_id' : optionSelected.data('id')\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar button = this;\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_settings_templates_export', data: data},\r\n\t\t\t{\r\n\t\t\t\ttimeout: 25000,\r\n\t\t\t\tbutton: button,\r\n\t\t\t\tspinner: jQuery('#spbc_settings_templates_export_button .spbc_preloader_button' ),\r\n\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\tif(result.success) {\r\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\r\n\t\t\t\t\t\tjQuery('#spbc_settings_templates_export_button .spbc_success').show(300);\r\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_settings_templates_export_button .spbc_success').hide(300);}, 2000);\r\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\r\n\t\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tsetTimeout(function(){spbcModal.close()}, 2000);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t});\r\n\r\n\t// Reset settings\r\n\tjQuery( document ).on('click', '#spbc_settings_templates_reset_button', function(){\r\n\t\tvar button = this;\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{action: 'spbc_settings_templates_reset'},\r\n\t\t\t{\r\n\t\t\t\ttimeout: 25000,\r\n\t\t\t\tbutton: button,\r\n\t\t\t\tspinner: jQuery('#spbc_settings_templates_reset_button .spbc_preloader_button' ),\r\n\t\t\t\tcallback: function(result, data, params, obj){\r\n\t\t\t\t\tif(result.success) {\r\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\r\n\t\t\t\t\t\tjQuery('#spbc_settings_templates_reset_button .spbc_success').show(300);\r\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_settings_templates_reset_button .spbc_success').hide(300);}, 2000);\r\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\r\n\t\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tsetTimeout(function(){spbcModal.close()}, 2000);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t});\r\n\r\n\tjQuery(document).on('change', '#spbc_settings_templates_export',function(){\r\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\r\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\r\n\t\t\tjQuery(this).parent().parent().find('#spbc_settings_templates_export_name').show();\r\n\t\t} else {\r\n\t\t\tjQuery(this).parent().parent().find('#spbc_settings_templates_export_name').hide();\r\n\t\t}\r\n\t});\r\n\r\n\t//* TAB_CONTROL\r\n\t\r\n\t\tjQuery('.spbc_tab_nav-summary').data('loaded', true); // Summary tab loaded by default\r\n\t\tjQuery('.spbc_tabs_nav_wrapper').on('click', '.spbc_tab_nav', function(event){\r\n\t\t\tspbc_switchTab(event.currentTarget);\r\n\t\t});\r\n\t\t\r\n\t\t// Get additional params\r\n var params = {\r\n target: location.search.match(/spbc_target=(\\S*?)(&|$)/) ? location.search.match(/spbc_target=(\\S*?)(&|$)/)[1] : null,\r\n action: location.search.match(/spbc_action=(\\S*?)(&|$)/) ? location.search.match(/spbc_action=(\\S*?)(&|$)/)[1] : null,\r\n times: location.search.match(/spbc_times=(\\S*?)(&|$)/) ? location.search.match(/spbc_times=(\\S*?)(&|$)/)[1] : 3,\r\n };\r\n // Legacy support\r\n params.target = location.search.match(/spbc_highlight=(\\S*?)(&|$)/) ? location.search.match(/spbc_highlight=(\\S*?)(&|$)/)[1] : params.target;\r\n params.action = location.search.search(/spbc_highlight=(\\S*?)(&|$)/) != -1\r\n ? 'highlight'\r\n : params.action;\r\n\r\n\t\t// Get open tab form query\r\n\t\tvar spbc_tab = document.getElementsByClassName('spbc_tab_nav-' + (location.search.match(/spbc_tab=(\\S*?)(&|$)/) ? location.search.match(/spbc_tab=(\\S*?)(&|$)/)[1] : ''))[0] || null;\r\n\r\n\t\t// TAB SWITCHING\r\n\t\t// Switch by URL\r\n\t\tif(spbc_tab){\r\n\r\n\t\t// Switch to DEBUG\r\n\t\t}else if( +spbcSettings.debug ){\r\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-debug')[0];\r\n\t\t// Switch by DEFAULT\r\n\t\t}else if( +spbcSettings.wpms && !+spbcSettings.is_main_site){\r\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-security_log')[0];\r\n\t\t// Switch if Key is OK and SFW is ON\r\n\t\t}else if( +spbcSettings.key_is_ok && +spbcSettings.secfw_enabled ){\r\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-traffic_control')[0];\r\n\t\t// Switch if Key is OK\r\n\t\t}else if( +spbcSettings.key_is_ok ){\r\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-scanner')[0];\r\n\t\t// Switch if KEY IS BAD\r\n\t\t}else{\r\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-settings_general')[0];\r\n\t\t\tparams = {\r\n\t\t\t target: 'spbc_key',\r\n action: 'highlight',\r\n times: 3,\r\n };\r\n\t\t}\r\n\t\t\r\n\t\t// Switch tab\r\n\t\tif(spbc_tab) spbc_switchTab(spbc_tab, params);\r\n\t\t\r\n\t//*/ TAB_CONROL END\r\n\t\r\n\t//* REFRESH TAB IF ctrl+F5\r\n\tvar ctrlKeyDown = false;\r\n\r\n\tjQuery(document).on(\"keyup\", function(e) {\r\n\t\tif ((e.which || e.keyCode) == 17) ctrlKeyDown = false;\r\n\t});\r\n\r\n\tjQuery(document).on(\"keydown\", function(e) {\r\n\t\tif (((e.which || e.keyCode) == 116) && ctrlKeyDown) {\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\tvar active_tab = jQuery('.spbc_tab_nav--active')[0];\r\n\t\t\tvar tab_name = active_tab.classList[1].replace('spbc_tab_nav-', '');\r\n\r\n\t\t\tif (tab_name === 'scanner') return; \r\n\r\n\t\t\tjQuery(active_tab).data('loaded', false);\r\n\r\n\t\t\tspbc_switchTab(active_tab);\r\n\r\n\t\t} else if ((e.which || e.keyCode) == 17) {\r\n\t ctrlKeyDown = true;\r\n\t }\r\n\t});\r\n\t//*/ REFRESH TAB IF ctrl+F5 END\r\n\r\n\t/**\r\n * Change cleantalk account email\r\n */\r\n jQuery(document).on('click', '#spbc-change-account-email', function(e) {\r\n e.preventDefault();\r\n\r\n let $this = jQuery(this);\r\n let accountEmailField = jQuery('#spbc-account-email');\r\n let accountEmail = accountEmailField.text();\r\n\r\n\t\tspbcToggleClass($this, 'active');\r\n\r\n if ($this.hasClass('active')) {\r\n $this.text($this.data('save-text'));\r\n accountEmailField.attr('contenteditable', 'true');\r\n\t\t\taccountEmailField.focus();\r\n accountEmailField.on('keydown', function(e) {\r\n if (e.code === 'Enter') {\r\n e.preventDefault();\r\n }\r\n });\r\n accountEmailField.on('input', function(e) {\r\n if (e.inputType === 'insertParagraph') {\r\n e.preventDefault();\r\n }\r\n });\r\n } else {\r\n spbc_sendAJAXRequest(\r\n {\r\n action: 'spbc_update_account_email',\r\n accountEmail: accountEmail,\r\n },\r\n {\r\n timeout: 5000,\r\n callback: function(result, data, params, obj) {\r\n if (result.success !== undefined && result.success === 'ok') {\r\n if (result.manuallyLink !== undefined) {\r\n jQuery('#spbc-key-manually-link').attr('href', result.manuallyLink);\r\n }\r\n }\r\n\r\n if (result.error !== undefined) {\r\n\t\t\t\t\t\t\r\n jQuery('#spbc-account-email').css('border-color', 'red');\r\n }\r\n },\r\n\t\t\t\t\terrorOutput: function(msg) {\r\n\t\t\t\t\t\tspbcModal.loaded = msg;\r\n\t\t\t\t\t\tspbcModal.open();\r\n\t\t\t\t\t}\r\n },\r\n );\r\n\r\n accountEmailField.attr('contenteditable', 'false');\r\n $this.text($this.data('default-text'));\r\n }\r\n });\r\n});\r\n\r\n/**\r\n * @param {string} className\r\n */\r\nfunction spbcToggleClass(arr, className) {\r\n\tfor (let i=0; i\");\n\tvar obj = jQuery('#spbc_long_desc__'+setting_id);\n\tobj.append(\"\")\n\t\t.append(\"
\")\n\t\t.css({\n\t\t\ttop: label.position().top + 25,\n\t\t\tleft: label.position().left + 5\n\t\t});\n\n\t\n\tspbc_sendAJAXRequest(\n\t\t{action: 'spbc_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(\"
\")\n\t\t\t\t\t.append(\"\")\n\t\t\t\t\t.append(\"

\"+result.title+\"

\")\n\t\t\t\t\t.append(\"

\"+result.desc+\"

\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\nfunction spbc_settings__show_recommendation(label, setting_id){\n\t\n\tvar remove_recommendation_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.spbc_long_desc').length == 0 || jQuery(e.target).hasClass('spbc_long_desc__cancel')) && !jQuery(e.target).hasClass('spbc_long_recommendation__show'))){\n\t\t\tjQuery('.spbc_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_recommendation_func);\n\t\t}\n\t};\n\t\n\tremove_recommendation_func();\n\t\n\tlabel.after(\"
\");\n\tvar obj = jQuery('#spbc_long_desc__'+setting_id);\n\tobj.append(\"\")\n\t\t.append(\"
\")\n\t\t.css({\n\t\t\ttop: label.position().top + 25,\n\t\t\tleft: label.position().left + 5\n\t\t});\n\n\t\n\tspbc_sendAJAXRequest(\n\t\t{action: 'spbc_settings__get_recommendation', 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(\"
\")\n\t\t\t\t\t.append(\"\")\n\t\t\t\t\t.append(\"

\"+result.title+\"

\")\n\t\t\t\t\t.append(\"

\"+result.desc+\"

\");\n\n\t\t\t\tjQuery(document).on('click', remove_recommendation_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\n// Shows/hides full text\nfunction spbcStartShowHide(){\n\tjQuery('.spbcShortText')\n\t\t.off('mouseover' )\n\t\t.on('mouseover', function(){ jQuery(this).next().show(); })\n\t\t.off('mouseout' )\n\t\t.on('mouseout', function(){ jQuery(this).next().hide(); });\n\tjQuery('.spbcFullText')\n\t\t.off('mouseout' )\n\t\t.on('mouseout', function(){ jQuery(this).hide(); })\n\t\t.off('mouseover' )\n\t\t.on('mouseover', function(){ jQuery(this).show(); })\n}\n\n// Generate and save confirmation code\nfunction spbctGenerateConfirmationCode() {\n\n\tvar data = {};\n\tvar res = {};\n\tres.success = false;\n\tdata.security = spbcSettings.ajax_nonce;\n\tdata.action = 'spbc_generate_confirmation_code';\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: false,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result){\n\t\t\tif(result.success) {\n\t\t\t\tres.success = true;\n\t\t\t} else {\n\t\t\t\tres.text = result.data;\n\t\t\t}\n\t\t},\n\t});\n\treturn res;\n}\n// Check confirmation code\nfunction spbctCheckConfirmationCode( radioButton, timeout, timer ) {\n\n\tvar element = radioButton;\n\tvar data = {};\n\tdata.security = spbcSettings.ajax_nonce;\n\tdata.action = 'spbc_check_confirmation_code';\n\tdata.code = jQuery('#confirmation-code input').val();\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: false,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result){\n\t\t\tif(result.success) {\n\t\t\t\tjQuery('[name *= 2fa__enable]').attr(\"checked\", \"\");\n\t\t\t\telement.checked = true;\n\t\t\t\tjQuery('#spbc_setting_2fa__roles').removeAttr('disabled');\n\t\t\t\tjQuery('#spbc_setting_2fa__roles > option:first').attr('selected','selected');\n\t\t\t\tclearTimeout( timeout );\n\t\t\t\ttimer.remove();\n\t\t\t\tjQuery('#confirmation-code').dialog( \"close\" );\n\t\t\t} else {\n\t\t\t\talert('Code verification failed!');\n\t\t\t}\n\t\t},\n\t});\n\n}\n\n/**\n * Checking current account status for renew notice\n */\nfunction spbc_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tspbc_sendAJAXRequest(\n\t\t\t{action: 'spbc_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('#spbc_renew_notice').length)\n\t\t\t\t\t\t\tjQuery('#spbc_renew_notice').hide('slow');\n\t\t\t\t\t\tif (jQuery('#spbc_trial_notice').length)\n\t\t\t\t\t\t\tjQuery('#spbc_trial_notice').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 60000);\n}\n\njQuery(document).ready(function(){\n\t\n\tjQuery('#spbc_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// Checking email receiving possibility for activation 2FA\n\tjQuery(document).on('click', '[name*=fa__enable]:not([value=0]),#confirmation-code--resend', function(e){\n\n\t\te.preventDefault();\n\n\t\tjQuery('#confirmation-code--resend').attr('disabled', 'disabled')\n\t\t\t.append('
');\n\t\tvar enableResend = setTimeout(function(){\n\t\t\tjQuery('#confirmation-code--resend').removeAttr('disabled');\n\t\t\tjQuery('#confirmation-code--resend>.circle').remove();\n\t\t}, 30000);\n\n\t\tvar res = spbctGenerateConfirmationCode();\n\t\tif( res.success ) {\n\t\t\tjQuery('#confirmation-code input').val('');\n\t\t\tjQuery('#confirmation-code').dialog({\n\t\t\t\tmodal: true,\n\t\t\t\ttitle: 'Confirmation code',\n\t\t\t\twidth: 310,\n\t\t\t\tbuttons: {\n\t\t\t\t\tCancel: function() {\n\t\t\t\t\t\tjQuery( this ).dialog( \"close\" );\n\t\t\t\t\t\tclearTimeout( enableResend );\n\t\t\t\t\t\tjQuery('#confirmation-code--resend>.circle').remove();\n\t\t\t\t\t},\n\t\t\t\t\tOk: function() {\n\t\t\t\t\t\tspbctCheckConfirmationCode(e.target, enableResend, jQuery('#confirmation-code--resend>.circle'));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdraggable: false,\n\t\t\t\tresizable: false,\n\t\t\t});\n\t\t} else {\n\t\t\talert(res.text);\n\t\t}\n\t});\n\t\n\tif (jQuery('#spbc_renew_notice').length || jQuery('#spbc_trial_notice').length) {\n\t\tspbc_banner_check();\n\t}\n\n\t// Sync button\n\tjQuery('#spbc_button__sync').on('click', function(){\n\t\tspbc_sendAJAXRequest(\n\t\t\t{action: 'spbc_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('spbc_button__sync' ),\n\t\t\t\tspinner: jQuery('#spbc_button__sync .spbc_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#spbc_button__sync .spbc_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_button__sync .spbc_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( spbcSettings.key_changed ){\n\t\tjQuery('#spbc_button__sync').click();\n\t}\n\n\t// Get Key Auto button\n\tjQuery(document).on('click', '#spbc_setting_get_key_auto', function(){\n\t\tspbc_sendAJAXRequest(\n\t\t\t{action: 'spbc_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('spbc_setting_get_key_auto' ),\n\t\t\t\tspinner: jQuery('#spbc_setting_get_key_auto .spbc_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#spbc_setting_get_key_auto .spbc_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_setting_get_key_auto .spbc_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.msg) {\n\t\t\t\t\t\tspbcModal.open().putError(result.msg);\n\t\t\t\t\t}\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tspbcModal.loaded = result.getTemplates;\n\t\t\t\t\t\tspbcModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", 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', '#spbc_settings_templates_import_button', function(){\n\t\tjQuery('#spbc-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#spbc_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\tspbc_sendAJAXRequest(\n\t\t\t{action: 'spbc_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('#spbc_settings_templates_import_button .spbc_preloader_button' ),\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( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#spbc_settings_templates_import_button .spbc_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_settings_templates_import_button .spbc_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", 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(){spbcModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).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', '#spbc_settings_templates_export_button', function(){\n\t\tjQuery('#spbc-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#spbc_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\tspbc_sendAJAXRequest(\n\t\t\t{action: 'spbc_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('#spbc_settings_templates_export_button .spbc_preloader_button' ),\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( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#spbc_settings_templates_export_button .spbc_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_settings_templates_export_button .spbc_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", 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(){spbcModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).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', '#spbc_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tspbc_sendAJAXRequest(\n\t\t\t{action: 'spbc_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('#spbc_settings_templates_reset_button .spbc_preloader_button' ),\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( \"

\" + result.data + \"

\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#spbc_settings_templates_reset_button .spbc_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#spbc_settings_templates_reset_button .spbc_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", 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(){spbcModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"

\" + result.data + \"

\" ).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\tjQuery(document).on('change', '#spbc_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('#spbc_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#spbc_settings_templates_export_name').hide();\n\t\t}\n\t});\n\n\t//* TAB_CONTROL\n\t\n\t\tjQuery('.spbc_tab_nav-summary').data('loaded', true); // Summary tab loaded by default\n\t\tjQuery('.spbc_tabs_nav_wrapper').on('click', '.spbc_tab_nav', function(event){\n\t\t\tspbc_switchTab(event.currentTarget);\n\t\t});\n\t\t\n\t\t// Get additional params\n var params = {\n target: location.search.match(/spbc_target=(\\S*?)(&|$)/) ? location.search.match(/spbc_target=(\\S*?)(&|$)/)[1] : null,\n action: location.search.match(/spbc_action=(\\S*?)(&|$)/) ? location.search.match(/spbc_action=(\\S*?)(&|$)/)[1] : null,\n times: location.search.match(/spbc_times=(\\S*?)(&|$)/) ? location.search.match(/spbc_times=(\\S*?)(&|$)/)[1] : 3,\n };\n // Legacy support\n params.target = location.search.match(/spbc_highlight=(\\S*?)(&|$)/) ? location.search.match(/spbc_highlight=(\\S*?)(&|$)/)[1] : params.target;\n params.action = location.search.search(/spbc_highlight=(\\S*?)(&|$)/) != -1\n ? 'highlight'\n : params.action;\n\n\t\t// Get open tab form query\n\t\tvar spbc_tab = document.getElementsByClassName('spbc_tab_nav-' + (location.search.match(/spbc_tab=(\\S*?)(&|$)/) ? location.search.match(/spbc_tab=(\\S*?)(&|$)/)[1] : ''))[0] || null;\n\n\t\t// TAB SWITCHING\n\t\t// Switch by URL\n\t\tif(spbc_tab){\n\n\t\t// Switch to DEBUG\n\t\t}else if( +spbcSettings.debug ){\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-debug')[0];\n\t\t// Switch by DEFAULT\n\t\t}else if( +spbcSettings.wpms && !+spbcSettings.is_main_site){\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-security_log')[0];\n\t\t// Switch if Key is OK and SFW is ON\n\t\t}else if( +spbcSettings.key_is_ok && +spbcSettings.secfw_enabled ){\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-traffic_control')[0];\n\t\t// Switch if Key is OK\n\t\t}else if( +spbcSettings.key_is_ok ){\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-scanner')[0];\n\t\t// Switch if KEY IS BAD\n\t\t}else{\n\t\t\tspbc_tab = document.getElementsByClassName('spbc_tab_nav-settings_general')[0];\n\t\t\tparams = {\n\t\t\t target: 'spbc_key',\n action: 'highlight',\n times: 3,\n };\n\t\t}\n\t\t\n\t\t// Switch tab\n\t\tif(spbc_tab) spbc_switchTab(spbc_tab, params);\n\t\t\n\t//*/ TAB_CONROL END\n\t\n\t//* REFRESH TAB IF ctrl+F5\n\tvar ctrlKeyDown = false;\n\n\tjQuery(document).on(\"keyup\", function(e) {\n\t\tif ((e.which || e.keyCode) == 17) ctrlKeyDown = false;\n\t});\n\n\tjQuery(document).on(\"keydown\", function(e) {\n\t\tif (((e.which || e.keyCode) == 116) && ctrlKeyDown) {\n\t\t\te.preventDefault();\n\n\t\t\tvar active_tab = jQuery('.spbc_tab_nav--active')[0];\n\t\t\tvar tab_name = active_tab.classList[1].replace('spbc_tab_nav-', '');\n\n\t\t\tif (tab_name === 'scanner') return; \n\n\t\t\tjQuery(active_tab).data('loaded', false);\n\n\t\t\tspbc_switchTab(active_tab);\n\n\t\t} else if ((e.which || e.keyCode) == 17) {\n\t ctrlKeyDown = true;\n\t }\n\t});\n\t//*/ REFRESH TAB IF ctrl+F5 END\n\n\t/**\n * Change cleantalk account email\n */\n jQuery(document).on('click', '#spbc-change-account-email', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#spbc-account-email');\n let accountEmail = accountEmailField.text();\n\n\t\tspbcToggleClass($this, 'active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n\t\t\taccountEmailField.focus();\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n spbc_sendAJAXRequest(\n {\n action: 'spbc_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#spbc-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n\t\t\t\t\t\t\n jQuery('#spbc-account-email').css('border-color', 'red');\n }\n },\n\t\t\t\t\terrorOutput: function(msg) {\n\t\t\t\t\t\tspbcModal.loaded = msg;\n\t\t\t\t\t\tspbcModal.open();\n\t\t\t\t\t}\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n});\n\n/**\n * @param {string} className\n */\nfunction spbcToggleClass(arr, className) {\n\tfor (let i=0; i\");\r\n\r\n\tvar obj = jQuery('.spbc_popup_tip--wrapper');\r\n\r\n\tobj.empty()\r\n\t\t.append(\"
\")\r\n\t\t.css({\r\n\t\t\ttop: show_icon.position().top - 2,\r\n\t\t\tleft: show_icon.position().left + 25\r\n\t\t});\r\n\tobj.append(\"\")\r\n\t\t.append(\"

\" + tip_title + \"

\")\r\n\t\t.append(\"

\" + tip_text + \"

\");\r\n\r\n\tjQuery(document).on('click', remove_desc_func);\r\n\tshow_icon.parents('tr').on('mouseout', remove_desc_func);\r\n}\r\n\r\nfunction spbc_scanner_button_file_view_event(obj){\r\n\tvar self = jQuery(obj);\r\n\tvar data = {\r\n\t\taction: 'spbc_scanner_file_view',\r\n\t\tfile_id: self.parents('.row-actions').attr('uid'),\r\n\t};\r\n\tvar params = {\r\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\r\n\t\tcallback: spbc_scannerButtonView_callback,\r\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\r\n\t};\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\n/**\r\n * Delete file from analysis log\r\n */\r\nfunction spbc_scanner_analysis_log_delete_from_log(obj) {\r\n\r\n\tlet fileIds = [];\r\n\tconst self = jQuery(obj);\r\n\tlet spinner;\r\n\r\n\tif ( jQuery(obj).hasClass('tbl-row_action') ) {\r\n\t\tfileIds.push(self.parents('.row-actions').attr('uid'));\r\n\t\tspinner = self.parent().siblings('.tbl-preloader--tiny');\r\n\t} else {\r\n\t\tconst selectedItems = self.closest('#spbc_tbl__scanner_analysis_log').find('.cb-select:checked');\r\n\t\tif (selectedItems.length === 0) {\r\n\t\t\talert('Please, select elements.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tselectedItems.each(function (index, element) {\r\n\t\t\tconst elementId = jQuery(element).val();\r\n\t\t\tfileIds.push(elementId);\r\n\t\t});\r\n\t\tspinner = self.children('.tbl-preloader--small');\r\n\t}\r\n\r\n\tconst data = {\r\n\t\taction: 'spbc_scanner_analysis_log_delete_from_log',\r\n\t\tfile_ids: fileIds,\r\n\t};\r\n\r\n\tvar params = {\r\n\t\tspinner: spinner,\r\n\t\tcallback: function() { window.location.reload(); },\r\n\t};\r\n\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\nfunction spbc_scanner_button_page_view_event(obj){\r\n\tvar self = jQuery(obj);\r\n\tvar data = {\r\n\t\taction: 'spbc_scanner_page_view',\r\n\t\tpage_url: self.parents('.row-actions').attr('uid'),\r\n\t};\r\n\tvar params = {\r\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\r\n\t\tcallback: spbc_scannerButtonView_callback,\r\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\r\n\t};\r\n\r\n\tlet wp_wrap = jQuery('#wpwrap')\r\n\tlet dialog_window = jQuery('#spbc_dialog')\r\n\r\n\tdialog_window.dialog({\r\n\t\tmodal:true,\r\n\t\ttitle: 'Loading..',\r\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\r\n\t\twidth: +(wp_wrap.width() / 100 * 90),\r\n\t\tshow: { effect: \"blind\", duration: 500 },\r\n\t\tdraggable: false,\r\n\t\tresizable: false,\r\n\t\tcloseText: \"X\",\r\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\r\n\t\topen: function(event, ui) {\r\n\t\t\tevent.target.style.overflow = 'auto';\r\n\t\t\tjQuery('#spbc_dialog').height((document.documentElement.clientHeight) / 100 * 25);\r\n\t\t},\r\n\t\tbeforeClose: function(event, ui) {\r\n\t\t\tdocument.body.style.overflow = 'auto';\r\n\t\t\tjQuery('#spbc_dialog').empty();\r\n\t\t},\r\n\t})\r\n\r\n\tdialog_window.append('\"Wait')\r\n\r\n\tlet spinner = jQuery('#spbc_file_view_preloader')\r\n\tlet size_multiplier = (wp_wrap.width() * 0.0004)\r\n\r\n\tspinner.height(128 * size_multiplier)\r\n\tspinner.width(128 * size_multiplier)\r\n\tspinner.css({left: dialog_window.width()/2 - (128 * size_multiplier / 2)})\r\n\tspinner.css({top: dialog_window.height()/2 - (128 * size_multiplier / 2)})\r\n\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\nfunction spbc_scannerButtonView_callback(result){\r\n\r\n\tlet dialog_window = jQuery('#spbc_dialog')\r\n\tdialog_window.empty();\r\n\r\n\tjQuery('#spbc_file_view_preloader').css({display:'none'})\r\n\r\n\tlet row_template = '
%s

%s


';\r\n\r\n\tfor(let row in result.file){\r\n\t\tdialog_window.append(row_template.printf(row, result.file[row]));\r\n\t}\r\n\r\n\tlet content_height = Object.keys(result.file).length * 19 < 76 ? 76 : Object.keys(result.file).length * 19,\r\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\r\n\t\toverflow = content_height < visible_height ? 'hidden' : 'scroll',\r\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\r\n\r\n\tdialog_window.css({\r\n\t\theight: height,\r\n\t\toverflow: overflow\r\n\t})\r\n\r\n\tdialog_window.dialog({\r\n\t\tmodal:true,\r\n\t\ttitle: ('Loaded: ' + result.file_path),\r\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\r\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\r\n\t\tshow: { effect: \"blind\", duration: 500 },\r\n\t\tdraggable: true,\r\n\t\tresizable: false,\r\n\t\tcloseText: \"X\",\r\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\r\n\t\topen: function(event, ui) {\r\n\t\t\tevent.target.style.overflow = overflow;\r\n\t\t\tjQuery('#spbc_dialog').height(height);\r\n\t\t\tjQuery('.ui-widget-overlay').on('click', function() {\r\n\t\t\t\tjQuery(\"#spbc_dialog\").dialog('close');\r\n\t\t\t});\r\n\t\t},\r\n\t\tbeforeClose: function(event, ui) {\r\n\t\t\tdocument.body.style.overflow = 'auto';\r\n\t\t\tjQuery('#spbc_dialog').empty();\r\n\t\t},\r\n\t});\r\n\r\n\tconsole.log('FILE_VIEWED');\r\n\r\n}\r\n\r\nfunction spbc_scanner_button_file_view_bad_event(obj){\r\n\tvar self = jQuery(obj);\r\n\tvar data = {\r\n\t\taction: 'spbc_scanner_file_view',\r\n\t\tfile_id: self.parents('.row-actions').attr('uid'),\r\n\t};\r\n\tvar params = {\r\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\r\n\t\tcallback: spbc_scannerButtonViewBadFile_callback,\r\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\r\n\t};\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\nfunction spbc_scanner_button_page_view_bad_event(obj){\r\n\tvar self = jQuery(obj);\r\n\tvar data = {\r\n\t\taction: 'spbc_scanner_page_view',\r\n\t\tpage_url: self.parent().attr('uid'),\r\n\t};\r\n\tvar params = {\r\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\r\n\t\tcallback: spbc_scannerButtonViewBad_callback,\r\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\r\n\t};\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\nfunction spbc_scannerButtonViewBadFile_callback(result, data, params){\r\n\r\n\tconsole.log('FILE_VIEWED_BAD_CODE_FILE');\r\n\tconsole.log(arguments);\r\n\tjQuery('#spbc_dialog').empty();\r\n\r\n\tvar row_template = '
%s

%s


',\r\n\t\trow_template_bad = '
%s

%s


',\r\n\t\tseverity_parts = [],\r\n\t\tseverity_parts_sorted = [],\r\n\t\tseverity_keys_sorted = [];\r\n\r\n\tresult.weak_spots = JSON.parse(result.weak_spots)\r\n\tfor(let severity in result.weak_spots){\r\n\t\tseverity_parts[severity] = Object.keys(result.weak_spots[severity])\r\n\t}\r\n\r\n\tseverity_keys_sorted = Object.keys(severity_parts).sort();\r\n\r\n\tfor(key in severity_keys_sorted){\r\n\t\tseverity_parts_sorted[severity_keys_sorted[key]] = severity_parts[severity_keys_sorted[key]]\r\n\t}\r\n\r\n\tfor (let severity_part in severity_parts_sorted) {\r\n\t\tlet header_name = 'spbc-dialog-row-header-' + severity_part.toLowerCase();\r\n\t\tlet header_html = '' + severity_part + ' weakspots:';\r\n\t\tconst dialog = jQuery('#spbc_dialog');\r\n\r\n\t\tdialog.append(row_template.printf('',header_html));\r\n\t\tdialog.append(row_template. printf('...','...'));\r\n\r\n\t\tlet header = dialog.find('#' + header_name);\r\n\t\theader.parent().parent().css('text-align', 'center');\r\n\t\theader.parent().parent().css('border', '1px dotted');\r\n\t\theader.parent().parent().css('background', 'darkgrey');\r\n\r\n\t\tfor(let str_num in severity_parts[severity_part]){\r\n\t\t\t// Sort bad line\r\n\t\t\tstr_num = [...new Set(str_num)].sort()\r\n\r\n\t\t\tlet row = +severity_parts[severity_part][str_num],\r\n\t\t\t\tdisplay_depth = 2;\r\n\r\n\t\t\t// Display only existing lines of file\r\n\t\t\tfor(let curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\r\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' ){\r\n\t\t\t\t\tdialog.append((row === curr_row ? row_template_bad : row_template).printf(curr_row, result.file[curr_row]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Placing an empty string between results\r\n\t\t\tdialog.append(row_template. printf('...','...'));\r\n\t\t}\r\n\t}\r\n\r\n\t// Removing last empty string\r\n\tjQuery('#spbc_dialog div').last().remove();\r\n\r\n\tlet content_height = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19,\r\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\r\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll',\r\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\r\n\r\n\tjQuery('#spbc_dialog').dialog({\r\n\t\tmodal:true,\r\n\t\ttitle: result.file_path,\r\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\r\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\r\n\t\tshow: { effect: \"blind\", duration: 500 },\r\n\t\tdraggable: true,\r\n\t\tresizable: false,\r\n\t\tcloseText: \"X\",\r\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\r\n\t\topen: function(event, ui) {\r\n\t\t\tevent.target.style.overflow = overflow;\r\n\t\t\tjQuery('#spbc_dialog').height(height);\r\n\t\t\tjQuery('.ui-widget-overlay').on('click', function() {\r\n\t\t\t\tjQuery(\"#spbc_dialog\").dialog('close');\r\n\t\t\t});\r\n\t\t},\r\n\t\tbeforeClose: function(event, ui) {\r\n\t\t\tdocument.body.style.overflow = 'auto';\r\n\t\t\tjQuery('#spbc_dialog').empty();\r\n\t\t},\r\n\t});\r\n}\r\n\r\nfunction spbc_scannerButtonViewBad_callback(result, data, params){\r\n\r\n\tconsole.log('FILE_VIEWED_BAD_CODE');\r\n\r\n\tconsole.log(arguments);\r\n\r\n\tlet afterClose = () => {};\r\n\r\n\tif ( result.success == true ) {\r\n\t\tconsole.log(result);\r\n\t\tvar row_template = '
' +\r\n\t\t\t\t'%s' +\r\n\t\t\t\t'

%s

' +\r\n\t\t\t\t'
',\r\n\t\t\trow_template_bad = '
' +\r\n\t\t\t\t'%s' +\r\n\t\t\t\t'

%s

' +\r\n\t\t\t\t'
',\r\n\t\t\tstr_nums = [];\r\n\r\n\t\tresult.weak_spots = JSON.parse(result.weak_spots);\r\n\t\tfor(let severity in result.weak_spots){\r\n\t\t\tstr_nums = str_nums.concat(Object.keys(result.weak_spots[severity]));\r\n\t\t}\r\n\r\n\t\tstr_nums = [...new Set(str_nums)].sort(); // Sort bad line\r\n\t\t//get a map of bad strings\r\n\t\tlet bad_strings_map = new Map(Object.entries(result.weak_spots.CRITICAL)) //TODO: Probably there can get something else except CRITICAL in the future\r\n\t\tfor(let str_num in str_nums){\r\n\t\t\tif (str_num == 0 && bad_strings_map.get(str_nums[str_num]).toLowerCase().includes('doctype')) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet row = +str_nums[str_num],\r\n\t\t\t\tdisplay_depth = 2;\r\n\r\n\t\t\t// Display only existing lines of file\r\n\t\t\tfor(let curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\r\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' ){\r\n\t\t\t\t\tlet is_bad_string = (row === curr_row)\r\n\t\t\t\t\tlet unformatted_row\r\n\t\t\t\t\tlet highlited_row\r\n\t\t\t\t\tif (is_bad_string){\r\n\t\t\t\t\t\tunformatted_row = row_template_bad\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tunformatted_row = row_template\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (is_bad_string && !result.file[curr_row].includes('iframe')){\r\n\t\t\t\t\t\thighlited_row = unformatted_row.printf(curr_row, bad_strings_map.get(str_nums[str_num]));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\thighlited_row = unformatted_row.printf(curr_row, result.file[curr_row]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tjQuery('#spbc_dialog').append(highlited_row);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Placing an empty string between results\r\n\t\t\tjQuery('#spbc_dialog').append(row_template. printf('', ''));\r\n\r\n\t\t\t// Removing last empty string\r\n\t\t\tjQuery('#spbc_dialog div').last().remove();\r\n\t\t}\r\n\t} else {\r\n\t\tlet wrapperElement = '
%s
'\r\n\t\tjQuery('#spbc_dialog').append(wrapperElement.printf(result.content));\r\n\t\tafterClose = () => {document.location.reload();};\r\n\t}\r\n\r\n\tlet content_height = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19,\r\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\r\n\t\theight = 'auto',\r\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll';\r\n\r\n\tjQuery('#spbc_dialog').dialog({\r\n\t\tmodal:true,\r\n\t\ttitle: result.file_path,\r\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\r\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\r\n\t\tshow: { effect: \"blind\", duration: 500 },\r\n\t\tdraggable: true,\r\n\t\tresizable: false,\r\n\t\tcloseText: \"X\",\r\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\r\n\t\topen: function(event, ui) {\r\n\t\t\tevent.target.style.overflow = overflow;\r\n\t\t\tjQuery('#spbc_dialog').height(height);\r\n\t\t\tjQuery('.ui-widget-overlay').on('click', function() {\r\n\t\t\t\tjQuery(\"#spbc_dialog\").dialog('close');\r\n\t\t\t});\r\n\t\t},\r\n\t\tbeforeClose: function(event, ui) {\r\n\t\t\tdocument.body.style.overflow = 'auto';\r\n\t\t\tjQuery('#spbc_dialog').empty();\r\n\t\t},\r\n\t\tclose: afterClose,\r\n\t});\r\n}\r\n\r\nfunction spbc_scanner_button_file_compare_event(obj){\r\n\tvar self = jQuery(obj);\r\n\tvar data = {\r\n\t\taction: 'spbc_scanner_file_compare',\r\n\t\tfile_id: self.parents('.row-actions').attr('uid'),\r\n\t};\r\n\tvar params = {\r\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\r\n\t\tcallback: spbc_scannerButtonFileCompare_callback,\r\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\r\n\t};\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\nfunction spbc_scannerButtonFileCompare_callback(result, data, params){\r\n\r\n\tconsole.log('FILE_COMPARED');\r\n\r\n\tlet row_template = '

%s

%s

%s


';\r\n\tlet row_template_bad = '

%s

%s

%s


';\r\n\r\n\tjQuery('#spbc_dialog').append(row_template.printf('Modified', 'Line', 'Original'));\r\n\r\n\tfor(var row=1, prev = false, next = false; typeof result.file[row] != 'undefined' || typeof result.file_original[row] != 'undefined'; row++){\r\n\r\n\t\tif(typeof result.file[row] == 'undefined') result.file[row] = '';\r\n\t\tif(typeof result.file_original[row] == 'undefined') result.file_original[row] = '';\r\n\r\n\t\t// Display only existing lines of file\r\n\t\tif(result.difference.indexOf(row) != -1){\r\n\t\t\tfor(let display_depth = 2, curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\r\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' && typeof result.file_original[row] !== 'undefined') {\r\n\t\t\t\t\tjQuery('#spbc_dialog').append(\r\n\t\t\t\t\t\t(row === curr_row ? row_template_bad : row_template).printf(\r\n\t\t\t\t\t\t\tresult.file[curr_row] ? result.file[curr_row] : '',\r\n\t\t\t\t\t\t\tcurr_row,\r\n\t\t\t\t\t\t\tresult.file_original[curr_row] ? result.file_original[curr_row] : ''\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tjQuery('#spbc_dialog').append(row_template. printf('', '', ''));\r\n\t\t}\r\n\t}\r\n\r\n\tvar content_height = jQuery('#spbc_dialog div').length * 19 + 19,\r\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\r\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll',\r\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\r\n\r\n\tjQuery('#spbc_dialog').dialog({\r\n\t\tmodal:true,\r\n\t\ttitle: result.file_path,\r\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\r\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\r\n\t\theight: height,\r\n\t\tshow: { effect: \"blind\", duration: 500 },\r\n\t\tdraggable: true,\r\n\t\tresizable: true,\r\n\t\tcloseText: \"X\",\r\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\r\n\t\topen: function(event, ui) {\r\n\t\t\tdocument.body.style.overflow = 'hidden';\r\n\t\t\tevent.target.style.overflow = overflow;\r\n\t\t\tjQuery('#spbc_dialog').height(height);\r\n\t\t},\r\n\t\tbeforeClose: function(event, ui) {\r\n\t\t\tdocument.body.style.overflow = 'auto';\r\n\t\t\tjQuery('#spbc_dialog').empty();\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction spbc_scanner__reload_scan_info() {\r\n\tjQuery('.spbc_hint__last_scan_title').text(spbcScaner.look_below_for_scan_res);\r\n\tconst data = {\r\n\t\taction: 'spbc_scanner__last_scan_info'\r\n\t};\r\n\tconst params = {\r\n\t\tcallback: (result) => {\r\n\t\t\tdocument.getElementById('spbc_scanner__last_scan_info').innerText = result.data;\r\n\t\t}\r\n\t};\r\n\tspbc_sendAJAXRequest(data, params);\r\n}\r\n\r\n/**\r\n * Show snapshots of file\r\n * @param obj\r\n */\r\nfunction spbc_scanner_file_monitoring_show_current_snapshot(obj)\r\n{\r\n\tconst self = jQuery(obj);\r\n\tconst fileId = self.parents('.row-actions').attr('uid');\r\n\tconst file_name = self.closest('.column-path').find('.title').text();\r\n\r\n\t// Init and open remodal\r\n\tconst remodal = jQuery('[data-remodal-id=spbc-file-monitoring-modal]');\r\n\tconst remodalObject = remodal.remodal();\r\n\tremodalObject.open();\r\n\r\n\t// Ajax request to get data for slider\r\n\tlet data = {\r\n\t\taction: 'spbc_file_monitoring_show_snapshots',\r\n\t\tfile_id: fileId,\r\n\t\tsecurity: spbcSettings.ajax_nonce\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: true,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result) {\r\n\t\t\tif (result.success) {\r\n\t\t\t\tremodal.find('#spbc-fm-snapshot-list ul').remove();\r\n\t\t\t\tremodal.find('#spbc-fm-snapshot-file-name').text(file_name);\r\n\t\t\t\tdrawSnapshotList(result.data, remodal);\r\n\t\t\t\tdrawCurrentSnapshot(result.data[0].id, remodal);\r\n\t\t\t} else {\r\n\t\t\t\t// TODO: show errors\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}\r\n\r\n/**\r\n *\r\n * @param data\r\n * @param remodal\r\n */\r\nfunction drawSnapshotList(data, remodal)\r\n{\r\n\tlet list = '';\r\n\r\n\tfor (let item of data) {\r\n\t\tlist += `
  • ${item.created_at}
  • `;\r\n\t}\r\n\r\n\tlet html =\r\n\t\t`
      \r\n ${list}\r\n
    `;\r\n\r\n\tremodal.find('#spbc-fm-snapshot-list').append(html);\r\n}\r\n\r\nfunction drawCurrentSnapshot(snapshot_id, remodal)\r\n{\r\n\t// Ajax request to get data for slider\r\n\tlet data = {\r\n\t\taction: 'spbc_file_monitoring_show_current_snapshot',\r\n\t\tsnapshot_id,\r\n\t\tsecurity: spbcSettings.ajax_nonce\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: true,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tbeforeSend: function() {\r\n\t\t\tjQuery('#spbc-file-monitoring-modal-preloader').show();\r\n\t\t},\r\n\t\tsuccess: function(result) {\r\n\t\t\tif (result.success) {\r\n\t\t\t\tremodal.find('#spbc-fm-snapshot-view .wrap').remove();\r\n\t\t\t\tremodal.find('[data-spanshot-id').removeClass('active');\r\n\t\t\t\tremodal.find('[data-spanshot-id=' + snapshot_id + ']').addClass('active');\r\n\r\n\t\t\t\tlet html =\r\n\t\t\t\t\t`
    \r\n
    \r\n                            \r\n                                ${result.data.content}\r\n                            \r\n                        
    \r\n
    `;\r\n\r\n\t\t\t\tjQuery('#spbc-file-monitoring-modal-preloader').hide();\r\n\t\t\t\tremodal.find('#spbc-fm-snapshot-view').append(html);\r\n\t\t\t\tdocument.querySelectorAll('pre code').forEach((el) => {\r\n\t\t\t\t\thljs.highlightElement(el);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t// TODO: show errors\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}\r\n\r\n/**\r\n * Cure file\r\n * @param obj\r\n */\r\nfunction spbc_scanner_button_cure_file_ajax_handler(obj)\r\n{\r\n\tconst self = jQuery(obj);\r\n\tconst fileFastHash = self.parents('.row-actions').attr('uid');\r\n\r\n\tlet data = {\r\n\t\taction: 'spbc_file_cure_ajax_action',\r\n\t\tfile_fast_hash: fileFastHash,\r\n\t\tsecurity: spbcSettings.ajax_nonce\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: true,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result) {\r\n\t\t\tif (result.success) {\r\n\t\t\t\tspbcModal.open().put(result.data);\r\n\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\r\n\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tspbcModal.open().putError(result.data);\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}\r\n\r\n/**\r\n * Restore file from backup\r\n * @param obj\r\n */\r\nfunction spbc_scanner_button_restore_from_backup_ajax_handler(obj)\r\n{\r\n\tconst self = jQuery(obj);\r\n\tconst fileFastHash = self.parents('.row-actions').attr('uid');\r\n\r\n\tlet data = {\r\n\t\taction: 'spbc_restore_file_from_backup_ajax_action',\r\n\t\tfile_fast_hash: fileFastHash,\r\n\t\tsecurity: spbcSettings.ajax_nonce\r\n\t};\r\n\r\n\tjQuery.ajax({\r\n\t\ttype: \"POST\",\r\n\t\tasync: true,\r\n\t\turl: spbcSettings.ajaxurl,\r\n\t\tdata: data,\r\n\t\tsuccess: function(result) {\r\n\t\t\tif (result.success) {\r\n\t\t\t\tspbcModal.open().put(result.data);\r\n\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\r\n\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tspbcModal.open().putError(result.data);\r\n\t\t\t}\r\n\t\t},\r\n\t});\r\n}\r\n\r\n/**\r\n * Clear scan results\r\n */\r\nfunction spbc_scanner_button_clear_scan_results()\r\n{\r\n\tif( ! confirm('Do you confirm to clear the scan results?') )\r\n\t\treturn;\r\n\r\n\tconsole.log('CLEAR');\r\n\r\n\tspbc_sendAJAXRequest(\r\n\t\t{ action: 'spbc_scanner_clear', },\r\n\t\t{\r\n\t\t\ttype: 'GET',\r\n\t\t\tsuccessCallback: function(){ document.location = document.location },\r\n\t\t\tcomplete: null,\r\n\t\t\terrorOutput: null,\r\n\t\t\tcontext: this,\r\n\t\t\ttimeout: 40000,\r\n\t\t\tsuccess: function() {\r\n\t\t\t\tdocument.location.reload();\r\n\t\t\t},\r\n\t\t},\r\n\t);\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\r\n\t// EVENT HADLING\r\n\tspbc_tbl__bulk_actions__listen(); // Table. Row bulk handler\r\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\r\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\r\n\tspbc_tbl__sort__listen(); // Table. Sort handler\r\n\r\n\tspbcStartShowHide();\r\n\r\n\t// Preparing progressbar\r\n\tjQuery('#spbc_scaner_progress_bar').progressbar({\r\n\t\tvalue: 0,\r\n\t\tcreate: function( event, ui ) {\r\n\t\t\tevent.target.style.position = 'relative';\r\n\t\t\tevent.target.style.marginBottom = '12px';\r\n\t\t},\r\n\t\tchange: function(event, ui){\r\n\t\t\tjQuery('.spbc_progressbar_counter span').text(jQuery(event.target).progressbar('option', 'value') + ' %');\r\n\t\t},\r\n\t});\r\n\r\n\t// Preparing accordion\r\n\tjQuery('#spbc_scan_accordion').accordion({\r\n\t\theader: \"h3\",\r\n\t\theightStyle: 'content',\r\n\t\tcollapsible: true,\r\n\t\tactive: false,\r\n\t\tactivate: function( event, ui ) {\r\n\t\t\tif( ui.oldPanel.length === 0 && ui.oldHeader.length === 0 )\r\n\t\t\t\tjQuery(\"#spbc_scan_accordion\").accordion(\"option\", \"classes.ui-accordion-content\", \"ui-corner-bottom spbc-overflow--visible\");\r\n\t\t},\r\n\t\tbeforeActivate: function( event, ui ) {\r\n\t\t\tif( ui.oldPanel.length === 1 && ui.oldHeader.length === 1 )\r\n\t\t\t\tjQuery(\"#spbc_scan_accordion\").accordion(\"option\", \"classes.ui-accordion-content\", \"ui-corner-bottom\");\r\n\t\t}\r\n\t});\r\n\r\n\t// Init scanner plugin\r\n\twindow.spbc_scanner = new spbcMalwareScanner({\r\n\t\tsettings: spbcScaner.settings,\r\n\t\tstates: spbcScaner.states,\r\n\t\tbutton: jQuery('#spbc_perform_scan'),\r\n\t\tspinner: jQuery('#spbc_perform_scan').next(),\r\n\t\tcallback: null,\r\n\t\tprogress_overall: jQuery('#spbc_scaner_progress_overall'),\r\n\t\tprogressbar: jQuery('#spbc_scaner_progress_bar'),\r\n\t\tprogressbar_text: jQuery('.spbc_progressbar_counter span'),\r\n\t\twrapper: document.getElementsByClassName('spbc_unchecked_file_list'),\r\n\t\twarnings: {\r\n\t\t\tlong_scan: jQuery('.spbc_hint_warning__long_scan'),\r\n\t\t\toutdated: jQuery('.spbc_hint_warning__outdated')\r\n\t\t}\r\n\t});\r\n\r\n\tjQuery(document).on('click', '.spbc_popup_tip--icon---show', function(){\r\n\t\tspbc_popup_tip___show( jQuery( this ) );\r\n\t});\r\n\r\n\tjQuery('#spbc_perform_scan').on('click', function(){\r\n\t\tjQuery('#spbcscan-results-log-module').remove();\r\n\t\tspbc_scanner.actionControl();\r\n\r\n\t\tif (!jQuery(\".spbc_log-wrapper .panel-body\").length) {\r\n\t\t\tjQuery(\".spbc_log-wrapper\").append('
    ');\r\n\t\t}\r\n\r\n\t\tjQuery(\".spbc_log-wrapper\").resizable({\r\n\t\t\thandles: 'n, s',\r\n\t\t\tcontainment: 'document',\r\n\t\t});\r\n\t});\r\n\r\n\tjQuery(\"#spbcscan-results-log-module\").resizable({\r\n\t\thandles: 'n, s',\r\n\t\tcontainment: 'document',\r\n\t});\r\n\r\n\t// Clear scanner's tables\r\n\tjQuery('#spbc_scanner_clear').on('click', function(){\r\n\r\n\t\tif( ! confirm('Do you confirm to clear the scan results?') )\r\n\t\t\treturn;\r\n\r\n\t\tconsole.log('CLEAR');\r\n\r\n\t\tspbc_sendAJAXRequest(\r\n\t\t\t{ action: 'spbc_scanner_clear', },\r\n\t\t\t{\r\n\t\t\t\ttype: 'GET',\r\n\t\t\t\tsuccessCallback: function(){ document.location = document.location },\r\n\t\t\t\tcomplete: null,\r\n\t\t\t\terrorOutput: null,\r\n\t\t\t\tcontext: this,\r\n\t\t\t\ttimeout: 40000,\r\n\t\t\t\tsuccess: function() {\r\n\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t);\r\n\t});\r\n\r\n\tjQuery('#spbc_scanner_save_to_pdf').on('click', function(){\r\n\t\tjQuery.ajax({\r\n\t\t\turl: spbcSettings.ajaxurl,\r\n\t\t\ttype: 'POST',\r\n\t\t\tdata: {\r\n\t\t\t\taction: 'spbc_scanner_save_to_pdf',\r\n\t\t\t\tsecurity: spbcSettings.ajax_nonce,\r\n\t\t\t\tno_cache: Math.random()\r\n\t\t\t},\r\n\t\t\txhrFields: {\r\n\t\t\t\tresponseType: 'blob'\r\n\t\t\t},\r\n\t\t\tsuccess: function(data) {\r\n\t\t\t\tjQuery.ajax({\r\n\t\t\t\t\t\turl: spbcSettings.ajaxurl,\r\n\t\t\t\t\t\ttype: 'POST',\r\n\t\t\t\t\t\tdata: {\r\n\t\t\t\t\t\t\taction: 'spbc_scanner_get_pdf_file_name',\r\n\t\t\t\t\t\t\tsecurity: spbcSettings.ajax_nonce,\r\n\t\t\t\t\t\t\tno_cache: Math.random()\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\txhrFields: {\r\n\t\t\t\t\t\t\tresponseType: 'text'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tsuccess: function(filename) {\r\n\t\t\t\t\t\t\tlet blob=new Blob([data]);\r\n\t\t\t\t\t\t\tlet link=document.createElement('a');\r\n\t\t\t\t\t\t\tlink.href=window.URL.createObjectURL(blob);\r\n\t\t\t\t\t\t\tlink.download=filename.data;\r\n\t\t\t\t\t\t\tlink.click();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\r\n\t// Select snapshot\r\n\tjQuery(document).on('click', '.spbc-fm-snapshot-list [data-spanshot-id]', function() {\r\n\t\tconst currentSnapshotId = jQuery(this).data('spanshot-id');\r\n\t\tconst activeSnapshotId = jQuery('.spbc-fm-snapshot-list [data-spanshot-id].active').data('spanshot-id');\r\n\r\n\t\tif (currentSnapshotId === activeSnapshotId) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst remodal = jQuery('[data-remodal-id=spbc-file-monitoring-modal]');\r\n\t\tdrawCurrentSnapshot(currentSnapshotId, remodal)\r\n\t});\r\n});\r\n"],"names":["spbc_popup_tip___show","show_icon","remove_desc_func","e","jQuery","target","parent","length","hasClass","hide","document","off","tip_title","attr","tip_text","obj","after","empty","append","css","top","position","left","on","parents","spbc_scanner_button_file_view_event","self","data","action","file_id","params","spinner","siblings","callback","spbc_scannerButtonView_callback","errorOutput","msg","spbcModal","open","putError","spbc_sendAJAXRequest","spbc_scanner_analysis_log_delete_from_log","let","fileIds","push","selectedItems","closest","find","alert","each","index","element","elementId","val","children","file_ids","window","location","reload","spbc_scanner_button_page_view_event","page_url","wp_wrap","dialog_window","dialog","modal","title","my","at","of","width","show","effect","duration","draggable","resizable","closeText","classes","ui-dialog","event","ui","style","overflow","height","documentElement","beforeClose","body","size_multiplier","result","row","display","file","printf","content_height","Object","keys","visible_height","file_path","console","log","spbc_scanner_button_file_view_bad_event","spbc_scannerButtonViewBadFile_callback","spbc_scanner_button_page_view_bad_event","spbc_scannerButtonViewBad_callback","arguments","severity_keys_sorted","severity","severity_part","row_template","severity_parts","severity_parts_sorted","weak_spots","JSON","parse","key","sort","str_num","header_name","toLowerCase","header_html","header","Set","curr_row","last","remove","afterClose","success","str_nums","concat","bad_strings_map","Map","entries","CRITICAL","get","includes","is_bad_string","unformatted_row","highlited_row","content","close","spbc_scanner_button_file_compare_event","spbc_scannerButtonFileCompare_callback","file_original","difference","indexOf","spbc_scanner__reload_scan_info","text","spbcScaner","look_below_for_scan_res","getElementById","innerText","spbc_scanner_file_monitoring_show_current_snapshot","fileId","file_name","remodal","security","spbcSettings","ajax_nonce","ajax","type","async","url","ajaxurl","drawSnapshotList","drawCurrentSnapshot","id","list","item","created_at","html","snapshot_id","beforeSend","removeClass","addClass","querySelectorAll","forEach","hljs","highlightElement","el","spbc_scanner_button_cure_file_ajax_handler","file_fast_hash","put","addEventListener","spbc_scanner_button_restore_from_backup_ajax_handler","spbc_scanner_button_clear_scan_results","confirm","successCallback","complete","context","this","timeout","ready","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","progressbar","value","create","marginBottom","change","accordion","heightStyle","collapsible","active","activate","oldPanel","oldHeader","beforeActivate","spbc_scanner","spbcMalwareScanner","settings","states","button","next","progress_overall","progressbar_text","wrapper","getElementsByClassName","warnings","long_scan","outdated","actionControl","handles","containment","no_cache","Math","random","xhrFields","responseType","filename","blob","Blob","link","createElement","href","URL","createObjectURL","download","click","currentSnapshotId"],"mappings":"AAAA,SAASA,sBAAsBC,GAIP,SAAnBC,EAA4BC,GAGjB,KAAA,IAANA,IAEyD,GAA9DC,OAAOD,EAAEE,MAAM,EAAEC,OAAO,0BAA0B,EAAEC,QAAeH,CAAAA,OAAOD,EAAEE,MAAM,EAAEG,SAAS,+BAA+B,GAC5HJ,OAAOD,EAAEE,MAAM,EAAEG,SAAS,6BAA6B,KAGzDJ,OAAO,0BAA0B,EAAEK,KAAK,EACxCL,OAAOM,QAAQ,EAAEC,IAAI,QAAST,CAAgB,EAEhD,CAdA,IAAIU,EAAYX,EAAUY,KAAK,gBAAgB,GAAK,KAChDC,EAAYb,EAAUY,KAAK,eAAe,GAAM,KAmBhDE,GAJJb,EAAiB,EAEjBD,EAAUe,MAAM,6CAA6C,EAEnDZ,OAAO,0BAA0B,GAE3CW,EAAIE,MAAM,EACRC,OAAO,2CAA2C,EAClDC,IAAI,CACJC,IAAKnB,EAAUoB,SAAS,EAAED,IAAM,EAChCE,KAAMrB,EAAUoB,SAAS,EAAEC,KAAO,EACnC,CAAC,EACFP,EAAIG,OAAO,2DAA2D,EACpEA,OAAO,qCAAuCN,EAAY,OAAO,EACjEM,OAAO,mCAAqCJ,EAAW,MAAM,EAE/DV,OAAOM,QAAQ,EAAEa,GAAG,QAASrB,CAAgB,EAC7CD,EAAUuB,QAAQ,IAAI,EAAED,GAAG,WAAYrB,CAAgB,CACxD,CAEA,SAASuB,oCAAoCV,GAC5C,IAAIW,EAAOtB,OAAOW,CAAG,EACjBY,EAAO,CACVC,OAAQ,yBACR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AK,CACXG,IAAKL,aAAaM,QAClBH,KAAM,OACNnI,KAAM,CACLC,OAAQ,2BACR8H,SAAUC,aAAaC,WACvBqE,SAAUC,KAAKC,OAAO,CACvB,EACAC,UAAW,CACVC,aAAc,MACf,EACAxG,QAAS,SAASlG,GACjBvB,OAAOyJ,KAAK,CACVG,IAAKL,aAAaM,QAClBH,KAAM,OACNnI,KAAM,CACLC,OAAQ,iCACR8H,SAAUC,aAAaC,WACvBqE,SAAUC,KAAKC,OAAO,CACvB,EACAC,UAAW,CACVC,aAAc,MACf,EACAxG,QAAS,SAASyG,GACjB5L,IAAI6L,EAAK,IAAIC,KAAK,CAAC7M,EAAK,EACpB8M,EAAK/N,SAASgO,cAAc,GAAG,EACnCD,EAAKE,KAAKnL,OAAOoL,IAAIC,gBAAgBN,CAAI,EACzCE,EAAKK,SAASR,EAAS3M,KACvB8M,EAAKM,MAAM,CACZ,CACD,CACD,CACD,CACD,CAAC,CACF,CAAC,EAGD3O,OAAOM,QAAQ,EAAEa,GAAG,QAAS,4CAA6C,WACzE,IAAMyN,EAAoB5O,OAAOwL,IAAI,EAAEjK,KAAK,aAAa,EAGrDqN,IAFqB5O,OAAO,kDAAkD,EAAEuB,KAAK,aAAa,GAOtGwI,oBAAoB6E,EADJ5O,OAAO,8CAA8C,CACvB,CAC/C,CAAC,CACF,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-settings_tab--scanner.min.js","sources":["spbc-settings_tab--scanner.js"],"sourcesContent":["function spbc_popup_tip___show(show_icon){\n\n\tvar tip_title = show_icon.attr('spbc_tip_title') || null;\n\tvar\ttip_text = show_icon.attr('spbc_tip_text') || null;\n\tvar remove_desc_func = function(e){\n\n\t\tif(\n\t\t\ttypeof e === 'undefined' ||\n\t\t\t(\n\t\t\t\t(jQuery(e.target).parent('.spbc_popup_tip--wrapper').length == 0 || jQuery(e.target).hasClass('spbc_popup_tip--icon---cancel')) &&\n\t\t\t\t!jQuery(e.target).hasClass('spbc_popup_tip--icon---show')\n\t\t\t)\n\t\t){\n\t\t\tjQuery('.spbc_popup_tip--wrapper').hide();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tshow_icon.after(\"
    \");\n\n\tvar obj = jQuery('.spbc_popup_tip--wrapper');\n\n\tobj.empty()\n\t\t.append(\"
    \")\n\t\t.css({\n\t\t\ttop: show_icon.position().top - 2,\n\t\t\tleft: show_icon.position().left + 25\n\t\t});\n\tobj.append(\"\")\n\t\t.append(\"

    \" + tip_title + \"

    \")\n\t\t.append(\"

    \" + tip_text + \"

    \");\n\n\tjQuery(document).on('click', remove_desc_func);\n\tshow_icon.parents('tr').on('mouseout', remove_desc_func);\n}\n\nfunction spbc_scanner_button_file_view_event(obj){\n\tvar self = jQuery(obj);\n\tvar data = {\n\t\taction: 'spbc_scanner_file_view',\n\t\tfile_id: self.parents('.row-actions').attr('uid'),\n\t};\n\tvar params = {\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\n\t\tcallback: spbc_scannerButtonView_callback,\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\n\tspbc_sendAJAXRequest(data, params);\n}\n\n/**\n * Delete file from analysis log\n */\nfunction spbc_scanner_analysis_log_delete_from_log(obj) {\n\n\tlet fileIds = [];\n\tconst self = jQuery(obj);\n\tlet spinner;\n\n\tif ( jQuery(obj).hasClass('tbl-row_action') ) {\n\t\tfileIds.push(self.parents('.row-actions').attr('uid'));\n\t\tspinner = self.parent().siblings('.tbl-preloader--tiny');\n\t} else {\n\t\tconst selectedItems = self.closest('#spbc_tbl__scanner_analysis_log').find('.cb-select:checked');\n\t\tif (selectedItems.length === 0) {\n\t\t\talert('Please, select elements.');\n\t\t\treturn;\n\t\t}\n\n\t\tselectedItems.each(function (index, element) {\n\t\t\tconst elementId = jQuery(element).val();\n\t\t\tfileIds.push(elementId);\n\t\t});\n\t\tspinner = self.children('.tbl-preloader--small');\n\t}\n\n\tconst data = {\n\t\taction: 'spbc_scanner_analysis_log_delete_from_log',\n\t\tfile_ids: fileIds,\n\t};\n\n\tvar params = {\n\t\tspinner: spinner,\n\t\tcallback: function() { window.location.reload(); },\n\t};\n\n\tspbc_sendAJAXRequest(data, params);\n}\n\nfunction spbc_scanner_button_page_view_event(obj){\n\tvar self = jQuery(obj);\n\tvar data = {\n\t\taction: 'spbc_scanner_page_view',\n\t\tpage_url: self.parents('.row-actions').attr('uid'),\n\t};\n\tvar params = {\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\n\t\tcallback: spbc_scannerButtonView_callback,\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\n\n\tlet wp_wrap = jQuery('#wpwrap')\n\tlet dialog_window = jQuery('#spbc_dialog')\n\n\tdialog_window.dialog({\n\t\tmodal:true,\n\t\ttitle: 'Loading..',\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\n\t\twidth: +(wp_wrap.width() / 100 * 90),\n\t\tshow: { effect: \"blind\", duration: 500 },\n\t\tdraggable: false,\n\t\tresizable: false,\n\t\tcloseText: \"X\",\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\n\t\topen: function(event, ui) {\n\t\t\tevent.target.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').height((document.documentElement.clientHeight) / 100 * 25);\n\t\t},\n\t\tbeforeClose: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').empty();\n\t\t},\n\t})\n\n\tdialog_window.append('\"Wait')\n\n\tlet spinner = jQuery('#spbc_file_view_preloader')\n\tlet size_multiplier = (wp_wrap.width() * 0.0004)\n\n\tspinner.height(128 * size_multiplier)\n\tspinner.width(128 * size_multiplier)\n\tspinner.css({left: dialog_window.width()/2 - (128 * size_multiplier / 2)})\n\tspinner.css({top: dialog_window.height()/2 - (128 * size_multiplier / 2)})\n\n\tspbc_sendAJAXRequest(data, params);\n}\n\nfunction spbc_scannerButtonView_callback(result){\n\n\tlet dialog_window = jQuery('#spbc_dialog')\n\tdialog_window.empty();\n\n\tjQuery('#spbc_file_view_preloader').css({display:'none'})\n\n\tlet row_template = '
    %s

    %s


    ';\n\n\tfor(let row in result.file){\n\t\tdialog_window.append(row_template.printf(row, result.file[row]));\n\t}\n\n\tlet content_height = Object.keys(result.file).length * 19 < 76 ? 76 : Object.keys(result.file).length * 19,\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\n\t\toverflow = content_height < visible_height ? 'hidden' : 'scroll',\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\n\n\tdialog_window.css({\n\t\theight: height,\n\t\toverflow: overflow\n\t})\n\n\tdialog_window.dialog({\n\t\tmodal:true,\n\t\ttitle: ('Loaded: ' + result.file_path),\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\n\t\tshow: { effect: \"blind\", duration: 500 },\n\t\tdraggable: true,\n\t\tresizable: false,\n\t\tcloseText: \"X\",\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\n\t\topen: function(event, ui) {\n\t\t\tevent.target.style.overflow = overflow;\n\t\t\tjQuery('#spbc_dialog').height(height);\n\t\t\tjQuery('.ui-widget-overlay').on('click', function() {\n\t\t\t\tjQuery(\"#spbc_dialog\").dialog('close');\n\t\t\t});\n\t\t},\n\t\tbeforeClose: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').empty();\n\t\t},\n\t});\n\n\tconsole.log('FILE_VIEWED');\n\n}\n\nfunction spbc_scanner_button_file_view_bad_event(obj){\n\tvar self = jQuery(obj);\n\tvar data = {\n\t\taction: 'spbc_scanner_file_view',\n\t\tfile_id: self.parents('.row-actions').attr('uid'),\n\t};\n\tvar params = {\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\n\t\tcallback: spbc_scannerButtonViewBadFile_callback,\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\n\tspbc_sendAJAXRequest(data, params);\n}\n\nfunction spbc_scanner_button_page_view_bad_event(obj){\n\tvar self = jQuery(obj);\n\tvar data = {\n\t\taction: 'spbc_scanner_page_view',\n\t\tpage_url: self.parent().attr('uid'),\n\t};\n\tvar params = {\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\n\t\tcallback: spbc_scannerButtonViewBad_callback,\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\n\tspbc_sendAJAXRequest(data, params);\n}\n\nfunction spbc_scannerButtonViewBadFile_callback(result, data, params){\n\n\tconsole.log('FILE_VIEWED_BAD_CODE_FILE');\n\tconsole.log(arguments);\n\tjQuery('#spbc_dialog').empty();\n\n\tvar row_template = '
    %s

    %s


    ',\n\t\trow_template_bad = '
    %s

    %s


    ',\n\t\tseverity_parts = [],\n\t\tseverity_parts_sorted = [],\n\t\tseverity_keys_sorted = [];\n\n\tresult.weak_spots = JSON.parse(result.weak_spots)\n\tfor(let severity in result.weak_spots){\n\t\tseverity_parts[severity] = Object.keys(result.weak_spots[severity])\n\t}\n\n\tseverity_keys_sorted = Object.keys(severity_parts).sort();\n\n\tfor(key in severity_keys_sorted){\n\t\tseverity_parts_sorted[severity_keys_sorted[key]] = severity_parts[severity_keys_sorted[key]]\n\t}\n\n\tfor (let severity_part in severity_parts_sorted) {\n\t\tlet header_name = 'spbc-dialog-row-header-' + severity_part.toLowerCase();\n\t\tlet header_html = '' + severity_part + ' weakspots:';\n\t\tconst dialog = jQuery('#spbc_dialog');\n\n\t\tdialog.append(row_template.printf('',header_html));\n\t\tdialog.append(row_template. printf('...','...'));\n\n\t\tlet header = dialog.find('#' + header_name);\n\t\theader.parent().parent().css('text-align', 'center');\n\t\theader.parent().parent().css('border', '1px dotted');\n\t\theader.parent().parent().css('background', 'darkgrey');\n\n\t\tfor(let str_num in severity_parts[severity_part]){\n\t\t\t// Sort bad line\n\t\t\tstr_num = [...new Set(str_num)].sort()\n\n\t\t\tlet row = +severity_parts[severity_part][str_num],\n\t\t\t\tdisplay_depth = 2;\n\n\t\t\t// Display only existing lines of file\n\t\t\tfor(let curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' ){\n\t\t\t\t\tdialog.append((row === curr_row ? row_template_bad : row_template).printf(curr_row, result.file[curr_row]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Placing an empty string between results\n\t\t\tdialog.append(row_template. printf('...','...'));\n\t\t}\n\t}\n\n\t// Removing last empty string\n\tjQuery('#spbc_dialog div').last().remove();\n\n\tlet content_height = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19,\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll',\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\n\n\tjQuery('#spbc_dialog').dialog({\n\t\tmodal:true,\n\t\ttitle: result.file_path,\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\n\t\tshow: { effect: \"blind\", duration: 500 },\n\t\tdraggable: true,\n\t\tresizable: false,\n\t\tcloseText: \"X\",\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\n\t\topen: function(event, ui) {\n\t\t\tevent.target.style.overflow = overflow;\n\t\t\tjQuery('#spbc_dialog').height(height);\n\t\t\tjQuery('.ui-widget-overlay').on('click', function() {\n\t\t\t\tjQuery(\"#spbc_dialog\").dialog('close');\n\t\t\t});\n\t\t},\n\t\tbeforeClose: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').empty();\n\t\t},\n\t});\n}\n\nfunction spbc_scannerButtonViewBad_callback(result, data, params){\n\n\tconsole.log('FILE_VIEWED_BAD_CODE');\n\n\tconsole.log(arguments);\n\n\tlet afterClose = () => {};\n\n\tif ( result.success == true ) {\n\t\tconsole.log(result);\n\t\tvar row_template = '
    ' +\n\t\t\t\t'%s' +\n\t\t\t\t'

    %s

    ' +\n\t\t\t\t'
    ',\n\t\t\trow_template_bad = '
    ' +\n\t\t\t\t'%s' +\n\t\t\t\t'

    %s

    ' +\n\t\t\t\t'
    ',\n\t\t\tstr_nums = [];\n\n\t\tresult.weak_spots = JSON.parse(result.weak_spots);\n\t\tfor(let severity in result.weak_spots){\n\t\t\tstr_nums = str_nums.concat(Object.keys(result.weak_spots[severity]));\n\t\t}\n\n\t\tstr_nums = [...new Set(str_nums)].sort(); // Sort bad line\n\t\t//get a map of bad strings\n\t\tlet bad_strings_map = new Map(Object.entries(result.weak_spots.CRITICAL)) //TODO: Probably there can get something else except CRITICAL in the future\n\t\tfor(let str_num in str_nums){\n\t\t\tif (str_num == 0 && bad_strings_map.get(str_nums[str_num]).toLowerCase().includes('doctype')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet row = +str_nums[str_num],\n\t\t\t\tdisplay_depth = 2;\n\n\t\t\t// Display only existing lines of file\n\t\t\tfor(let curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' ){\n\t\t\t\t\tlet is_bad_string = (row === curr_row)\n\t\t\t\t\tlet unformatted_row\n\t\t\t\t\tlet highlited_row\n\t\t\t\t\tif (is_bad_string){\n\t\t\t\t\t\tunformatted_row = row_template_bad\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunformatted_row = row_template\n\t\t\t\t\t}\n\t\t\t\t\tif (is_bad_string && !result.file[curr_row].includes('iframe')){\n\t\t\t\t\t\thighlited_row = unformatted_row.printf(curr_row, bad_strings_map.get(str_nums[str_num]));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thighlited_row = unformatted_row.printf(curr_row, result.file[curr_row]);\n\t\t\t\t\t}\n\t\t\t\t\tjQuery('#spbc_dialog').append(highlited_row);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Placing an empty string between results\n\t\t\tjQuery('#spbc_dialog').append(row_template. printf('', ''));\n\n\t\t\t// Removing last empty string\n\t\t\tjQuery('#spbc_dialog div').last().remove();\n\t\t}\n\t} else {\n\t\tlet wrapperElement = '
    %s
    '\n\t\tjQuery('#spbc_dialog').append(wrapperElement.printf(result.content));\n\t\tafterClose = () => {document.location.reload();};\n\t}\n\n\tlet content_height = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19,\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\n\t\theight = 'auto',\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll';\n\n\tjQuery('#spbc_dialog').dialog({\n\t\tmodal:true,\n\t\ttitle: result.file_path,\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\n\t\tshow: { effect: \"blind\", duration: 500 },\n\t\tdraggable: true,\n\t\tresizable: false,\n\t\tcloseText: \"X\",\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\n\t\topen: function(event, ui) {\n\t\t\tevent.target.style.overflow = overflow;\n\t\t\tjQuery('#spbc_dialog').height(height);\n\t\t\tjQuery('.ui-widget-overlay').on('click', function() {\n\t\t\t\tjQuery(\"#spbc_dialog\").dialog('close');\n\t\t\t});\n\t\t},\n\t\tbeforeClose: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').empty();\n\t\t},\n\t\tclose: afterClose,\n\t});\n}\n\nfunction spbc_scanner_button_file_compare_event(obj){\n\tvar self = jQuery(obj);\n\tvar data = {\n\t\taction: 'spbc_scanner_file_compare',\n\t\tfile_id: self.parents('.row-actions').attr('uid'),\n\t};\n\tvar params = {\n\t\tspinner: self.parent().siblings('.tbl-preloader--tiny'),\n\t\tcallback: spbc_scannerButtonFileCompare_callback,\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\n\tspbc_sendAJAXRequest(data, params);\n}\n\nfunction spbc_scannerButtonFileCompare_callback(result, data, params){\n\n\tconsole.log('FILE_COMPARED');\n\n\tlet row_template = '

    %s

    %s

    %s


    ';\n\tlet row_template_bad = '

    %s

    %s

    %s


    ';\n\n\tjQuery('#spbc_dialog').append(row_template.printf('Modified', 'Line', 'Original'));\n\n\tfor(var row=1, prev = false, next = false; typeof result.file[row] != 'undefined' || typeof result.file_original[row] != 'undefined'; row++){\n\n\t\tif(typeof result.file[row] == 'undefined') result.file[row] = '';\n\t\tif(typeof result.file_original[row] == 'undefined') result.file_original[row] = '';\n\n\t\t// Display only existing lines of file\n\t\tif(result.difference.indexOf(row) != -1){\n\t\t\tfor(let display_depth = 2, curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' && typeof result.file_original[row] !== 'undefined') {\n\t\t\t\t\tjQuery('#spbc_dialog').append(\n\t\t\t\t\t\t(row === curr_row ? row_template_bad : row_template).printf(\n\t\t\t\t\t\t\tresult.file[curr_row] ? result.file[curr_row] : '',\n\t\t\t\t\t\t\tcurr_row,\n\t\t\t\t\t\t\tresult.file_original[curr_row] ? result.file_original[curr_row] : ''\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\tjQuery('#spbc_dialog').append(row_template. printf('', '', ''));\n\t\t}\n\t}\n\n\tvar content_height = jQuery('#spbc_dialog div').length * 19 + 19,\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll',\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\n\n\tjQuery('#spbc_dialog').dialog({\n\t\tmodal:true,\n\t\ttitle: result.file_path,\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\n\t\theight: height,\n\t\tshow: { effect: \"blind\", duration: 500 },\n\t\tdraggable: true,\n\t\tresizable: true,\n\t\tcloseText: \"X\",\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\n\t\topen: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\tevent.target.style.overflow = overflow;\n\t\t\tjQuery('#spbc_dialog').height(height);\n\t\t},\n\t\tbeforeClose: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').empty();\n\t\t}\n\t});\n}\n\nfunction spbc_scanner__reload_scan_info() {\n\tjQuery('.spbc_hint__last_scan_title').text(spbcScaner.look_below_for_scan_res);\n\tconst data = {\n\t\taction: 'spbc_scanner__last_scan_info'\n\t};\n\tconst params = {\n\t\tcallback: (result) => {\n\t\t\tdocument.getElementById('spbc_scanner__last_scan_info').innerText = result.data;\n\t\t}\n\t};\n\tspbc_sendAJAXRequest(data, params);\n}\n\n/**\n * Show snapshots of file\n * @param obj\n */\nfunction spbc_scanner_file_monitoring_show_current_snapshot(obj)\n{\n\tconst self = jQuery(obj);\n\tconst fileId = self.parents('.row-actions').attr('uid');\n\tconst file_name = self.closest('.column-path').find('.title').text();\n\n\t// Init and open remodal\n\tconst remodal = jQuery('[data-remodal-id=spbc-file-monitoring-modal]');\n\tconst remodalObject = remodal.remodal();\n\tremodalObject.open();\n\n\t// Ajax request to get data for slider\n\tlet data = {\n\t\taction: 'spbc_file_monitoring_show_snapshots',\n\t\tfile_id: fileId,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tremodal.find('#spbc-fm-snapshot-list ul').remove();\n\t\t\t\tremodal.find('#spbc-fm-snapshot-file-name').text(file_name);\n\t\t\t\tdrawSnapshotList(result.data, remodal);\n\t\t\t\tdrawCurrentSnapshot(result.data[0].id, remodal);\n\t\t\t} else {\n\t\t\t\t// TODO: show errors\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n *\n * @param data\n * @param remodal\n */\nfunction drawSnapshotList(data, remodal)\n{\n\tlet list = '';\n\n\tfor (let item of data) {\n\t\tlist += `
  • ${item.created_at}
  • `;\n\t}\n\n\tlet html =\n\t\t`
      \n ${list}\n
    `;\n\n\tremodal.find('#spbc-fm-snapshot-list').append(html);\n}\n\nfunction drawCurrentSnapshot(snapshot_id, remodal)\n{\n\t// Ajax request to get data for slider\n\tlet data = {\n\t\taction: 'spbc_file_monitoring_show_current_snapshot',\n\t\tsnapshot_id,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tbeforeSend: function() {\n\t\t\tjQuery('#spbc-file-monitoring-modal-preloader').show();\n\t\t},\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tremodal.find('#spbc-fm-snapshot-view .wrap').remove();\n\t\t\t\tremodal.find('[data-spanshot-id').removeClass('active');\n\t\t\t\tremodal.find('[data-spanshot-id=' + snapshot_id + ']').addClass('active');\n\n\t\t\t\tlet html =\n\t\t\t\t\t`
    \n
    \n                            \n                                ${result.data.content}\n                            \n                        
    \n
    `;\n\n\t\t\t\tjQuery('#spbc-file-monitoring-modal-preloader').hide();\n\t\t\t\tremodal.find('#spbc-fm-snapshot-view').append(html);\n\t\t\t\tdocument.querySelectorAll('pre code').forEach((el) => {\n\t\t\t\t\thljs.highlightElement(el);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// TODO: show errors\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n * Cure file\n * @param obj\n */\nfunction spbc_scanner_button_cure_file_ajax_handler(obj)\n{\n\tconst self = jQuery(obj);\n\tconst fileFastHash = self.parents('.row-actions').attr('uid');\n\n\tlet data = {\n\t\taction: 'spbc_file_cure_ajax_action',\n\t\tfile_fast_hash: fileFastHash,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tspbcModal.open().put(result.data);\n\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tspbcModal.open().putError(result.data);\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n * Restore file from backup\n * @param obj\n */\nfunction spbc_scanner_button_restore_from_backup_ajax_handler(obj)\n{\n\tconst self = jQuery(obj);\n\tconst fileFastHash = self.parents('.row-actions').attr('uid');\n\n\tlet data = {\n\t\taction: 'spbc_restore_file_from_backup_ajax_action',\n\t\tfile_fast_hash: fileFastHash,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tspbcModal.open().put(result.data);\n\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tspbcModal.open().putError(result.data);\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n * Clear scan results\n */\nfunction spbc_scanner_button_clear_scan_results()\n{\n\tif( ! confirm('Do you confirm to clear the scan results?') )\n\t\treturn;\n\n\tconsole.log('CLEAR');\n\n\tspbc_sendAJAXRequest(\n\t\t{ action: 'spbc_scanner_clear', },\n\t\t{\n\t\t\ttype: 'GET',\n\t\t\tsuccessCallback: function(){ document.location = document.location },\n\t\t\tcomplete: null,\n\t\t\terrorOutput: null,\n\t\t\tcontext: this,\n\t\t\ttimeout: 40000,\n\t\t\tsuccess: function() {\n\t\t\t\tdocument.location.reload();\n\t\t\t},\n\t\t},\n\t);\n}\n\njQuery(document).ready(function(){\n\n\t// EVENT HADLING\n\tspbc_tbl__bulk_actions__listen(); // Table. Row bulk handler\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\n\tspbc_tbl__sort__listen(); // Table. Sort handler\n\n\tspbcStartShowHide();\n\n\t// Preparing progressbar\n\tjQuery('#spbc_scaner_progress_bar').progressbar({\n\t\tvalue: 0,\n\t\tcreate: function( event, ui ) {\n\t\t\tevent.target.style.position = 'relative';\n\t\t\tevent.target.style.marginBottom = '12px';\n\t\t},\n\t\tchange: function(event, ui){\n\t\t\tjQuery('.spbc_progressbar_counter span').text(jQuery(event.target).progressbar('option', 'value') + ' %');\n\t\t},\n\t});\n\n\t// Preparing accordion\n\tjQuery('#spbc_scan_accordion').accordion({\n\t\theader: \"h3\",\n\t\theightStyle: 'content',\n\t\tcollapsible: true,\n\t\tactive: false,\n\t\tactivate: function( event, ui ) {\n\t\t\tif( ui.oldPanel.length === 0 && ui.oldHeader.length === 0 )\n\t\t\t\tjQuery(\"#spbc_scan_accordion\").accordion(\"option\", \"classes.ui-accordion-content\", \"ui-corner-bottom spbc-overflow--visible\");\n\t\t},\n\t\tbeforeActivate: function( event, ui ) {\n\t\t\tif( ui.oldPanel.length === 1 && ui.oldHeader.length === 1 )\n\t\t\t\tjQuery(\"#spbc_scan_accordion\").accordion(\"option\", \"classes.ui-accordion-content\", \"ui-corner-bottom\");\n\t\t}\n\t});\n\n\t// Init scanner plugin\n\twindow.spbc_scanner = new spbcMalwareScanner({\n\t\tsettings: spbcScaner.settings,\n\t\tstates: spbcScaner.states,\n\t\tbutton: jQuery('#spbc_perform_scan'),\n\t\tspinner: jQuery('#spbc_perform_scan').next(),\n\t\tcallback: null,\n\t\tprogress_overall: jQuery('#spbc_scaner_progress_overall'),\n\t\tprogressbar: jQuery('#spbc_scaner_progress_bar'),\n\t\tprogressbar_text: jQuery('.spbc_progressbar_counter span'),\n\t\twrapper: document.getElementsByClassName('spbc_unchecked_file_list'),\n\t\twarnings: {\n\t\t\tlong_scan: jQuery('.spbc_hint_warning__long_scan'),\n\t\t\toutdated: jQuery('.spbc_hint_warning__outdated')\n\t\t}\n\t});\n\n\tjQuery(document).on('click', '.spbc_popup_tip--icon---show', function(){\n\t\tspbc_popup_tip___show( jQuery( this ) );\n\t});\n\n\tjQuery('#spbc_perform_scan').on('click', function(){\n\t\tjQuery('#spbcscan-results-log-module').remove();\n\t\tspbc_scanner.actionControl();\n\n\t\tif (!jQuery(\".spbc_log-wrapper .panel-body\").length) {\n\t\t\tjQuery(\".spbc_log-wrapper\").append('
    ');\n\t\t}\n\n\t\tjQuery(\".spbc_log-wrapper\").resizable({\n\t\t\thandles: 'n, s',\n\t\t\tcontainment: 'document',\n\t\t});\n\t});\n\n\tjQuery(\"#spbcscan-results-log-module\").resizable({\n\t\thandles: 'n, s',\n\t\tcontainment: 'document',\n\t});\n\n\t// Clear scanner's tables\n\tjQuery('#spbc_scanner_clear').on('click', function(){\n\n\t\tif( ! confirm('Do you confirm to clear the scan results?') )\n\t\t\treturn;\n\n\t\tconsole.log('CLEAR');\n\n\t\tspbc_sendAJAXRequest(\n\t\t\t{ action: 'spbc_scanner_clear', },\n\t\t\t{\n\t\t\t\ttype: 'GET',\n\t\t\t\tsuccessCallback: function(){ document.location = document.location },\n\t\t\t\tcomplete: null,\n\t\t\t\terrorOutput: null,\n\t\t\t\tcontext: this,\n\t\t\t\ttimeout: 40000,\n\t\t\t\tsuccess: function() {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t});\n\n\tjQuery('#spbc_scanner_save_to_pdf').on('click', function(){\n\t\tjQuery.ajax({\n\t\t\turl: spbcSettings.ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdata: {\n\t\t\t\taction: 'spbc_scanner_save_to_pdf',\n\t\t\t\tsecurity: spbcSettings.ajax_nonce,\n\t\t\t\tno_cache: Math.random()\n\t\t\t},\n\t\t\txhrFields: {\n\t\t\t\tresponseType: 'blob'\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\turl: spbcSettings.ajaxurl,\n\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\taction: 'spbc_scanner_get_pdf_file_name',\n\t\t\t\t\t\t\tsecurity: spbcSettings.ajax_nonce,\n\t\t\t\t\t\t\tno_cache: Math.random()\n\t\t\t\t\t\t},\n\t\t\t\t\t\txhrFields: {\n\t\t\t\t\t\t\tresponseType: 'text'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function(filename) {\n\t\t\t\t\t\t\tlet blob=new Blob([data]);\n\t\t\t\t\t\t\tlet link=document.createElement('a');\n\t\t\t\t\t\t\tlink.href=window.URL.createObjectURL(blob);\n\t\t\t\t\t\t\tlink.download=filename.data;\n\t\t\t\t\t\t\tlink.click();\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// Select snapshot\n\tjQuery(document).on('click', '.spbc-fm-snapshot-list [data-spanshot-id]', function() {\n\t\tconst currentSnapshotId = jQuery(this).data('spanshot-id');\n\t\tconst activeSnapshotId = jQuery('.spbc-fm-snapshot-list [data-spanshot-id].active').data('spanshot-id');\n\n\t\tif (currentSnapshotId === activeSnapshotId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst remodal = jQuery('[data-remodal-id=spbc-file-monitoring-modal]');\n\t\tdrawCurrentSnapshot(currentSnapshotId, remodal)\n\t});\n});\n"],"names":["spbc_popup_tip___show","show_icon","remove_desc_func","e","jQuery","target","parent","length","hasClass","hide","document","off","tip_title","attr","tip_text","obj","after","empty","append","css","top","position","left","on","parents","spbc_scanner_button_file_view_event","self","data","action","file_id","params","spinner","siblings","callback","spbc_scannerButtonView_callback","errorOutput","msg","spbcModal","open","putError","spbc_sendAJAXRequest","spbc_scanner_analysis_log_delete_from_log","let","fileIds","push","selectedItems","closest","find","alert","each","index","element","elementId","val","children","file_ids","window","location","reload","spbc_scanner_button_page_view_event","page_url","wp_wrap","dialog_window","dialog","modal","title","my","at","of","width","show","effect","duration","draggable","resizable","closeText","classes","ui-dialog","event","ui","style","overflow","height","documentElement","beforeClose","body","size_multiplier","result","row","display","file","printf","content_height","Object","keys","visible_height","file_path","console","log","spbc_scanner_button_file_view_bad_event","spbc_scannerButtonViewBadFile_callback","spbc_scanner_button_page_view_bad_event","spbc_scannerButtonViewBad_callback","arguments","severity_keys_sorted","severity","severity_part","row_template","severity_parts","severity_parts_sorted","weak_spots","JSON","parse","key","sort","str_num","header_name","toLowerCase","header_html","header","Set","curr_row","last","remove","afterClose","success","str_nums","concat","bad_strings_map","Map","entries","CRITICAL","get","includes","is_bad_string","unformatted_row","highlited_row","content","close","spbc_scanner_button_file_compare_event","spbc_scannerButtonFileCompare_callback","file_original","difference","indexOf","spbc_scanner__reload_scan_info","text","spbcScaner","look_below_for_scan_res","getElementById","innerText","spbc_scanner_file_monitoring_show_current_snapshot","fileId","file_name","remodal","security","spbcSettings","ajax_nonce","ajax","type","async","url","ajaxurl","drawSnapshotList","drawCurrentSnapshot","id","list","item","created_at","html","snapshot_id","beforeSend","removeClass","addClass","querySelectorAll","forEach","hljs","highlightElement","el","spbc_scanner_button_cure_file_ajax_handler","file_fast_hash","put","addEventListener","spbc_scanner_button_restore_from_backup_ajax_handler","spbc_scanner_button_clear_scan_results","confirm","successCallback","complete","context","this","timeout","ready","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","progressbar","value","create","marginBottom","change","accordion","heightStyle","collapsible","active","activate","oldPanel","oldHeader","beforeActivate","spbc_scanner","spbcMalwareScanner","settings","states","button","next","progress_overall","progressbar_text","wrapper","getElementsByClassName","warnings","long_scan","outdated","actionControl","handles","containment","no_cache","Math","random","xhrFields","responseType","filename","blob","Blob","link","createElement","href","URL","createObjectURL","download","click","currentSnapshotId"],"mappings":"AAAA,SAASA,sBAAsBC,GAIP,SAAnBC,EAA4BC,GAGjB,KAAA,IAANA,IAEyD,GAA9DC,OAAOD,EAAEE,MAAM,EAAEC,OAAO,0BAA0B,EAAEC,QAAeH,CAAAA,OAAOD,EAAEE,MAAM,EAAEG,SAAS,+BAA+B,GAC5HJ,OAAOD,EAAEE,MAAM,EAAEG,SAAS,6BAA6B,KAGzDJ,OAAO,0BAA0B,EAAEK,KAAK,EACxCL,OAAOM,QAAQ,EAAEC,IAAI,QAAST,CAAgB,EAEhD,CAdA,IAAIU,EAAYX,EAAUY,KAAK,gBAAgB,GAAK,KAChDC,EAAYb,EAAUY,KAAK,eAAe,GAAM,KAmBhDE,GAJJb,EAAiB,EAEjBD,EAAUe,MAAM,6CAA6C,EAEnDZ,OAAO,0BAA0B,GAE3CW,EAAIE,MAAM,EACRC,OAAO,2CAA2C,EAClDC,IAAI,CACJC,IAAKnB,EAAUoB,SAAS,EAAED,IAAM,EAChCE,KAAMrB,EAAUoB,SAAS,EAAEC,KAAO,EACnC,CAAC,EACFP,EAAIG,OAAO,2DAA2D,EACpEA,OAAO,qCAAuCN,EAAY,OAAO,EACjEM,OAAO,mCAAqCJ,EAAW,MAAM,EAE/DV,OAAOM,QAAQ,EAAEa,GAAG,QAASrB,CAAgB,EAC7CD,EAAUuB,QAAQ,IAAI,EAAED,GAAG,WAAYrB,CAAgB,CACxD,CAEA,SAASuB,oCAAoCV,GAC5C,IAAIW,EAAOtB,OAAOW,CAAG,EACjBY,EAAO,CACVC,OAAQ,yBACRC,QAASH,EAAKF,QAAQ,cAAc,EAAEX,KAAK,KAAK,CACjD,EACIiB,EAAS,CACZC,QAASL,EAAKpB,OAAO,EAAE0B,SAAS,sBAAsB,EACtDC,SAAUC,gCACVC,YAAa,SAASC,GAAMC,UAAUC,KAAK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,GACjBvB,OAAOyJ,KAAK,CACVG,IAAKL,aAAaM,QAClBH,KAAM,OACNnI,KAAM,CACLC,OAAQ,iCACR8H,SAAUC,aAAaC,WACvBqE,SAAUC,KAAKC,OAAO,CACvB,EACAC,UAAW,CACVC,aAAc,MACf,EACAxG,QAAS,SAASyG,GACjB5L,IAAI6L,EAAK,IAAIC,KAAK,CAAC7M,EAAK,EACpB8M,EAAK/N,SAASgO,cAAc,GAAG,EACnCD,EAAKE,KAAKnL,OAAOoL,IAAIC,gBAAgBN,CAAI,EACzCE,EAAKK,SAASR,EAAS3M,KACvB8M,EAAKM,MAAM,CACZ,CACD,CACD,CACD,CACD,CAAC,CACF,CAAC,EAGD3O,OAAOM,QAAQ,EAAEa,GAAG,QAAS,4CAA6C,WACzE,IAAMyN,EAAoB5O,OAAOwL,IAAI,EAAEjK,KAAK,aAAa,EAGrDqN,IAFqB5O,OAAO,kDAAkD,EAAEuB,KAAK,aAAa,GAOtGwI,oBAAoB6E,EADJ5O,OAAO,8CAA8C,CACvB,CAC/C,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/js/spbc-settings_tab--security_log.min.js.map b/js/spbc-settings_tab--security_log.min.js.map index df30090b0..41ba159fb 100644 --- a/js/spbc-settings_tab--security_log.min.js.map +++ b/js/spbc-settings_tab--security_log.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings_tab--security_log.min.js","sources":["spbc-settings_tab--security_log.js"],"sourcesContent":["// SECURITY LOGS SHOW MORE\r\nfunction spbc_sec_logs__show_more__listen(){\r\n\tjQuery('#spbc_show_more_button').on('click', function(){\r\n\t\tif(spbcSettingsSecLogs.clicks < 2){\r\n\t\t\tspbcSettingsSecLogs.clicks++;\r\n\t\t\tvar data = {\r\n\t\t\t\taction: 'spbc_show_more_security_logs',\r\n\t\t\t\tamount: spbcSettingsSecLogs.amount * (+spbcSettingsSecLogs.clicks+1),\r\n\t\t\t};\r\n\t\t\tvar params = {\r\n\t\t\t\tbutton: this,\r\n\t\t\t\tspinner: this.nextElementSibling,\r\n\t\t\t\twrapper: jQuery('#spbc_tbl__secuirty_logs').find('tbody'),\r\n\t\t\t\tcallback: spbc_sec_logs__show_more__callback,\r\n\t\t\t};\r\n\t\t\tspbc_sendAJAXRequest( data, params );\r\n\t\t}else{\r\n\t\t\t// Hide \"More logs\" button, show \"Control Panel\" button\r\n\t\t\tjQuery(this).hide();\r\n\t\t\tjQuery(this).siblings('.spbc__show_more_logs').css('display', 'inline-block');\r\n\t\t}\r\n\t});\r\n}\r\n\r\n\t// Callback for SHOW MORE SECURITY LOGS\r\nfunction spbc_sec_logs__show_more__callback(result, data, params){\t\r\n\tconsole.log(result);\r\n\tif(result.size > 0){\r\n\t\tjQuery(params.wrapper).html(result.html);\r\n\t\tspbc_tbl__row_actions__listen();\r\n\t\tspbcStartShowHide();\r\n\t}else{\r\n\t\t// Hide \"More logs\" button, show \"Control Panel\" button\r\n\t\tjQuery(params.button).hide();\r\n\t\tjQuery(params.button).siblings('.spbc__show_more_logs').css('display', 'inline-block');\r\n\t}\r\n}\r\n\r\nfunction spbc_sec_logs__allow_ip(ip) {\r\n\tspbc_sec_logs__filter_ip( ip, 'allow')\r\n\treturn false;\r\n}\r\n\r\nfunction spbc_sec_logs__ban_ip(ip) {\r\n\tspbc_sec_logs__filter_ip( ip, 'deny')\r\n\treturn false;\r\n}\r\n\r\nfunction spbc_sec_logs__filter_ip( ip, status, bulk = false) {\r\n\tconst data = {\r\n\t\taction: 'spbc_tc__filter_ip',\r\n\t\tip: ip,\r\n\t\tstatus: status\r\n\t};\r\n\tconst params = {\r\n\t\tstatus: status,\r\n\t};\r\n\tif (!bulk) {\r\n\t\tparams.callback = spbc_sec_logs__allow_ip__callback;\r\n\t}\r\n\tspbc_sendAJAXRequest( data, params );\r\n\r\n\treturn false;\r\n}\r\n\r\nfunction spbc_sec_logs__allow_ip__callback(result, data) {\r\n\tconsole.log(data);\r\n\tif (result.success) {\r\n\t\tlet msg = data.status === 'allow' ? 'Allowed' : 'Banned';\r\n\t\talert('Success. Selected IPs have been ' + msg + '. Changes will be applied within 10 minutes.');\r\n\t} else {\r\n\t\talert(result.data);\r\n\t}\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\t\r\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\r\n\tspbc_tbl__bulk_actions__listen();\r\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\r\n\tspbc_tbl__sort__listen(); // Table. Sort handler\r\n\t\r\n\t// Handler for show more SECURITY LOGS\r\n\tspbc_sec_logs__show_more__listen();\r\n\t\r\n\t// Start to hide long values in a table\r\n\tspbcStartShowHide();\r\n\t\r\n});"],"names":["spbc_sec_logs__show_more__listen","jQuery","on","data","params","spbcSettingsSecLogs","clicks","action","amount","button","this","spinner","nextElementSibling","wrapper","find","callback","spbc_sec_logs__show_more__callback","spbc_sendAJAXRequest","hide","siblings","css","result","console","log","size","html","spbc_tbl__row_actions__listen","spbcStartShowHide","spbc_sec_logs__allow_ip","ip","spbc_sec_logs__filter_ip","spbc_sec_logs__ban_ip","status","bulk","spbc_sec_logs__allow_ip__callback","success","msg","alert","document","ready","spbc_tbl__bulk_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen"],"mappings":"AACA,SAASA,mCACRC,OAAO,wBAAwB,EAAEC,GAAG,QAAS,WAC5C,IAEKC,EAIAC,EANFC,oBAAoBC,OAAS,GAC/BD,oBAAoBC,MAAM,GACtBH,EAAO,CACVI,OAAQ,+BACRC,OAAQH,oBAAoBG,QAAU,CAACH,oBAAoBC,OAAO,EACnE,EACIF,EAAS,CACZK,OAAQC,KACRC,QAASD,KAAKE,mBACdC,QAASZ,OAAO,0BAA0B,EAAEa,KAAK,OAAO,EACxDC,SAAUC,kCACX,EACAC,qBAAsBd,EAAMC,CAAO,IAGnCH,OAAOS,IAAI,EAAEQ,KAAK,EAClBjB,OAAOS,IAAI,EAAES,SAAS,uBAAuB,EAAEC,IAAI,UAAW,cAAc,EAE9E,CAAC,CACF,CAGA,SAASJ,mCAAmCK,EAAQlB,EAAMC,GACzDkB,QAAQC,IAAIF,CAAM,EACD,EAAdA,EAAOG,MACTvB,OAAOG,EAAOS,OAAO,EAAEY,KAAKJ,EAAOI,IAAI,EACvCC,8BAA8B,EAC9BC,kBAAkB,IAGlB1B,OAAOG,EAAOK,MAAM,EAAES,KAAK,EAC3BjB,OAAOG,EAAOK,MAAM,EAAEU,SAAS,uBAAuB,EAAEC,IAAI,UAAW,cAAc,EAEvF,CAEA,SAASQ,wBAAwBC,GAEhC,OADAC,yBAA0BD,EAAI,OAAO,EAC9B,CAAA,CACR,CAEA,SAASE,sBAAsBF,GAE9B,OADAC,yBAA0BD,EAAI,MAAM,EAC7B,CAAA,CACR,CAEA,SAASC,yBAA0BD,EAAIG,EAAQC,EAAO,CAAA,GAC/C9B,EAAO,CACZI,OAAQ,qBACRsB,GAAIA,EACJG,OAAQA,CACT,EACM5B,EAAS,CACd4B,OAAQA,CACT,EAMA,OALKC,IACJ7B,EAAOW,SAAWmB,mCAEnBjB,qBAAsBd,EAAMC,CAAO,EAE5B,CAAA,CACR,CAEA,SAAS8B,kCAAkCb,EAAQlB,GAClDmB,QAAQC,IAAIpB,CAAI,EACZkB,EAAOc,SACNC,EAAsB,UAAhBjC,EAAK6B,OAAqB,UAAY,SAChDK,MAAM,mCAAqCD,EAAM,8CAA8C,GAE/FC,MAAMhB,EAAOlB,IAAI,CAEnB,CAEAF,OAAOqC,QAAQ,EAAEC,MAAM,WAEtBb,8BAA8B,EAC9Bc,+BAA+B,EAC/BC,6BAA6B,EAC7BC,uBAAuB,EAGvB1C,iCAAiC,EAGjC2B,kBAAkB,CAEnB,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-settings_tab--security_log.min.js","sources":["spbc-settings_tab--security_log.js"],"sourcesContent":["// SECURITY LOGS SHOW MORE\nfunction spbc_sec_logs__show_more__listen(){\n\tjQuery('#spbc_show_more_button').on('click', function(){\n\t\tif(spbcSettingsSecLogs.clicks < 2){\n\t\t\tspbcSettingsSecLogs.clicks++;\n\t\t\tvar data = {\n\t\t\t\taction: 'spbc_show_more_security_logs',\n\t\t\t\tamount: spbcSettingsSecLogs.amount * (+spbcSettingsSecLogs.clicks+1),\n\t\t\t};\n\t\t\tvar params = {\n\t\t\t\tbutton: this,\n\t\t\t\tspinner: this.nextElementSibling,\n\t\t\t\twrapper: jQuery('#spbc_tbl__secuirty_logs').find('tbody'),\n\t\t\t\tcallback: spbc_sec_logs__show_more__callback,\n\t\t\t};\n\t\t\tspbc_sendAJAXRequest( data, params );\n\t\t}else{\n\t\t\t// Hide \"More logs\" button, show \"Control Panel\" button\n\t\t\tjQuery(this).hide();\n\t\t\tjQuery(this).siblings('.spbc__show_more_logs').css('display', 'inline-block');\n\t\t}\n\t});\n}\n\n\t// Callback for SHOW MORE SECURITY LOGS\nfunction spbc_sec_logs__show_more__callback(result, data, params){\t\n\tconsole.log(result);\n\tif(result.size > 0){\n\t\tjQuery(params.wrapper).html(result.html);\n\t\tspbc_tbl__row_actions__listen();\n\t\tspbcStartShowHide();\n\t}else{\n\t\t// Hide \"More logs\" button, show \"Control Panel\" button\n\t\tjQuery(params.button).hide();\n\t\tjQuery(params.button).siblings('.spbc__show_more_logs').css('display', 'inline-block');\n\t}\n}\n\nfunction spbc_sec_logs__allow_ip(ip) {\n\tspbc_sec_logs__filter_ip( ip, 'allow')\n\treturn false;\n}\n\nfunction spbc_sec_logs__ban_ip(ip) {\n\tspbc_sec_logs__filter_ip( ip, 'deny')\n\treturn false;\n}\n\nfunction spbc_sec_logs__filter_ip( ip, status, bulk = false) {\n\tconst data = {\n\t\taction: 'spbc_tc__filter_ip',\n\t\tip: ip,\n\t\tstatus: status\n\t};\n\tconst params = {\n\t\tstatus: status,\n\t};\n\tif (!bulk) {\n\t\tparams.callback = spbc_sec_logs__allow_ip__callback;\n\t}\n\tspbc_sendAJAXRequest( data, params );\n\n\treturn false;\n}\n\nfunction spbc_sec_logs__allow_ip__callback(result, data) {\n\tconsole.log(data);\n\tif (result.success) {\n\t\tlet msg = data.status === 'allow' ? 'Allowed' : 'Banned';\n\t\talert('Success. Selected IPs have been ' + msg + '. Changes will be applied within 10 minutes.');\n\t} else {\n\t\talert(result.data);\n\t}\n}\n\njQuery(document).ready(function(){\n\t\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\n\tspbc_tbl__bulk_actions__listen();\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\n\tspbc_tbl__sort__listen(); // Table. Sort handler\n\t\n\t// Handler for show more SECURITY LOGS\n\tspbc_sec_logs__show_more__listen();\n\t\n\t// Start to hide long values in a table\n\tspbcStartShowHide();\n\t\n});"],"names":["spbc_sec_logs__show_more__listen","jQuery","on","data","params","spbcSettingsSecLogs","clicks","action","amount","button","this","spinner","nextElementSibling","wrapper","find","callback","spbc_sec_logs__show_more__callback","spbc_sendAJAXRequest","hide","siblings","css","result","console","log","size","html","spbc_tbl__row_actions__listen","spbcStartShowHide","spbc_sec_logs__allow_ip","ip","spbc_sec_logs__filter_ip","spbc_sec_logs__ban_ip","status","bulk","spbc_sec_logs__allow_ip__callback","success","msg","alert","document","ready","spbc_tbl__bulk_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen"],"mappings":"AACA,SAASA,mCACRC,OAAO,wBAAwB,EAAEC,GAAG,QAAS,WAC5C,IAEKC,EAIAC,EANFC,oBAAoBC,OAAS,GAC/BD,oBAAoBC,MAAM,GACtBH,EAAO,CACVI,OAAQ,+BACRC,OAAQH,oBAAoBG,QAAU,CAACH,oBAAoBC,OAAO,EACnE,EACIF,EAAS,CACZK,OAAQC,KACRC,QAASD,KAAKE,mBACdC,QAASZ,OAAO,0BAA0B,EAAEa,KAAK,OAAO,EACxDC,SAAUC,kCACX,EACAC,qBAAsBd,EAAMC,CAAO,IAGnCH,OAAOS,IAAI,EAAEQ,KAAK,EAClBjB,OAAOS,IAAI,EAAES,SAAS,uBAAuB,EAAEC,IAAI,UAAW,cAAc,EAE9E,CAAC,CACF,CAGA,SAASJ,mCAAmCK,EAAQlB,EAAMC,GACzDkB,QAAQC,IAAIF,CAAM,EACD,EAAdA,EAAOG,MACTvB,OAAOG,EAAOS,OAAO,EAAEY,KAAKJ,EAAOI,IAAI,EACvCC,8BAA8B,EAC9BC,kBAAkB,IAGlB1B,OAAOG,EAAOK,MAAM,EAAES,KAAK,EAC3BjB,OAAOG,EAAOK,MAAM,EAAEU,SAAS,uBAAuB,EAAEC,IAAI,UAAW,cAAc,EAEvF,CAEA,SAASQ,wBAAwBC,GAEhC,OADAC,yBAA0BD,EAAI,OAAO,EAC9B,CAAA,CACR,CAEA,SAASE,sBAAsBF,GAE9B,OADAC,yBAA0BD,EAAI,MAAM,EAC7B,CAAA,CACR,CAEA,SAASC,yBAA0BD,EAAIG,EAAQC,EAAO,CAAA,GAC/C9B,EAAO,CACZI,OAAQ,qBACRsB,GAAIA,EACJG,OAAQA,CACT,EACM5B,EAAS,CACd4B,OAAQA,CACT,EAMA,OALKC,IACJ7B,EAAOW,SAAWmB,mCAEnBjB,qBAAsBd,EAAMC,CAAO,EAE5B,CAAA,CACR,CAEA,SAAS8B,kCAAkCb,EAAQlB,GAClDmB,QAAQC,IAAIpB,CAAI,EACZkB,EAAOc,SACNC,EAAsB,UAAhBjC,EAAK6B,OAAqB,UAAY,SAChDK,MAAM,mCAAqCD,EAAM,8CAA8C,GAE/FC,MAAMhB,EAAOlB,IAAI,CAEnB,CAEAF,OAAOqC,QAAQ,EAAEC,MAAM,WAEtBb,8BAA8B,EAC9Bc,+BAA+B,EAC/BC,6BAA6B,EAC7BC,uBAAuB,EAGvB1C,iCAAiC,EAGjC2B,kBAAkB,CAEnB,CAAC"} \ No newline at end of file diff --git a/js/spbc-settings_tab--settings_general.min.js.map b/js/spbc-settings_tab--settings_general.min.js.map index 66d50a8a3..0c0d8579e 100644 --- a/js/spbc-settings_tab--settings_general.min.js.map +++ b/js/spbc-settings_tab--settings_general.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings_tab--settings_general.min.js","sources":["spbc-settings_tab--settings_general.js"],"sourcesContent":["jQuery(document).ready(function(){\r\n\t\r\n\t// Show/Hide access key\r\n\tjQuery('#showHideLink').on('click', function(){\r\n\t\tjQuery('#spbc_key').val(jQuery('#spbc_key').attr('key'));\r\n\t\tjQuery('#spbc_key+div').show();\r\n\t\tjQuery(this).fadeOut(300);\r\n\t});\r\n\t\r\n\t// Set time zone filed value if key is bad\r\n\tif( !+spbcSettings.key_is_ok ){\r\n\t\tvar d = new Date();\r\n\t\tjQuery('#spbc_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\t\r\n\t}\r\n\t\r\n\t// Function for shuffle authentication unique keys and salts\r\n\tfunction spbcShuffleSalts() {\r\n\t\tvar data = {};\r\n\t\tvar res = {};\r\n\t\tdata.security = spbcSettings.ajax_nonce;\r\n\t\tdata.action = 'spbc_action_shuffle_salts';\r\n\r\n\t\tjQuery.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\tasync: false,\r\n\t\t\turl: spbcSettings.ajaxurl,\r\n\t\t\tdata: data,\r\n\t\t\tsuccess: function(result){\r\n\t\t\t\tif(result.success) {\r\n\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t} else {\r\n\t\t\t\t\talert(result.data);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\t// Event for shuffle authentication unique keys and salts\r\n\t// Enabling the salt update button and repeatedly pressing\r\n\tvar actionShuffleSaltsCountClicks = 0;\r\n\r\n\tjQuery('#action-shuffle-salts').click(function (e) {\r\n\t\te.preventDefault();\r\n\r\n\t\tif (jQuery(this).hasClass('disabled')) {\r\n\t\t\tactionShuffleSaltsCountClicks++;\r\n\t\t\tif (actionShuffleSaltsCountClicks === 3) {\r\n\t\t\t\tjQuery(this).removeClass('disabled');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tactionShuffleSaltsCountClicks = 0;\r\n\t\t\t\r\n\t\t\tif (confirm('Are you sure?')) {\r\n\t\t\t\tspbcShuffleSalts();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n});"],"names":["jQuery","document","ready","d","on","val","attr","show","this","fadeOut","spbcSettings","key_is_ok","Date","getTimezoneOffset","actionShuffleSaltsCountClicks","click","e","preventDefault","hasClass","removeClass","confirm","data","security","ajax_nonce","action","ajax","type","async","url","ajaxurl","success","result","location","reload","alert"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAUtB,IACKC,EARLH,OAAO,eAAe,EAAEI,GAAG,QAAS,WACnCJ,OAAO,WAAW,EAAEK,IAAIL,OAAO,WAAW,EAAEM,KAAK,KAAK,CAAC,EACvDN,OAAO,eAAe,EAAEO,KAAK,EAC7BP,OAAOQ,IAAI,EAAEC,QAAQ,GAAG,CACzB,CAAC,EAGI,CAACC,aAAaC,YACdR,EAAI,IAAIS,KACZZ,OAAO,sBAAsB,EAAEK,IAAIF,EAAEU,kBAAkB,EAAE,GAAG,CAAE,CAAE,GA2BjE,IAAIC,EAAgC,EAEpCd,OAAO,uBAAuB,EAAEe,MAAM,SAAUC,GAC/CA,EAAEC,eAAe,EAEbjB,OAAOQ,IAAI,EAAEU,SAAS,UAAU,EAEG,IADtCJ,EAAAA,GAECd,OAAOQ,IAAI,EAAEW,YAAY,UAAU,GAGpCL,EAAgC,EAE5BM,QAAQ,eAAe,KAnCxBC,EAAO,IAENC,SAAWZ,aAAaa,WAC7BF,EAAKG,OAAS,4BAEdxB,OAAOyB,KAAK,CACXC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKlB,aAAamB,QAClBR,KAAMA,EACNS,QAAS,SAASC,GACdA,EAAOD,QACT7B,SAAS+B,SAASC,OAAO,EAEzBC,MAAMH,EAAOV,IAAI,CAEnB,CACD,CAAC,GAsBF,CAAC,CACF,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-settings_tab--settings_general.min.js","sources":["spbc-settings_tab--settings_general.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Show/Hide access key\n\tjQuery('#showHideLink').on('click', function(){\n\t\tjQuery('#spbc_key').val(jQuery('#spbc_key').attr('key'));\n\t\tjQuery('#spbc_key+div').show();\n\t\tjQuery(this).fadeOut(300);\n\t});\n\t\n\t// Set time zone filed value if key is bad\n\tif( !+spbcSettings.key_is_ok ){\n\t\tvar d = new Date();\n\t\tjQuery('#spbc_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\t\n\t}\n\t\n\t// Function for shuffle authentication unique keys and salts\n\tfunction spbcShuffleSalts() {\n\t\tvar data = {};\n\t\tvar res = {};\n\t\tdata.security = spbcSettings.ajax_nonce;\n\t\tdata.action = 'spbc_action_shuffle_salts';\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\tasync: false,\n\t\t\turl: spbcSettings.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(result){\n\t\t\t\tif(result.success) {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t} else {\n\t\t\t\t\talert(result.data);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}\n\n\t// Event for shuffle authentication unique keys and salts\n\t// Enabling the salt update button and repeatedly pressing\n\tvar actionShuffleSaltsCountClicks = 0;\n\n\tjQuery('#action-shuffle-salts').click(function (e) {\n\t\te.preventDefault();\n\n\t\tif (jQuery(this).hasClass('disabled')) {\n\t\t\tactionShuffleSaltsCountClicks++;\n\t\t\tif (actionShuffleSaltsCountClicks === 3) {\n\t\t\t\tjQuery(this).removeClass('disabled');\n\t\t\t}\n\t\t} else {\n\t\t\tactionShuffleSaltsCountClicks = 0;\n\t\t\t\n\t\t\tif (confirm('Are you sure?')) {\n\t\t\t\tspbcShuffleSalts();\n\t\t\t}\n\t\t}\n\t});\n});"],"names":["jQuery","document","ready","d","on","val","attr","show","this","fadeOut","spbcSettings","key_is_ok","Date","getTimezoneOffset","actionShuffleSaltsCountClicks","click","e","preventDefault","hasClass","removeClass","confirm","data","security","ajax_nonce","action","ajax","type","async","url","ajaxurl","success","result","location","reload","alert"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAUtB,IACKC,EARLH,OAAO,eAAe,EAAEI,GAAG,QAAS,WACnCJ,OAAO,WAAW,EAAEK,IAAIL,OAAO,WAAW,EAAEM,KAAK,KAAK,CAAC,EACvDN,OAAO,eAAe,EAAEO,KAAK,EAC7BP,OAAOQ,IAAI,EAAEC,QAAQ,GAAG,CACzB,CAAC,EAGI,CAACC,aAAaC,YACdR,EAAI,IAAIS,KACZZ,OAAO,sBAAsB,EAAEK,IAAIF,EAAEU,kBAAkB,EAAE,GAAG,CAAE,CAAE,GA2BjE,IAAIC,EAAgC,EAEpCd,OAAO,uBAAuB,EAAEe,MAAM,SAAUC,GAC/CA,EAAEC,eAAe,EAEbjB,OAAOQ,IAAI,EAAEU,SAAS,UAAU,EAEG,IADtCJ,EAAAA,GAECd,OAAOQ,IAAI,EAAEW,YAAY,UAAU,GAGpCL,EAAgC,EAE5BM,QAAQ,eAAe,KAnCxBC,EAAO,IAENC,SAAWZ,aAAaa,WAC7BF,EAAKG,OAAS,4BAEdxB,OAAOyB,KAAK,CACXC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKlB,aAAamB,QAClBR,KAAMA,EACNS,QAAS,SAASC,GACdA,EAAOD,QACT7B,SAAS+B,SAASC,OAAO,EAEzBC,MAAMH,EAAOV,IAAI,CAEnB,CACD,CAAC,GAsBF,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/js/spbc-settings_tab--summary.min.js.map b/js/spbc-settings_tab--summary.min.js.map index 3a3c801c2..4ac7735fd 100644 --- a/js/spbc-settings_tab--summary.min.js.map +++ b/js/spbc-settings_tab--summary.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings_tab--summary.min.js","sources":["spbc-settings_tab--summary.js"],"sourcesContent":["jQuery(document).ready(function(){\r\n\tconsole.log('TAB - SUMMARY');\r\n});"],"names":["jQuery","document","ready","console","log"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WACtBC,QAAQC,IAAI,eAAe,CAC5B,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-settings_tab--summary.min.js","sources":["spbc-settings_tab--summary.js"],"sourcesContent":["jQuery(document).ready(function(){\n\tconsole.log('TAB - SUMMARY');\n});"],"names":["jQuery","document","ready","console","log"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WACtBC,QAAQC,IAAI,eAAe,CAC5B,CAAC"} \ No newline at end of file diff --git a/js/spbc-settings_tab--traffic_control.min.js.map b/js/spbc-settings_tab--traffic_control.min.js.map index 4c0d21d57..e1ddcfb79 100644 --- a/js/spbc-settings_tab--traffic_control.min.js.map +++ b/js/spbc-settings_tab--traffic_control.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings_tab--traffic_control.min.js","sources":["spbc-settings_tab--traffic_control.js"],"sourcesContent":["// Callback for displaying Firewall logs\r\nfunction spbc_tc__show_more__callback(result, data, params){\r\n\tif(data.full_refresh){\r\n\t\tjQuery(params.wrapper).html(result);\r\n\t\tspbc_tbl__row_actions__listen();\r\n\t\tspbc_tbl__pagination__listen();\r\n\t\tspbc_tbl__sort__listen();\r\n\t\tspbcStartShowHide();\r\n\t}else if(result.size > 0){\r\n\t\tjQuery(params.wrapper).html(result.html);\r\n\t\tspbc_tbl__row_actions__listen();\r\n\t\tspbcStartShowHide();\r\n\t}else{\r\n\t\t// Hide \"More logs\" button, show \"Control Panel\" button\r\n\t\tjQuery(params.button).hide();\r\n\t\tjQuery(params.button).siblings('.spbc__show_more_logs').css('display', 'inline-block');\r\n\t}\r\n}\r\n\r\nfunction spbc_tc__show_more__listen(){\t\r\n\tjQuery('#spbc_show_more_fw_logs_button').on('click', function(){\r\n\t\tif(spbcSettingsFWLogs.clicks < 2){\r\n\t\t\tspbcSettingsFWLogs.clicks++;\r\n\t\t\tvar data = {\r\n\t\t\t\taction: 'spbc_show_more_security_firewall_logs',\r\n\t\t\t\tamount: spbcSettingsFWLogs.amount * (+spbcSettingsFWLogs.clicks+1),\r\n\t\t\t};\t\t\t\r\n\t\t\tvar params = {\r\n\t\t\t\tbutton: this,\r\n\t\t\t\tspinner: this.nextElementSibling,\r\n\t\t\t\twrapper: jQuery('#spbc_tbl__traffic_control_logs').find('tbody'),\r\n\t\t\t\tcallback: spbc_tc__show_more__callback,\r\n\t\t\t};\r\n\t\t\tspbc_sendAJAXRequest( data, params );\r\n\t\t}else{\r\n\t\t\t// Hide \"More logs\" button, show \"Control Panel\" button\r\n\t\t\tjQuery(this).hide();\r\n\t\t\tjQuery(this).siblings('.spbc__show_more_logs').css('display', 'inline-block');\r\n\t\t}\r\n\t});\t\r\n}\r\n\r\njQuery(document).ready(function(){\r\n\t\r\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\r\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\r\n\tspbc_tbl__sort__listen(); // Table. Sort handler\r\n\t\r\n\t// Start to hide long values in a table\r\n\tspbcStartShowHide();\r\n\t\r\n\t// FIREWALL LOGS EVENTS\r\n\t\r\n\t// Handler for show more FIREWALL LOGS\r\n\tspbc_tc__show_more__listen();\r\n\t\r\n\t// Timer for FireWall logs\r\n\tvar spbcFireWallLogsUpdateTimer = setTimeout(function spbc_heartbeat(){\t\t\r\n\t\t// Do refresh only if traffic control is enabled and tab is active\r\n\t\tif( +spbcSettingsFWLogs.moderate && jQuery('.spbc_tab_nav-traffic_control').hasClass('spbc_tab_nav--active')){\r\n\t\t\tvar data = {\r\n\t\t\t\taction: 'spbc_show_more_security_firewall_logs',\r\n\t\t\t\tfull_refresh: true,\r\n\t\t\t};\r\n\t\t\tvar params = {\r\n\t\t\t\twrapper: jQuery('#spbc_tbl__traffic_control_logs'),\r\n\t\t\t\tcallback: spbc_tc__show_more__callback,\r\n\t\t\t\tnotJson: true,\r\n\t\t\t};\r\n\t\t\tspbc_sendAJAXRequest( data, params );\r\n\t\t}\r\n\t\tsetTimeout(spbc_heartbeat, 60000);\r\n\t}, 60000);\t\r\n});\r\n\r\nfunction spbc_tc__allow_ip(ip) {\r\n\tspbc_tc__filter_ip( ip, 'allow')\r\n\treturn false;\r\n}\r\n\r\nfunction spbc_tc__ban_ip(ip) {\r\n\tspbc_tc__filter_ip( ip, 'deny')\r\n\treturn false;\r\n}\r\n\r\nfunction spbc_tc__filter_ip( ip, status) {\r\n\tconst data = {\r\n\t\taction: 'spbc_tc__filter_ip',\r\n\t\tip: ip,\r\n\t\tstatus: status\r\n\t};\r\n\tconst params = {\r\n\t\tcallback: spbc_tc__allow_ip__callback,\r\n\t};\r\n\tspbc_sendAJAXRequest( data, params );\r\n\treturn false;\r\n}\r\n\r\nfunction spbc_tc__allow_ip__callback(data) {\r\n\tif (data.success) {\r\n\t\talert('Success.');\r\n\t} else {\r\n\t\talert(data.data);\r\n\t}\r\n}"],"names":["spbc_tc__show_more__callback","result","data","params","full_refresh","jQuery","wrapper","html","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","size","button","hide","siblings","css","spbc_tc__show_more__listen","on","spbcSettingsFWLogs","clicks","action","amount","this","spinner","nextElementSibling","find","callback","spbc_sendAJAXRequest","spbc_tc__allow_ip","ip","spbc_tc__filter_ip","spbc_tc__ban_ip","status","spbc_tc__allow_ip__callback","success","alert","document","ready","setTimeout","spbc_heartbeat","moderate","hasClass","notJson"],"mappings":"AACA,SAASA,6BAA6BC,EAAQC,EAAMC,GAChDD,EAAKE,cACPC,OAAOF,EAAOG,OAAO,EAAEC,KAAKN,CAAM,EAClCO,8BAA8B,EAC9BC,6BAA6B,EAC7BC,uBAAuB,EACvBC,kBAAkB,GACI,EAAdV,EAAOW,MACfP,OAAOF,EAAOG,OAAO,EAAEC,KAAKN,EAAOM,IAAI,EACvCC,8BAA8B,EAC9BG,kBAAkB,IAGlBN,OAAOF,EAAOU,MAAM,EAAEC,KAAK,EAC3BT,OAAOF,EAAOU,MAAM,EAAEE,SAAS,uBAAuB,EAAEC,IAAI,UAA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,CACf,EAM4BD,CAAO,GAEpCoC,WAAWC,EAAgB,GAAK,CACjC,EAAG,GAAK,CACT,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-settings_tab--traffic_control.min.js","sources":["spbc-settings_tab--traffic_control.js"],"sourcesContent":["// Callback for displaying Firewall logs\nfunction spbc_tc__show_more__callback(result, data, params){\n\tif(data.full_refresh){\n\t\tjQuery(params.wrapper).html(result);\n\t\tspbc_tbl__row_actions__listen();\n\t\tspbc_tbl__pagination__listen();\n\t\tspbc_tbl__sort__listen();\n\t\tspbcStartShowHide();\n\t}else if(result.size > 0){\n\t\tjQuery(params.wrapper).html(result.html);\n\t\tspbc_tbl__row_actions__listen();\n\t\tspbcStartShowHide();\n\t}else{\n\t\t// Hide \"More logs\" button, show \"Control Panel\" button\n\t\tjQuery(params.button).hide();\n\t\tjQuery(params.button).siblings('.spbc__show_more_logs').css('display', 'inline-block');\n\t}\n}\n\nfunction spbc_tc__show_more__listen(){\t\n\tjQuery('#spbc_show_more_fw_logs_button').on('click', function(){\n\t\tif(spbcSettingsFWLogs.clicks < 2){\n\t\t\tspbcSettingsFWLogs.clicks++;\n\t\t\tvar data = {\n\t\t\t\taction: 'spbc_show_more_security_firewall_logs',\n\t\t\t\tamount: spbcSettingsFWLogs.amount * (+spbcSettingsFWLogs.clicks+1),\n\t\t\t};\t\t\t\n\t\t\tvar params = {\n\t\t\t\tbutton: this,\n\t\t\t\tspinner: this.nextElementSibling,\n\t\t\t\twrapper: jQuery('#spbc_tbl__traffic_control_logs').find('tbody'),\n\t\t\t\tcallback: spbc_tc__show_more__callback,\n\t\t\t};\n\t\t\tspbc_sendAJAXRequest( data, params );\n\t\t}else{\n\t\t\t// Hide \"More logs\" button, show \"Control Panel\" button\n\t\t\tjQuery(this).hide();\n\t\t\tjQuery(this).siblings('.spbc__show_more_logs').css('display', 'inline-block');\n\t\t}\n\t});\t\n}\n\njQuery(document).ready(function(){\n\t\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\n\tspbc_tbl__sort__listen(); // Table. Sort handler\n\t\n\t// Start to hide long values in a table\n\tspbcStartShowHide();\n\t\n\t// FIREWALL LOGS EVENTS\n\t\n\t// Handler for show more FIREWALL LOGS\n\tspbc_tc__show_more__listen();\n\t\n\t// Timer for FireWall logs\n\tvar spbcFireWallLogsUpdateTimer = setTimeout(function spbc_heartbeat(){\t\t\n\t\t// Do refresh only if traffic control is enabled and tab is active\n\t\tif( +spbcSettingsFWLogs.moderate && jQuery('.spbc_tab_nav-traffic_control').hasClass('spbc_tab_nav--active')){\n\t\t\tvar data = {\n\t\t\t\taction: 'spbc_show_more_security_firewall_logs',\n\t\t\t\tfull_refresh: true,\n\t\t\t};\n\t\t\tvar params = {\n\t\t\t\twrapper: jQuery('#spbc_tbl__traffic_control_logs'),\n\t\t\t\tcallback: spbc_tc__show_more__callback,\n\t\t\t\tnotJson: true,\n\t\t\t};\n\t\t\tspbc_sendAJAXRequest( data, params );\n\t\t}\n\t\tsetTimeout(spbc_heartbeat, 60000);\n\t}, 60000);\t\n});\n\nfunction spbc_tc__allow_ip(ip) {\n\tspbc_tc__filter_ip( ip, 'allow')\n\treturn false;\n}\n\nfunction spbc_tc__ban_ip(ip) {\n\tspbc_tc__filter_ip( ip, 'deny')\n\treturn false;\n}\n\nfunction spbc_tc__filter_ip( ip, status) {\n\tconst data = {\n\t\taction: 'spbc_tc__filter_ip',\n\t\tip: ip,\n\t\tstatus: status\n\t};\n\tconst params = {\n\t\tcallback: spbc_tc__allow_ip__callback,\n\t};\n\tspbc_sendAJAXRequest( data, params );\n\treturn false;\n}\n\nfunction spbc_tc__allow_ip__callback(data) {\n\tif (data.success) {\n\t\talert('Success.');\n\t} else {\n\t\talert(data.data);\n\t}\n}"],"names":["spbc_tc__show_more__callback","result","data","params","full_refresh","jQuery","wrapper","html","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","size","button","hide","siblings","css","spbc_tc__show_more__listen","on","spbcSettingsFWLogs","clicks","action","amount","this","spinner","nextElementSibling","find","callback","spbc_sendAJAXRequest","spbc_tc__allow_ip","ip","spbc_tc__filter_ip","spbc_tc__ban_ip","status","spbc_tc__allow_ip__callback","success","alert","document","ready","setTimeout","spbc_heartbeat","moderate","hasClass","notJson"],"mappings":"AACA,SAASA,6BAA6BC,EAAQC,EAAMC,GAChDD,EAAKE,cACPC,OAAOF,EAAOG,OAAO,EAAEC,KAAKN,CAAM,EAClCO,8BAA8B,EAC9BC,6BAA6B,EAC7BC,uBAAuB,EACvBC,kBAAkB,GACI,EAAdV,EAAOW,MACfP,OAAOF,EAAOG,OAAO,EAAEC,KAAKN,EAAOM,IAAI,EACvCC,8BAA8B,EAC9BG,kBAAkB,IAGlBN,OAAOF,EAAOU,MAAM,EAAEC,KAAK,EAC3BT,OAAOF,EAAOU,MAAM,EAAEE,SAAS,uBAAuB,EAAEC,IAAI,UAAW,cAAc,EAEvF,CAEA,SAASC,6BACRZ,OAAO,gCAAgC,EAAEa,GAAG,QAAS,WACpD,IAEKhB,EAIAC,EANFgB,mBAAmBC,OAAS,GAC9BD,mBAAmBC,MAAM,GACrBlB,EAAO,CACVmB,OAAQ,wCACRC,OAAQH,mBAAmBG,QAAU,CAACH,mBAAmBC,OAAO,EACjE,EACIjB,EAAS,CACZU,OAAQU,KACRC,QAASD,KAAKE,mBACdnB,QAASD,OAAO,iCAAiC,EAAEqB,KAAK,OAAO,EAC/DC,SAAU3B,4BACX,EACA4B,qBAAsB1B,EAAMC,CAAO,IAGnCE,OAAOkB,IAAI,EAAET,KAAK,EAClBT,OAAOkB,IAAI,EAAER,SAAS,uBAAuB,EAAEC,IAAI,UAAW,cAAc,EAE9E,CAAC,CACF,CAmCA,SAASa,kBAAkBC,GAE1B,OADAC,mBAAoBD,EAAI,OAAO,EACxB,CAAA,CACR,CAEA,SAASE,gBAAgBF,GAExB,OADAC,mBAAoBD,EAAI,MAAM,EACvB,CAAA,CACR,CAEA,SAASC,mBAAoBD,EAAIG,GAUhC,OADAL,qBARa,CACZP,OAAQ,qBACRS,GAAIA,EACJG,OAAQA,CACT,EACe,CACdN,SAAUO,2BACX,CACmC,EAC5B,CAAA,CACR,CAEA,SAASA,4BAA4BhC,GAChCA,EAAKiC,QACRC,MAAM,UAAU,EAEhBA,MAAMlC,EAAKA,IAAI,CAEjB,CA9DAG,OAAOgC,QAAQ,EAAEC,MAAM,WAEtB9B,8BAA8B,EAC9BC,6BAA6B,EAC7BC,uBAAuB,EAGvBC,kBAAkB,EAKlBM,2BAA2B,EAGOsB,WAAW,SAASC,IAErD,IAKKrC,EALD,CAACgB,mBAAmBsB,UAAYpC,OAAO,+BAA+B,EAAEqC,SAAS,sBAAsB,IAKtGvC,EAAS,CACZG,QAASD,OAAO,iCAAiC,EACjDsB,SAAU3B,6BACV2C,QAAS,CAAA,CACV,EACAf,qBATW,CACVP,OAAQ,wCACRjB,aAAc,CAAA,CACf,EAM4BD,CAAO,GAEpCoC,WAAWC,EAAgB,GAAK,CACjC,EAAG,GAAK,CACT,CAAC"} \ No newline at end of file diff --git a/js/spbc-table.min.js b/js/spbc-table.min.js index 5c86482c9..ed82d50b6 100644 --- a/js/spbc-table.min.js +++ b/js/spbc-table.min.js @@ -1,2 +1,2 @@ -function spbc_reload_accordion(){spbc_sendAJAXRequest({action:"spbc_scanner_tab__reload_accordion"},{notJson:!0,callback:function(t,e,a,n){jQuery(n).accordion("destroy"),jQuery(n).html(t),jQuery(n).accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1}),spbc_tbl__bulk_actions__listen(),spbc_tbl__row_actions__listen(),spbc_tbl__pagination__listen(),spbc_tbl__sort__listen(),spbcStartShowHide()}},jQuery("#spbc_scan_accordion"))}function spbc_tbl__bulk_actions__listen(){jQuery(".tbl-bulk_actions-all--apply").off("click").on("click",function(){if(spbc_scanner.active)alert(spbcTableLocalize.scannerIsActive);else{var t=jQuery(this),a=t.siblings("select").children()[t.siblings("select").first()[0].selectedIndex].value;if(-1!==["approve","disapprove","send","check_analysis_status","approve_page","disapprove_page","cure","delete_from_analysis_log"].indexOf(a)){if(confirm(spbcTable.warning_bulk)){var e={action:"spbc_tbl-action--bulk",add_action:a,status:t.parents(".tbl-root").attr("type")};if("cure"===a){var n=t.closest("#spbc_tbl__scanner_cure_log").find(".cb-select");let a=[];n.each(function(t,e){e=jQuery(e).val();a.push(e)}),e.selectedIds=a}if("delete_from_analysis_log"===a){n=t.closest("#spbc_tbl__scanner_analysis_log").find(".cb-select");let a=[];n.each(function(t,e){e=jQuery(e).val();a.push(e)}),e.file_ids=a}n={button:this,spinner:t.children(".tbl-preloader--small"),callback:function(t){var e;spbc_reload_accordion(),"check_analysis_status"===a&&(e="

    Analysis status updated. Total: "+t.counters.total+", updated: "+t.counters.updated+", skipped: "+t.counters.skipped+", failed: "+t.counters.failed+", queued: "+t.counters.queued+"

    ",spbcModal.open().put(e)),"send"===a&&(e="

    Files have been sent: "+t.files_sent_counter+"

    ",spbcModal.open().put(e))},errorOutput:function(t,e){e&&(t=t+"
    Additional information:
    "+e),spbcModal.open().putError(t)},timeout:6e4};spbc_sendAJAXRequest(e,n)}}else alert("This action is not supported for all files yet =(")}}),jQuery(".tbl-bulk_actions--apply").off("click").on("click",function(t){if(spbc_bulk_action||confirm(spbcTable.warning_bulk)){var a=spbc_bulk_action||jQuery(this),n=(spbc_bulk_action=a).siblings("select").children()[a.siblings("select").first()[0].selectedIndex].value;if("cure"===n)spbc_scanner__cure_selected(jQuery(this));else if("delete_from_analysis_log"===n)spbc_scanner_analysis_log_delete_from_log(jQuery(this));else if("allow"===n||"ban"===n){let e="ban"===n?"deny":n;var s=a.parents(".tbl-root").find(".cb-select:checked"),s=(s&&(a.children(".tbl-preloader--small").show(),s.each(function(){var t=jQuery(this).parents("tr").find(".tbl-row_action--"+n).data("ip");spbc_sec_logs__filter_ip(t,e,!0),jQuery(this).prop("checked",!1)})),a.children(".tbl-preloader--small").hide(),"allow"===n?"Allowed":"Banned"),s="

    Success. Selected IPs have been "+s+". Changes will be applied within 10 minutes.

    ";spbcModal.open().put(s),void setTimeout(spbc_reload_accordion,1900)}else"-1"!==n&&a.parents(".tbl-root").find(".cb-select").is(":checked")?(a.children(".tbl-preloader--small").show(),a.parents(".tbl-root").find(".cb-select:checked").first().parents("tr").find(".tbl-row_action--"+n)[0]?(a.parents(".tbl-root").find(".cb-select:checked").first().parents("tr").find(".tbl-row_action--"+n).click(),a.parents(".tbl-root").find(".cb-select:checked").first().prop("checked",!1)):(a.parents(".tbl-root").find(".cb-select:checked").first().prop("checked",!1),a.click())):(a.children(".tbl-preloader--small").hide(),spbc_bulk_action=null,"check_analysis_status"===n&&spbcModal.open().put("

    All available files are updated.

    "),"send"===n&&spbcModal.open().put("

    All available files are sent.

    "),setTimeout(spbc_reload_accordion,1900))}})}function spbc_scanner__cure_selected(e){var t=e.closest("#spbc_tbl__scanner_cure_log").find(".cb-select:checked");let a=[];0===t.length&&alert("Please, select elements."),t.each(function(t,e){e=jQuery(e).val();a.push(e)});t={action:"spbc_cure_selected",security:spbcSettings.ajax_nonce,selectedIds:a};jQuery.ajax({type:"POST",url:spbcSettings.ajaxurl,data:t,beforeSend:function(){e.closest("#spbc_tbl__scanner_cure_log").find(".tbl-button---white_blue .tbl-preloader--in_button").show()},success:function(t){e.closest("#spbc_tbl__scanner_cure_log").find(".tbl-button---white_blue .tbl-preloader--in_button").hide(),t.success?(spbcModal.open().put(t.data),document.addEventListener("spbcModalClosed",function(t){document.location.reload()})):spbcModal.open().putError(t.data)}})}function spbc_tbl__row_actions__listen(){jQuery(".tbl-row_action--ajax").off("click").on("click",function(){var t,e,a,n;console.log("spbc_tbl__row_actions__listen click"),spbc_scanner.active?alert(spbcTableLocalize.scannerIsActive):(e={action:"spbc_tbl-action--row",add_action:(t=jQuery(this)).attr("row-action"),id:t.parents(".row-actions").attr("uid"),cols:t.parents(".row-actions").attr("cols_amount"),page_url:t.parent().attr("uid"),page_id:t.parent().attr("page_id")},a={callback:spbc_tbl__row_actions__callback,errorOutput:function(t){spbcModal.open().putError(t)},spinner:t.parent().siblings(".tbl-preloader--tiny")},!spbc_bulk_action&&(n=spbcTable["warning_"+t.attr("row-action")]||spbcTable.warning_default,"copy_file_info"===e.add_action||"check_analysis_status"===e.add_action||confirm(n))&&spbc_sendAJAXRequest(e,a,t.parents("tr")),spbc_bulk_action&&spbc_sendAJAXRequest(e,a,t.parents("tr")))})}function spbc_tbl__row_actions__callback(t,e,a,n){if(t.color&&n.css({background:t.background,color:t.color}),t.html&&(n.parent().parent().parent().prepend(t.html),setTimeout(function(){n.fadeOut(300)},1500),spbc_bulk_action||setTimeout(spbc_reload_accordion,1900)),"copy_file_info"===e.add_action&&(!0===t.success&&t.data.file_info?window.prompt("Copy the file info below and send it to support@cleantalk.org: ",t.data.file_info):(c=void 0!==t.data.error?t.data.error:"Unknown copy_file_info error",spbcModal.open().putError(c))),t.temp_html){var s=n.html();if(n.html(t.temp_html),void 0!==t.updated_template){var c=t.updated_template_type,t=t.updated_template,l=jQuery(t).find(".wp-list-table tbody tr").length,i=jQuery('[aria-controls="spbc_scan_accordion_tab_'+c+'"]');if(0a&&jQuery(e).css("outline","1px solid green")}),i.click()}else"analysis_log"===c&&(o='",c='