diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2016-05-18 07:31:37 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-05-18 07:31:37 -0400 |
commit | d7ae460ed642e717f79ab028c27f13e5f1b71167 (patch) | |
tree | c6c1cb0b1f2a3901a4e4a22fe15873832671a0d4 /plugins/akismet | |
parent | Update plugin wordpress-mobile-pack to 2.2.3 (diff) | |
download | blogs-gentoo-d7ae460ed642e717f79ab028c27f13e5f1b71167.tar.gz blogs-gentoo-d7ae460ed642e717f79ab028c27f13e5f1b71167.tar.bz2 blogs-gentoo-d7ae460ed642e717f79ab028c27f13e5f1b71167.zip |
Update plugin akismet to 3.1.11
Diffstat (limited to 'plugins/akismet')
-rw-r--r-- | plugins/akismet/.htaccess | 4 | ||||
-rw-r--r-- | plugins/akismet/_inc/akismet.js | 3 | ||||
-rw-r--r-- | plugins/akismet/akismet.php | 10 | ||||
-rw-r--r-- | plugins/akismet/class.akismet-admin.php | 13 | ||||
-rw-r--r-- | plugins/akismet/class.akismet-widget.php | 2 | ||||
-rw-r--r-- | plugins/akismet/class.akismet.php | 20 | ||||
-rw-r--r-- | plugins/akismet/readme.txt | 16 | ||||
-rw-r--r-- | plugins/akismet/views/notice.php | 8 |
8 files changed, 51 insertions, 25 deletions
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 @@ </IfModule> # Akismet CSS and JS -<FilesMatch "^(form|akismet)\.(css|js)$"> +<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$"> <IfModule !mod_authz_core.c> Allow from all </IfModule> @@ -23,7 +23,7 @@ </FilesMatch> # Akismet images -<FilesMatch "^(.+)\.(png|gif)$"> +<FilesMatch "^logo-full-2x\.png$"> <IfModule !mod_authz_core.c> Allow from all </IfModule> 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 <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="http://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.1.10 +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.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 { ?> <div class="a-stats"> - <a href="http://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a> + <a href="https://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a> </div> <?php diff --git a/plugins/akismet/class.akismet.php b/plugins/akismet/class.akismet.php index c81d70d0..2e8a3493 100644 --- a/plugins/akismet/class.akismet.php +++ b/plugins/akismet/class.akismet.php @@ -505,8 +505,9 @@ class Akismet { ( isset( $_POST['spam'] ) && (int) $_POST['spam'] == 1 ) || ( isset( $_POST['unspam'] ) && (int) $_POST['unspam'] == 1 ) || ( isset( $_POST['comment_status'] ) && in_array( $_POST['comment_status'], array( 'spam', 'unspam' ) ) ) || - ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'spam', 'unspam' ) ) ) || - ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'editedcomment' ) ) ) + ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'spam', 'unspam', 'spamcomment', 'unspamcomment', ) ) ) || + ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'editedcomment' ) ) ) || + ( isset( $_GET['for'] ) && ( 'jetpack' == $_GET['for'] ) ) // Moderation via WP.com notifications/WP app/etc. ) { if ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) { return self::submit_spam_comment( $comment->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 = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('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', 'http://wordpress.org/extend/plugins/akismet/download/'); + $message = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('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/'); 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 @@ <?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’s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet’s system requirements</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p> + <p class="description"><?php printf( __('Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet’s system requirements</a>.', 'akismet'), '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’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'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p> + <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> <?php elseif ( $type == 'active-dunning' ) :?> <div class="wrap alert critical"> @@ -100,14 +100,14 @@ <?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'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p> + <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> <?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?> <div class="wrap alert critical"> <?php if ( $level == 'yellow' ): ?> <h3 class="key-status failed"><?php esc_html_e( 'You’re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3> <p class="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' ), 'http://docs.akismet.com/billing/add-more-sites/' ); ?> + <?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> |