wip
This commit is contained in:
@@ -5,7 +5,9 @@ body {
|
||||
--akismet-color-dark-grey: #646970;
|
||||
--akismet-color-grey-80: #2c3338;
|
||||
--akismet-color-grey-100: #101517;
|
||||
--akismet-color-grey-border: #dcdcde;
|
||||
--akismet-color-white: #fff;
|
||||
--akismet-color-dark-green: #2d6a40;
|
||||
--akismet-color-mid-green: #357b49;
|
||||
--akismet-color-light-green: #4eb26a;
|
||||
--akismet-color-mid-red: #e82c3f;
|
||||
@@ -31,6 +33,7 @@ body {
|
||||
#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;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
#akismet-plugin-container a {
|
||||
@@ -69,10 +72,26 @@ body {
|
||||
padding-left: 0.2em;
|
||||
}
|
||||
|
||||
.akismet-button, .akismet-button:hover {
|
||||
background-color: var(--akismet-color-mid-green);
|
||||
.akismet-button,
|
||||
.akismet-button:hover {
|
||||
border: 0;
|
||||
color: #fff;
|
||||
color: var(--akismet-color-white);
|
||||
}
|
||||
|
||||
.akismet-button {
|
||||
background-color: var(--akismet-color-mid-green);
|
||||
}
|
||||
|
||||
.akismet-button:hover {
|
||||
background-color: var(--akismet-color-dark-green);
|
||||
}
|
||||
|
||||
.akismet-external-link::after {
|
||||
content: "↗";
|
||||
display: inline-block;
|
||||
padding-left: 2px;
|
||||
text-decoration: none;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
/* Need this specificity to override the existing header rule */
|
||||
@@ -84,9 +103,13 @@ body {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.akismet-new-snapshot .akismet-new-snapshot__number {
|
||||
.akismet-new-snapshot__number {
|
||||
color: var(--akismet-color-charcoal);
|
||||
display: block;
|
||||
font-size: 32px;
|
||||
font-weight: 400;
|
||||
letter-spacing: -1px;
|
||||
line-height: 1.5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -152,6 +175,10 @@ body {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.akismet-box:not(:first-child) {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.akismet-box,
|
||||
.akismet-card {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.16);
|
||||
@@ -340,6 +367,133 @@ body {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
/* Setup */
|
||||
.akismet-setup-instructions__heading {
|
||||
font-size: 1.375rem;
|
||||
font-weight: 700;
|
||||
padding-block-end: 0;
|
||||
}
|
||||
|
||||
h3.akismet-setup-instructions__subheading {
|
||||
color: var(--akismet-color-dark-grey);
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 1.25rem;
|
||||
padding-block-start: 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__feature-list {
|
||||
list-style: none;
|
||||
margin: 1rem 0.5rem 1.5rem;
|
||||
max-width: 640px;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__feature {
|
||||
align-items: start;
|
||||
display: flex;
|
||||
margin-block-end: 1rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__icon {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__body {
|
||||
flex: 1;
|
||||
padding-inline-start: 0.5rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__title {
|
||||
color: #1d2327;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p.akismet-setup-instructions__text {
|
||||
color: var(--akismet-color-grey-80);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0.25rem 0 0;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__button,
|
||||
.akismet-setup-instructions__button:hover,
|
||||
.akismet-setup-instructions__button:visited {
|
||||
font-size: 1rem;
|
||||
margin-inline-start: 1.5rem;
|
||||
}
|
||||
|
||||
.akismet-setup__connection {
|
||||
background: var(--akismet-color-light-grey);
|
||||
border: 1px solid var(--akismet-color-grey-border);
|
||||
border-radius: 8px;
|
||||
margin: 1rem 1rem 2rem 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-action:not(:last-child) {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-user {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-avatar {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-avatar-image {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-account-name {
|
||||
color: var(--akismet-color-charcoal);
|
||||
font-size: 0.9rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-account-email {
|
||||
margin-top: 0.1rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-action {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-button {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
p.akismet-setup__connection-action-intro,
|
||||
p.akismet-setup__connection-action-description {
|
||||
color: var(--akismet-color-dark-grey);
|
||||
font-size: 0.875rem;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p.akismet-setup__connection-action-intro {
|
||||
margin: 0 0 1rem 0;
|
||||
}
|
||||
|
||||
p.akismet-setup__connection-action-description {
|
||||
margin: 1rem 0 0;
|
||||
}
|
||||
|
||||
/* Setup - API key input */
|
||||
.akismet-enter-api-key-box {
|
||||
margin: 1.5rem 0;
|
||||
@@ -467,22 +621,6 @@ h3.akismet-enter-api-key-box__header {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.akismet-settings__external-link::after {
|
||||
content: "↗";
|
||||
display: inline-block;
|
||||
padding-left: 2px;
|
||||
text-decoration: none;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.akismet-compatible-plugins__external-link::after {
|
||||
content: "↗";
|
||||
display: inline-block;
|
||||
padding-left: 2px;
|
||||
text-decoration: none;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.akismet-compatible-plugins__show-more {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -91,13 +91,6 @@ table.comments td.comment p a:after {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.akismet-alert-text {
|
||||
color: #dd3d36;
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
margin-top: .5rem;
|
||||
}
|
||||
|
||||
.akismet-new-snapshot {
|
||||
margin-top: 1em;
|
||||
text-align: center;
|
||||
@@ -118,12 +111,6 @@ table.comments td.comment p a:after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.akismet-new-snapshot__number {
|
||||
display: block;
|
||||
font-size: 32px;
|
||||
font-weight: lighter;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.akismet-settings th:first-child {
|
||||
vertical-align: top;
|
||||
@@ -295,18 +282,6 @@ table.comments td.comment p a:after {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.akismet-jetpack-email {
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
.akismet-jetpack-gravatar {
|
||||
padding: 0 0 0 1.5rem;
|
||||
float: left;
|
||||
margin-right: 1rem;
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
}
|
||||
|
||||
.akismet-box p:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
@@ -333,31 +308,10 @@ table.comments td.comment p a:after {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.akismet-box-header {
|
||||
max-width: 700px;
|
||||
margin: 0 auto 40px auto;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.akismet-box-header h2 {
|
||||
margin: 1.5rem 10% 0;
|
||||
font-size: 1.375rem;
|
||||
font-weight: 700;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.akismet-box .centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.akismet-box .akismet-toggles {
|
||||
margin: 3rem 0;
|
||||
}
|
||||
|
||||
.akismet-box .akismet-ak-connect, .akismet-box .toggle-jp-connect {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.akismet-button, .akismet-button:hover, .akismet-button:visited {
|
||||
background: white;
|
||||
border-color: #c8d7e1;
|
||||
@@ -432,14 +386,15 @@ table.comments td.comment p a:after {
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions form {
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions > a.akismet-button {
|
||||
display: inline-block;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
div.error.akismet-usage-limit-alert {
|
||||
padding: 25px 45px 25px 15px;
|
||||
display: flex;
|
||||
@@ -477,6 +432,7 @@ div.error.akismet-usage-limit-alert {
|
||||
}
|
||||
|
||||
.akismet-usage-limit-alert h3 {
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -394,28 +394,4 @@ jQuery( function ( $ ) {
|
||||
|
||||
$( this ).hide();
|
||||
} );
|
||||
|
||||
/**
|
||||
* Hides the Connect with Jetpack form | Shows the Activate Akismet Account form
|
||||
*/
|
||||
$( 'a.toggle-ak-connect' ).on( 'click', function ( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
$( '.akismet-ak-connect' ).slideToggle('slow');
|
||||
$( 'a.toggle-ak-connect' ).hide();
|
||||
$( '.akismet-jp-connect' ).hide();
|
||||
$( 'a.toggle-jp-connect' ).show();
|
||||
} );
|
||||
|
||||
/**
|
||||
* Shows the Connect with Jetpack form | Hides the Activate Akismet Account form
|
||||
*/
|
||||
$( 'a.toggle-jp-connect' ).on( 'click', function ( e ) {
|
||||
e.preventDefault();
|
||||
|
||||
$( '.akismet-jp-connect' ).slideToggle('slow');
|
||||
$( 'a.toggle-jp-connect' ).hide();
|
||||
$( '.akismet-ak-connect' ).hide();
|
||||
$( 'a.toggle-ak-connect' ).show();
|
||||
} );
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* This file was automatically generated on Jun 19 2025 22:31:12 */
|
||||
/* This file was automatically generated on Oct 23 2025 00:26:05 */
|
||||
|
||||
body {
|
||||
--akismet-color-charcoal: #272635;
|
||||
@@ -7,7 +7,9 @@ body {
|
||||
--akismet-color-dark-grey: #646970;
|
||||
--akismet-color-grey-80: #2c3338;
|
||||
--akismet-color-grey-100: #101517;
|
||||
--akismet-color-grey-border: #dcdcde;
|
||||
--akismet-color-white: #fff;
|
||||
--akismet-color-dark-green: #2d6a40;
|
||||
--akismet-color-mid-green: #357b49;
|
||||
--akismet-color-light-green: #4eb26a;
|
||||
--akismet-color-mid-red: #e82c3f;
|
||||
@@ -33,6 +35,7 @@ body {
|
||||
#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;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
#akismet-plugin-container a {
|
||||
@@ -71,10 +74,26 @@ body {
|
||||
padding-right: 0.2em;
|
||||
}
|
||||
|
||||
.akismet-button, .akismet-button:hover {
|
||||
background-color: var(--akismet-color-mid-green);
|
||||
.akismet-button,
|
||||
.akismet-button:hover {
|
||||
border: 0;
|
||||
color: #fff;
|
||||
color: var(--akismet-color-white);
|
||||
}
|
||||
|
||||
.akismet-button {
|
||||
background-color: var(--akismet-color-mid-green);
|
||||
}
|
||||
|
||||
.akismet-button:hover {
|
||||
background-color: var(--akismet-color-dark-green);
|
||||
}
|
||||
|
||||
.akismet-external-link::after {
|
||||
content: "↗";
|
||||
display: inline-block;
|
||||
padding-right: 2px;
|
||||
text-decoration: none;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
/* Need this specificity to override the existing header rule */
|
||||
@@ -86,9 +105,13 @@ body {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.akismet-new-snapshot .akismet-new-snapshot__number {
|
||||
.akismet-new-snapshot__number {
|
||||
color: var(--akismet-color-charcoal);
|
||||
display: block;
|
||||
font-size: 32px;
|
||||
font-weight: 400;
|
||||
letter-spacing: -1px;
|
||||
line-height: 1.5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -154,6 +177,10 @@ body {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.akismet-box:not(:first-child) {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.akismet-box,
|
||||
.akismet-card {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 0 2px rgba(0, 0, 0, 0.16);
|
||||
@@ -342,6 +369,133 @@ body {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
/* Setup */
|
||||
.akismet-setup-instructions__heading {
|
||||
font-size: 1.375rem;
|
||||
font-weight: 700;
|
||||
padding-block-end: 0;
|
||||
}
|
||||
|
||||
h3.akismet-setup-instructions__subheading {
|
||||
color: var(--akismet-color-dark-grey);
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 1.25rem;
|
||||
padding-block-start: 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__feature-list {
|
||||
list-style: none;
|
||||
margin: 1rem 0.5rem 1.5rem;
|
||||
max-width: 640px;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__feature {
|
||||
align-items: start;
|
||||
display: flex;
|
||||
margin-block-end: 1rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__icon {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__body {
|
||||
flex: 1;
|
||||
padding-inline-start: 0.5rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__title {
|
||||
color: #1d2327;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
p.akismet-setup-instructions__text {
|
||||
color: var(--akismet-color-grey-80);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5;
|
||||
margin: 0.25rem 0 0;
|
||||
padding: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions__button,
|
||||
.akismet-setup-instructions__button:hover,
|
||||
.akismet-setup-instructions__button:visited {
|
||||
font-size: 1rem;
|
||||
margin-inline-start: 1.5rem;
|
||||
}
|
||||
|
||||
.akismet-setup__connection {
|
||||
background: var(--akismet-color-light-grey);
|
||||
border: 1px solid var(--akismet-color-grey-border);
|
||||
border-radius: 8px;
|
||||
margin: 1rem 1rem 2rem 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-action:not(:last-child) {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-user {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-avatar {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-avatar-image {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-account-name {
|
||||
color: var(--akismet-color-charcoal);
|
||||
font-size: 0.9rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-account-email {
|
||||
margin-top: 0.1rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-action {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.akismet-setup__connection-button {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
p.akismet-setup__connection-action-intro,
|
||||
p.akismet-setup__connection-action-description {
|
||||
color: var(--akismet-color-dark-grey);
|
||||
font-size: 0.875rem;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p.akismet-setup__connection-action-intro {
|
||||
margin: 0 0 1rem 0;
|
||||
}
|
||||
|
||||
p.akismet-setup__connection-action-description {
|
||||
margin: 1rem 0 0;
|
||||
}
|
||||
|
||||
/* Setup - API key input */
|
||||
.akismet-enter-api-key-box {
|
||||
margin: 1.5rem 0;
|
||||
@@ -469,22 +623,6 @@ h3.akismet-enter-api-key-box__header {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.akismet-settings__external-link::after {
|
||||
content: "↗";
|
||||
display: inline-block;
|
||||
padding-right: 2px;
|
||||
text-decoration: none;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.akismet-compatible-plugins__external-link::after {
|
||||
content: "↗";
|
||||
display: inline-block;
|
||||
padding-right: 2px;
|
||||
text-decoration: none;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.akismet-compatible-plugins__show-more {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* This file was automatically generated on Jun 19 2025 22:00:12 */
|
||||
/* This file was automatically generated on Oct 30 2025 21:26:42 */
|
||||
|
||||
.wp-admin.jetpack_page_akismet-key-config, .wp-admin.settings_page_akismet-key-config {
|
||||
background-color:#f3f6f8;
|
||||
@@ -93,13 +93,6 @@ table.comments td.comment p a:after {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.akismet-alert-text {
|
||||
color: #dd3d36;
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
margin-top: .5rem;
|
||||
}
|
||||
|
||||
.akismet-new-snapshot {
|
||||
margin-top: 1em;
|
||||
text-align: center;
|
||||
@@ -120,12 +113,6 @@ table.comments td.comment p a:after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.akismet-new-snapshot__number {
|
||||
display: block;
|
||||
font-size: 32px;
|
||||
font-weight: lighter;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.akismet-settings th:first-child {
|
||||
vertical-align: top;
|
||||
@@ -297,18 +284,6 @@ table.comments td.comment p a:after {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.akismet-jetpack-email {
|
||||
font-style: oblique;
|
||||
}
|
||||
|
||||
.akismet-jetpack-gravatar {
|
||||
padding: 0 1.5rem 0 0;
|
||||
float: right;
|
||||
margin-left: 1rem;
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
}
|
||||
|
||||
.akismet-box p:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
@@ -335,31 +310,10 @@ table.comments td.comment p a:after {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.akismet-box-header {
|
||||
max-width: 700px;
|
||||
margin: 0 auto 40px auto;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.akismet-box-header h2 {
|
||||
margin: 1.5rem 10% 0;
|
||||
font-size: 1.375rem;
|
||||
font-weight: 700;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.akismet-box .centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.akismet-box .akismet-toggles {
|
||||
margin: 3rem 0;
|
||||
}
|
||||
|
||||
.akismet-box .akismet-ak-connect, .akismet-box .toggle-jp-connect {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.akismet-button, .akismet-button:hover, .akismet-button:visited {
|
||||
background: white;
|
||||
border-color: #c8d7e1;
|
||||
@@ -434,14 +388,15 @@ table.comments td.comment p a:after {
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions form {
|
||||
padding-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.akismet-setup-instructions > a.akismet-button {
|
||||
display: inline-block;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
div.error.akismet-usage-limit-alert {
|
||||
padding: 25px 15px 25px 45px;
|
||||
display: flex;
|
||||
@@ -479,6 +434,7 @@ div.error.akismet-usage-limit-alert {
|
||||
}
|
||||
|
||||
.akismet-usage-limit-alert h3 {
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
Plugin Name: Akismet Anti-spam: Spam Protection
|
||||
Plugin URI: https://akismet.com/
|
||||
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
|
||||
Version: 5.5
|
||||
Version: 5.6
|
||||
Requires at least: 5.8
|
||||
Requires PHP: 7.2
|
||||
Author: Automattic - Anti-spam Team
|
||||
@@ -39,7 +39,7 @@ if ( ! function_exists( 'add_action' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define( 'AKISMET_VERSION', '5.5' );
|
||||
define( 'AKISMET_VERSION', '5.6' );
|
||||
define( 'AKISMET__MINIMUM_WP_VERSION', '5.8' );
|
||||
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
define( 'AKISMET_DELETE_LIMIT', 10000 );
|
||||
|
||||
@@ -52,12 +52,6 @@ class Akismet_Compatible_Plugins {
|
||||
*/
|
||||
protected const CACHE_KEY = 'akismet_compatible_plugin_list';
|
||||
|
||||
/**
|
||||
* The cache group for things cached in this class.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected const CACHE_GROUP = 'akismet_compatible_plugins';
|
||||
|
||||
/**
|
||||
* How many plugins should be visible by default?
|
||||
@@ -69,6 +63,7 @@ class Akismet_Compatible_Plugins {
|
||||
/**
|
||||
* Get the list of active, installed compatible plugins.
|
||||
*
|
||||
* @param bool $bypass_cache Whether to bypass the cache and fetch fresh data.
|
||||
* @return WP_Error|array {
|
||||
* Array of active, installed compatible plugins with their metadata.
|
||||
* @type string $name The display name of the plugin
|
||||
@@ -76,9 +71,9 @@ class Akismet_Compatible_Plugins {
|
||||
* @type string $logo URL or path to the plugin's logo
|
||||
* }
|
||||
*/
|
||||
public static function get_installed_compatible_plugins() {
|
||||
public static function get_installed_compatible_plugins( bool $bypass_cache = false ) {
|
||||
// Retrieve and validate the full compatible plugins list.
|
||||
$compatible_plugins = static::get_compatible_plugins();
|
||||
$compatible_plugins = static::get_compatible_plugins( $bypass_cache );
|
||||
|
||||
if ( empty( $compatible_plugins ) ) {
|
||||
return new WP_Error(
|
||||
@@ -149,13 +144,14 @@ class Akismet_Compatible_Plugins {
|
||||
/**
|
||||
* Gets plugins that are compatible with Akismet from the Akismet API.
|
||||
*
|
||||
* @param bool $bypass_cache Whether to bypass the cache and fetch fresh data.
|
||||
* @return array
|
||||
*/
|
||||
private static function get_compatible_plugins(): array {
|
||||
private static function get_compatible_plugins( bool $bypass_cache = false ): array {
|
||||
// Return cached result if present (false => cache miss; empty array is valid).
|
||||
$cached_plugins = static::get_cached_plugins();
|
||||
|
||||
if ( $cached_plugins ) {
|
||||
if ( false !== $cached_plugins && ! $bypass_cache ) {
|
||||
return $cached_plugins;
|
||||
}
|
||||
|
||||
@@ -278,10 +274,9 @@ class Akismet_Compatible_Plugins {
|
||||
private static function set_cached_plugins( array $plugins ): bool {
|
||||
$_blog_id = (int) get_current_blog_id();
|
||||
|
||||
return wp_cache_set(
|
||||
return set_transient(
|
||||
static::CACHE_KEY . "_$_blog_id",
|
||||
$plugins,
|
||||
static::CACHE_GROUP . "_$_blog_id",
|
||||
DAY_IN_SECONDS
|
||||
);
|
||||
}
|
||||
@@ -294,9 +289,8 @@ class Akismet_Compatible_Plugins {
|
||||
private static function get_cached_plugins() {
|
||||
$_blog_id = (int) get_current_blog_id();
|
||||
|
||||
return wp_cache_get(
|
||||
static::CACHE_KEY . "_$_blog_id",
|
||||
static::CACHE_GROUP . "_$_blog_id"
|
||||
return get_transient(
|
||||
static::CACHE_KEY . "_$_blog_id"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -308,9 +302,8 @@ class Akismet_Compatible_Plugins {
|
||||
private static function purge_cache(): bool {
|
||||
$_blog_id = (int) get_current_blog_id();
|
||||
|
||||
return wp_cache_delete(
|
||||
static::CACHE_KEY . "_$_blog_id",
|
||||
static::CACHE_GROUP . "_$_blog_id"
|
||||
return delete_transient(
|
||||
static::CACHE_KEY . "_$_blog_id"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,13 +111,22 @@ class Akismet_Admin {
|
||||
}
|
||||
|
||||
public static function admin_menu() {
|
||||
if ( class_exists( 'Jetpack' ) ) {
|
||||
if ( self::is_jetpack_active() ) {
|
||||
add_action( 'jetpack_admin_menu', array( 'Akismet_Admin', 'load_menu' ) );
|
||||
} else {
|
||||
self::load_menu();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Jetpack is active.
|
||||
*
|
||||
* @return bool True if Jetpack class exists, false otherwise.
|
||||
*/
|
||||
public static function is_jetpack_active(): bool {
|
||||
return class_exists( 'Jetpack' );
|
||||
}
|
||||
|
||||
public static function admin_head() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
@@ -131,7 +140,7 @@ class Akismet_Admin {
|
||||
}
|
||||
|
||||
public static function load_menu() {
|
||||
if ( class_exists( 'Jetpack' ) ) {
|
||||
if ( self::is_jetpack_active() ) {
|
||||
$hook = add_submenu_page( 'jetpack', __( 'Akismet Anti-spam', 'akismet' ), __( 'Akismet Anti-spam', 'akismet' ), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
|
||||
} else {
|
||||
$hook = add_options_page( __( 'Akismet Anti-spam', 'akismet' ), __( 'Akismet Anti-spam', 'akismet' ), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
|
||||
@@ -234,7 +243,7 @@ class Akismet_Admin {
|
||||
'<p><strong>' . esc_html__( 'Akismet Setup', 'akismet' ) . '</strong></p>' .
|
||||
'<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.', 'akismet' ) . '</p>' .
|
||||
/* translators: %s: a link to the signup page with the text 'Akismet.com'. */
|
||||
'<p>' . sprintf( __( 'Sign up for an account on %s to get an API Key.', 'akismet' ), '<a href="https://akismet.com/plugin-signup/" target="_blank">Akismet.com</a>' ) . '</p>',
|
||||
'<p>' . sprintf( __( 'Sign up for an account on %s to get an API Key.', 'akismet' ), '<a href="https://akismet.com/pricing/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=help_signup" target="_blank">Akismet.com</a>' ) . '</p>',
|
||||
)
|
||||
);
|
||||
|
||||
@@ -306,8 +315,9 @@ class Akismet_Admin {
|
||||
// Help Sidebar
|
||||
$current_screen->set_help_sidebar(
|
||||
'<p><strong>' . esc_html__( 'For more information:', 'akismet' ) . '</strong></p>' .
|
||||
'<p><a href="https://akismet.com/faq/" target="_blank">' . esc_html__( 'Akismet FAQ', 'akismet' ) . '</a></p>' .
|
||||
'<p><a href="https://akismet.com/support/" target="_blank">' . esc_html__( 'Akismet Support', 'akismet' ) . '</a></p>'
|
||||
|
||||
'<p><a href="https://akismet.com/resources/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=help_faq" target="_blank">' . esc_html__( 'Akismet FAQ', 'akismet' ) . '</a></p>' .
|
||||
'<p><a href="https://akismet.com/support/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=help_support" target="_blank">' . esc_html__( 'Akismet Support', 'akismet' ) . '</a></p>'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -356,14 +366,14 @@ class Akismet_Admin {
|
||||
$akismet_user = self::get_akismet_user( $api_key );
|
||||
|
||||
if ( $akismet_user ) {
|
||||
if ( in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ) ) {
|
||||
if ( in_array( $akismet_user->status, array( Akismet::USER_STATUS_ACTIVE, 'active-dunning' ) ) ) {
|
||||
update_option( 'wordpress_api_key', $api_key );
|
||||
}
|
||||
|
||||
if ( $akismet_user->status == 'active' ) {
|
||||
if ( $akismet_user->status == Akismet::USER_STATUS_ACTIVE ) {
|
||||
self::$notices['status'] = 'new-key-valid';
|
||||
} elseif ( $akismet_user->status == 'notice' ) {
|
||||
self::$notices['status'] = $akismet_user;
|
||||
} elseif ( $akismet_user->status == Akismet::USER_STATUS_NO_SUB ) {
|
||||
self::$notices['status'] = 'no-sub';
|
||||
} else {
|
||||
self::$notices['status'] = $akismet_user->status;
|
||||
}
|
||||
@@ -371,7 +381,15 @@ class Akismet_Admin {
|
||||
self::$notices['status'] = 'new-key-invalid';
|
||||
}
|
||||
} elseif ( in_array( $key_status, array( 'invalid', 'failed' ) ) ) {
|
||||
self::$notices['status'] = 'new-key-' . $key_status;
|
||||
// When verify-key returns 'invalid', it could be truly invalid OR suspended.
|
||||
// Check get-subscription to distinguish between these cases.
|
||||
$akismet_user = self::get_akismet_user( $api_key );
|
||||
|
||||
if ( $akismet_user && isset( $akismet_user->status ) && $akismet_user->status === Akismet::USER_STATUS_SUSPENDED ) {
|
||||
self::$notices['status'] = Akismet::USER_STATUS_SUSPENDED;
|
||||
} else {
|
||||
self::$notices['status'] = 'new-key-' . $key_status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +414,7 @@ class Akismet_Admin {
|
||||
$count,
|
||||
'akismet'
|
||||
),
|
||||
'https://akismet.com/wordpress/',
|
||||
'https://akismet.com/wordpress/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=dashboard_stats',
|
||||
esc_url( add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( isset( $submenu['edit-comments.php'] ) ? 'edit-comments.php' : 'edit.php' ) ) ),
|
||||
number_format_i18n( $count )
|
||||
) . '</p>';
|
||||
@@ -413,12 +431,12 @@ class Akismet_Admin {
|
||||
$count,
|
||||
'akismet'
|
||||
),
|
||||
'https://akismet.com/wordpress/',
|
||||
'https://akismet.com/wordpress/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=dashboard_stats',
|
||||
number_format_i18n( $count )
|
||||
);
|
||||
} else {
|
||||
/* translators: %s: Akismet website URL. */
|
||||
$intro = sprintf( __( '<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet' ), 'https://akismet.com/wordpress/' );
|
||||
$intro = sprintf( __( '<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet' ), 'https://akismet.com/wordpress/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=dashboard_stats' );
|
||||
}
|
||||
|
||||
$link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );
|
||||
@@ -508,7 +526,7 @@ class Akismet_Admin {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) {
|
||||
if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) {
|
||||
wp_send_json(
|
||||
array(
|
||||
'error' => __( 'You don’t have permission to do that.', 'akismet' ),
|
||||
@@ -959,9 +977,21 @@ class Akismet_Admin {
|
||||
return add_query_arg( $args, menu_page_url( 'akismet-key-config', false ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Akismet user subscription information.
|
||||
*
|
||||
* @param string $api_key The Akismet API key.
|
||||
* @return object|false Object with subscription info, or false if key is invalid or has no subscription.
|
||||
*
|
||||
* The returned object contains these properties:
|
||||
* - account_id (int|false): WordPress.com user ID, or false if unavailable.
|
||||
* - status (string): Account status - 'active', 'active-dunning', 'no-sub', 'cancelled', 'suspended', 'missing', or 'notice'.
|
||||
* - account_name (string): Subscription plan display name.
|
||||
* - account_type (string): Account type slug.
|
||||
* - next_billing_date (int|false): Unix timestamp of next billing date, or false if none.
|
||||
* - limit_reached (bool): Whether the usage limit has been reached.
|
||||
*/
|
||||
public static function get_akismet_user( $api_key ) {
|
||||
$akismet_user = false;
|
||||
|
||||
$request_args = array(
|
||||
'key' => $api_key,
|
||||
'blog' => get_option( 'home' ),
|
||||
@@ -971,9 +1001,14 @@ class Akismet_Admin {
|
||||
|
||||
$subscription_verification = Akismet::http_post( Akismet::build_query( $request_args ), 'get-subscription' );
|
||||
|
||||
$akismet_user = false;
|
||||
|
||||
if ( ! empty( $subscription_verification[1] ) ) {
|
||||
if ( 'invalid' !== $subscription_verification[1] ) {
|
||||
$akismet_user = json_decode( $subscription_verification[1] );
|
||||
$decoded = json_decode( $subscription_verification[1] );
|
||||
if ( is_object( $decoded ) ) {
|
||||
$akismet_user = $decoded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1040,7 +1075,7 @@ class Akismet_Admin {
|
||||
|
||||
if ( is_object( $akismet_user ) ) {
|
||||
self::save_key( $akismet_user->api_key );
|
||||
return in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) );
|
||||
return in_array( $akismet_user->status, array( Akismet::USER_STATUS_ACTIVE, 'active-dunning', Akismet::USER_STATUS_NO_SUB ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1061,15 +1096,16 @@ class Akismet_Admin {
|
||||
|
||||
public static function get_usage_limit_alert_data() {
|
||||
return array(
|
||||
'type' => 'usage-limit',
|
||||
'code' => (int) get_option( 'akismet_alert_code' ),
|
||||
'msg' => get_option( 'akismet_alert_msg' ),
|
||||
'api_calls' => get_option( 'akismet_alert_api_calls' ),
|
||||
'usage_limit' => get_option( 'akismet_alert_usage_limit' ),
|
||||
'upgrade_plan' => get_option( 'akismet_alert_upgrade_plan' ),
|
||||
'upgrade_url' => get_option( 'akismet_alert_upgrade_url' ),
|
||||
'upgrade_type' => get_option( 'akismet_alert_upgrade_type' ),
|
||||
'upgrade_via_support' => get_option( 'akismet_alert_upgrade_via_support' ) === 'true',
|
||||
'type' => 'usage-limit',
|
||||
'code' => (int) get_option( 'akismet_alert_code' ),
|
||||
'msg' => get_option( 'akismet_alert_msg' ),
|
||||
'api_calls' => get_option( 'akismet_alert_api_calls' ),
|
||||
'usage_limit' => get_option( 'akismet_alert_usage_limit' ),
|
||||
'upgrade_plan' => get_option( 'akismet_alert_upgrade_plan' ),
|
||||
'upgrade_url' => get_option( 'akismet_alert_upgrade_url' ),
|
||||
'upgrade_type' => get_option( 'akismet_alert_upgrade_type' ),
|
||||
'upgrade_via_support' => get_option( 'akismet_alert_upgrade_via_support' ) === 'true',
|
||||
'recommended_plan_name' => get_option( 'akismet_alert_recommended_plan_name' ),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1165,11 +1201,11 @@ class Akismet_Admin {
|
||||
|
||||
/*
|
||||
// To see all variants when testing.
|
||||
$akismet_user->status = 'no-sub';
|
||||
$akismet_user->status = Akismet::USER_STATUS_NO_SUB;
|
||||
Akismet::view( 'start', compact( 'akismet_user' ) );
|
||||
$akismet_user->status = 'cancelled';
|
||||
$akismet_user->status = Akismet::USER_STATUS_CANCELLED;
|
||||
Akismet::view( 'start', compact( 'akismet_user' ) );
|
||||
$akismet_user->status = 'suspended';
|
||||
$akismet_user->status = Akismet::USER_STATUS_SUSPENDED;
|
||||
Akismet::view( 'start', compact( 'akismet_user' ) );
|
||||
$akismet_user->status = 'other';
|
||||
Akismet::view( 'start', compact( 'akismet_user' ) );
|
||||
@@ -1208,7 +1244,7 @@ class Akismet_Admin {
|
||||
$notices = array();
|
||||
|
||||
if ( empty( self::$notices ) ) {
|
||||
if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
|
||||
if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == Akismet::USER_STATUS_ACTIVE && $akismet_user->account_type == 'free-api-key' ) {
|
||||
|
||||
$time_saved = false;
|
||||
|
||||
@@ -1237,7 +1273,7 @@ class Akismet_Admin {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! Akismet::predefined_api_key() && ! isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) {
|
||||
if ( ! Akismet::predefined_api_key() && ! isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_SUSPENDED, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_NO_SUB ) ) ) {
|
||||
$notices[] = array( 'type' => $akismet_user->status );
|
||||
}
|
||||
|
||||
@@ -1264,15 +1300,17 @@ class Akismet_Admin {
|
||||
// $notices[] = array( 'type' => 'missing-functions' );
|
||||
// $notices[] = array( 'type' => 'servers-be-down' );
|
||||
// $notices[] = array( 'type' => 'active-dunning' );
|
||||
// $notices[] = array( 'type' => 'cancelled' );
|
||||
// $notices[] = array( 'type' => 'suspended' );
|
||||
// $notices[] = array( 'type' => 'missing' );
|
||||
// $notices[] = array( 'type' => 'no-sub' );
|
||||
// $notices[] = array( 'type' => Akismet::USER_STATUS_CANCELLED );
|
||||
// $notices[] = array( 'type' => Akismet::USER_STATUS_SUSPENDED );
|
||||
// $notices[] = array( 'type' => Akismet::USER_STATUS_MISSING );
|
||||
// $notices[] = array( 'type' => Akismet::USER_STATUS_NO_SUB );
|
||||
// $notices[] = array( 'type' => 'new-key-valid' );
|
||||
// $notices[] = array( 'type' => 'new-key-invalid' );
|
||||
// $notices[] = array( 'type' => 'existing-key-invalid' );
|
||||
// $notices[] = array( 'type' => 'new-key-failed' );
|
||||
// $notices[] = array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_plan' => 'Enterprise', 'upgrade_url' => 'https://akismet.com/account/', 'code' => 10502 );
|
||||
// $notices[] = array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_type' => 'qty', 'upgrade_plan' => 'Business', 'upgrade_url' => 'https://akismet.com/account/', 'code' => 10504, 'recommended_plan_name' => 'Akismet Pro (500)' );
|
||||
// $notices[] = array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_type' => 'qty', 'upgrade_plan' => 'Business', 'upgrade_url' => 'https://akismet.com/pricing/', 'code' => 10508 );
|
||||
// $notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' );
|
||||
// $notices[] = array( 'type' => 'spam-check-cron-disabled' );
|
||||
// $notices[] = array( 'type' => 'alert', 'code' => 123 );
|
||||
@@ -1294,6 +1332,9 @@ class Akismet_Admin {
|
||||
// Akismet::view( 'notice', array( 'type' => 'spam-check-cron-disabled' ) );
|
||||
// Akismet::view( 'notice', array( 'type' => 'spam-check' ) );
|
||||
// Akismet::view( 'notice', array( 'type' => 'alert', 'code' => 123, 'msg' => 'Message' ) );
|
||||
// Akismet::view( 'notice', array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_plan' => 'Enterprise', 'upgrade_url' => 'https://akismet.com/account/', 'code' => 10502 ) );
|
||||
// Akismet::view( 'notice', array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_type' => 'qty', 'upgrade_plan' => 'Business', 'upgrade_url' => 'https://akismet.com/account/', 'code' => 10504, 'recommended_plan_name' => 'Akismet Pro (500)' ) );
|
||||
// Akismet::view( 'notice', array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_type' => 'qty', 'upgrade_plan' => 'Business', 'upgrade_url' => 'https://akismet.com/pricing/', 'code' => 10508 ) );
|
||||
|
||||
if ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
|
||||
Akismet::verify_key( Akismet::get_api_key() ); // verify that the key is still in alert state
|
||||
@@ -1383,7 +1424,7 @@ class Akismet_Admin {
|
||||
* @return array|false
|
||||
*/
|
||||
private static function get_jetpack_user() {
|
||||
if ( ! class_exists( 'Jetpack' ) ) {
|
||||
if ( ! self::is_jetpack_active() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class Akismet_REST_API {
|
||||
'required' => true,
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/account', 'akismet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -119,7 +119,7 @@ class Akismet_REST_API {
|
||||
'required' => false,
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/account', 'akismet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -132,7 +132,7 @@ class Akismet_REST_API {
|
||||
'required' => false,
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/account', 'akismet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -145,7 +145,7 @@ class Akismet_REST_API {
|
||||
'required' => false,
|
||||
'type' => 'string',
|
||||
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
|
||||
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/account', 'akismet' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -388,7 +388,7 @@ class Akismet_REST_API {
|
||||
public static function remote_call_permission_callback( $request ) {
|
||||
$local_key = Akismet::get_api_key();
|
||||
|
||||
return $local_key && ( strtolower( $request->get_param( 'key' ) ) === strtolower( $local_key ) );
|
||||
return $local_key && ( strtolower( $request->get_param( 'key' ) ?? '' ) === strtolower( $local_key ) );
|
||||
}
|
||||
|
||||
public static function sanitize_interval( $interval, $request, $param ) {
|
||||
|
||||
@@ -137,7 +137,7 @@ class Akismet_Widget extends WP_Widget {
|
||||
</style>
|
||||
|
||||
<div class="a-stats">
|
||||
<a href="https://akismet.com" class="a-stats__link" target="_blank" rel="noopener" style="background-color: var(--akismet-color-mid-green); color: var(--akismet-color-white);">
|
||||
<a href="https://akismet.com?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=widget_stats" class="a-stats__link" target="_blank" rel="noopener" style="background-color: var(--akismet-color-mid-green); color: var(--akismet-color-white);">
|
||||
<?php
|
||||
|
||||
echo wp_kses(
|
||||
|
||||
@@ -12,6 +12,13 @@ class Akismet {
|
||||
const MAX_DELAY_BEFORE_MODERATION_EMAIL = 86400; // One day in seconds
|
||||
const ALERT_CODE_COMMERCIAL = 30001;
|
||||
|
||||
// User account status constants
|
||||
const USER_STATUS_ACTIVE = 'active';
|
||||
const USER_STATUS_NO_SUB = 'no-sub';
|
||||
const USER_STATUS_MISSING = 'missing';
|
||||
const USER_STATUS_CANCELLED = 'cancelled';
|
||||
const USER_STATUS_SUSPENDED = 'suspended';
|
||||
|
||||
public static $limit_notices = array(
|
||||
10501 => 'FIRST_MONTH_OVER_LIMIT',
|
||||
10502 => 'SECOND_MONTH_OVER_LIMIT',
|
||||
@@ -864,7 +871,7 @@ class Akismet {
|
||||
|
||||
/**
|
||||
* Get the full comment history for a given comment, as an array in reverse chronological order.
|
||||
* Each entry will have an 'event', a 'time', and possible a 'message' member (if the entry is old enough).
|
||||
* Each entry will have an 'event', a 'time', and possibly a 'message' member (if the entry is old enough).
|
||||
* Some entries will also have a 'user' or 'meta' member.
|
||||
*
|
||||
* @param int $comment_id The relevant comment ID.
|
||||
@@ -915,7 +922,17 @@ class Akismet {
|
||||
$history[] = array( 'time' => 445856427, 'event' => 'webhook-ham-noaction' );
|
||||
*/
|
||||
|
||||
usort( $history, array( 'Akismet', '_cmp_time' ) );
|
||||
// Validate history entries to guard against malformed data.
|
||||
// In one case, serialized data was returned in $entry instead of an array.
|
||||
$history = array_filter(
|
||||
$history,
|
||||
function ( $entry ) {
|
||||
return is_array( $entry ) && isset( $entry['time'] ) && is_numeric( $entry['time'] );
|
||||
}
|
||||
);
|
||||
|
||||
usort( $history, 'Akismet::_cmp_time' );
|
||||
|
||||
return $history;
|
||||
}
|
||||
|
||||
@@ -1712,6 +1729,7 @@ class Akismet {
|
||||
'upgrade-url',
|
||||
'upgrade-type',
|
||||
'upgrade-via-support',
|
||||
'recommended-plan-name',
|
||||
);
|
||||
|
||||
foreach ( $alert_header_names as $alert_header_name ) {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs, procifer, stephdau, kbrownkd, bluefuton, derekspringer, lschuyler, andyperdomo, akismetantispam
|
||||
Tags: comments, spam, antispam, anti-spam, contact form
|
||||
Requires at least: 5.8
|
||||
Tested up to: 6.8.1
|
||||
Stable tag: 5.5
|
||||
Tested up to: 6.9
|
||||
Stable tag: 5.6
|
||||
License: GPLv2 or later
|
||||
|
||||
The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress and WooCommerce.
|
||||
@@ -32,6 +32,15 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 5.6 =
|
||||
*Release Date - 12 November 2025*
|
||||
|
||||
* Improve caching of compatible plugins.
|
||||
* Explain the key features of Akismet more clearly on the setup page.
|
||||
* Improve the configuration process to better explain errors when they occur.
|
||||
* UI cleanup and refresh
|
||||
* Improve messaging related to usage limits.
|
||||
|
||||
= 5.5 =
|
||||
*Release Date - 15 July 2025*
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'title' ); ?>
|
||||
<?php Akismet::view( 'setup' ); ?>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'enter' ); ?>
|
||||
</div>
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
/** @var array|WP_Error $compatible_plugins */
|
||||
$compatible_plugins = Akismet_Compatible_Plugins::get_installed_compatible_plugins();
|
||||
$bypass_cache = ! empty( $_GET['akismet_refresh_compatible_plugins'] );
|
||||
$compatible_plugins = Akismet_Compatible_Plugins::get_installed_compatible_plugins( $bypass_cache );
|
||||
if ( is_array( $compatible_plugins ) ) :
|
||||
|
||||
$compatible_plugin_count = count( $compatible_plugins );
|
||||
@@ -24,14 +25,14 @@ if ( is_array( $compatible_plugins ) ) :
|
||||
echo '<p>';
|
||||
|
||||
if ( 0 === $compatible_plugin_count ) {
|
||||
echo '<a class="akismet-settings__external-link" href="https://akismet.com/developers/plugins-and-libraries/">';
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/developers/plugins-and-libraries/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=compatible_plugins">';
|
||||
echo esc_html( __( 'See supported integrations', 'akismet' ) );
|
||||
echo '</a>';
|
||||
} else {
|
||||
echo esc_html(
|
||||
_n(
|
||||
"The plugin you've installed is compatible. Follow the documentation link to get started.",
|
||||
"The plugins you've installed are compatible. Follow the documentation links to get started.",
|
||||
"This plugin you've installed is compatible. Follow the documentation link to get started.",
|
||||
"These plugins you've installed are compatible. Follow the documentation links to get started.",
|
||||
$compatible_plugin_count,
|
||||
'akismet'
|
||||
)
|
||||
@@ -75,7 +76,7 @@ if ( is_array( $compatible_plugins ) ) :
|
||||
<h3 class="akismet-compatible-plugins__card-title"><?php echo esc_html( $compatible_plugin['name'] ); ?></h3>
|
||||
<div class="akismet-compatible-plugins__docs">
|
||||
<a
|
||||
class="akismet-settings__external-link"
|
||||
class="akismet-external-link"
|
||||
href="<?php echo esc_url( $compatible_plugin['help_url'] ); ?>"
|
||||
aria-label="
|
||||
<?php
|
||||
|
||||
@@ -168,7 +168,7 @@ $kses_allow_link_href = array(
|
||||
</div>
|
||||
<div>
|
||||
<label class="akismet-settings__row-input-label" for="akismet_strictness_0">
|
||||
<input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
|
||||
<input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( true, get_option( 'akismet_strictness' ) !== '1' ); ?> />
|
||||
<span class="akismet-settings__row-label-text">
|
||||
<?php esc_html_e( 'Always put spam in the Spam folder for review.', 'akismet' ); ?>
|
||||
</span>
|
||||
@@ -274,13 +274,13 @@ $kses_allow_link_href = array(
|
||||
<th scope="row"><?php esc_html_e( 'Status', 'akismet' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
if ( 'cancelled' === $akismet_user->status ) :
|
||||
if ( Akismet::USER_STATUS_CANCELLED === $akismet_user->status ) :
|
||||
esc_html_e( 'Cancelled', 'akismet' );
|
||||
elseif ( 'suspended' === $akismet_user->status ) :
|
||||
elseif ( Akismet::USER_STATUS_SUSPENDED === $akismet_user->status ) :
|
||||
esc_html_e( 'Suspended', 'akismet' );
|
||||
elseif ( 'missing' === $akismet_user->status ) :
|
||||
elseif ( Akismet::USER_STATUS_MISSING === $akismet_user->status ) :
|
||||
esc_html_e( 'Missing', 'akismet' );
|
||||
elseif ( 'no-sub' === $akismet_user->status ) :
|
||||
elseif ( Akismet::USER_STATUS_NO_SUB === $akismet_user->status ) :
|
||||
esc_html_e( 'No subscription found', 'akismet' );
|
||||
else :
|
||||
esc_html_e( 'Active', 'akismet' );
|
||||
@@ -299,9 +299,9 @@ $kses_allow_link_href = array(
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="akismet-card-actions">
|
||||
<?php if ( $akismet_user->status === 'active' ) : ?>
|
||||
<?php if ( $akismet_user->status === Akismet::USER_STATUS_ACTIVE ) : ?>
|
||||
<div class="akismet-card-actions__secondary-action">
|
||||
<a href="https://akismet.com/account" class="akismet-settings__external-link" aria-label="Account overview on akismet.com"><?php esc_html_e( 'Account overview', 'akismet' ); ?></a>
|
||||
<a href="https://akismet.com/account?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=account_overview" class="akismet-external-link" aria-label="Account overview on akismet.com"><?php esc_html_e( 'Account overview', 'akismet' ); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div id="publishing-action">
|
||||
@@ -309,8 +309,9 @@ $kses_allow_link_href = array(
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === 'active' ? __( 'Upgrade', 'akismet' ) : __( 'Change', 'akismet' ) ),
|
||||
'redirect' => 'upgrade',
|
||||
'text' => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === Akismet::USER_STATUS_ACTIVE ? __( 'Upgrade', 'akismet' ) : __( 'Change', 'akismet' ) ),
|
||||
'redirect' => 'upgrade',
|
||||
'utm_content' => ( $akismet_user->account_type === 'free-api-key' && $akismet_user->status === Akismet::USER_STATUS_ACTIVE ? 'config_upgrade' : 'config_change' ),
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -1,98 +1,14 @@
|
||||
<?php
|
||||
declare( strict_types = 1 );
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
?>
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'title' ); ?>
|
||||
<div class="akismet-jp-connect">
|
||||
<h3><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></h3>
|
||||
<?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
|
||||
<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>
|
||||
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
|
||||
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
|
||||
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
|
||||
<input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
|
||||
<input type="hidden" name="redirect" value="plugin-signup"/>
|
||||
<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack', 'akismet' ); ?>"/>
|
||||
</form>
|
||||
<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
/* translators: %s is the WordPress.com username */
|
||||
printf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' );
|
||||
|
||||
?>
|
||||
<br />
|
||||
<span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span>
|
||||
</p>
|
||||
<?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
|
||||
<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>
|
||||
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
|
||||
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
|
||||
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
|
||||
<input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
|
||||
<input type="hidden" name="redirect" value="upgrade"/>
|
||||
<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack', 'akismet' ); ?>"/>
|
||||
</form>
|
||||
<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
/* translators: %s is the WordPress.com email address */
|
||||
echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.', 'akismet' ), $akismet_user->user_email ) );
|
||||
|
||||
?>
|
||||
<br />
|
||||
<span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span>
|
||||
</p>
|
||||
<?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
|
||||
<div class="akismet-right">
|
||||
<p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support', 'akismet' ); ?></a></p>
|
||||
</div>
|
||||
<p>
|
||||
<span class="akismet-alert-text">
|
||||
<?php
|
||||
|
||||
/* translators: %s is the WordPress.com email address */
|
||||
echo esc_html( sprintf( __( 'Your subscription for %s is suspended.', 'akismet' ), $akismet_user->user_email ) );
|
||||
|
||||
?>
|
||||
</span>
|
||||
<?php esc_html_e( 'No worries! Get in touch and we’ll sort this out.', 'akismet' ); ?>
|
||||
</p>
|
||||
<?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
|
||||
<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>
|
||||
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
|
||||
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key ); ?>"/>
|
||||
<input type="hidden" name="action" value="enter-key">
|
||||
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
||||
<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack', 'akismet' ); ?>"/>
|
||||
</form>
|
||||
<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
/* translators: %s is the WordPress.com username */
|
||||
printf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' );
|
||||
|
||||
?>
|
||||
<br />
|
||||
<span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span>
|
||||
</p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="akismet-ak-connect">
|
||||
<?php Akismet::view( 'setup' ); ?>
|
||||
</div>
|
||||
<div class="centered akismet-toggles">
|
||||
<a href="#" class="toggle-jp-connect"><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></a>
|
||||
<a href="#" class="toggle-ak-connect"><?php esc_html_e( 'Set up a different account', 'akismet' ); ?></a>
|
||||
</div>
|
||||
<?php Akismet::view( 'setup', array( 'use_jetpack_connection' => true ) ); ?>
|
||||
<?php Akismet::view( 'setup-jetpack', array( 'akismet_user' => $akismet_user ) ); ?>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div class="akismet-box">
|
||||
<?php Akismet::view( 'enter' ); ?>
|
||||
</div>
|
||||
|
||||
@@ -8,11 +8,25 @@ $submit_classes_attr = 'akismet-button';
|
||||
if ( isset( $classes ) && ( is_countable( $classes ) ? count( $classes ) : 0 ) > 0 ) {
|
||||
$submit_classes_attr = implode( ' ', $classes );
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
|
||||
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
|
||||
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
|
||||
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? esc_attr( $redirect ) : 'plugin-signup'; ?>"/>
|
||||
<button type="submit" class="<?php echo esc_attr( $submit_classes_attr ); ?>" value="<?php echo esc_attr( $text ); ?>"><?php echo esc_attr( $text ) . '<span class="screen-reader-text">' . esc_html__( '(opens in a new tab)', 'akismet' ) . '</span>'; ?></button>
|
||||
</form>
|
||||
$query_args = array(
|
||||
'passback_url' => Akismet_Admin::get_page_url(),
|
||||
'redirect' => isset( $redirect ) ? $redirect : 'plugin-signup',
|
||||
);
|
||||
|
||||
// Set default UTM parameters, overriding with any provided values.
|
||||
$utm_args = array(
|
||||
'utm_source' => isset( $utm_source ) ? $utm_source : 'akismet_plugin',
|
||||
'utm_medium' => isset( $utm_medium ) ? $utm_medium : 'in_plugin',
|
||||
'utm_campaign' => isset( $utm_campaign ) ? $utm_campaign : 'plugin_static_link',
|
||||
'utm_content' => isset( $utm_content ) ? $utm_content : 'get_view_link',
|
||||
);
|
||||
|
||||
$query_args = array_merge( $query_args, $utm_args );
|
||||
|
||||
$url = add_query_arg( $query_args, 'https://akismet.com/get/' );
|
||||
?>
|
||||
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $submit_classes_attr ); ?>" target="_blank">
|
||||
<?php echo esc_html( is_string( $text ) ? $text : '' ); ?>
|
||||
<span class="screen-reader-text"><?php esc_html_e( '(opens in a new tab)', 'akismet' ); ?></span>
|
||||
</a>
|
||||
|
||||
@@ -5,6 +5,7 @@ $kses_allow_link = array(
|
||||
'a' => array(
|
||||
'href' => true,
|
||||
'target' => true,
|
||||
'class' => true,
|
||||
),
|
||||
);
|
||||
$kses_allow_strong = array( 'strong' => true );
|
||||
@@ -29,7 +30,6 @@ if ( ! isset( $type ) ) {
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'spam-check' ) : ?>
|
||||
<?php // This notice is only displayed on edit-comments.php. ?>
|
||||
<div class="notice notice-warning">
|
||||
@@ -47,7 +47,7 @@ if ( ! isset( $type ) ) {
|
||||
<p><?php esc_html_e( 'WP-Cron has been disabled using the DISABLE_WP_CRON constant. Comment rechecks may not work properly.', 'akismet' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'alert' && $code === Akismet::ALERT_CODE_COMMERCIAL && $parent_view === 'config' ) : ?>
|
||||
<?php elseif ( $type === 'alert' && $code === Akismet::ALERT_CODE_COMMERCIAL && isset( $parent_view ) && $parent_view === 'config' ) : ?>
|
||||
<?php // Display a different commercial warning alert on the config page ?>
|
||||
<div class="akismet-card akismet-alert is-commercial">
|
||||
<div>
|
||||
@@ -55,20 +55,28 @@ if ( ! isset( $type ) ) {
|
||||
<p class="akismet-alert-info">
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Your current subscription is for <a href="%s">personal, non-commercial use</a>. Please upgrade your plan to continue using Akismet.', 'akismet' ), esc_url( 'https://akismet.com/support/getting-started/free-or-paid/' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'Your current subscription is for <a class="akismet-external-link" href="%s">personal, non-commercial use</a>. Please upgrade your plan to continue using Akismet.', 'akismet' ), esc_url( 'https://akismet.com/support/getting-started/free-or-paid/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=commercial_support' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
<p class="akismet-alert-info">
|
||||
<?php
|
||||
/* translators: The placeholder is a URL to the contact form. */
|
||||
echo wp_kses( sprintf( __( 'If you believe your site should not be classified as commercial, <a href="%s">please get in touch</a>.', 'akismet' ), esc_url( 'https://akismet.com/contact/?purpose=commercial' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'If you believe your site should not be classified as commercial, <a class="akismet-external-link" href="%s">please get in touch</a>', 'akismet' ), esc_url( 'https://akismet.com/contact/?purpose=commercial&utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=commercial_contact' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="akismet-alert-button-wrapper">
|
||||
<a href="https://akismet.com/pricing/?flow=upgrade&utm_source=akismet_plugin&utm_campaign=commercial_notice&utm_medium=banner" class="akismet-alert-button akismet-button">
|
||||
<?php esc_html_e( 'Upgrade plan', 'akismet' ); ?>
|
||||
</a>
|
||||
<?php
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => __( 'Upgrade plan', 'akismet' ),
|
||||
'classes' => array( 'akismet-alert-button', 'akismet-button' ),
|
||||
'redirect' => 'upgrade',
|
||||
'utm_content' => 'commercial_upgrade',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -79,8 +87,14 @@ if ( ! isset( $type ) ) {
|
||||
<p><?php echo isset( $msg ) ? esc_html( $msg ) : ''; ?></p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */
|
||||
printf( esc_html__( 'For more information: %s', 'akismet' ), '<a href="https://akismet.com/errors/' . esc_attr( $code ) . '">https://akismet.com/errors/' . esc_attr( $code ) . '</a>' );
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */
|
||||
__( 'For more information, see the <a class="akismet-external-link" href="%s">error documentation on akismet.com</a>', 'akismet' ),
|
||||
esc_url( 'https://akismet.com/developers/detailed-docs/errors/akismet-error-' . absint( $code ) . '?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=error_info' )
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -96,10 +110,15 @@ if ( ! isset( $type ) ) {
|
||||
<?php elseif ( $type === 'missing-functions' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'Network functions are disabled.', 'akismet' ); ?></h3>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses( __( 'Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> function.', 'akismet' ), array_merge( $kses_allow_link, $kses_allow_strong, array( 'code' => true ) ) );
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet’s system requirements</a>.', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/' ) ), array_merge( $kses_allow_link, $kses_allow_strong, array( 'code' => true ) ) );
|
||||
echo wp_kses( sprintf( __( 'Please contact your web host or firewall administrator and give them <a class="akismet-external-link" href="%s" target="_blank">this information about Akismet’s system requirements</a>', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=hosting_faq_php' ) ), array_merge( $kses_allow_link, $kses_allow_strong, array( 'code' => true ) ) );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -110,7 +129,7 @@ if ( ! isset( $type ) ) {
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Your firewall may be blocking Akismet from connecting to its API. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'Your firewall may be blocking Akismet from connecting to its API. Please contact your host and refer to <a class="akismet-external-link" href="%s" target="_blank">our guide about firewalls</a>', 'akismet' ), esc_url( 'https://akismet.com/akismet-hosting-faq/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=hosting_faq_firewall' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -121,7 +140,7 @@ if ( ! isset( $type ) ) {
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet' ), esc_url( 'https://akismet.com/account/' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'We cannot process your payment. Please <a class="akismet-external-link" href="%s" target="_blank">update your payment details</a>', 'akismet' ), esc_url( 'https://wordpress.com/me/purchases/payment-methods?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=payment_update' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -132,7 +151,7 @@ if ( ! isset( $type ) ) {
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet' ), esc_url( 'https://akismet.com/account/' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'Please visit <a class="akismet-external-link" href="%s" target="_blank">Akismet.com</a> to purchase a new subscription.', 'akismet' ), esc_url( 'https://akismet.com/pricing/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=pricing_cancelled' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -143,7 +162,7 @@ if ( ! isset( $type ) ) {
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL. */
|
||||
echo wp_kses( sprintf( __( 'Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'Please contact <a class="akismet-external-link" href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=support_suspended' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -154,7 +173,7 @@ if ( ! isset( $type ) ) {
|
||||
<p>
|
||||
<?php
|
||||
/* translators: the placeholder is a clickable URL to the Akismet account upgrade page. */
|
||||
echo wp_kses( sprintf( __( 'You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet' ), esc_url( 'https://akismet.com/pricing' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'You can help us fight spam and upgrade your account by <a class="akismet-external-link" href="%s" target="_blank">contributing a token amount</a>', 'akismet' ), esc_url( 'https://akismet.com/pricing?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=upgrade_contribution' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -165,7 +184,7 @@ if ( ! isset( $type ) ) {
|
||||
<p>
|
||||
<?php
|
||||
/* translators: The placeholder is a URL to the Akismet contact form. */
|
||||
echo wp_kses( sprintf( __( 'Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'Please contact <a class="akismet-external-link" href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet' ), esc_url( 'https://akismet.com/contact/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=support_missing' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -173,13 +192,13 @@ if ( ! isset( $type ) ) {
|
||||
<?php elseif ( $type === 'no-sub' ) : ?>
|
||||
<div class="akismet-alert is-bad">
|
||||
<h3 class="akismet-alert__heading"><?php esc_html_e( 'You don’t have an Akismet plan.', 'akismet' ); ?></h3>
|
||||
<p><?php echo esc_html__( 'Your API key must have an Akismet plan before it can protect your site from spam.', 'akismet' ); ?></p>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: the placeholder is the URL to the Akismet pricing page. */
|
||||
echo wp_kses( sprintf( __( 'Please <a href="%s" target="_blank">choose a plan</a> to get started with Akismet.', 'akismet' ), esc_url( 'https://akismet.com/pricing' ) ), $kses_allow_link );
|
||||
echo wp_kses( sprintf( __( 'Please <a class="akismet-external-link" href="%s" target="_blank">choose a free or paid plan</a> so Akismet can protect your site from spam.', 'akismet' ), esc_url( 'https://akismet.com/pricing?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=choose_plan' ) ), $kses_allow_link );
|
||||
?>
|
||||
</p>
|
||||
<p><?php echo esc_html__( 'Once you\'ve chosen a plan, return here to complete your setup.', 'akismet' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php elseif ( $type === 'new-key-valid' ) : ?>
|
||||
@@ -225,8 +244,8 @@ if ( ! isset( $type ) ) {
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL to the Akismet contact form. */
|
||||
__( 'Please enter a new key or <a href="%s" target="_blank">contact Akismet support</a>.', 'akismet' ),
|
||||
'https://akismet.com/contact/'
|
||||
__( 'Please enter a new key or <a class="akismet-external-link" href="%s" target="_blank">contact Akismet support</a>', 'akismet' ),
|
||||
'https://akismet.com/contact/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=support_invalid_key'
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
@@ -242,8 +261,8 @@ if ( ! isset( $type ) ) {
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL. */
|
||||
__( 'The connection to akismet.com could not be established. Please refer to <a href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet' ),
|
||||
'https://blog.akismet.com/akismet-hosting-faq/'
|
||||
__( 'The connection to akismet.com could not be established. Please refer to <a class="akismet-external-link" href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet' ),
|
||||
'https://akismet.com/akismet-hosting-faq/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=hosting_faq'
|
||||
),
|
||||
$kses_allow_link
|
||||
);
|
||||
@@ -289,33 +308,33 @@ if ( ! isset( $type ) ) {
|
||||
)
|
||||
);
|
||||
echo ' ';
|
||||
echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) );
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
case 'SECOND_MONTH_OVER_LIMIT':
|
||||
echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Please consider upgrading your plan.', 'akismet' ) );
|
||||
echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Increase your limit to make sure your site stays protected from spam.', 'akismet' ) );
|
||||
echo ' ';
|
||||
echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) );
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
case 'THIRD_MONTH_APPROACHING_LIMIT':
|
||||
echo esc_html( __( 'Your Akismet usage is nearing your plan’s limit for the third consecutive month. We will restrict your account after you reach the limit. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) );
|
||||
echo esc_html( __( 'Your Akismet usage is nearing your plan’s limit for the third consecutive month. We will restrict your account after you reach the limit. Increase your limit to make sure your site stays protected from spam.', 'akismet' ) );
|
||||
echo ' ';
|
||||
echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) );
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
case 'THIRD_MONTH_OVER_LIMIT':
|
||||
case 'FOUR_PLUS_MONTHS_OVER_LIMIT':
|
||||
echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for three consecutive months. We have restricted your account for the rest of the month. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) );
|
||||
echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for three consecutive months. We have restricted your account for the rest of the month. Increase your limit to make sure your site stays protected from spam.', 'akismet' ) );
|
||||
echo ' ';
|
||||
echo '<a href="https://docs.akismet.com/akismet-api-usage-limits/" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) );
|
||||
echo '<a class="akismet-external-link" href="https://akismet.com/support/general/akismet-api-usage-limits/?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_docs" target="_blank">';
|
||||
echo esc_html( __( 'Learn more about usage limits', 'akismet' ) );
|
||||
echo '</a>';
|
||||
|
||||
break;
|
||||
@@ -326,18 +345,28 @@ if ( ! isset( $type ) ) {
|
||||
</p>
|
||||
</div>
|
||||
<div class="akismet-usage-limit-cta">
|
||||
<a href="<?php echo esc_attr( $upgrade_url ); ?>" class="button" target="_blank">
|
||||
<a href="<?php echo esc_attr( $upgrade_url . ( strpos( $upgrade_url, '?' ) !== false ? '&' : '?' ) . 'utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=usage_limit_upgrade' ); ?>" class="button" target="_blank">
|
||||
<?php
|
||||
if ( isset( $upgrade_via_support ) && $upgrade_via_support ) {
|
||||
// Direct user to contact support.
|
||||
esc_html_e( 'Contact Akismet support', 'akismet' );
|
||||
} elseif ( ! empty( $upgrade_type ) && 'qty' === $upgrade_type ) {
|
||||
// If only a qty upgrade is required, show a more generic message.
|
||||
esc_html_e( 'Upgrade your subscription level', 'akismet' );
|
||||
// If a qty upgrade is required, use recommended plan name if available.
|
||||
if ( ! empty( $recommended_plan_name ) && is_string( $recommended_plan_name ) ) {
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
/* translators: The placeholder is the name of an Akismet subscription plan, like "Akismet Pro" or "Akismet Business" . */
|
||||
__( 'Add an %s subscription', 'akismet' ),
|
||||
$recommended_plan_name
|
||||
)
|
||||
);
|
||||
} else {
|
||||
esc_html_e( 'Increase your limit', 'akismet' );
|
||||
}
|
||||
} else {
|
||||
echo esc_html(
|
||||
sprintf(
|
||||
/* translators: The placeholder is the name of a subscription level, like "Plus" or "Enterprise" . */
|
||||
/* translators: The placeholder is the name of a subscription level, like "Akismet Business" or "Akismet Enterprise" . */
|
||||
__( 'Upgrade to %s', 'akismet' ),
|
||||
$upgrade_plan
|
||||
)
|
||||
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
declare( strict_types = 1 );
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
$user_status = $akismet_user->status ?? null;
|
||||
?>
|
||||
<div class="akismet-setup__connection">
|
||||
<?php if ( ! empty( $akismet_user->user_email ) && ! empty( $akismet_user->user_login ) ) : ?>
|
||||
<div class="akismet-setup__connection-user">
|
||||
<div class="akismet-setup__connection-avatar">
|
||||
<?php
|
||||
// Decorative avatar; empty alt for screen readers.
|
||||
echo get_avatar(
|
||||
$akismet_user->user_email,
|
||||
48,
|
||||
'',
|
||||
'',
|
||||
array(
|
||||
'class' => 'akismet-setup__connection-avatar-image',
|
||||
'alt' => '',
|
||||
)
|
||||
);
|
||||
?>
|
||||
<div class="akismet-setup__connection-account">
|
||||
<div class="akismet-setup__connection-account-name">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s is the WordPress.com username */
|
||||
esc_html__( 'Signed in as %s', 'akismet' ),
|
||||
'<strong>' . esc_html( $akismet_user->user_login ) . '</strong>'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<div class="akismet-setup__connection-account-email"><?php echo esc_html( $akismet_user->user_email ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="akismet-setup__connection-action">
|
||||
<?php if ( in_array( $user_status, array( Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_NO_SUB ) ) ) : ?>
|
||||
|
||||
<p class="akismet-setup__connection-action-intro">
|
||||
<?php esc_html_e( "Your Jetpack account is connected, but it doesn't have an active Akismet subscription yet. To continue, please choose a plan on Akismet.com.", 'akismet' ); ?>
|
||||
</p>
|
||||
|
||||
<a href="https://akismet.com/get?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=jetpack_flow_<?php echo esc_attr( str_replace( '-', '_', $user_status ) ); ?>" class="akismet-setup__connection-button akismet-button">
|
||||
<?php esc_html_e( 'Choose a plan on Akismet.com', 'akismet' ); ?>
|
||||
</a>
|
||||
|
||||
<p class="akismet-setup__connection-action-description">
|
||||
<?php esc_html_e( "Once you've chosen a plan, return here to complete your setup.", 'akismet' ); ?>
|
||||
</p>
|
||||
|
||||
<?php elseif ( $user_status === Akismet::USER_STATUS_SUSPENDED ) : ?>
|
||||
<p class="akismet-setup__connection-action-intro">
|
||||
<?php esc_html_e( "Your Akismet account appears to be suspended. This sometimes happens if there's a billing or verification issue. Please contact our support team so we can help you get it sorted.", 'akismet' ); ?>
|
||||
</p>
|
||||
|
||||
<a href="https://akismet.com/contact?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=jetpack_flow_suspended" class="akismet-setup__connection-button akismet-button">
|
||||
<?php esc_html_e( 'Contact support', 'akismet' ); ?>
|
||||
</a>
|
||||
<?php else : ?>
|
||||
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate">
|
||||
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key ); ?>"/>
|
||||
<input type="hidden" name="action" value="enter-key">
|
||||
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
||||
<input type="submit" class="akismet-setup__connection-button akismet-button" value="<?php esc_attr_e( 'Connect with Jetpack', 'akismet' ); ?>"/>
|
||||
</form>
|
||||
|
||||
<p class="akismet-setup__connection-action-description">
|
||||
<?php esc_html_e( "By connecting, we'll use your Jetpack account to activate Akismet on this site.", 'akismet' ); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! in_array( $user_status, array( Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_NO_SUB ) ) ) : ?>
|
||||
<p class="akismet-setup__connection-action-description">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
sprintf(
|
||||
/* translators: The placeholder is a URL. */
|
||||
__( 'Want to use a different account? <a href="%s" class="akismet-external-link">Visit akismet.com</a> to set it up and get your API key.', 'akismet' ),
|
||||
esc_url( 'https://akismet.com/get?utm_source=akismet_plugin&utm_campaign=plugin_static_link&utm_medium=in_plugin&utm_content=jetpack_flow_different_account' )
|
||||
),
|
||||
array(
|
||||
'a' => array(
|
||||
'href' => array(),
|
||||
'class' => array(),
|
||||
),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,78 @@
|
||||
<div class="akismet-setup-instructions">
|
||||
<p><?php esc_html_e( 'Set up your Akismet account to enable spam filtering on this site.', 'akismet' ); ?></p>
|
||||
<?php
|
||||
declare( strict_types = 1 );
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
$tick_icon = '<svg class="akismet-setup-instructions__icon" width="48" height="48" viewBox="0 0 48 48" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="24" cy="24" r="22" fill="#2E7D32"/>
|
||||
<path d="M16 24l6 6 12-14" fill="none" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>';
|
||||
?>
|
||||
<section class="akismet-setup-instructions">
|
||||
<h2 class="akismet-setup-instructions__heading"><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
|
||||
|
||||
<h3 class="akismet-setup-instructions__subheading">
|
||||
<?php echo esc_html__( 'Protect your site from comment spam and contact form spam — automatically.', 'akismet' ); ?>
|
||||
</h3>
|
||||
|
||||
<ul class="akismet-setup-instructions__feature-list">
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Machine learning accuracy', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Learns from billions of spam signals across the web to stop junk before it reaches you.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Zero effort', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Akismet runs quietly in the background, saving you hours of manual moderation.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Works with popular contact forms', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Seamlessly integrates with plugins like Elementor, Contact Form 7, Jetpack and WPForms.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="akismet-setup-instructions__feature">
|
||||
<?php echo $tick_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<div class="akismet-setup-instructions__body">
|
||||
<h4 class="akismet-setup-instructions__title">
|
||||
<?php echo esc_html__( 'Flexible pricing', 'akismet' ); ?>
|
||||
</h4>
|
||||
<p class="akismet-setup-instructions__text">
|
||||
<?php echo esc_html__( 'Name your own price for personal sites. Businesses start on a paid plan.', 'akismet' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => __( 'Choose an Akismet plan', 'akismet' ),
|
||||
'classes' => array( 'akismet-button', 'akismet-is-primary' ),
|
||||
)
|
||||
);
|
||||
if ( empty( $use_jetpack_connection ) ) :
|
||||
Akismet::view(
|
||||
'get',
|
||||
array(
|
||||
'text' => __( 'Get started', 'akismet' ),
|
||||
'classes' => array( 'akismet-button', 'akismet-is-primary', 'akismet-setup-instructions__button' ),
|
||||
'utm_content' => 'setup_instructions',
|
||||
)
|
||||
);
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
//phpcs:disable VariableAnalysis
|
||||
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||
|
||||
?>
|
||||
<div id="akismet-plugin-container">
|
||||
<div class="akismet-masthead">
|
||||
@@ -14,15 +13,13 @@
|
||||
<?php Akismet_Admin::display_status(); ?>
|
||||
<div class="akismet-boxes">
|
||||
<?php
|
||||
|
||||
if ( Akismet::predefined_api_key() ) {
|
||||
Akismet::view( 'predefined' );
|
||||
} elseif ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) {
|
||||
} elseif ( $akismet_user && in_array( $akismet_user->status, array( Akismet::USER_STATUS_ACTIVE, 'active-dunning', Akismet::USER_STATUS_NO_SUB, Akismet::USER_STATUS_MISSING, Akismet::USER_STATUS_CANCELLED, Akismet::USER_STATUS_SUSPENDED ) ) ) {
|
||||
Akismet::view( 'connect-jp', compact( 'akismet_user' ) );
|
||||
} else {
|
||||
Akismet::view( 'activate' );
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<div class="centered akismet-box-header">
|
||||
<h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
|
||||
</div>
|
||||
Reference in New Issue
Block a user