Akismet Anti-Spam - Version 3.1.7

Version Description

Release Date - 4 January 2016

  • Added documentation for the 'akismet_comment_nonce' filter.
  • The post-install activation button is now accessible to screen readers and keyboard-only users.
  • Fixed a bug that was preventing the "Remove author URL" feature from working in WordPress 4.4
Download this release

Release Info

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

Code changes from version 3.1.6 to 3.1.7

.htaccess ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Only allow direct access to specific Web-available files.
2
+
3
+ # Apache 2.2
4
+ <IfModule !mod_authz_core.c>
5
+ Order Deny,Allow
6
+ Deny from all
7
+ </IfModule>
8
+
9
+ # Apache 2.4
10
+ <IfModule mod_authz_core.c>
11
+ Require all denied
12
+ </IfModule>
13
+
14
+ # Akismet CSS and JS
15
+ <FilesMatch "^(form|akismet)\.(css|js)$">
16
+ <IfModule !mod_authz_core.c>
17
+ Allow from all
18
+ </IfModule>
19
+
20
+ <IfModule mod_authz_core.c>
21
+ Require all granted
22
+ </IfModule>
23
+ </FilesMatch>
24
+
25
+ # Akismet images
26
+ <FilesMatch "^(.+)\.(png|gif)$">
27
+ <IfModule !mod_authz_core.c>
28
+ Allow from all
29
+ </IfModule>
30
+
31
+ <IfModule mod_authz_core.c>
32
+ Require all granted
33
+ </IfModule>
34
+ </FilesMatch>
_inc/akismet.css CHANGED
@@ -373,4 +373,102 @@ h2.ak-header {
373
 
374
  .clearfix {
375
  clear:both;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  }
373
 
374
  .clearfix {
375
  clear:both;
376
+ }
377
+
378
+ /**
379
+ * For the activation notice on the plugins page.
380
+ */
381
+ .akismet_activate {
382
+ min-width: 825px;
383
+ border: 1px solid #4F800D;
384
+ padding: 5px;
385
+ margin: 15px 0;
386
+ background: #83AF24;
387
+ background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D));
388
+ background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24);
389
+ -moz-border-radius: 3px;
390
+ border-radius: 3px;
391
+ -webkit-border-radius: 3px;
392
+ position: relative;
393
+ overflow: hidden;
394
+ }
395
+
396
+ .akismet_activate .aa_a {
397
+ position: absolute;
398
+ top: -5px;
399
+ right: 10px;
400
+ font-size: 140px;
401
+ color: #769F33;
402
+ font-family: Georgia, "Times New Roman", Times, serif;
403
+ z-index: 1;
404
+ }
405
+
406
+ .akismet_activate .aa_button {
407
+ font-weight: bold;
408
+ border: 1px solid #029DD6;
409
+ border-top: 1px solid #06B9FD;
410
+ font-size: 15px;
411
+ text-align: center;
412
+ padding: 9px 0 8px 0;
413
+ color: #FFF;
414
+ background: #029DD6;
415
+ background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
416
+ background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
417
+ -moz-border-radius: 2px;
418
+ border-radius: 2px;
419
+ -webkit-border-radius: 2px;
420
+ width: 100%;
421
+ cursor: pointer;
422
+ margin: 0;
423
+ }
424
+
425
+ .akismet_activate .aa_button:hover {
426
+ text-decoration: none !important;
427
+ border: 1px solid #029DD6;
428
+ border-bottom: 1px solid #00A8EF;
429
+ font-size: 15px;
430
+ text-align: center;
431
+ padding: 9px 0 8px 0;
432
+ color: #F0F8FB;
433
+ background: #0079B1;
434
+ background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF));
435
+ background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1);
436
+ -moz-border-radius: 2px;
437
+ border-radius: 2px;
438
+ -webkit-border-radius: 2px;
439
+ }
440
+
441
+ .akismet_activate .aa_button_border {
442
+ border: 1px solid #006699;
443
+ -moz-border-radius: 2px;
444
+ border-radius: 2px;
445
+ -webkit-border-radius: 2px;
446
+ background: #029DD6;
447
+ background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
448
+ background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
449
+ }
450
+
451
+ .akismet_activate .aa_button_container {
452
+ display: inline-block;
453
+ background: #DEF1B8;
454
+ padding: 5px;
455
+ -moz-border-radius: 2px;
456
+ border-radius: 2px;
457
+ -webkit-border-radius: 2px;
458
+ width: 266px;
459
+ }
460
+
461
+ .akismet_activate .aa_description {
462
+ position: absolute;
463
+ top: 22px;
464
+ left: 285px;
465
+ margin-left: 25px;
466
+ color: #E5F2B1;
467
+ font-size: 15px;
468
+ z-index: 1000;
469
+ }
470
+
471
+ .akismet_activate .aa_description strong {
472
+ color: #FFF;
473
+ font-weight: normal;
474
  }
