Akismet Anti-Spam - Version 4.2.3

Version Description

Release Date - 25 April 2022

  • Improved compatibility with Fluent Forms
  • Fixed missing translation domains
  • Updated stats URL.
  • Improved accessibility of elements on the config page.
Download this release

Release Info

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

Code changes from version 4.2.2 to 4.2.3

akismet.php CHANGED
@@ -6,7 +6,7 @@
6
  Plugin Name: Akismet Anti-Spam
7
  Plugin URI: https://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: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
9
- Version: 4.2.2
10
  Author: Automattic
11
  Author URI: https://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', '4.2.2' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '5.0' );
42
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
43
  define( 'AKISMET_DELETE_LIMIT', 10000 );
6
  Plugin Name: Akismet Anti-Spam
7
  Plugin URI: https://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: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
9
+ Version: 4.2.3
10
  Author: Automattic
11
  Author URI: https://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
37
  exit;
38
  }
39
 
40
+ define( 'AKISMET_VERSION', '4.2.3' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '5.0' );
42
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
43
  define( 'AKISMET_DELETE_LIMIT', 10000 );
class.akismet-admin.php CHANGED
@@ -434,7 +434,7 @@ class Akismet_Admin {
434
 
435
  if ( ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) {
436
  wp_send_json( array(
437
- 'error' => __( "You don't have permission to do that."),
438
  ));
439
  return;
440
  }
434
 
435
  if ( ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) {
436
  wp_send_json( array(
437
+ 'error' => __( 'You don&#8217;t have permission to do that.', 'akismet' ),
438
  ));
439
  return;
440
  }
class.akismet.php CHANGED
@@ -68,6 +68,10 @@ class Akismet {
68
  add_filter( 'frm_filter_final_form', array( 'Akismet', 'inject_custom_form_fields' ) );
69
  add_filter( 'frm_akismet_values', array( 'Akismet', 'prepare_custom_form_values' ) );
70
 
 
 
 
 
71
  add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 );
72
  add_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 );
73
 
