From d7ae460ed642e717f79ab028c27f13e5f1b71167 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Wed, 18 May 2016 07:31:37 -0400 Subject: Update plugin akismet to 3.1.11 --- plugins/akismet/.htaccess | 4 ++-- plugins/akismet/_inc/akismet.js | 3 ++- plugins/akismet/akismet.php | 10 +++++----- plugins/akismet/class.akismet-admin.php | 13 +++++++++++-- plugins/akismet/class.akismet-widget.php | 2 +- plugins/akismet/class.akismet.php | 20 ++++++++++++++------ plugins/akismet/readme.txt | 16 ++++++++++++---- plugins/akismet/views/notice.php | 8 ++++---- 8 files changed, 51 insertions(+), 25 deletions(-) (limited to 'plugins') diff --git a/plugins/akismet/.htaccess b/plugins/akismet/.htaccess index f271986e..49d72d71 100644 --- a/plugins/akismet/.htaccess +++ b/plugins/akismet/.htaccess @@ -12,7 +12,7 @@ # Akismet CSS and JS - + Allow from all @@ -23,7 +23,7 @@ # Akismet images - + Allow from all diff --git a/plugins/akismet/_inc/akismet.js b/plugins/akismet/_inc/akismet.js index 101db40f..246c8581 100644 --- a/plugins/akismet/_inc/akismet.js +++ b/plugins/akismet/_inc/akismet.js @@ -181,7 +181,8 @@ jQuery( function ( $ ) { window.location.reload(); } else { - akismet_check_for_spam(offset + limit, limit); + // Account for comments that were caught as spam and moved out of the queue. + akismet_check_for_spam(offset + limit - result.counts.spam, limit); } } ); diff --git a/plugins/akismet/akismet.php b/plugins/akismet/akismet.php index a4807c9c..a65a0d65 100644 --- a/plugins/akismet/akismet.php +++ b/plugins/akismet/akismet.php @@ -4,11 +4,11 @@ */ /* Plugin Name: Akismet -Plugin URI: http://akismet.com/ -Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. It keeps your site protected even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) Sign up for an Akismet plan to get an API key, and 3) Go to your Akismet configuration page, and save your API key. -Version: 3.1.10 +Plugin URI: https://akismet.com/ +Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. It keeps your site protected even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) Sign up for an Akismet plan to get an API key, and 3) Go to your Akismet configuration page, and save your API key. +Version: 3.1.11 Author: Automattic -Author URI: http://automattic.com/wordpress-plugins/ +Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ @@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) { exit; } -define( 'AKISMET_VERSION', '3.1.10' ); +define( 'AKISMET_VERSION', '3.1.11' ); define( 'AKISMET__MINIMUM_WP_VERSION', '3.2' ); 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 08d67701..c9e82eb0 100644 --- a/plugins/akismet/class.akismet-admin.php +++ b/plugins/akismet/class.akismet-admin.php @@ -366,6 +366,12 @@ class Akismet_Admin { } $moderation = $wpdb->get_results( "SELECT * FROM {$wpdb->comments} WHERE comment_approved = '0'{$paginate}", ARRAY_A ); + $result_counts = array( + 'spam' => 0, + 'ham' => 0, + 'error' => 0, + ); + foreach ( (array) $moderation as $c ) { $c['user_ip'] = $c['comment_author_IP']; $c['user_agent'] = $c['comment_agent']; @@ -392,14 +398,15 @@ class Akismet_Admin { delete_comment_meta( $c['comment_ID'], 'akismet_error' ); delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' ); Akismet::update_comment_history( $c['comment_ID'], '', 'recheck-spam' ); - + ++$result_counts['spam']; } elseif ( 'false' == $response[1] ) { update_comment_meta( $c['comment_ID'], 'akismet_result', 'false' ); delete_comment_meta( $c['comment_ID'], 'akismet_error' ); delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' ); Akismet::update_comment_history( $c['comment_ID'], '', 'recheck-ham' ); - // abnormal result: error + ++$result_counts['ham']; } else { + // abnormal result: error update_comment_meta( $c['comment_ID'], 'akismet_result', 'error' ); Akismet::update_comment_history( $c['comment_ID'], @@ -407,6 +414,7 @@ class Akismet_Admin { 'recheck-error', array( 'response' => substr( $response[1], 0, 50 ) ) ); + ++$result_counts['error']; } delete_comment_meta( $c['comment_ID'], 'akismet_rechecking' ); @@ -414,6 +422,7 @@ class Akismet_Admin { if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { wp_send_json( array( 'processed' => count((array) $moderation), + 'counts' => $result_counts, )); } else { diff --git a/plugins/akismet/class.akismet-widget.php b/plugins/akismet/class.akismet-widget.php index a60ae603..a2c4f303 100644 --- a/plugins/akismet/class.akismet-widget.php +++ b/plugins/akismet/class.akismet-widget.php @@ -95,7 +95,7 @@ class Akismet_Widget extends WP_Widget { ?> comment_ID ); @@ -824,8 +825,13 @@ class Akismet { // filter handler used to return a spam result to pre_comment_approved public static function last_comment_status( $approved, $comment ) { + if ( is_null( self::$last_comment_result ) ) { + // We didn't have reason to store the result of the last check. + return $approved; + } + // Only do this if it's the correct comment - if ( is_null(self::$last_comment_result) || ! self::matches_last_comment( $comment ) ) { + if ( ! self::matches_last_comment( $comment ) ) { self::log( "comment_is_spam mismatched comment, returning unaltered $approved" ); return $approved; } @@ -1087,7 +1093,7 @@ p { if ( version_compare( $GLOBALS['wp_version'], AKISMET__MINIMUM_WP_VERSION, '<' ) ) { load_plugin_textdomain( 'akismet' ); - $message = ''.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).' '.sprintf(__('Please upgrade WordPress to a current version, or downgrade to version 2.4 of the Akismet plugin.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'); + $message = ''.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).' '.sprintf(__('Please upgrade WordPress to a current version, or downgrade to version 2.4 of the Akismet plugin.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/'); Akismet::bail_on_activation( $message ); } @@ -1114,12 +1120,14 @@ p { /** * Log debugging info to the error log. * - * Enabled when WP_DEBUG_LOG is enabled, but can be disabled via the akismet_debug_log filter. + * Enabled when WP_DEBUG_LOG is enabled (and WP_DEBUG, since according to + * core, "WP_DEBUG_DISPLAY and WP_DEBUG_LOG perform no function unless + * WP_DEBUG is true), but can be disabled via the akismet_debug_log filter. * * @param mixed $akismet_debug The data to log. */ public static function log( $akismet_debug ) { - if ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ) { + if ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ) { error_log( print_r( compact( 'akismet_debug' ), true ) ); } } diff --git a/plugins/akismet/readme.txt b/plugins/akismet/readme.txt index 01197dc9..9be516de 100644 --- a/plugins/akismet/readme.txt +++ b/plugins/akismet/readme.txt @@ -2,8 +2,8 @@ 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.2 -Tested up to: 4.5 -Stable tag: 3.1.10 +Tested up to: 4.5.2 +Stable tag: 3.1.11 License: GPLv2 or later Akismet checks your comments against the Akismet Web service to see if they look like spam or not. @@ -20,16 +20,24 @@ Major features in Akismet include: * Moderators can see the number of approved comments for each user. * A discard feature that outright blocks the worst spam, saving you disk space and speeding up your site. -PS: You'll need an [Akismet.com API key](http://akismet.com/get/) to use it. Keys are free for personal blogs; paid subscriptions are available for businesses and commercial sites. +PS: You'll need an [Akismet.com API key](https://akismet.com/get/) to use it. Keys are free for personal blogs; paid subscriptions are available for businesses and commercial sites. == Installation == -Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.com API key](http://akismet.com/get/). +Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.com API key](https://akismet.com/get/). 1, 2, 3: You're done! == Changelog == += 3.1.11 = +*Release Date - 12 May 2016* + +* Fixed a bug that could cause the "Check for Spam" button to skip some comments. +* Fixed a bug that could prevent some spam submissions from being sent to Akismet. +* Updated all links to use https:// when possible. +* Disabled Akismet debug logging unless WP_DEBUG and WP_DEBUG_LOG are both enabled. + = 3.1.10 = *Release Date - 1 April 2016* diff --git a/plugins/akismet/views/notice.php b/plugins/akismet/views/notice.php index fc8bc183..8e6e5080 100644 --- a/plugins/akismet/views/notice.php +++ b/plugins/akismet/views/notice.php @@ -44,12 +44,12 @@

-

gethostbynamel function. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet’s system requirements.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

+

gethostbynamel function. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet’s system requirements.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>

-

our guide about firewalls.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

+

our guide about firewalls.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>

@@ -100,14 +100,14 @@

-

our guide about firewalls and check your server configuration.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

+

our guide about firewalls and check your server configuration.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>

- purchase additional Pro subscriptions or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'http://docs.akismet.com/billing/add-more-sites/' ); ?> + purchase additional Pro subscriptions or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'https://docs.akismet.com/billing/add-more-sites/' ); ?>

contact our support team with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>

-- cgit v1.2.3