Akismet Anti-Spam - Version 3.0.3

Version Description

Release Date - 3rd November, 2014

  • Fix for sending the wrong data to delete_comment action that could have prevented old spam comments from being deleted.
  • Added a filter to disable logging of Akismet debugging information.
  • Added a filter for the maximum comment age when deleting old spam comments.
  • Added a filter for the number per batch when deleting old spam comments.
  • Removed the "Check for Spam" button from the Spam folder.
Download this release

Release Info

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

Code changes from version 3.0.2 to 3.0.3

Files changed (5) hide show
  1. akismet.php +2 -2
  2. class.akismet-admin.php +4 -0
  3. class.akismet.php +30 -4
  4. readme.txt +43 -1
  5. views/notice.php +3 -3
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 comment and trackback spam</strong>. It keeps your site protected from spam 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 API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
9
- Version: 3.0.2
10
  Author: Automattic
11
  Author URI: http://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
@@ -35,7 +35,7 @@ if ( !function_exists( 'add_action' ) ) {
35
  exit;
36
  }
37
 
38
- define( 'AKISMET_VERSION', '3.0.2' );
39
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.1' );
40
  define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
41
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
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 comment and trackback spam</strong>. It keeps your site protected from spam 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 API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
9
+ Version: 3.0.3
10
  Author: Automattic
11
  Author URI: http://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
35
  exit;
36
  }
37
 
38
+ define( 'AKISMET_VERSION', '3.0.3' );
39
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.1' );
40
  define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
41
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
class.akismet-admin.php CHANGED
@@ -327,6 +327,10 @@ class Akismet_Admin {
327
  if ( 'approved' == $comment_status )
328
  return;
329
 
 
 
 
 
330
  if ( function_exists('plugins_url') )
331
  $link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) );
332
  else
327
  if ( 'approved' == $comment_status )
328
  return;
329
 
330
+ if ( 'spam' == $comment_status ) {
331
+ return;
332
+ }
333
+
334
  if ( function_exists('plugins_url') )
335
  $link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) );
336
  else
class.akismet.php CHANGED
@@ -256,13 +256,31 @@ class Akismet {
256
  public static function delete_old_comments() {
257
  global $wpdb;
258
 
259
- while( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 ) ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  if ( empty( $comment_ids ) )
261
  return;
262
 
263
  $wpdb->queries = array();
264
 
265
- do_action( 'delete_comment', $comment_ids );
 
 
266
 
267
  $comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
268
 
@@ -926,8 +944,16 @@ p {
926
  return _http_build_query( $args, '', '&' );
927
  }
928
 
 
 
 
 
 
 
 
929
  public static function log( $akismet_debug ) {
930
- if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG )
931
- error_log( print_r( compact( 'akismet_debug' ), 1 ) ); //send message to debug.log when in debug mode
 
932
  }
933
  }
256
  public static function delete_old_comments() {
257
  global $wpdb;
258
 
259
+ /**
260
+ * Determines how many comments will be deleted in each batch.
261
+ *
262
+ * @param int The default, as defined by AKISMET_DELETE_LIMIT.
263
+ */
264
+ $delete_limit = apply_filters( 'akismet_delete_comment_limit', defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 );
265
+ $delete_limit = max( 1, intval( $delete_limit ) );
266
+
267
+ /**
268
+ * Determines how many days a comment will be left in the Spam queue before being deleted.
269
+ *
270
+ * @param int The default number of days.
271
+ */
272
+ $delete_interval = apply_filters( 'akismet_delete_comment_interval', 15 );
273
+ $delete_interval = max( 1, intval( $delete_interval ) );
274
+
275
+ while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL %d DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", $delete_interval, $delete_limit ) ) ) {
276
  if ( empty( $comment_ids ) )
277
  return;
278
 
279
  $wpdb->queries = array();
280
 
281
+ foreach ( $comment_ids as $comment_id ) {
282
+ do_action( 'delete_comment', $comment_id );
283
+ }
284
 
285
  $comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
286
 
944
  return _http_build_query( $args, '', '&' );
945
  }
946
 
947
+ /**
948
+ * Log debugging info to the error log.
949
+ *
950
+ * Enabled when WP_DEBUG_LOG is enabled, but can be disabled via the akismet_debug_log filter.
951
+ *
952
+ * @param mixed $akismet_debug The data to log.
953
+ */
954
  public static function log( $akismet_debug ) {
955
+ if ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ) {
956
+ error_log( print_r( compact( 'akismet_debug' ), true ) );
957
+ }
958
  }
