From b089da91d9e823c84d653decd6b6563ad11b7426 Mon Sep 17 00:00:00 2001 From: Rebecca Hum Date: Mon, 18 Dec 2023 16:53:45 -0700 Subject: [PATCH 1/2] Update Akismet to 5.3 (#5086) --- akismet/.htaccess | 6 +- akismet/_inc/akismet-admin.css | 360 ++++++++++ akismet/_inc/akismet-admin.js | 7 + akismet/_inc/akismet.css | 88 +-- akismet/_inc/akismet.js | 4 +- akismet/_inc/fonts/inter.css | 67 ++ akismet/_inc/img/akismet-refresh-logo.svg | 1 + akismet/_inc/img/akismet-refresh-logo@2x.png | Bin 0 -> 2783 bytes akismet/_inc/img/arrow-left.svg | 1 + akismet/_inc/rtl/akismet-admin-rtl.css | 362 +++++++++++ akismet/_inc/rtl/akismet-rtl.css | 649 +++++++++++++++++++ akismet/akismet.php | 18 +- akismet/changelog.txt | 2 +- akismet/class.akismet-admin.php | 191 +++--- akismet/class.akismet-widget.php | 1 + akismet/class.akismet.php | 37 +- akismet/readme.txt | 31 +- akismet/views/config.php | 344 +++++----- akismet/views/connect-jp.php | 128 ++-- akismet/views/enter.php | 17 +- akismet/views/get.php | 8 +- akismet/views/logo.php | 13 + akismet/views/notice.php | 283 +++++--- akismet/views/start.php | 4 +- akismet/views/stats.php | 9 +- 25 files changed, 2118 insertions(+), 513 deletions(-) create mode 100644 akismet/_inc/akismet-admin.css create mode 100644 akismet/_inc/akismet-admin.js create mode 100644 akismet/_inc/fonts/inter.css create mode 100644 akismet/_inc/img/akismet-refresh-logo.svg create mode 100644 akismet/_inc/img/akismet-refresh-logo@2x.png create mode 100644 akismet/_inc/img/arrow-left.svg create mode 100644 akismet/_inc/rtl/akismet-admin-rtl.css create mode 100644 akismet/_inc/rtl/akismet-rtl.css create mode 100644 akismet/views/logo.php diff --git a/akismet/.htaccess b/akismet/.htaccess index d267551777..b331c6a9e4 100644 --- a/akismet/.htaccess +++ b/akismet/.htaccess @@ -12,7 +12,7 @@ # Akismet CSS and JS - + Allow from all @@ -23,7 +23,7 @@ # Akismet images - + Allow from all @@ -31,4 +31,4 @@ Require all granted - \ No newline at end of file + diff --git a/akismet/_inc/akismet-admin.css b/akismet/_inc/akismet-admin.css new file mode 100644 index 0000000000..44d4b0860b --- /dev/null +++ b/akismet/_inc/akismet-admin.css @@ -0,0 +1,360 @@ +#akismet-plugin-container { + background-color: var(--akismet-color-light-grey); + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif; + --akismet-color-charcoal: #272635; + --akismet-color-light-grey: #f6f7f7; + --akismet-color-mid-grey: #a7aaad; + --akismet-color-dark-grey: #646970; + --akismet-color-grey-80: #2c3338; + --akismet-color-grey-100: #101517; + --akismet-color-white: #fff; + --akismet-color-mid-green: #357b49; + --akismet-color-mid-red: #e82c3f; + --akismet-color-light-blue: #256eff; + --akismet-color-notice-light-green: #dbf0e1; + --akismet-color-notice-dark-green: #69bf82; + --akismet-color-notice-light-red: #ffdbde; + --akismet-color-notice-dark-red: #ff6676; +} + +#akismet-plugin-container a { + color: var(--akismet-color-mid-green); +} + +#akismet-plugin-container button:focus-visible, +#akismet-plugin-container input:focus-visible { + border: 0; + box-shadow: none; + outline: 2px solid var(--akismet-color-light-blue); +} + +.akismet-masthead { + box-shadow: none; +} + +.akismet-masthead__logo { + margin: 20px 0; +} + +.akismet-section-header { + box-shadow: none; + margin-bottom: 0; +} + +.akismet-section-header__label { + color: var(--akismet-color-charcoal); + font-weight: 600; +} + +.akismet-button, .akismet-button:hover { + background-color: var(--akismet-color-mid-green); + border: 0; + color: #fff; +} + +/* Need this specificity to override the existing header rule */ +.akismet-new-snapshot h3.akismet-new-snapshot__header { + background: none; + font-size: 13px; + color: var(--akismet-color-charcoal); + text-align: left; + text-transform: none; +} + +.akismet-new-snapshot .akismet-new-snapshot__number { + color: var(--akismet-color-charcoal); + letter-spacing: -1px; + text-align: left; +} + +.akismet-new-snapshot li.akismet-new-snapshot__item { + color: var(--akismet-color-dark-grey); + font-size: 13px; + text-align: left; + text-transform: none; +} + +.akismet-masthead__logo-link { + min-height: 50px; +} + +.akismet-masthead__back-link-container { + margin-top: 16px; + margin-bottom: 2px; +} + +/* Need this specificity to override the existing link rule */ +#akismet-plugin-container a.akismet-masthead__back-link { + background-image: url(img/arrow-left.svg); + background-position: left; + background-repeat: no-repeat; + background-size: 16px; + color: var(--akismet-color-charcoal); + font-weight: 400; + padding-left: 20px; + text-decoration: none; +} + +#akismet-plugin-container a.akismet-masthead__back-link:hover { + text-decoration: underline; +} + +.akismet-new-snapshot__item { + border-top: 1px solid var(--akismet-color-light-grey); + border-left: 1px solid var(--akismet-color-light-grey); + padding: 1em; +} + +.akismet-new-snapshot li:first-child { + border-left: none; +} + +.akismet-new-snapshot__list { + display: flex; + margin-bottom: 0; +} + +.akismet-new-snapshot__item { + flex: 1 0 33.33%; + margin-bottom: 0; + padding-left: 1.5em; + padding-right: 1.5em; +} + +.akismet-new-snapshot__chart { + padding: 1em; +} + +.akismet-box { + border: 0; +} + +.akismet-box, +.akismet-card { + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.16); + border-radius: 8px; + overflow: hidden; +} + +.akismet-card { + margin: 32px auto 0 auto; +} + +.akismet-lower { + padding-top: 0; +} + +.akismet-lower .inside { + padding: 0; +} + +.akismet-section-header__label { + margin: 0; +} + +.akismet-settings__row { + border-bottom: 1px solid var(--akismet-color-light-grey); + display: block; + padding: 1em 1.5em; +} + +.akismet-settings__row-input { + margin-left: auto; +} + +.akismet-settings__row-title { + font-weight: 500; + font-size: 1em; + margin: 0; + margin-bottom: 1em; +} + +.akismet-settings__row-description { + margin-top: 0.5em; +} + +.akismet-card-actions { + padding: 1em; +} + +.akismet-settings__row label { + padding-bottom: 1em; +} + +.akismet-settings__row-note { + font-size: 0.9em; + margin-top: 0.4em; +} + +.akismet-settings__row input[type="checkbox"], +.akismet-settings__row input[type="radio"] { + accent-color: var(--akismet-color-mid-green); + box-shadow: none; + flex-shrink: 0; + margin: 2px 0 0 0; +} + +.akismet-settings__row input[type="checkbox"] { + margin-top: 1px; + vertical-align: top; + -webkit-appearance: checkbox; +} + +.akismet-settings__row input[type="radio"] { + -webkit-appearance: radio; +} + +/* Fix up misbehaving wp-admin styles in Chrome (from forms and colors stylesheets) */ +.akismet-settings__row input[type="checkbox"]:checked:before { + content: ''; +} + +.akismet-settings__row input[type="radio"]:checked:before { + background: none; +} + +.akismet-settings__row input[type="checkbox"]:checked:hover, +.akismet-settings__row input[type="radio"]:checked:hover { + accent-color: var(--akismet-color-mid-green); +} + +.akismet-button:disabled { + background-color: var(--akismet-color-mid-grey); + color: var(--akismet-color-white); + cursor: arrow; +} + +.akismet-awaiting-stats, +.akismet-account { + padding: 0 1rem 1rem 1rem; + margin: 0; +} + +.akismet-account { + padding-bottom: 0; +} + +.akismet-account th { + font-weight: 500; + padding-right: 1em; +} + +.akismet-account th, .akismet-account td { + padding-bottom: 1em; +} + +.akismet-settings__row-input-label { + align-items: center; + display: flex; +} + +.akismet-settings__row-label-text { + padding-left: 0.5em; + margin-top: 2px; +} + +.akismet-alert { + border-left: 8px solid; + border-radius: 8px; + margin: 20px 0; + padding: 0.2em 1em; +} + +.akismet-alert__heading { + font-size: 1em; +} + +.akismet-alert.is-good { + background-color: var(--akismet-color-notice-light-green); + border-left-color: var(--akismet-color-notice-dark-green); +} + +.akismet-alert.is-neutral { + background-color: var(--akismet-color-white); + border-left-color: var(--akismet-color-dark-grey); +} + +.akismet-alert.is-bad { + background-color: var(--akismet-color-notice-light-red); + border-left-color: var(--akismet-color-notice-dark-red); +} + +#akismet-plugin-container .akismet-alert.is-good a, +#akismet-plugin-container .akismet-alert.is-bad a { + /* For better contrast - green isn't great */ + color: var(--akismet-color-grey-80); +} + +/* Setup - API key input */ +.akismet-enter-api-key-box { + margin: 1.5rem 0; +} + +.akismet-enter-api-key-box__reveal { + background: none; + border: 0; + color: var(--akismet-color-mid-green); + cursor: pointer; + text-decoration: underline; +} + +.akismet-enter-api-key-box__form-wrapper { + display: none; + margin-top: 1.5rem; +} + +.akismet-enter-api-key-box__input-wrapper { + box-sizing: border-box; + display: flex; + flex-wrap: nowrap; + padding: 0 1.5rem; + width: 100%; +} + +.akismet-enter-api-key-box__key-input { + flex-grow: 1; + margin-right: 1rem; +} + +h3.akismet-enter-api-key-box__header { + padding-top: 0; + padding-bottom: 1em; + text-align: left; +} + +@media screen and (max-width: 782px) { + .akismet-new-snapshot__list { + display: block; + } + + .akismet-new-snapshot__number { + float: right; + font-size: 20px; + font-weight: 500; + margin-top: -16px; + } + + .akismet-new-snapshot__header { + font-size: 14px; + font-weight: 500; + } + + .akismet-new-snapshot__text { + font-size: 12px; + } + + .akismet-settings__row input[type="checkbox"], + .akismet-settings__row input[type="radio"] { + height: 24px; + width: 24px; + } + + .akismet-settings__row-label-text { + padding-left: 0.8em; + } + + .akismet-settings__row input[type="checkbox"], + .akismet-settings__row input[type="radio"] { + margin-top: 0; + } +} \ No newline at end of file diff --git a/akismet/_inc/akismet-admin.js b/akismet/_inc/akismet-admin.js new file mode 100644 index 0000000000..4a3f9fc2a8 --- /dev/null +++ b/akismet/_inc/akismet-admin.js @@ -0,0 +1,7 @@ +document.addEventListener( 'DOMContentLoaded', function() { + // Prevent aggressive iframe caching in Firefox + var statsIframe = document.getElementById( 'stats-iframe' ); + if ( statsIframe ) { + statsIframe.contentWindow.location.href = statsIframe.src; + } +} ); \ No newline at end of file diff --git a/akismet/_inc/akismet.css b/akismet/_inc/akismet.css index a62f7a84cf..dbede8f5e9 100644 --- a/akismet/_inc/akismet.css +++ b/akismet/_inc/akismet.css @@ -99,46 +99,9 @@ table.comments td.comment p a:after { font-size: 120%; margin-top: .5rem; } -.akismet-alert { - padding: 0.4em 1em 1.4em 1em; - box-sizing: border-box; - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; -} - -.akismet-alert h3.akismet-key-status { - color: #fff; - margin: 1em 0 0.5em 0; -} - -.akismet-alert.akismet-critical { - background-color: #993300; -} - -.akismet-alert.akismet-active { - background-color: #649316; -} - -.akismet-alert p.akismet-key-status { - font-size: 24px; -} - -.akismet-alert p.akismet-description { - color:#fff; - font-size: 14px; - margin: 0 0; - font-style: normal; -} - -.akismet-alert p.akismet-description a, -.akismet-alert p.akismet-description a, -.akismet-alert p.akismet-description a, -.akismet-alert p.akismet-description a { - color: #fff; -} .akismet-new-snapshot { margin-top: 1em; - padding: 1em; text-align: center; background: #fff; } @@ -148,34 +111,19 @@ table.comments td.comment p a:after { color: #888; font-size: 11px; margin: 0; - padding: 3px; -} - -.new-snapspot ul { - font-size: 12px; - width: 100%; } .akismet-new-snapshot ul li { color: #999; - float: left; font-size: 11px; - padding: 0 20px; text-transform: uppercase; - width: 33%; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; } -.akismet-new-snapshot ul li:first-child, -.akismet-new-snapshot ul li:nth-child(2) { - border-right:1px dotted #ccc; -} - -.akismet-new-snapshot ul li span { - color: #52accc; +.akismet-new-snapshot__number { display: block; font-size: 32px; font-weight: lighter; @@ -192,10 +140,6 @@ table.comments td.comment p a:after { padding-top: 0; } -.akismet-settings input[type=text] { - width: 75%; -} - .akismet-settings span.akismet-note{ float: left; padding-left: 23px; @@ -312,7 +256,7 @@ table.comments td.comment p a:after { .akismet_activate .aa_a { display: none; } - + .akismet_activate .aa_button_container { width: 100%; } @@ -328,7 +272,7 @@ table.comments td.comment p a:after { #akismet_setup_prompt .aa_description { display: none; } - + .akismet_activate { min-width: 0; } @@ -359,10 +303,6 @@ table.comments td.comment p a:after { .akismet-masthead__logo-container { padding:.3125rem 0 0 } -.akismet-masthead__logo { - width:10.375rem; - height:1.8125rem; -} .akismet-masthead__logo-link { display:inline-block; outline:none; @@ -448,10 +388,8 @@ table.comments td.comment p a:after { margin-top: 1rem; margin-bottom: 0; position: relative; - margin: 0 auto 0.625rem auto; box-sizing: border-box; background: white; - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; } .akismet-card:after, .akismet-card .inside:after, .akismet-masthead__logo-container:after { @@ -507,7 +445,7 @@ table.comments td.comment p a:after { width: 54px; height: 54px; } - + .akismet-box p:after { content: "."; display: block; @@ -551,15 +489,6 @@ table.comments td.comment p a:after { text-align: center; } -.akismet-enter-api-key-box { - margin: 1.5rem 0; -} - -.akismet-box .enter-api-key { - display: none; - margin-top: 1.5rem; -} - .akismet-box .akismet-toggles { margin: 3rem 0; } @@ -568,10 +497,6 @@ table.comments td.comment p a:after { display: none; } -.akismet-box .enter-api-key p { - padding: 0 1.5rem; -} - .akismet-button, .akismet-button:hover, .akismet-button:visited { background: white; border-color: #c8d7e1; @@ -699,9 +624,14 @@ div.error.akismet-usage-limit-alert { } .akismet-usage-limit-alert .akismet-usage-limit-cta { + border-color: none; text-align: right; } +#akismet-plugin-container .akismet-usage-limit-cta a { + color: #d63638; +} + @media (max-width: 550px) { div.error.akismet-usage-limit-alert { display: block; diff --git a/akismet/_inc/akismet.js b/akismet/_inc/akismet.js index 7ebac1a5a3..2f9aa73a45 100644 --- a/akismet/_inc/akismet.js +++ b/akismet/_inc/akismet.js @@ -385,10 +385,10 @@ jQuery( function ( $ ) { /** * Shows the Enter API key form */ - $( '.akismet-enter-api-key-box a' ).on( 'click', function ( e ) { + $( '.akismet-enter-api-key-box__reveal' ).on( 'click', function ( e ) { e.preventDefault(); - var div = $( '.enter-api-key' ); + var div = $( '.akismet-enter-api-key-box__form-wrapper' ); div.show( 500 ); div.find( 'input[name=key]' ).focus(); diff --git a/akismet/_inc/fonts/inter.css b/akismet/_inc/fonts/inter.css new file mode 100644 index 0000000000..d28b612452 --- /dev/null +++ b/akismet/_inc/fonts/inter.css @@ -0,0 +1,67 @@ +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-Regular.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-Regular.woff?v=3.19") format("woff"); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-Italic.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-Italic.woff?v=3.19") format("woff"); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 500; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-Medium.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-Medium.woff?v=3.19") format("woff"); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 500; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-MediumItalic.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-MediumItalic.woff?v=3.19") format("woff"); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-SemiBold.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-SemiBold.woff?v=3.19") format("woff"); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 600; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-SemiBoldItalic.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-SemiBoldItalic.woff?v=3.19") format("woff"); +} + +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-Bold.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-Bold.woff?v=3.19") format("woff"); +} +@font-face { + font-family: 'Inter'; + font-style: italic; + font-weight: 700; + font-display: swap; + src: url("https://s0.wp.com/i/fonts/inter/Inter-BoldItalic.woff2?v=3.19") format("woff2"), + url("https://s0.wp.com/i/fonts/inter/Inter-BoldItalic.woff?v=3.19") format("woff"); +} diff --git a/akismet/_inc/img/akismet-refresh-logo.svg b/akismet/_inc/img/akismet-refresh-logo.svg new file mode 100644 index 0000000000..f5b5d2c57d --- /dev/null +++ b/akismet/_inc/img/akismet-refresh-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/akismet/_inc/img/akismet-refresh-logo@2x.png b/akismet/_inc/img/akismet-refresh-logo@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..15c3db3c0b3e20649fe9b7062da44756c2db135f GIT binary patch literal 2783 zcmZ`*c{mhWA2wVeL_;&yA|)}_21!}648|HVvdj$GlcgDJV@)nuCS7AJg-O)4jl?ix zi$*k-ELoGL8_h?uW*ITx+l)6zP{g||~Pe9%-~R8cRlys{9XrAtx* z?upKng?~h64gtl8U;2TXDz{n|zzu=}>X#@)56o?CN(=q4df|Y%H~^Zx-m3Dk`ZAxw zz29Z&cmz9x_3=q;3aojBcRD$JSdZP@f@7##tKz;YZ(GV2DQ7fx0 z4l=bK!AH=?aTXUBLy^YV>0l6j`9TL21S!h0S{jVJbH^SuyF1Y0*5R@RV7yi9dRc|w z%9~pV%rL#dSg^oh6N1JUK2HY!WZEya(d7M1VZPt&rk z(`3sI0#m%)w{TZLdh2?INU85{3@BzE7w4dj~RtZsrO>E7m+Cg!#Erz#A;wJ*7 z8Y`HHs~hqu9^9}gnjx(|>Zj@XD4tsv?II#mbBeB?R_$q*|G6SrH9BeJv|Y$h(df&F zI37-Lb%Hfx{r4gzw#uojFdH(n{}jWb)aPN_@eGkkDO_&VIY*Y*wK&*NtwhGQ(AFc* z9N`diRW;@eybuV|V%QO>cjJU0`@1F+;Db|yk%@-YUdp`ByC_S+H$acg@-cN;GqPeX za}R0!OHf5({G-xdckhz|7ue(toPJgfv!LFzFU<=%}u*utHEB-Gu*_VUHE1P)D_vc2X zb8kS)5bY9~h!5w{L48-U_CuMv$D5?+8&jI!*N>zgUIgQAbxI4%T{pd;ZJTuQ06 zxli-Yr*yb|Tq}dGgsDJf0+03f9ElB~`n?N#y|HYTxRZb;%p09ykN1o(>9oHkojM)1U2#hoR2`f;9%v@jIDI#yAH7|E=d4*kx|gW;rAaSwM&&H&_xn5XxIN;BK~^s#(QU1J1@OL{*ZI$ zf{J}c%BLQoWkUsF{wv}l_d)3*;X=m*U?zWp#$0Nna*mO({z%u@PR85{@b$sK!eI*H z(o9gUg>hDqm-5W!8+?BBnIMcg-fvo0-h#}M1Lc0}HZ>CP45@4j%@Wi>_tNAUeAaFe zfW?()AJdSvXCk<&VP&J>BFiJrCma2`m+01VIIT77hwJ(M0lmB+B@=%cck-_&h=7#* zIbp4XQ{bL%b8mW~QH>Z##^<|TBvqB_z6K#g;R@@r55jXCCaOXE60&GuJu>?B3kIFM z7V}M*PC{ljtKKn%n6d?&ge(Cd^5=JP;!gopJ^?o7@UIU-+gF zk1whL$NxaR(GtS6y@Q5eRE5I4G*an{6aldY7WnDPL%1~jkL&j4x&>W2PLQj&r`%kp zRwMgp&po$>6Wp@$FqLAX<-megR?}QT=2(6rzP>kQStxj~p#xJ}yZ}EerYzKg0y@={ zWqe08VfzA~uk`^Hdfj@#T5a9wq@-u5=c=ig4~6^~qz3yNF|A(o{r#enfn>NmNKTy+ z;2XgY>G}ageEQ6is?tDeB-4QfV_6JwLJ-nynCNy1Y@>Si<7ApY2nN_!m2|kb|oZ7k?sI zj2+bUU%m(kJ22&lhvAJDb&$8^n(mq0GX7i5a{U9BG9953v}4vbaSwIwXHrN|RqdyhJ$WExq?A#`f=6t{ZO8JL!^WL+th z$C^kQk5>2fR-_oCCKVer_V{#h=TnjM1W~R1Z{*LFo<;ASj;04@^bR~V=<*+}Ab&X- zHnj9ZN93g?;AOc