From 963606125d27c8fad6297fe5abefca2f876f16dc Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 6 May 2024 13:16:35 +0300 Subject: [PATCH] Fix. Vulnerability alarm. Safe badge layout fixed. (#340) --- css/spbc-admin.min.css | 2 +- css/src/spbc-admin.css | 20 ++++----------- images/spbct-safe-extension.png | Bin 2651 -> 0 bytes .../Assets/approved_auto.svg | 13 ++++++++++ .../Assets/approved_manual.svg | 19 +++++++++++++++ .../Assets/approved_manual_and_auto.svg | 23 ++++++++++++++++++ .../VulnerabilityAlarm/Assets/vulnerable.svg | 16 ++++++++++++ .../View/PluginIsSafeBadge.html | 2 +- .../VulnerabilityAlarmView.php | 19 +++++++++------ 9 files changed, 90 insertions(+), 24 deletions(-) delete mode 100644 images/spbct-safe-extension.png create mode 100644 lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_auto.svg create mode 100644 lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual.svg create mode 100644 lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual_and_auto.svg create mode 100644 lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/vulnerable.svg diff --git a/css/spbc-admin.min.css b/css/spbc-admin.min.css index a8321eb8d..9aa2f1b4a 100644 --- a/css/spbc-admin.min.css +++ b/css/spbc-admin.min.css @@ -1 +1 @@ -.spbc_translate_links{color:rgba(150,150,20,1)}.spbc_faq_links{color:rgba(20,150,20,1)}.spbc_support_links{color:rgba(150,20,20,1)}.spbc_setting_links{color:rgba(20,20,150,1)}.spbc_translate_links:hover{color:rgba(210,210,20,1)!important}.spbc_faq_links:hover{color:rgba(20,250,20,1)!important}.spbc_support_links:hover{color:rgba(250,20,20,1)!important}.spbc_setting_links:hover{color:rgba(20,20,250,1)!important}.spbc_hide{display:none}.spbc_hide_table_cell_desc{display:none;max-width:90%}.--hide{display:none}#wp-admin-bar-cleantalk_admin_bar__parent_node span,.-display--inline-block{display:inline-block}.ctlk---red,.spbcRed{color:red}.spbcGreen{color:green}.spbcTextCenter{text-align:center}.spbc-overflow--visible{overflow:visible!important}._animate--rotate{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node .spbc-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}#wp-admin-bar-spbc_admin_bar__settings_link a,.cleantalk-admin_bar__parent a{display:inline-block!important;padding:0 10px!important}.cleantalk_admin_bar__blocked div{cursor:not-allowed!important}.cleantalk_admin_bar__blocked div a{color:#777!important}b.spbc-admin_bar--online_admins{font-size:11px!important}.cleantalk_admin_bar__title{vertical-align:top;margin-left:5px!important}.clntlk-hint{position:relative!important}.clntlk-hint:hover{color:#fff}.clntlk-hint:hover::after{content:attr(hint);position:absolute;left:100%;top:50%;background:rgba(235,235,235,.85);padding:0 5px;border:1px solid #333;color:#000;font-style:normal;width:max-content;z-index:99999999999999999}.cleantalk_admin_bar__separator{height:0!important}span.green_dot,span.red_dot{height:8px!important;width:8px!important;border-radius:50%!important;display:inline-block!important;margin-left:5px!important}.cleantalk_admin_bar__counter a{padding:0 10px!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}span.red_dot{background-color:#d00!important}span.green_dot{background-color:#0d0!important}#spbct-upload-checker-details{overflow-y:scroll;height:150px;border:1px solid #CCC}#spbct-upload-checker-details li:nth-child(2n+1){background:#CCC}.plugins .update+.spbc-vulnerable-notice td{box-shadow:none!important}.spbct-safe-extension-badge{cursor:pointer}.spbct-safe-extension-badge-description-placeholder{position:relative}.spbct-safe-extension-badge-description{display:none;position:absolute;min-width:150px;background:rgba(0,0,0,.5);color:#fff;text-align:left;top:5px;right:0;padding:5px;border-radius:4px;animation:fadeInFromNone .3s ease-in-out;z-index:9999}@keyframes fadeInFromNone{0%{display:none;opacity:0}1%{display:block;opacity:0}100%{display:block;opacity:1}}.spbct-safe-extension-badge-description:before{content:'';position:absolute;top:-10px;right:12px;border:5px solid transparent;border-bottom:5px solid rgba(0,0,0,.5)}.spbct-safe-extension-badge-description:hover,.spbct-safe-extension-badge:hover+.spbct-safe-extension-badge-description-placeholder>.spbct-safe-extension-badge-description{display:block}.spbct-safe-extension-badge-description>a{color:#fff}.spbct-safe-icon{background-color:transparent;background-image:url(../images/spbct-safe-extension.png);background-size:34px;display:inline-block;height:34px;width:34px;top:-5px;left:-5px} \ No newline at end of file +.spbc_translate_links{color:rgba(150,150,20,1)}.spbc_faq_links{color:rgba(20,150,20,1)}.spbc_support_links{color:rgba(150,20,20,1)}.spbc_setting_links{color:rgba(20,20,150,1)}.spbc_translate_links:hover{color:rgba(210,210,20,1)!important}.spbc_faq_links:hover{color:rgba(20,250,20,1)!important}.spbc_support_links:hover{color:rgba(250,20,20,1)!important}.spbc_setting_links:hover{color:rgba(20,20,250,1)!important}.spbc_hide{display:none}.spbc_hide_table_cell_desc{display:none;max-width:90%}.--hide{display:none}#wp-admin-bar-cleantalk_admin_bar__parent_node span,.-display--inline-block{display:inline-block}.ctlk---red,.spbcRed{color:red}.spbcGreen{color:green}.spbcTextCenter{text-align:center}.spbc-overflow--visible{overflow:visible!important}._animate--rotate{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}#wp-admin-bar-cleantalk_admin_bar__parent_node{margin-right:5px}#wp-admin-bar-cleantalk_admin_bar__parent_node .spbc-icon-attention-alt{background:#d63638;color:#fff;border-radius:50%;font-size:12px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{width:14px;height:17px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{width:18px;height:18px;margin-top:7px}#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{color:#999;display:inline;padding:2px 5px!important}#wp-admin-bar-spbc_admin_bar__settings_link a,.cleantalk-admin_bar__parent a{display:inline-block!important;padding:0 10px!important}.cleantalk_admin_bar__blocked div{cursor:not-allowed!important}.cleantalk_admin_bar__blocked div a{color:#777!important}b.spbc-admin_bar--online_admins{font-size:11px!important}.cleantalk_admin_bar__title{vertical-align:top;margin-left:5px!important}.clntlk-hint{position:relative!important}.clntlk-hint:hover{color:#fff}.clntlk-hint:hover::after{content:attr(hint);position:absolute;left:100%;top:50%;background:rgba(235,235,235,.85);padding:0 5px;border:1px solid #333;color:#000;font-style:normal;width:max-content;z-index:99999999999999999}.cleantalk_admin_bar__separator{height:0!important}span.green_dot,span.red_dot{height:8px!important;width:8px!important;border-radius:50%!important;display:inline-block!important;margin-left:5px!important}.cleantalk_admin_bar__counter a{padding:0 10px!important}.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{margin-bottom:5px!important}span.red_dot{background-color:#d00!important}span.green_dot{background-color:#0d0!important}#spbct-upload-checker-details{overflow-y:scroll;height:150px;border:1px solid #CCC}#spbct-upload-checker-details li:nth-child(2n+1){background:#CCC}.plugins .update+.spbc-vulnerable-notice td{box-shadow:none!important}.spbct-safe-extension-badge{cursor:pointer}.spbct-safe-extension-badge-description-placeholder{position:relative}.spbct-safe-extension-badge-description{display:none;position:absolute;min-width:200px;background:rgba(0,0,0,.5);color:#fff;text-align:center;top:2px;right:0;padding:5px;animation:fadeInFromNone .3s ease-in-out;z-index:9999}@keyframes fadeInFromNone{0%{display:none;opacity:0}1%{display:block;opacity:0}100%{display:block;opacity:1}}.spbct-safe-extension-badge-description:before{content:'';position:absolute;top:-10px;right:10px;border:5px solid transparent;border-bottom:5px solid rgba(0,0,0,.5)}.spbct-safe-extension-badge-description:hover,.spbct-safe-extension-badge:hover+.spbct-safe-extension-badge-description-placeholder>.spbct-safe-extension-badge-description{display:block}.spbct-safe-extension-badge-description>a{color:#fff;text-decoration:underline} \ No newline at end of file diff --git a/css/src/spbc-admin.css b/css/src/spbc-admin.css index 4cabe9c5a..983fe74f0 100644 --- a/css/src/spbc-admin.css +++ b/css/src/spbc-admin.css @@ -158,14 +158,13 @@ span.green_dot{ .spbct-safe-extension-badge-description { display: none; position: absolute; - min-width: 150px; + min-width: 200px; background: rgba(0, 0, 0, 0.5); color: white; - text-align: left; - top: 5px; + text-align: center; + top: 2px; right: 0; padding: 5px; - border-radius: 4px; animation: fadeInFromNone 0.3s ease-in-out; z-index: 9999; } @@ -187,7 +186,7 @@ span.green_dot{ content: ''; position: absolute; top: -10px; - right: 12px; + right: 10px; border: 5px solid transparent; border-bottom: 5px solid rgba(0, 0, 0, 0.5); } @@ -197,14 +196,5 @@ span.green_dot{ } .spbct-safe-extension-badge-description > a { color: white; -} -.spbct-safe-icon { - background-color: transparent; - background-image: url(../images/spbct-safe-extension.png); - background-size: 34px; - display: inline-block; - height: 34px; - width: 34px; - top: -5px; - left: -5px; + text-decoration: underline; } \ No newline at end of file diff --git a/images/spbct-safe-extension.png b/images/spbct-safe-extension.png deleted file mode 100644 index e4ff5c1fa45de6f326000662eb9083cbdbbceac1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2651 zcmV-h3Z(UkP)2uk5F`>=)Wpg%F395g zA`ynHW5Ccb7Nr=DkU&}q$D+2PP=%3N5DRQY^u+?rA_77YCQgFbkkxeT58Hy8DvTM> zHM|j1K`IH^#U;=r9y*yBB~i}Pk7+y@^i#H&>3A|-T)ve508J)vi+P}|#EB5BCs1L! zPGm+z0%w{!29bw?uH(5|O-c>|b7ftpGH0n&a)N$r$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@}`PkIBr6;k?J6sS<{hfUc97*)aCZ+`hAnAmH)L0mO%T*237%#IV&M1h{N3 zGhAnzzaIQj*?QK(*b2i|6Gp7zjjl3Rf2TeSzKs?i&`@;IV%~A?GAyfknPwmDws}X* z_&ZZLJsE_y+!X(dRl5H!vse4z`G`S;AB_0 z`5Uz^Z0JZ|C5|tWG~e~pdaf;yo*3IsW=1K!I|GF$s7y1PpvsEffu?~qE9p9w=_kwK zX4)wzyih37FyymWvK8yg0y~|Y+}e#+N(&R^Y3YZda7$9tFl=>gO=<75Z9Frk>CQ`Y z6pj?=z74W#Yg*qWvxK9L{`G@-R&&!EVyzyj#Xam(P`HAUg3-WYj1yeO;n*V*D5|vD z9b_#xLTw?(?yXf|jJtC~W(yK1Qo(kDES-C~C0E-brVt)SBkAqOEz?`uk&({Dks!K( zv-g(qs@*YF=KJnsvBcH{jDBugX_Px8rbM~lSRieZ@9NkddDF#hr-pV5-580?ir6}I zWDQMB_?ghMvR*u47%W(-LOlBJIHyJLr9|=NvqRZQ3A$l^0gI#=#sImGfhMm6&5;oo_#&<_c6?tEIAs)_{E4$ZCtxhDXxe}9UwttS0w`j}{{h=#u^$rGJfQ#p002ov JPDHLkV1l`I1y}$8 diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_auto.svg b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_auto.svg new file mode 100644 index 000000000..123ca8801 --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_auto.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual.svg b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual.svg new file mode 100644 index 000000000..7faf7de23 --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual_and_auto.svg b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual_and_auto.svg new file mode 100644 index 000000000..e1d60115c --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/approved_manual_and_auto.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/vulnerable.svg b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/vulnerable.svg new file mode 100644 index 000000000..083f3830d --- /dev/null +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets/vulnerable.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/PluginIsSafeBadge.html b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/PluginIsSafeBadge.html index a2c99035b..95481d9d5 100644 --- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/PluginIsSafeBadge.html +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/View/PluginIsSafeBadge.html @@ -1,5 +1,5 @@
- + Approved
diff --git a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php index 4cb69355d..e7961e5f5 100755 --- a/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php +++ b/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/VulnerabilityAlarmView.php @@ -6,6 +6,8 @@ class VulnerabilityAlarmView { + const ASSETS_URL = SPBC_PATH . '/lib/CleantalkSP/SpbctWP/VulnerabilityAlarm/Assets'; + /** * @param string $plugin_file * @param PluginReport $plugin_report @@ -69,6 +71,7 @@ public static function showSafeBadge($module_type, $plugin_slug, $plugin_id) if ( file_exists($layout_file) ) { $replaces = [ + '{{ASSETS_URL}}' => self::ASSETS_URL, '{{DESCRIPTION}}' => $badge_description, '{{MORE_DETAILS_LINK}}' => static::getMoreDetailsLink($plugin_slug, $plugin_id, true) ]; @@ -93,18 +96,20 @@ public static function showSafeBadge($module_type, $plugin_slug, $plugin_id) private static function getMoreDetailsLink($plugin_slug = '', $plugin_id = '', $line_break = false) { $details_link = "https://research.cleantalk.org"; - $line_break = $line_break ? '
' : ' '; + $line_break_layout = $line_break ? '
' : ' '; if ($plugin_slug && $plugin_id) { - $details_link = $details_link . '/reports/app/' . $plugin_slug . '#' . $plugin_id; + $details_link = esc_attr($details_link . '/reports/app/' . $plugin_slug . '#' . $plugin_id); } return sprintf( - esc_html__('Full report is here %s', 'security-malware-firewall'), - '' . $details_link . '' + esc_html__('Full report is %shere%s', 'security-malware-firewall'), + '', + '' ) - . $line_break + . $line_break_layout . sprintf( - esc_html__('Have questions? Ask us here %s', 'security-malware-firewall'), - 'https://wordpress.org/support/plugin/security-malware-firewall/' + esc_html__('Have questions? Ask us %shere%s', 'security-malware-firewall'), + '', + '' ); }