Akismet Anti-Spam - Version 3.0.0

Version Description

  • Move Akismet to Settings menu
  • Drop Akismet Stats menu
  • Add stats snapshot to Akismet settings
  • Add Akismet subscription details and status to Akismet settings
  • Add contextual help for each page
  • Improve Akismet setup to use Jetpack to automate plugin setup
  • Fix Update Check for Spam to use ajax to avoid page timing out
  • Fix Akismet settings page to be responsive
  • Drop legacy code
  • Tidy up CSS and Javascript
  • Replace the old discard setting with a new "discard pervasive spam" feature.
Download this release

Release Info

Developer eoigal
Plugin Icon 128x128 Akismet Anti-Spam
Version 3.0.0
Comparing to
See all releases

Code changes from version 3.0.0-RC1 to 3.0.0

.htaccess DELETED
@@ -1,11 +0,0 @@
1
- Order Deny,Allow
2
- Deny from all
3
-
4
- <FilesMatch "^(form|akismet)\.(css|js)$">
5
- Allow from all
6
- </FilesMatch>
7
-
8
- #allow access to any image
9
- <FilesMatch "^(.+)\.(png|gif)$">
10
- Allow from all
11
- </FilesMatch>
 
 
 
 
 
 
 
 
 
 
 
_inc/akismet.css CHANGED
@@ -65,7 +65,7 @@ span.comment-link:after {
65
  }
