Files sent for analysis.
",jQuery("#spbc_scan_accordion_tab_critical").after(l+s),i.click())}setTimeout(function(){a.html(e).css({background:"inherit"}).find(".column-primary .row-actions .tbl-row_action--"+n.add_action).remove(),spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcStartShowHide()},5e3)}spbcBulkAction&&spbcBulkAction.click()}function spbcTblPaginationListen(){let n={action:"spbc_tbl-pagination"},a={callback:spbcTblPaginationCallback,notJson:!0};jQuery(".tbl-pagination--button").on("click",function(){jQuery(this).parents(".tbl-root").find(".tbl-pagination--button").attr("disabled","disabled")}),jQuery(".tbl-pagination--go").on("click",function(){var e=jQuery(this),t=e.parents(".tbl-root");n.page=e.siblings(".tbl-pagination--curr_page").val(),n.type=t.attr("type"),a.spinner=e.siblings(".tbl-preloader--small"),spbcSendAJAXRequest(n,a,t)}),jQuery(".tbl-pagination--prev").on("click",function(){var e=jQuery(this),t=e.parents(".tbl-root");n.page=e.parents(".tbl-pagination--wrapper").attr("prev_page"),n.type=t.attr("type"),a.spinner=e.siblings(".tbl-preloader--small"),spbcSendAJAXRequest(n,a,t)}),jQuery(".tbl-pagination--next").on("click",function(){var e=jQuery(this),t=e.parents(".tbl-root");n.page=e.parents(".tbl-pagination--wrapper").attr("next_page"),n.type=t.attr("type"),a.spinner=e.siblings(".tbl-preloader--small"),spbcSendAJAXRequest(n,a,t)}),jQuery(".tbl-pagination--end").on("click",function(){var e=jQuery(this),t=e.parents(".tbl-root");n.page=e.parents(".tbl-pagination--wrapper").attr("last_page"),n.type=t.attr("type"),a.spinner=e.siblings(".tbl-preloader--small"),spbcSendAJAXRequest(n,a,t)}),jQuery(".tbl-pagination--start").on("click",function(){var e=jQuery(this),t=e.parents(".tbl-root");n.page=1,n.type=t.attr("type"),a.spinner=e.siblings(".tbl-preloader--small"),spbcSendAJAXRequest(n,a,t)})}function spbcTblPaginationCallback(e,t,n,a){jQuery(a).html(e).find(".tbl-pagination--button").removeAttr("disabled"),spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen(),spbcStartShowHide()}function spbcTblSortListen(){let a={callback:spbcTblSortCallback,notJson:!0};jQuery(".tbl-column-sortable").on("click",function(e){var t,n;e.target.classList.contains("tbl-sorting_indicator")&&(n="links"==(t=(e=jQuery(this)).parents(".tbl-root")).attr("type")?jQuery("#spbc_tbl__scanner__outbound_links b").html():"",e={action:"spbc_tbl-sort",order_by:e.attr("id"),order:e.attr("sort_direction"),type:t.attr("type"),domain:n},spbcSendAJAXRequest(e,a,t))})}function spbcTblSortCallback(e,t,n,a){jQuery(a).html(e),spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen()}function spbcScannerSwitchTable(e,t){var e=jQuery(e),n=e.parents(".row-actions").attr("uid");spbcSendAJAXRequest({action:"spbc_tbl-switch",type:t,domain:n},{callback:spbcTblPaginationCallback,notJson:!0},e.parents(".tbl-root"))}function spbcShowHideRows(e,t){t=jQuery("."+t+"_block_"+e);t.hasClass("mob_table_active")?t.removeClass("mob_table_active"):t.addClass("mob_table_active")}function spbcUpdateEstimatedTime(){spbcUpdateTables(),setInterval(()=>{spbcUpdateTables()},6e4)}function spbcUpdateTables(e,t){var n={action:"spbc_settings__draw_elements",tab_name:"scanner",security:spbcSettings.ajax_nonce};spbcSendAJAXRequest(n,{callback:spbcViweUpdateEstimatedTime,notJson:!0,additional:t||null},e)}function spbcViweUpdateEstimatedTime(e){e=(new DOMParser).parseFromString(e,"text/html");let t=e.querySelectorAll("#spbc_tbl__scanner_analysis_log tbody tr"),i=document.querySelectorAll("#spbc_tbl__scanner_analysis_log tbody tr");(e=e.querySelector("#spbc_last_update_time"))&&e.innerText;i.forEach(e=>{if("Done"!==e.querySelector(".pscan_estimated_execution_time").innerText){let n,a,s,c;t.forEach(t=>{i.forEach(e=>{c=e.querySelector(".spbcFullText").innerText,t.querySelector(".spbcFullText").innerText==c&&(n=t.querySelector(".pscan_status").innerHTML,e.querySelector(".pscan_status").innerHTML=n,a=t.querySelector(".pscan_estimated_execution_time").innerHTML,e.querySelector(".pscan_estimated_execution_time").innerHTML=a,s=t.querySelector(".analysis_comment").innerHTML,e.querySelector(".analysis_comment").innerHTML=s)})})}}),spbcUpdatePscanCloudAnalysisInfo()}function spbcUpdatePscanCloudAnalysisInfo(){var e={action:"spbc_analysyis_files_stats__get_html",sub_action:"give_me_html",security:spbcSettings.ajax_nonce};spbcSendAJAXRequest(e,{callback:spbcViweUpdateAnalysisInfo,notJson:!0})}function spbcViweUpdateAnalysisInfo(e){var t=document.getElementById("spbc_analysis_files_stats");t&&(t.innerHTML=e)}jQuery(document).ready(function(){spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen(),spbcUpdateEstimatedTime()});
//# sourceMappingURL=spbc-table.min.js.map
diff --git a/js/spbc-table.min.js.map b/js/spbc-table.min.js.map
index c6d1d9bdb..5b25a81d6 100644
--- a/js/spbc-table.min.js.map
+++ b/js/spbc-table.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"spbc-table.min.js","sources":["spbc-table.js"],"sourcesContent":["let spbcBulkAction = null;\n\n/**\n * Reloads scanner accordion and set all the listeners\n */\nfunction spbcReloadAccordion() {\n spbcSendAJAXRequest(\n {action: 'spbc_scanner_tab__reload_accordion'},\n {\n notJson: true,\n callback: function(result, data, params, obj) {\n jQuery(obj).accordion('destroy');\n jQuery(obj).html(result);\n jQuery(obj).accordion({\n header: 'h3',\n heightStyle: 'content',\n collapsible: true,\n active: false,\n });\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n spbcStartShowHide();\n },\n },\n jQuery('#spbc_scan_accordion'),\n );\n}\n\n/**\n * Table bulk actions\n */\nfunction spbcTblBulkActionsListen() {\n jQuery('.tbl-bulk_actions-all--apply')\n .off('click')\n .on('click', function() {\n // @ToDo perhaps spbcScanner.active is not defined anywhere.\n // check this and implement `active` status in the right place\n if ( spbcScanner.active ) {\n alert(spbcTableLocalize.scannerIsActive);\n return;\n }\n\n let self = jQuery(this);\n let allowedBulkActions = [\n 'approve',\n 'disapprove',\n 'send',\n 'check_analysis_status',\n 'approve_page',\n 'disapprove_page',\n 'cure',\n 'delete_from_analysis_log',\n ];\n let action = self.siblings('select').children()[self.siblings('select').first()[0].selectedIndex].value;\n\n if ( allowedBulkActions.indexOf( action ) !== -1 ) {\n if (!confirm(spbcTable.warning_bulk)) {\n return;\n }\n\n let data = {\n action: 'spbc_tbl-action--bulk',\n add_action: action,\n status: self.parents('.tbl-root').attr('type'),\n };\n\n if (action === 'cure') {\n const selectedItems = self.closest('#spbc_tbl__scanner_cure_log').find('.cb-select');\n let selectedIds = [];\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n selectedIds.push(elementId);\n });\n data.selectedIds = selectedIds;\n }\n\n if (action === 'delete_from_analysis_log') {\n const selectedItems = self.closest('#spbc_tbl__scanner_analysis_log').find('.cb-select');\n let fileIds = [];\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n fileIds.push(elementId);\n });\n data.file_ids = fileIds;\n }\n\n let params = {\n button: this,\n spinner: self.children('.tbl-preloader--small'),\n callback: function(out) {\n spbcReloadAccordion();\n if ( action === 'check_analysis_status' && typeof out !== 'undefined') {\n let html = '
Analysis status updated.' +\n ' Total: ' + out.counters.total +\n ', updated: ' + out.counters.updated +\n ', skipped: ' + out.counters.skipped +\n ', failed: ' + out.counters.failed +\n ', queued: ' + out.counters.queued +\n '
';\n spbcModal.open().put( html );\n }\n if ( action === 'send' && typeof out !== 'undefined') {\n let html = '
Files have been sent: ' +\n out.files_sent_counter +\n '
';\n spbcModal.open().put(html);\n }\n },\n errorOutput: function( errorText, comment ) {\n if ( comment ) {\n errorText = errorText + '
' + comment;\n }\n spbcModal.open().putError( errorText );\n },\n timeout: 60000,\n };\n\n spbcSendAJAXRequest(data, params);\n } else {\n alert('This action is not supported for all files yet =(');\n }\n });\n\n jQuery('.tbl-bulk_actions--apply')\n .off('click')\n .on('click', function(e) {\n if (!spbcBulkAction && !confirm(spbcTable.warning_bulk)) {\n return;\n }\n\n let self = spbcBulkAction || jQuery(this);\n spbcBulkAction = self;\n let action = self.siblings('select').children()[self.siblings('select').first()[0].selectedIndex].value;\n\n if (action === 'cure') {\n spbcScannerCureSelected(jQuery(this));\n return;\n }\n\n if (action === 'delete_from_analysis_log') {\n spbcScannerAnalysisLogDeleteFromLog(jQuery(this));\n return;\n }\n\n if (action === 'allow' || action === 'ban') {\n let sendAction = action === 'ban' ? 'deny' : action;\n let items = self.parents('.tbl-root').find('.cb-select:checked');\n if (items) {\n self.children('.tbl-preloader--small').show();\n items.each(function() {\n let ip = jQuery(this).parents('tr').find('.tbl-row_action--'+action).data('ip');\n spbcSecLogsFilterIp(ip, sendAction, true);\n jQuery(this).prop('checked', false);\n });\n }\n self.children('.tbl-preloader--small').hide();\n let msg = action === 'allow' ? 'Allowed' : 'Banned';\n let html = '
Success. Selected IPs have been ' +\n msg +\n '. Changes will be applied within 10 minutes.' +\n '
';\n spbcModal.open().put( html );\n setTimeout(spbcReloadAccordion, 1900);\n\n return;\n }\n\n if ( action !== '-1' && self.parents('.tbl-root').find('.cb-select').is(':checked') ) {\n self.children('.tbl-preloader--small').show();\n // eslint-disable-next-line max-len\n if (self.parents('.tbl-root').find('.cb-select:checked').first().parents('tr').find('.tbl-row_action--'+action)[0]) {\n self\n .parents('.tbl-root')\n .find('.cb-select:checked')\n .first()\n .parents('tr')\n .find('.tbl-row_action--'+action)\n .click();\n self.parents('.tbl-root').find('.cb-select:checked').first().prop('checked', false);\n } else {\n self.parents('.tbl-root').find('.cb-select:checked').first().prop('checked', false);\n self.click();\n }\n } else {\n self.children('.tbl-preloader--small').hide();\n spbcBulkAction = null;\n if ( action === 'check_analysis_status' || action === 'disapprove' ) {\n let html = '
';\n spbcModal.open().put( html );\n }\n if ( action === 'send') {\n let html = '
';\n spbcModal.open().put( html );\n }\n setTimeout(spbcReloadAccordion, 1900);\n }\n });\n}\n\n/**\n * Cure selected files\n * @param {obj} current\n */\nfunction spbcScannerCureSelected(current) {\n const selectedItems = current.closest('#spbc_tbl__scanner_cure_log').find('.cb-select:checked');\n let selectedIds = [];\n\n if (selectedItems.length === 0) {\n alert('Please, select elements.');\n }\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n selectedIds.push(elementId);\n });\n\n const data = {\n action: 'spbc_cure_selected',\n security: spbcSettings.ajax_nonce,\n selectedIds: selectedIds,\n };\n jQuery.ajax({\n type: 'POST',\n url: spbcSettings.ajaxurl,\n data: data,\n beforeSend: function() {\n current\n .closest('#spbc_tbl__scanner_cure_log')\n .find('.tbl-button---white_blue .tbl-preloader--in_button')\n .show();\n },\n success: function(result) {\n current\n .closest('#spbc_tbl__scanner_cure_log')\n .find('.tbl-button---white_blue .tbl-preloader--in_button')\n .hide();\n if (result.success) {\n spbcModal.open().put(result.data);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n } else {\n spbcModal.open().putError(result.data);\n }\n },\n });\n}\n\n/**\n * Table row actions\n */\nfunction spbcTblRowActionsListen() {\n jQuery('.tbl-row_action--ajax')\n .off('click')\n .on('click', function() {\n console.log('spbcTblRowActionsListen click');\n if ( spbcScanner.active ) {\n alert(spbcTableLocalize.scannerIsActive);\n return;\n }\n let self = jQuery(this);\n let data = {\n action: 'spbc_tbl-action--row',\n add_action: self.attr('row-action'),\n id: self.parents('.row-actions').attr('uid'),\n cols: self.parents('.row-actions').attr('cols_amount'),\n page_url: self.parent().attr('uid'),\n page_id: self.parent().attr('page_id'),\n };\n let params = {\n callback: spbcTblRowActionsCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n };\n if (!spbcBulkAction) {\n let fileName = self.parent().parent()[0].firstChild.innerHTML;\n let confirmation = spbcTable['warning_'+self.attr('row-action')] || spbcTable.warning_default;\n // Without confirm\n if (\n data.add_action === 'copy_file_info' ||\n data.add_action === 'check_analysis_status'\n ) {\n spbcSendAJAXRequest(data, params, self.parents('tr'));\n\n // With confirm\n } else {\n spbcModal.open().confirm(confirmation, fileName, (confirmed) => {\n if (confirmed) {\n spbcSendAJAXRequest(data, params, self.parents('tr'));\n }\n });\n }\n }\n if (spbcBulkAction) {\n spbcSendAJAXRequest(data, params, self.parents('tr'));\n }\n });\n}\n\n/**\n * Callback for table row actions\n *\n * @param {obj|string} result\n * @param {obj} data\n * @param {obj} params\n * @param {obj} obj\n */\nfunction spbcTblRowActionsCallback(result, data, params, obj) {\n if (result.color) {\n obj.css({background: result.background, color: result.color});\n }\n if (result.html) {\n obj.parent().parent().parent().prepend(result.html);\n setTimeout(function() {\n obj.fadeOut(300);\n }, 1500);\n if ( ! spbcBulkAction) {\n setTimeout(spbcReloadAccordion, 1900);\n }\n }\n\n if (\n data.add_action === 'copy_file_info'\n ) {\n if (result.success === true && result.data.file_info) {\n window.\n prompt('Copy the file info below and send it to support@cleantalk.org: ', result.data.file_info);\n } else {\n let errorText = (typeof result.data.error !== 'undefined') ?\n result.data.error :\n 'Unknown copy_file_info error';\n spbcModal.open().putError( errorText );\n }\n }\n\n if (result.temp_html) {\n let tmp=obj.html();\n obj.html(result.temp_html);\n if (result.updated_template !== undefined) {\n let updatedType = result.updated_template_type;\n let template = result.updated_template;\n let rowsInTemplate = jQuery(template).find('.wp-list-table tbody tr');\n let countRowInTemplate = rowsInTemplate.length;\n let targetTab = jQuery('[aria-controls=\"spbc_scan_accordion_tab_' + updatedType + '\"]');\n\n if (targetTab.length > 0) {\n let table = jQuery('#spbc_tbl__scanner_' + updatedType);\n // Count files in header\n jQuery('.spbc_bad_type_count.' + updatedType + '_counter').text(countRowInTemplate);\n // Count rows in table\n let countExistingRows = table.find('.wp-list-table tbody tr').length;\n table.remove();\n jQuery('#spbc_scan_accordion_tab_' + updatedType).append(template);\n // Marked new rows\n jQuery(jQuery('#spbc_scan_accordion_tab_' + updatedType)\n .find('.wp-list-table tbody tr'))\n .each(function(index, element) {\n if (++index > countExistingRows) {\n jQuery(element).css('outline', '1px solid green');\n }\n });\n targetTab.click();\n } else {\n if (updatedType === 'analysis_log') {\n // eslint-disable-next-line max-len\n let tabHeaderTemplate = '';\n // eslint-disable-next-line max-len\n let tabBodyTemplate = '
Files sent for analysis.
' +\n template +\n '
';\n jQuery('#spbc_scan_accordion_tab_critical').after(tabHeaderTemplate + tabBodyTemplate);\n targetTab.click();\n }\n }\n }\n setTimeout(function() {\n obj\n .html(tmp)\n .css({background: 'inherit'})\n .find('.column-primary .row-actions .tbl-row_action--' + data.add_action)\n .remove();\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcStartShowHide();\n }, 5000);\n }\n if (spbcBulkAction) {\n spbcBulkAction.click();\n }\n}\n\n/**\n * Table pagination actions\n */\nfunction spbcTblPaginationListen() {\n let data = {action: 'spbc_tbl-pagination'};\n let params = {callback: spbcTblPaginationCallback, notJson: true};\n jQuery('.tbl-pagination--button').on('click', function() {\n jQuery(this).parents('.tbl-root').find('.tbl-pagination--button').attr('disabled', 'disabled');\n });\n jQuery('.tbl-pagination--go').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.siblings('.tbl-pagination--curr_page').val();\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--prev').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.parents('.tbl-pagination--wrapper').attr('prev_page');\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--next').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.parents('.tbl-pagination--wrapper').attr('next_page');\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--end').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.parents('.tbl-pagination--wrapper').attr('last_page');\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--start').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = 1;\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n}\n\n/**\n * Callback for Table pagination actions\n *\n * @param {obj|string} result\n * @param {obj} data\n * @param {obj} params\n * @param {obj} obj\n */\nfunction spbcTblPaginationCallback(result, data, params, obj) {\n jQuery(obj)\n .html(result)\n .find('.tbl-pagination--button').removeAttr('disabled');\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n spbcStartShowHide();\n}\n\n/**\n * Table sort actions\n */\nfunction spbcTblSortListen() {\n let params = {callback: spbcTblSortCallback, notJson: true};\n jQuery('.tbl-column-sortable').on('click', function(e) {\n if (e.target.classList.contains('tbl-sorting_indicator')) {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n let domain = obj.attr('type') == 'links'? jQuery('#spbc_tbl__scanner__outbound_links b').html(): '';\n let data = {\n action: 'spbc_tbl-sort',\n order_by: self.attr('id'),\n order: self.attr('sort_direction'),\n type: obj.attr('type'),\n domain: domain,\n };\n spbcSendAJAXRequest(data, params, obj);\n }\n });\n}\n\n/**\n * Callback for Table sort actions\n *\n * @param {obj|string} result\n * @param {obj} data\n * @param {obj} params\n * @param {obj} obj\n */\nfunction spbcTblSortCallback(result, data, params, obj) {\n jQuery(obj).html(result);\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n}\n\njQuery(document).ready(function() {\n // Table. Row actions handler\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n spbcUpdateEstimatedTime();\n});\n\n/**\n * Switching table handler\n * Using by inline php code\n *\n * @param {obj} obj\n * @param {obj} table\n *\n */\nfunction spbcScannerSwitchTable(obj, table) {/* eslint-disable-line no-unused-vars */\n let _obj = jQuery(obj);\n let domain = _obj.parents('.row-actions').attr('uid');\n let data = {action: 'spbc_tbl-switch', type: table, domain: domain};\n let params = {callback: spbcTblPaginationCallback, notJson: true};\n spbcSendAJAXRequest(data, params, _obj.parents('.tbl-root'));\n}\n\n/**\n * Open/close table rows handler\n * Using by inline php code\n *\n * @param {string} blockId\n * @param {string} columnKey\n */\nfunction spbcShowHideRows(blockId, columnKey) {/* eslint-disable-line no-unused-vars */\n let className = '.' + columnKey + '_block_' + blockId;\n let block = jQuery(className);\n if (block.hasClass('mob_table_active')) {\n block.removeClass('mob_table_active');\n } else {\n block.addClass('mob_table_active');\n }\n}\n\n/**\n * Update estimated time\n */\nfunction spbcUpdateEstimatedTime() {\n spbcUpdateTables();\n setInterval(() => {\n spbcUpdateTables();\n }, 60000);\n}\n\n/**\n * Update tables\n * @param {obj} tab\n * @param {obj} params\n */\nfunction spbcUpdateTables(tab, params) {\n let tabName = 'scanner';\n let data = {\n action: 'spbc_settings__draw_elements',\n tab_name: tabName,\n security: spbcSettings.ajax_nonce,\n };\n let currentParams = {\n callback: spbcViweUpdateEstimatedTime,\n notJson: true,\n additional: params || null,\n };\n spbcSendAJAXRequest( data, currentParams, tab );\n}\n\n/**\n * Update estimated time\n * @param {string} result\n */\nfunction spbcViweUpdateEstimatedTime(result) {\n const parser = new DOMParser();\n const newTables = parser.parseFromString(result, 'text/html');\n const newAnalysisRows = newTables.querySelectorAll('#spbc_tbl__scanner_analysis_log tbody tr');\n const currentAnalysisRows = document.querySelectorAll('#spbc_tbl__scanner_analysis_log tbody tr');\n let newLastUpdateTime = newTables.querySelector('#spbc_last_update_time');\n if (newLastUpdateTime) {\n newLastUpdateTime = newLastUpdateTime.innerText;\n }\n\n currentAnalysisRows.forEach((currentRow) => {\n if (currentRow.querySelector('.pscan_estimated_execution_time').innerText === 'Done') {\n return;\n }\n\n let status = '';\n let time = '';\n let comment = '';\n let text = '';\n newAnalysisRows.forEach((newRow) => {\n currentAnalysisRows.forEach((currentRow) => {\n text = currentRow.querySelector('.spbcFullText').innerText;\n if (newRow.querySelector('.spbcFullText').innerText == text) {\n status = newRow.querySelector('.pscan_status').innerHTML;\n currentRow.querySelector('.pscan_status').innerHTML = status;\n time = newRow.querySelector('.pscan_estimated_execution_time').innerHTML;\n currentRow.querySelector('.pscan_estimated_execution_time').innerHTML = time;\n comment = newRow.querySelector('.analysis_comment').innerHTML;\n currentRow.querySelector('.analysis_comment').innerHTML = comment;\n }\n });\n });\n });\n\n spbcUpdatePscanCloudAnalysisInfo();\n}\n\n/**\n * Update psacn cloud analysis info\n */\nfunction spbcUpdatePscanCloudAnalysisInfo() {\n let data = {\n action: 'spbc_analysyis_files_stats__get_html',\n sub_action: 'give_me_html',\n security: spbcSettings.ajax_nonce,\n };\n\n let params = {\n callback: spbcViweUpdateAnalysisInfo,\n notJson: true,\n };\n\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Update analysis info\n * @param {string} result\n */\nfunction spbcViweUpdateAnalysisInfo(result) {\n let info = document.getElementById('spbc_analysis_files_stats');\n\n if (info) {\n info.innerHTML = result;\n }\n}\n"],"names":["let","spbcBulkAction","spbcReloadAccordion","spbcSendAJAXRequest","action","notJson","callback","result","data","params","obj","jQuery","accordion","html","header","heightStyle","collapsible","active","spbcTblBulkActionsListen","spbcTblRowActionsListen","spbcTblPaginationListen","spbcTblSortListen","spbcStartShowHide","off","on","spbcScanner","alert","spbcTableLocalize","scannerIsActive","self","this","siblings","children","first","selectedIndex","value","indexOf","confirm","spbcTable","warning_bulk","add_action","status","parents","attr","selectedItems","closest","find","selectedIds","each","index","element","elementId","val","push","fileIds","file_ids","button","spinner","out","counters","total","updated","skipped","failed","queued","spbcModal","open","put","files_sent_counter","errorOutput","errorText","comment","putError","timeout","e","spbcScannerCureSelected","spbcScannerAnalysisLogDeleteFromLog","sendAction","items","msg","show","ip","spbcSecLogsFilterIp","prop","hide","setTimeout","is","click","current","length","security","spbcSettings","ajax_nonce","ajax","type","url","ajaxurl","beforeSend","success","document","addEventListener","location","reload","console","log","id","cols","page_url","parent","page_id","spbcTblRowActionsCallback","fileName","confirmation","firstChild","innerHTML","warning_default","confirmed","color","css","background","prepend","fadeOut","file_info","window","prompt","error","temp_html","tmp","undefined","updated_template","updatedType","updated_template_type","template","countRowInTemplate","targetTab","table","text","countExistingRows","remove","append","tabHeaderTemplate","tabBodyTemplate","after","spbcTblPaginationCallback","page","removeAttr","spbcTblSortCallback","domain","target","classList","contains","order_by","order","spbcScannerSwitchTable","_obj","spbcShowHideRows","blockId","columnKey","block","hasClass","removeClass","addClass","spbcUpdateEstimatedTime","spbcUpdateTables","setInterval","tab","tab_name","spbcViweUpdateEstimatedTime","additional","newTables","DOMParser","parseFromString","newAnalysisRows","querySelectorAll","currentAnalysisRows","newLastUpdateTime","querySelector","innerText","forEach","currentRow","time","newRow","spbcUpdatePscanCloudAnalysisInfo","sub_action","spbcViweUpdateAnalysisInfo","info","getElementById","ready"],"mappings":"AAAAA,IAAIC,eAAiB,KAKrB,SAASC,sBACLC,oBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,QAAS,CAAA,EACTC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACrCC,OAAOD,CAAG,EAAEE,UAAU,SAAS,EAC/BD,OAAOD,CAAG,EAAEG,KAAKN,CAAM,EACvBI,OAAOD,CAAG,EAAEE,UAAU,CAClBE,OAAQ,KACRC,YAAa,UACbC,YAAa,CAAA,EACbC,OAAQ,CAAA,CACZ,CAAC,EACDC,yBAAyB,EACzBC,wBAAwB,EACxBC,wBAAwB,EACxBC,kBAAkB,EAClBC,kBAAkB,CACtB,CACJ,EACAX,OAAO,sBAAsB,CACjC,CACJ,CAKA,SAASO,2BAC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cAAc,wBAAwB,IAEhDD,EAAkBE,UAG1CH,EAAoBI,QAAQ,IACxB,GAA8E,SAA1EC,EAAWH,cAAc,iCAAiC,EAAEC,UAAhE,CAIAjL,IAAIyC,EACA2I,EACA7G,EACAiE,EACJoC,EAAgBM,QAAQ,IACpBJ,EAAoBI,QAAQ,IACxB1C,EAAO2C,EAAWH,cAAc,eAAe,EAAEC,UAC7CI,EAAOL,cAAc,eAAe,EAAEC,WAAazC,IACnD/F,EAAS4I,EAAOL,cAAc,eAAe,EAAE9D,UAC/CiE,EAAWH,cAAc,eAAe,EAAE9D,UAAYzE,EACtD2I,EAAOC,EAAOL,cAAc,iCAAiC,EAAE9D,UAC/DiE,EAAWH,cAAc,iCAAiC,EAAE9D,UAAYkE,EACxE7G,EAAU8G,EAAOL,cAAc,mBAAmB,EAAE9D,UACpDiE,EAAWH,cAAc,mBAAmB,EAAE9D,UAAY3C,EAElE,CAAC,CACL,CAAC,CAlBD,CAmBJ,CAAC,EAED+G,iCAAiC,CACrC,CAKA,SAASA,mCACLtL,IAAIQ,EAAO,CACPJ,OAAQ,uCACRmL,WAAY,eACZ7F,SAAUC,aAAaC,UAC3B,EAOAzF,oBAAoBK,EALP,CACTF,SAAUkL,2BACVnL,QAAS,CAAA,CACb,CAEgC,CACpC,CAMA,SAASmL,2BAA2BjL,GAChCP,IAAIyL,EAAOtF,SAASuF,eAAe,2BAA2B,EAE1DD,IACAA,EAAKvE,UAAY3G,EAEzB,CA7IAI,OAAOwF,QAAQ,EAAEwF,MAAM,WAEnBzK,yBAAyB,EACzBC,wBAAwB,EACxBC,wBAAwB,EACxBC,kBAAkB,EAClB6I,wBAAwB,CAC5B,CAAC"}
\ No newline at end of file
+{"version":3,"file":"spbc-table.min.js","sources":["spbc-table.js"],"sourcesContent":["let spbcBulkAction = null;\n\n/**\n * Reloads scanner accordion and set all the listeners\n */\nfunction spbcReloadAccordion() {\n spbcSendAJAXRequest(\n {action: 'spbc_scanner_tab__reload_accordion'},\n {\n notJson: true,\n callback: function(result, data, params, obj) {\n jQuery(obj).accordion('destroy');\n jQuery(obj).html(result);\n jQuery(obj).accordion({\n header: 'h3',\n heightStyle: 'content',\n collapsible: true,\n active: false,\n });\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n spbcStartShowHide();\n },\n },\n jQuery('#spbc_scan_accordion'),\n );\n}\n\n/**\n * Table bulk actions\n */\nfunction spbcTblBulkActionsListen() {\n jQuery('.tbl-bulk_actions-all--apply')\n .off('click')\n .on('click', function() {\n // @ToDo perhaps spbcScanner.active is not defined anywhere.\n // check this and implement `active` status in the right place\n if ( spbcScanner.active ) {\n alert(spbcTableLocalize.scannerIsActive);\n return;\n }\n\n let self = jQuery(this);\n let allowedBulkActions = [\n 'approve',\n 'disapprove',\n 'send',\n 'check_analysis_status',\n 'approve_page',\n 'disapprove_page',\n 'cure',\n 'delete_from_analysis_log',\n ];\n let action = self.siblings('select').children()[self.siblings('select').first()[0].selectedIndex].value;\n\n if ( allowedBulkActions.indexOf( action ) !== -1 ) {\n if (!confirm(spbcTable.warning_bulk)) {\n return;\n }\n\n let data = {\n action: 'spbc_tbl-action--bulk',\n add_action: action,\n status: self.parents('.tbl-root').attr('type'),\n };\n\n if (action === 'cure') {\n const selectedItems = self.closest('#spbc_tbl__scanner_cure_log').find('.cb-select');\n let selectedIds = [];\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n selectedIds.push(elementId);\n });\n data.selectedIds = selectedIds;\n }\n\n if (action === 'delete_from_analysis_log') {\n const selectedItems = self.closest('#spbc_tbl__scanner_analysis_log').find('.cb-select');\n let fileIds = [];\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n fileIds.push(elementId);\n });\n data.file_ids = fileIds;\n }\n\n let params = {\n button: this,\n spinner: self.children('.tbl-preloader--small'),\n callback: function(out) {\n spbcReloadAccordion();\n if ( action === 'check_analysis_status' && typeof out !== 'undefined') {\n let html = '
Analysis status updated.' +\n ' Total: ' + out.counters.total +\n ', updated: ' + out.counters.updated +\n ', skipped: ' + out.counters.skipped +\n ', failed: ' + out.counters.failed +\n ', queued: ' + out.counters.queued +\n '
';\n spbcModal.open().put( html );\n }\n if ( action === 'send' && typeof out !== 'undefined') {\n let html = '
Files have been sent: ' +\n out.files_sent_counter +\n '
';\n spbcModal.open().put(html);\n }\n },\n errorOutput: function( errorText, comment ) {\n if ( comment ) {\n errorText = errorText + '
Additional information:
' + comment;\n }\n spbcModal.open().putError( errorText );\n },\n timeout: 60000,\n };\n\n spbcSendAJAXRequest(data, params);\n } else {\n alert('This action is not supported for all files yet =(');\n }\n });\n\n jQuery('.tbl-bulk_actions--apply')\n .off('click')\n .on('click', function(e) {\n if (!spbcBulkAction && !confirm(spbcTable.warning_bulk)) {\n return;\n }\n\n let self = spbcBulkAction || jQuery(this);\n spbcBulkAction = self;\n let action = self.siblings('select').children()[self.siblings('select').first()[0].selectedIndex].value;\n\n if (action === 'cure') {\n spbcScannerCureSelected(jQuery(this));\n return;\n }\n\n if (action === 'delete_from_analysis_log') {\n spbcScannerAnalysisLogDeleteFromLog(jQuery(this));\n return;\n }\n\n if (action === 'allow' || action === 'ban') {\n let sendAction = action === 'ban' ? 'deny' : action;\n let items = self.parents('.tbl-root').find('.cb-select:checked');\n if (items) {\n self.children('.tbl-preloader--small').show();\n items.each(function() {\n let ip = jQuery(this).parents('tr').find('.tbl-row_action--'+action).data('ip');\n spbcSecLogsFilterIp(ip, sendAction, true);\n jQuery(this).prop('checked', false);\n });\n }\n self.children('.tbl-preloader--small').hide();\n let msg = action === 'allow' ? 'Allowed' : 'Banned';\n let html = '
Success. Selected IPs have been ' +\n msg +\n '. Changes will be applied within 10 minutes.' +\n '
';\n spbcModal.open().put( html );\n setTimeout(spbcReloadAccordion, 1900);\n\n return;\n }\n\n if ( action !== '-1' && self.parents('.tbl-root').find('.cb-select').is(':checked') ) {\n self.children('.tbl-preloader--small').show();\n // eslint-disable-next-line max-len\n if (self.parents('.tbl-root').find('.cb-select:checked').first().parents('tr').find('.tbl-row_action--'+action)[0]) {\n self\n .parents('.tbl-root')\n .find('.cb-select:checked')\n .first()\n .parents('tr')\n .find('.tbl-row_action--'+action)\n .click();\n self.parents('.tbl-root').find('.cb-select:checked').first().prop('checked', false);\n } else {\n self.parents('.tbl-root').find('.cb-select:checked').first().prop('checked', false);\n self.click();\n }\n } else {\n self.children('.tbl-preloader--small').hide();\n spbcBulkAction = null;\n if ( action === 'check_analysis_status' || action === 'disapprove' ) {\n let html = '
All available files are updated.' + '
';\n spbcModal.open().put( html );\n }\n if ( action === 'send') {\n let html = '
All available files are sent.' + '
';\n spbcModal.open().put( html );\n }\n setTimeout(spbcReloadAccordion, 1900);\n }\n });\n}\n\n/**\n * Cure selected files\n * @param {obj} current\n */\nfunction spbcScannerCureSelected(current) {\n const selectedItems = current.closest('#spbc_tbl__scanner_cure_log').find('.cb-select:checked');\n let selectedIds = [];\n\n if (selectedItems.length === 0) {\n alert('Please, select elements.');\n }\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n selectedIds.push(elementId);\n });\n\n const data = {\n action: 'spbc_cure_selected',\n security: spbcSettings.ajax_nonce,\n selectedIds: selectedIds,\n };\n jQuery.ajax({\n type: 'POST',\n url: spbcSettings.ajaxurl,\n data: data,\n beforeSend: function() {\n current\n .closest('#spbc_tbl__scanner_cure_log')\n .find('.tbl-button---white_blue .tbl-preloader--in_button')\n .show();\n },\n success: function(result) {\n current\n .closest('#spbc_tbl__scanner_cure_log')\n .find('.tbl-button---white_blue .tbl-preloader--in_button')\n .hide();\n if (result.success) {\n spbcModal.open().put(result.data);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n } else {\n spbcModal.open().putError(result.data);\n }\n },\n });\n}\n\n/**\n * Table row actions\n */\nfunction spbcTblRowActionsListen() {\n jQuery('.tbl-row_action--ajax')\n .off('click')\n .on('click', function() {\n if ( spbcScanner.active ) {\n alert(spbcTableLocalize.scannerIsActive);\n return;\n }\n let self = jQuery(this);\n let data = {\n action: 'spbc_tbl-action--row',\n add_action: self.attr('row-action'),\n id: self.parents('.row-actions').attr('uid'),\n cols: self.parents('.row-actions').attr('cols_amount'),\n page_url: self.parent().attr('uid'),\n page_id: self.parent().attr('page_id'),\n };\n let params = {\n callback: spbcTblRowActionsCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n };\n if (!spbcBulkAction) {\n let fileName = self.parent().parent()[0].firstChild.innerHTML;\n let confirmation = spbcTable['warning_'+self.attr('row-action')] || spbcTable.warning_default;\n // Without confirm\n if (\n data.add_action === 'copy_file_info' ||\n data.add_action === 'check_analysis_status'\n ) {\n spbcSendAJAXRequest(data, params, self.parents('tr'));\n\n // With confirm\n } else {\n spbcModal.open().confirm(confirmation, fileName, (confirmed) => {\n if (confirmed) {\n spbcSendAJAXRequest(data, params, self.parents('tr'));\n }\n });\n }\n }\n if (spbcBulkAction) {\n spbcSendAJAXRequest(data, params, self.parents('tr'));\n }\n });\n}\n\n/**\n * Callback for table row actions\n *\n * @param {obj|string} result\n * @param {obj} data\n * @param {obj} params\n * @param {obj} obj\n */\nfunction spbcTblRowActionsCallback(result, data, params, obj) {\n if (result.color) {\n obj.css({background: result.background, color: result.color});\n }\n if (result.html) {\n obj.parent().parent().parent().prepend(result.html);\n setTimeout(function() {\n obj.fadeOut(300);\n }, 1500);\n if ( ! spbcBulkAction) {\n setTimeout(spbcReloadAccordion, 1900);\n }\n }\n\n if (\n data.add_action === 'copy_file_info'\n ) {\n if (result.success === true && result.data.file_info) {\n window.\n prompt('Copy the file info below and send it to support@cleantalk.org: ', result.data.file_info);\n } else {\n let errorText = (typeof result.data.error !== 'undefined') ?\n result.data.error :\n 'Unknown copy_file_info error';\n spbcModal.open().putError( errorText );\n }\n }\n\n if (result.temp_html) {\n let tmp=obj.html();\n obj.html(result.temp_html);\n if (result.updated_template !== undefined) {\n let updatedType = result.updated_template_type;\n let template = result.updated_template;\n let rowsInTemplate = jQuery(template).find('.wp-list-table tbody tr');\n let countRowInTemplate = rowsInTemplate.length;\n let targetTab = jQuery('[aria-controls=\"spbc_scan_accordion_tab_' + updatedType + '\"]');\n\n if (targetTab.length > 0) {\n let table = jQuery('#spbc_tbl__scanner_' + updatedType);\n // Count files in header\n jQuery('.spbc_bad_type_count.' + updatedType + '_counter').text(countRowInTemplate);\n // Count rows in table\n let countExistingRows = table.find('.wp-list-table tbody tr').length;\n table.remove();\n jQuery('#spbc_scan_accordion_tab_' + updatedType).append(template);\n // Marked new rows\n jQuery(jQuery('#spbc_scan_accordion_tab_' + updatedType)\n .find('.wp-list-table tbody tr'))\n .each(function(index, element) {\n if (++index > countExistingRows) {\n jQuery(element).css('outline', '1px solid green');\n }\n });\n targetTab.click();\n } else {\n if (updatedType === 'analysis_log') {\n // eslint-disable-next-line max-len\n let tabHeaderTemplate = '';\n // eslint-disable-next-line max-len\n let tabBodyTemplate = '
Files sent for analysis.
' +\n template +\n '
';\n jQuery('#spbc_scan_accordion_tab_critical').after(tabHeaderTemplate + tabBodyTemplate);\n targetTab.click();\n }\n }\n }\n setTimeout(function() {\n obj\n .html(tmp)\n .css({background: 'inherit'})\n .find('.column-primary .row-actions .tbl-row_action--' + data.add_action)\n .remove();\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcStartShowHide();\n }, 5000);\n }\n if (spbcBulkAction) {\n spbcBulkAction.click();\n }\n}\n\n/**\n * Table pagination actions\n */\nfunction spbcTblPaginationListen() {\n let data = {action: 'spbc_tbl-pagination'};\n let params = {callback: spbcTblPaginationCallback, notJson: true};\n jQuery('.tbl-pagination--button').on('click', function() {\n jQuery(this).parents('.tbl-root').find('.tbl-pagination--button').attr('disabled', 'disabled');\n });\n jQuery('.tbl-pagination--go').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.siblings('.tbl-pagination--curr_page').val();\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--prev').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.parents('.tbl-pagination--wrapper').attr('prev_page');\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--next').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.parents('.tbl-pagination--wrapper').attr('next_page');\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--end').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = self.parents('.tbl-pagination--wrapper').attr('last_page');\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n jQuery('.tbl-pagination--start').on('click', function() {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n data.page = 1;\n data.type = obj.attr('type');\n params.spinner = self.siblings('.tbl-preloader--small');\n spbcSendAJAXRequest(data, params, obj);\n });\n}\n\n/**\n * Callback for Table pagination actions\n *\n * @param {obj|string} result\n * @param {obj} data\n * @param {obj} params\n * @param {obj} obj\n */\nfunction spbcTblPaginationCallback(result, data, params, obj) {\n jQuery(obj)\n .html(result)\n .find('.tbl-pagination--button').removeAttr('disabled');\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n spbcStartShowHide();\n}\n\n/**\n * Table sort actions\n */\nfunction spbcTblSortListen() {\n let params = {callback: spbcTblSortCallback, notJson: true};\n jQuery('.tbl-column-sortable').on('click', function(e) {\n if (e.target.classList.contains('tbl-sorting_indicator')) {\n let self = jQuery(this);\n let obj = self.parents('.tbl-root');\n let domain = obj.attr('type') == 'links'? jQuery('#spbc_tbl__scanner__outbound_links b').html(): '';\n let data = {\n action: 'spbc_tbl-sort',\n order_by: self.attr('id'),\n order: self.attr('sort_direction'),\n type: obj.attr('type'),\n domain: domain,\n };\n spbcSendAJAXRequest(data, params, obj);\n }\n });\n}\n\n/**\n * Callback for Table sort actions\n *\n * @param {obj|string} result\n * @param {obj} data\n * @param {obj} params\n * @param {obj} obj\n */\nfunction spbcTblSortCallback(result, data, params, obj) {\n jQuery(obj).html(result);\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n}\n\njQuery(document).ready(function() {\n // Table. Row actions handler\n spbcTblBulkActionsListen();\n spbcTblRowActionsListen();\n spbcTblPaginationListen();\n spbcTblSortListen();\n spbcUpdateEstimatedTime();\n});\n\n/**\n * Switching table handler\n * Using by inline php code\n *\n * @param {obj} obj\n * @param {obj} table\n *\n */\nfunction spbcScannerSwitchTable(obj, table) {/* eslint-disable-line no-unused-vars */\n let _obj = jQuery(obj);\n let domain = _obj.parents('.row-actions').attr('uid');\n let data = {action: 'spbc_tbl-switch', type: table, domain: domain};\n let params = {callback: spbcTblPaginationCallback, notJson: true};\n spbcSendAJAXRequest(data, params, _obj.parents('.tbl-root'));\n}\n\n/**\n * Open/close table rows handler\n * Using by inline php code\n *\n * @param {string} blockId\n * @param {string} columnKey\n */\nfunction spbcShowHideRows(blockId, columnKey) {/* eslint-disable-line no-unused-vars */\n let className = '.' + columnKey + '_block_' + blockId;\n let block = jQuery(className);\n if (block.hasClass('mob_table_active')) {\n block.removeClass('mob_table_active');\n } else {\n block.addClass('mob_table_active');\n }\n}\n\n/**\n * Update estimated time\n */\nfunction spbcUpdateEstimatedTime() {\n spbcUpdateTables();\n setInterval(() => {\n spbcUpdateTables();\n }, 60000);\n}\n\n/**\n * Update tables\n * @param {obj} tab\n * @param {obj} params\n */\nfunction spbcUpdateTables(tab, params) {\n let tabName = 'scanner';\n let data = {\n action: 'spbc_settings__draw_elements',\n tab_name: tabName,\n security: spbcSettings.ajax_nonce,\n };\n let currentParams = {\n callback: spbcViweUpdateEstimatedTime,\n notJson: true,\n additional: params || null,\n };\n spbcSendAJAXRequest( data, currentParams, tab );\n}\n\n/**\n * Update estimated time\n * @param {string} result\n */\nfunction spbcViweUpdateEstimatedTime(result) {\n const parser = new DOMParser();\n const newTables = parser.parseFromString(result, 'text/html');\n const newAnalysisRows = newTables.querySelectorAll('#spbc_tbl__scanner_analysis_log tbody tr');\n const currentAnalysisRows = document.querySelectorAll('#spbc_tbl__scanner_analysis_log tbody tr');\n let newLastUpdateTime = newTables.querySelector('#spbc_last_update_time');\n if (newLastUpdateTime) {\n newLastUpdateTime = newLastUpdateTime.innerText;\n }\n\n currentAnalysisRows.forEach((currentRow) => {\n if (currentRow.querySelector('.pscan_estimated_execution_time').innerText === 'Done') {\n return;\n }\n\n let status = '';\n let time = '';\n let comment = '';\n let text = '';\n newAnalysisRows.forEach((newRow) => {\n currentAnalysisRows.forEach((currentRow) => {\n text = currentRow.querySelector('.spbcFullText').innerText;\n if (newRow.querySelector('.spbcFullText').innerText == text) {\n status = newRow.querySelector('.pscan_status').innerHTML;\n currentRow.querySelector('.pscan_status').innerHTML = status;\n time = newRow.querySelector('.pscan_estimated_execution_time').innerHTML;\n currentRow.querySelector('.pscan_estimated_execution_time').innerHTML = time;\n comment = newRow.querySelector('.analysis_comment').innerHTML;\n currentRow.querySelector('.analysis_comment').innerHTML = comment;\n }\n });\n });\n });\n\n spbcUpdatePscanCloudAnalysisInfo();\n}\n\n/**\n * Update psacn cloud analysis info\n */\nfunction spbcUpdatePscanCloudAnalysisInfo() {\n let data = {\n action: 'spbc_analysyis_files_stats__get_html',\n sub_action: 'give_me_html',\n security: spbcSettings.ajax_nonce,\n };\n\n let params = {\n callback: spbcViweUpdateAnalysisInfo,\n notJson: true,\n };\n\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Update analysis info\n * @param {string} result\n */\nfunction spbcViweUpdateAnalysisInfo(result) {\n let info = document.getElementById('spbc_analysis_files_stats');\n\n if (info) {\n info.innerHTML = result;\n }\n}\n"],"names":["let","spbcBulkAction","spbcReloadAccordion","spbcSendAJAXRequest","action","notJson","callback","result","data","params","obj","jQuery","accordion","html","header","heightStyle","collapsible","active","spbcTblBulkActionsListen","spbcTblRowActionsListen","spbcTblPaginationListen","spbcTblSortListen","spbcStartShowHide","off","on","spbcScanner","alert","spbcTableLocalize","scannerIsActive","self","this","siblings","children","first","selectedIndex","value","indexOf","confirm","spbcTable","warning_bulk","add_action","status","parents","attr","selectedItems","closest","find","selectedIds","each","index","element","elementId","val","push","fileIds","file_ids","button","spinner","out","counters","total","updated","skipped","failed","queued","spbcModal","open","put","files_sent_counter","errorOutput","errorText","comment","putError","timeout","e","spbcScannerCureSelected","spbcScannerAnalysisLogDeleteFromLog","sendAction","items","msg","show","ip","spbcSecLogsFilterIp","prop","hide","setTimeout","is","click","current","length","security","spbcSettings","ajax_nonce","ajax","type","url","ajaxurl","beforeSend","success","document","addEventListener","location","reload","id","cols","page_url","parent","page_id","spbcTblRowActionsCallback","fileName","confirmation","firstChild","innerHTML","warning_default","confirmed","color","css","background","prepend","fadeOut","file_info","window","prompt","error","temp_html","tmp","undefined","updated_template","updatedType","updated_template_type","template","countRowInTemplate","targetTab","table","text","countExistingRows","remove","append","tabHeaderTemplate","tabBodyTemplate","after","spbcTblPaginationCallback","page","removeAttr","spbcTblSortCallback","domain","target","classList","contains","order_by","order","spbcScannerSwitchTable","_obj","spbcShowHideRows","blockId","columnKey","block","hasClass","removeClass","addClass","spbcUpdateEstimatedTime","spbcUpdateTables","setInterval","tab","tab_name","spbcViweUpdateEstimatedTime","additional","newTables","DOMParser","parseFromString","newAnalysisRows","querySelectorAll","currentAnalysisRows","newLastUpdateTime","querySelector","innerText","forEach","currentRow","time","newRow","spbcUpdatePscanCloudAnalysisInfo","sub_action","spbcViweUpdateAnalysisInfo","info","getElementById","ready"],"mappings":"AAAAA,IAAIC,eAAiB,KAKrB,SAASC,sBACLC,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OpF,SAASqF,eAAe,2BAA2B,EAE1DD,IACAA,EAAKvE,UAAYzG,EAEzB,CA7IAI,OAAOwF,QAAQ,EAAEsF,MAAM,WAEnBvK,yBAAyB,EACzBC,wBAAwB,EACxBC,wBAAwB,EACxBC,kBAAkB,EAClB2I,wBAAwB,CAC5B,CAAC"}
\ No newline at end of file
diff --git a/js/src/spbc-admin.js b/js/src/spbc-admin.js
index 80b501cae..7361bad53 100644
--- a/js/src/spbc-admin.js
+++ b/js/src/spbc-admin.js
@@ -95,7 +95,7 @@ function spbcCheckVulnerability(list, type = 'install') {
spbcCheckVulnerabilityInstallRender(result.list, result.msg);
}
if (type === 'list') {
- spbcCheckVulnerabilityListRender(result.list, result.msg);
+ spbcCheckVulnerabilityListRender(result.list);
}
} else {
console.log(result);
@@ -110,15 +110,15 @@ function spbcCheckVulnerability(list, type = 'install') {
* @param {object} list
* @param {string} msg
*/
-function spbcCheckVulnerabilityListRender(list, msg) {
+function spbcCheckVulnerabilityListRender(list) {
let card;
let badge;
list.forEach((el) => {
badge = document.createElement('div');
badge.classList.add('notice', 'notice-error', 'error-message');
- badge.innerHTML = '
' + msg + '
';
- card = document.querySelector('.themes .theme[data-slug=' + el + ']');
+ badge.innerHTML = el.msg;
+ card = document.querySelector('.themes .theme[data-slug=' + el.slug + ']');
if (card) {
card.appendChild(badge);
}
@@ -162,7 +162,7 @@ jQuery(document).ready(function() {
version = el.querySelector('img').src ?
el.querySelector('img').src.match(/ver=([\d\.]+)/)[1] :
null;
- slugs.push(el.dataset.slug, version);
+ slugs.push({'slug': el.dataset.slug, 'version': version});
});
}
diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/ThemesListAlarmLayout.html b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/ThemesListAlarmLayout.html
new file mode 100644
index 000000000..e319ed544
--- /dev/null
+++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/ThemesListAlarmLayout.html
@@ -0,0 +1,4 @@
+
+
{{VULNERABILITY_TEXT}}
+
{{MORE_DETAILS_LINK}}
+
diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/VulnerabilityAlarmTab.html b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/VulnerabilityAlarmTab.html
index 676dfe0d5..841b96340 100644
--- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/VulnerabilityAlarmTab.html
+++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/VulnerabilityAlarmTab.html
@@ -2,22 +2,22 @@
{{VULNERABILITIES_SUBTITLE}}
{{OUTDATED_SUBTITLE}}
{{PSC_SUBTITLE}}
-
\ No newline at end of file
+
diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarm.php b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarm.php
index bd94401c1..2a844a82a 100755
--- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarm.php
+++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarm.php
@@ -41,13 +41,13 @@ public static function checkPluginVulnerability($plugin_slug, $plugin_version)
public static function checkThemesVulnerability($slugs)
{
- $theme_names = array();
- for ($i = 0; $i < count($slugs); $i++) {
- $arr_slug_and_version = [$slugs[$i++]];
- array_push($theme_names, $arr_slug_and_version);
+
+ $themes_data = array();
+ foreach ($slugs as $theme) {
+ $themes_data[] = array($theme['slug'], $theme['version']);
}
- return VulnerabilityAlarmService::getVulnerabilityThemes($theme_names);
+ return VulnerabilityAlarmService::getVulnerabilityThemes($themes_data);
}
public static function checkThemeVulnerability($theme_slug, $theme_version)
@@ -66,9 +66,9 @@ public static function showAlarm($plugin_file, $plugin_data)
return VulnerabilityAlarmView::showPluginAlarm($plugin_file, $plugin_data);
}
- public static function showThemeAlarm()
+ public static function showThemeAlarm($theme)
{
- return VulnerabilityAlarmView::showThemeAlarm();
+ return VulnerabilityAlarmView::showThemeAlarm($theme);
}
/**
diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php
index c9e2d3c6d..dee415c5a 100755
--- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php
+++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php
@@ -34,8 +34,11 @@ public static function setSummaryLogPluginsAndThemes($modules)
$spbc->scan_themes_info['themes_info_requested'] = count($modules['themes']);
if ($theme_is_vulnerable && is_array($theme_is_vulnerable)) {
- $spbc->scan_themes_info['names_vulnerable_themes'] = $theme_is_vulnerable; //
- $spbc->scan_themes_info['themes_found_with_known_vulnerabilities'] = count($theme_is_vulnerable);
+ $theme_names = array_map(function ($report) {
+ return $report->name;
+ }, $theme_is_vulnerable);
+ $spbc->scan_themes_info['names_vulnerable_themes'] = $theme_names; //
+ $spbc->scan_themes_info['themes_found_with_known_vulnerabilities'] = count($theme_names);
}
$spbc->save('scan_themes_info');
}
@@ -163,26 +166,26 @@ public static function checkTheme($theme_slug, $theme_version)
}
/**
- * @param array $theme_slug
+ * @param array $theme_slugs
*
* @return array
*/
- public static function getVulnerabilityThemes($theme_slug)
+ public static function getVulnerabilityThemes($theme_slugs)
{
try {
- $report = self::getReport(['themes' => $theme_slug]);
+ $report = self::getReport(['themes' => $theme_slugs]);
} catch (\Exception $_exception) {
- return $theme_slug;
+ return $theme_slugs;
}
- $list_vlnerability_themes = array();
+ $list_vulnerability_reports = array();
if (count($report->themes) > 0) {
- foreach ($report->themes as $theme_name) {
- if ($theme_name->app_status == 'vulnerable') {
- array_push($list_vlnerability_themes, $theme_name->slug);
+ foreach ($report->themes as $theme_report) {
+ if ($theme_report->app_status == 'vulnerable') {
+ $list_vulnerability_reports[] = $theme_report;
}
}
- return $list_vlnerability_themes;
+ return $list_vulnerability_reports;
}
return [];
}
diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php
index d6fde94da..8ad5db080 100755
--- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php
+++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php
@@ -53,10 +53,40 @@ public static function showPluginAlarm($plugin_file, $plugin_report)
return '
';
}
- public static function showThemeAlarm()
+ public static function showThemeAlarm($theme_report)
{
- $alarm_text = esc_html__('The theme contains known vulnerability', 'security-malware-firewall');
- return $alarm_text;
+ $slug = $theme_report->slug;
+ $id = $theme_report->id;
+ $alarm_text = esc_html__('This theme version contains a known vulnerability', 'security-malware-firewall');
+ $alarm_cve_url = $theme_report->CVE;
+ $delete_text = esc_html__('It is strongly recommended to delete the theme.', 'security-malware-firewall');
+ $update_text = esc_html__('Updating the theme to a version higher than ', 'security-malware-firewall');
+
+ $vulnerability_text = sprintf(
+ $alarm_text . ' ' . $alarm_cve_url . '. %s',
+ ! empty($theme_report->rs_app_version_max)
+ ? $update_text . $theme_report->rs_app_version_max . ' is strongly recommended.'
+ : $delete_text
+ );
+
+ $layout_file = __DIR__ . '/View/ThemesListAlarmLayout.html';
+
+ if ( file_exists($layout_file) ) {
+ $replaces = [
+ '{{SLUG}}' => esc_attr($slug),
+ '{{VULNERABILITY_TEXT}}' => wp_kses($vulnerability_text, 'post'),
+ '{{MORE_DETAILS_LINK}}' => static::getMoreDetailsLink($slug, $id)
+ ];
+ $layout = file_get_contents($layout_file);
+
+ foreach ($replaces as $place_holder => $replace) {
+ $layout = str_replace($place_holder, $replace, $layout);
+ }
+
+ return $layout;
+ }
+
+ return '
' . $vulnerability_text . '
';
}
public static function showSafeBadge($module_type, $plugin_slug, $plugin_id)
@@ -65,7 +95,7 @@ public static function showSafeBadge($module_type, $plugin_slug, $plugin_id)
if ($module_type === 'theme') {
$badge_text = esc_html__('Theme is safe', 'security-malware-firewall');
}
- $badge_description = esc_html__('CleanTalk Security team has been checked this module', 'security-malware-firewall');
+ $badge_description = esc_html__('The CleanTalk Security team has been checked this module', 'security-malware-firewall');
$layout_file = __DIR__ . '/View/PluginIsSafeBadge.html';
@@ -88,26 +118,26 @@ public static function showSafeBadge($module_type, $plugin_slug, $plugin_id)
}
/**
- * @param string $plugin_slug
- * @param string $plugin_id
+ * @param string $module_slug
+ * @param string $module_id
*
* @return string
*/
- private static function getMoreDetailsLink($plugin_slug = '', $plugin_id = '', $line_break = false)
+ private static function getMoreDetailsLink($module_slug = '', $module_id = '', $line_break = false)
{
$details_link = "https://research.cleantalk.org";
$line_break_layout = $line_break ? '
' : ' ';
- if ($plugin_slug && $plugin_id) {
- $details_link = esc_attr($details_link . '/reports/app/' . $plugin_slug . '#' . $plugin_id);
+ if ($module_slug && $module_id) {
+ $details_link = esc_attr($details_link . '/reports/app/' . $module_slug . '#' . $module_id);
}
return sprintf(
- esc_html__('Full report is %shere%s', 'security-malware-firewall'),
+ esc_html__('The full report is %shere%s.', 'security-malware-firewall'),
'
'
)
. $line_break_layout
. sprintf(
- esc_html__('Have questions? Ask us %shere%s', 'security-malware-firewall'),
+ esc_html__('Have questions? Ask us %shere%s.', 'security-malware-firewall'),
'