1 |
commit: 07405d17c3ed619db3d8af200546e157a81ad11b |
2 |
Author: Theo Chatzimichos <tampakrap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 3 20:00:33 2013 +0000 |
4 |
Commit: Theo Chatzimichos <tampakrap <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 3 20:00:33 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/blogs-gentoo.git;a=commit;h=07405d17 |
7 |
|
8 |
Update akismet |
9 |
|
10 |
--- |
11 |
plugins/akismet/.htaccess | 11 ------- |
12 |
plugins/akismet/admin.php | 62 ++++++++++++++++++++++++---------------- |
13 |
plugins/akismet/akismet.php | 4 +-- |
14 |
plugins/akismet/img/logo.png | Bin 0 -> 2710 bytes |
15 |
plugins/akismet/img/logo@××.png | Bin 0 -> 1467 bytes |
16 |
plugins/akismet/readme.txt | 7 ++++- |
17 |
6 files changed, 46 insertions(+), 38 deletions(-) |
18 |
|
19 |
diff --git a/plugins/akismet/.htaccess b/plugins/akismet/.htaccess |
20 |
deleted file mode 100644 |
21 |
index cfad468..0000000 |
22 |
--- a/plugins/akismet/.htaccess |
23 |
+++ /dev/null |
24 |
@@ -1,11 +0,0 @@ |
25 |
-Order Deny,Allow |
26 |
-Deny from all |
27 |
- |
28 |
-<FilesMatch "^akismet\.(css|js)$"> |
29 |
- Allow from all |
30 |
-</FilesMatch> |
31 |
- |
32 |
-#allow access to any image |
33 |
-<FilesMatch "^(.+)\.(png|gif)$"> |
34 |
- Allow from all |
35 |
-</FilesMatch> |
36 |
\ No newline at end of file |
37 |
|
38 |
diff --git a/plugins/akismet/admin.php b/plugins/akismet/admin.php |
39 |
index 481b0f3..f807191 100644 |
40 |
--- a/plugins/akismet/admin.php |
41 |
+++ b/plugins/akismet/admin.php |
42 |
@@ -39,10 +39,10 @@ function akismet_load_js_and_css() { |
43 |
'plugins_page_akismet-key-config', |
44 |
'jetpack_page_akismet-key-config', |
45 |
) ) ) { |
46 |
- wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.4.4' ); |
47 |
+ wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.9' ); |
48 |
wp_enqueue_style( 'akismet.css'); |
49 |
|
50 |
- wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.4.6' ); |
51 |
+ wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.9' ); |
52 |
wp_enqueue_script( 'akismet.js' ); |
53 |
wp_localize_script( 'akismet.js', 'WPAkismet', array( |
54 |
'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ) |
55 |
@@ -67,11 +67,14 @@ add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 ); |
56 |
function akismet_conf() { |
57 |
global $akismet_nonce, $current_user; |
58 |
|
59 |
- $new_key_link = 'https://akismet.com/get/'; |
60 |
- $api_key = akismet_get_key(); |
61 |
- $show_key_form = $api_key; |
62 |
- $key_status = 'empty'; |
63 |
- $saved_ok = false; |
64 |
+ $new_key_link = 'https://akismet.com/get/'; |
65 |
+ $config_link = esc_url( add_query_arg( array( 'page' => 'akismet-key-config', 'show' => 'enter-api-key' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) ); |
66 |
+ $stats_link = esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ); |
67 |
+ $api_key = akismet_get_key(); |
68 |
+ $show_key_form = $api_key; |
69 |
+ $key_status = 'empty'; |
70 |
+ $saved_ok = false; |
71 |
+ $key_status_text = ''; |
72 |
|
73 |
$ms = array(); |
74 |
|
75 |
@@ -98,17 +101,17 @@ function akismet_conf() { |
76 |
$ms[] = 'key_empty'; |
77 |
} |
78 |
else |
79 |
- $key_status = akismet_verify_key( $key ); |
80 |
- |
81 |
+ $key_status = akismet_verify_key( $key ); |
82 |
+ |
83 |
if ( $key != $api_key && $key_status == 'valid' ) { |
84 |
- update_option('wordpress_api_key', $key); |
85 |
$ms[] = 'new_key_valid'; |
86 |
+ update_option('wordpress_api_key', $key); |
87 |
} |
88 |
elseif ( $key_status == 'invalid' ) |
89 |
$ms[] = 'new_key_invalid'; |
90 |
elseif ( $key_status == 'failed' ) |
91 |
$ms[] = 'new_key_failed'; |
92 |
- |
93 |
+ |
94 |
$api_key = $key_status == 'valid' ? $key : false; |
95 |
|
96 |
if ( isset( $_POST['akismet_discard_month'] ) ) |
97 |
@@ -130,6 +133,9 @@ function akismet_conf() { |
98 |
check_admin_referer( $akismet_nonce ); |
99 |
akismet_get_server_connectivity(0); |
100 |
} |
101 |
+ elseif ( isset( $_GET['show'] ) && $_GET['show'] == 'enter-api-key' ) { |
102 |
+ $show_key_form = true; |
103 |
+ } |
104 |
|
105 |
if ( $show_key_form ) { |
106 |
//check current key status |
107 |
@@ -154,7 +160,14 @@ function akismet_conf() { |
108 |
elseif ( !empty( $key ) && $key_status == 'failed' ) |
109 |
$ms[] = 'key_failed'; |
110 |
} |
111 |
- } |
112 |
+ } |
113 |
+ |
114 |
+ $key_status_strings = array( |
115 |
+ 'empty' => __( 'Empty' ), |
116 |
+ 'valid' => __( 'Valid' ), |
117 |
+ 'invalid' => __( 'Invalid' ), |
118 |
+ 'failed' => __( 'Failed' ), |
119 |
+ ); |
120 |
|
121 |
$messages = array( |
122 |
'new_key_empty' => array( 'class' => 'updated fade', 'text' => __('Your key has been cleared.' ) ), |
123 |
@@ -174,7 +187,7 @@ function akismet_conf() { |
124 |
<?php if ( !$api_key ) : ?> |
125 |
<h2 class="ak-header"><?php _e('Akismet'); ?></h2> |
126 |
<?php else: ?> |
127 |
- <h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ) ); ?></h2> |
128 |
+ <h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), $stats_link ); ?></h2> |
129 |
<?php endif; ?> |
130 |
<div class="no-key <?php echo $show_key_form ? 'hidden' : '';?>"> |
131 |
<p><?php _e('Akismet eliminates the comment and trackback spam you get on your site. To use Akismet you may need to sign up for an API key. Click the button below to get started.'); ?></p> |
132 |
@@ -182,10 +195,10 @@ function akismet_conf() { |
133 |
<input type="hidden" name="return" value="1"/> |
134 |
<input type="hidden" name="jetpack" value="<?php echo (string) class_exists( 'Jetpack' );?>"/> |
135 |
<input type="hidden" name="user" value="<?php echo esc_attr( $current_user->user_login );?>"/> |
136 |
- <input type="submit" class="button button-primary" value="<?php echo esc_attr( __('Create a new Akismet Key') ); ?>"/> |
137 |
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Create a new Akismet Key' ); ?>"/> |
138 |
</form> |
139 |
<br/> |
140 |
- <a href="#" class="switch-have-key"><?php _e('I already have a key'); ?></a> |
141 |
+ <a href="<?php echo $config_link;?>"><?php _e('I already have a key'); ?></a> |
142 |
</div> |
143 |
<div class="have-key <?php echo $show_key_form ? '' : 'hidden';?>"> |
144 |
<?php if ( !empty($_POST['submit'] ) && $saved_ok ) : ?> |
145 |
@@ -203,7 +216,7 @@ function akismet_conf() { |
146 |
<tr> |
147 |
<th><label for="key"><?php _e('Akismet API Key');?></label></th> |
148 |
<td> |
149 |
- <input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_html( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo ucfirst( $key_status );?></div> |
150 |
+ <input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo isset( $key_status_strings[ $key_status ] ) ? $key_status_strings[ $key_status ] : '';?></div> |
151 |
<p class="need-key description"><?php printf( __('You must enter a valid Akismet API key here. If you need an API key, you can <a href="%s">create one here</a>'), '#' );?></p> |
152 |
</td> |
153 |
</tr> |
154 |
@@ -212,8 +225,8 @@ function akismet_conf() { |
155 |
<th scope="row"><?php _e('Settings');?></th> |
156 |
<td> |
157 |
<fieldset><legend class="screen-reader-text"><span><?php _e('Settings');?></span></legend> |
158 |
- <label for="akismet_discard_month" title="<?php echo esc_attr( __( 'Auto-detete old spam' ) ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br> |
159 |
- <label for="akismet_show_user_comments_approved" title="<?php echo esc_attr( __( 'Show approved comments' ) ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label> |
160 |
+ <label for="akismet_discard_month" title="<?php esc_attr_e( 'Auto-detete old spam' ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br> |
161 |
+ <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label> |
162 |
</fieldset> |
163 |
</td> |
164 |
</tr> |
165 |
@@ -301,12 +314,13 @@ function akismet_conf() { |
166 |
function akismet_stats_display() { |
167 |
global $akismet_api_host, $akismet_api_port; |
168 |
|
169 |
- $blog = urlencode( get_bloginfo('url') ); |
170 |
- $api_key = akismet_get_key();?> |
171 |
+ $blog = urlencode( get_bloginfo('url') ); |
172 |
+ $api_key = akismet_get_key(); |
173 |
+ $config_link = esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) );?> |
174 |
|
175 |
<div class="wrap"><?php |
176 |
if ( !$api_key ) :?> |
177 |
- <div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet is almost ready.');?></strong> <?php printf( __( 'You must <a href="%1$s">enter your Akismet API key</a> for it to work.' ), esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), admin_url( 'admin.php' ) ) ) );?></p></div><?php |
178 |
+ <div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet is almost ready.');?></strong> <?php printf( __( 'You must <a href="%1$s">enter your Akismet API key</a> for it to work.' ), $config_link );?></p></div><?php |
179 |
else :?> |
180 |
<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', $blog, $api_key ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe><?php |
181 |
endif;?> |
182 |
@@ -368,7 +382,7 @@ function akismet_admin_warnings() { |
183 |
<style type="text/css"> |
184 |
.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 |
185 |
#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{ |
186 |
color:#FFF;font-weight:normal} |
187 |
</style> |
188 |
- <form name="akismet_activate" action="https://akismet.com/get/" method="POST"> |
189 |
+ <form name="akismet_activate" action="'.esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) ).'" method="POST"> |
190 |
<input type="hidden" name="return" value="1"/> |
191 |
<input type="hidden" name="jetpack" value="'.(string) class_exists( 'Jetpack' ).'"/> |
192 |
<input type="hidden" name="user" value="'.esc_attr( $current_user->user_login ).'"/> |
193 |
@@ -376,10 +390,10 @@ function akismet_admin_warnings() { |
194 |
<div class="aa_a">A</div> |
195 |
<div class="aa_button_container" onclick="document.akismet_activate.submit();"> |
196 |
<div class="aa_button_border"> |
197 |
- <div class="aa_button">Activate your Akismet account</div> |
198 |
+ <div class="aa_button">'.__('Activate your Akismet account').'</div> |
199 |
</div> |
200 |
</div> |
201 |
- <div class="aa_description"><strong>Almost done</strong> - activate your account and say goodbye to comment spam.</div> |
202 |
+ <div class="aa_description">'.__('<strong>Almost done</strong> - activate your account and say goodbye to comment spam').'</div> |
203 |
</div> |
204 |
</form> |
205 |
</div> |
206 |
|
207 |
diff --git a/plugins/akismet/akismet.php b/plugins/akismet/akismet.php |
208 |
index 1e622f6..b0b258d 100644 |
209 |
--- a/plugins/akismet/akismet.php |
210 |
+++ b/plugins/akismet/akismet.php |
211 |
@@ -6,7 +6,7 @@ |
212 |
Plugin Name: Akismet |
213 |
Plugin URI: http://akismet.com/?return=true |
214 |
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. |
215 |
-Version: 2.5.8 |
216 |
+Version: 2.5.9 |
217 |
Author: Automattic |
218 |
Author URI: http://automattic.com/wordpress-plugins/ |
219 |
License: GPLv2 or later |
220 |
@@ -34,7 +34,7 @@ if ( !function_exists( 'add_action' ) ) { |
221 |
exit; |
222 |
} |
223 |
|
224 |
-define('AKISMET_VERSION', '2.5.8'); |
225 |
+define('AKISMET_VERSION', '2.5.9'); |
226 |
define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ )); |
227 |
|
228 |
/** If you hardcode a WP.com API key here, all key config screens will be hidden */ |
229 |
|
230 |
diff --git a/plugins/akismet/img/logo.png b/plugins/akismet/img/logo.png |
231 |
new file mode 100644 |
232 |
index 0000000..b5f5b9a |
233 |
Binary files /dev/null and b/plugins/akismet/img/logo.png differ |
234 |
|
235 |
diff --git a/plugins/akismet/img/logo@××.png b/plugins/akismet/img/logo@××.png |
236 |
new file mode 100644 |
237 |
index 0000000..80c835b |
238 |
Binary files /dev/null and b/plugins/akismet/img/logo@××.png differ |
239 |
|
240 |
diff --git a/plugins/akismet/readme.txt b/plugins/akismet/readme.txt |
241 |
index 597749e..d0094d2 100644 |
242 |
--- a/plugins/akismet/readme.txt |
243 |
+++ b/plugins/akismet/readme.txt |
244 |
@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo |
245 |
Tags: akismet, comments, spam |
246 |
Requires at least: 3.0 |
247 |
Tested up to: 3.6 |
248 |
-Stable tag: 2.5.8 |
249 |
+Stable tag: 2.5.9 |
250 |
License: GPLv2 or later |
251 |
|
252 |
Akismet checks your comments against the Akismet web service to see if they look like spam or not. |
253 |
@@ -31,6 +31,11 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co |
254 |
|
255 |
== Changelog == |
256 |
|
257 |
+= 2.5.9 = |
258 |
+* Update 'Already have a key' link to redirect page rather than depend on javascript |
259 |
+* Fix some non-translatable strings to be translatable |
260 |
+* Update Activation banner in plugins page to redirect user to Akismet config page |
261 |
+ |
262 |
= 2.5.8 = |
263 |
* Simplify the activation process for new users |
264 |
* Remove the reporter_ip parameter |