Akismet Anti-Spam - Version 3.1.9

Version Description

Release Date - 28 March 2016

  • Add compatibility with Jetpack so that Jetpack can automatically configure Akismet settings when appropriate.
  • Fixed a bug preventing some comment data from being sent to Akismet.
Download this release

Release Info

Developer cfinke
Plugin Icon 128x128 Akismet Anti-Spam
Version 3.1.9
Comparing to
See all releases

Code changes from version 3.1.8 to 3.1.9

Files changed (3) hide show
  1. akismet.php +2 -2
  2. class.akismet.php +37 -2
  3. readme.txt +7 -1
akismet.php CHANGED
@@ -6,7 +6,7 @@
6
  Plugin Name: Akismet
7
  Plugin URI: http://akismet.com/
8
  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.
9
- Version: 3.1.8
10
  Author: Automattic
11
  Author URI: http://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
@@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
37
  exit;
38
  }
39
 
40
- define( 'AKISMET_VERSION', '3.1.8' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.2' );
42
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
43
  define( 'AKISMET_DELETE_LIMIT', 100000 );
6
  Plugin Name: Akismet
7
  Plugin URI: http://akismet.com/
8
  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.
9
+ Version: 3.1.9
10
  Author: Automattic
11
  Author URI: http://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
37
  exit;
38
  }
39
 
40
+ define( 'AKISMET_VERSION', '3.1.9' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.2' );
42
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
43
  define( 'AKISMET_DELETE_LIMIT', 100000 );
class.akismet.php CHANGED
@@ -53,6 +53,10 @@ class Akismet {
53
 
54
  // Run this early in the pingback call, before doing a remote fetch of the source uri
55
  add_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) );
 
 
 
 
56
  }
57
 
58
  public static function get_api_key() {
@@ -81,6 +85,37 @@ class Akismet {
81
  return $response[1];
82
  }
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  public static function auto_check_comment( $commentdata ) {
85
  self::$last_comment_result = null;
86
 
@@ -130,7 +165,7 @@ class Akismet {
130
 
131
  // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
132
  if ( preg_match( "/^(HTTP_|REMOTE_ADDR|REQUEST_URI|DOCUMENT_URI)/", $key ) ) {
133
- $form[ "$key" ] = $value;
134
  }
135
  }
136
 
@@ -1164,4 +1199,4 @@ p {
1164
 
1165
  return $meta_value;
1166
  }
1167
- }
53
 
54
  // Run this early in the pingback call, before doing a remote fetch of the source uri
55
  add_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) );
56
+
57
+ // Jetpack compatibility
58
+ add_filter( 'jetpack_options_whitelist', array( 'Akismet', 'add_to_jetpack_options_whitelist' ) );
59
+ add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 );
60
  }
61
 
62
  public static function get_api_key() {
85
  return $response[1];
86
  }
87
 
88
+ /**
89
+ * Add the akismet option to the Jetpack options management whitelist.
90
+ *
91
+ * @param array $options The list of whitelisted option names.
92
+ * @return array The updated whitelist
93
+ */
94
+ public static function add_to_jetpack_options_whitelist( $options ) {
95
+ $options[] = 'wordpress_api_key';
96
+ return $options;
97
+ }
98
+
99
+ /**
100
+ * When the akismet option is updated, run the registration call.
101
+ *
102
+ * This should only be run when the option is updated from the Jetpack/WP.com
103
+ * API call, and only if the new key is different than the old key.
104
+ *
105
+ * @param mixed $old_value The old option value.
106
+ * @param mixed $value The new option value.
107
+ */
108
+ function updated_option( $old_value, $value ) {
109
+ // Not an API call
110
+ if ( ! class_exists( 'WPCOM_JSON_API_Update_Option_Endpoint' ) ) {
111
+ return;
112
+ }
113
+ // Only run the registration if the old key is different.
114
+ if ( $old_value !== $value ) {
115
+ self::verify_key( $value );
116
+ }
117
+ }
118
+
119
  public static function auto_check_comment( $commentdata ) {
120
  self::$last_comment_result = null;
121
 
165
 
166
  // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
167
  if ( preg_match( "/^(HTTP_|REMOTE_ADDR|REQUEST_URI|DOCUMENT_URI)/", $key ) ) {
168
+ $comment[ "$key" ] = $value;
169
  }
170
  }
171
 
1199
 
1200
  return $meta_value;
1201
  }
1202
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo
3
  Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
4
  Requires at least: 3.2
5
  Tested up to: 4.4.1
6
- Stable tag: 3.1.8
7
  License: GPLv2 or later
8
 
9
  Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
@@ -30,6 +30,12 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
 
33
  = 3.1.8 =
34
  *Release Date - 4 March 2016*
35
 
3
  Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
4
  Requires at least: 3.2
5
  Tested up to: 4.4.1
6
+ Stable tag: 3.1.9
7
  License: GPLv2 or later
8
 
9
  Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
30
 
31
  == Changelog ==
32
 
33
+ = 3.1.9 =
34
+ *Release Date - 28 March 2016*
35
+
36
+ * Add compatibility with Jetpack so that Jetpack can automatically configure Akismet settings when appropriate.
37
+ * Fixed a bug preventing some comment data from being sent to Akismet.
38
+
39
  = 3.1.8 =
40
  *Release Date - 4 March 2016*
41