66
  h2.ak-header {
67
  padding: 30px;
68
- background: #7c9936 url('img/logo-full-2x.png') no-repeat 20px center;
69
  background-size: 185px 33px;
70
  height: 33px;
71
  text-indent: -9999em;
@@ -92,7 +92,7 @@ h2.ak-header {
92
  padding: 20px;
93
  }
94
  .activate-option.clicked {
95
- background: #7c9936;
96
  color: #fff;
97
  }
98
  .activate-option.clicked:hover {
@@ -142,7 +142,7 @@ h2.ak-header {
142
  color: #dd3d36;
143
  }
144
  .success {
145
- color: #7c9936;
146
  }
147
  .option-description {
148
  float: left;
@@ -211,7 +211,7 @@ h2.ak-header {
211
  }
212
 
213
  .alert.active {
214
- background-color: #3db238;
215
  }
216
 
217
  .alert p.key-status {
65
  }
66
  h2.ak-header {
67
  padding: 30px;
68
+ background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
69
  background-size: 185px 33px;
70
  height: 33px;
71
  text-indent: -9999em;
92
  padding: 20px;
93
  }
94
  .activate-option.clicked {
95
+ background: #649316;
96
  color: #fff;
97
  }
98
  .activate-option.clicked:hover {
142
  color: #dd3d36;
143
  }
144
  .success {
145
+ color: #649316;
146
  }
147
  .option-description {
148
  float: left;
211
  }
212
 
213
  .alert.active {
214
+ background-color: #649316;
215
  }
216
 
217
  .alert p.key-status {
akismet.php CHANGED
@@ -4,9 +4,9 @@
4
  */
5
  /*
6
  Plugin Name: Akismet
7
- Plugin URI: http://akismet.com/?return=true
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/?return=true">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-beta
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-beta' );
39
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.0' );
40
  define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
41
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
4
  */
5
  /*
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.0
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.0' );
39
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.0' );
40
  define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
41
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
class.akismet-admin.php CHANGED
@@ -42,6 +42,8 @@ class Akismet_Admin {
42
  add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
43
  add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
44
  add_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) );
 
 
45
  }
46
 
47
  public static function admin_init() {
@@ -60,6 +62,12 @@ class Akismet_Admin {
60
  if ( !current_user_can( 'manage_options' ) )
61
  return;
62
  }
 
 
 
 
 
 
63
 
64
  public static function load_menu() {
65
  if ( class_exists( 'Jetpack' ) )
@@ -244,11 +252,11 @@ class Akismet_Admin {
244
  if ( $key_status == 'valid' ) {
245
  $akismet_user = self::get_akismet_user( $api_key );
246
 
247
- if ( $akismet_user ) {
248
- if ( $akismet_user->status != 'missing' )
249
  update_option( 'wordpress_api_key', $api_key );
250
 
251
- if ( $akismet_user->status == 'active' )
252
  self::$notices['status'] = 'new-key-valid';
253
  else
254
  self::$notices['status'] = $akismet_user->status;
@@ -275,7 +283,7 @@ class Akismet_Admin {
275
  '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comment</a>.',
276
  '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.',
277
  $count
278
- , 'akismet'), 'http://akismet.com/?return=true', esc_url( add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( isset( $submenu['edit-comments.php'] ) ? 'edit-comments.php' : 'edit.php' ) ) ), number_format_i18n($count) ).'</p>';
279
  }
280
 
281
  // WP 2.5+
@@ -294,9 +302,9 @@ class Akismet_Admin {
294
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
295
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
296
  $count
297
- , 'akismet'), 'http://akismet.com/?return=true', number_format_i18n( $count ) );
298
  } else {
299
- $intro = sprintf( __('<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'http://akismet.com/?return=true' );
300
  }
301
 
302
  $link = function_exists( 'esc_url' ) ? esc_url( $link ) : clean_url( $link );
@@ -743,6 +751,19 @@ class Akismet_Admin {
743
  return $akismet_user;
744
  }
745
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
  public static function verify_wpcom_key( $api_key, $user_id, $token = '' ) {
747
  $akismet_account = Akismet::http_post( http_build_query( array(
748
  'user_id' => $user_id,
@@ -840,21 +861,12 @@ class Akismet_Admin {
840
  public static function display_configuration_page() {
841
  $api_key = Akismet::get_api_key();
842
  $akismet_user = self::get_akismet_user( $api_key );
 
843
 
844
  // If unset, create the new strictness option using the old discard option to determine its default
845
  if ( get_option( 'akismet_strictness' ) === false )
846
  add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
847
 
848
- $blog = parse_url( get_option('home'), PHP_URL_HOST );
849
-
850
- foreach( array( '6-months', 'all' ) as $interval ) {
851
- $response = Akismet::http_post( http_build_query( array( 'blog' => urlencode( $blog ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
852
-
853
- if ( ! empty( $response[1] ) ) {
854
- $stat_totals[$interval] = json_decode( $response[1] );
855
- }
856
- }
857
-
858
  if ( empty( self::$notices ) ) {
859
  //show status
860
  if ( $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
@@ -883,11 +895,11 @@ class Akismet_Admin {
883
  }
884
  }
885
 
886
- if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing' ) ) )
887
  Akismet::view( 'notice', array( 'type' => $akismet_user->status ) );
888
 
889
  Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
890
- Akismet::view( 'config', compact( 'api_key', 'blog', 'akismet_user', 'stat_totals' ) );
891
  }
892
 
893
  public static function display_notice() {
42
  add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
43
  add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
44
  add_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) );
45
+
46
+ add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
47
  }
48
 
49
  public static function admin_init() {
62
  if ( !current_user_can( 'manage_options' ) )
63
  return;
64
  }
65
+
66
+ public static function admin_plugin_settings_link( $links ) {
67
+ $settings_link = '<a href="'.self::get_page_url().'">'.__('Settings', 'akismet').'</a>';
68
+ array_unshift( $links, $settings_link );
69
+ return $links;
70
+ }
71
 
72
  public static function load_menu() {
73
  if ( class_exists( 'Jetpack' ) )
252
  if ( $key_status == 'valid' ) {
253
  $akismet_user = self::get_akismet_user( $api_key );
254
 
255
+ if ( $akismet_user ) {
256
+ if ( in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ) )
257
  update_option( 'wordpress_api_key', $api_key );
258
 
259
+ if ( $akismet_user->status == 'active' )
260
  self::$notices['status'] = 'new-key-valid';
261
  else
262
  self::$notices['status'] = $akismet_user->status;
283
  '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comment</a>.',
284
  '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.',
285
  $count
286
+ , 'akismet'), 'https://akismet.com/wordpress/', esc_url( add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( isset( $submenu['edit-comments.php'] ) ? 'edit-comments.php' : 'edit.php' ) ) ), number_format_i18n($count) ).'</p>';
287
  }
288
 
289
  // WP 2.5+
302
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
303
  '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
304
  $count
305
+ , 'akismet'), 'https://akismet.com/wordpress/', number_format_i18n( $count ) );
306
  } else {
307
+ $intro = sprintf( __('<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' );
308
  }
309
 
310
  $link = function_exists( 'esc_url' ) ? esc_url( $link ) : clean_url( $link );
751
  return $akismet_user;
752
  }
753
 
754
+ public static function get_stats( $api_key ) {
755
+ $stat_totals = array();
756
+
757
+ foreach( array( '6-months', 'all' ) as $interval ) {
758
+ $response = Akismet::http_post( http_build_query( array( 'blog' => urlencode( get_bloginfo('url') ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
759
+
760
+ if ( ! empty( $response[1] ) ) {
761
+ $stat_totals[$interval] = json_decode( $response[1] );
762
+ }
763
+ }
764
+ return $stat_totals;
765
+ }
766
+
767
  public static function verify_wpcom_key( $api_key, $user_id, $token = '' ) {
768
  $akismet_account = Akismet::http_post( http_build_query( array(
769
  'user_id' => $user_id,
861
  public static function display_configuration_page() {
862
  $api_key = Akismet::get_api_key();
863
  $akismet_user = self::get_akismet_user( $api_key );
864
+ $stat_totals = self::get_stats( $api_key );
865
 
866
  // If unset, create the new strictness option using the old discard option to determine its default
867
  if ( get_option( 'akismet_strictness' ) === false )
868
  add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
869
 
 
 
 
 
 
 
 
 
 
 
870
  if ( empty( self::$notices ) ) {
871
  //show status
872
  if ( $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
895
  }
896
  }
897
 
898
+ if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) )
899
  Akismet::view( 'notice', array( 'type' => $akismet_user->status ) );
900
 
901
  Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
902
+ Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals' ) );
903
  }
904
 
905
  public static function display_notice() {
class.akismet.php CHANGED
@@ -743,7 +743,7 @@ p {
743
  if ( version_compare( $GLOBALS['wp_version'], AKISMET__MINIMUM_WP_VERSION, '<' ) ) {
744
  load_plugin_textdomain( 'akismet' );
745
 
746
- $message = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/');
747
 
748
  Akismet::bail_on_activation( $message );
749
  }
743
  if ( version_compare( $GLOBALS['wp_version'], AKISMET__MINIMUM_WP_VERSION, '<' ) ) {
744
  load_plugin_textdomain( 'akismet' );
745
 
746
+ $message = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/');
747
 
748
  Akismet::bail_on_activation( $message );
749
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic
3
  Tags: akismet, comments, spam
4
  Requires at least: 3.0
5
- Tested up to: 3.8.1
6
- Stable tag: 2.6.0
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.
@@ -31,7 +31,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
31
 
32
  == Changelog ==
33
 
34
- = 3.0-beta =
35
  * Move Akismet to Settings menu
36
  * Drop Akismet Stats menu
37
  * Add stats snapshot to Akismet settings
@@ -41,7 +41,7 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
41
  * Fix Update Check for Spam to use ajax to avoid page timing out
42
  * Fix Akismet settings page to be responsive
43
  * Drop legacy code
44
- * Tidy up CSS an Javascript
45
  * Replace the old discard setting with a new "discard pervasive spam" feature.
46
 
47
  = 2.6.0 =
2
  Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic
3
  Tags: akismet, comments, spam
4
  Requires at least: 3.0
5
+ Tested up to: 3.9
6
+ Stable tag: 3.0.0
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.
31
 
32
  == Changelog ==
33
 
34
+ = 3.0.0 =
35
  * Move Akismet to Settings menu
36
  * Drop Akismet Stats menu
37
  * Add stats snapshot to Akismet settings
41
  * Fix Update Check for Spam to use ajax to avoid page timing out
42
  * Fix Akismet settings page to be responsive
43
  * Drop legacy code
44
+ * Tidy up CSS and Javascript
45
  * Replace the old discard setting with a new "discard pervasive spam" feature.
46
 
47
  = 2.6.0 =
views/config.php CHANGED
@@ -12,7 +12,7 @@
12
  <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
13
  </span>
14
 
15
- <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( 'http://akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180', $blog, $api_key );?>"></iframe>
16
  <ul>
17
  <li>
18
  <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
@@ -88,7 +88,7 @@
88
  <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
89
  <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
90
  </fieldset>
91
- <span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong> <?php printf( __( 'Spam in the <a href="%s">spam folder</a> older than 15 days is deleted automatically.' , 'akismet'), admin_url( 'edit-comments.php?type=spam' ) );?></span>
92
  </td>
93
  </tr>
94
  </tbody>
@@ -131,7 +131,18 @@
131
  <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
132
  <td width="5%"/>
133
  <td align="left">
134
- <span><?php echo ucwords( $akismet_user->status ); ?></span>
 
 
 
 
 
 
 
 
 
 
 
135
  </td>
136
  </tr>
137
  <?php if ( $akismet_user->next_billing_date ) : ?>
@@ -148,7 +159,7 @@
148
  </div>
149
  <div id="major-publishing-actions">
150
  <div id="publishing-action">
151
- <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
152
  </div>
153
  <div class="clear"></div>
154
  </div>
12
  <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
13
  </span>
14
 
15
+ <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180&locale=%s', urlencode( get_bloginfo('url') ), Akismet::get_api_key(), get_locale() );?>"></iframe>
16
  <ul>
17
  <li>
18
  <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
88
  <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
89
  <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
90
  </fieldset>
91
+ <span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong> <?php printf( __( 'Spam in the <a href="%s">spam folder</a> older than 15 days is deleted automatically.' , 'akismet'), admin_url( 'edit-comments.php?comment_status=spam' ) );?></span>
92
  </td>
93
  </tr>
94
  </tbody>
131
  <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
132
  <td width="5%"/>
133
  <td align="left">
134
+ <span><?php
135
+ if ( 'cancelled' == $akismet_user->status ) :
136
+ esc_html_e( 'Cancelled', 'akismet' );
137
+ elseif ( 'suspended' == $akismet_user->status ) :
138
+ esc_html_e( 'Suspended', 'akismet' );
139
+ elseif ( 'missing' == $akismet_user->status ) :
140
+ esc_html_e( 'Missing', 'akismet' );
141
+ elseif ( 'no-sub' == $akismet_user->status ) :
142
+ esc_html_e( 'No Subscription Found', 'akismet' );
143
+ else :
144
+ esc_html_e( 'Active', 'akismet' );
145
+ endif; ?></span>
146
  </td>
147
  </tr>
148
  <?php if ( $akismet_user->next_billing_date ) : ?>
159
  </div>
160
  <div id="major-publishing-actions">
161
  <div id="publishing-action">
162
+ <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
163
  </div>
164
  <div class="clear"></div>
165
  </div>
views/get.php CHANGED
@@ -1,4 +1,4 @@
1
- <form name="akismet_activate" action="https://akismet.com/get/" method="POST">
2
  <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
3
  <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
4
  <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
1
+ <form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
2
  <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
3
  <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
4
  <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
views/notice.php CHANGED
@@ -63,9 +63,14 @@
63
  </div>
64
  <?php elseif ( $type == 'missing' ) :?>
65
  <div class="wrap alert critical">
66
- <h3 class="key-status failed"><?php esc_html_e("Your subscription is missing.", 'akismet'); ?></h3>
67
  <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
68
  </div>
 
 
 
 
 
69
  <?php elseif ( $type == 'new-key-valid' ) :?>
70
  <div class="wrap alert active">
71
  <h3 class="key-status"><?php esc_html_e('Your Akismet account has been successfully set up and activated. Happy blogging!', 'akismet'); ?></h3>
@@ -82,10 +87,10 @@
82
  <div class="wrap alert critical">
83
  <?php if ( $level == 'yellow' ): ?>
84
  <h3 class="key-status failed"><?php esc_html_e("You're using your Akismet key on more sites than your Pro subscription allows.", 'akismet'); ?></h3>
85
- <p class="description"><?php printf( __('If you would like to use Akismet on more than 10 sites, you will need to <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>. If you have any questions, please <a href="%s" target="_blank">get in touch with our support team</a>', 'akismet'), 'https://akismet.com/account/', 'https://akismet.com/contact/'); ?></p>
86
  <?php elseif ( $level == 'red' ): ?>
87
  <h3 class="key-status failed"><?php esc_html_e("You're using Akismet on far too many sites for your Pro subscription.", 'akismet'); ?></h3>
88
- <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/', 'https://akismet.com/contact/'); ?></p>
89
  <?php endif; ?>
90
  </div>
91
  <?php endif;?>
63
  </div>
64
  <?php elseif ( $type == 'missing' ) :?>
65
  <div class="wrap alert critical">
66
+ <h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your key.', 'akismet'); ?></h3>
67
  <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
68
  </div>
69
+ <?php elseif ( $type == 'no-sub' ) :?>
70
+ <div class="wrap alert critical">
71
+ <h3 class="key-status failed"><?php esc_html_e( 'Your subscription is missing.', 'akismet'); ?></h3>
72
+ <p class="description"><?php printf( __('Since 2012, Akismet began using subscriptions for all accounts (even free ones). It looks like a subscription has not been assigned to your account, and we’d appreciate it if you’d <a href="%s" target="_blank">sign into your account</a> and choose one. 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>
73
+ </div>
74
  <?php elseif ( $type == 'new-key-valid' ) :?>
75
  <div class="wrap alert active">
76
  <h3 class="key-status"><?php esc_html_e('Your Akismet account has been successfully set up and activated. Happy blogging!', 'akismet'); ?></h3>
87
  <div class="wrap alert critical">
88
  <?php if ( $level == 'yellow' ): ?>
89
  <h3 class="key-status failed"><?php esc_html_e("You're using your Akismet key on more sites than your Pro subscription allows.", 'akismet'); ?></h3>
90
+ <p class="description"><?php printf( __('If you would like to use Akismet on more than 10 sites, you will need to <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>. If you have any questions, please <a href="%s" target="_blank">get in touch with our support team</a>', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?></p>
91
  <?php elseif ( $level == 'red' ): ?>
92
  <h3 class="key-status failed"><?php esc_html_e("You're using Akismet on far too many sites for your Pro subscription.", 'akismet'); ?></h3>
93
+ <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>
94
  <?php endif; ?>
95
  </div>
96
  <?php endif;?>
views/start.php CHANGED
@@ -1,52 +1,56 @@
1
  <div class="no-key config-wrap"><?php
2
- if ( $akismet_user ) :
3
- if ( $akismet_user->status == 'active' ) : // ask do they want to use akismet account found using jetpack wpcom connection ?>
4
- <p style="margin-right:10px"><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
5
  <div class="activate-highlight activate-option">
6
  <div class="option-description">
7
  <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
8
  <?php echo esc_attr( $akismet_user->user_email ); ?>
9
  </div>
10
- <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
11
- <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
12
- <input type="hidden" name="action" value="enter-key">
13
- <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
14
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this Akismet account' , 'akismet'); ?>"/>
15
  </form>
16
  </div>
17
- <div class="activate-highlight secondary activate-option">
18
- <div class="option-description">
19
- <strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
20
- <p><?php esc_html_e('Use this option if you want to setup a new Akismet account.', 'akismet'); ?></p>
21
- </div>
22
- <?php Akismet::view( 'get', array( 'text' => __( 'Register a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
23
- </div>
24
- <div class="activate-highlight secondary activate-option">
25
- <div class="option-description">
26
- <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
27
- <p><?php esc_html_e('If you have another API key you want to use.', 'akismet'); ?></p>
28
  </div>
29
- <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
30
- <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
31
- <input type="hidden" name="action" value="enter-key">
32
- <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
33
- <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
34
  </form>
35
  </div>
36
- <?php elseif ( $akismet_user->status == 'missing' ) : //no akismet account, ask do they want to use jetpack wpcom account to create one, then redirect to plans page?>
37
- <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. Register your email address below to get started.', 'akismet'); ?></p>
 
 
 
 
 
 
 
 
38
  <div class="activate-highlight activate-option">
39
  <div class="option-description">
40
  <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
41
  <?php echo esc_attr( $akismet_user->user_email ); ?>
42
  </div>
43
- <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right">
44
- <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
45
- <input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
46
- <input type="hidden" name="redirect" value="plugin-signup"/>
47
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
48
  </form>
49
  </div>
 
50
  <div class="activate-highlight secondary activate-option">
51
  <div class="option-description">
52
  <strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
@@ -57,7 +61,7 @@
57
  <div class="activate-highlight secondary activate-option">
58
  <div class="option-description">
59
  <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
60
- <p><?php esc_html_e('If you have another API key you want to use.', 'akismet'); ?></p>
61
  </div>
62
  <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
63
  <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
@@ -66,29 +70,19 @@
66
  <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
67
  </form>
68
  </div>
69
- <?php elseif ( $akismet_user->status == 'suspended' ) : //has an akismet account but the key is suspended, need to upgrade their account to unsuspend key ?>
70
- <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
71
- <div class="activate-highlight centered activate-option">
72
- <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
73
- <h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
74
- <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll help sort this out.', 'akismet'); ?></p>
75
- <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
76
-
77
- </div><?php
78
- endif;
79
- else :?>
80
  <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
81
  <div class="activate-highlight activate-option">
82
  <div class="option-description">
83
- <strong><?php esc_html_e( 'New to Akismet?' , 'akismet');?></strong>
84
- <p><?php esc_html_e('Get started now to squash the comment and trackback spam you get.', 'akismet'); ?></p>
85
  </div>
86
- <?php Akismet::view( 'get', array( 'text' => __( 'Get an Akismet account' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
87
  </div>
88
  <div class="activate-highlight secondary activate-option">
89
  <div class="option-description">
90
  <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
91
- <p><?php esc_html_e('If you have another API key you want to use.', 'akismet'); ?></p>
92
  </div>
93
  <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
94
  <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
1
  <div class="no-key config-wrap"><?php
2
+ if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
3
+ if ( $akismet_user->status == 'missing' ) :?>
4
+ <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. Register your email address below to get started.', 'akismet'); ?></p>
5
  <div class="activate-highlight activate-option">
6
  <div class="option-description">
7
  <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
8
  <?php echo esc_attr( $akismet_user->user_email ); ?>
9
  </div>
10
+ <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
11
+ <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
12
+ <input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
13
+ <input type="hidden" name="redirect" value="plugin-signup"/>
14
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
15
  </form>
16
  </div>
17
+ <?php elseif ( $akismet_user->status == 'cancelled' ) :?>
18
+ <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
19
+ <div class="activate-highlight activate-option">
20
+ <div class="option-description" style="width:75%;">
21
+ <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
22
+ <?php printf( esc_html__( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ); ?>
 
 
 
 
 
23
  </div>
24
+ <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
25
+ <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
26
+ <input type="hidden" name="user_id" value="<?php echo $akismet_user->ID;?>"/>
27
+ <input type="hidden" name="redirect" value="upgrade"/>
28
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
29
  </form>
30
  </div>
31
+ <?php elseif ( $akismet_user->status == 'suspended' ) : ?>
32
+ <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
33
+ <div class="activate-highlight centered activate-option">
34
+ <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
35
+ <h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
36
+ <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll help sort this out.', 'akismet'); ?></p>
37
+ <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
38
+ </div>
39
+ <?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
40
+ <p style="margin-right:10px"><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
41
  <div class="activate-highlight activate-option">
42
  <div class="option-description">
43
  <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
44
  <?php echo esc_attr( $akismet_user->user_email ); ?>
45
  </div>
46
+ <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
47
+ <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
48
+ <input type="hidden" name="action" value="enter-key">
49
+ <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
50
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this Akismet account' , 'akismet'); ?>"/>
51
  </form>
52
  </div>
53
+ <?php endif;?>
54
  <div class="activate-highlight secondary activate-option">
55
  <div class="option-description">
56
  <strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
61
  <div class="activate-highlight secondary activate-option">
62
  <div class="option-description">
63
  <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
64
+ <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
65
  </div>
66
  <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
67
  <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
70
  <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
71
  </form>
72
  </div>
73
+ <?php else :?>
 
 
 
 
 
 
 
 
 
 
74
  <p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
75
  <div class="activate-highlight activate-option">
76
  <div class="option-description">
77
+ <strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
78
+ <p><?php esc_html_e('Log in or create an account to get your API key.', 'akismet'); ?></p>
79
  </div>
80
+ <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
81
  </div>
82
  <div class="activate-highlight secondary activate-option">
83
  <div class="option-description">
84
  <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
85
+ <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
86
  </div>
87
  <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
88
  <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
views/stats.php CHANGED
@@ -1,4 +1,4 @@
1
  <div class="wrap">
2
  <h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
3
- <iframe src="<?php echo esc_url( sprintf( '%s://akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', is_ssl()?'https':'http', urlencode( get_bloginfo('url') ), Akismet::get_api_key() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
4
  </div>
1
  <div class="wrap">
2
  <h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
3
+ <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_bloginfo('url') ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
4
  </div>