@@ -1399,9 +1403,16 @@ class Akismet {
1399
  * Ensure that any Akismet-added form fields are included in the comment-check call.
1400
  *
1401
  * @param array $form
 
 
1402
  * @return array $form
1403
  */
1404
- public static function prepare_custom_form_values( $form ) {
 
 
 
 
 
1405
  $prefix = 'ak_';
1406
 
1407
  // Contact Form 7 uses _wpcf7 as a prefix to know which fields to exclude from comment_content.
@@ -1409,8 +1420,7 @@ class Akismet {
1409
  $prefix = '_wpcf7_ak_';
1410
  }
1411
 
1412
- // phpcs:ignore WordPress.Security.NonceVerification.Missing
1413
- foreach ( $_POST as $key => $val ) {
1414
  if ( 0 === strpos( $key, $prefix ) ) {
1415
  $form[ 'POST_ak_' . substr( $key, strlen( $prefix ) ) ] = $val;
1416
  }
68
  add_filter( 'frm_filter_final_form', array( 'Akismet', 'inject_custom_form_fields' ) );
69
  add_filter( 'frm_akismet_values', array( 'Akismet', 'prepare_custom_form_values' ) );
70
 
71
+ // Fluent Forms
72
+ add_filter( 'fluentform_form_element_start', array( 'Akismet', 'output_custom_form_fields' ) );
73
+ add_filter( 'fluentform_akismet_fields', array( 'Akismet', 'prepare_custom_form_values' ), 10, 2 );
74
+
75
  add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 );
76
  add_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 );
77
 
1403
  * Ensure that any Akismet-added form fields are included in the comment-check call.
1404
  *
1405
  * @param array $form
1406
+ * @param array $data Some plugins will supply the POST data via the filter, since they don't
1407
+ * read it directly from $_POST.
1408
  * @return array $form
1409
  */
1410
+ public static function prepare_custom_form_values( $form, $data = null ) {
1411
+ if ( is_null( $data ) ) {
1412
+ // phpcs:ignore WordPress.Security.NonceVerification.Missing
1413
+ $data = $_POST;
1414
+ }
1415
+
1416
  $prefix = 'ak_';
1417
 
1418
  // Contact Form 7 uses _wpcf7 as a prefix to know which fields to exclude from comment_content.
1420
  $prefix = '_wpcf7_ak_';
1421
  }
1422
 
1423
+ foreach ( $data as $key => $val ) {
 
1424
  if ( 0 === strpos( $key, $prefix ) ) {
1425
  $form[ 'POST_ak_' . substr( $key, strlen( $prefix ) ) ] = $val;
1426
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo
3
  Tags: comments, spam, antispam, anti-spam, contact form, anti spam, comment moderation, comment spam, contact form spam, spam comments
4
  Requires at least: 5.0
5
  Tested up to: 5.9
6
- Stable tag: 4.2.2
7
  License: GPLv2 or later
8
 
9
  The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress and WooCommerce.
@@ -30,13 +30,21 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
 
 
 
33
  = 4.2.2 =
34
  *Release Date - 24 January 2022*
35
 
36
  * Improved compatibility with Formidable Forms
37
  * Fixed a bug that could cause issues when multiple contact forms appear on one page.
38
  * Updated delete_comment and deleted_comment actions to pass two arguments to match WordPress core since 4.9.0.
39
- * Add a filter that allows comment types to be excluded when counting users' approved comments.
40
 
41
  = 4.2.1 =
42
  *Release Date - 1 October 2021*
@@ -93,6 +101,6 @@ Upload the Akismet plugin to your blog, activate it, and then enter your Akismet
93
  *Release Date - 4 June 2020*
94
 
95
  * Disable "Check for Spam" button until the page is loaded to avoid errors with clicking through to queue recheck endpoint directly.
96
- * Add filter "akismet_enable_mshots" to allow disabling screenshot popups on the edit comments admin page.
97
 
98
  For older changelog entries, please see the [additional changelog.txt file](https://plugins.svn.wordpress.org/akismet/trunk/changelog.txt) delivered with the plugin.
3
  Tags: comments, spam, antispam, anti-spam, contact form, anti spam, comment moderation, comment spam, contact form spam, spam comments
4
  Requires at least: 5.0
5
  Tested up to: 5.9
6
+ Stable tag: 4.2.3
7
  License: GPLv2 or later
8
 
9
  The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress and WooCommerce.
30
 
31
  == Changelog ==
32
 
33
+ = 4.2.3 =
34
+ *Release Date - 25 April 2022*
35
+
36
+ * Improved compatibility with Fluent Forms
37
+ * Fixed missing translation domains
38
+ * Updated stats URL.
39
+ * Improved accessibility of elements on the config page.
40
+
41
  = 4.2.2 =
42
  *Release Date - 24 January 2022*
43
 
44
  * Improved compatibility with Formidable Forms
45
  * Fixed a bug that could cause issues when multiple contact forms appear on one page.
46
  * Updated delete_comment and deleted_comment actions to pass two arguments to match WordPress core since 4.9.0.
47
+ * Added a filter that allows comment types to be excluded when counting users' approved comments.
48
 
49
  = 4.2.1 =
50
  *Release Date - 1 October 2021*
101
  *Release Date - 4 June 2020*
102
 
103
  * Disable "Check for Spam" button until the page is loaded to avoid errors with clicking through to queue recheck endpoint directly.
104
+ * Added filter "akismet_enable_mshots" to allow disabling screenshot popups on the edit comments admin page.
105
 
106
  For older changelog entries, please see the [additional changelog.txt file](https://plugins.svn.wordpress.org/akismet/trunk/changelog.txt) delivered with the plugin.
views/config.php CHANGED
@@ -35,7 +35,7 @@
35
  </div>
36
 
37
  <div class="akismet-new-snapshot">
38
- <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
39
  <ul>
40
  <li>
41
  <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
@@ -73,7 +73,9 @@
73
  <tbody>
74
  <?php if ( ! Akismet::predefined_api_key() ) { ?>
75
  <tr>
76
- <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
 
 
77
  <td width="5%"/>
78
  <td align="left">
79
  <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
35
  </div>
36
 
37
  <div class="akismet-new-snapshot">
38
+ <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>"></iframe>
39
  <ul>
40
  <li>
41
  <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
73
  <tbody>
74
  <?php if ( ! Akismet::predefined_api_key() ) { ?>
75
  <tr>
76
+ <th class="akismet-api-key" width="10%" align="left" scope="row">
77
+ <label for="key"><?php esc_html_e( 'API Key', 'akismet' ); ?></label>
78
+ </th>
79
  <td width="5%"/>
80
  <td align="left">
81
  <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
views/connect-jp.php CHANGED
@@ -62,8 +62,8 @@
62
  <?php Akismet::view( 'setup' );?>
63
  </div>
64
  <div class="centered akismet-toggles">
65
- <a href="#" class="toggle-jp-connect"><?php esc_html_e( 'Connect with Jetpack' ); ?></a>
66
- <a href="#" class="toggle-ak-connect"><?php esc_html_e( 'Set up a different account' ); ?></a>
67
  </div>
68
  </div>
69
  <br/>
62
  <?php Akismet::view( 'setup' );?>
63
  </div>
64
  <div class="centered akismet-toggles">
65
+ <a href="#" class="toggle-jp-connect"><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></a>
66
+ <a href="#" class="toggle-ak-connect"><?php esc_html_e( 'Set up a different account', 'akismet' ); ?></a>
67
  </div>
68
  </div>
69
  <br/>
views/get.php CHANGED
@@ -2,11 +2,11 @@
2
 
3
  //phpcs:disable VariableAnalysis
4
  // There are "undefined" variables here because they're defined in the code that includes this file as a template.
5
-
6
  ?>
 
7
  <form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
8
  <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
9
  <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
10
  <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
11
- <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button';?>" value="<?php echo esc_attr( $text ); ?>"/>
12
- </form>
2
 
3
  //phpcs:disable VariableAnalysis
4
  // There are "undefined" variables here because they're defined in the code that includes this file as a template.
 
5
  ?>
6
+
7
  <form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
8
  <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
9
  <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
10
  <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
11
+ <button type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? esc_attr( implode( ' ', $classes ) ) : 'akismet-button'; ?>" value="<?php echo esc_attr( $text ); ?>"><?php echo esc_attr( $text ) . '<span class="screen-reader-text">' . esc_html__( '(opens in a new tab)', 'akismet' ) . '</span>'; ?></button>
12
+ </form>
views/stats.php CHANGED
@@ -7,5 +7,5 @@
7
  </div>
8
  </div>
9
  </div>
10
- <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
11
  </div>
7
  </div>
8
  </div>
9
  </div>
10
+ <iframe src="<?php echo esc_url( sprintf( 'https://tools.akismet.com/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), esc_attr( Akismet::get_api_key() ), esc_attr( get_locale() ) ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
11
  </div>