diff --git a/inc/spbc-admin.php b/inc/spbc-admin.php index 62405cb6f..7cac76287 100644 --- a/inc/spbc-admin.php +++ b/inc/spbc-admin.php @@ -203,7 +203,7 @@ function spbc_plugin_links_meta($meta, $plugin_file) function changedPluginName(){ jQuery('.plugin-title strong').each(function(i, item){ if(jQuery(item).html() == '{$plugin_name}') - jQuery(item).html('{$spbc->data["wl_brandname"]}'); + jQuery(item).html('{$spbc->data["wl_brandname"]}' + '  Security'); }); } changedPluginName(); diff --git a/inc/spbc-scanner.php b/inc/spbc-scanner.php index dec22a893..778c3f15d 100644 --- a/inc/spbc-scanner.php +++ b/inc/spbc-scanner.php @@ -119,7 +119,7 @@ function spbc_scanner_count_files($direct_call = false, $path = ABSPATH) $root_path = realpath(ABSPATH); $init_params = array( 'count' => true, - 'extensions' => 'php, html, htm', + 'extensions' => 'php, html, htm, php2, php3, php4, php5, php6, php7, phtml, shtml, phar', 'files_mandatory' => array(), 'dir_exceptions' => array(SPBC_PLUGIN_DIR . 'quarantine') ); @@ -438,8 +438,8 @@ function spbc_scanner_file_delete($direct_call = false, $file_id = null) $remembered_file_content = file_get_contents($file_path); $result = unlink($file_path); if ($result) { - $response_content = HTTP::getContentFromURL(get_option('home'), false); - $response_content_admin = HTTP::getContentFromURL(get_option('home') . '/wp-admin/', false); + $response_content = HTTP::getContentFromURL(get_option('home')); + $response_content_admin = HTTP::getContentFromURL(get_option('home') . '/wp-admin/'); if ( isset( $response_content['error'], @@ -1035,29 +1035,76 @@ function ($data) { return $out; } -function spbc_scanner_get_files_by_category($status) +/** + * Get SQL *WHERE* suffix for SELECT query depends on files category. + * @param string $category Category of files category which needs to be searched for + * @return string SQL *WHERE* suffix. + */ +function spbc_get_sql_where_addiction_for_table_of_category($category) { - global $wpdb; - - $ids = array(); - - switch ($status) { + global $spbc; + switch ($category) { case 'critical': - $res = $wpdb->get_results('SELECT fast_hash from ' . SPBC_TBL_SCAN_FILES . ' WHERE severity = "CRITICAL" AND status <> "QUARANTINED"'); + $res = ' WHERE severity IN("CRITICAL") AND + (status <> "QUARANTINED" AND + status <> "APROVED" AND + status <> "APPROVED_BY_CT") + AND + (last_sent IS NULL OR + pscan_status = "DANGEROUS" OR + analysis_status = "DANGEROUS")'; break; case 'suspicious': - $res = $wpdb->get_results('SELECT fast_hash from ' . SPBC_TBL_SCAN_FILES . ' WHERE status = "MODIFIED" AND severity <> "CRITICAL"'); - break; - case 'unknown': - $res = $wpdb->get_results('SELECT fast_hash from ' . SPBC_TBL_SCAN_FILES . ' WHERE status <> "APROVED" AND source IS NULL AND path NOT LIKE "%wp-content%themes%" AND path NOT LIKE "%wp-content%plugins%" AND (severity <> "CRITICAL" OR severity IS NULL)'); + $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") )'; break; case 'approved': - $res = $wpdb->get_results('SELECT fast_hash from ' . SPBC_TBL_SCAN_FILES . ' WHERE status = "APROVED"'); + $res = ' WHERE status = "APROVED"'; break; case 'analysis_log': - $res = $wpdb->get_results('SELECT fast_hash from ' . SPBC_TBL_SCAN_FILES . ' WHERE last_sent IS NOT NULL'); + $res = ' WHERE last_sent IS NOT NULL'; + break; + case 'unknown': + $res = ' WHERE status NOT IN ("APROVED","APPROVED_BY_CT","APPROVED_BY_CLOUD") AND + detected_at >= ' . (time() - $spbc->settings['scanner__list_unknown__older_than'] * 86400) . ' AND + source 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"))'; + break; + case 'quarantined': + $res = ' WHERE status = "QUARANTINED"'; break; + case 'frontend_malware': + $res = ' WHERE approved IS NULL OR approved <> 1'; + break; + case 'frontend_scan_results_approved': + $res = ' WHERE approved = 1'; + break; + default: + $res = ''; } + return $res; +} + +/** + * Get all files IDs of the category. + * @param string $category Category of files category which needs to be searched for + * @return array Array of IDs + */ +function spbc_scanner_get_files_by_category($category) +{ + global $wpdb; + + $ids = array(); + + $query = 'SELECT fast_hash from ' . SPBC_TBL_SCAN_FILES . spbc_get_sql_where_addiction_for_table_of_category($category); + + $res = $wpdb->get_results($query); foreach ($res as $tmp) { $ids[] = $tmp->fast_hash; diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php index 2388c98ba..3e0ddda55 100644 --- a/inc/spbc-settings.php +++ b/inc/spbc-settings.php @@ -2611,15 +2611,17 @@ function spbc_field_scanner() } echo ''; echo '
'; - printf( - __('%sView all scan results for this website%s%s', 'security-malware-firewall'), - "", - '', - '' - ); + if (! $spbc->data["wl_mode_enabled"]) { + printf( + __('%sView all scan results for this website%s%s', 'security-malware-firewall'), + "", + '', + ',' + ); + } // show save to pdf link if ( ! empty($spbc->data['scanner']['last_scan'])) { - echo ',  ' + echo '  ' . __('Export results to PDF', 'security-malware-firewall') . ''; } @@ -2658,6 +2660,17 @@ function spbc_field_scanner() _e('Found outdated plugins or themes. Please, update to latest versions.', 'security-malware-firewall'); echo '

'; + //* Debug Buttons + // Clear hashes + if (in_array(Server::getDomain(), array('lc', 'loc', 'lh', 'wordpress'), true)) { + echo '' + . '' + . '

'; + } + //*/ + echo '
' . '' . __('Receiving core hashes', 'security-malware-firewall') . ' -> ' @@ -3083,13 +3096,13 @@ function spbc_list_table__get_args_by_type($table_type) $accordion_default_args, array( 'columns' => array( - 'cb' => array('heading' => '', 'class' => 'check-column',), - 'path' => array('heading' => 'Path', 'primary' => true,), - 'size' => array('heading' => 'Size, bytes',), - 'perms' => array('heading' => 'Permissions',), - 'weak_spots' => array('heading' => 'Detected'), - 'mtime' => array('heading' => 'Last Modified',), - 'status' => array('heading' => 'Analysis verdict',), + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'path' => array('heading' => 'Path', 'primary' => true, 'width_percent' => 38), + 'size' => array('heading' => 'Size, bytes', 'width_percent' => 7), + 'perms' => array('heading' => 'Permissions', 'width_percent' => 7), + 'weak_spots' => array('heading' => 'Detected', 'width_percent' => 18), + 'mtime' => array('heading' => 'Last Modified', 'width_percent' => 10), + 'status' => array('heading' => 'Analysis verdict', 'width_percent' => 15), ), 'func_data_prepare' => 'spbc_field_scanner__prepare_data__files', 'if_empty_items' => '

' . __('No threats are found or all the files have been sent for analysis', 'security-malware-firewall') . '

', @@ -3126,14 +3139,7 @@ function spbc_list_table__get_args_by_type($table_type) 'quarantine' => array('name' => 'Quarantine it',), ), 'sql' => array( - 'where' => ' WHERE severity IN("CRITICAL") AND - (status <> "QUARANTINED" AND - status <> "APROVED" AND - status <> "APPROVED_BY_CT") - AND - (last_sent IS NULL OR - pscan_status = "DANGEROUS" OR - analysis_status = "DANGEROUS")', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('critical'), ), 'order_by' => array('path' => 'asc'), ) @@ -3146,6 +3152,15 @@ function spbc_list_table__get_args_by_type($table_type) $args = array_replace_recursive( $accordion_default_args, array( + 'columns' => array( + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'path' => array('heading' => 'Path', 'primary' => true, 'width_percent' => 38), + 'size' => array('heading' => 'Size, bytes', 'width_percent' => 7), + 'perms' => array('heading' => 'Permissions', 'width_percent' => 7), + 'weak_spots' => array('heading' => 'Detected', 'width_percent' => 18), + 'mtime' => array('heading' => 'Last Modified', 'width_percent' => 10), + 'status' => array('heading' => 'Analysis verdict', 'width_percent' => 15), + ), 'func_data_prepare' => 'spbc_field_scanner__prepare_data__files', 'if_empty_items' => false, 'actions' => array( @@ -3181,9 +3196,7 @@ function spbc_list_table__get_args_by_type($table_type) 'quarantine' => array('name' => 'Quarantine it',), ), 'sql' => array( - 'where' => ' WHERE severity <> "CRITICAL" AND - last_sent IS NULL AND - (status = "MODIFIED" AND severity IS NOT NULL) OR (status = "INFECTED" AND severity IN ("SUSPICIOUS","DANGER") )', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('suspicious'), ), 'order_by' => array('path' => 'asc'), ) @@ -3204,21 +3217,33 @@ function spbc_list_table__get_args_by_type($table_type) 'pscan_pending_queue', 'analysis_status' ), - 'where' => ' WHERE last_sent IS NOT NULL', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('analysis_log'), ), 'order_by' => array('pscan_status' => 'desc'), 'sortable' => array('path', 'last_sent', 'analysis_status', 'pscan_status'), ) ); - $args['columns'] = array( - 'cb' => array('heading' => '', 'class' => 'check-column',), - 'path' => array('heading' => 'Path', 'primary' => true,), - 'detected_at' => array('heading' => 'Detected at',), - 'last_sent' => array('heading' => 'Sent for analysis at',), - 'pscan_status' => array('heading' => 'Cloud verdict',), - 'analysis_status' => array('heading' => 'Manual verdict',), - 'analysis_comment' => array('heading' => 'Comment',), - ); + if (!spbc__check_if_manual_analysis_results_exist()) { + $args['columns'] = array( + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'path' => array('heading' => 'Path', 'primary' => true, 'width_percent' => 38), + 'detected_at' => array('heading' => 'Detected at', 'width_percent' => 15), + 'last_sent' => array('heading' => 'Sent for analysis at', 'width_percent' => 15), + 'pscan_status' => array('heading' => 'Cloud verdict', 'width_percent' => 10), + 'analysis_comment' => array('heading' => 'Comment', 'width_percent' => 20), + ); + } else { + $args['columns'] = array( + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'path' => array('heading' => 'Path', 'primary' => true, 'width_percent' => 38), + 'detected_at' => array('heading' => 'Detected at', 'width_percent' => 10), + 'last_sent' => array('heading' => 'Sent for analysis at', 'width_percent' => 10), + 'pscan_status' => array('heading' => 'Cloud verdict', 'width_percent' => 10), + 'analysis_status' => array('heading' => 'Manual verdict', 'width_percent' => 15), + 'analysis_comment' => array('heading' => 'Comment', 'width_percent' => 15), + ); + } + $args['actions'] = array( 'check_analysis_status' => array('name' => 'Refresh the analysis status'), 'copy_file_info' => array('name' => 'Copy file info'), @@ -3238,6 +3263,13 @@ function spbc_list_table__get_args_by_type($table_type) $accordion_default_args, array( 'func_data_prepare' => 'spbc_field_scanner__prepare_data__files', + 'columns' => array( + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'path' => array('heading' => 'Path', 'primary' => true, 'width_percent' => 39), + 'size' => array('heading' => 'Size, bytes', 'width_percent' => 13), + 'perms' => array('heading' => 'Permissions', 'width_percent' => 13), + 'mtime' => array('heading' => 'Last Modified', 'width_percent' => 13), + ), 'if_empty_items' => false, 'actions' => array( 'approve' => array('name' => 'Approve',), @@ -3247,15 +3279,7 @@ function spbc_list_table__get_args_by_type($table_type) 'approve' => array('name' => 'Approve',), ), 'sql' => array( - 'where' => ' WHERE - status NOT IN ("APROVED","APPROVED_BY_CT","APPROVED_BY_CLOUD") AND - detected_at >= ' . (time() - $spbc->settings['scanner__list_unknown__older_than'] * 86400) . ' AND - source 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"))', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('unknown'), ), 'order_by' => array('path' => 'asc'), ) @@ -3267,6 +3291,14 @@ function spbc_list_table__get_args_by_type($table_type) $accordion_default_args, array( 'func_data_prepare' => 'spbc_field_scanner__prepare_data__files', + 'columns' => array( + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'path' => array('heading' => 'Path', 'primary' => true, 'width_percent' => 40), + 'weak_spots' => array('heading' => 'Detected', 'width_percent' => 20), + 'size' => array('heading' => 'Size, bytes', 'width_percent' => 7), + 'perms' => array('heading' => 'Permissions', 'width_percent' => 7), + 'mtime' => array('heading' => 'Last Modified', 'width_percent' => 7), + ), 'if_empty_items' => false, 'actions' => array( 'disapprove' => array('name' => 'Disapprove',), @@ -3275,7 +3307,7 @@ function spbc_list_table__get_args_by_type($table_type) 'disapprove' => array('name' => 'Disapprove',), ), 'sql' => array( - 'where' => ' WHERE status = "APROVED"', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('approved'), ), 'order_by' => array('path' => 'asc'), ) @@ -3322,7 +3354,7 @@ function spbc_list_table__get_args_by_type($table_type) 'q_path', 'q_time', )), - 'where' => ' WHERE status = "QUARANTINED"', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('quarantined'), ), 'sortable' => array('path', 'previous_state', 'severity', 'q_time', 'size',), 'order_by' => array('path' => 'asc'), @@ -3393,18 +3425,18 @@ function spbc_list_table__get_args_by_type($table_type) 'offset' => 0, 'limit' => 20, 'get_array' => false, - 'where' => ' WHERE approved IS NULL OR approved <> 1', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('frontend_malware'), ), 'func_data_prepare' => 'spbc_field_scanner__prepare_data__frontend', 'func_data_get' => 'spbc_field_scanner__get_data__frontend_malware', 'if_empty_items' => __('No malware found', 'security-malware-firewall'), 'columns' => array( - 'cb' => array('heading' => '', 'class' => 'check-column',), - 'url' => array('heading' => 'Page', 'primary' => true,), - 'dbd_found' => array('heading' => 'Drive by Download',), - 'redirect_found' => array('heading' => 'Redirects',), - 'csrf' => array('heading' => 'CSRF',), - 'signature' => array('heading' => 'Signatures',), + 'cb' => array('heading' => '', 'class' => 'check-column', 'width_percent' => 2), + 'url' => array('heading' => 'Page', 'primary' => true, 'width_percent' => 38), + 'dbd_found' => array('heading' => 'Drive by Download', 'width_percent' => 15), + 'redirect_found' => array('heading' => 'Redirects', 'width_percent' => 15), + 'csrf' => array('heading' => 'CSRF', 'width_percent' => 15), + 'signature' => array('heading' => 'Signatures', 'width_percent' => 15), ), 'order_by' => array('url' => 'asc'), 'sortable' => array('url', 'dbd_found', 'redirect_found', 'signature', 'csrf'), @@ -3434,7 +3466,7 @@ function spbc_list_table__get_args_by_type($table_type) 'offset' => 0, 'limit' => 20, 'get_array' => false, - 'where' => ' WHERE approved = 1', + 'where' => spbc_get_sql_where_addiction_for_table_of_category('frontend_scan_results_approved'), ), 'func_data_prepare' => 'spbc_field_scanner__prepare_data__frontend', 'func_data_get' => 'spbc_field_scanner__get_data__frontend_approved', @@ -4538,7 +4570,7 @@ function spbc_bulk_actions_description() $description .= '

'; $description .= '*
'; - $description .= esc_html__('Website total files - only executable files (*.php, *.html, *.htm) except for the quarantined files, files of zero size and files larger than the acceptable size.', 'security-malware-firewall'); + $description .= esc_html__('Website total files - only executable files (*.php, *.html, *.htm, *.phtml, *.shtml, *.phar) except for the quarantined files, files of zero size and files larger than the acceptable size.', 'security-malware-firewall'); $description .= '
'; $description .= esc_html__('Files scanned - files was checked. Some files will be added to the scan if the scanner deems it necessary.', 'security-malware-firewall'); @@ -4806,3 +4838,16 @@ function spbc__get_count_outbound_links() "SELECT COUNT(*) FROM " . SPBC_TBL_SCAN_LINKS . ";" ); } + +/** + * Check if results table contains even a record with manual verdict in 'analysis_status' + * @return bool + */ +function spbc__check_if_manual_analysis_results_exist() +{ + global $wpdb; + + return (bool)$wpdb->get_var( + "SELECT COUNT(*) FROM " . SPBC_TBL_SCAN_FILES . " WHERE analysis_status IS NOT NULL;" + ); +} diff --git a/js/spbc-settings_tab--scanner.min.js b/js/spbc-settings_tab--scanner.min.js index 8e6d3d7bc..e3182018e 100644 --- a/js/spbc-settings_tab--scanner.min.js +++ b/js/spbc-settings_tab--scanner.min.js @@ -1,4 +1,4 @@ -function spbc_popup_tip___show(e){function s(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_popup_tip--wrapper").length&&!jQuery(e.target).hasClass("spbc_popup_tip--icon---cancel")||jQuery(e.target).hasClass("spbc_popup_tip--icon---show"))||(jQuery(".spbc_popup_tip--wrapper").hide(),jQuery(document).off("click",s))}var t=e.attr("spbc_tip_title")||null,o=e.attr("spbc_tip_text")||null,n=(s(),e.after("
"),jQuery(".spbc_popup_tip--wrapper"));n.empty().append("
").css({top:e.position().top-2,left:e.position().left+25}),n.append("").append("

"+t+"

").append("

"+o+"

"),jQuery(document).on("click",s),e.parents("tr").on("mouseout",s)}function spbc_scanner_button_file_view_event(e){var e=jQuery(e),s={action:"spbc_scanner_file_view",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbc_scannerButtonView_callback,errorOutput:function(e){spbcModal.open().putError(e)}};spbc_sendAJAXRequest(s,e)}function spbc_scanner_analysis_log_delete_from_log(e){var e=jQuery(e),s={action:"spbc_scanner_analysis_log_delete_from_log",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:window.location.reload(),errorOutput:function(e){spbcModal.open().putError(e)}};spbc_sendAJAXRequest(s,e)}function spbc_scanner_button_page_view_event(e){var e=jQuery(e),s={action:"spbc_scanner_page_view",page_url:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbc_scannerButtonView_callback,errorOutput:function(e){spbcModal.open().putError(e)}},t=jQuery("#wpwrap"),o=jQuery("#spbc_dialog"),n=(o.dialog({modal:!0,title:"Loading..",position:{my:"center top",at:"center top+100px",of:window},width:t.width()/100*90,show:{effect:"blind",duration:500},draggable:!1,resizable:!1,closeText:"X",classes:{"ui-dialog":"spbc---top"},open:function(e,s){e.target.style.overflow="auto",jQuery("#spbc_dialog").height(document.documentElement.clientHeight/100*25)},beforeClose:function(e,s){document.body.style.overflow="auto",jQuery("#spbc_dialog").empty()}}),o.append('Wait for downloading'),jQuery("#spbc_file_view_preloader")),t=4e-4*t.width();n.height(128*t),n.width(128*t),n.css({left:o.width()/2-128*t/2}),n.css({top:o.height()/2-128*t/2}),spbc_sendAJAXRequest(s,e)}function spbc_scannerButtonView_callback(e){var s,t=jQuery("#spbc_dialog");t.empty(),jQuery("#spbc_file_view_preloader").css({display:"none"});for(s in e.file)t.append('
%s

%s


'.printf(s,e.file[s]));let o=19*Object.keys(e.file).length<76?76:19*Object.keys(e.file).length,n=document.documentElement.clientHeight/100*75,a=o%s

%s


':a).printf(e,s.file[e]));jQuery("#spbc_dialog").append(a.printf("",""))}jQuery("#spbc_dialog div").last().remove();let i=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,p=document.documentElement.clientHeight/100*75,l=i{};if(1==o.success){console.log(o);var n,a='
%s

%s


',c=[];for(n in o.weak_spots=JSON.parse(o.weak_spots),o.weak_spots)c=c.concat(Object.keys(o.weak_spots[n]));var r,c=[...new Set(c)].sort(),i=new Map(Object.entries(o.weak_spots.CRITICAL));for(r in c){var p=+c[r];for(let t=p-2;t<=2+p;t++)if(void 0!==o.file[t]){var l=p===t;let e,s;e=l?'
%s

%s


':a,s=l?e.printf(t,i.get(c[r])):e.printf(t,o.file[t]),jQuery("#spbc_dialog").append(s)}jQuery("#spbc_dialog").append(a.printf("","")),jQuery("#spbc_dialog div").last().remove()}}else jQuery("#spbc_dialog").append('
%s
'.printf(o.content)),t=()=>{document.location.reload()};let _=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,d=document.documentElement.clientHeight/100*75,u=_Modified',"Line",'Original'));for(var n=1;void 0!==s.file[n]||void 0!==s.file_original[n];n++)if(void 0===s.file[n]&&(s.file[n]=""),void 0===s.file_original[n]&&(s.file_original[n]=""),-1!=s.difference.indexOf(n)){for(let e=n-2;e<=n+2;e++)void 0!==s.file[e]&&void 0!==s.file_original[n]&&jQuery("#spbc_dialog").append((n===e?'

%s

%s

%s


':o).printf(s.file[e]||"",e,s.file_original[e]||""));jQuery("#spbc_dialog").append(o.printf("","",""))}var a=19*jQuery("#spbc_dialog div").length+19,c=document.documentElement.clientHeight/100*75,r=a{document.getElementById("spbc_scanner__last_scan_info").innerText=e.data}})}function spbc_scanner_file_monitoring_show_current_snapshot(e){var e=jQuery(e),s=e.parents(".row-actions").attr("uid");const t=e.closest(".column-path").find(".title").text(),o=jQuery("[data-remodal-id=spbc-file-monitoring-modal]");o.remodal().open();e={action:"spbc_file_monitoring_show_snapshots",file_id:s,security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success&&(o.find("#spbc-fm-snapshot-list ul").remove(),o.find("#spbc-fm-snapshot-file-name").text(t),drawSnapshotList(e.data,o),drawCurrentSnapshot(e.data[0].id,o))}})}function drawSnapshotList(e,s){let t="";for(var o of e)t+=`
  • ${o.created_at}
  • `;e=`
      +function spbc_popup_tip___show(e){function s(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_popup_tip--wrapper").length&&!jQuery(e.target).hasClass("spbc_popup_tip--icon---cancel")||jQuery(e.target).hasClass("spbc_popup_tip--icon---show"))||(jQuery(".spbc_popup_tip--wrapper").hide(),jQuery(document).off("click",s))}var t=e.attr("spbc_tip_title")||null,o=e.attr("spbc_tip_text")||null,n=(s(),e.after("
      "),jQuery(".spbc_popup_tip--wrapper"));n.empty().append("
      ").css({top:e.position().top-2,left:e.position().left+25}),n.append("").append("

      "+t+"

      ").append("

      "+o+"

      "),jQuery(document).on("click",s),e.parents("tr").on("mouseout",s)}function spbc_scanner_button_file_view_event(e){var e=jQuery(e),s={action:"spbc_scanner_file_view",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbc_scannerButtonView_callback,errorOutput:function(e){spbcModal.open().putError(e)}};spbc_sendAJAXRequest(s,e)}function spbc_scanner_analysis_log_delete_from_log(e){var e=jQuery(e),s={action:"spbc_scanner_analysis_log_delete_from_log",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:window.location.reload(),errorOutput:function(e){spbcModal.open().putError(e)}};spbc_sendAJAXRequest(s,e)}function spbc_scanner_button_page_view_event(e){var e=jQuery(e),s={action:"spbc_scanner_page_view",page_url:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbc_scannerButtonView_callback,errorOutput:function(e){spbcModal.open().putError(e)}},t=jQuery("#wpwrap"),o=jQuery("#spbc_dialog"),n=(o.dialog({modal:!0,title:"Loading..",position:{my:"center top",at:"center top+100px",of:window},width:t.width()/100*90,show:{effect:"blind",duration:500},draggable:!1,resizable:!1,closeText:"X",classes:{"ui-dialog":"spbc---top"},open:function(e,s){e.target.style.overflow="auto",jQuery("#spbc_dialog").height(document.documentElement.clientHeight/100*25)},beforeClose:function(e,s){document.body.style.overflow="auto",jQuery("#spbc_dialog").empty()}}),o.append('Wait for downloading'),jQuery("#spbc_file_view_preloader")),t=4e-4*t.width();n.height(128*t),n.width(128*t),n.css({left:o.width()/2-128*t/2}),n.css({top:o.height()/2-128*t/2}),spbc_sendAJAXRequest(s,e)}function spbc_scannerButtonView_callback(e){var s,t=jQuery("#spbc_dialog");t.empty(),jQuery("#spbc_file_view_preloader").css({display:"none"});for(s in e.file)t.append('
      %s

      %s


      '.printf(s,e.file[s]));let o=19*Object.keys(e.file).length<76?76:19*Object.keys(e.file).length,n=document.documentElement.clientHeight/100*75,a=o%s

      %s


      ':a).printf(e,s.file[e]));jQuery("#spbc_dialog").append(a.printf("",""))}jQuery("#spbc_dialog div").last().remove();let i=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,p=document.documentElement.clientHeight/100*75,l=i{};if(1==o.success){console.log(o);var n,a='
      %s

      %s


      ',c=[];for(n in o.weak_spots=JSON.parse(o.weak_spots),o.weak_spots)c=c.concat(Object.keys(o.weak_spots[n]));var r,c=[...new Set(c)].sort(),i=new Map(Object.entries(o.weak_spots.CRITICAL));for(r in c){var p=+c[r];for(let t=p-2;t<=2+p;t++)if(void 0!==o.file[t]){var l=p===t;let e,s;e=l?'
      %s

      %s


      ':a,s=l&&!o.file[t].includes("iframe")?e.printf(t,i.get(c[r])):e.printf(t,o.file[t]),jQuery("#spbc_dialog").append(s)}jQuery("#spbc_dialog").append(a.printf("","")),jQuery("#spbc_dialog div").last().remove()}}else jQuery("#spbc_dialog").append('
      %s
      '.printf(o.content)),t=()=>{document.location.reload()};let _=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,d=document.documentElement.clientHeight/100*75,u=_Modified',"Line",'Original'));for(var n=1;void 0!==s.file[n]||void 0!==s.file_original[n];n++)if(void 0===s.file[n]&&(s.file[n]=""),void 0===s.file_original[n]&&(s.file_original[n]=""),-1!=s.difference.indexOf(n)){for(let e=n-2;e<=n+2;e++)void 0!==s.file[e]&&void 0!==s.file_original[n]&&jQuery("#spbc_dialog").append((n===e?'

      %s

      %s

      %s


      ':o).printf(s.file[e]||"",e,s.file_original[e]||""));jQuery("#spbc_dialog").append(o.printf("","",""))}var a=19*jQuery("#spbc_dialog div").length+19,c=document.documentElement.clientHeight/100*75,r=a{document.getElementById("spbc_scanner__last_scan_info").innerText=e.data}})}function spbc_scanner_file_monitoring_show_current_snapshot(e){var e=jQuery(e),s=e.parents(".row-actions").attr("uid");const t=e.closest(".column-path").find(".title").text(),o=jQuery("[data-remodal-id=spbc-file-monitoring-modal]");o.remodal().open();e={action:"spbc_file_monitoring_show_snapshots",file_id:s,security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success&&(o.find("#spbc-fm-snapshot-list ul").remove(),o.find("#spbc-fm-snapshot-file-name").text(t),drawSnapshotList(e.data,o),drawCurrentSnapshot(e.data[0].id,o))}})}function drawSnapshotList(e,s){let t="";for(var o of e)t+=`
    • ${o.created_at}
    • `;e=`
        ${t}
      `;s.find("#spbc-fm-snapshot-list").append(e)}function drawCurrentSnapshot(s,t){var e={action:"spbc_file_monitoring_show_current_snapshot",snapshot_id:s,security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,beforeSend:function(){jQuery("#spbc-file-monitoring-modal-preloader").show()},success:function(e){e.success&&(t.find("#spbc-fm-snapshot-view .wrap").remove(),t.find("[data-spanshot-id").removeClass("active"),t.find("[data-spanshot-id="+s+"]").addClass("active"),e=`
      diff --git a/js/spbc-settings_tab--scanner.min.js.map b/js/spbc-settings_tab--scanner.min.js.map
      index 0b10266c8..e899332a2 100644
      --- a/js/spbc-settings_tab--scanner.min.js.map
      +++ b/js/spbc-settings_tab--scanner.min.js.map
      @@ -1 +1 @@
      -{"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\tconst self = jQuery(obj);\n\tconst data = {\n\t\taction: 'spbc_scanner_analysis_log_delete_from_log',\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: window.location.reload(),\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\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\tstr_nums = [];\n\n\tresult.weak_spots = JSON.parse(result.weak_spots);\n\tfor(let severity in result.weak_spots){\n\t\tstr_nums = str_nums.concat(Object.keys(result.weak_spots[severity]));\n\t}\n\tstr_nums = [...new Set(str_nums)].sort(); // Sort bad line\n\n\tfor(let str_num in str_nums){\n\n\t\tlet row = +str_nums[str_num],\n\t\t\tdisplay_depth = 2;\n\n\t\t// Display only existing lines of file\n\t\tfor(let curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\n\t\t\tif( typeof result.file[curr_row] !== 'undefined' ){\n\t\t\t\tjQuery('#spbc_dialog').append((row === curr_row ? row_template_bad : row_template).printf(curr_row, result.file[curr_row]));\n\t\t\t}\n\t\t}\n\n\t\t// Placing an empty string between results\n\t\tjQuery('#spbc_dialog').append(row_template. printf('', ''));\n\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\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){\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});"],"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","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","let","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","str_num","row_template","str_nums","weak_spots","JSON","parse","concat","Set","sort","curr_row","last","remove","afterClose","success","bad_strings_map","Map","entries","CRITICAL","is_bad_string","unformatted_row","highlited_row","get","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","closest","find","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","header","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,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AGrDiM,IAFqBxN,OAAO,kDAAkD,EAAEuB,KAAK,aAAa,GAOtGmH,oBAAoB8E,EADJxN,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\tconst self = jQuery(obj);\n\tconst data = {\n\t\taction: 'spbc_scanner_analysis_log_delete_from_log',\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: window.location.reload(),\n\t\terrorOutput: function(msg){ spbcModal.open().putError( msg ); },\n\t};\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\tstr_nums = [];\n\n\tresult.weak_spots = JSON.parse(result.weak_spots);\n\tfor(let severity in result.weak_spots){\n\t\tstr_nums = str_nums.concat(Object.keys(result.weak_spots[severity]));\n\t}\n\tstr_nums = [...new Set(str_nums)].sort(); // Sort bad line\n\n\tfor(let str_num in str_nums){\n\n\t\tlet row = +str_nums[str_num],\n\t\t\tdisplay_depth = 2;\n\n\t\t// Display only existing lines of file\n\t\tfor(let curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\n\t\t\tif( typeof result.file[curr_row] !== 'undefined' ){\n\t\t\t\tjQuery('#spbc_dialog').append((row === curr_row ? row_template_bad : row_template).printf(curr_row, result.file[curr_row]));\n\t\t\t}\n\t\t}\n\n\t\t// Placing an empty string between results\n\t\tjQuery('#spbc_dialog').append(row_template. printf('', ''));\n\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\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});"],"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","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","let","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","str_num","row_template","str_nums","weak_spots","JSON","parse","concat","Set","sort","curr_row","last","remove","afterClose","success","bad_strings_map","Map","entries","CRITICAL","is_bad_string","unformatted_row","highlited_row","includes","get","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","closest","find","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","header","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,KAmB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AOoK,IAAI,EAAE7I,KAAK,aAAa,EAGrDkM,IAFqBzN,OAAO,kDAAkD,EAAEuB,KAAK,aAAa,GAOtGoH,oBAAoB8E,EADJzN,OAAO,8CAA8C,CACvB,CAC/C,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/js/src/spbc-settings_tab--scanner.js b/js/src/spbc-settings_tab--scanner.js index e5c447287..4dac0a215 100644 --- a/js/src/spbc-settings_tab--scanner.js +++ b/js/src/spbc-settings_tab--scanner.js @@ -308,7 +308,7 @@ function spbc_scannerButtonViewBad_callback(result, data, params){ } else { unformatted_row = row_template } - if (is_bad_string){ + if (is_bad_string && !result.file[curr_row].includes('iframe')){ highlited_row = unformatted_row.printf(curr_row, bad_strings_map.get(str_nums[str_num])); } else { highlited_row = unformatted_row.printf(curr_row, result.file[curr_row]); diff --git a/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/Modules/Entropy.php b/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/Modules/Entropy.php index 2d5a940e9..8db64f8f8 100644 --- a/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/Modules/Entropy.php +++ b/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/Modules/Entropy.php @@ -48,7 +48,7 @@ public function analyse(Variables $variables) $encoder = new Encoder(); $detected_unreadable_variables = []; foreach ( $variable_names as $variable ) { - if ( empty($variables_obj[$variable]) ) { + if ( ! isset($variables_obj[$variable][0]) ) { continue; } if ( strpos($variable, '_') === 0 || strlen($variable) < 5 ) { diff --git a/lib/CleantalkSP/SpbctWP/Firewall/BFP.php b/lib/CleantalkSP/SpbctWP/Firewall/BFP.php index 0d61d3119..1fc8a7a9a 100644 --- a/lib/CleantalkSP/SpbctWP/Firewall/BFP.php +++ b/lib/CleantalkSP/SpbctWP/Firewall/BFP.php @@ -16,6 +16,7 @@ class BFP extends FirewallModule protected $count_period = 900; // Counting login attempts in this interval protected $chance_to_clean = 100; // Chance to clean log table from old entries. In percents. + protected static $is_checked = false; /** * @psalm-suppress PossiblyUnusedProperty @@ -85,6 +86,10 @@ public function middleAction($result = null) public function updateLogs() { + if (self::$is_checked) { + return; + } + foreach ( $this->ip_array as $current_ip ) { $interval_time = Helper::getTimeIntervalStart($this->count_period); @@ -129,6 +134,8 @@ public function updateLogs() $this->db->execute($query); } } + + self::$is_checked = true; } private function clearTable() diff --git a/lib/CleantalkSP/SpbctWP/ListTable.php b/lib/CleantalkSP/SpbctWP/ListTable.php index 6f4555240..44df9436f 100644 --- a/lib/CleantalkSP/SpbctWP/ListTable.php +++ b/lib/CleantalkSP/SpbctWP/ListTable.php @@ -400,9 +400,13 @@ public function displayColumnHeaders() } $hint = isset($column['hint']) ? '' . $column['hint'] . '' : ''; - + $style = ''; + if (isset($column['width_percent'])) { + $header_length = !empty($column['width_percent']) ? $column['width_percent'] . '%' : ''; + $style = "style='width:$header_length'"; + } // Out - echo "<$tag id='$id' class='$classes' $sort_direction_attr>{$column['heading']}$sortable$hint"; + echo "<$tag id='$id' class='$classes' $sort_direction_attr $style>{$column['heading']}$sortable$hint"; } unset($column_key); } diff --git a/lib/CleantalkSP/SpbctWP/Scanner/DirectoryScan.php b/lib/CleantalkSP/SpbctWP/Scanner/DirectoryScan.php index b4e1c4332..29ba195f6 100644 --- a/lib/CleantalkSP/SpbctWP/Scanner/DirectoryScan.php +++ b/lib/CleantalkSP/SpbctWP/Scanner/DirectoryScan.php @@ -67,7 +67,7 @@ public function setElements() $this->root, array_merge( array( - 'extensions' => 'php, html, htm', + 'extensions' => 'php, html, htm, php2, php3, php4, php5, php6, php7, phtml, shtml, phar, js', 'extensions_exceptions' => array('jpg', 'jpeg', 'png', 'gif', 'css', 'txt', 'zip', 'xml', 'json'), ), $this->params diff --git a/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php b/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php index aae467c07..86c21ccfd 100755 --- a/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php +++ b/lib/CleantalkSP/SpbctWP/Scanner/ScannerQueue.php @@ -388,22 +388,22 @@ public function get_cms_hashes() // phpcs:ignore PSR1.Methods.CamelCapsMethodNam $stage_data_obj->set('added_count_hashes', $result->cnt); $out = array('comment' => 'Already up to date.', 'end' => 1,); } - } else { - $out = array('error' => 'Your WordPress version is not supported'); - } - $scanning_stages_storage->saveToDb(); + $scanning_stages_storage->saveToDb(); - // Adding to log - ScanningLogFacade::writeToLog( - '' . $stage_data_obj::getTitle() . ' ' . $stage_data_obj->getDescription() - ); + // Adding to log + ScanningLogFacade::writeToLog( + '' . $stage_data_obj::getTitle() . ' ' . $stage_data_obj->getDescription() + ); - // Sending data to frontend - $out['stage_data_for_logging'] = array( - 'title' => $stage_data_obj::getTitle(), - 'description' => $stage_data_obj->getDescription() - ); + // Sending data to frontend + $out['stage_data_for_logging'] = array( + 'title' => $stage_data_obj::getTitle(), + 'description' => $stage_data_obj->getDescription() + ); + } else { + $out = array('error' => 'Your WordPress version is not supported'); + } return $out; } @@ -788,7 +788,7 @@ public function countFileSystem($path_to_scan = ABSPATH) $init_params = array( 'count' => true, 'file_exceptions' => 'wp-config.php', - 'extensions' => 'php, html, htm, js', + 'extensions' => 'php, html, htm, js, php2, php3, php4, php5, php6, php7, phtml, shtml, phar', 'files_mandatory' => array(), 'dir_exceptions' => array(SPBC_PLUGIN_DIR . 'quarantine') ); @@ -835,7 +835,7 @@ public function file_system_analysis($offset = null, $amount = null, $path_to_sc 'full_hash' => true, 'offset' => $offset, 'amount' => $amount, - 'extensions' => 'php, html, htm, js', + 'extensions' => 'php, html, htm, js, php2, php3, php4, php5, php6, php7, phtml, shtml, phar', 'extensions_exceptions' => '', //array('jpg', 'jpeg', 'png', 'gif', 'css', 'txt', 'zip', 'xml', 'json') 'file_exceptions' => 'wp-config.php', 'files_mandatory' => array(), diff --git a/lib/CleantalkSP/SpbctWP/State.php b/lib/CleantalkSP/SpbctWP/State.php index d474c8b39..72bc164c5 100644 --- a/lib/CleantalkSP/SpbctWP/State.php +++ b/lib/CleantalkSP/SpbctWP/State.php @@ -42,7 +42,7 @@ class State extends \CleantalkSP\Common\State 'bfp__block_period__5_fails' => 3600, // By default ban IP for brute force for one hour 'bfp__count_interval' => 900, // Counting login attempts in this interval 'login_page_rename__enabled' => 0, - 'login_page_rename__name' => 'login', + 'login_page_rename__name' => 'custom-login-url', 'login_page_rename__redirect' => '', 'login_page_rename__send_email_notification' => 1, 'there_was_signature_treatment' => 0, diff --git a/readme.txt b/readme.txt index 441648038..48406c08f 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: security, firewall, malware, wordpress security, brute force Requires at least: 3.0 Tested up to: 6.2 Requires PHP: 5.6 -Stable tag: 2.114 +Stable tag: 2.115 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -301,6 +301,18 @@ This is required for the Security FireWall to function properly. Plugins that ar == Changelog == += 2.115 July 31 2023 = +* New: Firewall. Protect login from brute force even if expired key. +* New: Scanner. Added extensions to find malware. +* Fix: Whitelabel. Added rules for check brand info. +* Fix: Front Scanner. Fixed modal view suspicious code for drive by download malware. +* Fix: General. Check response code on file delete. +* Fix: Scanner. Bulk actions fixed and improved. +* Fix: Scanner. Entropy analyse - Index invalid or out of range. +* Ref: General. WP 6.3 compatibility. Fixed version checking before scanner run. +* Ref: Rename login URl. For new instances default new login page rename. +* Ref: Scanner. Accordeon fields custom length. + = 2.114 July 17 2023 = * New: Scanner. Added pop up with info how to fix file listening and unsafe permissions. * New: SecFW. Manage Firewall as option and refactored clear scanner logs button for admin access. diff --git a/security-malware-firewall.php b/security-malware-firewall.php index 3bd606ecd..d0d2559ac 100644 --- a/security-malware-firewall.php +++ b/security-malware-firewall.php @@ -5,7 +5,7 @@ Plugin URI: https://wordpress.org/plugins/security-malware-firewall/ Description: Security & Malware scan by CleanTalk to protect your website from online threats and viruses. IP/Country FireWall, Web application FireWall. Detailed stats and logs to have full control. Author: CleanTalk Security -Version: 2.114 +Version: 2.115 Author URI: https://cleantalk.org Text Domain: security-malware-firewall Domain Path: /i18n @@ -898,10 +898,12 @@ function spbc_login_form_notification() // @ToDo this section need to be refactored $link = ! $spbc->data["wl_mode_enabled"] ? $link : $spbc->data["wl_brandname"]; + $logo_img = $spbc->data["wl_mode_enabled"] ? "" : ""; echo "
      " . "

      " . __('Brute Force Protection by', 'security-malware-firewall') - . "" + . " " + . $logo_img . $link . ".

      " . "

      " . __('All attempts are logged.', 'security-malware-firewall') . "

      @@ -923,10 +925,11 @@ function spbc_login_form_notification() */ function spbc_authenticate($user, $username) { - global $spbc; if ( is_wp_error($user) ) { + spbc_authenticate__check_brute_force(); + $spbc->login_error = true; $err_codes = $user->get_error_codes(); @@ -1037,6 +1040,43 @@ function spbc_authenticate($user, $username) return $user; } +/** + * Check brute force attack + * + * @return void + */ +function spbc_authenticate__check_brute_force() +{ + global $spbc; + + $login_url = wp_login_url(); + if ($spbc->settings['login_page_rename__enabled']) { + $GLOBALS['wp_rewrite'] = new WP_Rewrite(); + $login_url = RenameLoginPage::getURL($spbc->settings['login_page_rename__name']); + } + + $bfp = new BFP( + array( + 'api_key' => $spbc->api_key, + 'state' => $spbc, + 'is_login_page' => strpos(Server::getURL(), $login_url) === 0, + 'is_logged_in' => Cookie::get('spbc_is_logged_in') === md5($spbc->data['salt'] . parse_url(get_option('home'), PHP_URL_HOST)), + 'bf_limit' => $spbc->settings['bfp__allowed_wrong_auths'], + 'block_period' => $spbc->settings['bfp__block_period__5_fails'], + 'count_period' => $spbc->settings['bfp__count_interval'], + ) + ); + + $bfp->setDb(new DB()); + $bfp->setIpArray([IP::get()]); + $bfp_result = $bfp->check(); + $bfp->middleAction(); + + if (!empty($bfp_result)) { + $bfp->_die($bfp_result[0]); + } +} + /** * Returns browser sign * @@ -2022,18 +2062,18 @@ function spbc_access_key_notices($spbc_key = null) $spbc_key = $spbc_key ?: $spbc->settings['spbc_key']; - if ( ! $spbc_key ) { - return array( 'error' => 'KEY_IS_NOT_OK' ); - } - if ( empty($spbc_key) ) { - $spbc_key = ! $spbc->is_mainsite && $spbc->ms__work_mode != 2 - ? ( ! empty($spbc->network_settings['spbc_key']) ? $spbc->network_settings['spbc_key'] : false ) - : ( ! empty($spbc->settings['spbc_key']) ? $spbc->settings['spbc_key'] : false ); - } - - if ( ! $spbc_key ) { - return array( 'error' => 'KEY_IS_EMPTY' ); + if ( ! $spbc->is_mainsite && $spbc->ms__work_mode != 2 ) { + $spbc_key = ! empty($spbc->network_settings['spbc_key']) ? $spbc->network_settings['spbc_key'] : false; + if ( ! $spbc_key ) { + return array( 'error' => 'KEY_IS_NOT_OK_ON_MAIN_WPMS_SITE' ); + } + } else { + $spbc_key = ! empty($spbc->settings['spbc_key']) ? $spbc->settings['spbc_key'] : false; + if ( ! $spbc_key ) { + return array( 'error' => 'KEY_IS_NOT_OK' ); + } + } } try {