959
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo
3
  Tags: akismet, comments, spam
4
  Requires at least: 3.1
5
  Tested up to: 4.0
6
- Stable tag: 3.0.2
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,11 +30,24 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
 
 
 
 
33
  = 3.0.2 =
 
 
34
  * Performance improvements.
35
  * Fixed a bug that could truncate the comment data being sent to Akismet for checking.
36
 
37
  = 3.0.1 =
 
 
38
  * Removed dependency on PHP's fsockopen function
39
  * Fix spam/ham reports to work when reported outside of the WP dashboard, e.g., from Notifications or the WP app
40
  * Remove jQuery dependency for comment form JavaScript
@@ -42,6 +55,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
42
  * Suspended keys will now result in all comments being put in moderation, not spam.
43
 
44
  = 3.0.0 =
 
 
45
  * Move Akismet to Settings menu
46
  * Drop Akismet Stats menu
47
  * Add stats snapshot to Akismet settings
@@ -55,6 +70,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
55
  * Replace the old discard setting with a new "discard pervasive spam" feature.
56
 
57
  = 2.6.0 =
 
 
58
  * Add ajax paging to the check for spam button to handle large volumes of comments
59
  * Optimize javascript and add localization support
60
  * Fix bug in link to spam comments from right now dashboard widget
@@ -63,16 +80,22 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
63
  * Add pre-check for pingbacks, to stop spam before an outbound verification request is made
64
 
65
  = 2.5.9 =
 
 
66
  * Update 'Already have a key' link to redirect page rather than depend on javascript
67
  * Fix some non-translatable strings to be translatable
68
  * Update Activation banner in plugins page to redirect user to Akismet config page
69
 
70
  = 2.5.8 =
 
 
71
  * Simplify the activation process for new users
72
  * Remove the reporter_ip parameter
73
  * Minor preventative security improvements
74
 
75
  = 2.5.7 =
 
 
76
  * FireFox Stats iframe preview bug
77
  * Fix mshots preview when using https
78
  * Add .htaccess to block direct access to files
@@ -82,6 +105,8 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
82
  * Fix prepare() warnings in WP 3.5
83
 
84
  = 2.5.6 =
 
 
85
  * Prevent retry scheduling problems on sites where wp_cron is misbehaving
86
  * Preload mshot previews
87
  * Modernize the widget code
@@ -93,10 +118,14 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
93
  * Improve error messages when verifying an API key
94
 
95
  = 2.5.5 =
 
 
96
  * Add nonce check for comment author URL remove action
97
  * Fix the settings link
98
 
99
  = 2.5.4 =
 
 
100
  * Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
101
  * Added author URL quick removal functionality
102
  * Added mShot preview on Author URL hover
@@ -105,11 +134,14 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
105
  * Purge old Akismet comment meta data, default of 15 days
106
 
107
  = 2.5.3 =
 
 
108
  * Specify the license is GPL v2 or later
109
  * Fix a bug that could result in orphaned commentmeta entries
110
  * Include hotfix for WordPress 3.0.5 filter issue
111
 
112
  = 2.5.2 =
 
113
 
114
  * Properly format the comment count for author counts
115
  * Look for super admins on multisite installs when looking up user roles
@@ -119,6 +151,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
119
  * Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
120
 
121
  = 2.5.1 =
 
122
 
123
  * Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
124
  * Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
@@ -137,6 +170,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
137
  * Hid "flagged by..." notification while on dashboard
138
 
139
  = 2.5.0 =
 
140
 
141
  * Track comment actions under 'Akismet Status' on the edit comment screen
142
  * Fix a few remaining deprecated function calls ( props Mike Glendinning )
@@ -152,6 +186,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
152
  * New option, "Use a nonce on the comment form."
153
 
154
  = 2.4.0 =
 
155
 
156
  * Spell out that the license is GPLv2
157
  * Fix PHP warnings
@@ -161,6 +196,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
161
  * General code clean up
162
 
163
  = 2.3.0 =
 
164
 
165
  * Fix "Are you sure" nonce message on config screen in WPMU
166
  * Fix XHTML compliance issue in sidebar widget
