diff --git a/js/spbc-admin.min.js b/js/spbc-admin.min.js index 54968d45..5f81e50d 100644 --- a/js/spbc-admin.min.js +++ b/js/spbc-admin.min.js @@ -1,2 +1,2 @@ -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){e.success?(jQuery("#spbct-google-qr-code").dialog("close"),document.location.reload()):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 c={};c.security=spbcSettings.ajax_nonce,c.action="install"===t?"spbc_check_vulnerability_install":"spbc_check_vulnerability_list",c.list=e,jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:c,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,c;e.forEach(e=>{(c=document.createElement("div")).classList.add("notice","notice-error","error-message","spbc-vulnerable-notice"),c.innerHTML=e.msg,(t=document.querySelector(".themes .theme[data-slug="+e.slug+"]"))&&t.appendChild(c)})}function spbcCheckVulnerabilityInstallRender(e,t){let c,n=document.createElement("div");n.classList.add("notice"),n.innerHTML="

"+t+"

",e.forEach(e=>{(c=document.querySelector(".theme-id-container .theme-actions a[data-slug="+e+"]"))&&c.parentNode.parentNode.parentNode.appendChild(n)})}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(n){var s,i,a=jQuery(n.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="",c="";if("string"==typeof e){try{e=JSON.parse(e)}catch(n){e=[]}for(var l of e)l.hasOwnProperty("bannerName")&&l.hasOwnProperty("postNoticeText")&&(s=l.bannerName,-1!==a.indexOf(s)&&(t=l.postNoticeText),l.hasOwnProperty("noticeLevel"))&&(c=l.noticeLevel)}""!==t&&(i='

'+t+"

",jQuery(n.target).parent(".notice").after(i),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"),n=-1===window.location.href.indexOf("spbc_tab=scanner");if(e&&n)window.location.href="options-general.php?page=spbc&spbc_tab=scanner&highlight_critical_files=1";else if(t||e){let t=null;n=document.querySelectorAll("#notice_id_found_critical_files");if(0{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 c=document.querySelector('h3[aria-controls="spbc_scan_accordion_tab_critical"]');if(null!==c)c.classList.contains("ui-accordion-header-active")||c.click();else{let e=setInterval(()=>{null!==(c=document.querySelector('h3[aria-controls="spbc_scan_accordion_tab_critical"]'))&&(c.classList.contains("ui-accordion-header-active")||c.click(),clearInterval(e))},150)}}}jQuery(document).ready(function(){if(-1"+e.data.code+"

"),jQuery("#spbct-google-qr-code input").val(""),jQuery("#spbct-google-qr-code").dialog({modal:!0,title:"Google authenticator activation",buttons:{Cancel:function(){jQuery(this).dialog("close")},Ok:function(){spbcCheckGoogleCode()}},draggable:!1,resizable:!1})):alert(spbcGetGoogleQrCode.data)}),jQuery(document).on("click","#spbc-g2fa-disable",function(e){e.preventDefault(),confirm("Are you sure?")&&spbcDisableG2fa(this)});function e(e,t,c){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,c)},15e3)}var t,c,n;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{(c=document.createElement("div")).classList.add("notice","notice-error","error-message","spbc-vulnerable-notice"),c.innerHTML=e.msg,(t=document.querySelector(".themes .theme[data-slug="+e.slug+"]"))&&t.appendChild(c)})}function spbcCheckVulnerabilityInstallRender(e,t){let c,n=document.createElement("div");n.classList.add("notice"),n.innerHTML="

"+t+"

",e.forEach(e=>{(c=document.querySelector(".theme-id-container .theme-actions a[data-slug="+e+"]"))&&c.parentNode.parentNode.parentNode.appendChild(n)})}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(n){var s,i,a=jQuery(n.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="",c="";if("string"==typeof e){try{e=JSON.parse(e)}catch(n){e=[]}for(var l of e)l.hasOwnProperty("bannerName")&&l.hasOwnProperty("postNoticeText")&&(s=l.bannerName,-1!==a.indexOf(s)&&(t=l.postNoticeText),l.hasOwnProperty("noticeLevel"))&&(c=l.noticeLevel)}""!==t&&(i='

'+t+"

",jQuery(n.target).parent(".notice").after(i),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"),n=-1===window.location.href.indexOf("spbc_tab=scanner");if(e&&n)window.location.href="options-general.php?page=spbc&spbc_tab=scanner&highlight_critical_files=1";else if(t||e){let t=null;n=document.querySelectorAll("#notice_id_found_critical_files");if(0{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 c=document.querySelector('h3[aria-controls="spbc_scan_accordion_tab_critical"]');if(null!==c)c.classList.contains("ui-accordion-header-active")||c.click();else{let e=setInterval(()=>{null!==(c=document.querySelector('h3[aria-controls="spbc_scan_accordion_tab_critical"]'))&&(c.classList.contains("ui-accordion-header-active")||c.click(),clearInterval(e))},150)}}}jQuery(document).ready(function(){if(-1"+e.data.code+"

"),jQuery("#spbct-google-qr-code input").val(""),jQuery("#spbct-google-qr-code").dialog({modal:!0,title:"Google authenticator activation",buttons:{Cancel:function(){jQuery(this).dialog("close")},Ok:function(){spbcCheckGoogleCode()}},draggable:!1,resizable:!1})):alert(spbcGetGoogleQrCode.data)}),jQuery(document).on("click","#spbc-g2fa-disable",function(e){e.preventDefault(),confirm("Are you sure?")&&spbcDisableG2fa(this)});function e(e,t,c){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,c)},15e3)}var t,c,n;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 {\n badge = document.createElement('div');\n badge.classList.add('notice', 'notice-error', 'error-message', 'spbc-vulnerable-notice');\n badge.innerHTML = el.msg;\n card = document.querySelector('.themes .theme[data-slug=' + el.slug + ']');\n if (card) {\n card.appendChild(badge);\n }\n });\n}\n\n/**\n * Check Vulnerability Install Render\n *\n * @param {object} list\n * @param {string} msg\n */\nfunction spbcCheckVulnerabilityInstallRender(list, msg) {\n let card;\n\n let badge = document.createElement('div');\n badge.classList.add('notice');\n badge.innerHTML = '

' + msg + '

';\n\n list.forEach((el) => {\n card = document.querySelector('.theme-id-container .theme-actions a[data-slug=' + el + ']');\n if (card) {\n card.parentNode.parentNode.parentNode.appendChild(badge);\n }\n });\n}\n\njQuery(document).ready(function() {\n if (window.location.href.indexOf('themes.php') > -1 && spbcSettings.vulnerabilityShowList) {\n let slugsState = [];\n let slugs = [];\n let slugsNodes;\n let version;\n\n setInterval(function() {\n slugsNodes = document.querySelectorAll('.themes .theme[data-slug]');\n\n if (slugsNodes.length > 0) {\n slugs = [];\n slugsNodes.forEach(function(el) {\n version = el.querySelector('img').src ?\n el.querySelector('img').src.match(/ver=([\\d\\.]+)/)[1] :\n null;\n slugs.push({'slug': el.dataset.slug, 'version': version});\n });\n }\n\n if (JSON.stringify(slugs) != JSON.stringify(slugsState)) {\n slugsState = slugs;\n spbcCheckVulnerability(slugs, 'list');\n }\n }, 500);\n }\n\n if (window.location.href.indexOf('theme-install.php') > -1 && spbcSettings.vulnerabilityShowInstall) {\n let slugsState = [];\n let slugs = [];\n let slugsNodes;\n\n setInterval(function() {\n slugsNodes = document.querySelectorAll('.theme-id-container .theme-actions a[data-slug]');\n\n if (slugsNodes.length > 0) {\n slugs = [];\n slugsNodes.forEach(function(el) {\n slugs.push(el.dataset.slug);\n });\n }\n\n if (JSON.stringify(slugs) != JSON.stringify(slugsState)) {\n slugsState = slugs;\n spbcCheckVulnerability(slugs);\n }\n }, 500);\n }\n\n // Auto update banner close handler\n jQuery('.spbc_update_notice').on('click', 'button', function() {\n spbcSetCookie('spbc_update_banner_closed', 1, 86400 * 30);\n });\n\n // Enable G2FA from user profile page\n jQuery(document).on('click', '#spbc-g2fa-enable', function(e) {\n e.preventDefault();\n let spbcGoogleQrCode = spbcGetGoogleQrCode();\n\n if ( spbcGoogleQrCode.success ) {\n let qrCodeDiv = jQuery('#spbct-google-qr-code-img');\n qrCodeDiv.html(spbcGoogleQrCode.data.img + '

' + spbcGoogleQrCode.data.code + '

');\n jQuery('#spbct-google-qr-code input').val('');\n jQuery('#spbct-google-qr-code').dialog({\n modal: true,\n title: 'Google authenticator activation',\n buttons: {\n Cancel: function() {\n jQuery( this ).dialog( 'close' );\n },\n Ok: function() {\n spbcCheckGoogleCode();\n },\n },\n draggable: false,\n resizable: false,\n });\n } else {\n alert(spbcGetGoogleQrCode.data);\n }\n });\n\n // Disable G2FA from user profile page\n jQuery(document).on('click', '#spbc-g2fa-disable', function(e) {\n e.preventDefault();\n if ( confirm( 'Are you sure?' ) ) {\n spbcDisableG2fa( this );\n }\n });\n\n let refreshUserOnlineCounter = function( result, data, params ) {\n setTimeout(function() {\n if ( result !== null ) {\n jQuery('.spbc-admin_bar--user_counter').html(result.count);\n if ( result.count <= 3 ) {\n jQuery('#wp-admin-bar-spbc_admin_bar__online_admins').show();\n jQuery('.spbc-admin_bar--online_admins').html(result.users.join(', '));\n } else {\n jQuery('#wp-admin-bar-spbc_admin_bar__online_admins').hide();\n }\n }\n spbcSendAJAXRequest( data, params );\n }, 15000 );\n };\n\n if ( +spbcSettings.admin_bar__admins_online_counter === 1 ) {\n refreshUserOnlineCounter(null, {action: 'spbc_get_authorized_admins'}, {callback: refreshUserOnlineCounter});\n }\n\n // Dismiss admin banner\n spbcHandleBannersDismissing();\n\n if (+spbcSettings.needToWhitelist === 1) {\n spbcSendAJAXRequest( {'action': 'spbc_private_list_add'}, {'callback': null} );\n }\n\n if ( +spbcSettings.critical > 0) {\n let ringContainer = document.createElement('div');\n ringContainer.className = 'spbc_ring-container';\n ringContainer.style.top = '0px';\n ringContainer.style.right = '70px';\n let ringRing = document.createElement('div');\n ringRing.className = 'spbc_ringring';\n let circle = document.createElement('div');\n circle.className = 'spbc_circle';\n\n ringContainer.appendChild(ringRing);\n ringContainer.appendChild(circle);\n\n let settings = document.querySelector('#menu-settings');\n if (settings) {\n settings.appendChild(ringContainer);\n }\n }\n\n jQuery(document).on('keyup', '#spbc_key', function(e) {\n e.preventDefault();\n let value = jQuery('#spbc_key').val();\n if (/^[a-zA-Z0-9]+$/.test(value) && value.length > 8) {\n jQuery('#spbc-key-manually-link').hide();\n jQuery('#spbc_setting_get_key_auto').hide();\n jQuery('#spbc_get_key_or_text').hide();\n } else {\n jQuery('#spbc-key-manually-link').show();\n jQuery('#spbc_setting_get_key_auto').show();\n jQuery('#spbc_get_key_or_text').show();\n }\n });\n\n if (spbcSettings['wl_mode_enabled']) {\n jQuery('.plugin-title strong').each( function(i, item) {\n if (jQuery(item).html().indexOf('Security by CleanTalk') >= 0) {\n jQuery(item).html(jQuery(item).html().replace('CleanTalk', spbcSettings['wl_company_name']));\n }\n });\n }\n});\n\n/**\n * Summary Show CDN Checker Table\n */\nfunction spbcSummaryShowCDNCheckerTable() {/* eslint-disable-line no-unused-vars */\n event.preventDefault();\n let table = document.getElementById('spbc_stats_cdn_checker_table');\n if (typeof (table) !== 'undefined') {\n if (table.style.display === 'block') {\n table.style.display = 'none';\n } else {\n table.style.display = 'block';\n }\n }\n}\n\n/**\n * Dismiss function for banners.\n */\nfunction spbcHandleBannersDismissing() {\n let body = jQuery('body');\n body.on('click', '.spbct-notice-dismiss-link', function(e) {\n jQuery(e.target).siblings('.notice-dismiss').click();\n });\n body.on('click', '.spbc-notice .notice-dismiss', function(e) {\n const bannerId = jQuery(e.target).parent('.notice').attr('id');\n if (bannerId) {\n // call ajax to dismiss banner anyway\n // todo There is no case when further API call for notice_review is unsuccessful,\n // todo but it should be handled in the future\n spbcSendAJAXRequest({'action': 'spbc_dismiss_banner', 'banner_id': bannerId}, {});\n\n // check if there is a postNoticeText to show after dismissing the notice\n if (\n typeof spbcSettings !== 'undefined' &&\n spbcSettings.hasOwnProperty('spbctNoticeDismissSuccess')\n ) {\n // get afterDismissingNotices from localized settings\n let afterDismissingNotices = spbcSettings.spbctNoticeDismissSuccess;\n // default postNoticeText\n let postNoticeText = '';\n // default notice level\n let noticeLevel = '';\n if (typeof afterDismissingNotices === 'string') {\n // try to parse JSON\n try {\n afterDismissingNotices = JSON.parse(afterDismissingNotices);\n } catch (e) {\n afterDismissingNotices = [];\n }\n // get postNoticeText and noticeLevel according to bannerName\n for (const afterDismissingNotice of afterDismissingNotices) {\n if (\n afterDismissingNotice.hasOwnProperty('bannerName') &&\n afterDismissingNotice.hasOwnProperty('postNoticeText')\n ) {\n let bannerName = afterDismissingNotice.bannerName;\n // if banner name is in the bannerId, show the postNoticeText\n if (bannerId.indexOf(bannerName) !== -1) {\n postNoticeText = afterDismissingNotice.postNoticeText;\n }\n // if noticeLevel is set, use it\n if (afterDismissingNotice.hasOwnProperty('noticeLevel')) {\n noticeLevel = afterDismissingNotice.noticeLevel;\n }\n }\n }\n }\n\n // if postNoticeText is set, show it\n if (postNoticeText !== '') {\n const noticeClassList = 'notice ' + noticeLevel + ' is-dismissible';\n let elem = '
' +\n '

' +\n postNoticeText +\n '

';\n jQuery(e.target)\n .parent('.notice')\n .after(elem);\n setTimeout(function() {\n jQuery('#spbct-notice-dismiss-success').fadeOut();\n }, 5000);\n }\n }\n }\n });\n}\n\n// eslint-disable-next-line no-unused-vars\n/**\n * Highlights the critical files notice if the URL contains specific parameters.\n *\n * @param {boolean} [isBannerCall=false] - Indicates if the function is called from a banner.\n *\n */\nfunction spbcHighlightCriticalFilesNotice(isBannerCall = false) { // eslint-disable-line no-unused-vars\n // Check if the URL contains the parameters to highlight the notice\n let needToHighlightNotice = window.location.href.indexOf('spbc_tab=scanner&highlight_critical_files=1') !== -1;\n let redirectConditionIsOK = window.location.href.indexOf('spbc_tab=scanner') === -1;\n\n // Redirect to the scanner tab if called from a banner and the condition is met\n if (isBannerCall && redirectConditionIsOK) {\n window.location.href = 'options-general.php?page=spbc&spbc_tab=scanner&highlight_critical_files=1';\n return;\n }\n\n // If the notice needs to be highlighted\n if (needToHighlightNotice || isBannerCall) {\n let criticalFilesNotice = null;\n let criticalFilesNotices = document.querySelectorAll('#notice_id_found_critical_files');\n\n // Find the critical files notice within the scanner tab\n if (criticalFilesNotices.length > 0) {\n criticalFilesNotices.forEach((notice) => {\n if (criticalFilesNotice == null) {\n if (notice.closest('#spbc_tab-scanner') !== null) {\n criticalFilesNotice = notice;\n }\n }\n });\n }\n // Scroll to the notice and highlight it with a blinking effect\n if (criticalFilesNotice !== null) {\n criticalFilesNotice.scrollIntoView({behavior: 'smooth', block: 'start'});\n if (!criticalFilesNotice.hasOwnProperty('highlighted')) {\n let switcher = false;\n setInterval(() => {\n switcher = !switcher;\n if (switcher) {\n criticalFilesNotice.classList.remove('notice-warning');\n criticalFilesNotice.classList.add('notice-error');\n criticalFilesNotice.highlighted = true;\n } else {\n criticalFilesNotice.classList.remove('notice-error');\n criticalFilesNotice.classList.add('notice-warning');\n }\n }, 1000);\n }\n }\n\n // Expand the critical files table if it exits and is collapsed\n let criticalFileTable = document.querySelector('h3[aria-controls=\"spbc_scan_accordion_tab_critical\"]');\n if (criticalFileTable !== null) {\n if (!criticalFileTable.classList.contains('ui-accordion-header-active')) {\n criticalFileTable.click();\n }\n } else {\n // Check periodically if the table is loaded and expand it\n const tabLoadingCheckInterval = setInterval(() => {\n criticalFileTable = document.querySelector('h3[aria-controls=\"spbc_scan_accordion_tab_critical\"]');\n if (criticalFileTable !== null) {\n if (!criticalFileTable.classList.contains('ui-accordion-header-active')) {\n criticalFileTable.click();\n }\n clearInterval(tabLoadingCheckInterval);\n }\n }, 150);\n }\n }\n}\n"],"names":["spbcGetGoogleQrCode","let","data","res","security","spbcSettings","ajax_nonce","action","jQuery","ajax","type","async","url","ajaxurl","success","result","spbcCheckGoogleCode","code","val","dialog","document","location","reload","alert","spbcDisableG2fa","element","user_id","spbcCheckVulnerability","list","spbcCheckVulnerabilityInstallRender","msg","spbcCheckVulnerabilityListRender","console","log","card","badge","forEach","createElement","classList","add","innerHTML","el","querySelector","slug","appendChild","parentNode","spbcSummaryShowCDNCheckerTable","event","preventDefault","table","getElementById","style","display","spbcHandleBannersDismissing","body","on","e","target","siblings","click","bannerName","elem","bannerId","parent","attr","spbcSendAJAXRequest","banner_id","hasOwnProperty","afterDismissingNotices","spbctNoticeDismissSuccess","postNoticeText","noticeLevel","JSON","parse","afterDismissingNotice","indexOf","after","setTimeout","fadeOut","spbcHighlightCriticalFilesNotice","isBannerCall","needToHighlightNotice","window","href","redirectConditionIsOK","criticalFilesNotice","criticalFilesNotices","querySelectorAll","length","notice","closest","scrollIntoView","behavior","block","switcher","setInterval","remove","highlighted","criticalFileTable","contains","tabLoadingCheckInterval","clearInterval","ready","vulnerabilityShowList","slugsState","slugs","slugsNodes","version","src","match","push","dataset","stringify","vulnerabilityShowInstall","spbcSetCookie","spbcGoogleQrCode","html","img","modal","title","buttons","Cancel","this","Ok","draggable","resizable","confirm","refreshUserOnlineCounter","params","count","show","users","join","hide","ringContainer","circle","settings","admin_bar__admins_online_counter","callback","needToWhitelist","critical","className","top","right","ringRing","value","test","each","i","item","replace"],"mappings":"AAKA,SAASA,sBACLC,IAAIC,EAAO,GACXD,IAAIE,EAAM,GAaV,OAZAD,EAAKE,SAAWC,aAAaC,WAC7BJ,EAAKK,OAAS,0BAEdC,OAAOC,KAAK,CACRC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKP,aAAaQ,QAClBX,KAAMA,EACNY,QAAS,SAASC,GACdZ,EAAMY,CACV,CACJ,CAAC,EACMZ,CACX,CAKA,SAASa,sBACLf,IAAIC,EAAO,GACXA,EAAKE,SAAWC,aAAaC,WAC7BJ,EAAKK,OAAS,yBACdL,EAAKe,KAAOT,OAAO,6BAA6B,EAAEU,IAAI,EAEtDV,OAAOC,KAAK,CACRC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKP,aAAaQ,QAClBX,KAAMA,EACNY,QAAS,SAASC,GACVA,EAAOD,SACPN,OAAO,uBAAuB,EAAEW,OAAQ,OAAQ,EAChDC,SA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spbc-admin.js"],"sourcesContent":["/**\n * Get Google Qr Code\n *\n * @return {object}\n */\nfunction spbcGetGoogleQrCode() {\n let data = {};\n let res = {};\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_get_google_qr_code';\n\n jQuery.ajax({\n type: 'POST',\n async: false,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\n res = result;\n },\n });\n return res;\n}\n\n/**\n * Check Google Code\n */\nfunction spbcCheckGoogleCode() {\n let data = {};\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_check_google_code';\n data.code = jQuery('#spbct-google-qr-code input').val();\n\n jQuery.ajax({\n type: 'POST',\n async: false,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\n if (result.success) {\n jQuery('#spbct-google-qr-code').dialog( 'close' );\n const submitButton = jQuery('form#your-profile input#submit');\n if (submitButton.length > 0) {\n submitButton.click();\n }\n } else {\n alert(result.data);\n }\n },\n });\n}\n\n/**\n * Disable Google 2fa\n *\n * @param {string} element\n */\nfunction spbcDisableG2fa( element ) {\n let data = {};\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_disable_google_2fa';\n data.user_id = jQuery(element).data('user-id');\n\n jQuery.ajax({\n type: 'POST',\n async: false,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\n if (result.success) {\n document.location.reload();\n } else {\n alert(result.data);\n }\n },\n });\n}\n\n/**\n * Check Vulnerability\n *\n * @param {array} list\n * @param {string} type\n */\nfunction spbcCheckVulnerability(list, type = 'install') {\n let data = {};\n data.security = spbcSettings.ajax_nonce;\n data.action = type === 'install' ? 'spbc_check_vulnerability_install' : 'spbc_check_vulnerability_list';\n data.list = list;\n\n jQuery.ajax({\n type: 'POST',\n async: false,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\n if (result.success) {\n if (type === 'install') {\n spbcCheckVulnerabilityInstallRender(result.list, result.msg);\n }\n if (type === 'list') {\n spbcCheckVulnerabilityListRender(result.list);\n }\n } else {\n console.log(result);\n }\n },\n });\n}\n\n/**\n * Check Vulnerability List Render\n *\n * @param {object} list\n * @param {string} msg\n */\nfunction spbcCheckVulnerabilityListRender(list) {\n let card;\n let badge;\n\n list.forEach((el) => {\n badge = document.createElement('div');\n badge.classList.add('notice', 'notice-error', 'error-message', 'spbc-vulnerable-notice');\n badge.innerHTML = el.msg;\n card = document.querySelector('.themes .theme[data-slug=' + el.slug + ']');\n if (card) {\n card.appendChild(badge);\n }\n });\n}\n\n/**\n * Check Vulnerability Install Render\n *\n * @param {object} list\n * @param {string} msg\n */\nfunction spbcCheckVulnerabilityInstallRender(list, msg) {\n let card;\n\n let badge = document.createElement('div');\n badge.classList.add('notice');\n badge.innerHTML = '

' + msg + '

';\n\n list.forEach((el) => {\n card = document.querySelector('.theme-id-container .theme-actions a[data-slug=' + el + ']');\n if (card) {\n card.parentNode.parentNode.parentNode.appendChild(badge);\n }\n });\n}\n\njQuery(document).ready(function() {\n if (window.location.href.indexOf('themes.php') > -1 && spbcSettings.vulnerabilityShowList) {\n let slugsState = [];\n let slugs = [];\n let slugsNodes;\n let version;\n\n setInterval(function() {\n slugsNodes = document.querySelectorAll('.themes .theme[data-slug]');\n\n if (slugsNodes.length > 0) {\n slugs = [];\n slugsNodes.forEach(function(el) {\n version = el.querySelector('img').src ?\n el.querySelector('img').src.match(/ver=([\\d\\.]+)/)[1] :\n null;\n slugs.push({'slug': el.dataset.slug, 'version': version});\n });\n }\n\n if (JSON.stringify(slugs) != JSON.stringify(slugsState)) {\n slugsState = slugs;\n spbcCheckVulnerability(slugs, 'list');\n }\n }, 500);\n }\n\n if (window.location.href.indexOf('theme-install.php') > -1 && spbcSettings.vulnerabilityShowInstall) {\n let slugsState = [];\n let slugs = [];\n let slugsNodes;\n\n setInterval(function() {\n slugsNodes = document.querySelectorAll('.theme-id-container .theme-actions a[data-slug]');\n\n if (slugsNodes.length > 0) {\n slugs = [];\n slugsNodes.forEach(function(el) {\n slugs.push(el.dataset.slug);\n });\n }\n\n if (JSON.stringify(slugs) != JSON.stringify(slugsState)) {\n slugsState = slugs;\n spbcCheckVulnerability(slugs);\n }\n }, 500);\n }\n\n // Auto update banner close handler\n jQuery('.spbc_update_notice').on('click', 'button', function() {\n spbcSetCookie('spbc_update_banner_closed', 1, 86400 * 30);\n });\n\n // Enable G2FA from user profile page\n jQuery(document).on('click', '#spbc-g2fa-enable', function(e) {\n e.preventDefault();\n let spbcGoogleQrCode = spbcGetGoogleQrCode();\n\n if ( spbcGoogleQrCode.success ) {\n let qrCodeDiv = jQuery('#spbct-google-qr-code-img');\n qrCodeDiv.html(spbcGoogleQrCode.data.img + '

' + spbcGoogleQrCode.data.code + '

');\n jQuery('#spbct-google-qr-code input').val('');\n jQuery('#spbct-google-qr-code').dialog({\n modal: true,\n title: 'Google authenticator activation',\n buttons: {\n Cancel: function() {\n jQuery( this ).dialog( 'close' );\n },\n Ok: function() {\n spbcCheckGoogleCode();\n },\n },\n draggable: false,\n resizable: false,\n });\n } else {\n alert(spbcGetGoogleQrCode.data);\n }\n });\n\n // Disable G2FA from user profile page\n jQuery(document).on('click', '#spbc-g2fa-disable', function(e) {\n e.preventDefault();\n if ( confirm( 'Are you sure?' ) ) {\n spbcDisableG2fa( this );\n }\n });\n\n let refreshUserOnlineCounter = function( result, data, params ) {\n setTimeout(function() {\n if ( result !== null ) {\n jQuery('.spbc-admin_bar--user_counter').html(result.count);\n if ( result.count <= 3 ) {\n jQuery('#wp-admin-bar-spbc_admin_bar__online_admins').show();\n jQuery('.spbc-admin_bar--online_admins').html(result.users.join(', '));\n } else {\n jQuery('#wp-admin-bar-spbc_admin_bar__online_admins').hide();\n }\n }\n spbcSendAJAXRequest( data, params );\n }, 15000 );\n };\n\n if ( +spbcSettings.admin_bar__admins_online_counter === 1 ) {\n refreshUserOnlineCounter(null, {action: 'spbc_get_authorized_admins'}, {callback: refreshUserOnlineCounter});\n }\n\n // Dismiss admin banner\n spbcHandleBannersDismissing();\n\n if (+spbcSettings.needToWhitelist === 1) {\n spbcSendAJAXRequest( {'action': 'spbc_private_list_add'}, {'callback': null} );\n }\n\n if ( +spbcSettings.critical > 0) {\n let ringContainer = document.createElement('div');\n ringContainer.className = 'spbc_ring-container';\n ringContainer.style.top = '0px';\n ringContainer.style.right = '70px';\n let ringRing = document.createElement('div');\n ringRing.className = 'spbc_ringring';\n let circle = document.createElement('div');\n circle.className = 'spbc_circle';\n\n ringContainer.appendChild(ringRing);\n ringContainer.appendChild(circle);\n\n let settings = document.querySelector('#menu-settings');\n if (settings) {\n settings.appendChild(ringContainer);\n }\n }\n\n jQuery(document).on('keyup', '#spbc_key', function(e) {\n e.preventDefault();\n let value = jQuery('#spbc_key').val();\n if (/^[a-zA-Z0-9]+$/.test(value) && value.length > 8) {\n jQuery('#spbc-key-manually-link').hide();\n jQuery('#spbc_setting_get_key_auto').hide();\n jQuery('#spbc_get_key_or_text').hide();\n } else {\n jQuery('#spbc-key-manually-link').show();\n jQuery('#spbc_setting_get_key_auto').show();\n jQuery('#spbc_get_key_or_text').show();\n }\n });\n\n if (spbcSettings['wl_mode_enabled']) {\n jQuery('.plugin-title strong').each( function(i, item) {\n if (jQuery(item).html().indexOf('Security by CleanTalk') >= 0) {\n jQuery(item).html(jQuery(item).html().replace('CleanTalk', spbcSettings['wl_company_name']));\n }\n });\n }\n});\n\n/**\n * Summary Show CDN Checker Table\n */\nfunction spbcSummaryShowCDNCheckerTable() {/* eslint-disable-line no-unused-vars */\n event.preventDefault();\n let table = document.getElementById('spbc_stats_cdn_checker_table');\n if (typeof (table) !== 'undefined') {\n if (table.style.display === 'block') {\n table.style.display = 'none';\n } else {\n table.style.display = 'block';\n }\n }\n}\n\n/**\n * Dismiss function for banners.\n */\nfunction spbcHandleBannersDismissing() {\n let body = jQuery('body');\n body.on('click', '.spbct-notice-dismiss-link', function(e) {\n jQuery(e.target).siblings('.notice-dismiss').click();\n });\n body.on('click', '.spbc-notice .notice-dismiss', function(e) {\n const bannerId = jQuery(e.target).parent('.notice').attr('id');\n if (bannerId) {\n // call ajax to dismiss banner anyway\n // todo There is no case when further API call for notice_review is unsuccessful,\n // todo but it should be handled in the future\n spbcSendAJAXRequest({'action': 'spbc_dismiss_banner', 'banner_id': bannerId}, {});\n\n // check if there is a postNoticeText to show after dismissing the notice\n if (\n typeof spbcSettings !== 'undefined' &&\n spbcSettings.hasOwnProperty('spbctNoticeDismissSuccess')\n ) {\n // get afterDismissingNotices from localized settings\n let afterDismissingNotices = spbcSettings.spbctNoticeDismissSuccess;\n // default postNoticeText\n let postNoticeText = '';\n // default notice level\n let noticeLevel = '';\n if (typeof afterDismissingNotices === 'string') {\n // try to parse JSON\n try {\n afterDismissingNotices = JSON.parse(afterDismissingNotices);\n } catch (e) {\n afterDismissingNotices = [];\n }\n // get postNoticeText and noticeLevel according to bannerName\n for (const afterDismissingNotice of afterDismissingNotices) {\n if (\n afterDismissingNotice.hasOwnProperty('bannerName') &&\n afterDismissingNotice.hasOwnProperty('postNoticeText')\n ) {\n let bannerName = afterDismissingNotice.bannerName;\n // if banner name is in the bannerId, show the postNoticeText\n if (bannerId.indexOf(bannerName) !== -1) {\n postNoticeText = afterDismissingNotice.postNoticeText;\n }\n // if noticeLevel is set, use it\n if (afterDismissingNotice.hasOwnProperty('noticeLevel')) {\n noticeLevel = afterDismissingNotice.noticeLevel;\n }\n }\n }\n }\n\n // if postNoticeText is set, show it\n if (postNoticeText !== '') {\n const noticeClassList = 'notice ' + noticeLevel + ' is-dismissible';\n let elem = '
' +\n '

' +\n postNoticeText +\n '

';\n jQuery(e.target)\n .parent('.notice')\n .after(elem);\n setTimeout(function() {\n jQuery('#spbct-notice-dismiss-success').fadeOut();\n }, 5000);\n }\n }\n }\n });\n}\n\n// eslint-disable-next-line no-unused-vars\n/**\n * Highlights the critical files notice if the URL contains specific parameters.\n *\n * @param {boolean} [isBannerCall=false] - Indicates if the function is called from a banner.\n *\n */\nfunction spbcHighlightCriticalFilesNotice(isBannerCall = false) { // eslint-disable-line no-unused-vars\n // Check if the URL contains the parameters to highlight the notice\n let needToHighlightNotice = window.location.href.indexOf('spbc_tab=scanner&highlight_critical_files=1') !== -1;\n let redirectConditionIsOK = window.location.href.indexOf('spbc_tab=scanner') === -1;\n\n // Redirect to the scanner tab if called from a banner and the condition is met\n if (isBannerCall && redirectConditionIsOK) {\n window.location.href = 'options-general.php?page=spbc&spbc_tab=scanner&highlight_critical_files=1';\n return;\n }\n\n // If the notice needs to be highlighted\n if (needToHighlightNotice || isBannerCall) {\n let criticalFilesNotice = null;\n let criticalFilesNotices = document.querySelectorAll('#notice_id_found_critical_files');\n\n // Find the critical files notice within the scanner tab\n if (criticalFilesNotices.length > 0) {\n criticalFilesNotices.forEach((notice) => {\n if (criticalFilesNotice == null) {\n if (notice.closest('#spbc_tab-scanner') !== null) {\n criticalFilesNotice = notice;\n }\n }\n });\n }\n // Scroll to the notice and highlight it with a blinking effect\n if (criticalFilesNotice !== null) {\n criticalFilesNotice.scrollIntoView({behavior: 'smooth', block: 'start'});\n if (!criticalFilesNotice.hasOwnProperty('highlighted')) {\n let switcher = false;\n setInterval(() => {\n switcher = !switcher;\n if (switcher) {\n criticalFilesNotice.classList.remove('notice-warning');\n criticalFilesNotice.classList.add('notice-error');\n criticalFilesNotice.highlighted = true;\n } else {\n criticalFilesNotice.classList.remove('notice-error');\n criticalFilesNotice.classList.add('notice-warning');\n }\n }, 1000);\n }\n }\n\n // Expand the critical files table if it exits and is collapsed\n let criticalFileTable = document.querySelector('h3[aria-controls=\"spbc_scan_accordion_tab_critical\"]');\n if (criticalFileTable !== null) {\n if (!criticalFileTable.classList.contains('ui-accordion-header-active')) {\n criticalFileTable.click();\n }\n } else {\n // Check periodically if the table is loaded and expand it\n const tabLoadingCheckInterval = setInterval(() => {\n criticalFileTable = document.querySelector('h3[aria-controls=\"spbc_scan_accordion_tab_critical\"]');\n if (criticalFileTable !== null) {\n if (!criticalFileTable.classList.contains('ui-accordion-header-active')) {\n criticalFileTable.click();\n }\n clearInterval(tabLoadingCheckInterval);\n }\n }, 150);\n }\n }\n}\n"],"names":["spbcGetGoogleQrCode","let","data","res","security","spbcSettings","ajax_nonce","action","jQuery","ajax","type","async","url","ajaxurl","success","result","spbcCheckGoogleCode","code","val","submitButton","dialog","length","click","alert","spbcDisableG2fa","element","user_id","document","location","reload","spbcCheckVulnerability","list","spbcCheckVulnerabilityInstallRender","msg","spbcCheckVulnerabilityListRender","console","log","card","badge","forEach","createElement","classList","add","innerHTML","el","querySelector","slug","appendChild","parentNode","spbcSummaryShowCDNCheckerTable","event","preventDefault","table","getElementById","style","display","spbcHandleBannersDismissing","body","on","e","target","siblings","bannerName","elem","bannerId","parent","attr","spbcSendAJAXRequest","banner_id","hasOwnProperty","afterDismissingNotices","spbctNoticeDismissSuccess","postNoticeText","noticeLevel","JSON","parse","afterDismissingNotice","indexOf","after","setTimeout","fadeOut","spbcHighlightCriticalFilesNotice","isBannerCall","needToHighlightNotice","window","href","redirectConditionIsOK","criticalFilesNotice","criticalFilesNotices","querySelectorAll","notice","closest","scrollIntoView","behavior","block","switcher","setInterval","remove","highlighted","criticalFileTable","contains","tabLoadingCheckInterval","clearInterval","ready","vulnerabilityShowList","slugsState","slugs","slugsNodes","version","src","match","push","dataset","stringify","vulnerabilityShowInstall","spbcSetCookie","spbcGoogleQrCode","html","img","modal","title","buttons","Cancel","this","Ok","draggable","resizable","confirm","refreshUserOnlineCounter","params","count","show","users","join","hide","ringContainer","circle","settings","admin_bar__admins_online_counter","callback","needToWhitelist","critical","className","top","right","ringRing","value","test","each","i","item","replace"],"mappings":"AAKA,SAASA,sBACLC,IAAIC,EAAO,GACXD,IAAIE,EAAM,GAaV,OAZAD,EAAKE,SAAWC,aAAaC,WAC7BJ,EAAKK,OAAS,0BAEdC,OAAOC,KAAK,CACRC,KAAM,OACNC,MAAO,CAAA,EACPC,IAAKP,aAAaQ,QAClBX,KAAMA,EACNY,QAAS,SAASC,GACdZ,EAAMY,CACV,CACJ,CAAC,EACMZ,CACX,CAKA,SAASa,sBACLf,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uBAAuB,EAAE2H,KAAK,EAE7C,CAAC,EAEG9H,aAA8B,iBAC9BG,OAAO,sBAAsB,EAAE4I,KAAM,SAASC,EAAGC,GACe,GAAxD9I,OAAO8I,CAAI,EAAEjC,KAAK,EAAExC,QAAQ,uBAAuB,GACnDrE,OAAO8I,CAAI,EAAEjC,KAAK7G,OAAO8I,CAAI,EAAEjC,KAAK,EAAEkC,QAAQ,YAAalJ,aAA8B,eAAC,CAAC,CAEnG,CAAC,CAET,CAAC"} \ No newline at end of file diff --git a/js/src/spbc-admin.js b/js/src/spbc-admin.js index cf67c202..0f967bf8 100644 --- a/js/src/spbc-admin.js +++ b/js/src/spbc-admin.js @@ -38,7 +38,10 @@ function spbcCheckGoogleCode() { success: function(result) { if (result.success) { jQuery('#spbct-google-qr-code').dialog( 'close' ); - document.location.reload(); + const submitButton = jQuery('form#your-profile input#submit'); + if (submitButton.length > 0) { + submitButton.click(); + } } else { alert(result.data); }