diff --git a/css/spbc-settings-media.min.css b/css/spbc-settings-media.min.css index f8296baed..76519faad 100644 --- a/css/spbc-settings-media.min.css +++ b/css/spbc-settings-media.min.css @@ -1 +1 @@ -@media screen and (max-width:782px){.spbc_manual_link,.spbc_page_header_info__state_block,.spbc_page_header_info_left_column,.spbc_page_header_info_right_column{width:100%}.spbc_page_header_info_common_wrapper{margin-bottom:15px}.spbc_page_buttons_wrapper{display:grid;gap:10px}.spbc_page_mob_info__about_block{display:block}.spbc_page_desktop_info__about_block,.wp-list-table tfoot{display:none}.spbc_long_text_field input[type=text]{width:auto}.spbc_setting__textarea{width:100%;height:150px}} \ No newline at end of file +@media screen and (max-width:782px){.spbc_manual_link,.spbc_page_header_info__state_block,.spbc_page_header_info_left_column,.spbc_page_header_info_right_column{width:100%}.spbc_page_header_info_common_wrapper{margin-bottom:15px}.spbc_page_buttons_wrapper{display:grid;gap:10px}.spbc_page_mob_info__about_block{display:block}.spbc_page_desktop_info__about_block,.wp-list-table tfoot{display:none}.spbc_long_text_field input[type=text]{width:auto}.spbc_setting__textarea{width:100%;height:150px}}@media screen and (max-width:900px){.spbc-quicknav--bar_wrapper{position:relative;top:0}.spbc-settings-general-wrapper{flex-direction:column-reverse}} \ No newline at end of file diff --git a/css/spbc-settings.min.css b/css/spbc-settings.min.css index 8c89fde88..427c79e4b 100644 --- a/css/spbc-settings.min.css +++ b/css/spbc-settings.min.css @@ -1 +1 @@ -.circle{border-radius:50%;align-items:center;justify-content:center;position:relative;background-color:#03A9F4;clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 0,50% 0,50% 50%,50% 50%)}.circle-inner{width:100%;height:100%;border-radius:50%;background:#f7f7f7;transform:scale(.7)}.circle--small{width:16px;height:16px}.circle--mid{width:30px;height:30px}.-animation--circle{animation:animation-circle 2s linear forwards}.-animation--30s{animation-duration:30s!important}.-animation--2min{animation-duration:120s!important}@keyframes animation-circle{12.5%{clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 0,0 0,50% 50%,50% 50%)}25%{clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 50%,0 50%,50% 50%,50% 50%)}37.5%{clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 100%,0 100%,50% 50%,50% 50%)}50%{clip-path:polygon(50% 0,100% 0,100% 100%,50% 100%,50% 100%,50% 100%,50% 100%,50% 50%,50% 50%)}62.5%{clip-path:polygon(50% 0,100% 0,100% 100%,100% 100%,100% 100%,100% 100%,100% 100%,50% 50%,50% 50%)}75%{clip-path:polygon(50% 0,100% 0,100% 50%,100% 50%,100% 50%,100% 50%,100% 50%,50% 50%,50% 50%)}87.5%{clip-path:polygon(50% 0,100% 0,100% 0,100% 0,100% 0,100% 0,100% 0,50% 50%,50% 50%)}100%{clip-path:polygon(50% 0,50% 0,50% 0,50% 0,50% 0,50% 0,50% 0,50% 50%,50% 50%)}}#confirmation-code--resend .circle{margin-left:5px;display:inline-block;vertical-align:text-bottom}.spbc---hidden,.spbc_waf_reason{display:none}#spbcTopWarning{margin-bottom:5px}#spbcTopWarning h3{margin:10px 0 5px}#spbcTopWarning h4{margin:10px}#spbcTopWarning h4 span{margin-top:5px}#spbc_gdpr_open_modal:hover{cursor:pointer}.spbc---gray{color:gray}.spbc---red{color:red}.spbc_bold{font-weight:800}.spbc---top{z-index:9999!important}.spbc_waf_reason_title{text-decoration:underline}.spbc_waf_reason_title:hover+.spbc_waf_reason{display:inline}.spbc_warning_counter{margin:0 5px;padding:0 7px;font-size:14px;height:23px;display:inline-block;text-align:center;border-radius:3px}.spbc_sub_setting{margin-left:30px!important}.spbc_sub2_setting{margin-left:60px!important}.spbc_affiliate_shortcode{width:inherit!important;min-width:inherit!important}.spbc_warning_counter--black{color:#fff;background-color:#000}.spbc_warning_counter--red{color:#000;background-color:red}.spbc_warning_counter--orange{color:#000;background-color:orange}.spbc_warning_counter--green{color:#000;background-color:green}.spbc_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.spbc_status_icon{vertical-align:text-bottom;margin:0 5px}.spbc_progressbar_counter{position:absolute;height:22px;width:100%;left:0;top:0;text-align:center}.spbc_progressbar_counter span{vertical-align:sub;line-height:22px;font-weight:600;font-size:18px}.spbc_preloader,.spbc_preloader_button{margin-left:5px;vertical-align:text-top;display:none}.spbc_compare_file_row_wrapper,.spbc_view_file_row,.spbc_view_file_row_wrapper{line-height:19px}.ui-progressbar-value{background-image:url(../images/pbar-ani.gif)!important}.spbc_preloader{width:20px}.spbc_preloader_button{height:15px}.spbc_spinner_big{display:block;margin:40px auto}.spbc_scan_result_row td{text-align:center}.spbc_scan_result_row td:nth-child(1){text-align:left}.spbc_scan_result_row td:nth-child(2){text-align:right}.spbc_scan_result_row td:last-child button{margin-left:3px}.spbc_view_file_row_wrapper:nth-child(odd){background:#ccc}.spbc_view_file_row_wrapper:nth-child(even){background:#ddd}.spbc_view_file_row_num{display:inline-block;width:30px;margin:0 0 0 5px;border-right:1px solid #000}.spbc_view_file_row{display:inline;margin:0 0 0 5px;font-size:1em;word-break:break-all}.spbc_compare_file_headings{text-align:center;width:100%;display:inline-block;font-weight:700}.spbc_compare_file_row_wrapper:nth-child(odd){background:#ccc}.spbc_compare_file_row_wrapper:nth-child(even){background:#ddd}.spbc_compare_file_row_num{display:inline-block;width:20px;box-shadow:-2px 0 0 0 #000,2px 0 0 0 #000;padding:0 1%}.spbc_compare_file_row{display:inline-block;width:45%;margin:0;padding:0 1%}table.spbc_table_general{width:100%;border:0;border-spacing:0;border-collapse:collapse}table.spbc_table_general td,table.spbc_table_general th{position:relative;border:1px solid #666;padding:2px 10px}.spbcShortText{display:inline-block;width:100%}.spbcFullText,.spbcFullText-right{display:none;position:absolute;background:rgba(150,150,150,.9);padding:7px;z-index:20;color:#fff}.spbcFullText{top:-5px;border:1px solid #333;border-radius:5px}.spbcFullText-right{top:0;right:0;border:1px solid #333;border-radius:5px}.spbcFullText a{color:#fff}.spbcFullText a:hover{color:#ddd}#spbc_scan_accordion .column-primary{position:initial}#spbc_scan_accordion tbody tr{position:relative}.spbc_accordion_category_wrapper{padding:0 5px 10px;border:1px solid #d3d3d3;border-radius:3px;margin-bottom:5px}.spbc_accordion_category_header{color:#026E88;font-weight:800;margin-left:10px!important}div.pagination{margin:10px}ul.pagination{display:inline-block;margin:0}li.pagination{display:inline-block;margin-left:10px}span.current_page{font-size:1.3em;font-weight:600}.spbc_new{color:red;position:relative;font-size:10px;vertical-align:bottom;top:-8px}.spbc_wrapper_settings{margin:10px 0 0}.spbc_page_header_info_common_wrapper{display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:1%}.spbc_page_header_info__block_label{top:3px;left:3px;position:relative;background:#f4f4f4;border:1px solid #DDD;border-radius:3px;padding:2px 5px;font-size:10px;color:gray}.spbc_page_header_info__block_body{border:1px solid #DDD;background:#f4f4f4;padding:1%}.spbc_page_header_info__block_row{overflow-wrap:anywhere;font-size:13px}.spbc_page_header_info_left_column{width:66%}.spbc_page_header_info__state_block{width:60%}.spbc_page_header_info_right_column{width:33%}.spbc_page_header_info__about_block{width:100%;height:auto}.spbc_page_header_info__about_block__divider{padding:5px}.spbc_page_header_info__error_block{width:100%}.spbc_page_buttons_wrapper{display:flex;margin-bottom:-10px}.spbc_page_buttons_header{display:inline-block;margin-right:7px}.spbc_page_mob_info__about_block{display:none}.spbc_tabs_nav_wrapper{display:flex;background-color:#fff;margin:15px 15px 0 0;overflow-x:auto}@media screen and (max-width:1200px){.spbc_tabs_nav_wrapper{flex-direction:column}}.spbc_tab_nav{display:inline-block;margin:10px 0 0 .5em;padding:5px 10px;height:24px;font-size:14px;line-height:24px;color:#555;cursor:pointer;font-weight:400}.spbc_tab_nav--active,.spbc_tab_nav:hover{margin-bottom:-1px;border-bottom:2px solid #026E88}.spbc_tab_nav svg{stroke:#000;stroke-width:.5}.spbc_tab_nav--active{color:#026E88;font-weight:800}.spbc_tab_nav--active svg{stroke:#026E88;stroke-width:1}.spbc_tab_nav-title{margin-left:5px;width:max-content}.spbc_tabs_nav_wrapper::-webkit-scrollbar{display:none}.spbc_tab{display:none;margin:0;background-color:#fff}.spbc_tab--active{display:block}.spbc_tab_fields_group{position:relative;min-width:255px;margin:10px auto;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fdfdfd}.spbc_group_header{margin:0 0 10px;padding:10px;border-bottom:1px solid #eee}.spbc_group_header>h3{margin:0}.spbc_group_header>h3>a{color:#1d2327;text-decoration:none}.spbc_wrapper_field{margin:0 15px 15px}.spbc_long_description__show:hover{color:#aaa;cursor:pointer}.spbc_settings_description{font-size:9pt;color:#888}.spbc_settings_description select{display:inline;position:relative;transform:scale(.7);left:-50px}.spbc_tab-settings_general input[type=text]{min-width:255px;width:100%}.spbc_short_text_field input{min-width:70px!important;width:70px!important}.spbc_middle_text_field input{min-width:200px!important;width:200px!important}.spbc_long_text_field input[type=text]{min-width:200px;width:500px}.spbc_wrapper_field label{vertical-align:baseline}.spbc_wrapper_field h4{margin:10px 15px 5px}.spbc_wrapper_footer{margin:15px}#spbc_wrapper_error{margin:0;padding:5px}#spbc_wrapper_error h3,#spbc_wrapper_error h4{margin:5px}#showHideLink{display:inline-block;margin-top:5px;color:#777}.spbc__wrapper--center{margin:10px 0;text-align:center}.spbc__show_more_logs{display:none}.spbc_settings_banner{display:inline-block;margin:1em 0;vertical-align:top;text-align:center}#spbc_translate_plugin{margin-left:10px}.spbc_rate_block{border:1px dashed #666;width:400px;padding:.2em}#spbc_translate_plugin .spbc_button_rate{margin-bottom:10px}.spbc_button_rate{display:inline-block;text-align:center;vertical-align:middle;padding:12px 24px;border:1px solid #216298;border-radius:8px;background:#35a0f7;background:-webkit-gradient(linear,left top,left bottom,from(#35a0f7),to(#216298));background:-moz-linear-gradient(top,#35a0f7,#216298);background:linear-gradient(to bottom,#35a0f7,#216298);text-shadow:#153e5f 1px 1px 1px;font:normal normal bold 16px verdana;color:#fff;text-decoration:none}.spbc_button_rate:focus,.spbc_button_rate:hover{border:1px solid #297bbe;background:#40c0ff;background:-webkit-gradient(linear,left top,left bottom,from(#40c0ff),to(#2876b6));background:-moz-linear-gradient(top,#40c0ff,#2876b6);background:linear-gradient(to bottom,#40c0ff,#2876b6);color:#fff;text-decoration:none}.spbc_button_rate:active{background:#216298;background:-webkit-gradient(linear,left top,left bottom,from(#216298),to(#216298));background:-moz-linear-gradient(top,#216298,#216298);background:linear-gradient(to bottom,#216298,#216298)}#spbc_rate_plugin .spbc_button_rate:before{content:"\0000a0";display:inline-block;height:24px;width:24px;line-height:24px;margin:0 4px -6px -4px;position:relative;top:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACjElEQVRIie1UTWsTURQ9dzKpofQLobQFlxqENF1JG0GE6sKuRLDtTKaBkJUIRdwpba2g9ge48gMEUUyTbrUutFmk1X6Q7kxDgi1YUSmlpsGYiTXtuy7GCYnaSRu3PczAfe/dd8695z0ecIAKsFVK0DQNLpcL8Xi8KgHZalFRNWe7uyMs2+RtkBQIjQerU/k3uVceHhmdyed/8NbWFg8OXrlXDY+020JdXf2NQMB/yuE4hHw+j5yur1df7h9QvQMXpiKRHSEECyF4cvJlQVG149VwlZ1BX58fsn1H7e29+OhMd7cEAMyM6PTMNAgfFUWrJSIAQgCAYAKIAECABACABGFt7fPPaDRqjItVqyrqG5vGAn7/kMfTBYMIyGQyeD0VMZKYweYGM2ZjpnR+eWVl8V08fnYiNP6t1Jbzc3PzbNryP38stsiKqp0uWuTz+eBqd9/s6uo02vpdPTOXxZuZDB7cfwgQGa0TIEmS7nA4PhhDkgBgdXV1FkTzRYHCtjjS4XZ3mGQmSsdEhKbGRqhqPwRz0ZOlRKImGBy/FA4F31gd8tG2tjaZmf+VUybS2tpaNpfeTMsADu+2xxRw2O12ENFftpTG6XQat26PQZIIzEA2m/1SKBSGGXhhWZmiaifezs7yfhGdnmFF1TqtuM0OksvvlzMnPZ4mq+RkMoVsNlu83ImlxDqATxUFwqHg94aGhsc9PeeuNjc372pRMpnExsZX5HI5xBZjd3aEuBsOBTcs7TGherXaa9eHIqlUioUQltYIIXhkZPT5XnjL7qXi1Wpkm6w5nccGWlpanLJNlkGQyEw1Pui6rs8tLFx+9vTJq30JlKK/3ycRCQkSFZ8Dcwszi4lwUOylgwNUxC8cBKAS7hIWzwAAAABJRU5ErkJggg==) left center no-repeat;background-size:100% 100%}.spbc_rate_block_stars{margin:1em 0}.star-icon{color:#ddd;font-size:18px;position:relative}.star-icon.full:before{color:#FDE16D;content:'\2605';position:absolute;left:0;text-shadow:0 0 2px rgba(0,0,0,.7)}.spbc_hint{color:#666}p.spbc_hint{margin:0}.spbc_hint_warning{font-size:17px;font-weight:600;text-align:center;color:#eb8f00}.spbc_hint--link{color:#aaa;text-decoration:underline;cursor:pointer}.spbc_hint--top_right{position:relative;float:right;top:0;right:10px}.spbc_auto_link{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:2px;border-radius:2px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.spbc_manual_link,.spbc_manual_link_scan{border-color:#026E88;display:inline-block;font-size:13px;line-height:26px;height:28px;padding:0 10px 1px;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;margin:0;text-decoration:none;cursor:pointer}.spbc_auto_link:hover{color:#fff}.spbc_manual_link_scan{color:#fff;background:#026E88;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);border-radius:3px;-webkit-border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.spbc_manual_link{background:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#026E88!important;border-radius:3px;-webkit-border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.spbc_manual_link:hover,button.ct_support_link{text-decoration:underline}.spbc_page_buttons_links_basic_align{display:flex;align-items:center;justify-content:center;gap:5px}.spbc-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#spbc-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}.spbc_long_desc,.spbc_popup_tip--wrapper{min-width:80px;min-height:80px;max-width:500px;padding:10px;z-index:10}.spbc_dismiss{width:20px;height:20px;border-radius:5px}.spbc-links:visited{color:#fff}.spbc_long_desc{position:absolute;background:#5a5a5a;color:#fff}@media screen and (max-width:900px){.spbc_long_desc{left:inherit!important}.spbc_long_desc__angle_top_left{display:none}}.spbc_long_desc p{color:#fff!important}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block;font-size:25px;line-height:20px;color:rgba(120,200,230,1);margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.spbc_long_desc__angle,.spbc_long_desc__angle_top_left{-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);position:absolute;width:10px;background:#5a5a5a}.spbc_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.spbc_long_desc__cancel:hover{color:#fff}.spbc_long_desc__link,.spbc_long_desc__title{color:rgba(120,200,230,1)}.spbc_long_desc__angle{top:5px;left:-17px;height:10px;transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.spbc_long_desc__angle_top_left{top:-10px;left:-9px;height:10px;transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.spbc_long_desc__title{margin:0}.spbc_long_desc__link:hover{color:rgba(140,220,250,1)}.spbc_long_desc h4{color:#50a0be;margin:10px 0 3px}.spbc_long_desc span{margin:0 0 0 10px;display:inline-block}.spbc_long_desc img{width:300px}.spbc_popup_tip--icon---show:hover{color:#aaa;cursor:pointer}.spbc_popup_tip--wrapper{position:absolute;background:#5a5a5a;color:#fff}.spbc_popup_tip--icon---cancel{position:absolute;top:0;right:5px;color:rgba(255,255,255,.5)}.spbc_popup_tip--icon---cancel:hover{color:#fff}.spbc_popup_tip--angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.spbc_popup_tip--title{color:rgba(120,200,230,1);margin:0}.spbc_popup_tip--text{color:#fff!important}tr:hover .spbc_hint--wrapper{display:none}.spbc_log-wrapper{padding:5px;border:1px solid #000;width:98%;min-height:300px;height:300px;border-bottom:5px dashed #5a5a5a}.spbc_log-wrapper .panel-body{height:100%;overflow-y:auto}.spbc_log-line{margin:0;padding:0 5px}.spbc_log-line:nth-child(odd){background:#d3d3d3}.spbc_log-block_header{margin:10px 0}.spbc_log-input--checkbox,.spbc_log-label--checkbox{width:auto}button.ct_support_link{border:none;background:0 0;color:#666;cursor:pointer}#spbc-modal-content{text-align:center}#spbc-modal-content>*{display:block;width:100%;margin:0}.spbc-modal-header{font-size:15px;font-weight:500}.spbc-modal-buttons-block{display:flex!important;gap:10px;justify-content:center}.spbc-modal-button{width:40%;height:35px;font-size:14px;font-weight:500;border:1px solid #60656b;background:#fff;border-radius:5px;cursor:pointer}.spbc-modal-button:hover{background:#2ea2cc;color:#fff;border:1px solid #2ea2cc}.spbc-modal-file_path{color:#026E88}.spbc-modal-file_path_wrapper{margin:4% 0 1%;padding:5px;border:1px solid #F5F5FD;border-radius:4px}.spbc-popup-msg{width:98%;height:15px;text-align:center;padding:4px;border-radius:7px;position:relative;top:0;right:0;bottom:0;left:0;margin:auto}.popup--green{background:#DFD;color:#060;border:1px solid #060}.popup--red{background:#FDD;color:#600;border:1px solid #600}#spbcscan-results-log-module{min-height:300px;height:300px;border-bottom:5px dashed #5a5a5a}#spbcscan-results-log-module .panel-body{height:100%;overflow-y:auto}#spbcscan-scanner-caption h4{margin:10px 0;font-size:14px}#spbcscan-results-log-caption p{font-size:13px;margin:0 0 6px}#spbcscan-scanner-caption{display:flex;flex-wrap:wrap;flex-direction:row-reverse}#spbcscan-scanner-caption .column:first-child{width:75%;flex:0 0 75%}#spbcscan-scanner-caption .column:last-child{width:25%;flex:0 0 25%;padding-right:10px;box-sizing:border-box}.spbc-scan-log-title{color:#1d2327;font-size:1.3em;margin:0 0 15px!important;font-weight:600}.spbc--status{position:relative;padding-left:26px}.spbc--marker-green::before,.spbc--marker-red::before,.spbc--marker-yellow::before{content:'';position:absolute;width:10px;height:10px;border-radius:50%;left:10px;top:4px}.spbc--marker-green::before{background:#1dda23}.spbc--marker-yellow::before{background:#ffb000}.spbc--marker-red::before{background:#d63638}button#spbc_setting_get_key_auto:disabled{background:#ccc;color:#111;text-decoration:none}.spbc_critical_updates-names{text-transform:uppercase;font-weight:500}.spbc_critical_updates-h_names{font-size:15px}.spbc_critical_updates-legend{border:1px solid #eee;padding:0 0 0 10px;margin:5px 0 0;color:#666}.spbc_critical_updates-no_vulnerabilities{color:green;font-size:15px;font-weight:500;margin:5px 0 0 30px}.spbct_notice{display:flex;justify-content:space-between}.spbct_notice-dismiss{position:relative;top:0;right:1px;border:none;margin:0;padding:9px;background:0 0;color:#787c82;cursor:pointer}.spbc_accordion_header_caption__update_status{display:inline-flex;flex-direction:row;flex-wrap:nowrap;width:45%;align-items:flex-end;justify-content:flex-end}.spbc_accordion_header_caption__updated{display:inline;color:#FFF;font-weight:700}.spbc_setting__textarea{width:400px;height:150px} \ No newline at end of file +.spbc_auto_link,.spbc_manual_link_scan{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;cursor:pointer}.circle{border-radius:50%;align-items:center;justify-content:center;position:relative;background-color:#03A9F4;clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 0,50% 0,50% 50%,50% 50%)}.circle-inner{width:100%;height:100%;border-radius:50%;background:#f7f7f7;transform:scale(.7)}.circle--small{width:16px;height:16px}.circle--mid{width:30px;height:30px}.-animation--circle{animation:animation-circle 2s linear forwards}.-animation--30s{animation-duration:30s!important}.-animation--2min{animation-duration:120s!important}@keyframes animation-circle{12.5%{clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 0,0 0,50% 50%,50% 50%)}25%{clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 50%,0 50%,50% 50%,50% 50%)}37.5%{clip-path:polygon(50% 0,100% 0,100% 100%,0 100%,0 100%,0 100%,0 100%,50% 50%,50% 50%)}50%{clip-path:polygon(50% 0,100% 0,100% 100%,50% 100%,50% 100%,50% 100%,50% 100%,50% 50%,50% 50%)}62.5%{clip-path:polygon(50% 0,100% 0,100% 100%,100% 100%,100% 100%,100% 100%,100% 100%,50% 50%,50% 50%)}75%{clip-path:polygon(50% 0,100% 0,100% 50%,100% 50%,100% 50%,100% 50%,100% 50%,50% 50%,50% 50%)}87.5%{clip-path:polygon(50% 0,100% 0,100% 0,100% 0,100% 0,100% 0,100% 0,50% 50%,50% 50%)}100%{clip-path:polygon(50% 0,50% 0,50% 0,50% 0,50% 0,50% 0,50% 0,50% 50%,50% 50%)}}#confirmation-code--resend .circle{margin-left:5px;display:inline-block;vertical-align:text-bottom}.spbc---hidden,.spbc_waf_reason{display:none}#spbcTopWarning{margin-bottom:5px}#spbcTopWarning h3{margin:10px 0 5px}#spbcTopWarning h4{margin:10px}#spbcTopWarning h4 span{margin-top:5px}#spbc_gdpr_open_modal:hover{cursor:pointer}.spbc---gray{color:gray}.spbc---red{color:red}.spbc_bold{font-weight:800}.spbc---top{z-index:9999!important}.spbc_waf_reason_title{text-decoration:underline}.spbc_waf_reason_title:hover+.spbc_waf_reason{display:inline}.spbc_warning_counter{margin:0 5px;padding:0 7px;font-size:14px;height:23px;display:inline-block;text-align:center;border-radius:3px}.spbc_sub_setting{margin-left:30px!important}.spbc_sub2_setting{margin-left:60px!important}.spbc_affiliate_shortcode{width:inherit!important;min-width:inherit!important}.spbc_warning_counter--black{color:#fff;background-color:#000}.spbc_warning_counter--red{color:#000;background-color:red}.spbc_warning_counter--orange{color:#000;background-color:orange}.spbc_warning_counter--green{color:#000;background-color:green}.spbc_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.spbc_status_icon{vertical-align:text-bottom;margin:0 5px}.spbc_progressbar_counter{position:absolute;height:22px;width:100%;left:0;top:0;text-align:center}.spbc_progressbar_counter span{vertical-align:sub;line-height:22px;font-weight:600;font-size:18px}.spbc_preloader,.spbc_preloader_button{margin-left:5px;vertical-align:text-top;display:none}.spbc_compare_file_row_wrapper,.spbc_view_file_row,.spbc_view_file_row_wrapper{line-height:19px}.ui-progressbar-value{background-image:url(../images/pbar-ani.gif)!important}.spbc_preloader{width:20px}.spbc_preloader_button{height:15px}.spbc_spinner_big{display:block;margin:40px auto}.spbc_scan_result_row td{text-align:center}.spbc_scan_result_row td:nth-child(1){text-align:left}.spbc_scan_result_row td:nth-child(2){text-align:right}.spbc_scan_result_row td:last-child button{margin-left:3px}.spbc_view_file_row_wrapper:nth-child(odd){background:#ccc}.spbc_view_file_row_wrapper:nth-child(even){background:#ddd}.spbc_auto_link,.spbc_compare_file_row_wrapper:nth-child(odd){background:#ccc}.spbc_view_file_row_num{display:inline-block;width:30px;margin:0 0 0 5px;border-right:1px solid #000}.spbc_view_file_row{display:inline;margin:0 0 0 5px;font-size:1em;word-break:break-all}.spbc_compare_file_headings{text-align:center;width:100%;display:inline-block;font-weight:700}.spbc_compare_file_row_wrapper:nth-child(even){background:#ddd}.spbc_compare_file_row_num{display:inline-block;width:20px;box-shadow:-2px 0 0 0 #000,2px 0 0 0 #000;padding:0 1%}.spbc_compare_file_row{display:inline-block;width:45%;margin:0;padding:0 1%}table.spbc_table_general{width:100%;border:0;border-spacing:0;border-collapse:collapse}table.spbc_table_general td,table.spbc_table_general th{position:relative;border:1px solid #666;padding:2px 10px}.spbcShortText{display:inline-block;width:100%}.spbcFullText,.spbcFullText-right{display:none;position:absolute;background:rgba(150,150,150,.9);padding:7px;z-index:20;color:#fff}.spbcFullText{top:-5px;border:1px solid #333;border-radius:5px}.spbcFullText-right{top:0;right:0;border:1px solid #333;border-radius:5px}.spbcFullText a{color:#fff}.spbcFullText a:hover{color:#ddd}#spbc_scan_accordion .column-primary{position:initial}#spbc_scan_accordion tbody tr{position:relative}.spbc_accordion_category_wrapper{padding:0 5px 10px;border:1px solid #d3d3d3;border-radius:3px;margin-bottom:5px}.spbc_accordion_category_header{color:#026E88;font-weight:800;margin-left:10px!important}div.pagination{margin:10px}ul.pagination{display:inline-block;margin:0}li.pagination{display:inline-block;margin-left:10px}span.current_page{font-size:1.3em;font-weight:600}.spbc_new{color:red;position:relative;font-size:10px;vertical-align:bottom;top:-8px}.spbc_wrapper_settings{margin:10px 0 0}.spbc_page_header_info_common_wrapper{display:flex;flex-wrap:wrap;justify-content:space-between;margin-bottom:1%}.spbc_page_header_info__block_label{top:3px;left:3px;position:relative;background:#f4f4f4;border:1px solid #DDD;border-radius:3px;padding:2px 5px;font-size:10px;color:gray}.spbc_page_header_info__block_body{border:1px solid #DDD;background:#f4f4f4;padding:1%}.spbc_page_header_info__block_row{overflow-wrap:anywhere;font-size:13px}.spbc_page_header_info_left_column{width:66%}.spbc_page_header_info__state_block{width:60%}.spbc_page_header_info_right_column{width:33%}.spbc_page_header_info__about_block{width:100%;height:auto}.spbc_page_header_info__about_block__divider{padding:5px}.spbc_page_header_info__error_block{width:100%}.spbc_page_buttons_wrapper{display:flex;margin-bottom:-10px}.spbc_page_buttons_header{display:inline-block;margin-right:7px}.spbc_page_mob_info__about_block{display:none}.spbc_tabs_nav_wrapper{display:flex;background-color:#fff;margin:15px 15px 0 0;overflow-x:auto}@media screen and (max-width:1200px){.spbc_tabs_nav_wrapper{flex-direction:column}}.spbc_tab_nav{display:inline-block;margin:10px 0 0 .5em;padding:5px 10px;height:24px;font-size:14px;line-height:24px;color:#555;cursor:pointer;font-weight:400}.spbc_tab_nav--active,.spbc_tab_nav:hover{margin-bottom:-1px;border-bottom:2px solid #026E88}.spbc_tab_nav svg{stroke:#000;stroke-width:.5}.spbc_tab_nav--active{color:#026E88;font-weight:800}.spbc_tab_nav--active svg{stroke:#026E88;stroke-width:1}.spbc_tab_nav-title{margin-left:5px;width:max-content}.spbc_tabs_nav_wrapper::-webkit-scrollbar{display:none}.spbc_tab{display:none;margin:0;background-color:#fff}.spbc_tab--active{display:block}.spbc_tab_fields_group{position:relative;min-width:255px;margin:10px auto;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fdfdfd}.spbc_group_header{margin:0 0 10px;padding:10px;border-bottom:1px solid #eee}.spbc_group_header>h3{margin:0}.spbc_group_header>h3>a{color:#1d2327;text-decoration:none}.spbc_wrapper_field{margin:0 15px 15px}.spbc_long_description__show:hover{color:#aaa;cursor:pointer}.spbc_settings_description{font-size:9pt;color:#888}.spbc_settings_description select{display:inline;position:relative;transform:scale(.7);left:-50px}.spbc_tab-settings_general input[type=text]{min-width:255px;width:100%}.spbc_short_text_field input{min-width:70px!important;width:70px!important}.spbc_middle_text_field input{min-width:200px!important;width:200px!important}.spbc_long_text_field input[type=text]{min-width:200px;width:500px}.spbc_wrapper_field label{vertical-align:baseline}.spbc_wrapper_field h4{margin:10px 15px 5px}.spbc_wrapper_footer{margin:15px}#spbc_wrapper_error{margin:0;padding:5px}#spbc_wrapper_error h3,#spbc_wrapper_error h4{margin:5px}#showHideLink{display:inline-block;margin-top:5px;color:#777}.spbc__wrapper--center{margin:10px 0;text-align:center}.spbc__show_more_logs{display:none}.spbc_settings_banner{display:inline-block;margin:1em 0;vertical-align:top;text-align:center}#spbc_translate_plugin{margin-left:10px}.spbc_rate_block{border:1px dashed #666;width:400px;padding:.2em}#spbc_translate_plugin .spbc_button_rate{margin-bottom:10px}.spbc_button_rate{display:inline-block;text-align:center;vertical-align:middle;padding:12px 24px;border:1px solid #216298;border-radius:8px;background:#35a0f7;background:-webkit-gradient(linear,left top,left bottom,from(#35a0f7),to(#216298));background:-moz-linear-gradient(top,#35a0f7,#216298);background:linear-gradient(to bottom,#35a0f7,#216298);text-shadow:#153e5f 1px 1px 1px;font:normal normal bold 16px verdana;color:#fff;text-decoration:none}.spbc_button_rate:focus,.spbc_button_rate:hover{border:1px solid #297bbe;background:#40c0ff;background:-webkit-gradient(linear,left top,left bottom,from(#40c0ff),to(#2876b6));background:-moz-linear-gradient(top,#40c0ff,#2876b6);background:linear-gradient(to bottom,#40c0ff,#2876b6);color:#fff;text-decoration:none}.spbc_button_rate:active{background:#216298;background:-webkit-gradient(linear,left top,left bottom,from(#216298),to(#216298));background:-moz-linear-gradient(top,#216298,#216298);background:linear-gradient(to bottom,#216298,#216298)}#spbc_rate_plugin .spbc_button_rate:before{content:"\0000a0";display:inline-block;height:24px;width:24px;line-height:24px;margin:0 4px -6px -4px;position:relative;top:0;left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACjElEQVRIie1UTWsTURQ9dzKpofQLobQFlxqENF1JG0GE6sKuRLDtTKaBkJUIRdwpba2g9ge48gMEUUyTbrUutFmk1X6Q7kxDgi1YUSmlpsGYiTXtuy7GCYnaSRu3PczAfe/dd8695z0ecIAKsFVK0DQNLpcL8Xi8KgHZalFRNWe7uyMs2+RtkBQIjQerU/k3uVceHhmdyed/8NbWFg8OXrlXDY+020JdXf2NQMB/yuE4hHw+j5yur1df7h9QvQMXpiKRHSEECyF4cvJlQVG149VwlZ1BX58fsn1H7e29+OhMd7cEAMyM6PTMNAgfFUWrJSIAQgCAYAKIAECABACABGFt7fPPaDRqjItVqyrqG5vGAn7/kMfTBYMIyGQyeD0VMZKYweYGM2ZjpnR+eWVl8V08fnYiNP6t1Jbzc3PzbNryP38stsiKqp0uWuTz+eBqd9/s6uo02vpdPTOXxZuZDB7cfwgQGa0TIEmS7nA4PhhDkgBgdXV1FkTzRYHCtjjS4XZ3mGQmSsdEhKbGRqhqPwRz0ZOlRKImGBy/FA4F31gd8tG2tjaZmf+VUybS2tpaNpfeTMsADu+2xxRw2O12ENFftpTG6XQat26PQZIIzEA2m/1SKBSGGXhhWZmiaifezs7yfhGdnmFF1TqtuM0OksvvlzMnPZ4mq+RkMoVsNlu83ImlxDqATxUFwqHg94aGhsc9PeeuNjc372pRMpnExsZX5HI5xBZjd3aEuBsOBTcs7TGherXaa9eHIqlUioUQltYIIXhkZPT5XnjL7qXi1Wpkm6w5nccGWlpanLJNlkGQyEw1Pui6rs8tLFx+9vTJq30JlKK/3ycRCQkSFZ8Dcwszi4lwUOylgwNUxC8cBKAS7hIWzwAAAABJRU5ErkJggg==) left center no-repeat;background-size:100% 100%}.spbc_auto_link,.spbc_manual_link,.spbc_manual_link_scan{display:inline-block;height:28px;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap}.spbc_rate_block_stars{margin:1em 0}.star-icon{color:#ddd;font-size:18px;position:relative}.star-icon.full:before{color:#FDE16D;content:'\2605';position:absolute;left:0;text-shadow:0 0 2px rgba(0,0,0,.7)}.spbc_hint{color:#666}p.spbc_hint{margin:0}.spbc_hint_warning{font-size:17px;font-weight:600;text-align:center;color:#eb8f00}.spbc_auto_link,.spbc_manual_link,.spbc_manual_link_scan{font-size:13px;text-decoration:none}.spbc_hint--link{color:#aaa;text-decoration:underline;cursor:pointer}.spbc_hint--top_right{position:relative;float:right;top:0;right:10px}.spbc_auto_link{border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;line-height:26px;margin:0;padding:0 10px 1px;-webkit-border-radius:2px;border-radius:2px;box-sizing:border-box}.spbc_auto_link:hover{color:#fff}.spbc_manual_link_scan{color:#fff;background:#026E88;border-color:#026E88;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);line-height:26px;margin:0;padding:0 10px 1px;border-radius:3px;-webkit-border-radius:3px;box-sizing:border-box}.spbc_manual_link{background:#fff;border-color:#026E88;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#026E88!important;line-height:26px;margin:0;padding:0 10px 1px;cursor:pointer;border-radius:3px;-webkit-border-radius:3px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.spbc_manual_link:hover,button.ct_support_link{text-decoration:underline}.spbc_page_buttons_links_basic_align{display:flex;align-items:center;justify-content:center;gap:5px}.spbc-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#spbc-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}.spbc_long_desc,.spbc_popup_tip--wrapper{min-width:80px;min-height:80px;max-width:500px;padding:10px;z-index:10}.spbc_dismiss{width:20px;height:20px;border-radius:5px}.spbc-links:visited{color:#fff}.spbc_long_desc{position:absolute;background:#5a5a5a;color:#fff}@media screen and (max-width:900px){.spbc_long_desc{left:inherit!important}.spbc_long_desc__angle_top_left{display:none}}.spbc_long_desc p{color:#fff!important}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block;font-size:25px;line-height:20px;color:rgba(120,200,230,1);margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.spbc_long_desc__angle,.spbc_long_desc__angle_top_left{-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);position:absolute;width:10px;height:10px;background:#5a5a5a}.spbc_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.spbc_long_desc__cancel:hover{color:#fff}.spbc_long_desc__link,.spbc_long_desc__title{color:rgba(120,200,230,1)}.spbc_long_desc__angle{top:5px;left:-17px;transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.spbc_long_desc__angle_top_left{top:-10px;left:-9px;transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.spbc_long_desc__title{margin:0}.spbc_long_desc__link:hover{color:rgba(140,220,250,1)}.spbc_long_desc h4{color:#50a0be;margin:10px 0 3px}.spbc_long_desc span{margin:0 0 0 10px;display:inline-block}.spbc_long_desc img{width:300px}.spbc_popup_tip--icon---show:hover{color:#aaa;cursor:pointer}.spbc_popup_tip--wrapper{position:absolute;background:#5a5a5a;color:#fff}.spbc_popup_tip--icon---cancel{position:absolute;top:0;right:5px;color:rgba(255,255,255,.5)}.spbc_popup_tip--icon---cancel:hover{color:#fff}.spbc_popup_tip--angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.spbc_popup_tip--title{color:rgba(120,200,230,1);margin:0}.spbc_popup_tip--text{color:#fff!important}tr:hover .spbc_hint--wrapper{display:none}.spbc_log-wrapper{padding:5px;border:1px solid #000;width:98%;min-height:300px;height:300px;border-bottom:5px dashed #5a5a5a}.spbc_log-wrapper .panel-body{height:100%;overflow-y:auto}.spbc_log-line{margin:0;padding:0 5px}.spbc_log-line:nth-child(odd){background:#d3d3d3}.spbc_log-block_header{margin:10px 0}.spbc_log-input--checkbox,.spbc_log-label--checkbox{width:auto}button.ct_support_link{border:none;background:0 0;color:#666;cursor:pointer}#spbc-modal-content{text-align:center}#spbc-modal-content>*{display:block;width:100%;margin:0}.spbc-modal-header{font-size:15px;font-weight:500}.spbc-modal-buttons-block{display:flex!important;gap:10px;justify-content:center}.spbc-modal-button{width:40%;height:35px;font-size:14px;font-weight:500;border:1px solid #60656b;background:#fff;border-radius:5px;cursor:pointer}.spbc-modal-button:hover{background:#2ea2cc;color:#fff;border:1px solid #2ea2cc}.spbc-modal-file_path{color:#026E88}.spbc-modal-file_path_wrapper{margin:4% 0 1%;padding:5px;border:1px solid #F5F5FD;border-radius:4px}.spbc-popup-msg{width:98%;height:15px;text-align:center;padding:4px;border-radius:7px;position:relative;top:0;right:0;bottom:0;left:0;margin:auto}.popup--green{background:#DFD;color:#060;border:1px solid #060}.popup--red{background:#FDD;color:#600;border:1px solid #600}#spbcscan-results-log-module{min-height:300px;height:300px;border-bottom:5px dashed #5a5a5a}#spbcscan-results-log-module .panel-body{height:100%;overflow-y:auto}#spbcscan-scanner-caption h4{margin:10px 0;font-size:14px}#spbcscan-results-log-caption p{font-size:13px;margin:0 0 6px}#spbcscan-scanner-caption{display:flex;flex-wrap:wrap;flex-direction:row-reverse}#spbcscan-scanner-caption .column:first-child{width:75%;flex:0 0 75%}#spbcscan-scanner-caption .column:last-child{width:25%;flex:0 0 25%;padding-right:10px;box-sizing:border-box}.spbc-scan-log-title{color:#1d2327;font-size:1.3em;margin:0 0 15px!important;font-weight:600}.spbc--status{position:relative;padding-left:26px}.spbc--marker-green::before,.spbc--marker-red::before,.spbc--marker-yellow::before{content:'';position:absolute;width:10px;height:10px;border-radius:50%;left:10px;top:4px}.spbc--marker-green::before{background:#1dda23}.spbc--marker-yellow::before{background:#ffb000}.spbc--marker-red::before{background:#d63638}button#spbc_setting_get_key_auto:disabled{background:#ccc;color:#111;text-decoration:none}.spbc_critical_updates-names{text-transform:uppercase;font-weight:500}.spbc_critical_updates-h_names{font-size:15px}.spbc_critical_updates-legend{border:1px solid #eee;padding:0 0 0 10px;margin:5px 0 0;color:#666}.spbc_critical_updates-no_vulnerabilities{color:green;font-size:15px;font-weight:500;margin:5px 0 0 30px}.spbct_notice{display:flex;justify-content:space-between}.spbct_notice-dismiss{position:relative;top:0;right:1px;border:none;margin:0;padding:9px;background:0 0;color:#787c82;cursor:pointer}.spbc_accordion_header_caption__update_status{display:inline-flex;flex-direction:row;flex-wrap:nowrap;width:45%;align-items:flex-end;justify-content:flex-end}.spbc_accordion_header_caption__updated{display:inline;color:#FFF;font-weight:700}.spbc_setting__textarea{width:400px;height:150px}.spbc-settings-general-wrapper{display:flex;flex-direction:row;flex-wrap:nowrap}.spbc-quicknav--bar_wrapper{display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;height:fit-content;position:sticky;top:5vh}.spbc-quicknav--links_wrapper{display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:center;padding:3px;border:1px solid #e5e5e5;margin:10px}.spbc-quicknav--link{margin:3px;width:-webkit-fill-available;width:-moz-available;text-align:left;display:flex;flex-direction:row;justify-content:flex-start}#spbc_quicknav--header{color:#026E88;text-align:center;margin:5px 0}.spbc_quicknav--save_button{margin:10px 5px!important;height:40px}.spbc_settings--save_button_custom{position:sticky;bottom:0;display:flex;justify-content:center;flex-direction:row;align-items:baseline;flex-wrap:nowrap;padding:15px 0}html{scroll-behavior:smooth} \ No newline at end of file diff --git a/css/src/spbc-settings-media.css b/css/src/spbc-settings-media.css index 535f847ca..4cc563c63 100644 --- a/css/src/spbc-settings-media.css +++ b/css/src/spbc-settings-media.css @@ -36,3 +36,12 @@ display: none; } } +@media screen and (max-width: 900px) { + .spbc-quicknav--bar_wrapper { + position: relative; + top: 0; + } + .spbc-settings-general-wrapper { + flex-direction: column-reverse; + } +} diff --git a/css/src/spbc-settings.css b/css/src/spbc-settings.css index 349e89d23..12a0b0624 100644 --- a/css/src/spbc-settings.css +++ b/css/src/spbc-settings.css @@ -1038,3 +1038,66 @@ button#spbc_setting_get_key_auto:disabled { width: 400px; height: 150px; } + +.spbc-settings-general-wrapper { + display: flex; + flex-direction: row; + flex-wrap: nowrap; +} + +.spbc-quicknav--bar_wrapper { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: flex-start; + height: fit-content; + position: sticky; + top: 5vh; +} + +.spbc-quicknav--links_wrapper { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + justify-content: center; + padding: 3px; + border: 1px solid #e5e5e5; + margin: 10px; +} + +.spbc-quicknav--link{ + margin: 3px; + width: -webkit-fill-available; + width: -moz-available; + text-align: left; + display: flex; + flex-direction: row; + justify-content: flex-start; +} + +#spbc_quicknav--header { + color: #026E88; + text-align: center; + margin: 5px 0; +} + +.spbc_quicknav--save_button { + margin: 10px 5px !important; + height: 40px; +} + +.spbc_settings--save_button_custom { + position: sticky; + bottom: 0; + display: flex; + justify-content: center; + flex-direction: row; + align-items: baseline; + flex-wrap: nowrap; + padding: 15px 0; +} + +html { + scroll-behavior: smooth; +} + diff --git a/inc/spbc-settings.php b/inc/spbc-settings.php index 95d106068..334e90075 100644 --- a/inc/spbc-settings.php +++ b/inc/spbc-settings.php @@ -218,7 +218,7 @@ function spbc_settings__register() 'class_prefix' => 'spbc', 'ajax' => true, 'js_after' => 'settings_tab--settings_general.min.js', - 'after' => 'submit_button', + 'after' => 'spbc_settings_draw_save_button_bottom_block', 'sections' => array( 'section_top_banner' => array( 'type' => 'section_banner', @@ -1310,64 +1310,13 @@ function spbc_settings__draw_elements($elems_to_draw = null, $direct_call = fals echo $elem['html']; } break; - // case 'tab_headings': - // echo '
' - // . $elem['html'] - // . '
'; - // break; case 'tab': echo '
'; - if ( ! $elem['ajax'] || ! $direct_call) { - // JS before - if (isset($elem['js_before'])) { - foreach (explode(' ', $elem['js_before']) as $script) { - $src = SPBC_PATH . '/js/spbc-' . $script . '?ver=' . SPBC_VERSION; - $target = 'spbc_tab-' . $elem_name; - echo ""; // JS before tab - } - } - - // Output - if ( ! empty($elem['callback'])) { - call_user_func($elem['callback']); + if ($elem_name === 'settings_general') { + spbct_settings__the_settings_tab_draw($elem_name, $elem); } else { - spbc_settings__draw_elements($elem['sections'], true); - } - - // Custom elements on tab - if (isset($elem['after'])) { - if (function_exists($elem['after'])) { - echo '
'; - call_user_func($elem['after']); - echo '
'; - } else { - echo $elem['after']; - } - } - - // JS after - if (isset($elem['js_after'])) { - foreach (explode(' ', $elem['js_after']) as $script) { - if ( strpos($script, '.min') === false ) { - $src = SPBC_PATH . '/js/src/spbc-' . $script . '?ver=' . SPBC_VERSION; - } else { - $src = SPBC_PATH . '/js/spbc-' . $script . '?ver=' . SPBC_VERSION; - } - $target = 'spbc_tab-' . $elem_name; - echo ""; // JS after tab - } + spbc_settings__tab_content_draw($elem_name, $elem); } } else { echo $elem['preloader']; @@ -1402,6 +1351,143 @@ function spbc_settings__draw_elements($elems_to_draw = null, $direct_call = fals } } +/** + * Draw the content of the settings tab. + * @param $elem_name + * @param $elem + * @return void + */ +function spbc_settings__tab_content_draw($elem_name, $elem) +{ + // JS before + if (isset($elem['js_before'])) { + foreach (explode(' ', $elem['js_before']) as $script) { + $src = SPBC_PATH . '/js/spbc-' . $script . '?ver=' . SPBC_VERSION; + $target = 'spbc_tab-' . $elem_name; + echo ""; // JS before tab + } + } + + // Output + if ( ! empty($elem['callback'])) { + call_user_func($elem['callback']); + } else { + spbc_settings__draw_elements($elem['sections'], true); + } + + // Custom elements on tab + if (isset($elem['after'])) { + if (function_exists($elem['after'])) { + call_user_func($elem['after']); + } else { + echo $elem['after']; + } + } + + // JS after + if (isset($elem['js_after'])) { + foreach (explode(' ', $elem['js_after']) as $script) { + if ( strpos($script, '.min') === false ) { + $src = SPBC_PATH . '/js/src/spbc-' . $script . '?ver=' . SPBC_VERSION; + } else { + $src = SPBC_PATH . '/js/spbc-' . $script . '?ver=' . SPBC_VERSION; + } + $target = 'spbc_tab-' . $elem_name; + echo ""; // JS after tab + } + } +} + +/** + * Draw the settings tab of the settings itself with quick navigation bar. + * @param $elem_name + * @param $elem + * @return void + */ +function spbct_settings__the_settings_tab_draw($elem_name, $elem) +{ + // Start output buffering to listen the settings tab echos - we need to do this because spbc_settings__tab_content_draw may call_user_func() with echo. + ob_start(); + spbc_settings__tab_content_draw($elem_name, $elem); + $settings_content = ob_get_clean(); + // End buffer + + $template = ' +
+
+ %s +
+
+ %s +
+
+ '; + + printf( + $template, + $settings_content, + spbc_settings__get_quick_navbar_html($elem) + ); +} + +/** + * Construct HTML for quick navigation bar for settings tab. + * @param array $elem - settings array element + * @return string + */ +function spbc_settings__get_quick_navbar_html($elem) +{ + $nav_link_template = '%s'; + $nav_bar_template = ' + '; + + $nav_elements = isset($elem['sections']) && is_array($elem['sections']) ? array_keys($elem['sections']) : array(); + $nav_links_html = ''; + + foreach ($nav_elements as $_index => $nav_element) { + //skip banner section from links list + if ($nav_element === 'section_top_banner') { + continue; + } + // get title from section or use section name + $title = isset($elem['sections'][$nav_element]['title']) + ? $elem['sections'][$nav_element]['title'] + : $nav_element; + // get anchor from section or use # + $anchor = isset($elem['sections'][$nav_element]['anchor']) + ? $elem['sections'][$nav_element]['anchor'] + : '#'; + // add a link to navbar + $nav_links_html .= sprintf( + $nav_link_template, + $anchor, + $nav_element, + $title + ); + } + + return sprintf( + $nav_bar_template, + __('Settings navigation', 'security-malware-firewall'), + $nav_links_html + ); +} + /** * @param $field * @@ -2350,10 +2436,19 @@ function spbc_field_traffic_control_logs__prepare_data(&$table) $time_offset = current_time('timestamp') - time(); foreach ($table->rows as $row) { + // obtain IP $ip = IP::reduceIPv6($row->ip_entry); + + //construct actions $allow_layout = '' . esc_html__('Allow', 'security-malware-firewall') . ''; $ban_layout = '' . esc_html__('Ban', 'security-malware-firewall') . ''; - $ip = "" . esc_html($ip) . '' + + //construct link + $uri_link = 'blacklists/' . $row->ip_entry; + $ip_link = LinkConstructor::buildCleanTalkLink('settings__firewall_ip_addresses', $uri_link); + + // + $ip = "" . esc_html($ip) . '' . '
' . $allow_layout . ' | ' . $ban_layout; @@ -6056,3 +6151,21 @@ function spbc_drop_to_defaults_on_key_clearance(\CleantalkSP\SpbctWP\State $spbc return $spbc; } + +/** + * Draws custom save button block with navigator backlink button with echo. + * @return void *echo + */ +function spbc_settings_draw_save_button_bottom_block() +{ + $template = ' + '; + printf( + $template, + __('Save Changes', 'security-malware-firewall'), + __('Back to navigation', 'security-malware-firewall') + ); +} diff --git a/js/spbc-scanner-plugin.min.js b/js/spbc-scanner-plugin.min.js index 9caf56a54..028c8cf0a 100644 --- a/js/spbc-scanner-plugin.min.js +++ b/js/spbc-scanner-plugin.min.js @@ -1,2 +1,2 @@ -class SpbcMalwareScanner{first_start=!0;active=!1;root="";settings=[];states=["get_cms_hashes","get_modules_hashes","clean_results","file_system_analysis","get_approved_hashes","get_denied_hashes","signature_analysis","heuristic_analysis","schedule_send_heuristic_suspicious_files","auto_cure_backup","auto_cure","outbound_links","frontend_analysis","important_files_listing","send_results"];state=null;offset=0;amount=0;amount_coefficient=1;total_scanned=0;scan_percent=0;percent_completed=0;paused=!1;button=null;spinner=null;progress_overall=null;progressbar=null;progressbar_text=null;timeout=6e4;state_timer=0;constructor(t){for(var e in console.log("init"),jQuery("#spbcscan-results-log-module").length&&jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),void 0!==t.settings.auto_cure&&(t.settings.scanner__auto_cure_backup="1"),t)void 0!==this[e]&&(this[e]=t[e])}actionControl(){null===this.state?this.start():this.paused?(this.resume(),this.controller()):this.pause()}start(){this.active=!0,this.state_timer=Math.round((new Date).getTime()/1e3),this.state=this.getNextState(null),this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold"),this.progressbar.show(500),this.progress_overall.show(500),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),setTimeout(()=>{this.controller()},1e3)}pause(t,e,s){console.log("PAUSE"),this.button.html(spbcScaner.button_scan_resume),this.spinner.css({display:"none"}),this.paused=!0,this.active=!1}resume(t){console.log("RESUME"),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),this.paused=!1,this.active=!0}end(t){this.progressbar.hide(500),this.progress_overall.hide(500),this.button.html(spbcScaner.button_scan_perform),this.spinner.css({display:"none"}),this.state=null,this.plug=!1,this.total_scanned=0,this.active=!1,t?document.location=document.location:(spbcSendAJAXRequest({action:"spbc_scanner_tab__reload_accordion"},{notJson:!0,callback:function(t,e,s,a){jQuery(a).accordion("destroy").html(t).accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1}),spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen(),spbcStartShowHide(),spbcScannerReloadScanInfo()}},jQuery("#spbc_scan_accordion")),jQuery("#spbc_scanner_clear").length||jQuery('
').insertBefore("#spbcscan-scanner-caption"))}controller(t){if(console.log(this.state),void 0!==t&&t.end){if(this.state=this.getNextState(this.state),void 0===this.state)return void this.end();this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold")}if(!0!==this.paused){var e={action:"spbc_scanner_controller_front",method:this.state,offset:this.offset},t={type:"GET",success:this.success,callback:this.successCallback,error:this.error,errorOutput:this.errorOutput,complete:null,context:this,timeout:12e4};switch(this.state){case"get_modules_hashes":this.amount=2;break;case"clear_table":this.amount=1e4;break;case"file_system_analysis":this.amount=700;break;case"auto_cure":this.amount=5;break;case"outbound_links":this.amount=10;break;case"frontend_analysis":this.amount=spbcSettings.frontendAnalysisAmount;break;case"signature_analysis":this.amount=10,e.status="UNKNOWN,MODIFIED,OK,INFECTED,ERROR";break;case"heuristic_analysis":this.amount=4,e.status="UNKNOWN,MODIFIED,OK,INFECTED,ERROR";break;case"schedule_send_heuristic_suspicious_files":this.amount=1}e.amount=Math.round(this.amount*this.amount_coefficient),spbcSendAJAXRequest(e,t,jQuery("#spbc_scan_accordion"))}}setCoefficients(t){let e=this.amount_coefficient;"file_system_analysis"===t&&(e*=1.5),this.amount_coefficient=e}getNextState(t){return t=null===t?this.states[0]:this.states[this.states.indexOf(t)+1],t=void 0!==this.settings["scanner__"+t]&&0==+this.settings["scanner__"+t]?this.getNextState(t):t}setPercents(t){this.percent_completed=Math.floor(100*t)/100,this.progressbar.progressbar("option","value",this.percent_completed),this.progressbar_text.text(spbcScaner["progressbar_"+this.state]+" - "+this.percent_completed+"%")}success(t){t.error?this.error({status:200,responseText:t.error},t.error,t.msg):this.successCallback&&this.successCallback(t,this.data,this.obj)}successCallback(e){if(console.log(e),this.interactAccordion(e),void 0!==e.total&&(this.scan_percent=100/e.total),void 0!==e.processed_items&&("heuristic_analysis"===this.state&&0!==typeof e.total&&this.logRaw('

Heuristic Analysis

'),"signature_analysis"===this.state&&0!==typeof e.total&&this.logRaw('

Signature Analysis

'),this.logFileEntry(e.processed_items)),void 0!==e.stage_data_for_logging&&this.logStageEntry(e.stage_data_for_logging),void 0!==e.cured&&0{this.controller(e)},300)}interactAccordion(t){t.hasOwnProperty("interactivity_data")&&t.interactivity_data.hasOwnProperty("update_text")&&t.interactivity_data.update_text&&t.interactivity_data.hasOwnProperty("refresh_data")&&t.interactivity_data.refresh_data.hasOwnProperty("do_refresh")&&t.interactivity_data.refresh_data.do_refresh&&t.interactivity_data.refresh_data.hasOwnProperty("control_tab")&&t.interactivity_data.refresh_data.control_tab&&spbcReloadAccordion(t.interactivity_data.refresh_data.control_tab,t.interactivity_data.update_text)}error(t,e,s){var a=this.errorOutput;if(console.log("%c APBCT_AJAX_ERROR","color: red;"),console.log(e),console.log(s),console.log(t),"error"==e&&(""==s||"Not found"==s)&&(this.tryCount||(this.tryCount=0,this.retryLimit=30),this.tryCount++,console.log("Try #"+this.tryCount),this.setCoefficients(this.state),this.tryCount<=this.retryLimit))this.pause(),this.resume(),this.controller();else{if(200===t.status)if("parsererror"===e)a("Unexpected response from server. See console for details.",this.state),console.log("%c "+t.responseText,"color: pink;");else{let t=e;void 0!==s&&(t+=" Additional info: "+s),a(t,this.state)}else a(500===t.status?"Internal server error.":"Unexpected response code: "+t.status+". Error: "+e,this.state);this.progressbar&&this.progressbar.fadeOut("slow"),this.end()}}errorOutput(t,e){spbcModal.open().putError(t+"
Stage: "+e)}logRaw(t){jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper .panel-body").prepend(t)}logFileEntry(t){for(var e in t)e&&this.logRaw('

'+this.getSiteUTCShiftedTimeString()+" - "+t[e].path+" - "+t[e].module+": "+t[e].status+"

")}logStageEntry(t){void 0!==jQuery(".panel-body .spbc_log-line span").first()&&void 0!==jQuery(".panel-body .spbc_log-line span").first()[0]&&jQuery(".panel-body .spbc_log-line span").first()[0].textContent===t.description||this.logRaw('

test '+this.getSiteUTCShiftedTimeString()+" - "+t.title+" "+t.description+"

")}showLinkForShuffleSalts(t){jQuery("#spbc_notice_about_shuffle_link").remove(),jQuery(jQuery(".spbc_tab--active .spbc_wrapper_field p")[1]).after('")}getSiteUTCShiftedTimeString(){let t=!1;var e=-1*(new Date).getTimezoneOffset()*1e3*60,e=(t="undefined"!=typeof spbcScaner&&void 0!==spbcScaner.timezone_shift&&!1!==spbcScaner.timezone_shift?Date.now()-e+1e3*spbcScaner.timezone_shift:t)?new Date(t):new Date,s=new Intl.DateTimeFormat("en-US",{month:"short"}).format,a=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0");return s(e)+" "+e.getDate()+" "+e.getFullYear()+" "+e.getHours()+":"+a+":"+i}} +class SpbcMalwareScanner{first_start=!0;active=!1;root="";settings=[];states=["get_cms_hashes","get_modules_hashes","clean_results","file_system_analysis","get_approved_hashes","get_denied_hashes","signature_analysis","heuristic_analysis","schedule_send_heuristic_suspicious_files","auto_cure_backup","auto_cure","outbound_links","frontend_analysis","important_files_listing","send_results"];state=null;offset=0;amount=0;amount_coefficient=1;total_scanned=0;scan_percent=0;percent_completed=0;paused=!1;button=null;spinner=null;progress_overall=null;progressbar=null;progressbar_text=null;timeout=6e4;state_timer=0;constructor(t){for(var e in console.log("init"),jQuery("#spbcscan-results-log-module").length&&jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),void 0!==t.settings.auto_cure&&(t.settings.scanner__auto_cure_backup="1"),t)void 0!==this[e]&&(this[e]=t[e])}actionControl(){null===this.state?this.start():this.paused?(this.resume(),this.controller()):this.pause()}start(){this.active=!0,this.state_timer=Math.round((new Date).getTime()/1e3),this.state=this.getNextState(null),this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold"),this.progressbar.show(500),this.progress_overall.show(500),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),setTimeout(()=>{this.controller()},1e3)}pause(t,e,s){console.log("PAUSE"),this.button.html(spbcScaner.button_scan_resume),this.spinner.css({display:"none"}),this.paused=!0,this.active=!1}resume(t){console.log("RESUME"),this.button.html(spbcScaner.button_scan_pause),this.spinner.css({display:"inline"}),this.paused=!1,this.active=!0}end(t){this.progressbar.hide(500),this.progress_overall.hide(500),this.button.html(spbcScaner.button_scan_perform),this.spinner.css({display:"none"}),this.state=null,this.plug=!1,this.total_scanned=0,this.active=!1,t?document.location=document.location:(spbcSendAJAXRequest({action:"spbc_scanner_tab__reload_accordion"},{notJson:!0,callback:function(t,e,s,a){jQuery(a).accordion("destroy").html(t).accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1}),spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen(),spbcStartShowHide(),spbcScannerReloadScanInfo()}},jQuery("#spbc_scan_accordion")),jQuery("#spbc_scanner_clear").length||jQuery('
').insertBefore("#spbcscan-scanner-caption"))}controller(t){if(console.log(this.state),void 0!==t&&t.end){if(this.state=this.getNextState(this.state),void 0===this.state)return void this.end();this.setPercents(0),this.scan_percent=0,this.offset=0,this.progress_overall.children("span").removeClass("spbc_bold").filter(".spbc_overall_scan_status_"+this.state).addClass("spbc_bold")}if(!0!==this.paused){var e={action:"spbc_scanner_controller_front",method:this.state,offset:this.offset},t={type:"GET",success:this.success,callback:this.successCallback,error:this.error,errorOutput:this.errorOutput,complete:null,context:this,timeout:12e4};switch(this.state){case"get_modules_hashes":this.amount=2;break;case"clear_table":this.amount=1e4;break;case"file_system_analysis":this.amount=700;break;case"auto_cure":this.amount=5;break;case"outbound_links":this.amount=10;break;case"frontend_analysis":this.amount=spbcSettings.frontendAnalysisAmount;break;case"signature_analysis":this.amount=10,e.status="UNKNOWN,MODIFIED,OK,INFECTED,ERROR";break;case"heuristic_analysis":this.amount=4,e.status="UNKNOWN,MODIFIED,OK,INFECTED,ERROR";break;case"schedule_send_heuristic_suspicious_files":this.amount=1}e.amount=Math.round(this.amount*this.amount_coefficient),spbcSendAJAXRequest(e,t,jQuery("#spbc_scan_accordion"))}}setCoefficients(t){let e=this.amount_coefficient;"file_system_analysis"===t&&(e*=1.5),this.amount_coefficient=e}getNextState(t){return t=null===t?this.states[0]:this.states[this.states.indexOf(t)+1],t=void 0!==this.settings["scanner__"+t]&&0==+this.settings["scanner__"+t]?this.getNextState(t):t}setPercents(t){this.percent_completed=Math.floor(100*t)/100,this.progressbar.progressbar("option","value",this.percent_completed),this.progressbar_text.text(spbcScaner["progressbar_"+this.state]+" - "+this.percent_completed+"%")}success(t){t.error?this.error({status:200,responseText:t.error},t.error,t.msg):this.successCallback&&this.successCallback(t,this.data,this.obj)}successCallback(e){if(console.log(e),this.interactAccordion(e),void 0!==e.total&&(this.scan_percent=100/e.total),void 0!==e.processed_items&&("heuristic_analysis"===this.state&&0!==typeof e.total&&this.logRaw('

Heuristic Analysis

'),"signature_analysis"===this.state&&0!==typeof e.total&&this.logRaw('

Signature Analysis

'),this.logFileEntry(e.processed_items)),void 0!==e.stage_data_for_logging&&this.logStageEntry(e.stage_data_for_logging),void 0!==e.cured&&0{this.controller(e)},300)}interactAccordion(t){t.hasOwnProperty("interactivity_data")&&t.interactivity_data.hasOwnProperty("update_text")&&t.interactivity_data.update_text&&t.interactivity_data.hasOwnProperty("refresh_data")&&t.interactivity_data.refresh_data.hasOwnProperty("do_refresh")&&t.interactivity_data.refresh_data.do_refresh&&t.interactivity_data.refresh_data.hasOwnProperty("control_tab")&&t.interactivity_data.refresh_data.control_tab&&spbcReloadAccordion(t.interactivity_data.refresh_data.control_tab,t.interactivity_data.update_text)}error(t,e,s){var a=this.errorOutput;if(console.log("%c APBCT_AJAX_ERROR","color: red;"),console.log(e),console.log(s),console.log(t),"error"==e&&(""==s||"Not found"==s)&&(this.tryCount||(this.tryCount=0,this.retryLimit=30),this.tryCount++,console.log("Try #"+this.tryCount),this.setCoefficients(this.state),this.tryCount<=this.retryLimit))this.pause(),this.resume(),this.controller();else{if(200===t.status)if("parsererror"===e)a("Unexpected response from server. See console for details.",this.state),console.log("%c "+t.responseText,"color: pink;");else{let t=e;void 0!==s&&(t+=" Additional info: "+s),a(t,this.state)}else 500===t.status?a("Internal server error.",this.state):a("Unexpected response code: "+t.status+". Error: "+e,this.state);this.progressbar&&this.progressbar.fadeOut("slow"),this.end()}}errorOutput(t,e){spbcModal.open().putError(t+"
Stage: "+e)}logRaw(t){jQuery(".spbc-scan-log-title").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper").removeClass("spbc---hidden"),jQuery(".spbc_log-wrapper .panel-body").prepend(t)}logFileEntry(t){for(var e in t)e&&this.logRaw('

'+this.getSiteUTCShiftedTimeString()+" - "+t[e].path+" - "+t[e].module+": "+t[e].status+"

")}logStageEntry(t){void 0!==jQuery(".panel-body .spbc_log-line span").first()&&void 0!==jQuery(".panel-body .spbc_log-line span").first()[0]&&jQuery(".panel-body .spbc_log-line span").first()[0].textContent===t.description||this.logRaw('

test '+this.getSiteUTCShiftedTimeString()+" - "+t.title+" "+t.description+"

")}showLinkForShuffleSalts(t){jQuery("#spbc_notice_about_shuffle_link").remove(),jQuery(jQuery(".spbc_tab--active .spbc_wrapper_field p")[1]).after('")}getSiteUTCShiftedTimeString(){let t=!1;var e=-1*(new Date).getTimezoneOffset()*1e3*60,e=(t="undefined"!=typeof spbcScaner&&void 0!==spbcScaner.timezone_shift&&!1!==spbcScaner.timezone_shift?Date.now()-e+1e3*spbcScaner.timezone_shift:t)?new Date(t):new Date,s=new Intl.DateTimeFormat("en-US",{month:"short"}).format,a=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0");return s(e)+" "+e.getDate()+" "+e.getFullYear()+" "+e.getHours()+":"+a+":"+i}} //# sourceMappingURL=spbc-scanner-plugin.min.js.map diff --git a/js/spbc-scanner-plugin.min.js.map b/js/spbc-scanner-plugin.min.js.map index 229b9e332..03c3ec17b 100644 --- a/js/spbc-scanner-plugin.min.js.map +++ b/js/spbc-scanner-plugin.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-scanner-plugin.min.js","sources":["spbc-scanner-plugin.js"],"sourcesContent":["'use strict';\n\n/**\n * class SpbcMalwareScanner\n */\nclass SpbcMalwareScanner {/* eslint-disable-line no-unused-vars */\n first_start = true;\n\n active = false;\n\n root = '';\n settings = [];\n states = [\n 'get_cms_hashes',\n 'get_modules_hashes',\n 'clean_results',\n 'file_system_analysis',\n 'get_approved_hashes',\n 'get_denied_hashes',\n 'signature_analysis',\n 'heuristic_analysis',\n 'schedule_send_heuristic_suspicious_files',\n 'auto_cure_backup',\n 'auto_cure',\n 'outbound_links',\n 'frontend_analysis',\n 'important_files_listing',\n 'send_results',\n ];\n state = null;\n offset = 0;\n amount = 0;\n amount_coefficient = 1;\n total_scanned = 0;\n scan_percent = 0;\n percent_completed = 0;\n\n paused = false;\n\n button = null;\n spinner = null;\n\n progress_overall = null;\n progressbar = null;\n progressbar_text = null;\n\n timeout = 60000;\n\n state_timer = 0;\n\n /**\n * constructor\n * @param {array} properties\n */\n constructor( properties ) {\n console.log('init');\n if (jQuery('#spbcscan-results-log-module').length) {\n jQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n }\n\n // Crunch for cure backups\n if ( typeof properties['settings']['auto_cure'] !== 'undefined' ) {\n properties['settings']['scanner__auto_cure_backup'] = '1';\n }\n\n for ( let key in properties ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = properties[key];\n }\n }\n };\n\n /**\n * Function Action Control\n */\n actionControl() {\n if (this.state === null) {\n this.start();\n } else if (this.paused) {\n this.resume();\n this.controller();\n } else {\n this.pause();\n }\n };\n\n /**\n * Function Start\n */\n start() {\n this.active = true;\n this.state_timer = Math.round(new Date().getTime() /1000);\n\n this.state = this.getNextState( null );\n\n this.setPercents( 0 );\n this.scan_percent = 0;\n this.offset = 0;\n this.progress_overall.children('span')\n .removeClass('spbc_bold')\n .filter('.spbc_overall_scan_status_' + this.state)\n .addClass('spbc_bold');\n\n this.progressbar.show(500);\n this.progress_overall.show(500);\n this.button.html(spbcScaner.button_scan_pause);\n this.spinner.css({display: 'inline'});\n\n setTimeout(() => {\n this.controller();\n }, 1000);\n };\n\n /**\n * Function Pause\n * @param {*} result\n * @param {*} data\n * @param {*} opt\n */\n pause( result, data, opt ) {\n console.log('PAUSE');\n this.button.html(spbcScaner.button_scan_resume);\n this.spinner.css({display: 'none'});\n this.paused = true;\n this.active = false;\n };\n\n /**\n * Function Resume\n * @param {*} opt\n */\n resume( opt ) {\n console.log('RESUME');\n this.button.html(spbcScaner.button_scan_pause);\n this.spinner.css({display: 'inline'});\n this.paused = false;\n this.active = true;\n };\n\n /**\n * Function End\n * @param {bool} reload\n */\n end( reload ) {\n this.progressbar.hide(500);\n this.progress_overall.hide(500);\n this.button.html(spbcScaner.button_scan_perform);\n this.spinner.css({display: 'none'});\n this.state = null;\n this.plug = false;\n this.total_scanned = 0;\n this.active = false;\n\n if (reload) {\n document.location = document.location;\n } else {\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 .html(result)\n .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 spbcScannerReloadScanInfo();\n },\n },\n jQuery('#spbc_scan_accordion'),\n );\n\n if (!jQuery('#spbc_scanner_clear').length) {\n let clearLink = '

Clear scanner logs


';\n jQuery(clearLink).insertBefore('#spbcscan-scanner-caption');\n }\n }\n };\n\n /**\n * Function Controller\n * @param {obj} result\n */\n controller( result ) {\n console.log(this.state);\n\n // The current stage is over. Switching to the new one\n if ( typeof result !== 'undefined' && result.end ) {\n this.state = this.getNextState( this.state );\n\n // End condition\n if (typeof this.state === 'undefined') {\n this.end();\n return;\n }\n\n // Set percent to 0\n this.setPercents( 0 );\n this.scan_percent = 0;\n this.offset = 0;\n\n // Changing visualizing of the current stage\n this.progress_overall.children('span')\n .removeClass('spbc_bold')\n .filter('.spbc_overall_scan_status_' + this.state)\n .addClass('spbc_bold');\n }\n\n // Break execution if paused\n if ( this.paused === true ) {\n return;\n }\n\n // // AJAX params\n let data = {\n action: 'spbc_scanner_controller_front',\n method: this.state,\n offset: this.offset,\n };\n\n let params = {\n type: 'GET',\n success: this.success,\n callback: this.successCallback,\n error: this.error,\n errorOutput: this.errorOutput,\n complete: null,\n context: this,\n timeout: 120000,\n };\n\n switch (this.state) {\n case 'get_modules_hashes': this.amount = 2; break;\n case 'clear_table': this.amount = 10000; break;\n case 'file_system_analysis': this.amount = 700; break;\n case 'auto_cure': this.amount = 5; break;\n case 'outbound_links': this.amount = 10; break;\n case 'frontend_analysis': this.amount = spbcSettings.frontendAnalysisAmount; break;\n case 'signature_analysis': this.amount = 10; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED,ERROR'; break;\n case 'heuristic_analysis': this.amount = 4; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED,ERROR'; break;\n case 'schedule_send_heuristic_suspicious_files': this.amount = 1; break;\n }\n\n data.amount = Math.round(this.amount * this.amount_coefficient);\n\n spbcSendAJAXRequest(\n data,\n params,\n jQuery('#spbc_scan_accordion'),\n );\n };\n\n /**\n * Set Coefficients\n * @param {string} state\n */\n setCoefficients( state ) {\n let coefficient = this.amount_coefficient;\n switch (state) {\n case 'file_system_analysis': coefficient *= 1.5; break;\n }\n this.amount_coefficient = coefficient;\n };\n\n /**\n * Get Next State\n * @param {string} state\n * @return {number}\n */\n getNextState( state ) {\n state = state === null ? this.states[0] : this.states[this.states.indexOf( state ) + 1];\n\n if (typeof this.settings['scanner__' + state] !== 'undefined' && +this.settings['scanner__' + state] === 0) {\n state = this.getNextState( state );\n }\n\n return state;\n };\n\n /**\n * Set Percents\n * @param {number} percents\n */\n setPercents( percents ) {\n this.percent_completed = Math.floor( percents * 100 ) / 100;\n this.progressbar.progressbar( 'option', 'value', this.percent_completed );\n this.progressbar_text.text( spbcScaner['progressbar_' + this.state] + ' - ' + this.percent_completed + '%' );\n };\n\n /**\n * Function Success\n * @param {obj} response\n */\n success( response ) {\n if ( !! response.error ) {\n this.error(\n {status: 200, responseText: response.error},\n response.error,\n response.msg,\n );\n } else {\n if ( this.successCallback ) {\n this.successCallback( response, this.data, this.obj );\n }\n }\n };\n\n // Processing response from backend\n /**\n * Success Callback\n * @param {obj} result\n */\n successCallback( result ) {\n console.log( result );\n\n this.interactAccordion(result);\n\n if ( typeof result.total !== 'undefined' ) {\n this.scan_percent = 100 / result.total;\n }\n\n if ( typeof result.processed_items !== 'undefined') {\n if ( this.state === 'heuristic_analysis' && typeof result.total !== 0 ) {\n this.logRaw('

Heuristic Analysis

');\n }\n if ( this.state === 'signature_analysis' && typeof result.total !== 0 ) {\n this.logRaw('

Signature Analysis

');\n }\n\n this.logFileEntry( result.processed_items );\n }\n\n if ( typeof result.stage_data_for_logging !== 'undefined') {\n this.logStageEntry( result.stage_data_for_logging );\n }\n\n // Add link on shuffle salt if cured\n if (result.cured !== undefined && Number(result.cured) > 0) {\n this.showLinkForShuffleSalts(result.message);\n }\n\n if ( result.end !== true && result.end !== 1 ) {\n let processedPercents = this.percent_completed + result.processed * this.scan_percent;\n if (result.stage_data_for_logging.title === 'File System Analysis' && processedPercents > 100) {\n processedPercents = 100;\n }\n this.setPercents(processedPercents);\n this.offset = this.offset + result.processed;\n this.controller( result );\n } else {\n console.log( this.state +\n ' stage took ' +\n ( Math.round(new Date().getTime() /1000) - this.state_timer ) +\n ' seconds to complete' );\n this.state_timer = Math.round(new Date().getTime()/1000);\n this.setPercents( 100 );\n this.scan_percent = 0;\n this.offset = 0;\n setTimeout(() => {\n this.controller( result );\n }, 300);\n }\n };\n\n /**\n * Run interactive refresh for accordion.\n * @param {obj|string[]} result\n */\n interactAccordion(result) {\n // validation control\n if (result.hasOwnProperty('interactivity_data') &&\n result.interactivity_data.hasOwnProperty('update_text') &&\n result.interactivity_data.update_text &&\n result.interactivity_data.hasOwnProperty('refresh_data') &&\n result.interactivity_data.refresh_data.hasOwnProperty('do_refresh') &&\n result.interactivity_data.refresh_data.do_refresh &&\n result.interactivity_data.refresh_data.hasOwnProperty('control_tab') &&\n result.interactivity_data.refresh_data.control_tab\n ) {\n spbcReloadAccordion(\n result.interactivity_data.refresh_data.control_tab,\n result.interactivity_data.update_text,\n );\n }\n }\n\n /**\n * Function Error\n * @param {object} xhr\n * @param {string} status\n * @param {string} error\n */\n error( xhr, status, error ) {\n let errorOutput = this.errorOutput;\n\n console.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\n console.log( status );\n console.log( error );\n console.log( xhr );\n\n if (status == 'error' && (error == '' || error == 'Not found')) {\n if (!this.tryCount) {\n this.tryCount = 0;\n this.retryLimit = 30;\n }\n this.tryCount++;\n console.log('Try #' + this.tryCount);\n this.setCoefficients(this.state);\n if (this.tryCount <= this.retryLimit) {\n this.pause();\n this.resume();\n this.controller();\n return;\n }\n }\n\n if ( xhr.status === 200 ) {\n if ( status === 'parsererror' ) {\n errorOutput( 'Unexpected response from server. See console for details.', this.state );\n console.log( '%c ' + xhr.responseText, 'color: pink;' );\n } else {\n let errorString = status;\n if ( typeof error !== 'undefined' ) {\n errorString += ' Additional info: ' + error;\n }\n errorOutput( errorString, this.state );\n }\n } else if (xhr.status === 500) {\n errorOutput( 'Internal server error.', this.state);\n } else {\n errorOutput('Unexpected response code: ' + xhr.status + '. Error: ' + status, this.state);\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n\n this.end();\n };\n\n /**\n * Error Output\n * @param {string} errorMsg\n * @param {string} stage\n */\n errorOutput( errorMsg, stage ) {\n spbcModal.open().putError( errorMsg + '
Stage: ' + stage);\n };\n\n /**\n * Log Raw\n * @param {htmlString|Element|Text|Array|jQuery} messageToLog\n */\n logRaw(messageToLog) {\n jQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n jQuery('.spbc_log-wrapper').removeClass('spbc---hidden');\n jQuery('.spbc_log-wrapper .panel-body').prepend( messageToLog );\n };\n\n /**\n * Log File Entry\n * @param {array} items\n */\n logFileEntry(items) {\n for ( let key in items ) {\n if ( key ) {\n this.logRaw(\n '

' +\n this.getSiteUTCShiftedTimeString() + ' - ' +\n items[key].path + ' - ' + items[key].module +\n ': ' + items[key].status + '' +\n '

');\n }\n }\n };\n\n /**\n * Log Stage Entry\n * @param {obj} data\n */\n logStageEntry(data) {\n if (typeof jQuery('.panel-body .spbc_log-line span').first() !== 'undefined' &&\n typeof jQuery('.panel-body .spbc_log-line span').first()[0] !== 'undefined' &&\n jQuery('.panel-body .spbc_log-line span').first()[0].textContent === data.description\n ) {\n return;\n }\n this.logRaw( '

test ' +\n this.getSiteUTCShiftedTimeString() + ' - ' + '' +\n data.title + ' ' + '' + data.description + '

' );\n };\n\n /**\n * Show Link For Shuffle Salts\n * @param {string} message\n */\n showLinkForShuffleSalts(message) {\n jQuery('#spbc_notice_about_shuffle_link').remove();\n jQuery(jQuery('.spbc_tab--active .spbc_wrapper_field p')[1])\n .after(\n '
' +\n '' +\n message +\n '' +\n '
',\n );\n }\n\n /**\n * Get Site UTC Shifted Time String\n * @return {string}\n */\n getSiteUTCShiftedTimeString() {\n let utcShiftedTs = false;\n // gettings current system/browser offset\n let currentBrowserOffset = new Date().getTimezoneOffset();\n currentBrowserOffset = currentBrowserOffset * -1 * 1000 * 60;\n // chek if global ct object is defined\n if (typeof spbcScaner !== 'undefined' &&\n typeof spbcScaner.timezone_shift !== 'undefined' &&\n spbcScaner.timezone_shift !== false) {\n utcShiftedTs = Date.now() - currentBrowserOffset + (spbcScaner.timezone_shift * 1000);\n }\n let ctDate = utcShiftedTs ? new Date(utcShiftedTs) : new Date();\n // construct date string\n let shortMonthName = new Intl.DateTimeFormat('en-US', {month: 'short'}).format;\n let minutes = String(ctDate.getMinutes()).padStart(2, '0');\n let seconds = String(ctDate.getSeconds()).padStart(2, '0');\n return shortMonthName(ctDate) + ' ' +\n ctDate.getDate() + ' ' + ctDate.getFullYear() + ' ' +\n ctDate.getHours() + ':' + minutes + ':' + seconds;\n }\n}\n"],"names":["SpbcMalwareScanner","first_start","active","root","settings","states","state","offset","amount","amount_coefficient","total_scanned","scan_percent","percent_completed","paused","button","spinner","progress_overall","progressbar","progressbar_text","timeout","state_timer","constructor","properties","let","key","console","log","jQuery","length","removeClass","this","actionControl","start","resume","controller","pause","Math","round","Date","getTime","getNextState","setPercents","children","filter","addClass","show","html","spbcScaner","button_scan_pause","css","display","setTimeout","result","data","opt","button_scan_resume","end","reload","hide","button_scan_perform","plug","document","location","spbcSendAJAXRequest","action","notJson","callback","params","obj","accordion","header","heightStyle","collapsible","spbcTblBulkActionsListen","spbcTblRowActionsListen","spbcTblPaginationListen","spbcTblSortListen","spbcStartShowHide","spbcScannerReloadScanInfo","insertBefore","method","type","success","successCallback","error","errorOutput","complete","context","spbcSettings","frontendAnalysisAmount","status","setCoefficients","coefficient","indexOf","percents","floor","text","response","responseText","msg","interactAccordion","total","processed_items","logRaw","logFileEntry","stage_data_for_logging","logStageEntry","undefined","cured","Number","showLinkForShuffleSalts","message","processedPercents","processed","title","hasOwnProperty","interactivity_data","update_text","refresh_data","do_refresh","control_tab","spbcReloadAccordion","xhr","tryCount","retryLimit","errorString","fadeOut","errorMsg","stage","spbcModal","open","putError","messageToLog","prepend","items","getSiteUTCShiftedTimeString","path","module","first","textContent","description","remove","after","utcShiftedTs","currentBrowserOffset","getTimezoneOffset","ctDate","timezone_shift","now","shortMonthName","Intl","DateTimeFormat","month","format","minutes","String","getMinutes","padStart","seconds","getSeconds","getDate","getFullYear","getHours"],"mappings":"MAKMA,mBACFC,YAAc,CAAA,EAEdC,OAAS,CAAA,EAETC,KAAO,GACPC,SAAW,GACXC,OAAS,CACL,iBACA,qBACA,gBACA,uBACA,sBACA,oBACA,qBACA,qBACA,2CACA,mBACA,YACA,iBACA,oBACA,0BACA,gBAEJC,MAAQ,KACRC,OAAS,EACTC,OAAS,EACTC,mBAAqB,EACrBC,cAAgB,EAChBC,aAAe,EACfC,kBAAoB,EAEpBC,OAAS,CAAA,EAETC,OAAS,KACTC,QAAU,KAEVC,iBAAmB,KACnBC,YAAc,KACdC,iBAAmB,KAEnBC,QAAU,IAEVC,YAAc,EAMdC,YAAaC,GAWT,IAAMC,IAAIC,KAVVC,QAAQC,IAAI,MAAM,EACdC,OAAO,8BAA8B,EAAEC,QACvCD,OAAO,sBAAsB,EAAEE,YAAY,eAAe,EAIV,KAAA,IAAxCP,EAAqB,SAAa,YAC1CA,EAAqB,SAA6B,0BAAI,KAGzCA,EACa,KAAA,IAAdQ,KAAKN,KACbM,KAAKN,GAAOF,EAAWE,GAGnC,CAKAO,gBACuB,OAAfD,KAAKxB,MACLwB,KAAKE,MAAM,EACJF,KAAKj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pF,OAAO,iCAAiC,EAAEkH,OAAO,EACjDlH,OAAOA,OAAO,yCAAyC,EAAE,EAAE,EACtDmH,MACG,uKAEA/B,EAEA,YACJ,CACR,CAMAwB,8BACIhH,IAAIwH,EAAe,CAAA,EAEnBxH,IACAyH,EAA8C,CAAC,GADpB,IAAI1G,MAAO2G,kBAAkB,EACL,IAAO,GAOtDC,GAFAH,EAHsB,aAAtB,OAAOhG,YAC8B,KAAA,IAA9BA,WAAWoG,gBACY,CAAA,IAA9BpG,WAAWoG,eACI7G,KAAK8G,IAAI,EAAIJ,EAAoD,IAA5BjG,WAAWoG,eAEtDJ,GAAe,IAAIzG,KAAKyG,CAAY,EAAI,IAAIzG,KAErD+G,EAAiB,IAAIC,KAAKC,eAAe,QAAS,CAACC,MAAO,OAAO,CAAC,EAAEC,OACpEC,EAAUC,OAAOT,EAAOU,WAAW,CAAC,EAAEC,SAAS,EAAG,GAAG,EACrDC,EAAUH,OAAOT,EAAOa,WAAW,CAAC,EAAEF,SAAS,EAAG,GAAG,EACzD,OAAOR,EAAeH,CAAM,EAAI,IAC5BA,EAAOc,QAAQ,EAAI,IAAMd,EAAOe,YAAY,EAAI,IAChDf,EAAOgB,SAAS,EAAI,IAAMR,EAAU,IAAMI,CAClD,CACJ"} \ No newline at end of file +{"version":3,"file":"spbc-scanner-plugin.min.js","sources":["spbc-scanner-plugin.js"],"sourcesContent":["'use strict';\n\n/**\n * class SpbcMalwareScanner\n */\nclass SpbcMalwareScanner {/* eslint-disable-line no-unused-vars */\n first_start = true;\n\n active = false;\n\n root = '';\n settings = [];\n states = [\n 'get_cms_hashes',\n 'get_modules_hashes',\n 'clean_results',\n 'file_system_analysis',\n 'get_approved_hashes',\n 'get_denied_hashes',\n 'signature_analysis',\n 'heuristic_analysis',\n 'schedule_send_heuristic_suspicious_files',\n 'auto_cure_backup',\n 'auto_cure',\n 'outbound_links',\n 'frontend_analysis',\n 'important_files_listing',\n 'send_results',\n ];\n state = null;\n offset = 0;\n amount = 0;\n amount_coefficient = 1;\n total_scanned = 0;\n scan_percent = 0;\n percent_completed = 0;\n\n paused = false;\n\n button = null;\n spinner = null;\n\n progress_overall = null;\n progressbar = null;\n progressbar_text = null;\n\n timeout = 60000;\n\n state_timer = 0;\n\n /**\n * constructor\n * @param {array} properties\n */\n constructor( properties ) {\n console.log('init');\n if (jQuery('#spbcscan-results-log-module').length) {\n jQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n }\n\n // Crunch for cure backups\n if ( typeof properties['settings']['auto_cure'] !== 'undefined' ) {\n properties['settings']['scanner__auto_cure_backup'] = '1';\n }\n\n for ( let key in properties ) {\n if ( typeof this[key] !== 'undefined' ) {\n this[key] = properties[key];\n }\n }\n };\n\n /**\n * Function Action Control\n */\n actionControl() {\n if (this.state === null) {\n this.start();\n } else if (this.paused) {\n this.resume();\n this.controller();\n } else {\n this.pause();\n }\n };\n\n /**\n * Function Start\n */\n start() {\n this.active = true;\n this.state_timer = Math.round(new Date().getTime() /1000);\n\n this.state = this.getNextState( null );\n\n this.setPercents( 0 );\n this.scan_percent = 0;\n this.offset = 0;\n this.progress_overall.children('span')\n .removeClass('spbc_bold')\n .filter('.spbc_overall_scan_status_' + this.state)\n .addClass('spbc_bold');\n\n this.progressbar.show(500);\n this.progress_overall.show(500);\n this.button.html(spbcScaner.button_scan_pause);\n this.spinner.css({display: 'inline'});\n\n setTimeout(() => {\n this.controller();\n }, 1000);\n };\n\n /**\n * Function Pause\n * @param {*} result\n * @param {*} data\n * @param {*} opt\n */\n pause( result, data, opt ) {\n console.log('PAUSE');\n this.button.html(spbcScaner.button_scan_resume);\n this.spinner.css({display: 'none'});\n this.paused = true;\n this.active = false;\n };\n\n /**\n * Function Resume\n * @param {*} opt\n */\n resume( opt ) {\n console.log('RESUME');\n this.button.html(spbcScaner.button_scan_pause);\n this.spinner.css({display: 'inline'});\n this.paused = false;\n this.active = true;\n };\n\n /**\n * Function End\n * @param {bool} reload\n */\n end( reload ) {\n this.progressbar.hide(500);\n this.progress_overall.hide(500);\n this.button.html(spbcScaner.button_scan_perform);\n this.spinner.css({display: 'none'});\n this.state = null;\n this.plug = false;\n this.total_scanned = 0;\n this.active = false;\n\n if (reload) {\n document.location = document.location;\n } else {\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 .html(result)\n .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 spbcScannerReloadScanInfo();\n },\n },\n jQuery('#spbc_scan_accordion'),\n );\n\n if (!jQuery('#spbc_scanner_clear').length) {\n let clearLink = '

Clear scanner logs


';\n jQuery(clearLink).insertBefore('#spbcscan-scanner-caption');\n }\n }\n };\n\n /**\n * Function Controller\n * @param {obj} result\n */\n controller( result ) {\n console.log(this.state);\n\n // The current stage is over. Switching to the new one\n if ( typeof result !== 'undefined' && result.end ) {\n this.state = this.getNextState( this.state );\n\n // End condition\n if (typeof this.state === 'undefined') {\n this.end();\n return;\n }\n\n // Set percent to 0\n this.setPercents( 0 );\n this.scan_percent = 0;\n this.offset = 0;\n\n // Changing visualizing of the current stage\n this.progress_overall.children('span')\n .removeClass('spbc_bold')\n .filter('.spbc_overall_scan_status_' + this.state)\n .addClass('spbc_bold');\n }\n\n // Break execution if paused\n if ( this.paused === true ) {\n return;\n }\n\n // // AJAX params\n let data = {\n action: 'spbc_scanner_controller_front',\n method: this.state,\n offset: this.offset,\n };\n\n let params = {\n type: 'GET',\n success: this.success,\n callback: this.successCallback,\n error: this.error,\n errorOutput: this.errorOutput,\n complete: null,\n context: this,\n timeout: 120000,\n };\n\n switch (this.state) {\n case 'get_modules_hashes': this.amount = 2; break;\n case 'clear_table': this.amount = 10000; break;\n case 'file_system_analysis': this.amount = 700; break;\n case 'auto_cure': this.amount = 5; break;\n case 'outbound_links': this.amount = 10; break;\n case 'frontend_analysis': this.amount = spbcSettings.frontendAnalysisAmount; break;\n case 'signature_analysis': this.amount = 10; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED,ERROR'; break;\n case 'heuristic_analysis': this.amount = 4; data.status = 'UNKNOWN,MODIFIED,OK,INFECTED,ERROR'; break;\n case 'schedule_send_heuristic_suspicious_files': this.amount = 1; break;\n }\n\n data.amount = Math.round(this.amount * this.amount_coefficient);\n\n spbcSendAJAXRequest(\n data,\n params,\n jQuery('#spbc_scan_accordion'),\n );\n };\n\n /**\n * Set Coefficients\n * @param {string} state\n */\n setCoefficients( state ) {\n let coefficient = this.amount_coefficient;\n switch (state) {\n case 'file_system_analysis': coefficient *= 1.5; break;\n }\n this.amount_coefficient = coefficient;\n };\n\n /**\n * Get Next State\n * @param {string} state\n * @return {number}\n */\n getNextState( state ) {\n state = state === null ? this.states[0] : this.states[this.states.indexOf( state ) + 1];\n\n if (typeof this.settings['scanner__' + state] !== 'undefined' && +this.settings['scanner__' + state] === 0) {\n state = this.getNextState( state );\n }\n\n return state;\n };\n\n /**\n * Set Percents\n * @param {number} percents\n */\n setPercents( percents ) {\n this.percent_completed = Math.floor( percents * 100 ) / 100;\n this.progressbar.progressbar( 'option', 'value', this.percent_completed );\n this.progressbar_text.text( spbcScaner['progressbar_' + this.state] + ' - ' + this.percent_completed + '%' );\n };\n\n /**\n * Function Success\n * @param {obj} response\n */\n success( response ) {\n if ( !! response.error ) {\n this.error(\n {status: 200, responseText: response.error},\n response.error,\n response.msg,\n );\n } else {\n if ( this.successCallback ) {\n this.successCallback( response, this.data, this.obj );\n }\n }\n };\n\n // Processing response from backend\n /**\n * Success Callback\n * @param {obj} result\n */\n successCallback( result ) {\n console.log( result );\n\n this.interactAccordion(result);\n\n if ( typeof result.total !== 'undefined' ) {\n this.scan_percent = 100 / result.total;\n }\n\n if ( typeof result.processed_items !== 'undefined') {\n if ( this.state === 'heuristic_analysis' && typeof result.total !== 0 ) {\n this.logRaw('

Heuristic Analysis

');\n }\n if ( this.state === 'signature_analysis' && typeof result.total !== 0 ) {\n this.logRaw('

Signature Analysis

');\n }\n\n this.logFileEntry( result.processed_items );\n }\n\n if ( typeof result.stage_data_for_logging !== 'undefined') {\n this.logStageEntry( result.stage_data_for_logging );\n }\n\n // Add link on shuffle salt if cured\n if (result.cured !== undefined && Number(result.cured) > 0) {\n this.showLinkForShuffleSalts(result.message);\n }\n\n if ( result.end !== true && result.end !== 1 ) {\n let processedPercents = this.percent_completed + result.processed * this.scan_percent;\n if (result.stage_data_for_logging.title === 'File System Analysis' && processedPercents > 100) {\n processedPercents = 100;\n }\n this.setPercents(processedPercents);\n this.offset = this.offset + result.processed;\n this.controller( result );\n } else {\n console.log( this.state +\n ' stage took ' +\n ( Math.round(new Date().getTime() /1000) - this.state_timer ) +\n ' seconds to complete' );\n this.state_timer = Math.round(new Date().getTime()/1000);\n this.setPercents( 100 );\n this.scan_percent = 0;\n this.offset = 0;\n setTimeout(() => {\n this.controller( result );\n }, 300);\n }\n };\n\n /**\n * Run interactive refresh for accordion.\n * @param {obj|string[]} result\n */\n interactAccordion(result) {\n // validation control\n if (result.hasOwnProperty('interactivity_data') &&\n result.interactivity_data.hasOwnProperty('update_text') &&\n result.interactivity_data.update_text &&\n result.interactivity_data.hasOwnProperty('refresh_data') &&\n result.interactivity_data.refresh_data.hasOwnProperty('do_refresh') &&\n result.interactivity_data.refresh_data.do_refresh &&\n result.interactivity_data.refresh_data.hasOwnProperty('control_tab') &&\n result.interactivity_data.refresh_data.control_tab\n ) {\n spbcReloadAccordion(\n result.interactivity_data.refresh_data.control_tab,\n result.interactivity_data.update_text,\n );\n }\n }\n\n /**\n * Function Error\n * @param {object} xhr\n * @param {string} status\n * @param {string} error\n */\n error( xhr, status, error ) {\n let errorOutput = this.errorOutput;\n\n console.log( '%c APBCT_AJAX_ERROR', 'color: red;' );\n console.log( status );\n console.log( error );\n console.log( xhr );\n\n if (status == 'error' && (error == '' || error == 'Not found')) {\n if (!this.tryCount) {\n this.tryCount = 0;\n this.retryLimit = 30;\n }\n this.tryCount++;\n console.log('Try #' + this.tryCount);\n this.setCoefficients(this.state);\n if (this.tryCount <= this.retryLimit) {\n this.pause();\n this.resume();\n this.controller();\n return;\n }\n }\n\n if ( xhr.status === 200 ) {\n if ( status === 'parsererror' ) {\n errorOutput( 'Unexpected response from server. See console for details.', this.state );\n console.log( '%c ' + xhr.responseText, 'color: pink;' );\n } else {\n let errorString = status;\n if ( typeof error !== 'undefined' ) {\n errorString += ' Additional info: ' + error;\n }\n errorOutput( errorString, this.state );\n }\n } else if (xhr.status === 500) {\n errorOutput( 'Internal server error.', this.state);\n } else {\n errorOutput('Unexpected response code: ' + xhr.status + '. Error: ' + status, this.state);\n }\n\n if ( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n\n this.end();\n };\n\n /**\n * Error Output\n * @param {string} errorMsg\n * @param {string} stage\n */\n errorOutput( errorMsg, stage ) {\n spbcModal.open().putError( errorMsg + '
Stage: ' + stage);\n };\n\n /**\n * Log Raw\n * @param {htmlString|Element|Text|Array|jQuery} messageToLog\n */\n logRaw(messageToLog) {\n jQuery('.spbc-scan-log-title').removeClass('spbc---hidden');\n jQuery('.spbc_log-wrapper').removeClass('spbc---hidden');\n jQuery('.spbc_log-wrapper .panel-body').prepend( messageToLog );\n };\n\n /**\n * Log File Entry\n * @param {array} items\n */\n logFileEntry(items) {\n for ( let key in items ) {\n if ( key ) {\n this.logRaw(\n '

' +\n this.getSiteUTCShiftedTimeString() + ' - ' +\n items[key].path + ' - ' + items[key].module +\n ': ' + items[key].status + '' +\n '

');\n }\n }\n };\n\n /**\n * Log Stage Entry\n * @param {obj} data\n */\n logStageEntry(data) {\n if (typeof jQuery('.panel-body .spbc_log-line span').first() !== 'undefined' &&\n typeof jQuery('.panel-body .spbc_log-line span').first()[0] !== 'undefined' &&\n jQuery('.panel-body .spbc_log-line span').first()[0].textContent === data.description\n ) {\n return;\n }\n this.logRaw( '

test ' +\n this.getSiteUTCShiftedTimeString() + ' - ' + '' +\n data.title + ' ' + '' + data.description + '

' );\n };\n\n /**\n * Show Link For Shuffle Salts\n * @param {string} message\n */\n showLinkForShuffleSalts(message) {\n jQuery('#spbc_notice_about_shuffle_link').remove();\n jQuery(jQuery('.spbc_tab--active .spbc_wrapper_field p')[1])\n .after(\n '
' +\n '' +\n message +\n '' +\n '
',\n );\n }\n\n /**\n * Get Site UTC Shifted Time String\n * @return {string}\n */\n getSiteUTCShiftedTimeString() {\n let utcShiftedTs = false;\n // gettings current system/browser offset\n let currentBrowserOffset = new Date().getTimezoneOffset();\n currentBrowserOffset = currentBrowserOffset * -1 * 1000 * 60;\n // chek if global ct object is defined\n if (typeof spbcScaner !== 'undefined' &&\n typeof spbcScaner.timezone_shift !== 'undefined' &&\n spbcScaner.timezone_shift !== false) {\n utcShiftedTs = Date.now() - currentBrowserOffset + (spbcScaner.timezone_shift * 1000);\n }\n let ctDate = utcShiftedTs ? new Date(utcShiftedTs) : new Date();\n // construct date string\n let shortMonthName = new Intl.DateTimeFormat('en-US', {month: 'short'}).format;\n let minutes = String(ctDate.getMinutes()).padStart(2, '0');\n let seconds = String(ctDate.getSeconds()).padStart(2, '0');\n return shortMonthName(ctDate) + ' ' +\n ctDate.getDate() + ' ' + ctDate.getFullYear() + ' ' +\n ctDate.getHours() + ':' + minutes + ':' + seconds;\n }\n}\n"],"names":["SpbcMalwareScanner","first_start","active","root","settings","states","state","offset","amount","amount_coefficient","total_scanned","scan_percent","percent_completed","paused","button","spinner","progress_overall","progressbar","progressbar_text","timeout","state_timer","constructor","properties","let","key","console","log","jQuery","length","removeClass","this","actionControl","start","resume","controller","pause","Math","round","Date","getTime","getNextState","setPercents","children","filter","addClass","show","html","spbcScaner","button_scan_pause","css","display","setTimeout","result","data","opt","button_scan_resume","end","reload","hide","button_scan_perform","plug","document","location","spbcSendAJAXRequest","action","notJson","callback","params","obj","accordion","header","heightStyle","collapsible","spbcTblBulkActionsListen","spbcTblRowActionsListen","spbcTblPaginationListen","spbcTblSortListen","spbcStartShowHide","spbcScannerReloadScanInfo","insertBefore","method","type","success","successCallback","error","errorOutput","complete","context","spbcSettings","frontendAnalysisAmount","status","setCoefficients","coefficient","indexOf","percents","floor","text","response","responseText","msg","interactAccordion","total","processed_items","logRaw","logFileEntry","stage_data_for_logging","logStageEntry","undefined","cured","Number","showLinkForShuffleSalts","message","processedPercents","processed","title","hasOwnProperty","interactivity_data","update_text","refresh_data","do_refresh","control_tab","spbcReloadAccordion","xhr","tryCount","retryLimit","errorString","fadeOut","errorMsg","stage","spbcModal","open","putError","messageToLog","prepend","items","getSiteUTCShiftedTimeString","path","module","first","textContent","description","remove","after","utcShiftedTs","currentBrowserOffset","getTimezoneOffset","ctDate","timezone_shift","now","shortMonthName","Intl","DateTimeFormat","month","format","minutes","String","getMinutes","padStart","seconds","getSeconds","getDate","getFullYear","getHours"],"mappings":"MAKMA,mBACFC,YAAc,CAAA,EAEdC,OAAS,CAAA,EAETC,KAAO,GACPC,SAAW,GACXC,OAAS,CACL,iBACA,qBACA,gBACA,uBACA,sBACA,oBACA,qBACA,qBACA,2CACA,mBACA,YACA,iBACA,oBACA,0BACA,gBAEJC,MAAQ,KACRC,OAAS,EACTC,OAAS,EACTC,mBAAqB,EACrBC,cAAgB,EAChBC,aAAe,EACfC,kBAAoB,EAEpBC,OAAS,CAAA,EAETC,OAAS,KACTC,QAAU,KAEVC,iBAAmB,KACnBC,YAAc,KACdC,iBAAmB,KAEnBC,QAAU,IAEVC,YAAc,EAMdC,YAAaC,GAWT,IAAMC,IAAIC,KAVVC,QAAQC,IAAI,MAAM,EACdC,OAAO,8BAA8B,EAAEC,QACvCD,OAAO,sBAAsB,EAAEE,YAAY,eAAe,EAIV,KAAA,IAAxCP,EAAqB,SAAa,YAC1CA,EAAqB,SAA6B,0BAAI,KAGzCA,EACa,KAAA,IAAdQ,KAAKN,KACbM,KAAKN,GAAOF,EAAWE,GAGnC,CAKAO,gBACuB,OAAfD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,EAAK6D,MAAkB,cAAW7D,EAAKuF,YAAc,aAAc,CAC3E,CAMA9B,wBAAwBC,GACpBpF,OAAO,iCAAiC,EAAEkH,OAAO,EACjDlH,OAAOA,OAAO,yCAAyC,EAAE,EAAE,EACtDmH,MACG,uKAEA/B,EAEA,YACJ,CACR,CAMAwB,8BACIhH,IAAIwH,EAAe,CAAA,EAEnBxH,IACAyH,EAA8C,CAAC,GADpB,IAAI1G,MAAO2G,kBAAkB,EACL,IAAO,GAOtDC,GAFAH,EAHsB,aAAtB,OAAOhG,YAC8B,KAAA,IAA9BA,WAAWoG,gBACY,CAAA,IAA9BpG,WAAWoG,eACI7G,KAAK8G,IAAI,EAAIJ,EAAoD,IAA5BjG,WAAWoG,eAEtDJ,GAAe,IAAIzG,KAAKyG,CAAY,EAAI,IAAIzG,KAErD+G,EAAiB,IAAIC,KAAKC,eAAe,QAAS,CAACC,MAAO,OAAO,CAAC,EAAEC,OACpEC,EAAUC,OAAOT,EAAOU,WAAW,CAAC,EAAEC,SAAS,EAAG,GAAG,EACrDC,EAAUH,OAAOT,EAAOa,WAAW,CAAC,EAAEF,SAAS,EAAG,GAAG,EACzD,OAAOR,EAAeH,CAAM,EAAI,IAC5BA,EAAOc,QAAQ,EAAI,IAAMd,EAAOe,YAAY,EAAI,IAChDf,EAAOgB,SAAS,EAAI,IAAMR,EAAU,IAAMI,CAClD,CACJ"} \ No newline at end of file diff --git a/js/spbc-settings.min.js b/js/spbc-settings.min.js index 9e7915cfe..a27eb2e36 100644 --- a/js/spbc-settings.min.js +++ b/js/spbc-settings.min.js @@ -1,2 +1,2 @@ -function spbcSwitchTab(e,t){var s=e.classList[1].replace("spbc_tab_nav-",""),n=new URLSearchParams(window.location.search),c=(n.set("spbc_tab",s),window.location.hash),c=window.location.pathname+"?"+n.toString()+c;if(history.replaceState(null,"",c),"backups"!==n.get("spbc_tab")&&jQuery(".spbc_tab_nav-backups").hide(),jQuery(".spbc_tab_nav").removeClass("spbc_tab_nav--active"),jQuery(".spbc_tab").removeClass("spbc_tab--active"),jQuery(e).addClass("spbc_tab_nav--active"),jQuery(".spbc_tab-"+s).addClass("spbc_tab--active"),jQuery(e).data("loaded")){if(t&&t.action)switch(t.action){case"highlight":spbcHighlightElement(t.target,t.times);break;case"click":setTimeout(function(){jQuery("#"+t.additional.target).click()},500)}}else{c={action:"spbc_settings__draw_elements",tab_name:s,security:spbcSettings.ajax_nonce};t={callback:spbcDrawSettingsCallback,notJson:!0,additional:t||null},spbcSendAJAXRequest(c,t,e)}}function spbcDrawSettingsCallback(e,t,s,n){jQuery(n).data("loaded",!0),jQuery(".spbc_tab-"+t.tab_name).replaceWith(e);n=jQuery(".spbc_tab-"+t.tab_name);if(n.addClass("spbc_tab--active"),jQuery(document).off("click",".spbc_long_description__show"),jQuery(document).on("click",".spbc_long_description__show",function(){spbcSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),jQuery(document).off("click",".spbc_long_recommendation__show"),jQuery(document).on("click",".spbc_long_recommendation__show",function(){spbcSettingsShowRecommendation(self=jQuery(this),self.attr("setting"))}),s.additional)switch(s.additional.action){case"highlight":spbcHighlightElement(s.additional.target,s.additional.times);break;case"click":setTimeout(function(){jQuery("#"+s.additional.target).click()},500)}jQuery(n).on("click",".spbc_hint-send_"+t.tab_name,function(){jQuery(".spbc_hint-send_"+t.tab_name).hide(),spbcSendAJAXRequest({action:"spbc_send_"+t.tab_name,tab_name:t.tab_name},{callback:spbcSendLogsCallback})}),window.location.hash&&document.getElementById(window.location.hash.substring(1)).scrollIntoView(),document.dispatchEvent(new CustomEvent("spbctTabLoaded",{bubbles:!0,detail:{tab:t.tab_name}})),"function"==typeof spbcHighlightCriticalFilesNotice&&spbcHighlightCriticalFilesNotice(!1)}function spbcSendLogsCallback(e,t,s,n){jQuery(".spbc_tab_nav-"+t.tab_name).data("loaded",!1),spbcSwitchTab(document.getElementsByClassName("spbc_tab_nav-"+t.tab_name)[0])}function spbcSettingsDependenciesbyId(e,i){"string"==typeof e&&((tmp=[]).push(e),e=tmp),i=void 0===i?null:+i,e.forEach(function(e,t,s){let n=document.getElementById("spbc_setting_"+e);function c(){n.setAttribute("disabled","disabled")}function o(){n.removeAttribute("disabled")}(null!==i?1===i?o:c:null===n.getAttribute("disabled")?c:o)()})}function spbcSettingsDependencies(e,i){e="string"==typeof e?e.split(","):e,i=void 0===i?+event.target.checked:+i,e.forEach(function(e,t,s){document.getElementsByName("spbc_settings["+e+"]").forEach(function(e,t,s){function n(){e.setAttribute("disabled","disabled")}function c(){e.removeAttribute("disabled")}(null!==i?1===i?c:n:null===e.getAttribute("disabled")?n:c)();var o=e.getAttribute("children");null!==o&&spbcSettingsDependencies(o,i&&e.checked)})})}function spbcSettingsShowDescription(e,t){function c(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_long_desc").length&&!jQuery(e.target).hasClass("spbc_long_desc__cancel")||jQuery(e.target).hasClass("spbc_long_description__show"))||(jQuery(".spbc_long_desc").remove(),jQuery(document).off("click",c))}c(),e.after("
");var s=jQuery("#spbc_long_desc__"+t);s.append("").append("
").css({top:e.position().top+25,left:e.position().left+5}),spbcSendAJAXRequest({action:"spbc_settings__get_description",setting_id:t},{spinner:s.children("img"),callback:function(e,t,s,n){n.empty().append("
").append("").append("

"+e.title+"

").append("

"+e.desc+"

"),jQuery(document).on("click",c)}},s)}function spbcSettingsShowRecommendation(e,t){function c(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_long_desc").length&&!jQuery(e.target).hasClass("spbc_long_desc__cancel")||jQuery(e.target).hasClass("spbc_long_recommendation__show"))||(jQuery(".spbc_long_desc").remove(),jQuery(document).off("click",c))}c(),e.after("
");var s=jQuery("#spbc_long_desc__"+t);s.append("").append("
").css({top:e.position().top+25,left:e.position().left+5}),spbcSendAJAXRequest({action:"spbc_settings__get_recommendation",setting_id:t},{spinner:s.children("img"),callback:function(e,t,s,n){n.empty().append("
").append("").append("

"+e.title+"

").append("

"+e.desc+"

"),jQuery(document).on("click",c)}},s)}function spbcStartShowHide(){jQuery(".spbcShortText").off("mouseover").on("mouseover",function(){jQuery(this).next().show()}).off("mouseout").on("mouseout",function(){jQuery(this).next().hide()}),jQuery(".spbcFullText").off("mouseout").on("mouseout",function(){jQuery(this).hide()}).off("mouseover").on("mouseover",function(){jQuery(this).show()})}function spbctGenerateConfirmationCode(){var e={};let t={success:!1};return e.security=spbcSettings.ajax_nonce,e.action="spbc_generate_confirmation_code",jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?t.success=!0:t.text=e.data}}),t}function spbctCheckConfirmationCode(e,t,s){let n=e;e={};e.security=spbcSettings.ajax_nonce,e.action="spbc_check_confirmation_code",e.code=jQuery("#confirmation-code input").val(),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(jQuery("[name *= 2fa__enable]").attr("checked",""),n.checked=!0,jQuery("#spbc_setting_2fa__roles").removeAttr("disabled"),jQuery("#spbc_setting_2fa__roles > option:first").attr("selected","selected"),clearTimeout(t),s.remove(),jQuery("#confirmation-code").dialog("close")):alert("Code verification failed!")}})}function spbcBannerCheck(){let c=setInterval(function(){spbcSendAJAXRequest({action:"spbc_settings__check_renew_banner"},{callback:function(e,t,s,n){e.close_renew_banner&&(jQuery("#spbc_renew_notice").length&&jQuery("#spbc_renew_notice").hide("slow"),jQuery("#spbc_trial_notice").length&&jQuery("#spbc_trial_notice").hide("slow"),clearInterval(c))}})},6e4)}function spbcToggleClass(t,s){for(let e=0;e
');let t=setTimeout(function(){jQuery("#confirmation-code--resend").removeAttr("disabled"),jQuery("#confirmation-code--resend>.circle").remove()},3e4);var s=spbctGenerateConfirmationCode();s.success?(jQuery("#confirmation-code input").val(""),jQuery("#confirmation-code").dialog({modal:!0,title:"Confirmation code",width:310,buttons:{Cancel:function(){jQuery(this).dialog("close"),clearTimeout(t),jQuery("#confirmation-code--resend>.circle").remove()},Ok:function(){spbctCheckConfirmationCode(e.target,t,jQuery("#confirmation-code--resend>.circle"))}},draggable:!1,resizable:!1})):alert(s.text)}),(jQuery("#spbc_renew_notice").length||jQuery("#spbc_trial_notice").length)&&spbcBannerCheck(),spbcSettings.key_changed&&jQuery("#spbc_button__sync").click(),jQuery(document).on("click","#spbc_setting_get_key_auto",function(){spbcSendAJAXRequest({action:"spbc_get_key_auto",ct_admin_timezone:jQuery("#spbc_admin_timezone").val()},{timeout:25e3,button:document.getElementById("spbc_setting_get_key_auto"),spinner:jQuery("#spbc_setting_get_key_auto .spbc_preloader_button"),callback:function(e,t,s,n){jQuery("#spbc_setting_get_key_auto .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_setting_get_key_auto .spbc_success").hide(300)},2e3),e.reload&&document.location.reload(),e.msg&&spbcModal.open().putError(e.msg),e.getTemplates&&(spbcModal.loaded=e.getTemplates,spbcModal.open(),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}))}})}),jQuery(document).on("click","#spbc_settings_templates_import_button",function(){jQuery("#spbc-ajax-result").remove();var e=jQuery("option:selected",jQuery("#spbc_settings_templates_import"));if(jQuery("#spbc_settings_templates_import_name").css("border-color","inherit"),void 0===e.data("id"))console.log('Attribute "data-id" not set for the option.');else{e={template_id:e.data("id"),template_name:e.data("name"),settings:e.data("settings")};let o=this;spbcSendAJAXRequest({action:"spbc_settings_templates_import",data:e},{timeout:25e3,button:o,spinner:jQuery("#spbc_settings_templates_import_button .spbc_preloader_button"),callback:function(e,t,s,n){let c;e.success?(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)),jQuery("#spbc_settings_templates_import_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_import_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)))}})}}),jQuery(document).on("click","#spbc_settings_templates_export_button",function(){jQuery("#spbc-ajax-result").remove();var t=jQuery("option:selected",jQuery("#spbc_settings_templates_export")),s=jQuery("#spbc_settings_templates_export_name");if(s.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{let e;if("new_template"===t.data("id")){var n=s.val();if(""===n)return void s.css("border-color","red");e={template_name:n}}else e={template_id:t.data("id")};let o=this;spbcSendAJAXRequest({action:"spbc_settings_templates_export",data:e},{timeout:25e3,button:o,spinner:jQuery("#spbc_settings_templates_export_button .spbc_preloader_button"),callback:function(e,t,s,n){let c;e.success?(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)),jQuery("#spbc_settings_templates_export_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_export_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)))}})}}),jQuery(document).on("click","#spbc_settings_templates_reset_button",function(){let o=this;spbcSendAJAXRequest({action:"spbc_settings_templates_reset"},{timeout:25e3,button:o,spinner:jQuery("#spbc_settings_templates_reset_button .spbc_preloader_button"),callback:function(e,t,s,n){let c;e.success?(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)),jQuery("#spbc_settings_templates_reset_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_reset_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)))}})}),jQuery(document).on("change","#spbc_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#spbc_settings_templates_export_name").show():jQuery(this).parent().parent().find("#spbc_settings_templates_export_name").hide()}),jQuery(document).on("click","#spbc-change-account-email",function(e){e.preventDefault();var e=jQuery(this),t=jQuery("#spbc-account-email"),s=t.text();spbcToggleClass(e,"active"),e.hasClass("active")?(e.text(e.data("save-text")),t.attr("contenteditable","true"),t.focus(),t.on("keydown",function(e){"Enter"===e.code&&e.preventDefault()}),t.on("input",function(e){"insertParagraph"===e.inputType&&e.preventDefault()})):(spbcSendAJAXRequest({action:"spbc_update_account_email",accountEmail:s},{timeout:5e3,callback:function(e,t,s,n){void 0!==e.success&&"ok"===e.success&&void 0!==e.manuallyLink&&jQuery("#spbc-key-manually-link").attr("href",e.manuallyLink),void 0!==e.error&&jQuery("#spbc-account-email").css("border-color","red")},errorOutput:function(e){spbcModal.loaded=e,spbcModal.open()}}),t.attr("contenteditable","false"),e.text(e.data("default-text")))}),jQuery(document).on("click",".spbct_notice-dismiss",function(e){var t=this.parentElement.classList;let s=t[t.length-1];document.querySelectorAll("."+s).forEach(e=>{e.parentElement.setAttribute("style","display:none;"),spbcSetCookie(s,1,2592e3)})})}); +function spbcSwitchTab(e,t){var s=e.classList[1].replace("spbc_tab_nav-",""),n=new URLSearchParams(window.location.search),c=(n.set("spbc_tab",s),window.location.hash),c=window.location.pathname+"?"+n.toString()+c;if(history.replaceState(null,"",c),"backups"!==n.get("spbc_tab")&&jQuery(".spbc_tab_nav-backups").hide(),jQuery(".spbc_tab_nav").removeClass("spbc_tab_nav--active"),jQuery(".spbc_tab").removeClass("spbc_tab--active"),jQuery(e).addClass("spbc_tab_nav--active"),jQuery(".spbc_tab-"+s).addClass("spbc_tab--active"),jQuery(e).data("loaded")){if(t&&t.action)switch(t.action){case"highlight":spbcHighlightElement(t.target,t.times);break;case"click":setTimeout(function(){jQuery("#"+t.additional.target).click()},500)}}else{c={action:"spbc_settings__draw_elements",tab_name:s,security:spbcSettings.ajax_nonce};t={callback:spbcDrawSettingsCallback,notJson:!0,additional:t||null},spbcSendAJAXRequest(c,t,e)}}function spbcDrawSettingsCallback(e,t,s,n){jQuery(n).data("loaded",!0),jQuery(".spbc_tab-"+t.tab_name).replaceWith(e);n=jQuery(".spbc_tab-"+t.tab_name);if(n.addClass("spbc_tab--active"),jQuery(document).off("click",".spbc_long_description__show"),jQuery(document).on("click",".spbc_long_description__show",function(){spbcSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),jQuery(document).off("click",".spbc_long_recommendation__show"),jQuery(document).on("click",".spbc_long_recommendation__show",function(){spbcSettingsShowRecommendation(self=jQuery(this),self.attr("setting"))}),s.additional)switch(s.additional.action){case"highlight":spbcHighlightElement(s.additional.target,s.additional.times);break;case"click":setTimeout(function(){jQuery("#"+s.additional.target).click()},500)}jQuery(n).on("click",".spbc_hint-send_"+t.tab_name,function(){jQuery(".spbc_hint-send_"+t.tab_name).hide(),spbcSendAJAXRequest({action:"spbc_send_"+t.tab_name,tab_name:t.tab_name},{callback:spbcSendLogsCallback})}),window.location.hash&&document.getElementById(window.location.hash.substring(1)).scrollIntoView(),document.dispatchEvent(new CustomEvent("spbctTabLoaded",{bubbles:!0,detail:{tab:t.tab_name}})),"function"==typeof spbcHighlightCriticalFilesNotice&&spbcHighlightCriticalFilesNotice(!1),spbcSaveSettingsButtonMobileLayout(),window.addEventListener("resize",e=>{spbcSaveSettingsButtonMobileLayout()})}function spbcSaveSettingsButtonMobileLayout(){var e=document.querySelector('div[name="spbc_settings--save_button_custom"]');e&&(900");var s=jQuery("#spbc_long_desc__"+t);s.append("").append("
").css({top:e.position().top+25,left:e.position().left+5}),spbcSendAJAXRequest({action:"spbc_settings__get_description",setting_id:t},{spinner:s.children("img"),callback:function(e,t,s,n){n.empty().append("
").append("").append("

"+e.title+"

").append("

"+e.desc+"

"),jQuery(document).on("click",c)}},s)}function spbcSettingsShowRecommendation(e,t){function c(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_long_desc").length&&!jQuery(e.target).hasClass("spbc_long_desc__cancel")||jQuery(e.target).hasClass("spbc_long_recommendation__show"))||(jQuery(".spbc_long_desc").remove(),jQuery(document).off("click",c))}c(),e.after("
");var s=jQuery("#spbc_long_desc__"+t);s.append("").append("
").css({top:e.position().top+25,left:e.position().left+5}),spbcSendAJAXRequest({action:"spbc_settings__get_recommendation",setting_id:t},{spinner:s.children("img"),callback:function(e,t,s,n){n.empty().append("
").append("").append("

"+e.title+"

").append("

"+e.desc+"

"),jQuery(document).on("click",c)}},s)}function spbcStartShowHide(){jQuery(".spbcShortText").off("mouseover").on("mouseover",function(){jQuery(this).next().show()}).off("mouseout").on("mouseout",function(){jQuery(this).next().hide()}),jQuery(".spbcFullText").off("mouseout").on("mouseout",function(){jQuery(this).hide()}).off("mouseover").on("mouseover",function(){jQuery(this).show()})}function spbctGenerateConfirmationCode(){var e={};let t={success:!1};return e.security=spbcSettings.ajax_nonce,e.action="spbc_generate_confirmation_code",jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?t.success=!0:t.text=e.data}}),t}function spbctCheckConfirmationCode(e,t,s){let n=e;e={};e.security=spbcSettings.ajax_nonce,e.action="spbc_check_confirmation_code",e.code=jQuery("#confirmation-code input").val(),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(jQuery("[name *= 2fa__enable]").attr("checked",""),n.checked=!0,jQuery("#spbc_setting_2fa__roles").removeAttr("disabled"),jQuery("#spbc_setting_2fa__roles > option:first").attr("selected","selected"),clearTimeout(t),s.remove(),jQuery("#confirmation-code").dialog("close")):alert("Code verification failed!")}})}function spbcBannerCheck(){let c=setInterval(function(){spbcSendAJAXRequest({action:"spbc_settings__check_renew_banner"},{callback:function(e,t,s,n){e.close_renew_banner&&(jQuery("#spbc_renew_notice").length&&jQuery("#spbc_renew_notice").hide("slow"),jQuery("#spbc_trial_notice").length&&jQuery("#spbc_trial_notice").hide("slow"),clearInterval(c))}})},6e4)}function spbcToggleClass(t,s){for(let e=0;e
');let t=setTimeout(function(){jQuery("#confirmation-code--resend").removeAttr("disabled"),jQuery("#confirmation-code--resend>.circle").remove()},3e4);var s=spbctGenerateConfirmationCode();s.success?(jQuery("#confirmation-code input").val(""),jQuery("#confirmation-code").dialog({modal:!0,title:"Confirmation code",width:310,buttons:{Cancel:function(){jQuery(this).dialog("close"),clearTimeout(t),jQuery("#confirmation-code--resend>.circle").remove()},Ok:function(){spbctCheckConfirmationCode(e.target,t,jQuery("#confirmation-code--resend>.circle"))}},draggable:!1,resizable:!1})):alert(s.text)}),(jQuery("#spbc_renew_notice").length||jQuery("#spbc_trial_notice").length)&&spbcBannerCheck(),spbcSettings.key_changed&&jQuery("#spbc_button__sync").click(),jQuery(document).on("click","#spbc_setting_get_key_auto",function(){spbcSendAJAXRequest({action:"spbc_get_key_auto",ct_admin_timezone:jQuery("#spbc_admin_timezone").val()},{timeout:25e3,button:document.getElementById("spbc_setting_get_key_auto"),spinner:jQuery("#spbc_setting_get_key_auto .spbc_preloader_button"),callback:function(e,t,s,n){jQuery("#spbc_setting_get_key_auto .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_setting_get_key_auto .spbc_success").hide(300)},2e3),e.reload&&document.location.reload(),e.msg&&spbcModal.open().putError(e.msg),e.getTemplates&&(spbcModal.loaded=e.getTemplates,spbcModal.open(),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}))}})}),jQuery(document).on("click","#spbc_settings_templates_import_button",function(){jQuery("#spbc-ajax-result").remove();var e=jQuery("option:selected",jQuery("#spbc_settings_templates_import"));if(jQuery("#spbc_settings_templates_import_name").css("border-color","inherit"),void 0===e.data("id"))console.log('Attribute "data-id" not set for the option.');else{e={template_id:e.data("id"),template_name:e.data("name"),settings:e.data("settings")};let o=this;spbcSendAJAXRequest({action:"spbc_settings_templates_import",data:e},{timeout:25e3,button:o,spinner:jQuery("#spbc_settings_templates_import_button .spbc_preloader_button"),callback:function(e,t,s,n){let c;e.success?(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)),jQuery("#spbc_settings_templates_import_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_import_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)))}})}}),jQuery(document).on("click","#spbc_settings_templates_export_button",function(){jQuery("#spbc-ajax-result").remove();var t=jQuery("option:selected",jQuery("#spbc_settings_templates_export")),s=jQuery("#spbc_settings_templates_export_name");if(s.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{let e;if("new_template"===t.data("id")){var n=s.val();if(""===n)return void s.css("border-color","red");e={template_name:n}}else e={template_id:t.data("id")};let o=this;spbcSendAJAXRequest({action:"spbc_settings_templates_export",data:e},{timeout:25e3,button:o,spinner:jQuery("#spbc_settings_templates_export_button .spbc_preloader_button"),callback:function(e,t,s,n){let c;e.success?(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)),jQuery("#spbc_settings_templates_export_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_export_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)))}})}}),jQuery(document).on("click","#spbc_settings_templates_reset_button",function(){let o=this;spbcSendAJAXRequest({action:"spbc_settings_templates_reset"},{timeout:25e3,button:o,spinner:jQuery("#spbc_settings_templates_reset_button .spbc_preloader_button"),callback:function(e,t,s,n){let c;e.success?(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)),jQuery("#spbc_settings_templates_reset_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_reset_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):(c="

"+e.data+"

",jQuery(c).insertAfter(jQuery(o)))}})}),jQuery(document).on("change","#spbc_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#spbc_settings_templates_export_name").show():jQuery(this).parent().parent().find("#spbc_settings_templates_export_name").hide()}),jQuery(document).on("click","#spbc-change-account-email",function(e){e.preventDefault();var e=jQuery(this),t=jQuery("#spbc-account-email"),s=t.text();spbcToggleClass(e,"active"),e.hasClass("active")?(e.text(e.data("save-text")),t.attr("contenteditable","true"),t.focus(),t.on("keydown",function(e){"Enter"===e.code&&e.preventDefault()}),t.on("input",function(e){"insertParagraph"===e.inputType&&e.preventDefault()})):(spbcSendAJAXRequest({action:"spbc_update_account_email",accountEmail:s},{timeout:5e3,callback:function(e,t,s,n){void 0!==e.success&&"ok"===e.success&&void 0!==e.manuallyLink&&jQuery("#spbc-key-manually-link").attr("href",e.manuallyLink),void 0!==e.error&&jQuery("#spbc-account-email").css("border-color","red")},errorOutput:function(e){spbcModal.loaded=e,spbcModal.open()}}),t.attr("contenteditable","false"),e.text(e.data("default-text")))}),jQuery(document).on("click",".spbct_notice-dismiss",function(e){var t=this.parentElement.classList;let s=t[t.length-1];document.querySelectorAll("."+s).forEach(e=>{e.parentElement.setAttribute("style","display:none;"),spbcSetCookie(s,1,2592e3)})})}); //# sourceMappingURL=spbc-settings.min.js.map diff --git a/js/spbc-settings.min.js.map b/js/spbc-settings.min.js.map index 4ab2147aa..c92ce8e2c 100644 --- a/js/spbc-settings.min.js.map +++ b/js/spbc-settings.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings.min.js","sources":["spbc-settings.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function() { // eslint-disable-line no-extend-native\n let formatted = this;\n /* eslint-disable guard-for-in */\n for ( let arg in arguments ) { // eslint-disable-line prefer-rest-params\n let beforeFormatted = formatted.substring(0, formatted.indexOf('%s', 0));\n let afterFormatted = formatted.substring(formatted.indexOf('%s', 0)+2, formatted.length);\n formatted = beforeFormatted + arguments[arg] + afterFormatted; // eslint-disable-line prefer-rest-params\n }\n return formatted;\n};\n\n/**\n * Switching tabs\n *\n * @param {object} tab\n * @param {object} params\n */\nfunction spbcSwitchTab(tab, params) {\n let tabName = tab.classList[1].replace('spbc_tab_nav-', '');\n\n // update url\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('spbc_tab', tabName);\n let hashParam = window.location.hash;\n let newRelativePathQuery = window.location.pathname + '?' + searchParams.toString() + hashParam;\n\n history.replaceState(null, '', newRelativePathQuery);\n\n // Hiding a tab 'Backups' if exist\n if (searchParams.get('spbc_tab') !== 'backups') {\n jQuery('.spbc_tab_nav-backups').hide();\n }\n\n // update active tab\n jQuery('.spbc_tab_nav').removeClass('spbc_tab_nav--active');\n jQuery('.spbc_tab').removeClass('spbc_tab--active');\n jQuery(tab).addClass('spbc_tab_nav--active');\n jQuery('.spbc_tab-' + tabName).addClass('spbc_tab--active');\n\n if (!jQuery(tab).data('loaded')) {\n let data = {\n action: 'spbc_settings__draw_elements',\n tab_name: tabName,\n security: spbcSettings.ajax_nonce,\n };\n params = {\n callback: spbcDrawSettingsCallback,\n notJson: true,\n additional: params || null,\n };\n spbcSendAJAXRequest( data, params, tab );\n } else if (params && params.action) {\n switch (params.action) {\n case 'highlight':\n spbcHighlightElement(params.target, params.times);\n break;\n case 'click':\n setTimeout(function() {\n jQuery('#'+params.additional.target).click();\n }, 500);\n break;\n }\n }\n}\n\n/**\n * Draws settings\n *\n * @param {*} result\n * @param {*} data\n * @param {*} params\n * @param {*} obj\n */\nfunction spbcDrawSettingsCallback(result, data, params, obj) {\n jQuery(obj).data('loaded', true);\n jQuery('.spbc_tab-'+data.tab_name).replaceWith(result);\n let tab = jQuery('.spbc_tab-'+data.tab_name);\n tab.addClass('spbc_tab--active');\n\n jQuery(document).off( 'click', '.spbc_long_description__show');\n jQuery(document).on('click', '.spbc_long_description__show', function() {\n self = jQuery(this);\n spbcSettingsShowDescription(self, self.attr('setting'));\n });\n\n jQuery(document).off( 'click', '.spbc_long_recommendation__show');\n jQuery(document).on('click', '.spbc_long_recommendation__show', function() {\n self = jQuery(this);\n spbcSettingsShowRecommendation(self, self.attr('setting'));\n });\n\n if (params.additional) {\n switch (params.additional.action) {\n case 'highlight':\n spbcHighlightElement(params.additional.target, params.additional.times);\n break;\n case 'click':\n setTimeout(function() {\n jQuery('#'+params.additional.target).click();\n }, 500);\n break;\n }\n }\n\n jQuery(tab).on('click', '.spbc_hint-send_'+data.tab_name, function() {\n jQuery('.spbc_hint-send_'+data.tab_name).hide();\n spbcSendAJAXRequest(\n {action: 'spbc_send_'+data.tab_name, tab_name: data.tab_name},\n {callback: spbcSendLogsCallback},\n );\n });\n\n // scroll to anchor\n if (window.location.hash) {\n document.getElementById(window.location.hash.substring(1)).scrollIntoView();\n }\n\n document.dispatchEvent(\n new CustomEvent( 'spbctTabLoaded', {\n bubbles: true,\n detail: {tab: data.tab_name},\n } ),\n );\n\n if (typeof spbcHighlightCriticalFilesNotice === 'function') {\n spbcHighlightCriticalFilesNotice(false);\n }\n}\n\n/**\n * Sends logs\n *\n * @param {*} result\n * @param {*} data\n * @param {*} params\n * @param {*} obj\n */\nfunction spbcSendLogsCallback(result, data, params, obj) {\n jQuery('.spbc_tab_nav-'+data.tab_name).data('loaded', false);\n spbcSwitchTab(document.getElementsByClassName('spbc_tab_nav-'+data.tab_name)[0]);\n}\n\n/**\n * Disables/enables settings by ID\n *\n * @param {array} settingsIDs\n * @param {number} enable\n */\nfunction spbcSettingsDependenciesbyId(settingsIDs, enable) { // eslint-disable-line no-unused-vars\n if (typeof settingsIDs === 'string') {\n tmp = [];\n tmp.push(settingsIDs);\n settingsIDs = tmp;\n }\n\n enable = typeof enable === 'undefined' ? null : +enable;\n\n settingsIDs.forEach(function(settingID, i, arr) {\n let elem = document.getElementById('spbc_setting_'+settingID);\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n if (enable !== null) {\n // Set\n enable === 1 ? doEnable() : doDisable();\n } else {\n // Switch\n elem.getAttribute('disabled') === null ? doDisable() : doEnable();\n }\n });\n}\n\n/**\n * Recursive in case children found!\n *\n * Settings dependencies\n *\n * @param {array} settingNames\n * @param {number} enable\n */\nfunction spbcSettingsDependencies(settingNames, enable) { // eslint-disable-line no-unused-vars\n // Cast settingNames to array\n settingNames = typeof settingNames === 'string' ? settingNames.split(',') : settingNames;\n enable = typeof enable === 'undefined' ? +event.target.checked : +enable;\n\n settingNames.forEach(function(settingName, i, arr) {\n document.getElementsByName('spbc_settings['+settingName+']')\n .forEach(function( elem, i, arr ) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n if (enable !== null) {\n // Set\n enable === 1 ? doEnable() : doDisable();\n } else {\n // Switch\n elem.getAttribute('disabled') === null ? doDisable() : doEnable();\n }\n\n let children = elem.getAttribute('children');\n if ( children !== null ) {\n spbcSettingsDependencies(children, enable && elem.checked);\n }\n });\n });\n}\n\n/**\n * Shows description\n *\n * @param {object} label\n * @param {string} settingId\n */\nfunction spbcSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n if (\n typeof e === 'undefined' ||\n (\n jQuery(e.target).parent('.spbc_long_desc').length == 0 ||\n jQuery(e.target).hasClass('spbc_long_desc__cancel')\n ) && !jQuery(e.target).hasClass('spbc_long_description__show')\n ) {\n jQuery('.spbc_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n removeDescFunc();\n\n label.after('
');\n let obj = jQuery('#spbc_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top + 25,\n left: label.position().left + 5,\n });\n\n\n spbcSendAJAXRequest(\n {action: 'spbc_settings__get_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * Shows recommendation\n *\n * @param {object} label\n * @param {string} settingId\n */\nfunction spbcSettingsShowRecommendation(label, settingId) {\n let removeRecommendationFunc = function(e) {\n if (\n typeof e === 'undefined' ||\n (\n jQuery(e.target).parent('.spbc_long_desc').length == 0 ||\n jQuery(e.target).hasClass('spbc_long_desc__cancel')\n ) && !jQuery(e.target).hasClass('spbc_long_recommendation__show')\n ) {\n jQuery('.spbc_long_desc').remove();\n jQuery(document).off('click', removeRecommendationFunc);\n }\n };\n\n removeRecommendationFunc();\n\n label.after('
');\n let obj = jQuery('#spbc_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top + 25,\n left: label.position().left + 5,\n });\n\n\n spbcSendAJAXRequest(\n {action: 'spbc_settings__get_recommendation', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeRecommendationFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * Shows/hides full text\n */\nfunction spbcStartShowHide() { // eslint-disable-line no-unused-vars\n jQuery('.spbcShortText')\n .off('mouseover' )\n .on('mouseover', function() {\n jQuery(this).next().show();\n })\n .off('mouseout' )\n .on('mouseout', function() {\n jQuery(this).next().hide();\n });\n jQuery('.spbcFullText')\n .off('mouseout' )\n .on('mouseout', function() {\n jQuery(this).hide();\n })\n .off('mouseover' )\n .on('mouseover', function() {\n jQuery(this).show();\n });\n}\n\n/**\n * Generate and save confirmation code\n *\n * @return {object}\n */\nfunction spbctGenerateConfirmationCode() {\n let data = {};\n let res = {};\n res.success = false;\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_generate_confirmation_code';\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 res.success = true;\n } else {\n res.text = result.data;\n }\n },\n });\n return res;\n}\n\n/**\n * Check confirmation code\n *\n * @param {object} radioButton\n * @param {number} timeout\n * @param {object} timer\n */\nfunction spbctCheckConfirmationCode( radioButton, timeout, timer ) {\n let element = radioButton;\n let data = {};\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_check_confirmation_code';\n data.code = jQuery('#confirmation-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('[name *= 2fa__enable]').attr('checked', '');\n element.checked = true;\n jQuery('#spbc_setting_2fa__roles').removeAttr('disabled');\n jQuery('#spbc_setting_2fa__roles > option:first').attr('selected', 'selected');\n clearTimeout( timeout );\n timer.remove();\n jQuery('#confirmation-code').dialog( 'close' );\n } else {\n alert('Code verification failed!');\n }\n },\n });\n}\n\n/**\n * Checking current account status for renew notice\n */\nfunction spbcBannerCheck() {\n let bannerChecker = setInterval( function() {\n spbcSendAJAXRequest(\n {action: 'spbc_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#spbc_renew_notice').length) {\n jQuery('#spbc_renew_notice').hide('slow');\n }\n if (jQuery('#spbc_trial_notice').length) {\n jQuery('#spbc_trial_notice').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 60000);\n}\n\njQuery(document).ready(function() {\n document.dispatchEvent(new CustomEvent('spbctPage', {bubbles: true}));\n document.dispatchEvent(new CustomEvent('spbctPageTabs', {bubbles: true}));\n document.dispatchEvent(new CustomEvent('spbctMobAboutCT', {bubbles: true}));\n\n jQuery('#spbc_gdpr_open_modal').on('click', function() {\n jQuery('#gdpr_dialog').dialog({\n modal: true,\n show: true,\n position: {my: 'center', at: 'center', of: window},\n width: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\n height: 'auto',\n title: 'GDPR compliance',\n draggable: false,\n resizable: false,\n closeText: 'Close',\n });\n });\n\n // Checking email receiving possibility for activation 2FA\n jQuery(document).on('click', '[name*=fa__enable]:not([value=0]),#confirmation-code--resend', function(e) {\n e.preventDefault();\n\n let view = '
' +\n '
';\n jQuery('#confirmation-code--resend').attr('disabled', 'disabled')\n .append(view);\n let enableResend = setTimeout(function() {\n jQuery('#confirmation-code--resend').removeAttr('disabled');\n jQuery('#confirmation-code--resend>.circle').remove();\n }, 30000);\n\n let res = spbctGenerateConfirmationCode();\n if ( res.success ) {\n jQuery('#confirmation-code input').val('');\n jQuery('#confirmation-code').dialog({\n modal: true,\n title: 'Confirmation code',\n width: 310,\n buttons: {\n Cancel: function() {\n jQuery( this ).dialog( 'close' );\n clearTimeout( enableResend );\n jQuery('#confirmation-code--resend>.circle').remove();\n },\n Ok: function() {\n let selector = '#confirmation-code--resend>.circle';\n spbctCheckConfirmationCode(e.target, enableResend, jQuery(selector));\n },\n },\n draggable: false,\n resizable: false,\n });\n } else {\n alert(res.text);\n }\n });\n\n if (jQuery('#spbc_renew_notice').length || jQuery('#spbc_trial_notice').length) {\n spbcBannerCheck();\n }\n\n // Sync button migrated to react\n\n if ( spbcSettings.key_changed ) {\n jQuery('#spbc_button__sync').click();\n }\n\n // Get Key Auto button\n jQuery(document).on('click', '#spbc_setting_get_key_auto', function() {\n spbcSendAJAXRequest(\n {action: 'spbc_get_key_auto', ct_admin_timezone: jQuery('#spbc_admin_timezone').val()},\n {\n timeout: 25000,\n button: document.getElementById('spbc_setting_get_key_auto' ),\n spinner: jQuery('#spbc_setting_get_key_auto .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#spbc_setting_get_key_auto .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_setting_get_key_auto .spbc_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.msg) {\n spbcModal.open().putError(result.msg);\n }\n if (result.getTemplates) {\n spbcModal.loaded = result.getTemplates;\n spbcModal.open();\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#spbc_settings_templates_import_button', function() {\n jQuery('#spbc-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_import'));\n let templateNameInput = jQuery('#spbc_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n spbcSendAJAXRequest(\n {action: 'spbc_settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#spbc_settings_templates_import_button .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n let selector;\n if (result.success) {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n jQuery('#spbc_settings_templates_import_button .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_settings_templates_import_button .spbc_success').hide(300);\n }, 2000);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n spbcModal.close();\n }, 2000);\n } else {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#spbc_settings_templates_export_button', function() {\n jQuery('#spbc-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_export'));\n let templateNameInput = jQuery('#spbc_settings_templates_export_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data;\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n spbcSendAJAXRequest(\n {action: 'spbc_settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#spbc_settings_templates_export_button .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n let selector;\n if (result.success) {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n jQuery('#spbc_settings_templates_export_button .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_settings_templates_export_button .spbc_success').hide(300);\n }, 2000);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n spbcModal.close();\n }, 2000);\n } else {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#spbc_settings_templates_reset_button', function() {\n let button = this;\n spbcSendAJAXRequest(\n {action: 'spbc_settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#spbc_settings_templates_reset_button .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n let selector;\n if (result.success) {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n jQuery('#spbc_settings_templates_reset_button .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_settings_templates_reset_button .spbc_success').hide(300);\n }, 2000);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n spbcModal.close();\n }, 2000);\n } else {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n jQuery(document).on('change', '#spbc_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#spbc_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#spbc_settings_templates_export_name').hide();\n }\n });\n\n //* TAB_CONTROL\n // migrated to react\n //* / REFRESH TAB IF ctrl+F5 END\n\n /**\n * Change cleantalk account email\n */\n jQuery(document).on('click', '#spbc-change-account-email', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#spbc-account-email');\n let accountEmail = accountEmailField.text();\n\n spbcToggleClass($this, 'active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.focus();\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n spbcSendAJAXRequest(\n {\n action: 'spbc_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#spbc-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#spbc-account-email').css('border-color', 'red');\n }\n },\n errorOutput: function(msg) {\n spbcModal.loaded = msg;\n spbcModal.open();\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n jQuery(document).on('click', '.spbct_notice-dismiss', function(e) {\n let classListNotice = this.parentElement.classList;\n let classNoticeForClose = classListNotice[classListNotice.length - 1];\n\n document.querySelectorAll('.' + classNoticeForClose).forEach((element) => {\n element.parentElement.setAttribute('style', 'display:none;');\n spbcSetCookie(classNoticeForClose, 1, 86400 * 30);\n });\n });\n});\n\n/**\n * Toggle class for DOM elements\n * @param {Array} arr\n * @param {string} className\n * @return {void}\n */\nfunction spbcToggleClass(arr, className) {\n for (let i=0; i {\n spbcSaveSettingsButtonMobileLayout();\n });\n}\n\n/**\n * A chunk to hide the custom element \"submit button\" on large screen or make sticky on mobile\n */\nfunction spbcSaveSettingsButtonMobileLayout() {\n const selector = document.querySelector('div[name=\"spbc_settings--save_button_custom\"]');\n if (selector) {\n if (window.innerWidth > 900) {\n selector.style.display = 'none';\n } else {\n selector.style.display = 'flex';\n }\n }\n}\n\n/**\n * Sends logs\n *\n * @param {*} result\n * @param {*} data\n * @param {*} params\n * @param {*} obj\n */\nfunction spbcSendLogsCallback(result, data, params, obj) {\n jQuery('.spbc_tab_nav-'+data.tab_name).data('loaded', false);\n spbcSwitchTab(document.getElementsByClassName('spbc_tab_nav-'+data.tab_name)[0]);\n}\n\n/**\n * Disables/enables settings by ID\n *\n * @param {array} settingsIDs\n * @param {number} enable\n */\nfunction spbcSettingsDependenciesbyId(settingsIDs, enable) { // eslint-disable-line no-unused-vars\n if (typeof settingsIDs === 'string') {\n tmp = [];\n tmp.push(settingsIDs);\n settingsIDs = tmp;\n }\n\n enable = typeof enable === 'undefined' ? null : +enable;\n\n settingsIDs.forEach(function(settingID, i, arr) {\n let elem = document.getElementById('spbc_setting_'+settingID);\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n if (enable !== null) {\n // Set\n enable === 1 ? doEnable() : doDisable();\n } else {\n // Switch\n elem.getAttribute('disabled') === null ? doDisable() : doEnable();\n }\n });\n}\n\n/**\n * Recursive in case children found!\n *\n * Settings dependencies\n *\n * @param {array} settingNames\n * @param {number} enable\n */\nfunction spbcSettingsDependencies(settingNames, enable) { // eslint-disable-line no-unused-vars\n // Cast settingNames to array\n settingNames = typeof settingNames === 'string' ? settingNames.split(',') : settingNames;\n enable = typeof enable === 'undefined' ? +event.target.checked : +enable;\n\n settingNames.forEach(function(settingName, i, arr) {\n document.getElementsByName('spbc_settings['+settingName+']')\n .forEach(function( elem, i, arr ) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n if (enable !== null) {\n // Set\n enable === 1 ? doEnable() : doDisable();\n } else {\n // Switch\n elem.getAttribute('disabled') === null ? doDisable() : doEnable();\n }\n\n let children = elem.getAttribute('children');\n if ( children !== null ) {\n spbcSettingsDependencies(children, enable && elem.checked);\n }\n });\n });\n}\n\n/**\n * Shows description\n *\n * @param {object} label\n * @param {string} settingId\n */\nfunction spbcSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n if (\n typeof e === 'undefined' ||\n (\n jQuery(e.target).parent('.spbc_long_desc').length == 0 ||\n jQuery(e.target).hasClass('spbc_long_desc__cancel')\n ) && !jQuery(e.target).hasClass('spbc_long_description__show')\n ) {\n jQuery('.spbc_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n removeDescFunc();\n\n label.after('
');\n let obj = jQuery('#spbc_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top + 25,\n left: label.position().left + 5,\n });\n\n\n spbcSendAJAXRequest(\n {action: 'spbc_settings__get_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * Shows recommendation\n *\n * @param {object} label\n * @param {string} settingId\n */\nfunction spbcSettingsShowRecommendation(label, settingId) {\n let removeRecommendationFunc = function(e) {\n if (\n typeof e === 'undefined' ||\n (\n jQuery(e.target).parent('.spbc_long_desc').length == 0 ||\n jQuery(e.target).hasClass('spbc_long_desc__cancel')\n ) && !jQuery(e.target).hasClass('spbc_long_recommendation__show')\n ) {\n jQuery('.spbc_long_desc').remove();\n jQuery(document).off('click', removeRecommendationFunc);\n }\n };\n\n removeRecommendationFunc();\n\n label.after('
');\n let obj = jQuery('#spbc_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top + 25,\n left: label.position().left + 5,\n });\n\n\n spbcSendAJAXRequest(\n {action: 'spbc_settings__get_recommendation', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeRecommendationFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * Shows/hides full text\n */\nfunction spbcStartShowHide() { // eslint-disable-line no-unused-vars\n jQuery('.spbcShortText')\n .off('mouseover' )\n .on('mouseover', function() {\n jQuery(this).next().show();\n })\n .off('mouseout' )\n .on('mouseout', function() {\n jQuery(this).next().hide();\n });\n jQuery('.spbcFullText')\n .off('mouseout' )\n .on('mouseout', function() {\n jQuery(this).hide();\n })\n .off('mouseover' )\n .on('mouseover', function() {\n jQuery(this).show();\n });\n}\n\n/**\n * Generate and save confirmation code\n *\n * @return {object}\n */\nfunction spbctGenerateConfirmationCode() {\n let data = {};\n let res = {};\n res.success = false;\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_generate_confirmation_code';\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 res.success = true;\n } else {\n res.text = result.data;\n }\n },\n });\n return res;\n}\n\n/**\n * Check confirmation code\n *\n * @param {object} radioButton\n * @param {number} timeout\n * @param {object} timer\n */\nfunction spbctCheckConfirmationCode( radioButton, timeout, timer ) {\n let element = radioButton;\n let data = {};\n data.security = spbcSettings.ajax_nonce;\n data.action = 'spbc_check_confirmation_code';\n data.code = jQuery('#confirmation-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('[name *= 2fa__enable]').attr('checked', '');\n element.checked = true;\n jQuery('#spbc_setting_2fa__roles').removeAttr('disabled');\n jQuery('#spbc_setting_2fa__roles > option:first').attr('selected', 'selected');\n clearTimeout( timeout );\n timer.remove();\n jQuery('#confirmation-code').dialog( 'close' );\n } else {\n alert('Code verification failed!');\n }\n },\n });\n}\n\n/**\n * Checking current account status for renew notice\n */\nfunction spbcBannerCheck() {\n let bannerChecker = setInterval( function() {\n spbcSendAJAXRequest(\n {action: 'spbc_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#spbc_renew_notice').length) {\n jQuery('#spbc_renew_notice').hide('slow');\n }\n if (jQuery('#spbc_trial_notice').length) {\n jQuery('#spbc_trial_notice').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 60000);\n}\n\njQuery(document).ready(function() {\n document.dispatchEvent(new CustomEvent('spbctPage', {bubbles: true}));\n document.dispatchEvent(new CustomEvent('spbctPageTabs', {bubbles: true}));\n document.dispatchEvent(new CustomEvent('spbctMobAboutCT', {bubbles: true}));\n\n jQuery('#spbc_gdpr_open_modal').on('click', function() {\n jQuery('#gdpr_dialog').dialog({\n modal: true,\n show: true,\n position: {my: 'center', at: 'center', of: window},\n width: +(jQuery('#wpbody').width() / 100 * 70), // 70% of #wpbody\n height: 'auto',\n title: 'GDPR compliance',\n draggable: false,\n resizable: false,\n closeText: 'Close',\n });\n });\n\n // Checking email receiving possibility for activation 2FA\n jQuery(document).on('click', '[name*=fa__enable]:not([value=0]),#confirmation-code--resend', function(e) {\n e.preventDefault();\n\n let view = '
' +\n '
';\n jQuery('#confirmation-code--resend').attr('disabled', 'disabled')\n .append(view);\n let enableResend = setTimeout(function() {\n jQuery('#confirmation-code--resend').removeAttr('disabled');\n jQuery('#confirmation-code--resend>.circle').remove();\n }, 30000);\n\n let res = spbctGenerateConfirmationCode();\n if ( res.success ) {\n jQuery('#confirmation-code input').val('');\n jQuery('#confirmation-code').dialog({\n modal: true,\n title: 'Confirmation code',\n width: 310,\n buttons: {\n Cancel: function() {\n jQuery( this ).dialog( 'close' );\n clearTimeout( enableResend );\n jQuery('#confirmation-code--resend>.circle').remove();\n },\n Ok: function() {\n let selector = '#confirmation-code--resend>.circle';\n spbctCheckConfirmationCode(e.target, enableResend, jQuery(selector));\n },\n },\n draggable: false,\n resizable: false,\n });\n } else {\n alert(res.text);\n }\n });\n\n if (jQuery('#spbc_renew_notice').length || jQuery('#spbc_trial_notice').length) {\n spbcBannerCheck();\n }\n\n // Sync button migrated to react\n\n if ( spbcSettings.key_changed ) {\n jQuery('#spbc_button__sync').click();\n }\n\n // Get Key Auto button\n jQuery(document).on('click', '#spbc_setting_get_key_auto', function() {\n spbcSendAJAXRequest(\n {action: 'spbc_get_key_auto', ct_admin_timezone: jQuery('#spbc_admin_timezone').val()},\n {\n timeout: 25000,\n button: document.getElementById('spbc_setting_get_key_auto' ),\n spinner: jQuery('#spbc_setting_get_key_auto .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#spbc_setting_get_key_auto .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_setting_get_key_auto .spbc_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.msg) {\n spbcModal.open().putError(result.msg);\n }\n if (result.getTemplates) {\n spbcModal.loaded = result.getTemplates;\n spbcModal.open();\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#spbc_settings_templates_import_button', function() {\n jQuery('#spbc-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_import'));\n let templateNameInput = jQuery('#spbc_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n spbcSendAJAXRequest(\n {action: 'spbc_settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#spbc_settings_templates_import_button .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n let selector;\n if (result.success) {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n jQuery('#spbc_settings_templates_import_button .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_settings_templates_import_button .spbc_success').hide(300);\n }, 2000);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n spbcModal.close();\n }, 2000);\n } else {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#spbc_settings_templates_export_button', function() {\n jQuery('#spbc-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#spbc_settings_templates_export'));\n let templateNameInput = jQuery('#spbc_settings_templates_export_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data;\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n spbcSendAJAXRequest(\n {action: 'spbc_settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#spbc_settings_templates_export_button .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n let selector;\n if (result.success) {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n jQuery('#spbc_settings_templates_export_button .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_settings_templates_export_button .spbc_success').hide(300);\n }, 2000);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n spbcModal.close();\n }, 2000);\n } else {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#spbc_settings_templates_reset_button', function() {\n let button = this;\n spbcSendAJAXRequest(\n {action: 'spbc_settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#spbc_settings_templates_reset_button .spbc_preloader_button' ),\n callback: function(result, data, params, obj) {\n let selector;\n if (result.success) {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n jQuery('#spbc_settings_templates_reset_button .spbc_success').show(300);\n setTimeout(function() {\n jQuery('#spbc_settings_templates_reset_button .spbc_success').hide(300);\n }, 2000);\n document.addEventListener('spbcModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n spbcModal.close();\n }, 2000);\n } else {\n selector = '

' + result.data + '

';\n jQuery( selector ).insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n jQuery(document).on('change', '#spbc_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#spbc_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#spbc_settings_templates_export_name').hide();\n }\n });\n\n //* TAB_CONTROL\n // migrated to react\n //* / REFRESH TAB IF ctrl+F5 END\n\n /**\n * Change cleantalk account email\n */\n jQuery(document).on('click', '#spbc-change-account-email', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#spbc-account-email');\n let accountEmail = accountEmailField.text();\n\n spbcToggleClass($this, 'active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.focus();\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n spbcSendAJAXRequest(\n {\n action: 'spbc_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#spbc-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#spbc-account-email').css('border-color', 'red');\n }\n },\n errorOutput: function(msg) {\n spbcModal.loaded = msg;\n spbcModal.open();\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n jQuery(document).on('click', '.spbct_notice-dismiss', function(e) {\n let classListNotice = this.parentElement.classList;\n let classNoticeForClose = classListNotice[classListNotice.length - 1];\n\n document.querySelectorAll('.' + classNoticeForClose).forEach((element) => {\n element.parentElement.setAttribute('style', 'display:none;');\n spbcSetCookie(classNoticeForClose, 1, 86400 * 30);\n });\n });\n});\n\n/**\n * Toggle class for DOM elements\n * @param {Array} arr\n * @param {string} className\n * @return {void}\n */\nfunction spbcToggleClass(arr, className) {\n for (let i=0; i");var c=jQuery(".spbc_popup_tip--wrapper");c.empty().append("
").css({top:e.position().top-2,left:e.position().left+25}),c.append("").append("

"+o+"

").append("

"+n+"

"),jQuery(document).on("click",t),e.parents("tr").on("mouseout",t)}function spbcScannerButtonFileViewEvent(e){var e=jQuery(e),o={action:"spbc_scanner_file_view",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbcScannerButtonViewCallback,errorOutput:function(e){spbcModal.open().putError(e)}};spbcSendAJAXRequest(o,e)}function spbcScannerAnalysisLogDeleteFromLog(e){let n=[];var o=jQuery(e);let t;if(jQuery(e).hasClass("tbl-row_action"))n.push(o.parents(".row-actions").attr("uid")),t=o.parent().siblings(".tbl-preloader--tiny");else{e=o.closest("#spbc_tbl__scanner_analysis_log").find(".cb-select:checked");if(0===e.length)return void alert("Please, select elements.");e.each(function(e,o){o=jQuery(o).val();n.push(o)}),t=o.children(".tbl-preloader--small")}e={action:"spbc_scanner_analysis_log_delete_from_log",file_ids:n},o={spinner:t,callback:function(){window.location.reload()}};spbcSendAJAXRequest(e,o)}function spbcScannerButtonPageViewEvent(e){var e=jQuery(e),o={action:"spbc_scanner_page_view",page_url:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbcScannerButtonViewCallback,errorOutput:function(e){spbcModal.open().putError(e)}},n=jQuery("#wpwrap"),t=jQuery("#spbc_dialog"),c=(t.dialog({modal:!0,title:"Loading..",position:{my:"center top",at:"center top+100px",of:window},width:n.width()/100*90,show:{effect:"blind",duration:500},draggable:!1,resizable:!1,closeText:"X",classes:{"ui-dialog":"spbc---top"},open:function(e,o){e.target.style.overflow="auto",jQuery("#spbc_dialog").height(document.documentElement.clientHeight/100*25)},beforeClose:function(e,o){document.body.style.overflow="auto",jQuery("#spbc_dialog").empty()}}),t.append('Wait for downloading'),jQuery("#spbc_file_view_preloader")),n=4e-4*n.width();c.height(128*n),c.width(128*n),c.css({left:t.width()/2-128*n/2}),c.css({top:t.height()/2-128*n/2}),spbcSendAJAXRequest(o,e)}function spbcScannerButtonViewCallback(e){var o,n=jQuery("#spbc_dialog"),t=(n.empty(),jQuery("#spbc_file_view_preloader").css({display:"none"}),'
%s');for(o in t+='

%s


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


','
'),i=(r=r+'%s'+'

%s


',[]),l=[];for(c in o.weak_spots=JSON.parse(o.weak_spots),o.weak_spots)i[c]=Object.keys(o.weak_spots[c]);for(key in t=Object.keys(i).sort())l[t[key]]=i[t[key]];for(a in l){var p,_="spbc-dialog-row-header-"+a.toLowerCase(),u='',d=(u+=a+" weakspots:",jQuery("#spbc_dialog")),u=(d.append(s.printf("",u)),d.append(s.printf("...","...")),d.find("#"+_));for(p in u.parent().parent().css("text-align","center"),u.parent().parent().css("border","1px dotted"),u.parent().parent().css("background","darkgrey"),i[a]){p=[...new Set(p)].sort();var b,f=+i[a][p];for(let e=f-2;e<=2+f;e++)void 0!==o.file[e]&&(b=f===e?'
%s

%s


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

%s


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

%s


':s,o=p&&!c.file[n].includes("iframe")?e.printf(n,i.get(t[r])):e.printf(n,c.file[n]),jQuery("#spbc_dialog").append(o)}jQuery("#spbc_dialog").append(s.printf("","")),jQuery("#spbc_dialog div").last().remove()}}else jQuery("#spbc_dialog").append('
%s
'.printf(c.content)),n=()=>{document.location.reload()};var t=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,_=document.documentElement.clientHeight/100*75;let u=t<_?"no_scroll":"scroll";jQuery("#spbc_dialog").dialog({modal:!0,title:c.file_path,position:{my:"center top",at:"center top+100px",of:window},width:jQuery("#wpwrap").width()/100*90,show:{effect:"blind",duration:500},draggable:!0,resizable:!1,closeText:"X",classes:{"ui-dialog":"spbc---top"},open:function(e,o){e.target.style.overflow=u,jQuery("#spbc_dialog").height("auto"),jQuery(".ui-widget-overlay").on("click",function(){jQuery("#spbc_dialog").dialog("close")})},beforeClose:function(e,o){document.body.style.overflow="auto",jQuery("#spbc_dialog").empty()},close:n})}function spbcScannerButtonFileCompareEvent(e){var e=jQuery(e),o={action:"spbc_scanner_file_compare",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbcScannerButtonFileCompareCallback,errorOutput:function(e){spbcModal.open().putError(e)}};spbcSendAJAXRequest(o,e)}function spbcScannerButtonFileCompareCallback(n,e,o){console.log("FILE_COMPARED");var t='
',c='
',a=(c=c+'

%s

%s'+'

%s


',(t=t+'

%s

%s'+'

%s


').printf('Modified',"Line",'Original'));jQuery("#spbc_dialog").append(a);for(let o=1;void 0!==n.file[o]||void 0!==n.file_original[o];o++)if(void 0===n.file[o]&&(n.file[o]=""),void 0===n.file_original[o]&&(n.file_original[o]=""),-1!=n.difference.indexOf(o)){for(let e=o-2;e<=o+2;e++)void 0!==n.file[e]&&void 0!==n.file_original[o]&&jQuery("#spbc_dialog").append((o===e?c:t).printf(n.file[e]||"",e,n.file_original[e]||""));jQuery("#spbc_dialog").append(t.printf("","",""))}var a=19*jQuery("#spbc_dialog div").length+19,s=document.documentElement.clientHeight/100*75;let r=a{document.getElementById("spbc_scanner__last_scan_info").innerText=e.data}})}function spbcScannerButtonCureFileAjaxHandler(e){e={action:"spbc_file_cure_ajax_action",file_fast_hash:jQuery(e).parents(".row-actions").attr("uid"),security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(spbcModal.open().put(e.data),document.addEventListener("spbcModalClosed",function(e){document.location.reload()})):spbcModal.open().putError(e.data)}})}function spbcScannerButtonRestoreFromBackupAjaxHandler(e){e={action:"spbc_restore_file_from_backup_ajax_action",file_fast_hash:jQuery(e).parents(".row-actions").attr("uid"),security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(spbcModal.open().put(e.data),document.addEventListener("spbcModalClosed",function(e){document.location.reload()})):spbcModal.open().putError(e.data)}})}function spbcScannerButtonClearScanResults(){confirm("Do you confirm to clear the scan results?")&&(console.log("CLEAR"),spbcSendAJAXRequest({action:"spbc_scanner_clear"},{type:"GET",successCallback:function(){document.location=document.location},complete:null,errorOutput:null,context:this,timeout:4e4,success:function(){document.location.reload()}}))}function spbcScannerCopyLogToClipboardHint(e){jQuery("#spbc_scanner_copy_log_to_clipboard_hint").text(e),jQuery("#spbc_scanner_copy_log_to_clipboard_hint").show(),jQuery("#spbc_scanner_copy_log_to_clipboard_hint").animate({opacity:0},3e3,function(){jQuery(this).hide(),jQuery(this).css("opacity",1)})}jQuery(document).ready(function(){spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen(),spbcStartShowHide(),jQuery("#spbc_scaner_progress_bar").progressbar({value:0,create:function(e,o){e.target.style.position="relative",e.target.style.marginBottom="12px"},change:function(e,o){jQuery(".spbc_progressbar_counter span").text(jQuery(e.target).progressbar("option","value")+" %")}}),jQuery("#spbc_scan_accordion").accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1,activate:function(e,o){0===o.oldPanel.length&&0===o.oldHeader.length&&jQuery("#spbc_scan_accordion").accordion("option","classes.ui-accordion-content","ui-corner-bottom spbc-overflow--visible")},beforeActivate:function(e,o){1===o.oldPanel.length&&1===o.oldHeader.length&&jQuery("#spbc_scan_accordion").accordion("option","classes.ui-accordion-content","ui-corner-bottom")}}),window.spbcScanner=new SpbcMalwareScanner({settings:spbcScaner.settings,states:spbcScaner.states,button:jQuery("#spbc_perform_scan"),spinner:jQuery("#spbc_perform_scan").next(),callback:null,progress_overall:jQuery("#spbc_scaner_progress_overall"),progressbar:jQuery("#spbc_scaner_progress_bar"),progressbar_text:jQuery(".spbc_progressbar_counter span"),wrapper:document.getElementsByClassName("spbc_unchecked_file_list"),warnings:{long_scan:jQuery(".spbc_hint_warning__long_scan"),outdated:jQuery(".spbc_hint_warning__outdated")}}),jQuery(document).on("click",".spbc_popup_tip--icon---show",function(){spbcPopupTipShow(jQuery(this))}),jQuery("#spbc_perform_scan").on("click",function(){jQuery("#spbcscan-results-log-module").remove(),spbcScanner.actionControl(),jQuery(".spbc_log-wrapper .panel-body").length||jQuery(".spbc_log-wrapper").append('
'),jQuery(".spbc_log-wrapper").resizable({handles:"n, s",containment:"document"})}),jQuery("#spbcscan-results-log-module").resizable({handles:"n, s",containment:"document"}),jQuery("#spbc_scanner_clear").on("click",function(){confirm("Do you confirm to clear the scan results?")&&(console.log("CLEAR"),spbcSendAJAXRequest({action:"spbc_scanner_clear"},{type:"GET",successCallback:function(){document.location=document.location},complete:null,errorOutput:null,context:this,timeout:4e4,success:function(){document.location.reload()}}))}),jQuery("#spbc_scanner_save_to_pdf").on("click",function(){jQuery.ajax({url:spbcSettings.ajaxurl,type:"POST",data:{action:"spbc_scanner_save_to_pdf",security:spbcSettings.ajax_nonce,no_cache:Math.random()},xhrFields:{responseType:"blob"},success:function(t){jQuery.ajax({url:spbcSettings.ajaxurl,type:"POST",data:{action:"spbc_scanner_get_pdf_file_name",security:spbcSettings.ajax_nonce,no_cache:Math.random()},xhrFields:{responseType:"text"},success:function(e){var o=new Blob([t]),n=document.createElement("a");n.href=window.URL.createObjectURL(o),n.download=e.data,n.click()}})}})}),jQuery("#spbc_scanner_copy_log_to_clipboard").length&&jQuery("#spbc_scanner_copy_log_to_clipboard").on("click",function(e){if(e.preventDefault(),navigator.clipboard){let e=jQuery("#spbcscan-results-log-module .panel-body").html().replace(//g,"").replace(/<\/b>/g,"");e=e.replace(/

/g,"\n").replace(/<\/p>/g,""),navigator.clipboard.writeText(e).then(()=>{spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint)}).catch(e=>{spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_failed)})}else spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_unsupported)})}); +function spbcPopupTipShow(e){var o=e.attr("spbc_tip_title")||null,n=e.attr("spbc_tip_text")||null;function t(e){void 0!==e&&0!=jQuery(e.target).parent(".spbc_popup_tip--wrapper").length&&!jQuery(e.target).hasClass("spbc_popup_tip--icon---cancel")||(jQuery(".spbc_popup_tip--wrapper").hide(),jQuery(document).off("click",t))}t(),e.after("

");var c=jQuery(".spbc_popup_tip--wrapper");c.empty().append("
").css({top:e.position().top-2,left:e.position().left+25}),c.append("").append("

"+o+"

").append("

"+n+"

"),jQuery(document).on("click",t),e.parents("tr").on("mouseout",t)}function spbcScannerButtonFileViewEvent(e){var e=jQuery(e),o={action:"spbc_scanner_file_view",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbcScannerButtonViewCallback,errorOutput:function(e){spbcModal.open().putError(e)}};spbcSendAJAXRequest(o,e)}function spbcScannerAnalysisLogDeleteFromLog(e){let n=[];var o=jQuery(e);let t;if(jQuery(e).hasClass("tbl-row_action"))n.push(o.parents(".row-actions").attr("uid")),t=o.parent().siblings(".tbl-preloader--tiny");else{e=o.closest("#spbc_tbl__scanner_analysis_log").find(".cb-select:checked");if(0===e.length)return void alert("Please, select elements.");e.each(function(e,o){o=jQuery(o).val();n.push(o)}),t=o.children(".tbl-preloader--small")}e={action:"spbc_scanner_analysis_log_delete_from_log",file_ids:n},o={spinner:t,callback:function(){window.location.reload()}};spbcSendAJAXRequest(e,o)}function spbcScannerButtonPageViewEvent(e){var e=jQuery(e),o={action:"spbc_scanner_page_view",page_url:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbcScannerButtonViewCallback,errorOutput:function(e){spbcModal.open().putError(e)}},n=jQuery("#wpwrap"),t=jQuery("#spbc_dialog"),c=(t.dialog({modal:!0,title:"Loading..",position:{my:"center top",at:"center top+100px",of:window},width:n.width()/100*90,show:{effect:"blind",duration:500},draggable:!1,resizable:!1,closeText:"X",classes:{"ui-dialog":"spbc---top"},open:function(e,o){e.target.style.overflow="auto",jQuery("#spbc_dialog").height(document.documentElement.clientHeight/100*25)},beforeClose:function(e,o){document.body.style.overflow="auto",jQuery("#spbc_dialog").empty()}}),t.append('Wait for downloading'),jQuery("#spbc_file_view_preloader")),n=4e-4*n.width();c.height(128*n),c.width(128*n),c.css({left:t.width()/2-128*n/2}),c.css({top:t.height()/2-128*n/2}),spbcSendAJAXRequest(o,e)}function spbcScannerButtonViewCallback(e){var o,n=jQuery("#spbc_dialog"),t=(n.empty(),jQuery("#spbc_file_view_preloader").css({display:"none"}),'
%s');for(o in t+='

%s


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


','
'),i=(r=r+'%s'+'

%s


',[]),p=[];for(c in o.weak_spots=JSON.parse(o.weak_spots),o.weak_spots)i[c]=Object.keys(o.weak_spots[c]);for(key in t=Object.keys(i).sort())p[t[key]]=i[t[key]];for(s in p){var l,_="spbc-dialog-row-header-"+s.toLowerCase(),u='',d=(u+=s+" weakspots:",jQuery("#spbc_dialog")),u=(d.append(a.printf("",u)),d.append(a.printf("...","...")),d.find("#"+_));for(l in u.parent().parent().css("text-align","center"),u.parent().parent().css("border","1px dotted"),u.parent().parent().css("background","darkgrey"),i[s]){l=[...new Set(l)].sort();var b,f=+i[s][l];for(let e=f-2;e<=2+f;e++)void 0!==o.file[e]&&(b=f===e?'
%s

%s


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

%s


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

%s


':a,o=l&&!c.file[n].includes("iframe")?e.printf(n,i.get(t[r])):e.printf(n,c.file[n]),jQuery("#spbc_dialog").append(o)}jQuery("#spbc_dialog").append(a.printf("","")),jQuery("#spbc_dialog div").last().remove()}}else jQuery("#spbc_dialog").append('
%s
'.printf(c.content)),n=()=>{document.location.reload()};var t=19*jQuery("#spbc_dialog div").length<76?76:19*jQuery("#spbc_dialog div").length,_=document.documentElement.clientHeight/100*75;let u=t<_?"no_scroll":"scroll";jQuery("#spbc_dialog").dialog({modal:!0,title:c.file_path,position:{my:"center top",at:"center top+100px",of:window},width:jQuery("#wpwrap").width()/100*90,show:{effect:"blind",duration:500},draggable:!0,resizable:!1,closeText:"X",classes:{"ui-dialog":"spbc---top"},open:function(e,o){e.target.style.overflow=u,jQuery("#spbc_dialog").height("auto"),jQuery(".ui-widget-overlay").on("click",function(){jQuery("#spbc_dialog").dialog("close")})},beforeClose:function(e,o){document.body.style.overflow="auto",jQuery("#spbc_dialog").empty()},close:n})}function spbcScannerButtonFileCompareEvent(e){var e=jQuery(e),o={action:"spbc_scanner_file_compare",file_id:e.parents(".row-actions").attr("uid")},e={spinner:e.parent().siblings(".tbl-preloader--tiny"),callback:spbcScannerButtonFileCompareCallback,errorOutput:function(e){spbcModal.open().putError(e)}};spbcSendAJAXRequest(o,e)}function spbcScannerButtonFileCompareCallback(n,e,o){console.log("FILE_COMPARED");var t='
',c='
',s=(c=c+'

%s

%s'+'

%s


',(t=t+'

%s

%s'+'

%s


').printf('Modified',"Line",'Original'));jQuery("#spbc_dialog").append(s);for(let o=1;void 0!==n.file[o]||void 0!==n.file_original[o];o++)if(void 0===n.file[o]&&(n.file[o]=""),void 0===n.file_original[o]&&(n.file_original[o]=""),-1!=n.difference.indexOf(o)){for(let e=o-2;e<=o+2;e++)void 0!==n.file[e]&&void 0!==n.file_original[o]&&jQuery("#spbc_dialog").append((o===e?c:t).printf(n.file[e]||"",e,n.file_original[e]||""));jQuery("#spbc_dialog").append(t.printf("","",""))}var s=19*jQuery("#spbc_dialog div").length+19,a=document.documentElement.clientHeight/100*75;let r=s{document.getElementById("spbc_scanner__last_scan_info").innerText=e.data}})}function spbcScannerButtonCureFileAjaxHandler(e){e={action:"spbc_file_cure_ajax_action",file_fast_hash:jQuery(e).parents(".row-actions").attr("uid"),security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(spbcModal.open().put(e.data),document.addEventListener("spbcModalClosed",function(e){document.location.reload()})):spbcModal.open().putError(e.data)}})}function spbcScannerButtonRestoreFromBackupAjaxHandler(e){e={action:"spbc_restore_file_from_backup_ajax_action",file_fast_hash:jQuery(e).parents(".row-actions").attr("uid"),security:spbcSettings.ajax_nonce};jQuery.ajax({type:"POST",async:!0,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(spbcModal.open().put(e.data),document.addEventListener("spbcModalClosed",function(e){document.location.reload()})):spbcModal.open().putError(e.data)}})}function spbcScannerButtonClearScanResults(){confirm("Do you confirm to clear the scan results?")&&(console.log("CLEAR"),spbcSendAJAXRequest({action:"spbc_scanner_clear"},{type:"GET",successCallback:function(){document.location=document.location},complete:null,errorOutput:null,context:this,timeout:4e4,success:function(){document.location.reload()}}))}function spbcScannerCopyLogToClipboardHint(e){jQuery("#spbc_scanner_copy_log_to_clipboard_hint").text(e),jQuery("#spbc_scanner_copy_log_to_clipboard_hint").show(),jQuery("#spbc_scanner_copy_log_to_clipboard_hint").animate({opacity:0},3e3,function(){jQuery(this).hide(),jQuery(this).css("opacity",1)})}jQuery(document).ready(function(){spbcTblBulkActionsListen(),spbcTblRowActionsListen(),spbcTblPaginationListen(),spbcTblSortListen(),spbcStartShowHide(),jQuery("#spbc_scaner_progress_bar").progressbar({value:0,create:function(e,o){e.target.style.position="relative",e.target.style.marginBottom="12px"},change:function(e,o){jQuery(".spbc_progressbar_counter span").text(jQuery(e.target).progressbar("option","value")+" %")}}),jQuery("#spbc_scan_accordion").accordion({header:"h3",heightStyle:"content",collapsible:!0,active:!1,activate:function(e,o){jQuery("#spbc_scan_accordion").accordion("option","classes.ui-accordion-content","ui-corner-bottom spbc-overflow--visible")},beforeActivate:function(e,o){jQuery("#spbc_scan_accordion").accordion("option","classes.ui-accordion-content","ui-corner-bottom")}}),window.spbcScanner=new SpbcMalwareScanner({settings:spbcScaner.settings,states:spbcScaner.states,button:jQuery("#spbc_perform_scan"),spinner:jQuery("#spbc_perform_scan").next(),callback:null,progress_overall:jQuery("#spbc_scaner_progress_overall"),progressbar:jQuery("#spbc_scaner_progress_bar"),progressbar_text:jQuery(".spbc_progressbar_counter span"),wrapper:document.getElementsByClassName("spbc_unchecked_file_list"),warnings:{long_scan:jQuery(".spbc_hint_warning__long_scan"),outdated:jQuery(".spbc_hint_warning__outdated")}}),jQuery(document).on("click",".spbc_popup_tip--icon---show",function(){spbcPopupTipShow(jQuery(this))}),jQuery("#spbc_perform_scan").on("click",function(){jQuery("#spbcscan-results-log-module").remove(),spbcScanner.actionControl(),jQuery(".spbc_log-wrapper .panel-body").length||jQuery(".spbc_log-wrapper").append('
'),jQuery(".spbc_log-wrapper").resizable({handles:"n, s",containment:"document"})}),jQuery("#spbcscan-results-log-module").resizable({handles:"n, s",containment:"document"}),jQuery("#spbc_scanner_clear").on("click",function(){confirm("Do you confirm to clear the scan results?")&&(console.log("CLEAR"),spbcSendAJAXRequest({action:"spbc_scanner_clear"},{type:"GET",successCallback:function(){document.location=document.location},complete:null,errorOutput:null,context:this,timeout:4e4,success:function(){document.location.reload()}}))}),jQuery("#spbc_scanner_save_to_pdf").on("click",function(){jQuery.ajax({url:spbcSettings.ajaxurl,type:"POST",data:{action:"spbc_scanner_save_to_pdf",security:spbcSettings.ajax_nonce,no_cache:Math.random()},xhrFields:{responseType:"blob"},success:function(t){jQuery.ajax({url:spbcSettings.ajaxurl,type:"POST",data:{action:"spbc_scanner_get_pdf_file_name",security:spbcSettings.ajax_nonce,no_cache:Math.random()},xhrFields:{responseType:"text"},success:function(e){var o=new Blob([t]),n=document.createElement("a");n.href=window.URL.createObjectURL(o),n.download=e.data,n.click()}})}})}),jQuery("#spbc_scanner_copy_log_to_clipboard").length&&jQuery("#spbc_scanner_copy_log_to_clipboard").on("click",function(e){if(e.preventDefault(),navigator.clipboard){let e=jQuery("#spbcscan-results-log-module .panel-body").html().replace(//g,"").replace(/<\/b>/g,"");e=e.replace(/

/g,"\n").replace(/<\/p>/g,""),navigator.clipboard.writeText(e).then(()=>{spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint)}).catch(e=>{spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_failed)})}else spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_unsupported)})}); //# sourceMappingURL=spbc-settings_tab--scanner.min.js.map diff --git a/js/spbc-settings_tab--scanner.min.js.map b/js/spbc-settings_tab--scanner.min.js.map index 77ab21a1b..1c326878d 100644 --- a/js/spbc-settings_tab--scanner.min.js.map +++ b/js/spbc-settings_tab--scanner.min.js.map @@ -1 +1 @@ -{"version":3,"file":"spbc-settings_tab--scanner.min.js","sources":["spbc-settings_tab--scanner.js"],"sourcesContent":["/**\n * Show popup tip\n *\n * @param {object} showIcon\n */\nfunction spbcPopupTipShow(showIcon) { // eslint-disable-line no-unused-vars\n let tipTitle = showIcon.attr('spbc_tip_title') || null;\n let tipText = showIcon.attr('spbc_tip_text') || null;\n let removeDescFunc = function(e) {\n if (\n typeof e === 'undefined' ||\n (\n jQuery(e.target).parent('.spbc_popup_tip--wrapper').length == 0 ||\n jQuery(e.target).hasClass('spbc_popup_tip--icon---cancel')\n )\n ) {\n jQuery('.spbc_popup_tip--wrapper').hide();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n removeDescFunc();\n\n showIcon.after('