_inc/akismet.js CHANGED
@@ -22,20 +22,27 @@ jQuery( function ( $ ) {
22
  var thisId = $(this).attr('commentid');
23
  $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
24
  });
25
- $('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title]').each(function () {
26
- // Comment author URLs are the only URL with a title attribute in the author column.
27
- var thisTitle = $(this).attr('title');
28
-
29
- var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
30
-
31
- $(this).attr("id", "author_comment_url_"+ thisCommentId[1]);
32
-
33
- if (thisTitle) {
34
- $(this).after(
35
- $( '<a href="#" class="remove_url">x</a>' )
36
- .attr( 'commentid', thisCommentId[1] )
37
- .attr( 'title', WPAkismet.strings['Remove this URL'] )
38
- );
 
 
 
 
 
 
 
39
  }
40
  });
41
  $('.remove_url').live('click', function () {
22
  var thisId = $(this).attr('commentid');
23
  $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
24
  });
25
+ $('#the-comment-list')
26
+ .find('tr.comment, tr[id ^= "comment-"]')
27
+ .find('.column-author a[href^="http"]:first') // Ignore mailto: links, which would be the comment author's email.
28
+ .each(function () {
29
+ var linkHref = $(this).attr( 'href' );
30
+
31
+ // Ignore any links to the current domain, which are diagnostic tools, like the IP address link
32
+ // or any other links another plugin might add.
33
+ var currentHostParts = document.location.href.split( '/' );
34
+ var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/';
35
+
36
+ if ( linkHref.indexOf( currentHost ) != 0 ) {
37
+ var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
38
+
39
+ $(this)
40
+ .attr("id", "author_comment_url_"+ thisCommentId[1])
41
+ .after(
42
+ $( '<a href="#" class="remove_url">x</a>' )
43
+ .attr( 'commentid', thisCommentId[1] )
44
+ .attr( 'title', WPAkismet.strings['Remove this URL'] )
45
+ );
46
  }
47
  });
48
  $('.remove_url').live('click', function () {
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.6
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.6' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.2' );
42
  define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
43
  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 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.7
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.7' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.2' );
42
  define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
