summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury German <blueknight@gentoo.org>2017-03-07 21:01:02 -0500
committerYury German <blueknight@gentoo.org>2017-03-07 21:01:02 -0500
commit1f38dbdf035b1f008eddfe052d3a17c66240ed8a (patch)
treeb53d149ef783d234812168598954c2ee1a37ba9a
parentJetpack upgrade 4.7 (diff)
downloadblogs-gentoo-1f38dbdf035b1f008eddfe052d3a17c66240ed8a.tar.gz
blogs-gentoo-1f38dbdf035b1f008eddfe052d3a17c66240ed8a.tar.bz2
blogs-gentoo-1f38dbdf035b1f008eddfe052d3a17c66240ed8a.zip
Upgrade Akismet to 3.3
-rw-r--r--plugins/akismet/_inc/akismet.css508
-rw-r--r--plugins/akismet/_inc/akismet.js35
-rw-r--r--plugins/akismet/_inc/img/logo-full-2x.pngbin4970 -> 7570 bytes
-rw-r--r--plugins/akismet/akismet.php8
-rw-r--r--plugins/akismet/class.akismet-admin.php184
-rw-r--r--plugins/akismet/class.akismet.php18
-rw-r--r--plugins/akismet/readme.txt17
-rw-r--r--plugins/akismet/views/config.php402
-rw-r--r--plugins/akismet/views/get.php2
-rw-r--r--plugins/akismet/views/notice.php108
-rw-r--r--plugins/akismet/views/start.php184
-rw-r--r--plugins/akismet/views/stats.php13
-rw-r--r--plugins/akismet/views/strict.php17
-rw-r--r--plugins/akismet/wrapper.php2
14 files changed, 872 insertions, 626 deletions
diff --git a/plugins/akismet/_inc/akismet.css b/plugins/akismet/_inc/akismet.css
index d38e14bc..53495bb2 100644
--- a/plugins/akismet/_inc/akismet.css
+++ b/plugins/akismet/_inc/akismet.css
@@ -1,3 +1,6 @@
+.wp-admin.jetpack_page_akismet-key-config, .wp-admin.settings_page_akismet-key-config {
+ background-color:#f3f6f8;
+}
#submitted-on {
position: relative;
@@ -73,136 +76,37 @@ table.comments td.comment p a:after {
height: 338px;
width: 450px;
}
-h2.ak-header {
- padding: 30px;
- background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
- background-size: 185px 33px;
- height: 33px;
- text-indent: -9999em;
- margin-right: 10px;
-}
.checkforspam {
display: inline-block !important;
}
-.checkforspam-spinner {
- display: inline-block;
- margin-top: 7px;
-}
-
-.config-wrap {
- margin-top: 2em;
- max-width: 700px;
-}
-
-.activate-option {
- background: #e3e3e3;
- border-radius: 3px;
- margin-bottom: 30px;
- overflow: hidden;
- padding: 20px;
-}
-.activate-option.clicked {
- background: #649316;
- color: #fff;
-}
-.activate-option.clicked:hover {
- background: #68802E;
- color: #fff;
-}
-
-.activate-option .button.button-secondary {
- margin: 15px 0;
-}
-
-.activate-option p {
- margin: 10px 0 10px;
-}
-
-.activate-highlight {
- background: #fff;
- padding: 30px;
- margin-right: 10px;
+.checkforspam-progress {
+ padding-left: 1ex;
+ display: none;
}
-
-.activate-highlight.secondary {
- background: #ddd;
- padding: 20px 30px;
+.checkforspam.button-disabled .checkforspam-progress {
+ display: inline;
}
-.activate-highlight h3 {
- margin: 0 0 0.3em;
-}
-.activate-highlight p {
- color: #777;
-}
-.activate-highlight .button-primary {
- margin-top: 15px;
+.checkforspam-spinner {
+ display: inline-block;
+ margin-top: 7px;
}
-#akismet-enter-api-key .regular-text {
- width: 18em;
- margin-top: 15px;
+.akismet-right {
+ float: right;
}
-.right {
- float: right;
+.akismet-card .akismet-right {
+ margin: 1em 0;
}
-.alert-text {
+.akismet-alert-text {
color: #dd3d36;
+ font-weight: bold;
+ font-size: 120%;
+ margin-top: .5rem;
}
-.success {
- color: #649316;
-}
-.option-description {
- float: left;
- font-size: 16px;
-}
-.option-description span {
- color: #666;
- display: block;
- font-size: 14px;
- margin-top: 5px;
-}
-.option-action {
- float: right;
-}
-.key-config-link {
- font-size: 14px;
- margin-left: 20px;
-}
-.jetpack-account {
- float: left;
- font-size: 18px;
- margin-right: 40px;
-}
-.small-heading {
- color: #777;
- display: block;
- font-size: 12px;
- font-weight: bold;
- margin-bottom: 5px;
- text-transform: uppercase;
-}
-.inline-label {
- background: #ddd;
- border-radius: 3px;
- font-size: 11px;
- padding: 3px 8px;
- text-transform: uppercase;
-}
-.inline-label.alert {
- background: #e54747;
- color: #fff;
-}
-.jetpack-account .inline-label {
- margin-left: 5px;
-}
-.option-action .manual-key {
- margin-top: 7px;
-}
-
-.alert {
+.akismet-alert {
border: 1px solid #e5e5e5;
padding: 0.4em 1em 1.4em 1em;
border-radius: 3px;
@@ -211,49 +115,45 @@ h2.ak-header {
border-style: solid;
}
-.alert h3.key-status {
+.akismet-alert h3.akismet-key-status {
color: #fff;
margin: 1em 0 0.5em 0;
}
-.alert.critical {
+.akismet-alert.akismet-critical {
background-color: #993300;
}
-.alert.active {
+.akismet-alert.akismet-active {
background-color: #649316;
}
-.alert p.key-status {
+.akismet-alert p.akismet-key-status {
font-size: 24px;
}
-.alert p.description {
+.akismet-alert p.akismet-description {
color:#fff;
font-size: 14px;
margin: 0 0;
font-style: normal;
}
-.alert p.description a,
-.alert p.description a,
-.alert p.description a,
-.alert p.description a {
+.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;
}
-.new-snapshot {
+.akismet-new-snapshot {
margin-top: 1em;
padding: 1em;
text-align: center;
-}
-
-.new-snapshot.stats {
background: #fff;
- border: 1px solid #e5e5e5;
}
-.new-snapshot h3 {
+.akismet-new-snapshot h3 {
background: #f5f5f5;
color: #888;
font-size: 11px;
@@ -266,7 +166,7 @@ h2.ak-header {
width: 100%;
}
-.new-snapshot ul li {
+.akismet-new-snapshot ul li {
color: #999;
float: left;
font-size: 11px;
@@ -279,16 +179,12 @@ h2.ak-header {
-ms-box-sizing: border-box;
}
-.new-snapshot.stats ul li:first-child,
-.new-snapshot.stats ul li:nth-child(2) {
+.akismet-new-snapshot ul li:first-child,
+.akismet-new-snapshot ul li:nth-child(2) {
border-right:1px dotted #ccc;
}
-.new-snapshot.account ul li:nth-child(2) {
- border-right: none;
-}
-
-.new-snapshot ul li span {
+.akismet-new-snapshot ul li span {
color: #52accc;
display: block;
font-size: 32px;
@@ -296,60 +192,6 @@ h2.ak-header {
line-height: 1.5em;
}
-.new-snapshot.stats {
-}
-
-.new-snapshot.account,
-.new-snapshot.settings {
- float: left;
- padding: 0;
- text-align: left;
- width: 50%;
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- -ms-box-sizing: border-box;
-}
-
-.account-container {
- background: #fff;
- border: 1px solid #e5e5e5;
- margin-right: 0.5em;
-}
-
-.settings-container {
- background: #fff;
- border: 1px solid #e5e5e5;
- margin-left: 0.5em;
-}
-
-.new-snapshot.account ul li {
- width:100%
-}
-
-.new-snapshot.account ul li span {
- font-size: 14px;
- font-weight: normal;
-}
-
-
-.new-snapshot.settings ul li {
- border: none;
- display: block;
- width:100%
-}
-
-.new-snapshot.settings ul li span {
- display: block;
- font-size: 14px;
- font-weight: normal;
-}
-
-.new-snapshot.settings p.submit {
- margin: 0;
- text-align: center;
-}
-
.akismet-settings th:first-child {
vertical-align: top;
padding-top: 15px;
@@ -364,17 +206,13 @@ h2.ak-header {
width: 75%;
}
-.akismet-settings span.note{
+.akismet-settings span.akismet-note{
float: left;
padding-left: 23px;
font-size: 75%;
margin-top: -10px;
}
-.clearfix {
- clear:both;
-}
-
/**
* For the activation notice on the plugins page.
*/
@@ -471,4 +309,278 @@ h2.ak-header {
.akismet_activate .aa_description strong {
color: #FFF;
font-weight: normal;
+}
+
+.jetpack_page_akismet-key-config #wpcontent, .settings_page_akismet-key-config #wpcontent {
+ padding-left: 0;
+}
+
+.akismet-masthead {
+ background-color:#fff;
+ text-align:center;
+ box-shadow:0 1px 0 rgba(200,215,225,0.5),0 1px 2px #e9eff3
+}
+@media (max-width: 45rem) {
+ .akismet-masthead {
+ padding:0 1.25rem
+ }
+}
+
+.akismet-masthead__inside-container {
+ padding:.375rem 0;
+ margin:0 auto;
+ width:100%;
+ max-width:45rem;
+ text-align: left;
+}
+.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;
+ vertical-align:middle
+}
+.akismet-masthead__logo-link:focus {
+ line-height:0;
+ box-shadow:0 0 0 2px #78dcfa
+}
+.akismet-masthead__logo-link+code {
+ margin:0 10px;
+ padding:5px 9px;
+ border-radius:2px;
+ background:#e6ecf1;
+ color:#647a88
+}
+.akismet-masthead__links {
+ display:-ms-flexbox;
+ display:flex;
+ -ms-flex-flow:row wrap;
+ flex-flow:row wrap;
+ -ms-flex:2 50%;
+ flex:2 50%;
+ -ms-flex-pack:end;
+ justify-content:flex-end;
+ margin:0
+}
+@media (max-width: 480px) {
+ .akismet-masthead__links {
+ padding-right:.625rem
+ }
+}
+.akismet-masthead__link-li {
+ margin:0;
+ padding:0
+}
+.akismet-masthead__link {
+ font-style:normal;
+ color:#0087be;
+ padding:.625rem;
+ display:inline-block
+}
+.akismet-masthead__link:visited {
+ color:#0087be
+}
+.akismet-masthead__link:active,.akismet-masthead__link:hover {
+ color:#00aadc
+}
+.akismet-masthead__link:hover {
+ text-decoration:underline
+}
+.akismet-masthead__link .dashicons {
+ display:none
+}
+@media (max-width: 480px) {
+ .akismet-masthead__link:hover,.akismet-masthead__link:active {
+ text-decoration:none
+ }
+ .akismet-masthead__link .dashicons {
+ display:block;
+ font-size:1.75rem
+ }
+ .akismet-masthead__link span+span {
+ display:none
+ }
+}
+.akismet-masthead__link-li:last-of-type .akismet-masthead__link {
+ padding-right:0
+}
+
+.akismet-lower {
+ margin: 0 auto;
+ text-align: left;
+ max-width: 45rem;
+ padding: 1.5rem;
+}
+
+.akismet-card {
+ 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 {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+.akismet-card .inside {
+ padding: 1.5rem;
+ padding-top: 1rem;
+}
+
+.akismet-card .akismet-card-actions {
+ margin-top: 1rem;
+}
+
+.jetpack_page_akismet-key-config .update-nag, .settings_page_akismet-key-config .update-nag {
+ display: none;
+}
+
+.akismet-masthead .akismet-right {
+ line-height: 2.125rem;
+ font-size: 0.9rem;
+}
+
+.akismet-box {
+ box-sizing: border-box;
+ background: white;
+ border: 1px solid rgba(200, 215, 225, 0.5);
+}
+
+.akismet-box h2, .akismet-box h3 {
+ padding: 1.5rem 1.5rem .5rem 1.5rem;
+ margin: 0;
+}
+
+.akismet-box p {
+ padding: 0 1.5rem 1.5rem 1.5rem;
+ 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;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+.akismet-box .akismet-right {
+ padding-right: 1.5rem;
+}
+
+.akismet-boxes .akismet-box {
+ margin-bottom: 0;
+ padding: 0;
+ margin-top: -1px;
+}
+
+.akismet-boxes .akismet-box:last-child {
+ margin-bottom: 1.5rem;
+}
+
+.akismet-boxes .akismet-box:first-child {
+ margin-top: 1.5rem;
+}
+
+.akismet-button, .akismet-button:hover, .akismet-button:visited {
+ background: white;
+ border-color: #c8d7e1;
+ border-style: solid;
+ border-width: 1px 1px 2px;
+ color: #2e4453;
+ cursor: pointer;
+ display: inline-block;
+ margin: 0;
+ outline: 0;
+ overflow: hidden;
+ font-size: 14px;
+ font-weight: 500;
+ text-overflow: ellipsis;
+ text-decoration: none;
+ vertical-align: top;
+ box-sizing: border-box;
+ font-size: 14px;
+ line-height: 21px;
+ border-radius: 4px;
+ padding: 7px 14px 9px;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+}
+
+.akismet-button:hover {
+ border-color: #a8bece;
+}
+
+.akismet-button:active {
+ border-width: 2px 1px 1px;
+}
+
+.akismet-is-primary, .akismet-is-primary:hover, .akismet-is-primary:visited {
+ background: #00aadc;
+ border-color: #0087be;
+ color: white;
+}
+
+.akismet-is-primary:hover, .akismet-is-primary:focus {
+ border-color: #005082;
+}
+
+.akismet-is-primary:hover {
+ border-color: #005082;
+}
+
+.akismet-section-header {
+ position: relative;
+ margin: 0 auto 0.625rem auto;
+ padding: 1rem;
+ box-sizing: border-box;
+ box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
+ background: #ffffff;
+ width: 100%;
+ padding-top: 0.6875rem;
+ padding-bottom: 0.6875rem;
+ display: flex;
+}
+
+.akismet-section-header__label {
+ display: -ms-flexbox;
+ display: flex;
+ -ms-flex-align: center;
+ align-items: center;
+ -ms-flex-positive: 1;
+ flex-grow: 1;
+ line-height: 1.75rem;
+ position: relative;
+ font-size: 0.875rem;
+ color: #4f748e;
+}
+
+.akismet-section-header__actions {
+ line-height: 1.75rem;
} \ No newline at end of file
diff --git a/plugins/akismet/_inc/akismet.js b/plugins/akismet/_inc/akismet.js
index ca4ebd2e..a72e3a9a 100644
--- a/plugins/akismet/_inc/akismet.js
+++ b/plugins/akismet/_inc/akismet.js
@@ -3,17 +3,6 @@ jQuery( function ( $ ) {
var mshotSecondTryTimer = null
var mshotThirdTryTimer = null
- $( 'a.activate-option' ).click( function(){
- var link = $( this );
- if ( link.hasClass( 'clicked' ) ) {
- link.removeClass( 'clicked' );
- }
- else {
- link.addClass( 'clicked' );
- }
- $( '.toggle-have-key' ).slideToggle( 'slow', function() {});
- return false;
- });
$('.akismet-status').each(function () {
var thisId = $(this).attr('commentid');
$(this).prependTo('#comment-' + thisId + ' .column-comment');
@@ -162,13 +151,24 @@ jQuery( function ( $ ) {
} );
$('.checkforspam:not(.button-disabled)').click( function(e) {
+ e.preventDefault();
+
$('.checkforspam:not(.button-disabled)').addClass('button-disabled');
- $('.checkforspam-spinner').addClass( 'spinner' );
+ $('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
+
+ // Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
+ $( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
+
akismet_check_for_spam(0, 100);
- e.preventDefault();
});
+ var spam_count = 0;
+ var recheck_count = 0;
+
function akismet_check_for_spam(offset, limit) {
+ // Update the progress counter on the "Check for Spam" button.
+ $( '.checkforspam-progress' ).text( $( '.checkforspam' ).data( 'progress-label-format' ).replace( '%1$s', offset ) );
+
$.post(
ajaxurl,
{
@@ -177,8 +177,11 @@ jQuery( function ( $ ) {
'limit': limit
},
function(result) {
+ recheck_count += result.counts.processed;
+ spam_count += result.counts.spam;
+
if (result.counts.processed < limit) {
- window.location.reload();
+ window.location.href = $( '.checkforspam' ).data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
}
else {
// Account for comments that were caught as spam and moved out of the queue.
@@ -187,6 +190,10 @@ jQuery( function ( $ ) {
}
);
}
+
+ if ( "start_recheck" in WPAkismet && WPAkismet.start_recheck ) {
+ $( '.checkforspam' ).click();
+ }
});
// URL encode plugin
jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
diff --git a/plugins/akismet/_inc/img/logo-full-2x.png b/plugins/akismet/_inc/img/logo-full-2x.png
index a9bed8b6..c555285a 100644
--- a/plugins/akismet/_inc/img/logo-full-2x.png
+++ b/plugins/akismet/_inc/img/logo-full-2x.png
Binary files differ
diff --git a/plugins/akismet/akismet.php b/plugins/akismet/akismet.php
index 61b41fa4..42d33213 100644
--- a/plugins/akismet/akismet.php
+++ b/plugins/akismet/akismet.php
@@ -3,10 +3,10 @@
* @package Akismet
*/
/*
-Plugin Name: Akismet
+Plugin Name: Akismet Anti-Spam
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>. It keeps your site protected even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="https://akismet.com/get/">Sign up for an Akismet plan</a> to get an API key, and 3) Go to your Akismet configuration page, and save your API key.
-Version: 3.2
+Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It 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: 3.3
Author: Automattic
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later
@@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
exit;
}
-define( 'AKISMET_VERSION', '3.2' );
+define( 'AKISMET_VERSION', '3.3' );
define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 );
diff --git a/plugins/akismet/class.akismet-admin.php b/plugins/akismet/class.akismet-admin.php
index 2d29cab2..fe29233d 100644
--- a/plugins/akismet/class.akismet-admin.php
+++ b/plugins/akismet/class.akismet-admin.php
@@ -63,6 +63,8 @@ class Akismet_Admin {
add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
add_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 );
+
+ add_filter( 'all_plugins', array( 'Akismet_Admin', 'modify_plugin_description' ) );
}
public static function admin_init() {
@@ -102,7 +104,7 @@ class Akismet_Admin {
public static function load_resources() {
global $hook_suffix;
- if ( in_array( $hook_suffix, array(
+ if ( in_array( $hook_suffix, apply_filters( 'akismet_admin_page_hook_suffixes', array(
'index.php', # dashboard
'edit-comments.php',
'comment.php',
@@ -110,13 +112,14 @@ class Akismet_Admin {
'settings_page_akismet-key-config',
'jetpack_page_akismet-key-config',
'plugins.php',
- ) ) ) {
+ ) ) ) ) {
wp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION );
wp_enqueue_style( 'akismet.css');
- wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery','postbox'), AKISMET_VERSION );
+ wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery'), AKISMET_VERSION );
wp_enqueue_script( 'akismet.js' );
- wp_localize_script( 'akismet.js', 'WPAkismet', array(
+
+ $inline_js = array(
'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ),
'strings' => array(
'Remove this URL' => __( 'Remove this URL' , 'akismet'),
@@ -125,7 +128,13 @@ class Akismet_Admin {
'(undo)' => __( '(undo)' , 'akismet'),
'Re-adding...' => __( 'Re-adding...' , 'akismet'),
)
- ) );
+ );
+
+ if ( isset( $_GET['akismet_recheck'] ) && wp_verify_nonce( $_GET['akismet_recheck'], 'akismet_recheck' ) ) {
+ $inline_js['start_recheck'] = true;
+ }
+
+ wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js );
}
}
@@ -349,7 +358,20 @@ class Akismet_Admin {
else
$link = add_query_arg( array( 'page' => 'akismet-admin', 'recheckqueue' => 'true', 'noheader' => 'true' ), admin_url( 'edit-comments.php' ) );
- echo '</div><div class="alignleft"><a class="button-secondary checkforspam" href="' . esc_url( $link ) . '">' . esc_html__('Check for Spam', 'akismet') . '</a><span class="checkforspam-spinner"></span>';
+ echo '</div>';
+ echo '<div class="alignleft">';
+ echo '<a
+ class="button-secondary checkforspam"
+ href="' . esc_url( $link ) . '"
+ data-active-label="' . esc_attr( __( 'Checking for Spam', 'akismet' ) ) . '"
+ data-progress-label-format="' . esc_attr( __( '(%1$s...)', 'akismet' ) ) . '"
+ data-success-url="' . esc_attr( remove_query_arg( 'akismet_recheck', add_query_arg( array( 'akismet_recheck_complete' => 1, 'recheck_count' => urlencode( '__recheck_count__' ), 'spam_count' => urlencode( '__spam_count__' ) ) ) ) ) . '"
+ >';
+ echo '<span class="akismet-label">' . esc_html__('Check for Spam', 'akismet') . '</span>';
+ echo '<span class="checkforspam-progress"></span>';
+ echo '</a>';
+ echo '<span class="checkforspam-spinner"></span>';
+
}
public static function recheck_queue() {
@@ -487,7 +509,14 @@ class Akismet_Admin {
if ( $desc )
echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' , 'akismet') . '">'.esc_html( $desc ).'</a></span>';
- $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') );
+ $show_user_comments_option = get_option( 'akismet_show_user_comments_approved' );
+
+ if ( $show_user_comments_option === false ) {
+ // Default to active if the user hasn't made a decision.
+ $show_user_comments_option = '1';
+ }
+
+ $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', $show_user_comments_option );
$show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true'
if ( $show_user_comments ) {
@@ -793,10 +822,6 @@ class Akismet_Admin {
}
}
- public static function display_invalid_version() {
- Akismet::view( 'notice', array( 'type' => 'version' ) );
- }
-
public static function display_api_key_warning() {
Akismet::view( 'notice', array( 'type' => 'plugin' ) );
}
@@ -838,18 +863,26 @@ class Akismet_Admin {
if ( $_GET['action'] == 'save-key' ) {
if ( is_object( $akismet_user ) ) {
self::save_key( $akismet_user->api_key );
- self::display_notice();
self::display_configuration_page();
- return;
+ return;
}
}
}
- echo '<h2 class="ak-header">'.esc_html__('Akismet', 'akismet').'</h2>';
-
- self::display_status();
+ Akismet::view( 'start', compact( 'akismet_user' ) );
+ /*
+ // To see all variants when testing.
+ $akismet_user->status = 'no-sub';
Akismet::view( 'start', compact( 'akismet_user' ) );
+ $akismet_user->status = 'cancelled';
+ Akismet::view( 'start', compact( 'akismet_user' ) );
+ $akismet_user->status = 'suspended';
+ Akismet::view( 'start', compact( 'akismet_user' ) );
+ $akismet_user->status = 'other';
+ Akismet::view( 'start', compact( 'akismet_user' ) );
+ $akismet_user = false;
+ */
}
public static function display_stats_page() {
@@ -869,12 +902,15 @@ class Akismet_Admin {
$stat_totals = self::get_stats( $api_key );
- // If unset, create the new strictness option using the old discard option to determine its default
- if ( get_option( 'akismet_strictness' ) === false )
- add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
+ // If unset, create the new strictness option using the old discard option to determine its default.
+ // If the old option wasn't set, default to discarding the blatant spam.
+ if ( get_option( 'akismet_strictness' ) === false ) {
+ add_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) );
+ }
+
+ $notices = array();
if ( empty( self::$notices ) ) {
- //show status
if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
$time_saved = false;
@@ -892,26 +928,53 @@ class Akismet_Admin {
elseif ( $total_in_minutes >= 30 )
$time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d minute!', 'Akismet has saved you %d minutes!', $total_in_minutes, 'akismet' ), $total_in_minutes );
}
-
- Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) );
+
+ $notices[] = array( 'type' => 'active-notice', 'time_saved' => $time_saved );
}
if ( !empty( $akismet_user->limit_reached ) && in_array( $akismet_user->limit_reached, array( 'yellow', 'red' ) ) ) {
- Akismet::view( 'notice', array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached ) );
+ $notices[] = array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached );
}
}
- if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) )
- Akismet::view( 'notice', array( 'type' => $akismet_user->status ) );
+ if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) {
+ $notices[] = array( 'type' => $akismet_user->status );
+ }
+ /*
+ // To see all variants when testing.
+ $notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' );
+ $notices[] = array( 'type' => 'plugin' );
+ $notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' );
+ $notices[] = array( 'type' => 'notice', 'notice_header' => 'This is the notice header.', 'notice_text' => 'This is the notice text.' );
+ $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' => 'new-key-valid' );
+ $notices[] = array( 'type' => 'new-key-invalid' );
+ $notices[] = array( 'type' => 'existing-key-invalid' );
+ $notices[] = array( 'type' => 'new-key-failed' );
+ $notices[] = array( 'type' => 'limit-reached', 'level' => 'yellow' );
+ $notices[] = array( 'type' => 'limit-reached', 'level' => 'red' );
+ */
+
Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
- Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals' ) );
+ Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals', 'notices' ) );
}
public static function display_notice() {
global $hook_suffix;
- if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config', 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
+ if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) ) {
+ // This page manages the notices and puts them inline where they make sense.
+ return;
+ }
+
+ 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
if ( get_option( 'akismet_alert_code' ) > 0 )
@@ -923,38 +986,59 @@ class Akismet_Admin {
elseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
self::display_spam_check_warning();
}
- elseif ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) && Akismet::get_api_key() ) {
- self::display_status();
+ else if ( isset( $_GET['akismet_recheck_complete'] ) ) {
+ $recheck_count = (int) $_GET['recheck_count'];
+ $spam_count = (int) $_GET['spam_count'];
+
+ if ( $recheck_count === 0 ) {
+ $message = __( 'There were no comments to check. Akismet will only check comments in the Pending queue.', 'akismet' );
+ }
+ else {
+ $message = sprintf( _n( 'Akismet checked %s comment.', 'Akismet checked %s comments.', $recheck_count, 'akismet' ), number_format( $recheck_count ) );
+ $message .= ' ';
+
+ if ( $spam_count === 0 ) {
+ $message .= __( 'No comments were caught as spam.' );
+ }
+ else {
+ $message .= sprintf( _n( '%s comment was caught as spam.', '%s comments were caught as spam.', $spam_count, 'akismet' ), number_format( $spam_count ) );
+ }
+ }
+
+ echo '<div class="notice notice-success"><p>' . esc_html( $message ) . '</p></div>';
}
}
public static function display_status() {
- $type = '';
-
- if ( !self::get_server_connectivity() )
- $type = 'servers-be-down';
-
- if ( !empty( $type ) )
- Akismet::view( 'notice', compact( 'type' ) );
- elseif ( !empty( self::$notices ) ) {
- foreach ( self::$notices as $type ) {
+ if ( ! self::get_server_connectivity() ) {
+ Akismet::view( 'notice', compact( 'servers-be-down' ) );
+ }
+ else if ( ! empty( self::$notices ) ) {
+ foreach ( self::$notices as $index => $type ) {
if ( is_object( $type ) ) {
$notice_header = $notice_text = '';
- if ( property_exists( $type, 'notice_header' ) )
+ if ( property_exists( $type, 'notice_header' ) ) {
$notice_header = wp_kses( $type->notice_header, self::$allowed );
+ }
- if ( property_exists( $type, 'notice_text' ) )
+ if ( property_exists( $type, 'notice_text' ) ) {
$notice_text = wp_kses( $type->notice_text, self::$allowed );
+ }
if ( property_exists( $type, 'status' ) ) {
$type = wp_kses( $type->status, self::$allowed );
Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );
+
+ unset( self::$notices[ $index ] );
}
}
- else
+ else {
Akismet::view( 'notice', compact( 'type' ) );
- }
+
+ unset( self::$notices[ $index ] );
+ }
+ }
}
}
@@ -997,4 +1081,20 @@ class Akismet_Admin {
return $exclude;
}
+
+ /**
+ * When Akismet is active, remove the "Activate Akismet" step from the plugin description.
+ */
+ public static function modify_plugin_description( $all_plugins ) {
+ if ( isset( $all_plugins['akismet/akismet.php'] ) ) {
+ if ( Akismet::get_api_key() ) {
+ $all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Your site is fully configured and being protected, even while you sleep.', 'akismet' );
+ }
+ else {
+ $all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started, just go to <a href="admin.php?page=akismet-key-config">your Akismet Settings page</a> to set up your API key.', 'akismet' );
+ }
+ }
+
+ return $all_plugins;
+ }
} \ No newline at end of file
diff --git a/plugins/akismet/class.akismet.php b/plugins/akismet/class.akismet.php
index 0d312e98..c8d5d75d 100644
--- a/plugins/akismet/class.akismet.php
+++ b/plugins/akismet/class.akismet.php
@@ -129,8 +129,9 @@ class Akismet {
$comment['blog_charset'] = get_option('blog_charset');
$comment['permalink'] = get_permalink( $comment['comment_post_ID'] );
- if ( !empty( $comment['user_ID'] ) )
+ if ( ! empty( $comment['user_ID'] ) ) {
$comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
+ }
/** See filter documentation in init_hooks(). */
$akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
@@ -465,8 +466,9 @@ class Akismet {
$c['recheck_reason'] = $recheck_reason;
$c['user_role'] = '';
- if ( isset( $c['user_ID'] ) )
- $c['user_role'] = Akismet::get_user_roles($c['user_ID']);
+ if ( ! empty( $c['user_ID'] ) ) {
+ $c['user_role'] = Akismet::get_user_roles( $c['user_ID'] );
+ }
if ( self::is_test_mode() )
$c['is_test'] = 'true';
@@ -596,8 +598,9 @@ class Akismet {
$comment->site_domain = $current_site->domain;
$comment->user_role = '';
- if ( isset( $comment->user_ID ) )
+ if ( ! empty( $comment->user_ID ) ) {
$comment->user_role = Akismet::get_user_roles( $comment->user_ID );
+ }
if ( self::is_test_mode() )
$comment->is_test = 'true';
@@ -642,8 +645,9 @@ class Akismet {
if ( is_object($current_site) )
$comment->site_domain = $current_site->domain;
- if ( isset( $comment->user_ID ) )
- $comment->user_role = Akismet::get_user_roles($comment->user_ID);
+ if ( ! empty( $comment->user_ID ) ) {
+ $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
+ }
if ( Akismet::is_test_mode() )
$comment->is_test = 'true';
@@ -1038,7 +1042,7 @@ class Akismet {
}
// given a response from an API call like check_key_status(), update the alert code options if an alert is present.
- private static function update_alert( $response ) {
+ public static function update_alert( $response ) {
$code = $msg = null;
if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
$code = $response[0]['x-akismet-alert-code'];
diff --git a/plugins/akismet/readme.txt b/plugins/akismet/readme.txt
index 41c75408..3d7beb00 100644
--- a/plugins/akismet/readme.txt
+++ b/plugins/akismet/readme.txt
@@ -2,15 +2,15 @@
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
Requires at least: 3.7
-Tested up to: 4.6.1
-Stable tag: 3.2
+Tested up to: 4.7.2
+Stable tag: 3.3
License: GPLv2 or later
-Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
+Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
== Description ==
-Akismet checks your comments against the Akismet Web service to see if they look like spam or not and lets you review the spam it catches under your blog's "Comments" admin screen.
+Akismet checks your comments and contact form submissions against our global database of spam to prevent your site from publishing malicious content. You can review the comment spam it catches on your blog's "Comments" admin screen.
Major features in Akismet include:
@@ -30,6 +30,15 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
== Changelog ==
+= 3.3 =
+*Release Date - 23 February 2017*
+
+* Updated the Akismet admin pages with a new clean design.
+* Fixed bugs preventing the `akismet_add_comment_nonce` and `akismet_update_alert` wrapper functions from working properly.
+* Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
+* Added a progress indicator to the "Check for Spam" button.
+* Added a success message after manually rechecking the Pending queue for spam.
+
= 3.2 =
*Release Date - 6 September 2016*
diff --git a/plugins/akismet/views/config.php b/plugins/akismet/views/config.php
index bc8cb977..f7b232ed 100644
--- a/plugins/akismet/views/config.php
+++ b/plugins/akismet/views/config.php
@@ -1,216 +1,232 @@
-<div class="wrap">
-
- <h2><?php esc_html_e( 'Akismet' , 'akismet');?></h2>
-
- <div class="have-key">
-
+<div id="akismet-plugin-container">
+ <div class="akismet-masthead">
+ <div class="akismet-masthead__inside-container">
+ <div class="akismet-masthead__logo-container">
+ <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
+ </div>
+ </div>
+ </div>
+ <div class="akismet-lower">
+ <?php if ( Akismet::get_api_key() ) { ?>
+ <?php Akismet_Admin::display_status(); ?>
+ <?php } ?>
+ <?php if ( ! empty( $notices ) ) { ?>
+ <?php foreach ( $notices as $notice ) { ?>
+ <?php Akismet::view( 'notice', $notice ); ?>
+ <?php } ?>
+ <?php } ?>
<?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
-
- <div class="new-snapshot stats">
-
- <span style="float:right;margin:10px 15px -5px 0px">
- <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
- </span>
-
- <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
- <ul>
- <li>
- <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
- <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
- <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
- </li>
- <li>
- <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
- <span><?php echo number_format( $stat_totals['all']->spam );?></span>
- <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
- </li>
- <li>
- <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
- <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
- <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
- |
- <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
- </li>
- </ul>
- <div class="clearfix"></div>
+ <div class="akismet-card">
+ <div class="akismet-section-header">
+ <div class="akismet-section-header__label">
+ <span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>
+ </div>
+ <div class="akismet-section-header__actions">
+ <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
+ <?php esc_html_e( 'Detailed Stats' , 'akismet');?>
+ </a>
+ </div>
+ </div>
+
+ <div class="akismet-new-snapshot">
+ <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
+ <ul>
+ <li>
+ <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
+ <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
+ <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
+ </li>
+ <li>
+ <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
+ <span><?php echo number_format( $stat_totals['all']->spam );?></span>
+ <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
+ </li>
+ <li>
+ <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
+ <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
+ <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
+ |
+ <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
+ </li>
+ </ul>
+ </div>
</div>
<?php endif;?>
<?php if ( $akismet_user ):?>
+ <div class="akismet-card">
+ <div class="akismet-section-header">
+ <div class="akismet-section-header__label">
+ <span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>
+ </div>
+ </div>
- <div id="wpcom-stats-meta-box-container" class="metabox-holder"><?php
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
- ?>
- <script type="text/javascript">
- jQuery(document).ready( function($) {
- jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
- if(typeof postboxes !== 'undefined')
- postboxes.add_postbox_toggles( 'plugins_page_akismet-key-config' );
- });
- </script>
- <div class="postbox-container" style="width: 55%;margin-right: 10px;">
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
- <div id="referrers" class="postbox ">
- <div class="handlediv" title="Click to toggle"><br></div>
- <h3 class="hndle"><span><?php esc_html_e( 'Settings' , 'akismet');?></span></h3>
- <form name="akismet_conf" id="akismet-conf" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
- <div class="inside">
- <table cellspacing="0" class="akismet-settings">
- <tbody>
- <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
- <tr>
- <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
- <td width="5%"/>
- <td align="left">
- <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
- </td>
- </tr>
- <?php endif; ?>
- <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
- <tr>
- <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
- <td></td>
- <td align="left">
- <p>
- <?php
+ <div class="inside">
+ <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
+ <table cellspacing="0" class="akismet-settings">
+ <tbody>
+ <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
+ <tr>
+ <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
+ <td width="5%"/>
+ <td align="left">
+ <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
+ <tr>
+ <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
+ <td></td>
+ <td align="left">
+ <p>
+ <?php
- if ( ! function_exists( 'wp_http_supports' ) ) {
- ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
- }
- else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
- ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php
- }
- else {
- $ssl_disabled = get_option( 'akismet_ssl_disabled' );
+ if ( ! function_exists( 'wp_http_supports' ) ) {
+ ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
+ }
+ else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
+ ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php
+ }
+ else {
+ $ssl_disabled = get_option( 'akismet_ssl_disabled' );
- if ( $ssl_disabled ) {
- ?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?><?php
- }
- else {
- ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
- }
- }
+ if ( $ssl_disabled ) {
+ ?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?><?php
+ }
+ else {
+ ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
+ }
+ }
- ?>
- </p>
- </td>
- </tr>
- <?php } ?>
- <tr>
- <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
- <td></td>
- <td align="left">
- <p>
- <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="1" type="checkbox" <?php checked('1', get_option('akismet_show_user_comments_approved')); ?>> <?php esc_html_e('Show the number of approved comments beside each comment author', 'akismet'); ?></label>
- </p>
- </td>
- </tr>
- <tr>
- <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
- <td></td>
- <td align="left">
- <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
- <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
- <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
- </fieldset>
- <span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
+ ?>
+ </p>
+ </td>
+ </tr>
+ <?php } ?>
+ <tr>
+ <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
+ <td></td>
+ <td align="left">
+ <p>
+ <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
+ <input
+ name="akismet_show_user_comments_approved"
+ id="akismet_show_user_comments_approved"
+ value="1"
+ type="checkbox"
<?php
- $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
-
- printf(
- _n(
- 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
- 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
- $delete_interval,
- 'akismet'
- ),
- admin_url( 'edit-comments.php?comment_status=spam' ),
- $delete_interval
- );
+ // If the option isn't set, or if it's enabled ('1'), or if it was enabled a long time ago ('true'), check the checkbox.
+ checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
?>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="major-publishing-actions">
- <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
- <div id="delete-action">
- <a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>
- </div>
- <?php endif; ?>
- <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
- <div id="publishing-action">
- <input type="hidden" name="action" value="enter-key">
- <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
-
- </div>
- <div class="clear"></div>
- </div>
- </form>
+ />
+ <?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
+ </label>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
+ <td></td>
+ <td align="left">
+ <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
+ <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
+ <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
+ </fieldset>
+ <span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
+ <?php
+
+ $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
+
+ printf(
+ _n(
+ 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
+ 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
+ $delete_interval,
+ 'akismet'
+ ),
+ admin_url( 'edit-comments.php?comment_status=spam' ),
+ $delete_interval
+ );
+
+ ?>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div class="akismet-card-actions">
+ <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
+ <div id="delete-action">
+ <a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>
+ </div>
+ <?php endif; ?>
+ <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
+ <div id="publishing-action">
+ <input type="hidden" name="action" value="enter-key">
+ <input type="submit" name="submit" id="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
+ </div>
+ <div class="clear"></div>
</div>
+ </form>
+ </div>
+ </div>
+
+ <div class="akismet-card">
+ <div class="akismet-section-header">
+ <div class="akismet-section-header__label">
+ <span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
</div>
</div>
- <div class="postbox-container" style="width:44%;">
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
- <div id="referrers" class="postbox ">
- <div class="handlediv" title="Click to toggle"><br></div>
- <h3 class="hndle"><span><?php esc_html_e( 'Account' , 'akismet');?></span></h3>
- <div class="inside">
- <table cellspacing="0">
- <tbody>
- <tr>
- <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
- <td width="5%"/>
- <td align="left">
- <span><?php echo esc_html( $akismet_user->account_name ); ?></span>
- </td>
- </tr>
- <tr>
- <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
- <td width="5%"/>
- <td align="left">
- <span><?php
- if ( 'cancelled' == $akismet_user->status ) :
- esc_html_e( 'Cancelled', 'akismet' );
- elseif ( 'suspended' == $akismet_user->status ) :
- esc_html_e( 'Suspended', 'akismet' );
- elseif ( 'missing' == $akismet_user->status ) :
- esc_html_e( 'Missing', 'akismet' );
- elseif ( 'no-sub' == $akismet_user->status ) :
- esc_html_e( 'No Subscription Found', 'akismet' );
- else :
- esc_html_e( 'Active', 'akismet' );
- endif; ?></span>
- </td>
- </tr>
- <?php if ( $akismet_user->next_billing_date ) : ?>
- <tr>
- <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
- <td width="5%"/>
- <td align="left">
- <span><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></span>
- </td>
- </tr>
- <?php endif; ?>
- </tbody>
- </table>
- </div>
- <div id="major-publishing-actions">
- <div id="publishing-action">
- <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
- </div>
- <div class="clear"></div>
- </div>
+
+ <div class="inside">
+ <table cellspacing="0" border="0" class="akismet-settings">
+ <tbody>
+ <tr>
+ <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
+ <td width="5%"/>
+ <td align="left">
+ <p><?php echo esc_html( $akismet_user->account_name ); ?></p>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
+ <td width="5%"/>
+ <td align="left">
+ <p><?php
+ if ( 'cancelled' == $akismet_user->status ) :
+ esc_html_e( 'Cancelled', 'akismet' );
+ elseif ( 'suspended' == $akismet_user->status ) :
+ esc_html_e( 'Suspended', 'akismet' );
+ elseif ( 'missing' == $akismet_user->status ) :
+ esc_html_e( 'Missing', 'akismet' );
+ elseif ( 'no-sub' == $akismet_user->status ) :
+ esc_html_e( 'No Subscription Found', 'akismet' );
+ else :
+ esc_html_e( 'Active', 'akismet' );
+ endif; ?></p>
+ </td>
+ </tr>
+ <?php if ( $akismet_user->next_billing_date ) : ?>
+ <tr>
+ <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
+ <td width="5%"/>
+ <td align="left">
+ <p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
+ </td>
+ </tr>
+ <?php endif; ?>
+ </tbody>
+ </table>
+ <div class="akismet-card-actions">
+ <div id="publishing-action">
+ <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
</div>
+ <div class="clear"></div>
</div>
</div>
</div>
-
<?php endif;?>
-
</div>
</div> \ No newline at end of file
diff --git a/plugins/akismet/views/get.php b/plugins/akismet/views/get.php
index 4bd6a9c5..c9dbf108 100644
--- a/plugins/akismet/views/get.php
+++ b/plugins/akismet/views/get.php
@@ -2,5 +2,5 @@
<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 ) ? $redirect : 'plugin-signup'; ?>"/>
- <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
+ <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button akismet-is-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
</form> \ No newline at end of file
diff --git a/plugins/akismet/views/notice.php b/plugins/akismet/views/notice.php
index 8e6e5080..e82f1685 100644
--- a/plugins/akismet/views/notice.php
+++ b/plugins/akismet/views/notice.php
@@ -5,10 +5,10 @@
<div class="aa_a">A</div>
<div class="aa_button_container">
<div class="aa_button_border">
- <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Activate your Akismet account', 'akismet' ); ?>" />
+ <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" />
</div>
</div>
- <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>
+ <div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div>
</div>
</form>
</div>
@@ -20,8 +20,6 @@
<p><?php echo $link_text; ?></p>
<?php } ?>
</div>
-<?php elseif ( $type == 'version' ) :?>
-<div id="akismet-warning" class="updated fade"><p><strong><?php printf( esc_html__('Akismet %s requires WordPress 3.0 or higher.', 'akismet'), AKISMET_VERSION);?></strong> <?php printf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');?></p></div>
<?php elseif ( $type == 'alert' ) :?>
<div class='error'>
<p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
@@ -35,88 +33,102 @@
</p>
</div>
<?php elseif ( $type == 'notice' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status failed"><?php echo $notice_header; ?></h3>
- <p class="description">
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status failed"><?php echo $notice_header; ?></h3>
+ <p class="akismet-description">
<?php echo $notice_text; ?>
</p>
</div>
<?php elseif ( $type == 'missing-functions' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
- <p class="description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;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&#8217;s system requirements</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;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&#8217;s system requirements</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
</div>
<?php elseif ( $type == 'servers-be-down' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
- <p class="description"><?php printf( __('Your firewall may be blocking Akismet. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('Your firewall may be blocking Akismet. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
</div>
<?php elseif ( $type == 'active-dunning' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
- <p class="description"><?php printf( __('We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
</div>
<?php elseif ( $type == 'cancelled' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
- <p class="description"><?php printf( __('Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
</div>
<?php elseif ( $type == 'suspended' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
- <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
</div>
<?php elseif ( $type == 'active-notice' && $time_saved ) :?>
-<div class="wrap alert active">
- <h3 class="key-status"><?php echo esc_html( $time_saved ); ?></h3>
- <p class="description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>
+<div class="akismet-alert akismet-active">
+ <h3 class="akismet-key-status"><?php echo esc_html( $time_saved ); ?></h3>
+ <p class="akismet-description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>
</div>
<?php elseif ( $type == 'missing' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
- <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
</div>
<?php elseif ( $type == 'no-sub' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
- <p class="description">
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
+ <p class="akismet-description">
<?php printf( __( 'In 2012, Akismet began using subscription plans for all accounts (even free ones). A plan has not been assigned to your account, and we&#8217;d appreciate it if you&#8217;d <a href="%s" target="_blank">sign into your account</a> and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>
<br /><br />
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
</p>
</div>
-<?php elseif ( $type == 'new-key-valid' ) :?>
-<div class="wrap alert active">
- <h3 class="key-status"><?php esc_html_e('Akismet is now activated. Happy blogging!', 'akismet'); ?></h3>
+<?php elseif ( $type == 'new-key-valid' ) :
+ global $wpdb;
+
+ $check_pending_link = false;
+
+ $at_least_one_comment_in_moderation = !! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" );
+
+ if ( $at_least_one_comment_in_moderation) {
+ $check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );
+ }
+
+ ?>
+<div class="akismet-alert akismet-active">
+ <h3 class="akismet-key-status"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3>
+ <?php if ( $check_pending_link ) { ?>
+ <p class="akismet-description"><?php printf( __( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p>
+ <?php } ?>
</div>
<?php elseif ( $type == 'new-key-invalid' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
</div>
<?php elseif ( $type == 'existing-key-invalid' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
</div>
<?php elseif ( $type == 'new-key-failed' ) :?>
-<div class="wrap alert critical">
- <h3 class="key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
- <p class="description"><?php printf( __('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/'); ?></p>
+<div class="akismet-alert akismet-critical">
+ <h3 class="akismet-key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
+ <p class="akismet-description"><?php printf( __('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/'); ?></p>
</div>
<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
-<div class="wrap alert critical">
+<div class="akismet-alert akismet-critical">
<?php if ( $level == 'yellow' ): ?>
- <h3 class="key-status failed"><?php esc_html_e( 'You&#8217;re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>
- <p class="description">
+ <h3 class="akismet-key-status failed"><?php esc_html_e( 'You&#8217;re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>
+ <p class="akismet-description">
<?php printf( __( 'Your Pro subscription allows the use of Akismet on only one site. Please <a href="%s" target="_blank">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'https://docs.akismet.com/billing/add-more-sites/' ); ?>
<br /><br />
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
</p>
<?php elseif ( $level == 'red' ): ?>
- <h3 class="key-status failed"><?php esc_html_e( 'You&#8217;re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>
- <p class="description">
- <?php printf( __( 'To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?></p>
+ <h3 class="akismet-key-status failed"><?php esc_html_e( 'You&#8217;re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>
+ <p class="akismet-description">
+ <?php printf( __( 'To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>
<br /><br />
- <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?></p>
+ <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
</p>
<?php endif; ?>
</div>
diff --git a/plugins/akismet/views/start.php b/plugins/akismet/views/start.php
index 751da6e6..d17b53dc 100644
--- a/plugins/akismet/views/start.php
+++ b/plugins/akismet/views/start.php
@@ -1,97 +1,93 @@
-<div class="no-key config-wrap"><?php
- if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
- if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) :?>
-<p><?php esc_html_e('Akismet eliminates spam from your site. Register below to get started.', 'akismet'); ?></p>
-<div class="activate-highlight activate-option">
- <div class="option-description">
- <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
- <?php echo esc_html( $akismet_user->user_email ); ?>
+<div id="akismet-plugin-container">
+ <div class="akismet-masthead">
+ <div class="akismet-masthead__inside-container">
+ <div class="akismet-masthead__logo-container">
+ <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
+ </div>
+ </div>
</div>
- <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="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="button button-primary" value="<?php esc_attr_e( 'Register for Akismet' , 'akismet'); ?>"/>
- </form>
-</div>
-<?php elseif ( $akismet_user->status == 'cancelled' ) :?>
-<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
-<div class="activate-highlight activate-option">
- <div class="option-description" style="width:75%;">
- <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
- <?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ) ); ?>
+ <div class="akismet-lower">
+ <?php Akismet_Admin::display_status(); ?>
+ <div class="akismet-box">
+ <h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
+ <p><?php esc_html_e( 'Select one of the options below to get started.', 'akismet' ); ?></p>
+ </div>
+ <div class="akismet-boxes">
+ <?php if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { ?>
+ <?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
+ <div class="akismet-box">
+ <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
+ <p><?php esc_html_e( 'Use your Jetpack connection to activate 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 echo sprintf( 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>
+ </div>
+ <?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
+ <div class="akismet-box">
+ <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
+ <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( 'Reactivate Akismet' , 'akismet' ); ?>"/>
+ </form>
+ <p><?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
+ </div>
+ <?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
+ <div class="centered akismet-box">
+ <h3><?php esc_html_e( 'Connected via Jetpack' , 'akismet' ); ?></h3>
+ <p class="akismet-alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
+ <p><?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?></p>
+ <p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
+ </div>
+ <?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
+ <div class="akismet-box">
+ <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
+ <p><?php esc_html_e( 'Use your Jetpack connection to activate 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 echo sprintf( 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>
+ </div>
+ <?php } ?>
+ <div class="akismet-box">
+ <h3><?php esc_html_e( 'Or sign up with a different email address', 'akismet' ); ?></h3>
+ <div class="akismet-right">
+ <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet' ), 'classes' => array( 'akismet-button' ) ) ); ?>
+ </div>
+ <p><?php esc_html_e( 'Choose this option to use Akismet independently of your Jetpack connection.', 'akismet' ); ?></p>
+ </div>
+ <?php } else { ?>
+ <div class="akismet-box">
+ <h3><?php esc_html_e( 'Activate Akismet' , 'akismet' );?></h3>
+ <div class="akismet-right">
+ <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
+ </div>
+ <p><?php esc_html_e( 'Log in or sign up now.', 'akismet' ); ?></p>
+ </div>
+ <?php } ?>
+ <div class="akismet-box">
+ <h3><?php esc_html_e( 'Or enter an API key', 'akismet' ); ?></h3>
+ <p><?php esc_html_e( 'Already have your key? Enter it here.', 'akismet' ); ?> <a href="https://docs.akismet.com/getting-started/api-key/" target="_blank"><?php esc_html_e( '(What is an API key?)', 'akismet' ); ?></a></p>
+ <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
+ <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
+ <input type="hidden" name="action" value="enter-key">
+ <p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
+ <input id="key" name="key" type="text" size="15" value="" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
+ <input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
+ </p>
+ </form>
+ </div>
</div>
- <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="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="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
- </form>
-</div>
-<?php elseif ( $akismet_user->status == 'suspended' ) : ?>
-<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
-<div class="activate-highlight centered activate-option">
- <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
- <h3 class="alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ) ); ?></h3>
- <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll sort this out.', 'akismet'); ?></p>
- <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
-</div>
-<?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
-<p style="margin-right:10px"><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
-<div class="activate-highlight activate-option">
- <div class="option-description">
- <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
- <?php echo esc_html( $akismet_user->user_email ); ?>
- </div>
- <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="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="button button-primary" value="<?php esc_attr_e( 'Use this account' , 'akismet'); ?>"/>
- </form>
-</div>
-<?php endif;?>
-<div class="activate-highlight secondary activate-option">
- <div class="option-description">
- <strong><?php esc_html_e('Sign up for a plan with a different email address', 'akismet'); ?></strong>
- <p><?php esc_html_e('Use this option to use Akismet independently of your Jetpack connection.', 'akismet'); ?></p>
- </div>
- <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
-</div>
-<div class="activate-highlight secondary activate-option">
- <div class="option-description">
- <strong><?php esc_html_e('Enter an API key', 'akismet'); ?></strong>
- <p><?php esc_html_e('Already have your key? Enter it here.', 'akismet'); ?></p>
- </div>
- <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
- <input id="key" name="key" type="text" size="15" value="" class="regular-text code">
- <input type="hidden" name="action" value="enter-key">
- <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
- <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
- </form>
-</div>
-<?php else :?>
-<p><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
-<div class="activate-highlight activate-option">
- <div class="option-description">
- <strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
- <p><?php esc_html_e('Log in or sign up now.', 'akismet'); ?></p>
- </div>
- <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
-</div>
-<div class="activate-highlight secondary activate-option">
- <div class="option-description">
- <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
- <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
- </div>
- <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
- <input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( Akismet::get_api_key() ); ?>" class="regular-text code">
- <input type="hidden" name="action" value="enter-key">
- <?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
- <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
- </form>
-</div><?php
- endif;?>
</div> \ No newline at end of file
diff --git a/plugins/akismet/views/stats.php b/plugins/akismet/views/stats.php
index a536f3a0..2302c11a 100644
--- a/plugins/akismet/views/stats.php
+++ b/plugins/akismet/views/stats.php
@@ -1,4 +1,11 @@
-<div class="wrap">
- <h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
- <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
+<div id="akismet-plugin-container">
+ <div class="akismet-masthead">
+ <div class="akismet-masthead__inside-container">
+ <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="akismet-right"><?php esc_html_e( 'Akismet Settings' , 'akismet' ); ?></a>
+ <div class="akismet-masthead__logo-container">
+ <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
+ </div>
+ </div>
+ </div>
+ <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
</div> \ No newline at end of file
diff --git a/plugins/akismet/views/strict.php b/plugins/akismet/views/strict.php
deleted file mode 100644
index 83d7a505..00000000
--- a/plugins/akismet/views/strict.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<fieldset>
- <legend class="screen-reader-text">
- <span><?php esc_html_e( 'Akismet anti-spam strictness', 'akismet' ); ?></span>
- </legend>
- <p>
- <label for="akismet_strictness_1">
- <input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
- <?php esc_html_e( 'Strict: silently discard the worst and most pervasive spam.', 'akismet' ); ?>
- </label>
- </p>
- <p>
- <label for="akismet_strictness_0">
- <input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
- <?php esc_html_e( 'Safe: always put spam in the Spam folder for review.', 'akismet' ); ?>
- </label>
- </p>
-</fieldset>
diff --git a/plugins/akismet/wrapper.php b/plugins/akismet/wrapper.php
index a77d4ce9..f687e099 100644
--- a/plugins/akismet/wrapper.php
+++ b/plugins/akismet/wrapper.php
@@ -175,7 +175,7 @@ function akismet_get_ip_address() {
function akismet_cron_recheck() {
return Akismet::cron_recheck();
}
-function akismet_add_comment_nonce() {
+function akismet_add_comment_nonce( $post_id ) {
return Akismet::add_comment_nonce( $post_id );
}
function akismet_fix_scheduled_recheck() {