Akismet Anti-Spam - Version 2.5.2

Version Description

  • Properly format the comment count for author counts
  • Look for super admins on multisite installs when looking up user roles
  • Increase the HTTP request timeout
  • Removed padding for author approved count
  • Fix typo in function name
  • Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
Download this release

Release Info

Developer josephscott
Plugin Icon 128x128 Akismet Anti-Spam
Version 2.5.2
Comparing to
See all releases

Code changes from version 2.5.1 to 2.5.2

Files changed (4) hide show
  1. admin.php +7 -13
  2. akismet.css +1 -6
  3. akismet.php +15 -5
  4. readme.txt +10 -1
admin.php CHANGED
@@ -236,11 +236,8 @@ function akismet_stats_script() {
236
  ?>
237
  <script type="text/javascript">
238
  function resizeIframe() {
239
- var height = document.documentElement.clientHeight;
240
- height -= document.getElementById('akismet-stats-frame').offsetTop;
241
- height += 100; // magic padding
242
-
243
- document.getElementById('akismet-stats-frame').style.height = height +"px";
244
 
245
  };
246
  function resizeIframeInit() {
@@ -352,8 +349,9 @@ function akismet_comment_row_action( $a, $comment ) {
352
  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' ) . '">'.htmlspecialchars($desc).'</a></span>';
353
 
354
  if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
355
- $comment_count = akimset_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
356
- echo '<span class="akismet-user-comment-count" commentid="'.$comment->comment_ID.'" style="display:none;"><br><span class="akismet-user-comment-counts">'.sprintf( _n( '%s approved', '%s approved', $comment_count ), intval($comment_count) ).'</span></span>';
 
357
  }
358
 
359
  return $a;
@@ -430,10 +428,6 @@ add_filter('comment_text', 'akismet_text_add_link_class');
430
  function akismet_rightnow() {
431
  global $submenu, $wp_db_version;
432
 
433
- $plural_func = '__ngettext';
434
- if ( function_exists( '_n' ) )
435
- $plural_func = '_n';
436
-
437
  // clean_url was deprecated in WP 3.0
438
  $esc_url = 'clean_url';
439
  if ( function_exists( 'esc_url' ) )
@@ -447,7 +441,7 @@ function akismet_rightnow() {
447
  $link = 'edit.php?page=akismet-admin';
448
 
449
  if ( $count = get_option('akismet_spam_count') ) {
450
- $intro = sprintf( $plural_func(
451
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
452
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
453
  $count
@@ -457,7 +451,7 @@ function akismet_rightnow() {
457
  }
458
 
459
  if ( $queue_count = akismet_spam_count() ) {
460
- $queue_text = sprintf( $plural_func(
461
  'There\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
462
  'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
463
  $queue_count
236
  ?>
237
  <script type="text/javascript">
238
  function resizeIframe() {
239
+
240
+ document.getElementById('akismet-stats-frame').style.height = "2500px";
 
 
 
241
 
242
  };
243
  function resizeIframeInit() {
349
  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' ) . '">'.htmlspecialchars($desc).'</a></span>';
350
 
351
  if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
352
+ $comment_count = akismet_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
353
+ $comment_count = intval( $comment_count );
354
+ echo '<span class="akismet-user-comment-count" commentid="'.$comment->comment_ID.'" style="display:none;"><br><span class="akismet-user-comment-counts">'.sprintf( _n( '%s approved', '%s approved', $comment_count ), number_format_i18n( $comment_count ) ) . '</span></span>';
355
  }
356
 
357
  return $a;
428
  function akismet_rightnow() {
429
  global $submenu, $wp_db_version;
430
 
 
 
 
 
431
  // clean_url was deprecated in WP 3.0
432
  $esc_url = 'clean_url';
433
  if ( function_exists( 'esc_url' ) )
441
  $link = 'edit.php?page=akismet-admin';
442
 
443
  if ( $count = get_option('akismet_spam_count') ) {
444
+ $intro = sprintf( _n(
445
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
446
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
447
  $count
451
  }
452
 
453
  if ( $queue_count = akismet_spam_count() ) {
454
+ $queue_text = sprintf( _n(
455
  'There\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
456
  'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
457
  $queue_count
akismet.css CHANGED
@@ -1,12 +1,7 @@
1
  #submitted-on { position: relative; }
2
- #the-comment-list .author { padding-bottom: 5px !important; white-space: nowrap; }
3
- #the-comment-list .author a { padding-left: 42px !important; }
4
- #the-comment-list .author img { position: absolute; top: 0; left: 0; }
5
- #the-comment-list .author strong { padding-left: 42px; font-size: 12px; position: relative; }
6
  #the-comment-list .author .akismet-user-comment-count { display: inline; }
7
- #the-comment-list .author .akismet-user-comment-counts { padding-left: 42px; }
8
  #dashboard_recent_comments .akismet-status { display: none; } /* never show the flagged by text on the dashboard */
9
  .akismet-status { float: right; }
10
  .akismet-status a { color: #AAA; font-style: italic; }
11
  span.comment-link a { text-decoration: underline; }
12
- span.comment-link:after { content: " " attr(title) " "; color: #aaa; text-decoration: none; }
1
  #submitted-on { position: relative; }
 
 
 
 
2
  #the-comment-list .author .akismet-user-comment-count { display: inline; }
 
3
  #dashboard_recent_comments .akismet-status { display: none; } /* never show the flagged by text on the dashboard */
4
  .akismet-status { float: right; }
5
  .akismet-status a { color: #AAA; font-style: italic; }
6
  span.comment-link a { text-decoration: underline; }
7
+ span.comment-link:after { content: " " attr(title) " "; color: #aaa; text-decoration: none; }
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 track-back 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/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="plugins.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
9
- Version: 2.5.1
10
  Author: Automattic
11
  Author URI: http://automattic.com/wordpress-plugins/
12
  License: GPLv2
@@ -28,7 +28,7 @@ along with this program; if not, write to the Free Software
28
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
  */
30
 
31
- define('AKISMET_VERSION', '2.5.0');
32
  define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
33
 
34
  /** If you hardcode a WP.com API key here, all key config screens will be hidden */
@@ -100,7 +100,16 @@ function akismet_get_user_roles($user_id ) {
100
  if ( isset($comment_user->roles) )
101
  $roles = join(',', $comment_user->roles);
102
  }
103
-
 
 
 
 
 
 
 
 
 
104
  return $roles;
105
  }
106
 
@@ -132,7 +141,8 @@ function akismet_http_post($request, $host, $path, $port = 80, $ip=null) {
132
  'Host' => $host,
133
  'User-Agent' => $akismet_ua
134
  ),
135
- 'httpversion' => '1.0'
 
136
  );
137
  $akismet_url = "http://{$http_host}{$path}";
138
  $response = wp_remote_post( $akismet_url, $http_args );
@@ -179,7 +189,7 @@ function akismet_result_hold( $approved ) {
179
  }
180
 
181
  // how many approved comments does this author have?
182
- function akimset_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
183
  global $wpdb;
184
 
185
  if ( !empty($user_id) )
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 track-back 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/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="plugins.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
9
+ Version: 2.5.2
10
  Author: Automattic
11
  Author URI: http://automattic.com/wordpress-plugins/
12
  License: GPLv2
28
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
  */
30
 
31
+ define('AKISMET_VERSION', '2.5.2');
32
  define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
33
 
34
  /** If you hardcode a WP.com API key here, all key config screens will be hidden */
100
  if ( isset($comment_user->roles) )
101
  $roles = join(',', $comment_user->roles);
102
  }
103
+
104
+ if ( is_multisite() && is_super_admin( $user_id ) ) {
105
+ if ( empty( $roles ) ) {
106
+ $roles = 'super_admin';
107
+ } else {
108
+ $comment_user->roles[] = 'super_admin';
109
+ $roles = join( ',', $comment_user->roles );
110
+ }
111
+ }
112
+
113
  return $roles;
114
  }
115
 
141
  'Host' => $host,
142
  'User-Agent' => $akismet_ua
143
  ),
144
+ 'httpversion' => '1.0',
145
+ 'timeout' => 15
146
  );
147
  $akismet_url = "http://{$http_host}{$path}";
148
  $response = wp_remote_post( $akismet_url, $http_args );
189
  }
190
 
191
  // how many approved comments does this author have?
192
+ function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
193
  global $wpdb;
194
 
195
  if ( !empty($user_id) )
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, au
3
  Tags: akismet, comments, spam
4
  Requires at least: 3.0
5
  Tested up to: 3.1
6
- Stable tag: 2.5.1
7
  License: GPLv2
8
 
9
  Akismet checks your comments against the Akismet web service to see if they look like spam or not.
@@ -31,6 +31,15 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
31
 
32
  == Changelog ==
33
 
 
 
 
 
 
 
 
 
 
34
  = 2.5.1 =
35
 
36
  * Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
3
  Tags: akismet, comments, spam
4
  Requires at least: 3.0
5
  Tested up to: 3.1
6
+ Stable tag: 2.5.2
7
  License: GPLv2
8
 
9
  Akismet checks your comments against the Akismet web service to see if they look like spam or not.
31
 
32
  == Changelog ==
33
 
34
+ = 2.5.2 =
35
+
36
+ * Properly format the comment count for author counts
37
+ * Look for super admins on multisite installs when looking up user roles
38
+ * Increase the HTTP request timeout
39
+ * Removed padding for author approved count
40
+ * Fix typo in function name
41
+ * Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
42
+
43
  = 2.5.1 =
44
 
45
  * Fix a bug that caused the "Auto delete" option to fail to discard comments correctly