Current File : /home/n742ef5/royalanteam.com/wp-content/plugins/security-malware-firewall/js/spbc-admin.min.js
function spbcGetGoogleQrCode(){var e={};let t={};return e.security=spbcSettings.ajax_nonce,e.action="spbc_get_google_qr_code",jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){t=e}}),t}function spbcCheckGoogleCode(){var e={};e.security=spbcSettings.ajax_nonce,e.action="spbc_check_google_code",e.code=jQuery("#spbct-google-qr-code input").val(),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){var t;e.success?(jQuery("#spbct-google-qr-code").dialog("close"),0<(t=jQuery("form#your-profile input#submit")).length&&t.click()):alert(e.data)}})}function spbcDisableG2fa(e){var t={};t.security=spbcSettings.ajax_nonce,t.action="spbc_disable_google_2fa",t.user_id=jQuery(e).data("user-id"),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:t,success:function(e){e.success?document.location.reload():alert(e.data)}})}function spbcCheckVulnerability(e,t="install"){var n={};n.security=spbcSettings.ajax_nonce,n.action="install"===t?"spbc_check_vulnerability_install":"spbc_check_vulnerability_list",n.list=e,jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:n,success:function(e){e.success?("install"===t&&spbcCheckVulnerabilityInstallRender(e.list,e.msg),"list"===t&&spbcCheckVulnerabilityListRender(e.list)):console.log(e)}})}function spbcCheckVulnerabilityListRender(e){let t,n;e.forEach(e=>{(n=document.createElement("div")).classList.add("notice","notice-error","error-message","spbc-vulnerable-notice"),n.innerHTML=e.msg,(t=document.querySelector(".themes .theme[data-slug="+e.slug+"]"))&&t.appendChild(n)})}function spbcCheckVulnerabilityInstallRender(e,t){let n,c=document.createElement("div");c.classList.add("notice"),c.innerHTML="<p>"+t+"</p>",e.forEach(e=>{(n=document.querySelector(".theme-id-container .theme-actions a[data-slug="+e+"]"))&&n.parentNode.parentNode.parentNode.appendChild(c)})}function spbcSummaryShowCDNCheckerTable(){event.preventDefault();var e=document.getElementById("spbc_stats_cdn_checker_table");void 0!==e&&("block"===e.style.display?e.style.display="none":e.style.display="block")}function spbcHandleBannersDismissing(){var e=jQuery("body");e.on("click",".spbct-notice-dismiss-link",function(e){jQuery(e.target).siblings(".notice-dismiss").click()}),e.on("click",".spbc-notice .notice-dismiss",function(c){var i,s,a=jQuery(c.target).parent(".notice").attr("id");if(a&&(spbcSendAJAXRequest({action:"spbc_dismiss_banner",banner_id:a},{}),"undefined"!=typeof spbcSettings)&&spbcSettings.hasOwnProperty("spbctNoticeDismissSuccess")){let e=spbcSettings.spbctNoticeDismissSuccess,t="",n="";if("string"==typeof e){try{e=JSON.parse(e)}catch(c){e=[]}for(var l of e)l.hasOwnProperty("bannerName")&&l.hasOwnProperty("postNoticeText")&&(i=l.bannerName,-1!==a.indexOf(i)&&(t=l.postNoticeText),l.hasOwnProperty("noticeLevel"))&&(n=l.noticeLevel)}""!==t&&(s='<div id="spbct-notice-dismiss-success" class="'+("notice "+n+" is-dismissible")+'"><p>'+t+"</p></div>",jQuery(c.target).parent(".notice").after(s),setTimeout(function(){jQuery("#spbct-notice-dismiss-success").fadeOut()},5e3))}})}function spbcHighlightCriticalFilesNotice(e=!1){var t=-1!==window.location.href.indexOf("spbc_tab=scanner&highlight_critical_files=1"),c=-1===window.location.href.indexOf("spbc_tab=scanner");if(e&&c)window.location.href="options-general.php?page=spbc&spbc_tab=scanner&highlight_critical_files=1";else if(t||e){let t=null;c=document.querySelectorAll("#notice_id_found_critical_files");if(0<c.length&&c.forEach(e=>{null==t&&null!==e.closest("#spbc_tab-scanner")&&(t=e)}),null!==t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),!t.hasOwnProperty("highlighted"))){let e=!1;setInterval(()=>{(e=!e)?(t.classList.remove("notice-warning"),t.classList.add("notice-error"),t.highlighted=!0):(t.classList.remove("notice-error"),t.classList.add("notice-warning"))},1e3)}let n=document.querySelector('h3[aria-controls="spbc_scan_accordion_tab_critical"]');if(null!==n)n.classList.contains("ui-accordion-header-active")||n.click();else{let e=setInterval(()=>{null!==(n=document.querySelector('h3[aria-controls="spbc_scan_accordion_tab_critical"]'))&&(n.classList.contains("ui-accordion-header-active")||n.click(),clearInterval(e))},150)}}}jQuery(document).ready(function(){if(-1<window.location.href.indexOf("themes.php")&&spbcSettings.vulnerabilityShowList){let e=[],t=[],n,c;setInterval(function(){0<(n=document.querySelectorAll(".themes .theme[data-slug]")).length&&(t=[],n.forEach(function(e){c=e.querySelector("img").src?e.querySelector("img").src.match(/ver=([\d\.]+)/)[1]:null,t.push({slug:e.dataset.slug,version:c})})),JSON.stringify(t)!=JSON.stringify(e)&&spbcCheckVulnerability(e=t,"list")},500)}if(-1<window.location.href.indexOf("theme-install.php")&&spbcSettings.vulnerabilityShowInstall){let e=[],t=[],n;setInterval(function(){0<(n=document.querySelectorAll(".theme-id-container .theme-actions a[data-slug]")).length&&(t=[],n.forEach(function(e){t.push(e.dataset.slug)})),JSON.stringify(t)!=JSON.stringify(e)&&spbcCheckVulnerability(e=t)},500)}jQuery(".spbc_update_notice").on("click","button",function(){spbcSetCookie("spbc_update_banner_closed",1,2592e3)}),jQuery(document).on("click","#spbc-g2fa-enable",function(e){e.preventDefault();e=spbcGetGoogleQrCode();e.success?(jQuery("#spbct-google-qr-code-img").html(e.data.img+"<p>"+e.data.code+"</p>"),jQuery("#spbct-google-qr-code input").val(""),jQuery("#spbct-google-qr-code").dialog({modal:!0,title:"Google authenticator activation",buttons:{Cancel:function(){jQuery(this).dialog("close")},Ok:function(){spbcCheckGoogleCode()}},draggable:!1,resizable:!1})):alert(spbcGetGoogleQrCode.data)}),jQuery(document).on("click","#spbc-g2fa-disable",function(e){e.preventDefault(),confirm("Are you sure?")&&spbcDisableG2fa(this)});function e(e,t,n){setTimeout(function(){null!==e&&(jQuery(".spbc-admin_bar--user_counter").html(e.count),e.count<=3?(jQuery("#wp-admin-bar-spbc_admin_bar__online_admins").show(),jQuery(".spbc-admin_bar--online_admins").html(e.users.join(", "))):jQuery("#wp-admin-bar-spbc_admin_bar__online_admins").hide()),spbcSendAJAXRequest(t,n)},15e3)}var t,n;if(1==+spbcSettings.admin_bar__admins_online_counter&&e(null,{action:"spbc_get_authorized_admins"},{callback:e}),spbcHandleBannersDismissing(),1==+spbcSettings.needToWhitelist&&spbcSendAJAXRequest({action:"spbc_private_list_add"},{callback:null}),0<+spbcSettings.critical&&((t=document.createElement("div")).className="spbc_ring-container",t.style.top="0px",t.style.right="70px",(n=document.createElement("div")).className="spbc_ringring",(c=document.createElement("div")).className="spbc_circle",t.appendChild(n),t.appendChild(c),n=document.querySelector("#menu-settings"))&&n.appendChild(t),jQuery(document).on("keyup","#spbc_key",function(e){e.preventDefault();e=jQuery("#spbc_key").val();/^[a-zA-Z0-9]+$/.test(e)&&8<e.length?(jQuery("#spbc-key-manually-link").hide(),jQuery("#spbc_setting_get_key_auto").hide(),jQuery("#spbc_get_key_or_text").hide()):(jQuery("#spbc-key-manually-link").show(),jQuery("#spbc_setting_get_key_auto").show(),jQuery("#spbc_get_key_or_text").show())}),spbcSettings.wl_mode_enabled){jQuery(".plugin-title strong").each(function(e,t){0<=jQuery(t).html().indexOf("Security by CleanTalk")&&jQuery(t).html(jQuery(t).html().replace("CleanTalk",spbcSettings.wl_company_name))});var c=jQuery('.plugin-update-tr[data-slug="security-malware-firewall"] .open-plugin-details-modal');let n=c.text().match(/version (\d+\.\d+)/i)?.[1];c.remove(),jQuery('.plugin-update-tr[data-slug="security-malware-firewall"] p').each(function(){var e=jQuery(`.plugin-update-tr[data-slug="security-malware-firewall"]
                a[aria-label="Update Security by CleanTalk now"]`),t="Update now to "+n;e.text(t),jQuery(this).text(jQuery(this).text().replace("  or ","")),jQuery(this).text(jQuery(this).text().replace(t+"."," ")),jQuery(this).append(e)})}});
//# sourceMappingURL=spbc-admin.min.js.map