');\n\n let obj = jQuery('.spbc_popup_tip--wrapper');\n\n obj.empty()\n .append('
')\n .css({\n top: showIcon.position().top - 2,\n left: showIcon.position().left + 25,\n });\n obj.append('')\n .append('

' + tipTitle + '

')\n .append('

' + tipText + '

');\n\n jQuery(document).on('click', removeDescFunc);\n showIcon.parents('tr').on('mouseout', removeDescFunc);\n}\n\n/**\n * View file in the scanner\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonFileViewEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_file_view',\n file_id: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Delete file from analysis log\n *\n * @param {object} obj\n */\nfunction spbcScannerAnalysisLogDeleteFromLog(obj) { // eslint-disable-line no-unused-vars\n let fileIds = [];\n const self = jQuery(obj);\n let spinner;\n\n if ( jQuery(obj).hasClass('tbl-row_action') ) {\n fileIds.push(self.parents('.row-actions').attr('uid'));\n spinner = self.parent().siblings('.tbl-preloader--tiny');\n } else {\n const selectedItems = self.closest('#spbc_tbl__scanner_analysis_log').find('.cb-select:checked');\n if (selectedItems.length === 0) {\n alert('Please, select elements.');\n return;\n }\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n fileIds.push(elementId);\n });\n spinner = self.children('.tbl-preloader--small');\n }\n\n const data = {\n action: 'spbc_scanner_analysis_log_delete_from_log',\n file_ids: fileIds,\n };\n\n let params = {\n spinner: spinner,\n callback: function() {\n window.location.reload();\n },\n };\n\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * View page in the scanner\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonPageViewEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_page_view',\n page_url: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n\n let wpWrap = jQuery('#wpwrap');\n let dialogWindow = jQuery('#spbc_dialog');\n\n dialogWindow.dialog({\n modal: true,\n title: 'Loading..',\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(wpWrap.width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: false,\n resizable: false,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = 'auto';\n jQuery('#spbc_dialog').height((document.documentElement.clientHeight) / 100 * 25);\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n\n dialogWindow.append('\"Wait');\n\n let spinner = jQuery('#spbc_file_view_preloader');\n let sizeMultiplier = (wpWrap.width() * 0.0004);\n\n spinner.height(128 * sizeMultiplier);\n spinner.width(128 * sizeMultiplier);\n spinner.css({left: dialogWindow.width()/2 - (128 * sizeMultiplier / 2)});\n spinner.css({top: dialogWindow.height()/2 - (128 * sizeMultiplier / 2)});\n\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Callback for file view\n *\n * @param {object} result\n */\nfunction spbcScannerButtonViewCallback(result) { // eslint-disable-line no-unused-vars\n let dialogWindow = jQuery('#spbc_dialog');\n dialogWindow.empty();\n\n jQuery('#spbc_file_view_preloader').css({display: 'none'});\n\n let rowTemplate = '
%s';\n rowTemplate += '

%s


';\n\n /* eslint-disable guard-for-in */\n for (let row in result.file) {\n dialogWindow.append(rowTemplate.printf(row, result.file[row]));\n }\n\n let contentHeight = Object.keys(result.file).length * 19 < 76 ? 76 : Object.keys(result.file).length * 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let overflow = contentHeight < visibleHeight ? 'hidden' : 'scroll';\n let height = overflow === 'scroll' ? visibleHeight : contentHeight;\n\n dialogWindow.css({\n height: height,\n overflow: overflow,\n });\n\n dialogWindow.dialog({\n modal: true,\n title: ('Loaded: ' + result.file_path),\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: false,\n height: height,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n jQuery('.ui-widget-overlay').on('click', function() {\n jQuery('#spbc_dialog').dialog('close');\n });\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n\n console.log('FILE_VIEWED');\n}\n\n/**\n * Event for file view bad\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonFileViewBadEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_file_view',\n file_id: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewBadFileCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Event for page view bad\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonPageViewBadEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_page_view',\n page_url: self.parent().attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewBadCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Callback for file view bad\n *\n * @param {object} result\n * @param {object} data\n * @param {object} params\n */\nfunction spbcScannerButtonViewBadFileCallback(result, data, params) { // eslint-disable-line no-unused-vars\n console.log('FILE_VIEWED_BAD_CODE_FILE');\n jQuery('#spbc_dialog').empty();\n\n let rowTemplate = '
%s';\n rowTemplate += '

%s


';\n let rowTemplateBad = '
';\n rowTemplateBad += '%s';\n rowTemplateBad += '

%s


';\n let severityParts = [];\n let severityPartsSorted = [];\n let severityKeysSorted = [];\n\n result.weak_spots = JSON.parse(result.weak_spots);\n /* eslint-disable guard-for-in */\n for (let severity in result.weak_spots) {\n severityParts[severity] = Object.keys(result.weak_spots[severity]);\n }\n\n severityKeysSorted = Object.keys(severityParts).sort();\n\n /* eslint-disable guard-for-in */\n for (key in severityKeysSorted) {\n severityPartsSorted[severityKeysSorted[key]] = severityParts[severityKeysSorted[key]];\n }\n\n /* eslint-disable guard-for-in */\n for (let severityPart in severityPartsSorted) {\n let headerName = 'spbc-dialog-row-header-' + severityPart.toLowerCase();\n let headerHtml = '';\n headerHtml += severityPart + ' weakspots:';\n const dialog = jQuery('#spbc_dialog');\n\n dialog.append(rowTemplate.printf('', headerHtml));\n dialog.append(rowTemplate. printf('...', '...'));\n\n let header = dialog.find('#' + headerName);\n header.parent().parent().css('text-align', 'center');\n header.parent().parent().css('border', '1px dotted');\n header.parent().parent().css('background', 'darkgrey');\n\n /* eslint-disable guard-for-in */\n for (let strNum in severityParts[severityPart]) {\n // Sort bad line\n strNum = [...new Set(strNum)].sort();\n\n let row = +severityParts[severityPart][strNum];\n let displayDepth = 2;\n let temp;\n // Display only existing lines of file\n for (let currRow = row - displayDepth; currRow <= row + displayDepth; currRow++ ) {\n if ( typeof result.file[currRow] !== 'undefined' ) {\n temp = row === currRow ? rowTemplateBad : rowTemplate;\n dialog.append(temp.printf(currRow, result.file[currRow]));\n }\n }\n\n // Placing an empty string between results\n dialog.append(rowTemplate. printf('...', '...'));\n }\n }\n\n // Removing last empty string\n jQuery('#spbc_dialog div').last().remove();\n\n let contentHeight = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let overflow = contentHeight < visibleHeight ? 'no_scroll' : 'scroll';\n let height = overflow === 'scroll' ? visibleHeight : contentHeight;\n\n jQuery('#spbc_dialog').dialog({\n modal: true,\n title: result.file_path,\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: false,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n jQuery('.ui-widget-overlay').on('click', function() {\n jQuery('#spbc_dialog').dialog('close');\n });\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n}\n\n/**\n * Callback for file view bad\n *\n * @param {object} result\n * @param {object} data\n * @param {object} params\n */\nfunction spbcScannerButtonViewBadCallback(result, data, params) { // eslint-disable-line no-unused-vars\n console.log('FILE_VIEWED_BAD_CODE');\n\n let afterClose = () => {};\n\n if ( result.success == true ) {\n console.log(result);\n let rowTemplate = '
' +\n '%s' +\n '

%s

' +\n '
';\n let rowTemplateBad = '
' +\n '%s' +\n '

%s

' +\n '
';\n let strNums = [];\n\n result.weak_spots = JSON.parse(result.weak_spots);\n /* eslint-disable guard-for-in */\n for (let severity in result.weak_spots) {\n strNums = strNums.concat(Object.keys(result.weak_spots[severity]));\n }\n\n strNums = [...new Set(strNums)].sort(); // Sort bad line\n // get a map of bad strings\n // TODO: Probably there can get something else except CRITICAL in the future\n let badStringsMap = new Map(Object.entries(result.weak_spots.CRITICAL));\n /* eslint-disable guard-for-in */\n for (let strNum in strNums) {\n if (strNum == 0 && badStringsMap.get(strNums[strNum]).toLowerCase().includes('doctype')) {\n continue;\n }\n\n let row = +strNums[strNum];\n let displayDepth = 2;\n\n // Display only existing lines of file\n for (let currRow = row - displayDepth; currRow <= row + displayDepth; currRow++ ) {\n if ( typeof result.file[currRow] !== 'undefined' ) {\n let isBadString = (row === currRow);\n let unformattedRow;\n let highlitedRow;\n if (isBadString) {\n unformattedRow = rowTemplateBad;\n } else {\n unformattedRow = rowTemplate;\n }\n if (isBadString && !result.file[currRow].includes('iframe')) {\n highlitedRow = unformattedRow.printf(currRow, badStringsMap.get(strNums[strNum]));\n } else {\n highlitedRow = unformattedRow.printf(currRow, result.file[currRow]);\n }\n jQuery('#spbc_dialog').append(highlitedRow);\n }\n }\n\n // Placing an empty string between results\n jQuery('#spbc_dialog').append(rowTemplate. printf('', ''));\n\n // Removing last empty string\n jQuery('#spbc_dialog div').last().remove();\n }\n } else {\n let wrapperElement = '
%s
';\n jQuery('#spbc_dialog').append(wrapperElement.printf(result.content));\n afterClose = () => {\n document.location.reload();\n };\n }\n\n let contentHeight = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let height = 'auto';\n let overflow = contentHeight < visibleHeight ? 'no_scroll' : 'scroll';\n\n jQuery('#spbc_dialog').dialog({\n modal: true,\n title: result.file_path,\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: false,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n jQuery('.ui-widget-overlay').on('click', function() {\n jQuery('#spbc_dialog').dialog('close');\n });\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n close: afterClose,\n });\n}\n\n/**\n * File compare event\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonFileCompareEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_file_compare',\n file_id: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonFileCompareCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Callback for file compare\n *\n * @param {object} result\n * @param {object} data\n * @param {object} params\n */\nfunction spbcScannerButtonFileCompareCallback(result, data, params) { // eslint-disable-line no-unused-vars\n console.log('FILE_COMPARED');\n\n let rowTemplate = '
';\n rowTemplate += '

%s

%s';\n rowTemplate += '

%s


';\n let rowTemplateBad = '
';\n rowTemplateBad += '

%s

%s';\n rowTemplateBad += '

%s


';\n\n let renderRowTemplate = rowTemplate.printf(\n 'Modified',\n 'Line',\n 'Original',\n );\n jQuery('#spbc_dialog').append(renderRowTemplate);\n\n for (let row=1; typeof result.file[row] != 'undefined' || typeof result.file_original[row] != 'undefined'; row++) {\n if (typeof result.file[row] == 'undefined') result.file[row] = '';\n if (typeof result.file_original[row] == 'undefined') result.file_original[row] = '';\n\n // Display only existing lines of file\n if (result.difference.indexOf(row) != -1) {\n for (let displayDepth = 2, currRow = row - displayDepth; currRow <= row + displayDepth; currRow++ ) {\n if ( typeof result.file[currRow] !== 'undefined' && typeof result.file_original[row] !== 'undefined') {\n jQuery('#spbc_dialog').append(\n (row === currRow ? rowTemplateBad : rowTemplate).printf(\n result.file[currRow] ? result.file[currRow] : '',\n currRow,\n result.file_original[currRow] ? result.file_original[currRow] : '',\n ),\n );\n }\n }\n jQuery('#spbc_dialog').append(rowTemplate. printf('', '', ''));\n }\n }\n\n let contentHeight = jQuery('#spbc_dialog div').length * 19 + 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let overflow = contentHeight < visibleHeight ? 'no_scroll' : 'scroll';\n let height = overflow === 'scroll' ? visibleHeight : contentHeight;\n\n jQuery('#spbc_dialog').dialog({\n modal: true,\n title: result.file_path,\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n height: height,\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: true,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n document.body.style.overflow = 'hidden';\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n}\n\n/**\n * Reloads last scan info\n */\nfunction spbcScannerReloadScanInfo() { // eslint-disable-line no-unused-vars\n jQuery('.spbc_hint__last_scan_title').text(spbcScaner.look_below_for_scan_res);\n const data = {\n action: 'spbc_scanner__last_scan_info',\n };\n const params = {\n callback: (result) => {\n document.getElementById('spbc_scanner__last_scan_info').innerText = result.data;\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Cure file\n * @param {object} obj\n */\nfunction spbcScannerButtonCureFileAjaxHandler(obj) { // eslint-disable-line no-unused-vars\n const self = jQuery(obj);\n const fileFastHash = self.parents('.row-actions').attr('uid');\n\n let data = {\n action: 'spbc_file_cure_ajax_action',\n file_fast_hash: fileFastHash,\n security: spbcSettings.ajax_nonce,\n };\n\n jQuery.ajax({\n type: 'POST',\n async: true,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\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 * Restore file from backup\n * @param {object} obj\n */\nfunction spbcScannerButtonRestoreFromBackupAjaxHandler(obj) { // eslint-disable-line no-unused-vars\n const self = jQuery(obj);\n const fileFastHash = self.parents('.row-actions').attr('uid');\n\n let data = {\n action: 'spbc_restore_file_from_backup_ajax_action',\n file_fast_hash: fileFastHash,\n security: spbcSettings.ajax_nonce,\n };\n\n jQuery.ajax({\n type: 'POST',\n async: true,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\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 * Clear scan results\n * @return {void}\n */\nfunction spbcScannerButtonClearScanResults() { // eslint-disable-line no-unused-vars\n if ( ! confirm('Do you confirm to clear the scan results?') ) {\n return;\n }\n\n console.log('CLEAR');\n\n spbcSendAJAXRequest(\n {action: 'spbc_scanner_clear'},\n {\n type: 'GET',\n successCallback: function() {\n document.location = document.location;\n },\n complete: null,\n errorOutput: null,\n context: this,\n timeout: 40000,\n success: function() {\n document.location.reload();\n },\n },\n );\n}\n\n/**\n * Show copy log to clipboard hint\n * @param {string} text\n */\nfunction spbcScannerCopyLogToClipboardHint(text) {\n jQuery('#spbc_scanner_copy_log_to_clipboard_hint').text(text);\n jQuery('#spbc_scanner_copy_log_to_clipboard_hint').show();\n jQuery('#spbc_scanner_copy_log_to_clipboard_hint').animate({opacity: 0}, 3000, function() {\n jQuery(this).hide();\n jQuery(this).css('opacity', 1);\n });\n}\n\njQuery(document).ready(function() {\n // EVENT HADLING\n spbcTblBulkActionsListen(); // Table. Row bulk handler\n spbcTblRowActionsListen(); // Table. Row actions handler\n spbcTblPaginationListen(); // Table. Pagination handler\n spbcTblSortListen(); // Table. Sort handler\n\n spbcStartShowHide();\n\n // Preparing progressbar\n jQuery('#spbc_scaner_progress_bar').progressbar({\n value: 0,\n create: function( event, ui ) {\n event.target.style.position = 'relative';\n event.target.style.marginBottom = '12px';\n },\n change: function(event, ui) {\n jQuery('.spbc_progressbar_counter span').text(jQuery(event.target).progressbar('option', 'value') + ' %');\n },\n });\n\n // Preparing accordion\n jQuery('#spbc_scan_accordion').accordion({\n header: 'h3',\n heightStyle: 'content',\n collapsible: true,\n active: false,\n activate: function( event, ui ) {\n if ( ui.oldPanel.length === 0 && ui.oldHeader.length === 0 ) {\n jQuery('#spbc_scan_accordion')\n .accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom spbc-overflow--visible');\n }\n },\n beforeActivate: function( event, ui ) {\n if ( ui.oldPanel.length === 1 && ui.oldHeader.length === 1 ) {\n jQuery('#spbc_scan_accordion').accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom');\n }\n },\n });\n\n // Init scanner plugin\n window.spbcScanner = new SpbcMalwareScanner({\n settings: spbcScaner.settings,\n states: spbcScaner.states,\n button: jQuery('#spbc_perform_scan'),\n spinner: jQuery('#spbc_perform_scan').next(),\n callback: null,\n progress_overall: jQuery('#spbc_scaner_progress_overall'),\n progressbar: jQuery('#spbc_scaner_progress_bar'),\n progressbar_text: jQuery('.spbc_progressbar_counter span'),\n wrapper: document.getElementsByClassName('spbc_unchecked_file_list'),\n warnings: {\n long_scan: jQuery('.spbc_hint_warning__long_scan'),\n outdated: jQuery('.spbc_hint_warning__outdated'),\n },\n });\n\n jQuery(document).on('click', '.spbc_popup_tip--icon---show', function() {\n spbcPopupTipShow( jQuery( this ) );\n });\n\n jQuery('#spbc_perform_scan').on('click', function() {\n jQuery('#spbcscan-results-log-module').remove();\n spbcScanner.actionControl();\n\n if (!jQuery('.spbc_log-wrapper .panel-body').length) {\n jQuery('.spbc_log-wrapper').append('
');\n }\n\n jQuery('.spbc_log-wrapper').resizable({\n handles: 'n, s',\n containment: 'document',\n });\n });\n\n jQuery('#spbcscan-results-log-module').resizable({\n handles: 'n, s',\n containment: 'document',\n });\n\n // Clear scanner's tables\n jQuery('#spbc_scanner_clear').on('click', function() {\n if ( ! confirm('Do you confirm to clear the scan results?') ) {\n return;\n }\n\n console.log('CLEAR');\n\n spbcSendAJAXRequest(\n {action: 'spbc_scanner_clear'},\n {\n type: 'GET',\n successCallback: function() {\n document.location = document.location;\n },\n complete: null,\n errorOutput: null,\n context: this,\n timeout: 40000,\n success: function() {\n document.location.reload();\n },\n },\n );\n });\n\n jQuery('#spbc_scanner_save_to_pdf').on('click', function() {\n jQuery.ajax({\n url: spbcSettings.ajaxurl,\n type: 'POST',\n data: {\n action: 'spbc_scanner_save_to_pdf',\n security: spbcSettings.ajax_nonce,\n no_cache: Math.random(),\n },\n xhrFields: {\n responseType: 'blob',\n },\n success: function(data) {\n jQuery.ajax({\n url: spbcSettings.ajaxurl,\n type: 'POST',\n data: {\n action: 'spbc_scanner_get_pdf_file_name',\n security: spbcSettings.ajax_nonce,\n no_cache: Math.random(),\n },\n xhrFields: {\n responseType: 'text',\n },\n success: function(filename) {\n let blob=new Blob([data]);\n let link=document.createElement('a');\n link.href=window.URL.createObjectURL(blob);\n link.download=filename.data;\n link.click();\n },\n },\n );\n },\n });\n });\n\n if (jQuery('#spbc_scanner_copy_log_to_clipboard').length) {\n jQuery('#spbc_scanner_copy_log_to_clipboard').on('click', function(e) {\n e.preventDefault();\n if (navigator.clipboard) {\n let log = jQuery('#spbcscan-results-log-module .panel-body').html();\n let formattedLog = log.replace(//g, '').replace(/<\\/b>/g, '');\n formattedLog = formattedLog.replace(/

/g, '\\n').replace(/<\\/p>/g, '');\n navigator.clipboard.writeText(formattedLog).then(() => {\n spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint);\n }).catch((err) => {\n spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_failed);\n });\n } else {\n spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_unsupported);\n }\n });\n }\n});\n"],"names":["spbcPopupTipShow","showIcon","let","tipTitle","attr","tipText","removeDescFunc","e","jQuery","target","parent","length","hasClass","hide","document","off","after","obj","empty","append","css","top","position","left","on","parents","spbcScannerButtonFileViewEvent","self","data","action","file_id","params","spinner","siblings","callback","spbcScannerButtonViewCallback","errorOutput","msg","spbcModal","open","putError","spbcSendAJAXRequest","spbcScannerAnalysisLogDeleteFromLog","fileIds","push","selectedItems","closest","find","alert","each","index","element","elementId","val","children","file_ids","window","location","reload","spbcScannerButtonPageViewEvent","page_url","wpWrap","dialogWindow","dialog","modal","title","my","at","of","width","show","effect","duration","draggable","resizable","closeText","classes","ui-dialog","event","ui","style","overflow","height","documentElement","beforeClose","body","sizeMultiplier","result","row","rowTemplate","display","file","printf","contentHeight","Object","keys","visibleHeight","file_path","console","log","spbcScannerButtonFileViewBadEvent","spbcScannerButtonViewBadFileCallback","spbcScannerButtonPageViewBadEvent","spbcScannerButtonViewBadCallback","severityKeysSorted","severity","severityPart","rowTemplateBad","severityParts","severityPartsSorted","weak_spots","JSON","parse","key","sort","strNum","headerName","toLowerCase","headerHtml","header","Set","temp","currRow","last","remove","afterClose","success","strNums","concat","badStringsMap","Map","entries","CRITICAL","get","includes","isBadString","unformattedRow","highlitedRow","content","close","spbcScannerButtonFileCompareEvent","spbcScannerButtonFileCompareCallback","renderRowTemplate","file_original","difference","indexOf","spbcScannerReloadScanInfo","text","spbcScaner","look_below_for_scan_res","getElementById","innerText","spbcScannerButtonCureFileAjaxHandler","file_fast_hash","security","spbcSettings","ajax_nonce","ajax","type","async","url","ajaxurl","put","addEventListener","spbcScannerButtonRestoreFromBackupAjaxHandler","spbcScannerButtonClearScanResults","confirm","successCallback","complete","context","this","timeout","spbcScannerCopyLogToClipboardHint","animate","opacity","ready","spbcTblBulkActionsListen","spbcTblRowActionsListen","spbcTblPaginationListen","spbcTblSortListen","spbcStartShowHide","progressbar","value","create","marginBottom","change","accordion","heightStyle","collapsible","active","activate","oldPanel","oldHeader","beforeActivate","spbcScanner","SpbcMalwareScanner","settings","states","button","next","progress_overall","progressbar_text","wrapper","getElementsByClassName","warnings","long_scan","outdated","actionControl","handles","containment","no_cache","Math","random","xhrFields","responseType","filename","blob","Blob","link","createElement","href","URL","createObjectURL","download","click","preventDefault","navigator","clipboard","formattedLog","html","replace","writeText","then","copy_log_to_clipboard_hint","catch","copy_log_to_clipboard_hint_failed","copy_log_to_clipboard_hint_unsupported"],"mappings":"AAKA,SAASA,iBAAiBC,GACtBC,IAAIC,EAAWF,EAASG,KAAK,gBAAgB,GAAK,KAC9CC,EAAUJ,EAASG,KAAK,eAAe,GAAK,KAC3B,SAAjBE,EAA0BC,GAET,KAAA,IAANA,GAE2D,GAA9DC,OAAOD,EAAEE,MAAM,EAAEC,OAAO,0BAA0B,EAAEC,QACpDH,CAAAA,OAAOD,EAAEE,MAAM,EAAEG,SAAS,+BAA+B,IAG7DJ,OAAO,0BAA0B,EAAEK,KAAK,EACxCL,OAAOM,QAAQ,EAAEC,IAAI,QAAST,CAAc,EAEpD,CAEAA,EAAe,EAEfL,EAASe,MAAM,6CAA+C,EAE9Dd,IAAIe,EAAMT,OAAO,0BAA0B,EAE3CS,EAAIC,MAAM,EACLC,OAAO,2CAA6C,EACpDC,IAAI,CACDC,IAAKpB,EAASqB,SAAS,EAAED,IAAM,EAC/BE,KAAMtB,EAASqB,SAAS,EAAEC,KAAO,EACrC,CAAC,EACLN,EAAIE,OAAO,2DAA6D,EACnEA,OAAO,qCAAyChB,EAAW,OAAO,EAClEgB,OAAO,mCAAuCd,EAAU,MAAM,EAEnEG,OAAOM,QAAQ,EAAEU,GAAG,QAASlB,CAAc,EAC3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AAEC,MAAM,IACL9D,kCAAkCxB,WAAWuF,iCAAiC,CAClF,CAAC,CACL,MACI/D,kCAAkCxB,WAAWwF,sCAAsC,CAE3F,CAAC,CAET,CAAC"} \ No newline at end of file +{"version":3,"file":"spbc-settings_tab--scanner.min.js","sources":["spbc-settings_tab--scanner.js"],"sourcesContent":["/**\n * Show popup tip\n *\n * @param {object} showIcon\n */\nfunction spbcPopupTipShow(showIcon) { // eslint-disable-line no-unused-vars\n let tipTitle = showIcon.attr('spbc_tip_title') || null;\n let tipText = showIcon.attr('spbc_tip_text') || null;\n let removeDescFunc = function(e) {\n if (\n typeof e === 'undefined' ||\n (\n jQuery(e.target).parent('.spbc_popup_tip--wrapper').length == 0 ||\n jQuery(e.target).hasClass('spbc_popup_tip--icon---cancel')\n )\n ) {\n jQuery('.spbc_popup_tip--wrapper').hide();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n removeDescFunc();\n\n showIcon.after('

');\n\n let obj = jQuery('.spbc_popup_tip--wrapper');\n\n obj.empty()\n .append('
')\n .css({\n top: showIcon.position().top - 2,\n left: showIcon.position().left + 25,\n });\n obj.append('')\n .append('

' + tipTitle + '

')\n .append('

' + tipText + '

');\n\n jQuery(document).on('click', removeDescFunc);\n showIcon.parents('tr').on('mouseout', removeDescFunc);\n}\n\n/**\n * View file in the scanner\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonFileViewEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_file_view',\n file_id: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Delete file from analysis log\n *\n * @param {object} obj\n */\nfunction spbcScannerAnalysisLogDeleteFromLog(obj) { // eslint-disable-line no-unused-vars\n let fileIds = [];\n const self = jQuery(obj);\n let spinner;\n\n if ( jQuery(obj).hasClass('tbl-row_action') ) {\n fileIds.push(self.parents('.row-actions').attr('uid'));\n spinner = self.parent().siblings('.tbl-preloader--tiny');\n } else {\n const selectedItems = self.closest('#spbc_tbl__scanner_analysis_log').find('.cb-select:checked');\n if (selectedItems.length === 0) {\n alert('Please, select elements.');\n return;\n }\n\n selectedItems.each(function(index, element) {\n const elementId = jQuery(element).val();\n fileIds.push(elementId);\n });\n spinner = self.children('.tbl-preloader--small');\n }\n\n const data = {\n action: 'spbc_scanner_analysis_log_delete_from_log',\n file_ids: fileIds,\n };\n\n let params = {\n spinner: spinner,\n callback: function() {\n window.location.reload();\n },\n };\n\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * View page in the scanner\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonPageViewEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_page_view',\n page_url: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n\n let wpWrap = jQuery('#wpwrap');\n let dialogWindow = jQuery('#spbc_dialog');\n\n dialogWindow.dialog({\n modal: true,\n title: 'Loading..',\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(wpWrap.width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: false,\n resizable: false,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = 'auto';\n jQuery('#spbc_dialog').height((document.documentElement.clientHeight) / 100 * 25);\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n\n dialogWindow.append('\"Wait');\n\n let spinner = jQuery('#spbc_file_view_preloader');\n let sizeMultiplier = (wpWrap.width() * 0.0004);\n\n spinner.height(128 * sizeMultiplier);\n spinner.width(128 * sizeMultiplier);\n spinner.css({left: dialogWindow.width()/2 - (128 * sizeMultiplier / 2)});\n spinner.css({top: dialogWindow.height()/2 - (128 * sizeMultiplier / 2)});\n\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Callback for file view\n *\n * @param {object} result\n */\nfunction spbcScannerButtonViewCallback(result) { // eslint-disable-line no-unused-vars\n let dialogWindow = jQuery('#spbc_dialog');\n dialogWindow.empty();\n\n jQuery('#spbc_file_view_preloader').css({display: 'none'});\n\n let rowTemplate = '
%s';\n rowTemplate += '

%s


';\n\n /* eslint-disable guard-for-in */\n for (let row in result.file) {\n dialogWindow.append(rowTemplate.printf(row, result.file[row]));\n }\n\n let contentHeight = Object.keys(result.file).length * 19 < 76 ? 76 : Object.keys(result.file).length * 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let overflow = contentHeight < visibleHeight ? 'hidden' : 'scroll';\n let height = overflow === 'scroll' ? visibleHeight : contentHeight;\n\n dialogWindow.css({\n height: height,\n overflow: overflow,\n });\n\n dialogWindow.dialog({\n modal: true,\n title: ('Loaded: ' + result.file_path),\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: false,\n height: height,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n jQuery('.ui-widget-overlay').on('click', function() {\n jQuery('#spbc_dialog').dialog('close');\n });\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n\n console.log('FILE_VIEWED');\n}\n\n/**\n * Event for file view bad\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonFileViewBadEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_file_view',\n file_id: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewBadFileCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Event for page view bad\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonPageViewBadEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_page_view',\n page_url: self.parent().attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonViewBadCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Callback for file view bad\n *\n * @param {object} result\n * @param {object} data\n * @param {object} params\n */\nfunction spbcScannerButtonViewBadFileCallback(result, data, params) { // eslint-disable-line no-unused-vars\n console.log('FILE_VIEWED_BAD_CODE_FILE');\n jQuery('#spbc_dialog').empty();\n\n let rowTemplate = '
%s';\n rowTemplate += '

%s


';\n let rowTemplateBad = '
';\n rowTemplateBad += '%s';\n rowTemplateBad += '

%s


';\n let severityParts = [];\n let severityPartsSorted = [];\n let severityKeysSorted = [];\n\n result.weak_spots = JSON.parse(result.weak_spots);\n /* eslint-disable guard-for-in */\n for (let severity in result.weak_spots) {\n severityParts[severity] = Object.keys(result.weak_spots[severity]);\n }\n\n severityKeysSorted = Object.keys(severityParts).sort();\n\n /* eslint-disable guard-for-in */\n for (key in severityKeysSorted) {\n severityPartsSorted[severityKeysSorted[key]] = severityParts[severityKeysSorted[key]];\n }\n\n /* eslint-disable guard-for-in */\n for (let severityPart in severityPartsSorted) {\n let headerName = 'spbc-dialog-row-header-' + severityPart.toLowerCase();\n let headerHtml = '';\n headerHtml += severityPart + ' weakspots:';\n const dialog = jQuery('#spbc_dialog');\n\n dialog.append(rowTemplate.printf('', headerHtml));\n dialog.append(rowTemplate. printf('...', '...'));\n\n let header = dialog.find('#' + headerName);\n header.parent().parent().css('text-align', 'center');\n header.parent().parent().css('border', '1px dotted');\n header.parent().parent().css('background', 'darkgrey');\n\n /* eslint-disable guard-for-in */\n for (let strNum in severityParts[severityPart]) {\n // Sort bad line\n strNum = [...new Set(strNum)].sort();\n\n let row = +severityParts[severityPart][strNum];\n let displayDepth = 2;\n let temp;\n // Display only existing lines of file\n for (let currRow = row - displayDepth; currRow <= row + displayDepth; currRow++ ) {\n if ( typeof result.file[currRow] !== 'undefined' ) {\n temp = row === currRow ? rowTemplateBad : rowTemplate;\n dialog.append(temp.printf(currRow, result.file[currRow]));\n }\n }\n\n // Placing an empty string between results\n dialog.append(rowTemplate. printf('...', '...'));\n }\n }\n\n // Removing last empty string\n jQuery('#spbc_dialog div').last().remove();\n\n let contentHeight = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let overflow = contentHeight < visibleHeight ? 'no_scroll' : 'scroll';\n let height = overflow === 'scroll' ? visibleHeight : contentHeight;\n\n jQuery('#spbc_dialog').dialog({\n modal: true,\n title: result.file_path,\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: false,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n jQuery('.ui-widget-overlay').on('click', function() {\n jQuery('#spbc_dialog').dialog('close');\n });\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n}\n\n/**\n * Callback for file view bad\n *\n * @param {object} result\n * @param {object} data\n * @param {object} params\n */\nfunction spbcScannerButtonViewBadCallback(result, data, params) { // eslint-disable-line no-unused-vars\n console.log('FILE_VIEWED_BAD_CODE');\n\n let afterClose = () => {};\n\n if ( result.success == true ) {\n console.log(result);\n let rowTemplate = '
' +\n '%s' +\n '

%s

' +\n '
';\n let rowTemplateBad = '
' +\n '%s' +\n '

%s

' +\n '
';\n let strNums = [];\n\n result.weak_spots = JSON.parse(result.weak_spots);\n /* eslint-disable guard-for-in */\n for (let severity in result.weak_spots) {\n strNums = strNums.concat(Object.keys(result.weak_spots[severity]));\n }\n\n strNums = [...new Set(strNums)].sort(); // Sort bad line\n // get a map of bad strings\n // TODO: Probably there can get something else except CRITICAL in the future\n let badStringsMap = new Map(Object.entries(result.weak_spots.CRITICAL));\n /* eslint-disable guard-for-in */\n for (let strNum in strNums) {\n if (strNum == 0 && badStringsMap.get(strNums[strNum]).toLowerCase().includes('doctype')) {\n continue;\n }\n\n let row = +strNums[strNum];\n let displayDepth = 2;\n\n // Display only existing lines of file\n for (let currRow = row - displayDepth; currRow <= row + displayDepth; currRow++ ) {\n if ( typeof result.file[currRow] !== 'undefined' ) {\n let isBadString = (row === currRow);\n let unformattedRow;\n let highlitedRow;\n if (isBadString) {\n unformattedRow = rowTemplateBad;\n } else {\n unformattedRow = rowTemplate;\n }\n if (isBadString && !result.file[currRow].includes('iframe')) {\n highlitedRow = unformattedRow.printf(currRow, badStringsMap.get(strNums[strNum]));\n } else {\n highlitedRow = unformattedRow.printf(currRow, result.file[currRow]);\n }\n jQuery('#spbc_dialog').append(highlitedRow);\n }\n }\n\n // Placing an empty string between results\n jQuery('#spbc_dialog').append(rowTemplate. printf('', ''));\n\n // Removing last empty string\n jQuery('#spbc_dialog div').last().remove();\n }\n } else {\n let wrapperElement = '
%s
';\n jQuery('#spbc_dialog').append(wrapperElement.printf(result.content));\n afterClose = () => {\n document.location.reload();\n };\n }\n\n let contentHeight = jQuery('#spbc_dialog div').length * 19 < 76 ? 76 : jQuery('#spbc_dialog div').length * 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let height = 'auto';\n let overflow = contentHeight < visibleHeight ? 'no_scroll' : 'scroll';\n\n jQuery('#spbc_dialog').dialog({\n modal: true,\n title: result.file_path,\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: false,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n jQuery('.ui-widget-overlay').on('click', function() {\n jQuery('#spbc_dialog').dialog('close');\n });\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n close: afterClose,\n });\n}\n\n/**\n * File compare event\n *\n * @param {object} obj\n */\nfunction spbcScannerButtonFileCompareEvent(obj) { // eslint-disable-line no-unused-vars\n let self = jQuery(obj);\n let data = {\n action: 'spbc_scanner_file_compare',\n file_id: self.parents('.row-actions').attr('uid'),\n };\n let params = {\n spinner: self.parent().siblings('.tbl-preloader--tiny'),\n callback: spbcScannerButtonFileCompareCallback,\n errorOutput: function(msg) {\n spbcModal.open().putError( msg );\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Callback for file compare\n *\n * @param {object} result\n * @param {object} data\n * @param {object} params\n */\nfunction spbcScannerButtonFileCompareCallback(result, data, params) { // eslint-disable-line no-unused-vars\n console.log('FILE_COMPARED');\n\n let rowTemplate = '
';\n rowTemplate += '

%s

%s';\n rowTemplate += '

%s


';\n let rowTemplateBad = '
';\n rowTemplateBad += '

%s

%s';\n rowTemplateBad += '

%s


';\n\n let renderRowTemplate = rowTemplate.printf(\n 'Modified',\n 'Line',\n 'Original',\n );\n jQuery('#spbc_dialog').append(renderRowTemplate);\n\n for (let row=1; typeof result.file[row] != 'undefined' || typeof result.file_original[row] != 'undefined'; row++) {\n if (typeof result.file[row] == 'undefined') result.file[row] = '';\n if (typeof result.file_original[row] == 'undefined') result.file_original[row] = '';\n\n // Display only existing lines of file\n if (result.difference.indexOf(row) != -1) {\n for (let displayDepth = 2, currRow = row - displayDepth; currRow <= row + displayDepth; currRow++ ) {\n if ( typeof result.file[currRow] !== 'undefined' && typeof result.file_original[row] !== 'undefined') {\n jQuery('#spbc_dialog').append(\n (row === currRow ? rowTemplateBad : rowTemplate).printf(\n result.file[currRow] ? result.file[currRow] : '',\n currRow,\n result.file_original[currRow] ? result.file_original[currRow] : '',\n ),\n );\n }\n }\n jQuery('#spbc_dialog').append(rowTemplate. printf('', '', ''));\n }\n }\n\n let contentHeight = jQuery('#spbc_dialog div').length * 19 + 19;\n let visibleHeight = (document.documentElement.clientHeight) / 100 * 75;\n let overflow = contentHeight < visibleHeight ? 'no_scroll' : 'scroll';\n let height = overflow === 'scroll' ? visibleHeight : contentHeight;\n\n jQuery('#spbc_dialog').dialog({\n modal: true,\n title: result.file_path,\n position: {my: 'center top', at: 'center top+100px', of: window},\n width: +(jQuery('#wpwrap').width() / 100 * 90),\n height: height,\n show: {effect: 'blind', duration: 500},\n draggable: true,\n resizable: true,\n closeText: 'X',\n classes: {'ui-dialog': 'spbc---top'},\n open: function(event, ui) {\n document.body.style.overflow = 'hidden';\n event.target.style.overflow = overflow;\n jQuery('#spbc_dialog').height(height);\n },\n beforeClose: function(event, ui) {\n document.body.style.overflow = 'auto';\n jQuery('#spbc_dialog').empty();\n },\n });\n}\n\n/**\n * Reloads last scan info\n */\nfunction spbcScannerReloadScanInfo() { // eslint-disable-line no-unused-vars\n jQuery('.spbc_hint__last_scan_title').text(spbcScaner.look_below_for_scan_res);\n const data = {\n action: 'spbc_scanner__last_scan_info',\n };\n const params = {\n callback: (result) => {\n document.getElementById('spbc_scanner__last_scan_info').innerText = result.data;\n },\n };\n spbcSendAJAXRequest(data, params);\n}\n\n/**\n * Cure file\n * @param {object} obj\n */\nfunction spbcScannerButtonCureFileAjaxHandler(obj) { // eslint-disable-line no-unused-vars\n const self = jQuery(obj);\n const fileFastHash = self.parents('.row-actions').attr('uid');\n\n let data = {\n action: 'spbc_file_cure_ajax_action',\n file_fast_hash: fileFastHash,\n security: spbcSettings.ajax_nonce,\n };\n\n jQuery.ajax({\n type: 'POST',\n async: true,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\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 * Restore file from backup\n * @param {object} obj\n */\nfunction spbcScannerButtonRestoreFromBackupAjaxHandler(obj) { // eslint-disable-line no-unused-vars\n const self = jQuery(obj);\n const fileFastHash = self.parents('.row-actions').attr('uid');\n\n let data = {\n action: 'spbc_restore_file_from_backup_ajax_action',\n file_fast_hash: fileFastHash,\n security: spbcSettings.ajax_nonce,\n };\n\n jQuery.ajax({\n type: 'POST',\n async: true,\n url: spbcSettings.ajaxurl,\n data: data,\n success: function(result) {\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 * Clear scan results\n * @return {void}\n */\nfunction spbcScannerButtonClearScanResults() { // eslint-disable-line no-unused-vars\n if ( ! confirm('Do you confirm to clear the scan results?') ) {\n return;\n }\n\n console.log('CLEAR');\n\n spbcSendAJAXRequest(\n {action: 'spbc_scanner_clear'},\n {\n type: 'GET',\n successCallback: function() {\n document.location = document.location;\n },\n complete: null,\n errorOutput: null,\n context: this,\n timeout: 40000,\n success: function() {\n document.location.reload();\n },\n },\n );\n}\n\n/**\n * Show copy log to clipboard hint\n * @param {string} text\n */\nfunction spbcScannerCopyLogToClipboardHint(text) {\n jQuery('#spbc_scanner_copy_log_to_clipboard_hint').text(text);\n jQuery('#spbc_scanner_copy_log_to_clipboard_hint').show();\n jQuery('#spbc_scanner_copy_log_to_clipboard_hint').animate({opacity: 0}, 3000, function() {\n jQuery(this).hide();\n jQuery(this).css('opacity', 1);\n });\n}\n\njQuery(document).ready(function() {\n // EVENT HADLING\n spbcTblBulkActionsListen(); // Table. Row bulk handler\n spbcTblRowActionsListen(); // Table. Row actions handler\n spbcTblPaginationListen(); // Table. Pagination handler\n spbcTblSortListen(); // Table. Sort handler\n\n spbcStartShowHide();\n\n // Preparing progressbar\n jQuery('#spbc_scaner_progress_bar').progressbar({\n value: 0,\n create: function( event, ui ) {\n event.target.style.position = 'relative';\n event.target.style.marginBottom = '12px';\n },\n change: function(event, ui) {\n jQuery('.spbc_progressbar_counter span').text(jQuery(event.target).progressbar('option', 'value') + ' %');\n },\n });\n\n // Preparing accordion\n jQuery('#spbc_scan_accordion').accordion({\n header: 'h3',\n heightStyle: 'content',\n collapsible: true,\n active: false,\n activate: function( event, ui ) {\n jQuery('#spbc_scan_accordion')\n .accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom spbc-overflow--visible');\n },\n beforeActivate: function( event, ui ) {\n jQuery('#spbc_scan_accordion').accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom');\n },\n });\n\n // Init scanner plugin\n window.spbcScanner = new SpbcMalwareScanner({\n settings: spbcScaner.settings,\n states: spbcScaner.states,\n button: jQuery('#spbc_perform_scan'),\n spinner: jQuery('#spbc_perform_scan').next(),\n callback: null,\n progress_overall: jQuery('#spbc_scaner_progress_overall'),\n progressbar: jQuery('#spbc_scaner_progress_bar'),\n progressbar_text: jQuery('.spbc_progressbar_counter span'),\n wrapper: document.getElementsByClassName('spbc_unchecked_file_list'),\n warnings: {\n long_scan: jQuery('.spbc_hint_warning__long_scan'),\n outdated: jQuery('.spbc_hint_warning__outdated'),\n },\n });\n\n jQuery(document).on('click', '.spbc_popup_tip--icon---show', function() {\n spbcPopupTipShow( jQuery( this ) );\n });\n\n jQuery('#spbc_perform_scan').on('click', function() {\n jQuery('#spbcscan-results-log-module').remove();\n spbcScanner.actionControl();\n\n if (!jQuery('.spbc_log-wrapper .panel-body').length) {\n jQuery('.spbc_log-wrapper').append('
');\n }\n\n jQuery('.spbc_log-wrapper').resizable({\n handles: 'n, s',\n containment: 'document',\n });\n });\n\n jQuery('#spbcscan-results-log-module').resizable({\n handles: 'n, s',\n containment: 'document',\n });\n\n // Clear scanner's tables\n jQuery('#spbc_scanner_clear').on('click', function() {\n if ( ! confirm('Do you confirm to clear the scan results?') ) {\n return;\n }\n\n console.log('CLEAR');\n\n spbcSendAJAXRequest(\n {action: 'spbc_scanner_clear'},\n {\n type: 'GET',\n successCallback: function() {\n document.location = document.location;\n },\n complete: null,\n errorOutput: null,\n context: this,\n timeout: 40000,\n success: function() {\n document.location.reload();\n },\n },\n );\n });\n\n jQuery('#spbc_scanner_save_to_pdf').on('click', function() {\n jQuery.ajax({\n url: spbcSettings.ajaxurl,\n type: 'POST',\n data: {\n action: 'spbc_scanner_save_to_pdf',\n security: spbcSettings.ajax_nonce,\n no_cache: Math.random(),\n },\n xhrFields: {\n responseType: 'blob',\n },\n success: function(data) {\n jQuery.ajax({\n url: spbcSettings.ajaxurl,\n type: 'POST',\n data: {\n action: 'spbc_scanner_get_pdf_file_name',\n security: spbcSettings.ajax_nonce,\n no_cache: Math.random(),\n },\n xhrFields: {\n responseType: 'text',\n },\n success: function(filename) {\n let blob=new Blob([data]);\n let link=document.createElement('a');\n link.href=window.URL.createObjectURL(blob);\n link.download=filename.data;\n link.click();\n },\n },\n );\n },\n });\n });\n\n if (jQuery('#spbc_scanner_copy_log_to_clipboard').length) {\n jQuery('#spbc_scanner_copy_log_to_clipboard').on('click', function(e) {\n e.preventDefault();\n if (navigator.clipboard) {\n let log = jQuery('#spbcscan-results-log-module .panel-body').html();\n let formattedLog = log.replace(//g, '').replace(/<\\/b>/g, '');\n formattedLog = formattedLog.replace(/

/g, '\\n').replace(/<\\/p>/g, '');\n navigator.clipboard.writeText(formattedLog).then(() => {\n spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint);\n }).catch((err) => {\n spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_failed);\n });\n } else {\n spbcScannerCopyLogToClipboardHint(spbcScaner.copy_log_to_clipboard_hint_unsupported);\n }\n });\n }\n});\n"],"names":["spbcPopupTipShow","showIcon","let","tipTitle","attr","tipText","removeDescFunc","e","jQuery","target","parent","length","hasClass","hide","document","off","after","obj","empty","append","css","top","position","left","on","parents","spbcScannerButtonFileViewEvent","self","data","action","file_id","params","spinner","siblings","callback","spbcScannerButtonViewCallback","errorOutput","msg","spbcModal","open","putError","spbcSendAJAXRequest","spbcScannerAnalysisLogDeleteFromLog","fileIds","push","selectedItems","closest","find","alert","each","index","element","elementId","val","children","file_ids","window","location","reload","spbcScannerButtonPageViewEvent","page_url","wpWrap","dialogWindow","dialog","modal","title","my","at","of","width","show","effect","duration","draggable","resizable","closeText","classes","ui-dialog","event","ui","style","overflow","height","documentElement","beforeClose","body","sizeMultiplier","result","row","rowTemplate","display","file","printf","contentHeight","Object","keys","visibleHeight","file_path","console","log","spbcScannerButtonFileViewBadEvent","spbcScannerButtonViewBadFileCallback","spbcScannerButtonPageViewBadEvent","spbcScannerButtonViewBadCallback","severityKeysSorted","severity","severityPart","rowTemplateBad","severityParts","severityPartsSorted","weak_spots","JSON","parse","key","sort","strNum","headerName","toLowerCase","headerHtml","header","Set","temp","currRow","last","remove","afterClose","success","strNums","concat","badStringsMap","Map","entries","CRITICAL","get","includes","isBadString","unformattedRow","highlitedRow","content","close","spbcScannerButtonFileCompareEvent","spbcScannerButtonFileCompareCallback","renderRowTemplate","file_original","difference","indexOf","spbcScannerReloadScanInfo","text","spbcScaner","look_below_for_scan_res","getElementById","innerText","spbcScannerButtonCureFileAjaxHandler","file_fast_hash","security","spbcSettings","ajax_nonce","ajax","type","async","url","ajaxurl","put","addEventListener","spbcScannerButtonRestoreFromBackupAjaxHandler","spbcScannerButtonClearScanResults","confirm","successCallback","complete","context","this","timeout","spbcScannerCopyLogToClipboardHint","animate","opacity","ready","spbcTblBulkActionsListen","spbcTblRowActionsListen","spbcTblPaginationListen","spbcTblSortListen","spbcStartShowHide","progressbar","value","create","marginBottom","change","accordion","heightStyle","collapsible","active","activate","beforeActivate","spbcScanner","SpbcMalwareScanner","settings","states","button","next","progress_overall","progressbar_text","wrapper","getElementsByClassName","warnings","long_scan","outdated","actionControl","handles","containment","no_cache","Math","random","xhrFields","responseType","filename","blob","Blob","link","createElement","href","URL","createObjectURL","download","click","preventDefault","navigator","clipboard","formattedLog","html","replace","writeText","then","copy_log_to_clipboard_hint","catch","copy_log_to_clipboard_hint_failed","copy_log_to_clipboard_hint_unsupported"],"mappings":"AAKA,SAASA,iBAAiBC,GACtBC,IAAIC,EAAWF,EAASG,KAAK,gBAAgB,GAAK,KAC9CC,EAAUJ,EAASG,KAAK,eAAe,GAAK,KAC3B,SAAjBE,EAA0BC,GAET,KAAA,IAANA,GAE2D,GAA9DC,OAAOD,EAAEE,MAAM,EAAEC,OAAO,0BAA0B,EAAEC,QACpDH,CAAAA,OAAOD,EAAEE,MAAM,EAAEG,SAAS,+BAA+B,IAG7DJ,OAAO,0BAA0B,EAAEK,KAAK,EACxCL,OAAOM,QAAQ,EAAEC,IAAI,QAAST,CAAc,EAEpD,CAEAA,EAAe,EAEfL,EAASe,MAAM,6CAA+C,EAE9Dd,IAAIe,EAAMT,OAAO,0BAA0B,EAE3CS,EAAIC,MAAM,EACLC,OAAO,2CAA6C,EACpDC,IAAI,CACDC,IAAKpB,EAASqB,SAAS,EAAED,IAAM,EAC/BE,KAAMtB,EAASqB,SAAS,EAAEC,KAAO,EACrC,CAAC,EACLN,EAAIE,OAAO,2DAA6D,EACnEA,OAAO,qCAAyChB,EAAW,OAAO,EAClEgB,OAAO,mCAAuCd,EAAU,MAAM,EAEnEG,OAAOM,QAAQ,EAAEU,GAAG,QAASlB,CAAc,EAC3CL,EAASwB,QAAQ,IAAI,EAAED,GAAG,WAAYlB,CAAc,CACxD,CAOA,SAASoB,+BAA+BT,GACpCf,IAAIyB,EAAOnB,OAAOS,CAAG,EACjBW,EAAO,CACPC,OAAQ,yBACRC,QAASH,EAAKF,QAAQ,cAAc,EAAErB,KAAK,KAAK,CACpD,EACI2B,EAA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AC1B,EACAC,UAAW,CACPC,aAAc,MAClB,EACAtF,QAAS,SAASlG,GACdpB,OAAOqJ,KAAK,CACRG,IAAKL,aAAaM,QAClBH,KAAM,OACNlI,KAAM,CACFC,OAAQ,iCACR6H,SAAUC,aAAaC,WACvBoD,SAAUC,KAAKC,OAAO,CAC1B,EACAC,UAAW,CACPC,aAAc,MAClB,EACAtF,QAAS,SAASuF,GACdnN,IAAIoN,EAAK,IAAIC,KAAK,CAAC3L,EAAK,EACpB4L,EAAK1M,SAAS2M,cAAc,GAAG,EACnCD,EAAKE,KAAKlK,OAAOmK,IAAIC,gBAAgBN,CAAI,EACzCE,EAAKK,SAASR,EAASzL,KACvB4L,EAAKM,MAAM,CACf,CACJ,CACA,CACJ,CACJ,CAAC,CACL,CAAC,EAEGtN,OAAO,qCAAqC,EAAEG,QAC9CH,OAAO,qCAAqC,EAAEgB,GAAG,QAAS,SAASjB,GAE/D,GADAA,EAAEwN,eAAe,EACbC,UAAUC,UAAW,CAErB/N,IAAIgO,EADM1N,OAAO,0CAA0C,EAAE2N,KAAK,EAC3CC,QAAQ,OAAQ,EAAE,EAAEA,QAAQ,SAAU,EAAE,EAC/DF,EAAeA,EAAaE,QAAQ,6BAA8B,IAAI,EAAEA,QAAQ,SAAU,EAAE,EAC5FJ,UAAUC,UAAUI,UAAUH,CAAY,EAAEI,KAAK,KAC7C1D,kCAAkCxB,WAAWmF,0BAA0B,CAC3E,CAAC,EAAEC,MAAM,IACL5D,kCAAkCxB,WAAWqF,iCAAiC,CAClF,CAAC,CACL,MACI7D,kCAAkCxB,WAAWsF,sCAAsC,CAE3F,CAAC,CAET,CAAC"} \ No newline at end of file diff --git a/js/src/spbc-settings.js b/js/src/spbc-settings.js index 6ba7b53ea..c7dfe33d4 100644 --- a/js/src/spbc-settings.js +++ b/js/src/spbc-settings.js @@ -126,6 +126,25 @@ function spbcDrawSettingsCallback(result, data, params, obj) { if (typeof spbcHighlightCriticalFilesNotice === 'function') { spbcHighlightCriticalFilesNotice(false); } + + spbcSaveSettingsButtonMobileLayout(); + window.addEventListener('resize', (event) => { + spbcSaveSettingsButtonMobileLayout(); + }); +} + +/** + * A chunk to hide the custom element "submit button" on large screen or make sticky on mobile + */ +function spbcSaveSettingsButtonMobileLayout() { + const selector = document.querySelector('div[name="spbc_settings--save_button_custom"]'); + if (selector) { + if (window.innerWidth > 900) { + selector.style.display = 'none'; + } else { + selector.style.display = 'flex'; + } + } } /** diff --git a/js/src/spbc-settings_tab--scanner.js b/js/src/spbc-settings_tab--scanner.js index 0f8643bf3..faa586742 100644 --- a/js/src/spbc-settings_tab--scanner.js +++ b/js/src/spbc-settings_tab--scanner.js @@ -713,15 +713,11 @@ jQuery(document).ready(function() { collapsible: true, active: false, activate: function( event, ui ) { - if ( ui.oldPanel.length === 0 && ui.oldHeader.length === 0 ) { - jQuery('#spbc_scan_accordion') - .accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom spbc-overflow--visible'); - } + jQuery('#spbc_scan_accordion') + .accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom spbc-overflow--visible'); }, beforeActivate: function( event, ui ) { - if ( ui.oldPanel.length === 1 && ui.oldHeader.length === 1 ) { - jQuery('#spbc_scan_accordion').accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom'); - } + jQuery('#spbc_scan_accordion').accordion('option', 'classes.ui-accordion-content', 'ui-corner-bottom'); }, }); diff --git a/lib/CleantalkSP/Common/LinkConstructor.php b/lib/CleantalkSP/Common/LinkConstructor.php index 9d54d669a..7941c4fb6 100644 --- a/lib/CleantalkSP/Common/LinkConstructor.php +++ b/lib/CleantalkSP/Common/LinkConstructor.php @@ -42,7 +42,9 @@ private static function getGetParamsChunk($utm_preset, $get_params = array()) } else { $utm_data = static::$utm_presets[$utm_preset]; } - $utm_data['utm_campaign'] = static::$utm_campaign; + $utm_data['utm_campaign'] = isset(static::$utm_presets[$utm_preset]['utm_campaign']) + ? static::$utm_presets[$utm_preset]['utm_campaign'] + : static::$utm_campaign; $glued = array_merge($get_params, $utm_data); return http_build_query($glued); } diff --git a/lib/CleantalkSP/SpbctWP/LinkConstructor.php b/lib/CleantalkSP/SpbctWP/LinkConstructor.php index 6ffb72530..8e3d1f62f 100644 --- a/lib/CleantalkSP/SpbctWP/LinkConstructor.php +++ b/lib/CleantalkSP/SpbctWP/LinkConstructor.php @@ -37,7 +37,14 @@ class LinkConstructor extends \CleantalkSP\Common\LinkConstructor /* * Settings */ - + 'settings__firewall_ip_addresses' => array( //each record of FW entries + 'utm_id' => '', + 'utm_term' => '', + 'utm_source' => 'wordpress', + 'utm_medium' => 'dashboard', + 'utm_content' => 'firewall_log', + 'utm_campaign' => 'firewall', + ), /* * Public pages */ diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php index 58698f0d0..4c7216d92 100755 --- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmService.php @@ -289,7 +289,7 @@ public static function getModules() foreach ($plugins as $plugin) { $modules['plugins'][] = [ - sanitize_title($plugin['Name']), + sanitize_title($plugin['TextDomain'], $plugin['Name']), $plugin['Version'] ]; } diff --git a/readme.txt b/readme.txt index e4f803ae3..ebf0ef640 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: security, firewall, malware, wordpress security, brute force Requires at least: 5.0 Tested up to: 6.7 Requires PHP: 5.6 -Stable tag: 2.147 +Stable tag: 2.148 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -339,6 +339,11 @@ This is required for the Security FireWall to function properly. Plugins that ar == Changelog == += 2.148 Dec 09 2024 +* New. Plugin settings. Navigation bar implemented for settings general. +* Upd. Code. Removed the plugin dependency on jQuery for site public pages. +* Fix. Vulnerability Alarm. Fixed the name detection of module being checked. + = 2.147 Nov 25 2024 * New. Admin Banners. Critical files warning banner implemented. * Upd. Readme. Tagline, description has been updated. diff --git a/security-malware-firewall.php b/security-malware-firewall.php index 60e830a7e..88311af6d 100644 --- a/security-malware-firewall.php +++ b/security-malware-firewall.php @@ -5,7 +5,7 @@ Plugin URI: https://wordpress.org/plugins/security-malware-firewall/ Description: Security & Malware scan by CleanTalk to protect your website from online threats and viruses. IP/Country FireWall, Web application FireWall. Detailed stats and logs to have full control. Author: CleanTalk Security -Version: 2.147 +Version: 2.148 Author URI: https://cleantalk.org Text Domain: security-malware-firewall Domain Path: /i18n @@ -409,14 +409,6 @@ function spbc_change_author_name($link, $_author_id, $_author_nicename) add_filter('all_plugins', 'spbc_admin__change_plugin_description'); add_filter('plugin_row_meta', 'spbc_plugin_links_meta', 10, 2); } - - // Public scripts -} else { - $spbc->public_scripts_attached = false; - - // Alternative cookies JS script - add_action('wp_enqueue_scripts', 'spbc_enqueue_scripts__public'); - add_action('login_enqueue_scripts', 'spbc_enqueue_scripts__public'); } add_action('init', function () use ($spbc) { @@ -430,37 +422,6 @@ function spbc_change_author_name($link, $_author_id, $_author_nicename) } }); -/** - * Enqueue JS scripts on public page - */ -function spbc_enqueue_scripts__public() -{ - global $spbc; - - if (spbc_is_amp_request()) { - return; - } - - if ( ! $spbc->public_scripts_attached && $spbc->settings['data__set_cookies'] ) { - wp_enqueue_script('spbc_cookie', SPBC_PATH . '/js/spbc-cookie.min.js', array( 'jquery' ), SPBC_VERSION, false /*in header*/); - wp_localize_script( - 'spbc_cookie', - 'spbcPublic', - array( - '_ajax_nonce' => wp_create_nonce('ct_secret_stuff'), - '_rest_nonce' => wp_create_nonce('wp_rest'), - '_ajax_url' => admin_url('admin-ajax.php', 'relative'), - '_rest_url' => esc_url(get_rest_url()), - // '_apbct_ajax_url' => APBCT_URL_PATH . '/lib/Cleantalk/ApbctWP/Ajax.php', - 'data__set_cookies' => $spbc->settings['data__set_cookies'], - 'data__set_cookies__alt_sessions_type' => $spbc->settings['data__set_cookies__alt_sessions_type'], - ) - ); - - $spbc->public_scripts_attached = true; - } -} - function spbc_set_headers() { global $spbc; diff --git a/tests/CleantalkSP/SpbctWP/Firewall/FWTest.php b/tests/CleantalkSP/SpbctWP/Firewall/FWTest.php index 297d0af17..b61719570 100644 --- a/tests/CleantalkSP/SpbctWP/Firewall/FWTest.php +++ b/tests/CleantalkSP/SpbctWP/Firewall/FWTest.php @@ -53,7 +53,7 @@ public function testCheckIPV6SingleRecord() $firewall->setIpArray(array('test' => '2001:0db8:85a3:0000:0000:8a2e:0370:7339')); $result = $firewall->check(); $result_status = $result[0]->status; - $this->assertEquals('DENY', $result_status); + defined('AF_INET6') && $this->assertEquals('DENY', $result_status); spbct_sfw_private_records_handler( 'delete', @@ -74,12 +74,12 @@ public function testCheckIPV6Network() $firewall->setIpArray(array('test' => '2001:67c:21f0:0000:0000:8a2e:0370:7339')); $result = $firewall->check(); $result_status = $result[0]->status; - $this->assertEquals('DENY', $result_status); + defined('AF_INET6') && $this->assertEquals('DENY', $result_status); $firewall->setIpArray(array('test' => '2001:67c:21f1:0000:0000:8a2e:0370:7339')); $result = $firewall->check(); $result_status = $result[0]->status; - $this->assertEquals('PASS', $result_status); + defined('AF_INET6') && $this->assertEquals('PASS', $result_status); spbct_sfw_private_records_handler( 'delete',