From b3fb3161c06bee11f67c5201a068ef7fdd97922a Mon Sep 17 00:00:00 2001 From: svfcode Date: Tue, 24 Oct 2023 11:11:47 +0300 Subject: [PATCH] merge fix to dev --- .../field-templates/textarea.php | 7 ++- inc/spbc-auth.php | 20 ++++---- inc/spbc-settings.php | 15 ++++-- js/spbc-settings_tab--scanner.min.js | 2 +- js/spbc-settings_tab--scanner.min.js.map | 2 +- js/src/spbc-settings_tab--scanner.js | 1 - lib/CleantalkSP/Common/Helpers/Data.php | 2 +- .../HeuristicAnalyser/HeuristicAnalyser.php | 2 +- .../AdminBanners/AdminBannerReview.php | 3 +- lib/CleantalkSP/Updater/UpdaterScripts.php | 2 +- security-malware-firewall.php | 46 +------------------ 11 files changed, 36 insertions(+), 66 deletions(-) diff --git a/inc/admin-templates/field-templates/textarea.php b/inc/admin-templates/field-templates/textarea.php index 2e0a64207..bbfd10ff9 100644 --- a/inc/admin-templates/field-templates/textarea.php +++ b/inc/admin-templates/field-templates/textarea.php @@ -1,7 +1,12 @@ -
+ + + + +
+ settings['2fa__enable'] ) { +if ( isset($spbc) && ($spbc instanceof \CleantalkSP\SpbctWP\State ) && $spbc->settings['2fa__enable'] ) { add_action('login_form_login', 'spbc_2fa__authenticate', 1); // Authenticate with Code add_action('login_form', 'spbc_2fa__show_field', 10); add_action('after_password_reset', 'spbc_2fa__Google2fa_replace_meta', 10, 1); @@ -27,11 +27,11 @@ /** * Disable G2FA after password resetting - * + * * @param \WP_User $user - * + * * return void - */ + */ function spbc_2fa__Google2fa_replace_meta(\WP_User $user) { return delete_user_meta($user->ID, 'spbc_2fa_type') && delete_user_meta($user->ID, 'spbc_g2fa_token'); @@ -136,7 +136,6 @@ function spbc_authenticate($user, $username) // The user is logged in. if ( $user instanceof WP_User && $user->ID > 0 ) { - // Skip for ZAPIER if ( spbc_is_plugin_active('zapier/zapier.php') && @@ -188,7 +187,7 @@ function spbc_authenticate($user, $username) * Detecting new device * * @param WP_User|WP_Error $user - * + * * @return bool */ function spbc_authenticate__is_new_device($user) @@ -202,8 +201,8 @@ function spbc_authenticate__is_new_device($user) /** * Writes log about login * - * @param WP_User|WP_Error $user - * + * @param WP_User $user + * * @return void */ function spbc_authenticate__write_log_login($user) @@ -236,7 +235,8 @@ function spbc_authenticate__browser_sign__create() $sign = preg_replace_callback( $regexp, function ($matches) { - return preg_replace('#\/(\d+\.?)+#', '', $matches[0]); + $replaces = preg_replace('#\/(\d+\.?)+#', '', $matches[0]); + return !is_string($replaces) ? '' : $replaces; }, $sign ); @@ -295,7 +295,7 @@ function spbc_authenticate__browser_sign__get_hash($user) } $sign = ''; - foreach($sign_collection as $item) { + foreach ($sign_collection as $item) { $sign .= $item; } diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php index f77aab420..1402d24b3 100644 --- a/inc/spbc-settings.php +++ b/inc/spbc-settings.php @@ -626,7 +626,8 @@ function spbc_settings__register() 'input_type' => 'textarea', 'title' => __('Directory exclusions for the malware scanner:', 'security-malware-firewall'), 'title_first' => true, - 'description' => __('Input relative directories (WordPress folder is ROOT). Separate each directory by a new line and omit the character "\" at the beginning. All subdirectories will be excluded too.', 'security-malware-firewall'), + 'description' => __('Input relative directories (WordPress folder is ROOT). Separate each directory path by a new line.', 'security-malware-firewall'), + 'long_description' => true ), 'scanner__auto_cure' => array( 'type' => 'field', @@ -4093,10 +4094,14 @@ function spbc_sanitize_settings($settings) } // Sanitizing scanner dirs exceptions - if ($settings['scanner__dir_exclusions']) { - $dirs = CSV::parseNSV($settings['scanner__dir_exclusions']); + if ( $settings['scanner__dir_exclusions'] ) { + $dirs = CSV::parseNSV($settings['scanner__dir_exclusions']); $settings['scanner__dir_exclusions'] = array(); foreach ($dirs as $dir) { + $dir = preg_replace('#\\\\+|\/+#', '/', $dir); + $dir = trim($dir, "/"); + $instance_dir_separator = $spbc->is_windows ? '\\' : '/'; + $dir = str_replace('/', $instance_dir_separator, $dir); $settings['scanner__dir_exclusions'][] = $dir; } $settings['scanner__dir_exclusions'] = implode("\n", $settings['scanner__dir_exclusions']); @@ -4643,6 +4648,10 @@ function spbc_settings__get_description() Disable this option if you have mail connection issues or SMTP service is not configured on this WordPress instance. Please note that only user that has permissions to activate plugins can disable this option.', 'security-malware-firewall'), ), + 'scanner__dir_exclusions' => array( + 'title' => __('Directory exclusions ruleset', 'security-malware-firewall'), + 'desc' => __('This rules will exclude the directory and all subdirectories matching the specified path. Any type of directory separator is acceptable. Example: wp-content/themes/yourtheme/skipthisdir', 'security-malware-firewall'), + ), 'no_description' => array( 'title' => esc_html($setting_id), 'desc' => __('No description provided yet for this item. We are sorry about this. Please, contact support@cleantalk.org for further help.', 'security-malware-firewall'), diff --git a/js/spbc-settings_tab--scanner.min.js b/js/spbc-settings_tab--scanner.min.js index e2d609f67..efbf7605f 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'+a+" weakspots:",d=jQuery("#spbc_dialog"),_=(d.append(c.printf("",_)),d.append(c.printf("...","...")),d.find("#"+l));for(p in _.parent().parent().css("text-align","center"),_.parent().parent().css("border","1px dotted"),_.parent().parent().css("background","darkgrey"),r[a]){p=[...new Set(p)].sort();var u=+r[a][p];for(let e=u-2;e<=2+u;e++)void 0!==s.file[e]&&d.append((u===e?'
%s

%s


':c).printf(e,s.file[e]));d.append(c.printf("...","..."))}}jQuery("#spbc_dialog div").last().remove();let b=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,f=document.documentElement.clientHeight/100*75,g=b{};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)if(0!=r||!i.get(c[r]).toLowerCase().includes("doctype")){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=`
      +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()};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'+a+" weakspots:",d=jQuery("#spbc_dialog"),_=(d.append(c.printf("",_)),d.append(c.printf("...","...")),d.find("#"+l));for(p in _.parent().parent().css("text-align","center"),_.parent().parent().css("border","1px dotted"),_.parent().parent().css("background","darkgrey"),r[a]){p=[...new Set(p)].sort();var u=+r[a][p];for(let e=u-2;e<=2+u;e++)void 0!==s.file[e]&&d.append((u===e?'
      %s

      %s


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

      %s

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

      %s

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

      %s

      %s

      %s


      ';\n\tlet row_template_bad = '

      %s

      %s

      %s


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

      %s


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

      %s


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

      %s


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

      %s

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

      %s

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

      %s

      %s

      %s


      ';\n\tlet row_template_bad = '

      %s

      %s

      %s


      ';\n\n\tjQuery('#spbc_dialog').append(row_template.printf('Modified', 'Line', 'Original'));\n\n\tfor(var row=1, prev = false, next = false; typeof result.file[row] != 'undefined' || typeof result.file_original[row] != 'undefined'; row++){\n\n\t\tif(typeof result.file[row] == 'undefined') result.file[row] = '';\n\t\tif(typeof result.file_original[row] == 'undefined') result.file_original[row] = '';\n\n\t\t// Display only existing lines of file\n\t\tif(result.difference.indexOf(row) != -1){\n\t\t\tfor(let display_depth = 2, curr_row = row - display_depth; curr_row <= row + display_depth; curr_row++ ){\n\t\t\t\tif( typeof result.file[curr_row] !== 'undefined' && typeof result.file_original[row] !== 'undefined') {\n\t\t\t\t\tjQuery('#spbc_dialog').append(\n\t\t\t\t\t\t(row === curr_row ? row_template_bad : row_template).printf(\n\t\t\t\t\t\t\tresult.file[curr_row] ? result.file[curr_row] : '',\n\t\t\t\t\t\t\tcurr_row,\n\t\t\t\t\t\t\tresult.file_original[curr_row] ? result.file_original[curr_row] : ''\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tjQuery('#spbc_dialog').append(row_template. printf('', '', ''));\n\t\t}\n\t}\n\n\tvar content_height = jQuery('#spbc_dialog div').length * 19 + 19,\n\t\tvisible_height = (document.documentElement.clientHeight) / 100 * 75,\n\t\toverflow = content_height < visible_height ? 'no_scroll' : 'scroll',\n\t\theight = overflow === 'scroll' ? visible_height : content_height;\n\n\tjQuery('#spbc_dialog').dialog({\n\t\tmodal:true,\n\t\ttitle: result.file_path,\n\t\tposition: { my: \"center top\", at: \"center top+100px\" , of: window },\n\t\twidth: +(jQuery('#wpwrap').width() / 100 * 90),\n\t\theight: height,\n\t\tshow: { effect: \"blind\", duration: 500 },\n\t\tdraggable: true,\n\t\tresizable: true,\n\t\tcloseText: \"X\",\n\t\tclasses: {\"ui-dialog\": 'spbc---top'},\n\t\topen: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\tevent.target.style.overflow = overflow;\n\t\t\tjQuery('#spbc_dialog').height(height);\n\t\t},\n\t\tbeforeClose: function(event, ui) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tjQuery('#spbc_dialog').empty();\n\t\t}\n\t});\n}\n\nfunction spbc_scanner__reload_scan_info() {\n\tjQuery('.spbc_hint__last_scan_title').text(spbcScaner.look_below_for_scan_res);\n\tconst data = {\n\t\taction: 'spbc_scanner__last_scan_info'\n\t};\n\tconst params = {\n\t\tcallback: (result) => {\n\t\t\tdocument.getElementById('spbc_scanner__last_scan_info').innerText = result.data;\n\t\t}\n\t};\n\tspbc_sendAJAXRequest(data, params);\n}\n\n/**\n * Show snapshots of file\n * @param obj\n */\nfunction spbc_scanner_file_monitoring_show_current_snapshot(obj)\n{\n\tconst self = jQuery(obj);\n\tconst fileId = self.parents('.row-actions').attr('uid');\n\tconst file_name = self.closest('.column-path').find('.title').text();\n\n\t// Init and open remodal\n\tconst remodal = jQuery('[data-remodal-id=spbc-file-monitoring-modal]');\n\tconst remodalObject = remodal.remodal();\n\tremodalObject.open();\n\n\t// Ajax request to get data for slider\n\tlet data = {\n\t\taction: 'spbc_file_monitoring_show_snapshots',\n\t\tfile_id: fileId,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tremodal.find('#spbc-fm-snapshot-list ul').remove();\n\t\t\t\tremodal.find('#spbc-fm-snapshot-file-name').text(file_name);\n\t\t\t\tdrawSnapshotList(result.data, remodal);\n\t\t\t\tdrawCurrentSnapshot(result.data[0].id, remodal);\n\t\t\t} else {\n\t\t\t\t// TODO: show errors\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n *\n * @param data\n * @param remodal\n */\nfunction drawSnapshotList(data, remodal)\n{\n\tlet list = '';\n\n\tfor (let item of data) {\n\t\tlist += `
    • ${item.created_at}
    • `;\n\t}\n\n\tlet html =\n\t\t`
        \n ${list}\n
      `;\n\n\tremodal.find('#spbc-fm-snapshot-list').append(html);\n}\n\nfunction drawCurrentSnapshot(snapshot_id, remodal)\n{\n\t// Ajax request to get data for slider\n\tlet data = {\n\t\taction: 'spbc_file_monitoring_show_current_snapshot',\n\t\tsnapshot_id,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tbeforeSend: function() {\n\t\t\tjQuery('#spbc-file-monitoring-modal-preloader').show();\n\t\t},\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tremodal.find('#spbc-fm-snapshot-view .wrap').remove();\n\t\t\t\tremodal.find('[data-spanshot-id').removeClass('active');\n\t\t\t\tremodal.find('[data-spanshot-id=' + snapshot_id + ']').addClass('active');\n\n\t\t\t\tlet html =\n\t\t\t\t\t`
      \n
      \n                            \n                                ${result.data.content}\n                            \n                        
      \n
      `;\n\n\t\t\t\tjQuery('#spbc-file-monitoring-modal-preloader').hide();\n\t\t\t\tremodal.find('#spbc-fm-snapshot-view').append(html);\n\t\t\t\tdocument.querySelectorAll('pre code').forEach((el) => {\n\t\t\t\t\thljs.highlightElement(el);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// TODO: show errors\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n * Cure file\n * @param obj\n */\nfunction spbc_scanner_button_cure_file_ajax_handler(obj)\n{\n\tconst self = jQuery(obj);\n\tconst fileFastHash = self.parents('.row-actions').attr('uid');\n\n\tlet data = {\n\t\taction: 'spbc_file_cure_ajax_action',\n\t\tfile_fast_hash: fileFastHash,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tspbcModal.open().put(result.data);\n\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tspbcModal.open().putError(result.data);\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n * Restore file from backup\n * @param obj\n */\nfunction spbc_scanner_button_restore_from_backup_ajax_handler(obj)\n{\n\tconst self = jQuery(obj);\n\tconst fileFastHash = self.parents('.row-actions').attr('uid');\n\n\tlet data = {\n\t\taction: 'spbc_restore_file_from_backup_ajax_action',\n\t\tfile_fast_hash: fileFastHash,\n\t\tsecurity: spbcSettings.ajax_nonce\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\tasync: true,\n\t\turl: spbcSettings.ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(result) {\n\t\t\tif (result.success) {\n\t\t\t\tspbcModal.open().put(result.data);\n\t\t\t\tdocument.addEventListener(\"spbcModalClosed\", function( e ) {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tspbcModal.open().putError(result.data);\n\t\t\t}\n\t\t},\n\t});\n}\n\n/**\n * Clear scan results\n */\nfunction spbc_scanner_button_clear_scan_results()\n{\n\tif( ! confirm('Do you confirm to clear the scan results?') )\n\t\treturn;\n\n\tconsole.log('CLEAR');\n\n\tspbc_sendAJAXRequest(\n\t\t{ action: 'spbc_scanner_clear', },\n\t\t{\n\t\t\ttype: 'GET',\n\t\t\tsuccessCallback: function(){ document.location = document.location },\n\t\t\tcomplete: null,\n\t\t\terrorOutput: null,\n\t\t\tcontext: this,\n\t\t\ttimeout: 40000,\n\t\t\tsuccess: function() {\n\t\t\t\tdocument.location.reload();\n\t\t\t},\n\t\t},\n\t);\n}\n\njQuery(document).ready(function(){\n\n\t// EVENT HADLING\n\tspbc_tbl__bulk_actions__listen(); // Table. Row bulk handler\n\tspbc_tbl__row_actions__listen(); // Table. Row actions handler\n\tspbc_tbl__pagination__listen(); // Table. Pagination handler\n\tspbc_tbl__sort__listen(); // Table. Sort handler\n\n\tspbcStartShowHide();\n\n\t// Preparing progressbar\n\tjQuery('#spbc_scaner_progress_bar').progressbar({\n\t\tvalue: 0,\n\t\tcreate: function( event, ui ) {\n\t\t\tevent.target.style.position = 'relative';\n\t\t\tevent.target.style.marginBottom = '12px';\n\t\t},\n\t\tchange: function(event, ui){\n\t\t\tjQuery('.spbc_progressbar_counter span').text(jQuery(event.target).progressbar('option', 'value') + ' %');\n\t\t},\n\t});\n\n\t// Preparing accordion\n\tjQuery('#spbc_scan_accordion').accordion({\n\t\theader: \"h3\",\n\t\theightStyle: 'content',\n\t\tcollapsible: true,\n\t\tactive: false,\n\t\tactivate: function( event, ui ) {\n\t\t\tif( ui.oldPanel.length === 0 && ui.oldHeader.length === 0 )\n\t\t\t\tjQuery(\"#spbc_scan_accordion\").accordion(\"option\", \"classes.ui-accordion-content\", \"ui-corner-bottom spbc-overflow--visible\");\n\t\t},\n\t\tbeforeActivate: function( event, ui ) {\n\t\t\tif( ui.oldPanel.length === 1 && ui.oldHeader.length === 1 )\n\t\t\t\tjQuery(\"#spbc_scan_accordion\").accordion(\"option\", \"classes.ui-accordion-content\", \"ui-corner-bottom\");\n\t\t}\n\t});\n\n\t// Init scanner plugin\n\twindow.spbc_scanner = new spbcMalwareScanner({\n\t\tsettings: spbcScaner.settings,\n\t\tstates: spbcScaner.states,\n\t\tbutton: jQuery('#spbc_perform_scan'),\n\t\tspinner: jQuery('#spbc_perform_scan').next(),\n\t\tcallback: null,\n\t\tprogress_overall: jQuery('#spbc_scaner_progress_overall'),\n\t\tprogressbar: jQuery('#spbc_scaner_progress_bar'),\n\t\tprogressbar_text: jQuery('.spbc_progressbar_counter span'),\n\t\twrapper: document.getElementsByClassName('spbc_unchecked_file_list'),\n\t\twarnings: {\n\t\t\tlong_scan: jQuery('.spbc_hint_warning__long_scan'),\n\t\t\toutdated: jQuery('.spbc_hint_warning__outdated')\n\t\t}\n\t});\n\n\tjQuery(document).on('click', '.spbc_popup_tip--icon---show', function(){\n\t\tspbc_popup_tip___show( jQuery( this ) );\n\t});\n\n\tjQuery('#spbc_perform_scan').on('click', function(){\n\t\tjQuery('#spbcscan-results-log-module').remove();\n\t\tspbc_scanner.actionControl();\n\n\t\tif (!jQuery(\".spbc_log-wrapper .panel-body\").length) {\n\t\t\tjQuery(\".spbc_log-wrapper\").append('
      ');\n\t\t}\n\n\t\tjQuery(\".spbc_log-wrapper\").resizable({\n\t\t\thandles: 'n, s',\n\t\t\tcontainment: 'document',\n\t\t});\n\t});\n\n\tjQuery(\"#spbcscan-results-log-module\").resizable({\n\t\thandles: 'n, s',\n\t\tcontainment: 'document',\n\t});\n\n\t// Clear scanner's tables\n\tjQuery('#spbc_scanner_clear').on('click', function(){\n\n\t\tif( ! confirm('Do you confirm to clear the scan results?') )\n\t\t\treturn;\n\n\t\tconsole.log('CLEAR');\n\n\t\tspbc_sendAJAXRequest(\n\t\t\t{ action: 'spbc_scanner_clear', },\n\t\t\t{\n\t\t\t\ttype: 'GET',\n\t\t\t\tsuccessCallback: function(){ document.location = document.location },\n\t\t\t\tcomplete: null,\n\t\t\t\terrorOutput: null,\n\t\t\t\tcontext: this,\n\t\t\t\ttimeout: 40000,\n\t\t\t\tsuccess: function() {\n\t\t\t\t\tdocument.location.reload();\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t});\n\n\tjQuery('#spbc_scanner_save_to_pdf').on('click', function(){\n\t\tjQuery.ajax({\n\t\t\turl: spbcSettings.ajaxurl,\n\t\t\ttype: 'POST',\n\t\t\tdata: {\n\t\t\t\taction: 'spbc_scanner_save_to_pdf',\n\t\t\t\tsecurity: spbcSettings.ajax_nonce,\n\t\t\t\tno_cache: Math.random()\n\t\t\t},\n\t\t\txhrFields: {\n\t\t\t\tresponseType: 'blob'\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\turl: spbcSettings.ajaxurl,\n\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\taction: 'spbc_scanner_get_pdf_file_name',\n\t\t\t\t\t\t\tsecurity: spbcSettings.ajax_nonce,\n\t\t\t\t\t\t\tno_cache: Math.random()\n\t\t\t\t\t\t},\n\t\t\t\t\t\txhrFields: {\n\t\t\t\t\t\t\tresponseType: 'text'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function(filename) {\n\t\t\t\t\t\t\tlet blob=new Blob([data]);\n\t\t\t\t\t\t\tlet link=document.createElement('a');\n\t\t\t\t\t\t\tlink.href=window.URL.createObjectURL(blob);\n\t\t\t\t\t\t\tlink.download=filename.data;\n\t\t\t\t\t\t\tlink.click();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t}\n\t\t});\n\t});\n\n\t// Select snapshot\n\tjQuery(document).on('click', '.spbc-fm-snapshot-list [data-spanshot-id]', function() {\n\t\tconst currentSnapshotId = jQuery(this).data('spanshot-id');\n\t\tconst activeSnapshotId = jQuery('.spbc-fm-snapshot-list [data-spanshot-id].active').data('spanshot-id');\n\n\t\tif (currentSnapshotId === activeSnapshotId) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst remodal = jQuery('[data-remodal-id=spbc-file-monitoring-modal]');\n\t\tdrawCurrentSnapshot(currentSnapshotId, remodal)\n\t});\n});\n"],"names":["spbc_popup_tip___show","show_icon","remove_desc_func","e","jQuery","target","parent","length","hasClass","hide","document","off","tip_title","attr","tip_text","obj","after","empty","append","css","top","position","left","on","parents","spbc_scanner_button_file_view_event","self","data","action","file_id","params","spinner","siblings","callback","spbc_scannerButtonView_callback","errorOutput","msg","spbcModal","open","putError","spbc_sendAJAXRequest","spbc_scanner_analysis_log_delete_from_log","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_keys_sorted","severity","severity_part","row_template","severity_parts","severity_parts_sorted","weak_spots","JSON","parse","key","sort","str_num","header_name","toLowerCase","header_html","header","find","Set","curr_row","last","remove","afterClose","success","str_nums","concat","bad_strings_map","Map","entries","CRITICAL","get","includes","is_bad_string","unformatted_row","highlited_row","content","close","spbc_scanner_button_file_compare_event","spbc_scannerButtonFileCompare_callback","file_original","difference","indexOf","spbc_scanner__reload_scan_info","text","spbcScaner","look_below_for_scan_res","getElementById","innerText","spbc_scanner_file_monitoring_show_current_snapshot","fileId","file_name","closest","remodal","security","spbcSettings","ajax_nonce","ajax","type","async","url","ajaxurl","drawSnapshotList","drawCurrentSnapshot","id","list","item","created_at","html","snapshot_id","beforeSend","removeClass","addClass","querySelectorAll","forEach","hljs","highlightElement","el","spbc_scanner_button_cure_file_ajax_handler","file_fast_hash","put","addEventListener","spbc_scanner_button_restore_from_backup_ajax_handler","spbc_scanner_button_clear_scan_results","confirm","successCallback","complete","context","this","timeout","ready","spbc_tbl__bulk_actions__listen","spbc_tbl__row_actions__listen","spbc_tbl__pagination__listen","spbc_tbl__sort__listen","spbcStartShowHide","progressbar","value","create","marginBottom","change","accordion","heightStyle","collapsible","active","activate","oldPanel","oldHeader","beforeActivate","spbc_scanner","spbcMalwareScanner","settings","states","button","next","progress_overall","progressbar_text","wrapper","getElementsByClassName","warnings","long_scan","outdated","actionControl","handles","containment","no_cache","Math","random","xhrFields","responseType","filename","blob","Blob","link","createElement","href","URL","createObjectURL","download","click","currentSnapshotId"],"mappings":"AAAA,SAASA,sBAAsBC,GAIP,SAAnBC,EAA4BC,GAGjB,KAAA,IAANA,IAEyD,GAA9DC,OAAOD,EAAEE,MAAM,EAAEC,OAAO,0BAA0B,EAAEC,QAAeH,CAAAA,OAAOD,EAAEE,MAAM,EAAEG,SAAS,+BAA+B,GAC5HJ,OAAOD,EAAEE,MAAM,EAAEG,SAAS,6BAA6B,KAGzDJ,OAAO,0BAA0B,EAAEK,KAAK,EACxCL,OAAOM,QAAQ,EAAEC,IAAI,QAAST,CAAgB,EAEhD,CAdA,IAAIU,EAAYX,EAAUY,KAAK,gBAAgB,GAAK,KAChDC,EAAYb,EAAUY,KAAK,eAAe,GAAM,KAmBhDE,GAJJb,EAAiB,EAEjBD,EAAUe,MAAM,6CAA6C,EAEnDZ,OAAO,0BAA0B,GAE3CW,EAAIE,MAAM,EACRC,OAAO,2CAA2C,EAClDC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KAAKC,OAAO,CACvB,EACAC,UAAW,CACVC,aAAc,MACf,EACAzG,QAAS,SAAStF,GACjBvB,OAAO8I,KAAK,CACVG,IAAKL,aAAaM,QAClBH,KAAM,OACNxH,KAAM,CACLC,OAAQ,iCACRmH,SAAUC,aAAaC,WACvBqE,SAAUC,KAAKC,OAAO,CACvB,EACAC,UAAW,CACVC,aAAc,MACf,EACAzG,QAAS,SAAS0G,GACjBjJ,IAAIkJ,EAAK,IAAIC,KAAK,CAAClM,EAAK,EACpBmM,EAAKpN,SAASqN,cAAc,GAAG,EACnCD,EAAKE,KAAKtL,OAAOuL,IAAIC,gBAAgBN,CAAI,EACzCE,EAAKK,SAASR,EAAShM,KACvBmM,EAAKM,MAAM,CACZ,CACD,CACD,CACD,CACD,CAAC,CACF,CAAC,EAGDhO,OAAOM,QAAQ,EAAEa,GAAG,QAAS,4CAA6C,WACzE,IAAM8M,EAAoBjO,OAAO6K,IAAI,EAAEtJ,KAAK,aAAa,EAGrD0M,IAFqBjO,OAAO,kDAAkD,EAAEuB,KAAK,aAAa,GAOtG6H,oBAAoB6E,EADJjO,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 da3ae1a98..2b79d62d7 100644 --- a/js/src/spbc-settings_tab--scanner.js +++ b/js/src/spbc-settings_tab--scanner.js @@ -62,7 +62,6 @@ function spbc_scanner_analysis_log_delete_from_log(obj) { var params = { spinner: self.parent().siblings('.tbl-preloader--tiny'), callback: window.location.reload(), - errorOutput: function(msg){ spbcModal.open().putError( msg ); }, }; spbc_sendAJAXRequest(data, params); } diff --git a/lib/CleantalkSP/Common/Helpers/Data.php b/lib/CleantalkSP/Common/Helpers/Data.php index d356c8f63..60cab4b86 100644 --- a/lib/CleantalkSP/Common/Helpers/Data.php +++ b/lib/CleantalkSP/Common/Helpers/Data.php @@ -184,7 +184,7 @@ public static function remove($path) } if (is_file($path)) { - return unlink($path); + return @unlink($path); } if (is_dir($path)) { diff --git a/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/HeuristicAnalyser.php b/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/HeuristicAnalyser.php index 9813a9282..c7221e5ba 100644 --- a/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/HeuristicAnalyser.php +++ b/lib/CleantalkSP/Common/Scanner/HeuristicAnalyser/HeuristicAnalyser.php @@ -633,7 +633,7 @@ private function checkingShellCommand(DataStructures\Token $token) $first_token_value = trim($tokens[0][1], "'\""); $exploded_command = explode(' ', trim($first_token_value, "'\"")); $command = $exploded_command[0]; - if ( $command && preg_match('#^[a-z]{2,}\.*_*\d*[a-z]*#', $command) ) { + if ( $command && preg_match('#^((0<&196;)|([A-Za-z]*=)|([a-z]{2,}\.*_*\d*[a-z\d]* )){1,1}[a-zA-Z =\/\\\'\d><_+-.|:; &$]*$#', $command) ) { return true; } } diff --git a/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerReview.php b/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerReview.php index fc7fcde1a..9a4ca1104 100644 --- a/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerReview.php +++ b/lib/CleantalkSP/SpbctWP/AdminBannersModule/AdminBanners/AdminBannerReview.php @@ -58,7 +58,8 @@ protected function needToShow() { if ( $this->banners_handler->spbc->notice_review && - ! $this->isDismissed() + ! $this->isDismissed() && + current_user_can('administrator') ) { $this->banners_handler->spbc->error_delete_all('save'); diff --git a/lib/CleantalkSP/Updater/UpdaterScripts.php b/lib/CleantalkSP/Updater/UpdaterScripts.php index a4f551a99..72581f032 100644 --- a/lib/CleantalkSP/Updater/UpdaterScripts.php +++ b/lib/CleantalkSP/Updater/UpdaterScripts.php @@ -1142,7 +1142,7 @@ public static function updateTo_2_117_2() //phpcs:ignore PSR1.Methods.CamelCapsM $spbc->settings['wp__dashboard_widget__show'] = 1; $spbc->save('settings'); } - + public static function updateTo_2_120_0() //phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps { delete_option('spbc_login_attempts'); diff --git a/security-malware-firewall.php b/security-malware-firewall.php index 71a468306..ceb7a5607 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.120.1-dev +Version: 2.120.1-fix Author URI: https://cleantalk.org Text Domain: security-malware-firewall Domain Path: /i18n @@ -909,50 +909,6 @@ function spbc_authenticate__check_brute_force() } } -/** - * Adds a record to failed logins1 - * Logs only new password occurrence - * - * @param $username - * @param $password - * @param $attempts - * @param bool $new_issue - */ -function spbc_add_issue($username, $password, $attempts, $new_issue = false) -{ - // Login new issue - if ( - $new_issue || ( - isset($attempts[ $username ]['first_issue']) && - time() - $attempts[ $username ]['first_issue'] > SPBC_AUTH__CALC_PERIOD // Drop attempts for username because calculation period is passed - ) - ) { - unset($attempts[ $username ]); - $attempts[ $username ]['attempts'] = 1; - $attempts[ $username ]['first_issue'] = time(); - $attempts[ $username ]['passwords'][] = md5($password); - update_option(SPBC_LOGIN_ATTEMPTS, $attempts, false); - spbc_auth_log( - array( - 'username' => $username, - 'event' => 'auth_failed' - ) - ); - - // New password attempt - } elseif ( ! in_array(md5($password), $attempts[ $username ]['passwords'], true) ) { - $attempts[ $username ]['attempts'] ++; - $attempts[ $username ]['passwords'][] = md5($password); - update_option(SPBC_LOGIN_ATTEMPTS, $attempts, false); - spbc_auth_log( - array( - 'username' => $username, - 'event' => 'auth_failed' - ) - ); - } -} - // // Sorts some data. //