Gentoo Archives: gentoo-commits

From: Yury German <blueknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/blogs-gentoo:master commit in: plugins/akismet/_inc/, plugins/akismet/, plugins/akismet/views/
Date: Sat, 13 Feb 2016 21:44:52
Message-Id: 1455399877.092a5e8113ae914bbdd4a90f5a271b3ece1b48b4.blueknight@gentoo
1 commit: 092a5e8113ae914bbdd4a90f5a271b3ece1b48b4
2 Author: Yury German <blueknight <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 13 21:44:37 2016 +0000
4 Commit: Yury German <blueknight <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 13 21:44:37 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/blogs-gentoo.git/commit/?id=092a5e81
7
8 Bug 574468 forgot akismet
9
10 plugins/akismet/LICENSE.txt | 339 ++++++++++++++++++++++++++++++++
11 plugins/akismet/_inc/akismet.css | 116 ++++++++++-
12 plugins/akismet/_inc/akismet.js | 108 ++++++----
13 plugins/akismet/akismet.php | 8 +-
14 plugins/akismet/class.akismet-admin.php | 221 ++++++++++++++++-----
15 plugins/akismet/class.akismet.php | 144 ++++++++++----
16 plugins/akismet/readme.txt | 47 ++++-
17 plugins/akismet/views/config.php | 16 +-
18 plugins/akismet/views/get.php | 1 +
19 plugins/akismet/views/notice.php | 69 ++++---
20 plugins/akismet/views/start.php | 44 +++--
21 plugins/akismet/views/strict.php | 24 ++-
22 12 files changed, 939 insertions(+), 198 deletions(-)
23
24 diff --git a/plugins/akismet/LICENSE.txt b/plugins/akismet/LICENSE.txt
25 new file mode 100644
26 index 0000000..d159169
27 --- /dev/null
28 +++ b/plugins/akismet/LICENSE.txt
29 @@ -0,0 +1,339 @@
30 + GNU GENERAL PUBLIC LICENSE
31 + Version 2, June 1991
32 +
33 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
34 + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 + Everyone is permitted to copy and distribute verbatim copies
36 + of this license document, but changing it is not allowed.
37 +
38 + Preamble
39 +
40 + The licenses for most software are designed to take away your
41 +freedom to share and change it. By contrast, the GNU General Public
42 +License is intended to guarantee your freedom to share and change free
43 +software--to make sure the software is free for all its users. This
44 +General Public License applies to most of the Free Software
45 +Foundation's software and to any other program whose authors commit to
46 +using it. (Some other Free Software Foundation software is covered by
47 +the GNU Lesser General Public License instead.) You can apply it to
48 +your programs, too.
49 +
50 + When we speak of free software, we are referring to freedom, not
51 +price. Our General Public Licenses are designed to make sure that you
52 +have the freedom to distribute copies of free software (and charge for
53 +this service if you wish), that you receive source code or can get it
54 +if you want it, that you can change the software or use pieces of it
55 +in new free programs; and that you know you can do these things.
56 +
57 + To protect your rights, we need to make restrictions that forbid
58 +anyone to deny you these rights or to ask you to surrender the rights.
59 +These restrictions translate to certain responsibilities for you if you
60 +distribute copies of the software, or if you modify it.
61 +
62 + For example, if you distribute copies of such a program, whether
63 +gratis or for a fee, you must give the recipients all the rights that
64 +you have. You must make sure that they, too, receive or can get the
65 +source code. And you must show them these terms so they know their
66 +rights.
67 +
68 + We protect your rights with two steps: (1) copyright the software, and
69 +(2) offer you this license which gives you legal permission to copy,
70 +distribute and/or modify the software.
71 +
72 + Also, for each author's protection and ours, we want to make certain
73 +that everyone understands that there is no warranty for this free
74 +software. If the software is modified by someone else and passed on, we
75 +want its recipients to know that what they have is not the original, so
76 +that any problems introduced by others will not reflect on the original
77 +authors' reputations.
78 +
79 + Finally, any free program is threatened constantly by software
80 +patents. We wish to avoid the danger that redistributors of a free
81 +program will individually obtain patent licenses, in effect making the
82 +program proprietary. To prevent this, we have made it clear that any
83 +patent must be licensed for everyone's free use or not licensed at all.
84 +
85 + The precise terms and conditions for copying, distribution and
86 +modification follow.
87 +
88 + GNU GENERAL PUBLIC LICENSE
89 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
90 +
91 + 0. This License applies to any program or other work which contains
92 +a notice placed by the copyright holder saying it may be distributed
93 +under the terms of this General Public License. The "Program", below,
94 +refers to any such program or work, and a "work based on the Program"
95 +means either the Program or any derivative work under copyright law:
96 +that is to say, a work containing the Program or a portion of it,
97 +either verbatim or with modifications and/or translated into another
98 +language. (Hereinafter, translation is included without limitation in
99 +the term "modification".) Each licensee is addressed as "you".
100 +
101 +Activities other than copying, distribution and modification are not
102 +covered by this License; they are outside its scope. The act of
103 +running the Program is not restricted, and the output from the Program
104 +is covered only if its contents constitute a work based on the
105 +Program (independent of having been made by running the Program).
106 +Whether that is true depends on what the Program does.
107 +
108 + 1. You may copy and distribute verbatim copies of the Program's
109 +source code as you receive it, in any medium, provided that you
110 +conspicuously and appropriately publish on each copy an appropriate
111 +copyright notice and disclaimer of warranty; keep intact all the
112 +notices that refer to this License and to the absence of any warranty;
113 +and give any other recipients of the Program a copy of this License
114 +along with the Program.
115 +
116 +You may charge a fee for the physical act of transferring a copy, and
117 +you may at your option offer warranty protection in exchange for a fee.
118 +
119 + 2. You may modify your copy or copies of the Program or any portion
120 +of it, thus forming a work based on the Program, and copy and
121 +distribute such modifications or work under the terms of Section 1
122 +above, provided that you also meet all of these conditions:
123 +
124 + a) You must cause the modified files to carry prominent notices
125 + stating that you changed the files and the date of any change.
126 +
127 + b) You must cause any work that you distribute or publish, that in
128 + whole or in part contains or is derived from the Program or any
129 + part thereof, to be licensed as a whole at no charge to all third
130 + parties under the terms of this License.
131 +
132 + c) If the modified program normally reads commands interactively
133 + when run, you must cause it, when started running for such
134 + interactive use in the most ordinary way, to print or display an
135 + announcement including an appropriate copyright notice and a
136 + notice that there is no warranty (or else, saying that you provide
137 + a warranty) and that users may redistribute the program under
138 + these conditions, and telling the user how to view a copy of this
139 + License. (Exception: if the Program itself is interactive but
140 + does not normally print such an announcement, your work based on
141 + the Program is not required to print an announcement.)
142 +
143 +These requirements apply to the modified work as a whole. If
144 +identifiable sections of that work are not derived from the Program,
145 +and can be reasonably considered independent and separate works in
146 +themselves, then this License, and its terms, do not apply to those
147 +sections when you distribute them as separate works. But when you
148 +distribute the same sections as part of a whole which is a work based
149 +on the Program, the distribution of the whole must be on the terms of
150 +this License, whose permissions for other licensees extend to the
151 +entire whole, and thus to each and every part regardless of who wrote it.
152 +
153 +Thus, it is not the intent of this section to claim rights or contest
154 +your rights to work written entirely by you; rather, the intent is to
155 +exercise the right to control the distribution of derivative or
156 +collective works based on the Program.
157 +
158 +In addition, mere aggregation of another work not based on the Program
159 +with the Program (or with a work based on the Program) on a volume of
160 +a storage or distribution medium does not bring the other work under
161 +the scope of this License.
162 +
163 + 3. You may copy and distribute the Program (or a work based on it,
164 +under Section 2) in object code or executable form under the terms of
165 +Sections 1 and 2 above provided that you also do one of the following:
166 +
167 + a) Accompany it with the complete corresponding machine-readable
168 + source code, which must be distributed under the terms of Sections
169 + 1 and 2 above on a medium customarily used for software interchange; or,
170 +
171 + b) Accompany it with a written offer, valid for at least three
172 + years, to give any third party, for a charge no more than your
173 + cost of physically performing source distribution, a complete
174 + machine-readable copy of the corresponding source code, to be
175 + distributed under the terms of Sections 1 and 2 above on a medium
176 + customarily used for software interchange; or,
177 +
178 + c) Accompany it with the information you received as to the offer
179 + to distribute corresponding source code. (This alternative is
180 + allowed only for noncommercial distribution and only if you
181 + received the program in object code or executable form with such
182 + an offer, in accord with Subsection b above.)
183 +
184 +The source code for a work means the preferred form of the work for
185 +making modifications to it. For an executable work, complete source
186 +code means all the source code for all modules it contains, plus any
187 +associated interface definition files, plus the scripts used to
188 +control compilation and installation of the executable. However, as a
189 +special exception, the source code distributed need not include
190 +anything that is normally distributed (in either source or binary
191 +form) with the major components (compiler, kernel, and so on) of the
192 +operating system on which the executable runs, unless that component
193 +itself accompanies the executable.
194 +
195 +If distribution of executable or object code is made by offering
196 +access to copy from a designated place, then offering equivalent
197 +access to copy the source code from the same place counts as
198 +distribution of the source code, even though third parties are not
199 +compelled to copy the source along with the object code.
200 +
201 + 4. You may not copy, modify, sublicense, or distribute the Program
202 +except as expressly provided under this License. Any attempt
203 +otherwise to copy, modify, sublicense or distribute the Program is
204 +void, and will automatically terminate your rights under this License.
205 +However, parties who have received copies, or rights, from you under
206 +this License will not have their licenses terminated so long as such
207 +parties remain in full compliance.
208 +
209 + 5. You are not required to accept this License, since you have not
210 +signed it. However, nothing else grants you permission to modify or
211 +distribute the Program or its derivative works. These actions are
212 +prohibited by law if you do not accept this License. Therefore, by
213 +modifying or distributing the Program (or any work based on the
214 +Program), you indicate your acceptance of this License to do so, and
215 +all its terms and conditions for copying, distributing or modifying
216 +the Program or works based on it.
217 +
218 + 6. Each time you redistribute the Program (or any work based on the
219 +Program), the recipient automatically receives a license from the
220 +original licensor to copy, distribute or modify the Program subject to
221 +these terms and conditions. You may not impose any further
222 +restrictions on the recipients' exercise of the rights granted herein.
223 +You are not responsible for enforcing compliance by third parties to
224 +this License.
225 +
226 + 7. If, as a consequence of a court judgment or allegation of patent
227 +infringement or for any other reason (not limited to patent issues),
228 +conditions are imposed on you (whether by court order, agreement or
229 +otherwise) that contradict the conditions of this License, they do not
230 +excuse you from the conditions of this License. If you cannot
231 +distribute so as to satisfy simultaneously your obligations under this
232 +License and any other pertinent obligations, then as a consequence you
233 +may not distribute the Program at all. For example, if a patent
234 +license would not permit royalty-free redistribution of the Program by
235 +all those who receive copies directly or indirectly through you, then
236 +the only way you could satisfy both it and this License would be to
237 +refrain entirely from distribution of the Program.
238 +
239 +If any portion of this section is held invalid or unenforceable under
240 +any particular circumstance, the balance of the section is intended to
241 +apply and the section as a whole is intended to apply in other
242 +circumstances.
243 +
244 +It is not the purpose of this section to induce you to infringe any
245 +patents or other property right claims or to contest validity of any
246 +such claims; this section has the sole purpose of protecting the
247 +integrity of the free software distribution system, which is
248 +implemented by public license practices. Many people have made
249 +generous contributions to the wide range of software distributed
250 +through that system in reliance on consistent application of that
251 +system; it is up to the author/donor to decide if he or she is willing
252 +to distribute software through any other system and a licensee cannot
253 +impose that choice.
254 +
255 +This section is intended to make thoroughly clear what is believed to
256 +be a consequence of the rest of this License.
257 +
258 + 8. If the distribution and/or use of the Program is restricted in
259 +certain countries either by patents or by copyrighted interfaces, the
260 +original copyright holder who places the Program under this License
261 +may add an explicit geographical distribution limitation excluding
262 +those countries, so that distribution is permitted only in or among
263 +countries not thus excluded. In such case, this License incorporates
264 +the limitation as if written in the body of this License.
265 +
266 + 9. The Free Software Foundation may publish revised and/or new versions
267 +of the General Public License from time to time. Such new versions will
268 +be similar in spirit to the present version, but may differ in detail to
269 +address new problems or concerns.
270 +
271 +Each version is given a distinguishing version number. If the Program
272 +specifies a version number of this License which applies to it and "any
273 +later version", you have the option of following the terms and conditions
274 +either of that version or of any later version published by the Free
275 +Software Foundation. If the Program does not specify a version number of
276 +this License, you may choose any version ever published by the Free Software
277 +Foundation.
278 +
279 + 10. If you wish to incorporate parts of the Program into other free
280 +programs whose distribution conditions are different, write to the author
281 +to ask for permission. For software which is copyrighted by the Free
282 +Software Foundation, write to the Free Software Foundation; we sometimes
283 +make exceptions for this. Our decision will be guided by the two goals
284 +of preserving the free status of all derivatives of our free software and
285 +of promoting the sharing and reuse of software generally.
286 +
287 + NO WARRANTY
288 +
289 + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
290 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
291 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
292 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
293 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
294 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
295 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
296 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
297 +REPAIR OR CORRECTION.
298 +
299 + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
300 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
301 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
302 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
303 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
304 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
305 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
306 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
307 +POSSIBILITY OF SUCH DAMAGES.
308 +
309 + END OF TERMS AND CONDITIONS
310 +
311 + How to Apply These Terms to Your New Programs
312 +
313 + If you develop a new program, and you want it to be of the greatest
314 +possible use to the public, the best way to achieve this is to make it
315 +free software which everyone can redistribute and change under these terms.
316 +
317 + To do so, attach the following notices to the program. It is safest
318 +to attach them to the start of each source file to most effectively
319 +convey the exclusion of warranty; and each file should have at least
320 +the "copyright" line and a pointer to where the full notice is found.
321 +
322 + <one line to give the program's name and a brief idea of what it does.>
323 + Copyright (C) <year> <name of author>
324 +
325 + This program is free software; you can redistribute it and/or modify
326 + it under the terms of the GNU General Public License as published by
327 + the Free Software Foundation; either version 2 of the License, or
328 + (at your option) any later version.
329 +
330 + This program is distributed in the hope that it will be useful,
331 + but WITHOUT ANY WARRANTY; without even the implied warranty of
332 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333 + GNU General Public License for more details.
334 +
335 + You should have received a copy of the GNU General Public License along
336 + with this program; if not, write to the Free Software Foundation, Inc.,
337 + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
338 +
339 +Also add information on how to contact you by electronic and paper mail.
340 +
341 +If the program is interactive, make it output a short notice like this
342 +when it starts in an interactive mode:
343 +
344 + Gnomovision version 69, Copyright (C) year name of author
345 + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
346 + This is free software, and you are welcome to redistribute it
347 + under certain conditions; type `show c' for details.
348 +
349 +The hypothetical commands `show w' and `show c' should show the appropriate
350 +parts of the General Public License. Of course, the commands you use may
351 +be called something other than `show w' and `show c'; they could even be
352 +mouse-clicks or menu items--whatever suits your program.
353 +
354 +You should also get your employer (if you work as a programmer) or your
355 +school, if any, to sign a "copyright disclaimer" for the program, if
356 +necessary. Here is a sample; alter the names:
357 +
358 + Yoyodyne, Inc., hereby disclaims all copyright interest in the program
359 + `Gnomovision' (which makes passes at compilers) written by James Hacker.
360 +
361 + <signature of Ty Coon>, 1 April 1989
362 + Ty Coon, President of Vice
363 +
364 +This General Public License does not permit incorporating your program into
365 +proprietary programs. If your program is a subroutine library, you may
366 +consider it more useful to permit linking proprietary applications with the
367 +library. If this is what you want to do, use the GNU Lesser General
368 +Public License instead of this License.
369
370 diff --git a/plugins/akismet/_inc/akismet.css b/plugins/akismet/_inc/akismet.css
371 index b754ec6..d38e14b 100644
372 --- a/plugins/akismet/_inc/akismet.css
373 +++ b/plugins/akismet/_inc/akismet.css
374 @@ -33,13 +33,14 @@
375 color: #AAA;
376 font-style: italic;
377 }
378 -span.comment-link a {
379 +table.comments td.comment p a {
380 text-decoration: underline;
381 }
382 -span.comment-link:after {
383 - content: " "attr(title) " ";
384 +table.comments td.comment p a:after {
385 + content: attr(href);
386 color: #aaa;
387 - text-decoration: none;
388 + display: inline-block; /* Show the URL without the link's underline extending under it. */
389 + padding: 0 1ex; /* Because it's inline block, we can't just use spaces in the content: attribute to separate it from the link text. */
390 }
391 .mshot-arrow {
392 width: 0;
393 @@ -63,6 +64,15 @@ span.comment-link:after {
394 border-radius: 6px;
395 -webkit-border-radius: 6px;
396 }
397 +.akismet-mshot {
398 + position: absolute;
399 + z-index: 100;
400 +}
401 +.akismet-mshot .mshot-image {
402 + margin: 0;
403 + height: 338px;
404 + width: 450px;
405 +}
406 h2.ak-header {
407 padding: 30px;
408 background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
409 @@ -363,4 +373,102 @@ h2.ak-header {
410
411 .clearfix {
412 clear:both;
413 +}
414 +
415 +/**
416 + * For the activation notice on the plugins page.
417 + */
418 +.akismet_activate {
419 + min-width: 825px;
420 + border: 1px solid #4F800D;
421 + padding: 5px;
422 + margin: 15px 0;
423 + background: #83AF24;
424 + background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D));
425 + background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24);
426 + -moz-border-radius: 3px;
427 + border-radius: 3px;
428 + -webkit-border-radius: 3px;
429 + position: relative;
430 + overflow: hidden;
431 +}
432 +
433 +.akismet_activate .aa_a {
434 + position: absolute;
435 + top: -5px;
436 + right: 10px;
437 + font-size: 140px;
438 + color: #769F33;
439 + font-family: Georgia, "Times New Roman", Times, serif;
440 + z-index: 1;
441 +}
442 +
443 +.akismet_activate .aa_button {
444 + font-weight: bold;
445 + border: 1px solid #029DD6;
446 + border-top: 1px solid #06B9FD;
447 + font-size: 15px;
448 + text-align: center;
449 + padding: 9px 0 8px 0;
450 + color: #FFF;
451 + background: #029DD6;
452 + background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
453 + background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
454 + -moz-border-radius: 2px;
455 + border-radius: 2px;
456 + -webkit-border-radius: 2px;
457 + width: 100%;
458 + cursor: pointer;
459 + margin: 0;
460 +}
461 +
462 +.akismet_activate .aa_button:hover {
463 + text-decoration: none !important;
464 + border: 1px solid #029DD6;
465 + border-bottom: 1px solid #00A8EF;
466 + font-size: 15px;
467 + text-align: center;
468 + padding: 9px 0 8px 0;
469 + color: #F0F8FB;
470 + background: #0079B1;
471 + background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF));
472 + background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1);
473 + -moz-border-radius: 2px;
474 + border-radius: 2px;
475 + -webkit-border-radius: 2px;
476 +}
477 +
478 +.akismet_activate .aa_button_border {
479 + border: 1px solid #006699;
480 + -moz-border-radius: 2px;
481 + border-radius: 2px;
482 + -webkit-border-radius: 2px;
483 + background: #029DD6;
484 + background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
485 + background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
486 +}
487 +
488 +.akismet_activate .aa_button_container {
489 + display: inline-block;
490 + background: #DEF1B8;
491 + padding: 5px;
492 + -moz-border-radius: 2px;
493 + border-radius: 2px;
494 + -webkit-border-radius: 2px;
495 + width: 266px;
496 +}
497 +
498 +.akismet_activate .aa_description {
499 + position: absolute;
500 + top: 22px;
501 + left: 285px;
502 + margin-left: 25px;
503 + color: #E5F2B1;
504 + font-size: 15px;
505 + z-index: 1000;
506 +}
507 +
508 +.akismet_activate .aa_description strong {
509 + color: #FFF;
510 + font-weight: normal;
511 }
512 \ No newline at end of file
513
514 diff --git a/plugins/akismet/_inc/akismet.js b/plugins/akismet/_inc/akismet.js
515 index 5e857d1..101db40 100644
516 --- a/plugins/akismet/_inc/akismet.js
517 +++ b/plugins/akismet/_inc/akismet.js
518 @@ -1,4 +1,8 @@
519 jQuery( function ( $ ) {
520 + var mshotRemovalTimer = null;
521 + var mshotSecondTryTimer = null
522 + var mshotThirdTryTimer = null
523 +
524 $( 'a.activate-option' ).click( function(){
525 var link = $( this );
526 if ( link.hasClass( 'clicked' ) ) {
527 @@ -18,20 +22,27 @@ jQuery( function ( $ ) {
528 var thisId = $(this).attr('commentid');
529 $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
530 });
531 - $('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title]').each(function () {
532 - // Comment author URLs are the only URL with a title attribute in the author column.
533 - var thisTitle = $(this).attr('title');
534 + $('#the-comment-list')
535 + .find('tr.comment, tr[id ^= "comment-"]')
536 + .find('.column-author a[href^="http"]:first') // Ignore mailto: links, which would be the comment author's email.
537 + .each(function () {
538 + var linkHref = $(this).attr( 'href' );
539 +
540 + // Ignore any links to the current domain, which are diagnostic tools, like the IP address link
541 + // or any other links another plugin might add.
542 + var currentHostParts = document.location.href.split( '/' );
543 + var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/';
544 +
545 + if ( linkHref.indexOf( currentHost ) != 0 ) {
546 + var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
547
548 - var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
549 -
550 - $(this).attr("id", "author_comment_url_"+ thisCommentId[1]);
551 -
552 - if (thisTitle) {
553 - $(this).after(
554 - $( '<a href="#" class="remove_url">x</a>' )
555 - .attr( 'commentid', thisCommentId[1] )
556 - .attr( 'title', WPAkismet.strings['Remove this URL'] )
557 - );
558 + $(this)
559 + .attr("id", "author_comment_url_"+ thisCommentId[1])
560 + .after(
561 + $( '<a href="#" class="remove_url">x</a>' )
562 + .attr( 'commentid', thisCommentId[1] )
563 + .attr( 'title', WPAkismet.strings['Remove this URL'] )
564 + );
565 }
566 });
567 $('.remove_url').live('click', function () {
568 @@ -101,30 +112,55 @@ jQuery( function ( $ ) {
569
570 return false;
571 });
572 - $('a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type').mouseover(function () {
573 - var wpcomProtocol = ( 'https:' === location.protocol ) ? 'https://' : 'http://';
574 - // Need to determine size of author column
575 - var thisParentWidth = $(this).parent().width();
576 - // It changes based on if there is a gravatar present
577 - thisParentWidth = ($(this).parent().find('.grav-hijack').length) ? thisParentWidth - 42 + 'px' : thisParentWidth + 'px';
578 - if ($(this).find('.mShot').length == 0 && !$(this).hasClass('akismet_undo_link_removal')) {
579 - var self = $( this );
580 - $('.widefat td').css('overflow', 'visible');
581 - $(this).css('position', 'relative');
582 - var thisHref = $.URLEncode( $(this).attr('href') );
583 - $(this).append('<div class="mShot mshot-container" style="left: '+thisParentWidth+'"><div class="mshot-arrow"></div><img src="//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450" width="450" class="mshot-image" style="margin: 0;" /></div>');
584 - setTimeout(function () {
585 - self.find( '.mshot-image' ).attr('src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2');
586 - }, 6000);
587 - setTimeout(function () {
588 - self.find( '.mshot-image' ).attr('src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3');
589 - }, 12000);
590 - } else {
591 - $(this).find('.mShot').css('left', thisParentWidth).show();
592 +
593 + // Show a preview image of the hovered URL. Applies to author URLs and URLs inside the comments.
594 + $( 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, table.comments td.comment p a' ).mouseover( function () {
595 + clearTimeout( mshotRemovalTimer );
596 +
597 + if ( $( '.akismet-mshot' ).length > 0 ) {
598 + if ( $( '.akismet-mshot:first' ).data( 'link' ) == this ) {
599 + // The preview is already showing for this link.
600 + return;
601 + }
602 + else {
603 + // A new link is being hovered, so remove the old preview.
604 + $( '.akismet-mshot' ).remove();
605 + }
606 }
607 - }).mouseout(function () {
608 - $(this).find('.mShot').hide();
609 - });
610 +
611 + clearTimeout( mshotSecondTryTimer );
612 + clearTimeout( mshotThirdTryTimer );
613 +
614 + var thisHref = $.URLEncode( $( this ).attr( 'href' ) );
615 +
616 + var mShot = $( '<div class="akismet-mshot mshot-container"><div class="mshot-arrow"></div><img src="//s0.wordpress.com/mshots/v1/' + thisHref + '?w=450" width="450" height="338" class="mshot-image" /></div>' );
617 + mShot.data( 'link', this );
618 +
619 + var offset = $( this ).offset();
620 +
621 + mShot.offset( {
622 + left : Math.min( $( window ).width() - 475, offset.left + $( this ).width() + 10 ), // Keep it on the screen if the link is near the edge of the window.
623 + top: offset.top + ( $( this ).height() / 2 ) - 101 // 101 = top offset of the arrow plus the top border thickness
624 + } );
625 +
626 + mshotSecondTryTimer = setTimeout( function () {
627 + mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2' );
628 + }, 6000 );
629 +
630 + mshotThirdTryTimer = setTimeout( function () {
631 + mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3' );
632 + }, 12000 );
633 +
634 + $( 'body' ).append( mShot );
635 + } ).mouseout( function () {
636 + mshotRemovalTimer = setTimeout( function () {
637 + clearTimeout( mshotSecondTryTimer );
638 + clearTimeout( mshotThirdTryTimer );
639 +
640 + $( '.akismet-mshot' ).remove();
641 + }, 200 );
642 + } );
643 +
644 $('.checkforspam:not(.button-disabled)').click( function(e) {
645 $('.checkforspam:not(.button-disabled)').addClass('button-disabled');
646 $('.checkforspam-spinner').addClass( 'spinner' );
647
648 diff --git a/plugins/akismet/akismet.php b/plugins/akismet/akismet.php
649 index 5cdd32a..2c13942 100644
650 --- a/plugins/akismet/akismet.php
651 +++ b/plugins/akismet/akismet.php
652 @@ -5,8 +5,8 @@
653 /*
654 Plugin Name: Akismet
655 Plugin URI: http://akismet.com/
656 -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.
657 -Version: 3.1.1
658 +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.
659 +Version: 3.1.7
660 Author: Automattic
661 Author URI: http://automattic.com/wordpress-plugins/
662 License: GPLv2 or later
663 @@ -27,6 +27,8 @@ GNU General Public License for more details.
664 You should have received a copy of the GNU General Public License
665 along with this program; if not, write to the Free Software
666 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
667 +
668 +Copyright 2005-2015 Automattic, Inc.
669 */
670
671 // Make sure we don't expose any info if called directly
672 @@ -35,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
673 exit;
674 }
675
676 -define( 'AKISMET_VERSION', '3.1.1' );
677 +define( 'AKISMET_VERSION', '3.1.7' );
678 define( 'AKISMET__MINIMUM_WP_VERSION', '3.2' );
679 define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
680 define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
681
682 diff --git a/plugins/akismet/class.akismet-admin.php b/plugins/akismet/class.akismet-admin.php
683 index 840b367..863d1ca 100644
684 --- a/plugins/akismet/class.akismet-admin.php
685 +++ b/plugins/akismet/class.akismet-admin.php
686 @@ -4,7 +4,25 @@ class Akismet_Admin {
687 const NONCE = 'akismet-update-key';
688
689 private static $initiated = false;
690 - private static $notices = array();
691 + private static $notices = array();
692 + private static $allowed = array(
693 + 'a' => array(
694 + 'href' => true,
695 + 'title' => true,
696 + ),
697 + 'b' => array(),
698 + 'code' => array(),
699 + 'del' => array(
700 + 'datetime' => true,
701 + ),
702 + 'em' => array(),
703 + 'i' => array(),
704 + 'q' => array(
705 + 'cite' => true,
706 + ),
707 + 'strike' => array(),
708 + 'strong' => array(),
709 + );
710
711 public static function init() {
712 if ( ! self::$initiated ) {
713 @@ -41,7 +59,6 @@ class Akismet_Admin {
714
715 add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
716 add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
717 - add_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) );
718
719 add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
720
721 @@ -92,6 +109,7 @@ class Akismet_Admin {
722 'post.php',
723 'settings_page_akismet-key-config',
724 'jetpack_page_akismet-key-config',
725 + 'plugins.php',
726 ) ) ) {
727 wp_register_style( 'akismet.css', AKISMET__PLUGIN_URL . '_inc/akismet.css', array(), AKISMET_VERSION );
728 wp_enqueue_style( 'akismet.css');
729 @@ -129,8 +147,8 @@ class Akismet_Admin {
730 'title' => __( 'Overview' , 'akismet'),
731 'content' =>
732 '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
733 - '<p>' . esc_html__( 'Akismet filters out your comment and trackback spam for you, so you can focus on more important things.' , 'akismet') . '</p>' .
734 - '<p>' . esc_html__( 'On this page, you are able to setup the Akismet plugin.' , 'akismet') . '</p>',
735 + '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
736 + '<p>' . esc_html__( 'On this page, you are able to set up the Akismet plugin.' , 'akismet') . '</p>',
737 )
738 );
739
740 @@ -141,7 +159,7 @@ class Akismet_Admin {
741 'content' =>
742 '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
743 '<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '</p>' .
744 - '<p>' . sprintf( __( 'Signup for an account on %s to get an API Key.' , 'akismet'), '<a href="https://akismet.com/plugin-signup/" target="_blank">Akismet.com</a>' ) . '</p>',
745 + '<p>' . sprintf( __( 'Sign up for an account on %s to get an API Key.' , 'akismet'), '<a href="https://akismet.com/plugin-signup/" target="_blank">Akismet.com</a>' ) . '</p>',
746 )
747 );
748
749 @@ -167,7 +185,7 @@ class Akismet_Admin {
750 'title' => __( 'Overview' , 'akismet'),
751 'content' =>
752 '<p><strong>' . esc_html__( 'Akismet Stats' , 'akismet') . '</strong></p>' .
753 - '<p>' . esc_html__( 'Akismet filters out your comment and trackback spam for you, so you can focus on more important things.' , 'akismet') . '</p>' .
754 + '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
755 '<p>' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '</p>',
756 )
757 );
758 @@ -180,7 +198,7 @@ class Akismet_Admin {
759 'title' => __( 'Overview' , 'akismet'),
760 'content' =>
761 '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
762 - '<p>' . esc_html__( 'Akismet filters out your comment and trackback spam for you, so you can focus on more important things.' , 'akismet') . '</p>' .
763 + '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
764 '<p>' . esc_html__( 'On this page, you are able to enter/remove an API key, view account information and view spam stats.' , 'akismet') . '</p>',
765 )
766 );
767 @@ -232,7 +250,7 @@ class Akismet_Admin {
768 if ( defined( 'WPCOM_API_KEY' ) )
769 return false; //shouldn't have option to save key if already defined
770
771 - $new_key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
772 + $new_key = preg_replace( '/[^a-f0-9]/i', '', $_POST['key'] );
773 $old_key = Akismet::get_api_key();
774
775 if ( empty( $new_key ) ) {
776 @@ -258,8 +276,10 @@ class Akismet_Admin {
777 if ( in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ) )
778 update_option( 'wordpress_api_key', $api_key );
779
780 - if ( $akismet_user->status == 'active' )
781 + if ( $akismet_user->status == 'active' )
782 self::$notices['status'] = 'new-key-valid';
783 + elseif ( $akismet_user->status == 'notice' )
784 + self::$notices['status'] = $akismet_user;
785 else
786 self::$notices['status'] = $akismet_user->status;
787 }
788 @@ -290,15 +310,6 @@ class Akismet_Admin {
789
790 // WP 2.5+
791 public static function rightnow_stats() {
792 - global $submenu, $wp_db_version;
793 -
794 - if ( 8645 < $wp_db_version ) // 2.7
795 - $link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );
796 - elseif ( isset( $submenu['edit-comments.php'] ) )
797 - $link = add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( 'edit-comments.php' ) );
798 - else
799 - $link = add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( 'edit.php' ) );
800 -
801 if ( $count = get_option('akismet_spam_count') ) {
802 $intro = sprintf( _n(
803 '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
804 @@ -309,15 +320,16 @@ class Akismet_Admin {
805 $intro = sprintf( __('<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' );
806 }
807
808 - $link = function_exists( 'esc_url' ) ? esc_url( $link ) : clean_url( $link );
809 + $link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );
810 +
811 if ( $queue_count = self::get_spam_count() ) {
812 $queue_text = sprintf( _n(
813 'There&#8217;s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
814 'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
815 $queue_count
816 - , 'akismet'), number_format_i18n( $queue_count ), $link );
817 + , 'akismet'), number_format_i18n( $queue_count ), esc_url( $link ) );
818 } else {
819 - $queue_text = sprintf( __( "There&#8217;s nothing in your <a href='%s'>spam queue</a> at the moment." , 'akismet'), $link );
820 + $queue_text = sprintf( __( "There&#8217;s nothing in your <a href='%s'>spam queue</a> at the moment." , 'akismet'), esc_url( $link ) );
821 }
822
823 $text = $intro . '<br />' . $queue_text;
824 @@ -379,17 +391,22 @@ class Akismet_Admin {
825 update_comment_meta( $c['comment_ID'], 'akismet_result', 'true' );
826 delete_comment_meta( $c['comment_ID'], 'akismet_error' );
827 delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
828 - Akismet::update_comment_history( $c['comment_ID'], __('Akismet re-checked and caught this comment as spam', 'akismet'), 'check-spam' );
829 + Akismet::update_comment_history( $c['comment_ID'], '', 'recheck-spam' );
830
831 } elseif ( 'false' == $response[1] ) {
832 update_comment_meta( $c['comment_ID'], 'akismet_result', 'false' );
833 delete_comment_meta( $c['comment_ID'], 'akismet_error' );
834 delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
835 - Akismet::update_comment_history( $c['comment_ID'], __('Akismet re-checked and cleared this comment', 'akismet'), 'check-ham' );
836 + Akismet::update_comment_history( $c['comment_ID'], '', 'recheck-ham' );
837 // abnormal result: error
838 } else {
839 update_comment_meta( $c['comment_ID'], 'akismet_result', 'error' );
840 - Akismet::update_comment_history( $c['comment_ID'], sprintf( __('Akismet was unable to re-check this comment (response: %s)', 'akismet'), substr($response[1], 0, 50)), 'check-error' );
841 + Akismet::update_comment_history(
842 + $c['comment_ID'],
843 + '',
844 + 'recheck-error',
845 + array( 'response' => substr( $response[1], 0, 50 ) )
846 + );
847 }
848
849 delete_comment_meta( $c['comment_ID'], 'akismet_rechecking' );
850 @@ -494,11 +511,95 @@ class Akismet_Admin {
851
852 if ( $history ) {
853 echo '<div class="akismet-history" style="margin: 13px;">';
854 +
855 foreach ( $history as $row ) {
856 $time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
857 - echo '<div style="margin-bottom: 13px;"><span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( esc_html__('%s ago', 'akismet'), human_time_diff( $row['time'] ) ) . '</span> - ';
858 - echo esc_html( $row['message'] ) . '</div>';
859 +
860 + $message = '';
861 +
862 + if ( ! empty( $row['message'] ) ) {
863 + // Old versions of Akismet stored the message as a literal string in the commentmeta.
864 + // New versions don't do that for two reasons:
865 + // 1) Save space.
866 + // 2) The message can be translated into the current language of the blog, not stuck
867 + // in the language of the blog when the comment was made.
868 + $message = $row['message'];
869 + }
870 +
871 + // If possible, use a current translation.
872 + switch ( $row['event'] ) {
873 + case 'recheck-spam';
874 + $message = __( 'Akismet re-checked and caught this comment as spam.', 'akismet' );
875 + break;
876 + case 'check-spam':
877 + $message = __( 'Akismet caught this comment as spam.', 'akismet' );
878 + break;
879 + case 'recheck-ham':
880 + $message = __( 'Akismet re-checked and cleared this comment.', 'akismet' );
881 + break;
882 + case 'check-ham':
883 + $message = __( 'Akismet cleared this comment.', 'akismet' );
884 + break;
885 + case 'wp-blacklisted':
886 + $message = __( 'Comment was caught by wp_blacklist_check.', 'akismet' );
887 + break;
888 + case 'report-spam':
889 + if ( isset( $row['user'] ) ) {
890 + $message = sprintf( __( '%s reported this comment as spam.', 'akismet' ), $row['user'] );
891 + }
892 + else if ( ! $message ) {
893 + $message = __( 'This comment was reported as spam.', 'akismet' );
894 + }
895 + break;
896 + case 'report-ham':
897 + if ( isset( $row['user'] ) ) {
898 + $message = sprintf( __( '%s reported this comment as not spam.', 'akismet' ), $row['user'] );
899 + }
900 + else if ( ! $message ) {
901 + $message = __( 'This comment was reported as not spam.', 'akismet' );
902 + }
903 + break;
904 + case 'cron-retry-spam':
905 + $message = __( 'Akismet caught this comment as spam during an automatic retry.' , 'akismet');
906 + break;
907 + case 'cron-retry-ham':
908 + $message = __( 'Akismet cleared this comment during an automatic retry.', 'akismet');
909 + break;
910 + case 'check-error':
911 + if ( isset( $row['meta'], $row['meta']['response'] ) ) {
912 + $message = sprintf( __( 'Akismet was unable to check this comment (response: %s) but will automatically retry later.', 'akismet'), $row['meta']['response'] );
913 + }
914 + break;
915 + case 'recheck-error':
916 + if ( isset( $row['meta'], $row['meta']['response'] ) ) {
917 + $message = sprintf( __( 'Akismet was unable to recheck this comment (response: %s).', 'akismet'), $row['meta']['response'] );
918 + }
919 + break;
920 + default:
921 + if ( preg_match( '/^status-changed/', $row['event'] ) ) {
922 + // Half of these used to be saved without the dash after 'status-changed'.
923 + // See https://plugins.trac.wordpress.org/changeset/1150658/akismet/trunk
924 + $new_status = preg_replace( '/^status-changed-?/', '', $row['event'] );
925 + $message = sprintf( __( 'Comment status was changed to %s', 'akismet' ), $new_status );
926 + }
927 + else if ( preg_match( '/^status-/', $row['event'] ) ) {
928 + $new_status = preg_replace( '/^status-/', '', $row['event'] );
929 +
930 + if ( isset( $row['user'] ) ) {
931 + $message = sprintf( __( '%1$s changed the comment status to %2$s.', 'akismet' ), $row['user'], $new_status );
932 + }
933 + }
934 + break;
935 +
936 + }
937 +
938 + echo '<div style="margin-bottom: 13px;">';
939 + echo '<span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( esc_html__('%s ago', 'akismet'), human_time_diff( $row['time'] ) ) . '</span>';
940 + echo ' - ';
941 + echo esc_html( $message );
942 + echo '</div>';
943 }
944 +
945 echo '</div>';
946 }
947 }
948 @@ -511,18 +612,6 @@ class Akismet_Admin {
949 return $links;
950 }
951
952 - public static function text_add_link_callback( $m ) {
953 - // bare link?
954 - if ( $m[4] == $m[2] )
955 - return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
956 - else
957 - return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
958 - }
959 -
960 - public static function text_add_link_class( $comment_text ) {
961 - return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', array( 'Akismet_Admin', 'text_add_link_callback' ), $comment_text );
962 - }
963 -
964 // Total spam in queue
965 // get_option( 'akismet_spam_count' ) is the total caught ever
966 public static function get_spam_count( $type = false ) {
967 @@ -631,13 +720,16 @@ class Akismet_Admin {
968 }
969
970 public static function get_akismet_user( $api_key ) {
971 - $akismet_user = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key ) ), 'get-subscription' );
972 + $akismet_user = false;
973 +
974 + $subscription_verification = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key, 'blog' => get_bloginfo( 'url' ) ) ), 'get-subscription' );
975 +
976 + if ( ! empty( $subscription_verification[1] ) ) {
977 + if ( 'invalid' !== $subscription_verification[1] ) {
978 + $akismet_user = json_decode( $subscription_verification[1] );
979 + }
980 + }
981
982 - if ( ! empty( $akismet_user[1] ) )
983 - $akismet_user = json_decode( $akismet_user[1] );
984 - else
985 - $akismet_user = false;
986 -
987 return $akismet_user;
988 }
989
990 @@ -645,12 +737,13 @@ class Akismet_Admin {
991 $stat_totals = array();
992
993 foreach( array( '6-months', 'all' ) as $interval ) {
994 - $response = Akismet::http_post( Akismet::build_query( array( 'blog' => urlencode( get_bloginfo('url') ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
995 + $response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_bloginfo( 'url' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
996
997 if ( ! empty( $response[1] ) ) {
998 $stat_totals[$interval] = json_decode( $response[1] );
999 }
1000 }
1001 +
1002 return $stat_totals;
1003 }
1004
1005 @@ -727,7 +820,7 @@ class Akismet_Admin {
1006 }
1007 }
1008
1009 - if ( $api_key = Akismet::get_api_key() ) {
1010 + if ( $api_key = Akismet::get_api_key() && ( empty( self::$notices['status'] ) || 'existing-key-invalid' != self::$notices['status'] ) ) {
1011 self::display_configuration_page();
1012 return;
1013 }
1014 @@ -768,8 +861,16 @@ class Akismet_Admin {
1015 public static function display_configuration_page() {
1016 $api_key = Akismet::get_api_key();
1017 $akismet_user = self::get_akismet_user( $api_key );
1018 - $stat_totals = self::get_stats( $api_key );
1019
1020 + if ( ! $akismet_user ) {
1021 + // This could happen if the user's key became invalid after it was previously valid and successfully set up.
1022 + self::$notices['status'] = 'existing-key-invalid';
1023 + self::display_start_page();
1024 + return;
1025 + }
1026 +
1027 + $stat_totals = self::get_stats( $api_key );
1028 +
1029 // If unset, create the new strictness option using the old discard option to determine its default
1030 if ( get_option( 'akismet_strictness' ) === false )
1031 add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
1032 @@ -787,11 +888,11 @@ class Akismet_Admin {
1033 $cleaning_up = __( 'Cleaning up spam takes time.' , 'akismet');
1034
1035 if ( $total_in_days > 1 )
1036 - $time_saved = $cleaning_up . ' ' . sprintf( __( 'Since you joined us, Akismet has saved you %s days!' , 'akismet'), number_format_i18n( $total_in_days ) );
1037 + $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %s day!', 'Akismet has saved you %s days!', $total_in_days, 'akismet' ), number_format_i18n( $total_in_days ) );
1038 elseif ( $total_in_hours > 1 )
1039 - $time_saved = $cleaning_up . ' ' . sprintf( __( 'Since you joined us, Akismet has saved you %d hours!' , 'akismet'), $total_in_hours );
1040 + $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d hour!', 'Akismet has saved you %d hours!', $total_in_hours, 'akismet' ), $total_in_hours );
1041 elseif ( $total_in_minutes >= 30 )
1042 - $time_saved = $cleaning_up . ' ' . sprintf( __( 'Since you joined us, Akismet has saved you %d minutes!' , 'akismet'), $total_in_minutes );
1043 + $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d minute!', 'Akismet has saved you %d minutes!', $total_in_minutes, 'akismet' ), $total_in_minutes );
1044 }
1045
1046 Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) );
1047 @@ -838,8 +939,24 @@ class Akismet_Admin {
1048 if ( !empty( $type ) )
1049 Akismet::view( 'notice', compact( 'type' ) );
1050 elseif ( !empty( self::$notices ) ) {
1051 - foreach ( self::$notices as $type )
1052 - Akismet::view( 'notice', compact( 'type' ) );
1053 + foreach ( self::$notices as $type ) {
1054 + if ( is_object( $type ) ) {
1055 + $notice_header = $notice_text = '';
1056 +
1057 + if ( property_exists( $type, 'notice_header' ) )
1058 + $notice_header = wp_kses( $type->notice_header, self::$allowed );
1059 +
1060 + if ( property_exists( $type, 'notice_text' ) )
1061 + $notice_text = wp_kses( $type->notice_text, self::$allowed );
1062 +
1063 + if ( property_exists( $type, 'status' ) ) {
1064 + $type = wp_kses( $type->status, self::$allowed );
1065 + Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );
1066 + }
1067 + }
1068 + else
1069 + Akismet::view( 'notice', compact( 'type' ) );
1070 + }
1071 }
1072 }
1073
1074
1075 diff --git a/plugins/akismet/class.akismet.php b/plugins/akismet/class.akismet.php
1076 index 144f103..e47c8a8 100644
1077 --- a/plugins/akismet/class.akismet.php
1078 +++ b/plugins/akismet/class.akismet.php
1079 @@ -9,7 +9,8 @@ class Akismet {
1080 private static $initiated = false;
1081 private static $prevent_moderation_email_for_these_comments = array();
1082 private static $last_comment_result = null;
1083 -
1084 + private static $comment_as_submitted_allowed_keys = array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' );
1085 +
1086 public static function init() {
1087 if ( ! self::$initiated ) {
1088 self::init_hooks();
1089 @@ -28,6 +29,14 @@ class Akismet {
1090 add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
1091 add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
1092
1093 + /**
1094 + * To disable the Akismet comment nonce, add a filter for the 'akismet_comment_nonce' tag
1095 + * and return any string value that is not 'true' or '' (empty string).
1096 + *
1097 + * Don't return boolean false, because that implies that the 'akismet_comment_nonce' option
1098 + * has not been set and that Akismet should just choose the default behavior for that
1099 + * situation.
1100 + */
1101 $akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
1102
1103 if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' )
1104 @@ -44,12 +53,6 @@ class Akismet {
1105
1106 // Run this early in the pingback call, before doing a remote fetch of the source uri
1107 add_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) );
1108 -
1109 - if ( '3.0.5' == $GLOBALS['wp_version'] ) {
1110 - remove_filter( 'comment_text', 'wp_kses_data' );
1111 - if ( is_admin() )
1112 - add_filter( 'comment_text', 'wp_kses_post' );
1113 - }
1114 }
1115
1116 public static function get_api_key() {
1117 @@ -66,7 +69,14 @@ class Akismet {
1118 if ( $response[1] != 'valid' && $response[1] != 'invalid' )
1119 return 'failed';
1120
1121 - self::update_alert( $response );
1122 + return $response[1];
1123 + }
1124 +
1125 + public static function deactivate_key( $key ) {
1126 + $response = self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option('home') ) ), 'deactivate' );
1127 +
1128 + if ( $response[1] != 'deactivated' )
1129 + return 'failed';
1130
1131 return $response[1];
1132 }
1133 @@ -87,6 +97,7 @@ class Akismet {
1134 if ( !empty( $comment['user_ID'] ) )
1135 $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
1136
1137 + /** See filter documentation in init_hooks(). */
1138 $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
1139 $comment['akismet_comment_nonce'] = 'inactive';
1140 if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
1141 @@ -124,9 +135,7 @@ class Akismet {
1142
1143 do_action( 'akismet_comment_check_response', $response );
1144
1145 - self::update_alert( $response );
1146 -
1147 - $commentdata['comment_as_submitted'] = array_intersect_key( $comment, array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' ) );
1148 + $commentdata['comment_as_submitted'] = array_intersect_key( $comment, self::$comment_as_submitted_allowed_keys );
1149 $commentdata['akismet_result'] = $response[1];
1150
1151 if ( isset( $response[0]['x-akismet-pro-tip'] ) )
1152 @@ -228,23 +237,32 @@ class Akismet {
1153 // normal result: true or false
1154 if ( self::$last_comment['akismet_result'] == 'true' ) {
1155 update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
1156 - self::update_comment_history( $comment->comment_ID, __('Akismet caught this comment as spam', 'akismet'), 'check-spam' );
1157 + self::update_comment_history( $comment->comment_ID, '', 'check-spam' );
1158 if ( $comment->comment_approved != 'spam' )
1159 - self::update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s', 'akismet'), $comment->comment_approved), 'status-changed'.$comment->comment_approved );
1160 + self::update_comment_history(
1161 + $comment->comment_ID,
1162 + '',
1163 + 'status-changed-'.$comment->comment_approved
1164 + );
1165 }
1166 elseif ( self::$last_comment['akismet_result'] == 'false' ) {
1167 update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
1168 - self::update_comment_history( $comment->comment_ID, __('Akismet cleared this comment', 'akismet'), 'check-ham' );
1169 + self::update_comment_history( $comment->comment_ID, '', 'check-ham' );
1170 if ( $comment->comment_approved == 'spam' ) {
1171 if ( wp_blacklist_check($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent) )
1172 - self::update_comment_history( $comment->comment_ID, __('Comment was caught by wp_blacklist_check', 'akismet'), 'wp-blacklisted' );
1173 + self::update_comment_history( $comment->comment_ID, '', 'wp-blacklisted' );
1174 else
1175 - self::update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s', 'akismet'), $comment->comment_approved), 'status-changed-'.$comment->comment_approved );
1176 + self::update_comment_history( $comment->comment_ID, '', 'status-changed-'.$comment->comment_approved );
1177 }
1178 } // abnormal result: error
1179 else {
1180 update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
1181 - self::update_comment_history( $comment->comment_ID, sprintf( __('Akismet was unable to check this comment (response: %s), will automatically retry again later.', 'akismet'), substr(self::$last_comment['akismet_result'], 0, 50)), 'check-error' );
1182 + self::update_comment_history(
1183 + $comment->comment_ID,
1184 + '',
1185 + 'check-error',
1186 + array( 'response' => substr( self::$last_comment['akismet_result'], 0, 50 ) )
1187 + );
1188 }
1189
1190 // record the complete original data as submitted for checking
1191 @@ -350,8 +368,15 @@ class Akismet {
1192 return $history;
1193 }
1194
1195 - // log an event for a given comment, storing it in comment_meta
1196 - public static function update_comment_history( $comment_id, $message, $event=null ) {
1197 + /**
1198 + * Log an event for a given comment, storing it in comment_meta.
1199 + *
1200 + * @param int $comment_id The ID of the relevant comment.
1201 + * @param string $message The string description of the event. No longer used.
1202 + * @param string $event The event code.
1203 + * @param array $meta Metadata about the history entry. e.g., the user that reported or changed the status of a given comment.
1204 + */
1205 + public static function update_comment_history( $comment_id, $message, $event=null, $meta=null ) {
1206 global $current_user;
1207
1208 // failsafe for old WP versions
1209 @@ -359,15 +384,19 @@ class Akismet {
1210 return false;
1211
1212 $user = '';
1213 - if ( is_object( $current_user ) && isset( $current_user->user_login ) )
1214 - $user = $current_user->user_login;
1215
1216 $event = array(
1217 'time' => self::_get_microtime(),
1218 - 'message' => $message,
1219 'event' => $event,
1220 - 'user' => $user,
1221 );
1222 +
1223 + if ( is_object( $current_user ) && isset( $current_user->user_login ) ) {
1224 + $event['user'] = $current_user->user_login;
1225 + }
1226 +
1227 + if ( ! empty( $meta ) ) {
1228 + $event['meta'] = $meta;
1229 + }
1230
1231 // $unique = false so as to allow multiple values per comment
1232 $r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
1233 @@ -443,7 +472,7 @@ class Akismet {
1234 }
1235 }
1236
1237 - self::update_comment_history( $comment->comment_ID, sprintf( __('%1$s changed the comment status to %2$s', 'akismet'), $reporter, $new_status ), 'status-' . $new_status );
1238 + self::update_comment_history( $comment->comment_ID, '', 'status-' . $new_status );
1239 }
1240
1241 public static function submit_spam_comment( $comment_id ) {
1242 @@ -460,7 +489,7 @@ class Akismet {
1243 return;
1244
1245 // use the original version stored in comment_meta if available
1246 - $as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
1247 + $as_submitted = self::sanitize_comment_as_submitted( get_comment_meta( $comment_id, 'akismet_as_submitted', true ) );
1248
1249 if ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) )
1250 $comment = (object) array_merge( (array)$comment, $as_submitted );
1251 @@ -488,7 +517,7 @@ class Akismet {
1252
1253 $response = Akismet::http_post( Akismet::build_query( $comment ), 'submit-spam' );
1254 if ( $comment->reporter ) {
1255 - self::update_comment_history( $comment_id, sprintf( __('%s reported this comment as spam', 'akismet'), $comment->reporter ), 'report-spam' );
1256 + self::update_comment_history( $comment_id, '', 'report-spam' );
1257 update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
1258 update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
1259 }
1260 @@ -506,7 +535,7 @@ class Akismet {
1261 return;
1262
1263 // use the original version stored in comment_meta if available
1264 - $as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
1265 + $as_submitted = self::sanitize_comment_as_submitted( get_comment_meta( $comment_id, 'akismet_as_submitted', true ) );
1266
1267 if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) )
1268 $comment = (object) array_merge( (array)$comment, $as_submitted );
1269 @@ -534,7 +563,7 @@ class Akismet {
1270
1271 $response = self::http_post( Akismet::build_query( $comment ), 'submit-ham' );
1272 if ( $comment->reporter ) {
1273 - self::update_comment_history( $comment_id, sprintf( __('%s reported this comment as not spam', 'akismet'), $comment->reporter ), 'report-ham' );
1274 + self::update_comment_history( $comment_id, '', 'report-ham' );
1275 update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
1276 update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
1277 }
1278 @@ -573,19 +602,19 @@ class Akismet {
1279 add_comment_meta( $comment_id, 'akismet_rechecking', true );
1280 $status = self::check_db_comment( $comment_id, 'retry' );
1281
1282 - $msg = '';
1283 + $event = '';
1284 if ( $status == 'true' ) {
1285 - $msg = __( 'Akismet caught this comment as spam during an automatic retry.' , 'akismet');
1286 + $event = 'cron-retry-spam';
1287 } elseif ( $status == 'false' ) {
1288 - $msg = __( 'Akismet cleared this comment during an automatic retry.' , 'akismet');
1289 + $event = 'cron-retry-ham';
1290 }
1291
1292 // If we got back a legit response then update the comment history
1293 // other wise just bail now and try again later. No point in
1294 // re-trying all the comments once we hit one failure.
1295 - if ( !empty( $msg ) ) {
1296 + if ( !empty( $event ) ) {
1297 delete_comment_meta( $comment_id, 'akismet_error' );
1298 - self::update_comment_history( $comment_id, $msg, 'cron-retry' );
1299 + self::update_comment_history( $comment_id, '', $event );
1300 update_comment_meta( $comment_id, 'akismet_result', $status );
1301 // make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
1302 $comment = get_comment( $comment_id );
1303 @@ -681,8 +710,21 @@ class Akismet {
1304 return (
1305 isset( $comment1['comment_post_ID'], $comment2['comment_post_ID'] )
1306 && intval( $comment1['comment_post_ID'] ) == intval( $comment2['comment_post_ID'] )
1307 - && $comment1['comment_author'] == $comment2['comment_author']
1308 - && $comment1['comment_author_email'] == $comment2['comment_author_email']
1309 + && (
1310 + // The comment author length max is 255 characters, limited by the TINYTEXT column type.
1311 + substr( $comment1['comment_author'], 0, 255 ) == substr( $comment2['comment_author'], 0, 255 )
1312 + || substr( stripslashes( $comment1['comment_author'] ), 0, 255 ) == substr( $comment2['comment_author'], 0, 255 )
1313 + || substr( $comment1['comment_author'], 0, 255 ) == substr( stripslashes( $comment2['comment_author'] ), 0, 255 )
1314 + )
1315 + && (
1316 + // The email max length is 100 characters, limited by the VARCHAR(100) column type.
1317 + substr( $comment1['comment_author_email'], 0, 100 ) == substr( $comment2['comment_author_email'], 0, 100 )
1318 + || substr( stripslashes( $comment1['comment_author_email'] ), 0, 100 ) == substr( $comment2['comment_author_email'], 0, 100 )
1319 + || substr( $comment1['comment_author_email'], 0, 100 ) == substr( stripslashes( $comment2['comment_author_email'] ), 0, 100 )
1320 + // Very long emails can be truncated and then stripped if the [0:100] substring isn't a valid address.
1321 + || ( ! $comment1['comment_author_email'] && strlen( $comment2['comment_author_email'] ) > 100 )
1322 + || ( ! $comment2['comment_author_email'] && strlen( $comment1['comment_author_email'] ) > 100 )
1323 + )
1324 );
1325 }
1326
1327 @@ -882,8 +924,12 @@ class Akismet {
1328
1329 do_action( 'akismet_https_disabled' );
1330 }
1331 +
1332 + $simplified_response = array( $response['headers'], $response['body'] );
1333 +
1334 + self::update_alert( $simplified_response );
1335
1336 - return array( $response['headers'], $response['body'] );
1337 + return $simplified_response;
1338 }
1339
1340 // given a response from an API call like check_key_status(), update the alert code options if an alert is present.
1341 @@ -999,7 +1045,7 @@ p {
1342 * @static
1343 */
1344 public static function plugin_deactivation( ) {
1345 - //tidy up
1346 + return self::deactivate_key( self::get_api_key() );
1347 }
1348
1349 /**
1350 @@ -1085,4 +1131,26 @@ p {
1351
1352 return $r;
1353 }
1354 -}
1355 +
1356 + /**
1357 + * Ensure that we are loading expected scalar values from akismet_as_submitted commentmeta.
1358 + *
1359 + * @param mixed $meta_value
1360 + * @return mixed
1361 + */
1362 + private static function sanitize_comment_as_submitted( $meta_value ) {
1363 + if ( empty( $meta_value ) ) {
1364 + return $meta_value;
1365 + }
1366 +
1367 + $meta_value = (array) $meta_value;
1368 +
1369 + foreach ( $meta_value as $key => $value ) {
1370 + if ( ! isset( self::$comment_as_submitted_allowed_keys[$key] ) || ! is_scalar( $value ) ) {
1371 + unset( $meta_value[$key] );
1372 + }
1373 + }
1374 +
1375 + return $meta_value;
1376 + }
1377 +}
1378 \ No newline at end of file
1379
1380 diff --git a/plugins/akismet/readme.txt b/plugins/akismet/readme.txt
1381 index 00fcd6a..69f43d8 100644
1382 --- a/plugins/akismet/readme.txt
1383 +++ b/plugins/akismet/readme.txt
1384 @@ -1,9 +1,9 @@
1385 === Akismet ===
1386 Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
1387 -Tags: akismet, comments, spam
1388 +Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
1389 Requires at least: 3.2
1390 -Tested up to: 4.2.1
1391 -Stable tag: 3.1.1
1392 +Tested up to: 4.4.1
1393 +Stable tag: 3.1.7
1394 License: GPLv2 or later
1395
1396 Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
1397 @@ -30,6 +30,47 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
1398
1399 == Changelog ==
1400
1401 += 3.1.7 =
1402 +*Release Date - 4 January 2016*
1403 +
1404 +* Added documentation for the 'akismet_comment_nonce' filter.
1405 +* The post-install activation button is now accessible to screen readers and keyboard-only users.
1406 +* Fixed a bug that was preventing the "Remove author URL" feature from working in WordPress 4.4
1407 +
1408 += 3.1.6 =
1409 +*Release Date - 14 December 2015*
1410 +
1411 +* Improve the notices shown after activating Akismet.
1412 +* Update some strings to allow for the proper plural forms in all languages.
1413 +
1414 += 3.1.5 =
1415 +*Release Date - 13 October 2015*
1416 +
1417 +* Closes a potential XSS vulnerability.
1418 +
1419 += 3.1.4 =
1420 +*Release Date - 24 September 2015*
1421 +
1422 +* Fixed a bug that was preventing some users from automatically connecting using Jetpack if they didn't have a current Akismet subscription.
1423 +* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
1424 +* Error messages and instructions have been simplified to be more understandable.
1425 +* Link previews are enabled for all links inside comments, not just the author's website link.
1426 +
1427 += 3.1.3 =
1428 +*Release Date - 6 July 2015*
1429 +
1430 +* Notify users when their account status changes after previously being successfully set up. This should help any users who are seeing blank Akismet settings screens.
1431 +
1432 += 3.1.2 =
1433 +*Release Date - 7 June 2015*
1434 +
1435 +* Reduced the amount of space Akismet uses in the commentmeta table.
1436 +* Fixed a bug where some comments with quotes in the author name weren't getting history entries
1437 +* Pre-emptive security improvements to ensure that the Akismet plugin can't be used by attackers to compromise a WordPress installation.
1438 +* Better UI for the key entry field: allow whitespace to be included at the beginning or end of the key and strip it out automatically when the form is submitted.
1439 +* When deactivating the plugin, notify the Akismet API so the site can be marked as inactive.
1440 +* Clearer error messages.
1441 +
1442 = 3.1.1 =
1443 *Release Date - 17th March, 2015*
1444
1445
1446 diff --git a/plugins/akismet/views/config.php b/plugins/akismet/views/config.php
1447 index 232d107..d84e21a 100644
1448 --- a/plugins/akismet/views/config.php
1449 +++ b/plugins/akismet/views/config.php
1450 @@ -17,23 +17,19 @@
1451 <li>
1452 <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
1453 <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
1454 - <?php esc_html_e( 'Spam blocked' , 'akismet');?>
1455 + <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
1456 </li>
1457 <li>
1458 <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
1459 <span><?php echo number_format( $stat_totals['all']->spam );?></span>
1460 - <?php esc_html_e( 'Spam blocked' , 'akismet');?>
1461 + <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
1462 </li>
1463 <li>
1464 <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
1465 <span><?php echo $stat_totals['all']->accuracy; ?>%</span>
1466 - <?php printf(
1467 - esc_html(
1468 - _n( '%s missed spam, %s false positive', '%s missed spam, %s false positives', $stat_totals['all']->false_positives , 'akismet')
1469 - ),
1470 - number_format( $stat_totals['all']->missed_spam ),
1471 - number_format( $stat_totals['all']->false_positives )
1472 - ); ?>
1473 + <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
1474 + |
1475 + <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
1476 </li>
1477 </ul>
1478 <div class="clearfix"></div>
1479 @@ -67,7 +63,7 @@
1480 <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
1481 <td width="5%"/>
1482 <td align="left">
1483 - <span class="api-key"><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 $akismet_user->status;?>"></span>
1484 + <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $akismet_user->status;?>"></span>
1485 </td>
1486 </tr>
1487 <?php endif; ?>
1488
1489 diff --git a/plugins/akismet/views/get.php b/plugins/akismet/views/get.php
1490 index 70727f6..72a3b6e 100644
1491 --- a/plugins/akismet/views/get.php
1492 +++ b/plugins/akismet/views/get.php
1493 @@ -1,5 +1,6 @@
1494 <form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
1495 <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1496 + <input type="hidden" name="blog" value="<?php echo esc_url( get_bloginfo('url') ); ?>"/>
1497 <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
1498 <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
1499 </form>
1500 \ No newline at end of file
1501
1502 diff --git a/plugins/akismet/views/notice.php b/plugins/akismet/views/notice.php
1503 index c2fc45a..fc8bc18 100644
1504 --- a/plugins/akismet/views/notice.php
1505 +++ b/plugins/akismet/views/notice.php
1506 @@ -1,17 +1,14 @@
1507 <?php if ( $type == 'plugin' ) :?>
1508 <div class="updated" style="padding: 0; margin: 0; border: none; background: none;">
1509 - <style type="text/css">
1510 -.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
1511 #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{
1512 color:#FFF;font-weight:normal}
1513 - </style>
1514 <form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
1515 <div class="akismet_activate">
1516 <div class="aa_a">A</div>
1517 - <div class="aa_button_container" onclick="document.akismet_activate.submit();">
1518 + <div class="aa_button_container">
1519 <div class="aa_button_border">
1520 - <div class="aa_button"><?php esc_html_e('Activate your Akismet account', 'akismet');?></div>
1521 + <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Activate your Akismet account', 'akismet' ); ?>" />
1522 </div>
1523 </div>
1524 - <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate your account and say goodbye to comment spam', 'akismet');?></div>
1525 + <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>
1526 </div>
1527 </form>
1528 </div>
1529 @@ -37,29 +34,36 @@
1530 ?>
1531 </p>
1532 </div>
1533 +<?php elseif ( $type == 'notice' ) :?>
1534 +<div class="wrap alert critical">
1535 + <h3 class="key-status failed"><?php echo $notice_header; ?></h3>
1536 + <p class="description">
1537 + <?php echo $notice_text; ?>
1538 + </p>
1539 +</div>
1540 <?php elseif ( $type == 'missing-functions' ) :?>
1541 <div class="wrap alert critical">
1542 <h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
1543 - <p class="description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;s <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet&#8217;s system requirements</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1544 + <p class="description"><?php printf( __('Your web host or server administrator has disabled PHP&#8217;s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet&#8217;s system requirements</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1545 </div>
1546 <?php elseif ( $type == 'servers-be-down' ) :?>
1547 <div class="wrap alert critical">
1548 - <h3 class="key-status failed"><?php esc_html_e("We can&#8217;t connect to your site.", 'akismet'); ?></h3>
1549 - <p class="description"><?php printf( __('Your firewall may be blocking us. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1550 + <h3 class="key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
1551 + <p class="description"><?php printf( __('Your firewall may be blocking Akismet. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1552 </div>
1553 <?php elseif ( $type == 'active-dunning' ) :?>
1554 <div class="wrap alert critical">
1555 - <h3 class="key-status"><?php esc_html_e("Please update your payment details.", 'akismet'); ?></h3>
1556 - <p class="description"><?php printf( __('We cannot process your transaction. Please contact your bank for assistance, and <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
1557 + <h3 class="key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
1558 + <p class="description"><?php printf( __('We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
1559 </div>
1560 <?php elseif ( $type == 'cancelled' ) :?>
1561 <div class="wrap alert critical">
1562 - <h3 class="key-status"><?php esc_html_e("Your subscription is cancelled.", 'akismet'); ?></h3>
1563 - <p class="description"><?php printf( __('Please visit the <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
1564 + <h3 class="key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
1565 + <p class="description"><?php printf( __('Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
1566 </div>
1567 <?php elseif ( $type == 'suspended' ) :?>
1568 <div class="wrap alert critical">
1569 - <h3 class="key-status failed"><?php esc_html_e("Your subscription is suspended.", 'akismet'); ?></h3>
1570 + <h3 class="key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
1571 <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
1572 </div>
1573 <?php elseif ( $type == 'active-notice' && $time_saved ) :?>
1574 @@ -69,34 +73,51 @@
1575 </div>
1576 <?php elseif ( $type == 'missing' ) :?>
1577 <div class="wrap alert critical">
1578 - <h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your key.', 'akismet'); ?></h3>
1579 + <h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
1580 <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
1581 </div>
1582 <?php elseif ( $type == 'no-sub' ) :?>
1583 <div class="wrap alert critical">
1584 - <h3 class="key-status failed"><?php esc_html_e( 'Your subscription is missing.', 'akismet'); ?></h3>
1585 - <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>
1586 + <h3 class="key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
1587 + <p class="description">
1588 + <?php printf( __( 'In 2012, Akismet began using subscription plans for all accounts (even free ones). A plan has not been assigned to your account, and we&#8217;d appreciate it if you&#8217;d <a href="%s" target="_blank">sign into your account</a> and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>
1589 + <br /><br />
1590 + <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
1591 + </p>
1592 </div>
1593 <?php elseif ( $type == 'new-key-valid' ) :?>
1594 <div class="wrap alert active">
1595 - <h3 class="key-status"><?php esc_html_e('Your Akismet account has been successfully set up and activated. Happy blogging!', 'akismet'); ?></h3>
1596 + <h3 class="key-status"><?php esc_html_e('Akismet is now activated. Happy blogging!', 'akismet'); ?></h3>
1597 </div>
1598 <?php elseif ( $type == 'new-key-invalid' ) :?>
1599 <div class="wrap alert critical">
1600 <h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
1601 </div>
1602 +<?php elseif ( $type == 'existing-key-invalid' ) :?>
1603 +<div class="wrap alert critical">
1604 + <h3 class="key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@×××××××.com.' , 'akismet'); ?></h3>
1605 +</div>
1606 <?php elseif ( $type == 'new-key-failed' ) :?>
1607 <div class="wrap alert critical">
1608 - <h3 class="key-status"><?php esc_html_e( 'The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.' , 'akismet'); ?></h3>
1609 + <h3 class="key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
1610 + <p class="description"><?php printf( __('The connection to akismet.com could not be established. Please refer to <a href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1611 </div>
1612 <?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
1613 <div class="wrap alert critical">
1614 <?php if ( $level == 'yellow' ): ?>
1615 - <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>
1616 - <p class="description"><?php printf( __('Your Pro subscription allows the use of Akismet on only one site. Please <a href="http://docs.akismet.com/billing/add-more-sites/">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.<br /><br />If you have any questions, please get in touch with our support team.', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?></p>
1617 + <h3 class="key-status failed"><?php esc_html_e( 'You&#8217;re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>
1618 + <p class="description">
1619 + <?php printf( __( 'Your Pro subscription allows the use of Akismet on only one site. Please <a href="%s" target="_blank">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'http://docs.akismet.com/billing/add-more-sites/' ); ?>
1620 + <br /><br />
1621 + <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
1622 + </p>
1623 <?php elseif ( $level == 'red' ): ?>
1624 - <h3 class="key-status failed"><?php esc_html_e("You're using Akismet on far too many sites for your Pro subscription.", 'akismet'); ?></h3>
1625 - <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>
1626 + <h3 class="key-status failed"><?php esc_html_e( 'You&#8217;re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>
1627 + <p class="description">
1628 + <?php printf( __( 'To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?></p>
1629 + <br /><br />
1630 + <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?></p>
1631 + </p>
1632 <?php endif; ?>
1633 </div>
1634 -<?php endif;?>
1635 +<?php endif;?>
1636 \ No newline at end of file
1637
1638 diff --git a/plugins/akismet/views/start.php b/plugins/akismet/views/start.php
1639 index 692b8af..75eb032 100644
1640 --- a/plugins/akismet/views/start.php
1641 +++ b/plugins/akismet/views/start.php
1642 @@ -1,81 +1,83 @@
1643 <div class="no-key config-wrap"><?php
1644 if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
1645 - if ( $akismet_user->status == 'missing' ) :?>
1646 -<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>
1647 + if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) :?>
1648 +<p><?php esc_html_e('Akismet eliminates spam from your site. Register below to get started.', 'akismet'); ?></p>
1649 <div class="activate-highlight activate-option">
1650 <div class="option-description">
1651 <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
1652 - <?php echo esc_attr( $akismet_user->user_email ); ?>
1653 + <?php echo esc_html( $akismet_user->user_email ); ?>
1654 </div>
1655 <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
1656 - <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
1657 + <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1658 + <input type="hidden" name="blog" value="<?php echo esc_url( get_bloginfo('url') ); ?>"/>
1659 <input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
1660 <input type="hidden" name="redirect" value="plugin-signup"/>
1661 - <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
1662 + <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register for Akismet' , 'akismet'); ?>"/>
1663 </form>
1664 </div>
1665 <?php elseif ( $akismet_user->status == 'cancelled' ) :?>
1666 -<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
1667 +<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
1668 <div class="activate-highlight activate-option">
1669 <div class="option-description" style="width:75%;">
1670 <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
1671 <?php printf( esc_html__( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ); ?>
1672 </div>
1673 <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
1674 - <input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
1675 + <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1676 + <input type="hidden" name="blog" value="<?php echo esc_url( get_bloginfo('url') ); ?>"/>
1677 <input type="hidden" name="user_id" value="<?php echo $akismet_user->ID;?>"/>
1678 <input type="hidden" name="redirect" value="upgrade"/>
1679 <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
1680 </form>
1681 </div>
1682 <?php elseif ( $akismet_user->status == 'suspended' ) : ?>
1683 -<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
1684 +<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
1685 <div class="activate-highlight centered activate-option">
1686 <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
1687 <h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
1688 - <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll help sort this out.', 'akismet'); ?></p>
1689 + <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll sort this out.', 'akismet'); ?></p>
1690 <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
1691 </div>
1692 <?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
1693 -<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>
1694 +<p style="margin-right:10px"><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
1695 <div class="activate-highlight activate-option">
1696 <div class="option-description">
1697 <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
1698 - <?php echo esc_attr( $akismet_user->user_email ); ?>
1699 + <?php echo esc_html( $akismet_user->user_email ); ?>
1700 </div>
1701 <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
1702 <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
1703 <input type="hidden" name="action" value="enter-key">
1704 <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
1705 - <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this Akismet account' , 'akismet'); ?>"/>
1706 + <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this account' , 'akismet'); ?>"/>
1707 </form>
1708 </div>
1709 <?php endif;?>
1710 <div class="activate-highlight secondary activate-option">
1711 <div class="option-description">
1712 - <strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
1713 - <p><?php esc_html_e('Use this option if you want to setup a new Akismet account.', 'akismet'); ?></p>
1714 + <strong><?php esc_html_e('Sign up for a plan with a different email address', 'akismet'); ?></strong>
1715 + <p><?php esc_html_e('Use this option to use Akismet independently of your Jetpack connection.', 'akismet'); ?></p>
1716 </div>
1717 - <?php Akismet::view( 'get', array( 'text' => __( 'Register a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
1718 + <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
1719 </div>
1720 <div class="activate-highlight secondary activate-option">
1721 <div class="option-description">
1722 - <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
1723 - <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
1724 + <strong><?php esc_html_e('Enter an API key', 'akismet'); ?></strong>
1725 + <p><?php esc_html_e('Already have your key? Enter it here.', 'akismet'); ?></p>
1726 </div>
1727 <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
1728 - <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
1729 + <input id="key" name="key" type="text" size="15" value="" class="regular-text code">
1730 <input type="hidden" name="action" value="enter-key">
1731 <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
1732 <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
1733 </form>
1734 </div>
1735 <?php else :?>
1736 -<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>
1737 +<p><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
1738 <div class="activate-highlight activate-option">
1739 <div class="option-description">
1740 <strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
1741 - <p><?php esc_html_e('Log in or create an account to get your API key.', 'akismet'); ?></p>
1742 + <p><?php esc_html_e('Log in or sign up now.', 'akismet'); ?></p>
1743 </div>
1744 <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
1745 </div>
1746 @@ -85,7 +87,7 @@
1747 <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
1748 </div>
1749 <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
1750 - <input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
1751 + <input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( Akismet::get_api_key() ); ?>" class="regular-text code">
1752 <input type="hidden" name="action" value="enter-key">
1753 <?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
1754 <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
1755
1756 diff --git a/plugins/akismet/views/strict.php b/plugins/akismet/views/strict.php
1757 index 3cf197c..83d7a50 100644
1758 --- a/plugins/akismet/views/strict.php
1759 +++ b/plugins/akismet/views/strict.php
1760 @@ -1,7 +1,17 @@
1761 -<tr valign="top">
1762 - <th scope="row"><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></th>
1763 - <td><fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
1764 - <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('Strict: silently discard the worst and most pervasive spam.', 'akismet'); ?></label></p>
1765 - <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('Safe: always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
1766 - </fieldset></td>
1767 -</tr>
1768 \ No newline at end of file
1769 +<fieldset>
1770 + <legend class="screen-reader-text">
1771 + <span><?php esc_html_e( 'Akismet anti-spam strictness', 'akismet' ); ?></span>
1772 + </legend>
1773 + <p>
1774 + <label for="akismet_strictness_1">
1775 + <input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
1776 + <?php esc_html_e( 'Strict: silently discard the worst and most pervasive spam.', 'akismet' ); ?>
1777 + </label>
1778 + </p>
1779 + <p>
1780 + <label for="akismet_strictness_0">
1781 + <input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
1782 + <?php esc_html_e( 'Safe: always put spam in the Spam folder for review.', 'akismet' ); ?>
1783 + </label>
1784 + </p>
1785 +</fieldset>