43
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
class.akismet-admin.php CHANGED
@@ -109,6 +109,7 @@ class Akismet_Admin {
109
  'post.php',
110
  'settings_page_akismet-key-config',
111
  'jetpack_page_akismet-key-config',
 
112
  ) ) ) {
113
  wp_register_style( 'akismet.css', AKISMET__PLUGIN_URL . '_inc/akismet.css', array(), AKISMET_VERSION );
114
  wp_enqueue_style( 'akismet.css');
109
  'post.php',
110
  'settings_page_akismet-key-config',
111
  'jetpack_page_akismet-key-config',
112
+ 'plugins.php',
113
  ) ) ) {
114
  wp_register_style( 'akismet.css', AKISMET__PLUGIN_URL . '_inc/akismet.css', array(), AKISMET_VERSION );
115
  wp_enqueue_style( 'akismet.css');
class.akismet.php CHANGED
@@ -29,6 +29,14 @@ class Akismet {
29
  add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
30
  add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
31
 
 
 
 
 
 
 
 
 
32
  $akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
33
 
34
  if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' )
@@ -89,6 +97,7 @@ class Akismet {
89
  if ( !empty( $comment['user_ID'] ) )
90
  $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
91
 
 
92
  $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
93
  $comment['akismet_comment_nonce'] = 'inactive';
94
  if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
29
  add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
30
  add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
31
 
32
+ /**
33
+ * To disable the Akismet comment nonce, add a filter for the 'akismet_comment_nonce' tag
34
+ * and return any string value that is not 'true' or '' (empty string).
35
+ *
36
+ * Don't return boolean false, because that implies that the 'akismet_comment_nonce' option
37
+ * has not been set and that Akismet should just choose the default behavior for that
38
+ * situation.
39
+ */
40
  $akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
41
 
42
  if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' )
97
  if ( !empty( $comment['user_ID'] ) )
98
  $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
99
 
100
+ /** See filter documentation in init_hooks(). */
101
  $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
102
  $comment['akismet_comment_nonce'] = 'inactive';
103
  if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
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
6
- Stable tag: 3.1.6
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,13 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
 
 
33
  = 3.1.6 =
34
  *Release Date - 14 December 2015*
35
 
2
  Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
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.7
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.7 =
34
+ *Release Date - 4 January 2016*
35
+
36
+ * Added documentation for the 'akismet_comment_nonce' filter.
37
+ * The post-install activation button is now accessible to screen readers and keyboard-only users.
38
+ * Fixed a bug that was preventing the "Remove author URL" feature from working in WordPress 4.4
39
+
40
  = 3.1.6 =
41
  *Release Date - 14 December 2015*
42
 
views/notice.php CHANGED
@@ -1,14 +1,11 @@
1
  <?php if ( $type == 'plugin' ) :?>
2
  <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
3
- <style type="text/css">
4
- .akismet_activate{min-width:825px;border:1px solid #4F800D;padding:5px;margin:15px 0;background:#83AF24;background-image:-webkit-gradient(linear,0% 0,80% 100%,from(#83AF24),to(#4F800D));background-image:-moz-linear-gradient(80% 100% 120deg,#4F800D,#83AF24);-moz-border-radius:3px;border-radius:3px;-webkit-border-radius:3px;position:relative;overflow:hidden}.akismet_activate .aa_a{position:absolute;top:-5px;right:10px;font-size:140px;color:#769F33;font-family:Georgia, "Times New Roman", Times, serif;z-index:1}.akismet_activate .aa_button{font-weight:bold;border:1px solid #029DD6;border-top:1px solid #06B9FD;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#FFF;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button:hover{text-decoration:none !important;border:1px solid #029DD6;border-bottom:1px solid #00A8EF;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#F0F8FB;background:#0079B1;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#0079B1),to(#0092BF));background-image:-moz-linear-gradient(0% 100% 90deg,#0092BF,#0079B1);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button_border{border:1px solid #006699;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6)}.akismet_activate .aa_button_container{cursor:pointer;display:inline-block;background:#DEF1B8;padding:5px;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;width:266px}.akismet_activate .aa_description{position:absolute;top:22px;left:285px;margin-left:25px;color:#E5F2B1;font-size:15px;z-index:1000}.akismet_activate .aa_description strong{color:#FFF;font-weight:normal}
5
- </style>
6
  <form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
7
  <div class="akismet_activate">
8
  <div class="aa_a">A</div>
9
- <div class="aa_button_container" onclick="document.akismet_activate.submit();">
10
  <div class="aa_button_border">
11
- <div class="aa_button"><?php esc_html_e('Activate your Akismet account', 'akismet');?></div>
12
  </div>
13
  </div>
14
  <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>
1
  <?php if ( $type == 'plugin' ) :?>
2
  <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
 
 
 
3
  <form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
4
  <div class="akismet_activate">
5
  <div class="aa_a">A</div>
6
+ <div class="aa_button_container">
7
  <div class="aa_button_border">
8
+ <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Activate your Akismet account', 'akismet' ); ?>" />
9
  </div>
10
  </div>
11
  <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>