@@ -168,10 +204,12 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
168
  * Localize the widget title (core ticket #13879)
169
 
170
  = 2.2.9 =
 
171
 
172
  * Eliminate a potential conflict with some plugins that may cause spurious reports
173
 
174
  = 2.2.8 =
 
175
 
176
  * Fix bug in initial comment check for ipv6 addresses
177
  * Report comments as ham when they are moved from spam to moderation
@@ -181,12 +219,14 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
181
  * Better handling of comments by logged-in users
182
 
183
  = 2.2.7 =
 
184
 
185
  * Add a new AKISMET_VERSION constant
186
  * Reduce the possibility of over-counting spam when another spam filter plugin is in use
187
  * Disable the connectivity check when the API key is hard-coded for WPMU
188
 
189
  = 2.2.6 =
 
190
 
191
  * Fix a global warning introduced in 2.2.5
192
  * Add changelog and additional readme.txt tags
@@ -194,10 +234,12 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
194
  * Support a new WPCOM_API_KEY constant for easier use with WordPress MU
195
 
196
  = 2.2.5 =
 
197
 
198
  * Include a new Server Connectivity diagnostic check, to detect problems caused by firewalls
199
 
200
  = 2.2.4 =
 
201
 
202
  * Fixed a key problem affecting the stats feature in WordPress MU
203
  * Provide additional blog information in Akismet API calls
3
  Tags: akismet, comments, spam
4
  Requires at least: 3.1
5
  Tested up to: 4.0
6
+ Stable tag: 3.0.3
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.0.3 =
34
+ *Release Date - 3rd November, 2014*
35
+
36
+ * Fix for sending the wrong data to delete_comment action that could have prevented old spam comments from being deleted.
37
+ * Added a filter to disable logging of Akismet debugging information.
38
+ * Added a filter for the maximum comment age when deleting old spam comments.
39
+ * Added a filter for the number per batch when deleting old spam comments.
40
+ * Removed the "Check for Spam" button from the Spam folder.
41
+
42
  = 3.0.2 =
43
+ *Release Date - 18th August, 2014*
44
+
45
  * Performance improvements.
46
  * Fixed a bug that could truncate the comment data being sent to Akismet for checking.
47
 
48
  = 3.0.1 =
49
+ *Release Date - 9th July, 2014*
50
+
51
  * Removed dependency on PHP's fsockopen function
52
  * Fix spam/ham reports to work when reported outside of the WP dashboard, e.g., from Notifications or the WP app
53
  * Remove jQuery dependency for comment form JavaScript
55
  * Suspended keys will now result in all comments being put in moderation, not spam.
56
 
57
  = 3.0.0 =
58
+ *Release Date - 15th April, 2014*
59
+
60
  * Move Akismet to Settings menu
61
  * Drop Akismet Stats menu
62
  * Add stats snapshot to Akismet settings
70
  * Replace the old discard setting with a new "discard pervasive spam" feature.
71
 
72
  = 2.6.0 =
73
+ *Release Date - 18th March, 2014*
74
+
75
  * Add ajax paging to the check for spam button to handle large volumes of comments
76
  * Optimize javascript and add localization support
77
  * Fix bug in link to spam comments from right now dashboard widget
80
  * Add pre-check for pingbacks, to stop spam before an outbound verification request is made
81
 
82
  = 2.5.9 =
83
+ *Release Date - 1st August, 2013*
84
+
85
  * Update 'Already have a key' link to redirect page rather than depend on javascript
86
  * Fix some non-translatable strings to be translatable
87
  * Update Activation banner in plugins page to redirect user to Akismet config page
88
 
89
  = 2.5.8 =
90
+ *Release Date - 20th January, 2013*
91
+
92
  * Simplify the activation process for new users
93
  * Remove the reporter_ip parameter
94
  * Minor preventative security improvements
95
 
96
  = 2.5.7 =
97
+ *Release Date - 13th December, 2012*
98
+
99
  * FireFox Stats iframe preview bug
100
  * Fix mshots preview when using https
101
  * Add .htaccess to block direct access to files
105
  * Fix prepare() warnings in WP 3.5
106
 
107
  = 2.5.6 =
108
+ *Release Date - 26th April, 2012*
109
+
110
  * Prevent retry scheduling problems on sites where wp_cron is misbehaving
111
  * Preload mshot previews
112
  * Modernize the widget code
118
  * Improve error messages when verifying an API key
119
 
120
  = 2.5.5 =
121
+ *Release Date - 11th January, 2012*
122
+
123
  * Add nonce check for comment author URL remove action
124
  * Fix the settings link
125
 
126
  = 2.5.4 =
127
+ *Release Date - 5th January, 2012*
128
+
129
  * Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
130
  * Added author URL quick removal functionality
131
  * Added mShot preview on Author URL hover
134
  * Purge old Akismet comment meta data, default of 15 days
135
 
136
  = 2.5.3 =
137
+ *Release Date - 8th Febuary, 2011*
138
+
139
  * Specify the license is GPL v2 or later
140
  * Fix a bug that could result in orphaned commentmeta entries
141
  * Include hotfix for WordPress 3.0.5 filter issue
142
 
143
  = 2.5.2 =
144
+ *Release Date - 14th January, 2011*
145
 
146
  * Properly format the comment count for author counts
147
  * Look for super admins on multisite installs when looking up user roles
151
  * Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
152
 
153
  = 2.5.1 =
154
+ *Release Date - 17th December, 2010*
155
 
156
  * Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
157
  * Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
170
  * Hid "flagged by..." notification while on dashboard
171
 
172
  = 2.5.0 =
173
+ *Release Date - 7th December, 2010*
174
 
175
  * Track comment actions under 'Akismet Status' on the edit comment screen
176
  * Fix a few remaining deprecated function calls ( props Mike Glendinning )
186
  * New option, "Use a nonce on the comment form."
187
 
188
  = 2.4.0 =
189
+ *Release Date - 23rd August, 2010*
190
 
191
  * Spell out that the license is GPLv2
192
  * Fix PHP warnings
196
  * General code clean up
197
 
198
  = 2.3.0 =
199
+ *Release Date - 5th June, 2010*
200
 
201
  * Fix "Are you sure" nonce message on config screen in WPMU
202
  * Fix XHTML compliance issue in sidebar widget
204
  * Localize the widget title (core ticket #13879)
205
 
206
  = 2.2.9 =
207
+ *Release Date - 2nd June, 2010*
208
 
209
  * Eliminate a potential conflict with some plugins that may cause spurious reports
210
 
211
  = 2.2.8 =
212
+ *Release Date - 27th May, 2010*
213
 
214
  * Fix bug in initial comment check for ipv6 addresses
215
  * Report comments as ham when they are moved from spam to moderation
219
  * Better handling of comments by logged-in users
220
 
221
  = 2.2.7 =
222
+ *Release Date - 17th December, 2009*
223
 
224
  * Add a new AKISMET_VERSION constant
225
  * Reduce the possibility of over-counting spam when another spam filter plugin is in use
226
  * Disable the connectivity check when the API key is hard-coded for WPMU
227
 
228
  = 2.2.6 =
229
+ *Release Date - 20th July, 2009*
230
 
231
  * Fix a global warning introduced in 2.2.5
232
  * Add changelog and additional readme.txt tags
234
  * Support a new WPCOM_API_KEY constant for easier use with WordPress MU
235
 
236
  = 2.2.5 =
237
+ *Release Date - 13th July, 2009*
238
 
239
  * Include a new Server Connectivity diagnostic check, to detect problems caused by firewalls
240
 
241
  = 2.2.4 =
242
+ *Release Date - 3rd June, 2009*
243
 
244
  * Fixed a key problem affecting the stats feature in WordPress MU
245
  * Provide additional blog information in Akismet API calls
views/notice.php CHANGED
@@ -40,12 +40,12 @@
40
  <?php elseif ( $type == 'missing-functions' ) :?>
41
  <div class="wrap alert critical">
42
  <h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
43
- <p class="description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;s <code>gethostbynamel</code> functions. <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>
44
  </div>
45
  <?php elseif ( $type == 'servers-be-down' ) :?>
46
  <div class="wrap alert critical">
47
  <h3 class="key-status failed"><?php esc_html_e("We can&#8217;t connect to your site.", 'akismet'); ?></h3>
48
- <p class="description"><?php printf( __('Your firewall may be blocking us. 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>
49
  </div>
50
  <?php elseif ( $type == 'active-dunning' ) :?>
51
  <div class="wrap alert critical">
@@ -99,4 +99,4 @@
99
  <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. Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?></p>
100
  <?php endif; ?>
101
  </div>
102
- <?php endif;?>
40
  <?php elseif ( $type == 'missing-functions' ) :?>
41
  <div class="wrap alert critical">
42
  <h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
43
+ <p class="description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;s <code>gethostbynamel</code> functions. <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'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
44
  </div>
45
  <?php elseif ( $type == 'servers-be-down' ) :?>
46
  <div class="wrap alert critical">
47
  <h3 class="key-status failed"><?php esc_html_e("We can&#8217;t connect to your site.", 'akismet'); ?></h3>
48
+ <p class="description"><?php printf( __('Your firewall may be blocking us. 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>
49
  </div>
50
  <?php elseif ( $type == 'active-dunning' ) :?>
51
  <div class="wrap alert critical">
99
  <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. Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?></p>
100
  <?php endif; ?>
101
  </div>
102
+ <?php endif;?>