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/, plugins/akismet/views/, plugins/akismet/_inc/img/, ...
Date: Wed, 08 Mar 2017 02:01:24
Message-Id: 1488938462.1f38dbdf035b1f008eddfe052d3a17c66240ed8a.blueknight@gentoo
1 commit: 1f38dbdf035b1f008eddfe052d3a17c66240ed8a
2 Author: Yury German <blueknight <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 8 02:01:02 2017 +0000
4 Commit: Yury German <blueknight <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 8 02:01:02 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/blogs-gentoo.git/commit/?id=1f38dbdf
7
8 Upgrade Akismet to 3.3
9
10 plugins/akismet/_inc/akismet.css | 508 ++++++++++++++++++------------
11 plugins/akismet/_inc/akismet.js | 35 +-
12 plugins/akismet/_inc/img/logo-full-2x.png | Bin 4970 -> 7570 bytes
13 plugins/akismet/akismet.php | 8 +-
14 plugins/akismet/class.akismet-admin.php | 184 ++++++++---
15 plugins/akismet/class.akismet.php | 18 +-
16 plugins/akismet/readme.txt | 17 +-
17 plugins/akismet/views/config.php | 402 +++++++++++------------
18 plugins/akismet/views/get.php | 2 +-
19 plugins/akismet/views/notice.php | 108 ++++---
20 plugins/akismet/views/start.php | 184 ++++++-----
21 plugins/akismet/views/stats.php | 13 +-
22 plugins/akismet/views/strict.php | 17 -
23 plugins/akismet/wrapper.php | 2 +-
24 14 files changed, 872 insertions(+), 626 deletions(-)
25
26 diff --git a/plugins/akismet/_inc/akismet.css b/plugins/akismet/_inc/akismet.css
27 index d38e14b..53495bb 100644
28 --- a/plugins/akismet/_inc/akismet.css
29 +++ b/plugins/akismet/_inc/akismet.css
30 @@ -1,3 +1,6 @@
31 +.wp-admin.jetpack_page_akismet-key-config, .wp-admin.settings_page_akismet-key-config {
32 + background-color:#f3f6f8;
33 +}
34
35 #submitted-on {
36 position: relative;
37 @@ -73,136 +76,37 @@ table.comments td.comment p a:after {
38 height: 338px;
39 width: 450px;
40 }
41 -h2.ak-header {
42 - padding: 30px;
43 - background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
44 - background-size: 185px 33px;
45 - height: 33px;
46 - text-indent: -9999em;
47 - margin-right: 10px;
48 -}
49 .checkforspam {
50 display: inline-block !important;
51 }
52 -.checkforspam-spinner {
53 - display: inline-block;
54 - margin-top: 7px;
55 -}
56 -
57 -.config-wrap {
58 - margin-top: 2em;
59 - max-width: 700px;
60 -}
61 -
62 -.activate-option {
63 - background: #e3e3e3;
64 - border-radius: 3px;
65 - margin-bottom: 30px;
66 - overflow: hidden;
67 - padding: 20px;
68 -}
69 -.activate-option.clicked {
70 - background: #649316;
71 - color: #fff;
72 -}
73 -.activate-option.clicked:hover {
74 - background: #68802E;
75 - color: #fff;
76 -}
77 -
78 -.activate-option .button.button-secondary {
79 - margin: 15px 0;
80 -}
81 -
82 -.activate-option p {
83 - margin: 10px 0 10px;
84 -}
85 -
86 -.activate-highlight {
87 - background: #fff;
88 - padding: 30px;
89 - margin-right: 10px;
90 +.checkforspam-progress {
91 + padding-left: 1ex;
92 + display: none;
93 }
94 -
95 -.activate-highlight.secondary {
96 - background: #ddd;
97 - padding: 20px 30px;
98 +.checkforspam.button-disabled .checkforspam-progress {
99 + display: inline;
100 }
101
102 -.activate-highlight h3 {
103 - margin: 0 0 0.3em;
104 -}
105 -.activate-highlight p {
106 - color: #777;
107 -}
108 -.activate-highlight .button-primary {
109 - margin-top: 15px;
110 +.checkforspam-spinner {
111 + display: inline-block;
112 + margin-top: 7px;
113 }
114
115 -#akismet-enter-api-key .regular-text {
116 - width: 18em;
117 - margin-top: 15px;
118 +.akismet-right {
119 + float: right;
120 }
121
122 -.right {
123 - float: right;
124 +.akismet-card .akismet-right {
125 + margin: 1em 0;
126 }
127
128 -.alert-text {
129 +.akismet-alert-text {
130 color: #dd3d36;
131 + font-weight: bold;
132 + font-size: 120%;
133 + margin-top: .5rem;
134 }
135 -.success {
136 - color: #649316;
137 -}
138 -.option-description {
139 - float: left;
140 - font-size: 16px;
141 -}
142 -.option-description span {
143 - color: #666;
144 - display: block;
145 - font-size: 14px;
146 - margin-top: 5px;
147 -}
148 -.option-action {
149 - float: right;
150 -}
151 -.key-config-link {
152 - font-size: 14px;
153 - margin-left: 20px;
154 -}
155 -.jetpack-account {
156 - float: left;
157 - font-size: 18px;
158 - margin-right: 40px;
159 -}
160 -.small-heading {
161 - color: #777;
162 - display: block;
163 - font-size: 12px;
164 - font-weight: bold;
165 - margin-bottom: 5px;
166 - text-transform: uppercase;
167 -}
168 -.inline-label {
169 - background: #ddd;
170 - border-radius: 3px;
171 - font-size: 11px;
172 - padding: 3px 8px;
173 - text-transform: uppercase;
174 -}
175 -.inline-label.alert {
176 - background: #e54747;
177 - color: #fff;
178 -}
179 -.jetpack-account .inline-label {
180 - margin-left: 5px;
181 -}
182 -.option-action .manual-key {
183 - margin-top: 7px;
184 -}
185 -
186 -.alert {
187 +.akismet-alert {
188 border: 1px solid #e5e5e5;
189 padding: 0.4em 1em 1.4em 1em;
190 border-radius: 3px;
191 @@ -211,49 +115,45 @@ h2.ak-header {
192 border-style: solid;
193 }
194
195 -.alert h3.key-status {
196 +.akismet-alert h3.akismet-key-status {
197 color: #fff;
198 margin: 1em 0 0.5em 0;
199 }
200
201 -.alert.critical {
202 +.akismet-alert.akismet-critical {
203 background-color: #993300;
204 }
205
206 -.alert.active {
207 +.akismet-alert.akismet-active {
208 background-color: #649316;
209 }
210
211 -.alert p.key-status {
212 +.akismet-alert p.akismet-key-status {
213 font-size: 24px;
214 }
215
216 -.alert p.description {
217 +.akismet-alert p.akismet-description {
218 color:#fff;
219 font-size: 14px;
220 margin: 0 0;
221 font-style: normal;
222 }
223
224 -.alert p.description a,
225 -.alert p.description a,
226 -.alert p.description a,
227 -.alert p.description a {
228 +.akismet-alert p.akismet-description a,
229 +.akismet-alert p.akismet-description a,
230 +.akismet-alert p.akismet-description a,
231 +.akismet-alert p.akismet-description a {
232 color: #fff;
233 }
234
235 -.new-snapshot {
236 +.akismet-new-snapshot {
237 margin-top: 1em;
238 padding: 1em;
239 text-align: center;
240 -}
241 -
242 -.new-snapshot.stats {
243 background: #fff;
244 - border: 1px solid #e5e5e5;
245 }
246
247 -.new-snapshot h3 {
248 +.akismet-new-snapshot h3 {
249 background: #f5f5f5;
250 color: #888;
251 font-size: 11px;
252 @@ -266,7 +166,7 @@ h2.ak-header {
253 width: 100%;
254 }
255
256 -.new-snapshot ul li {
257 +.akismet-new-snapshot ul li {
258 color: #999;
259 float: left;
260 font-size: 11px;
261 @@ -279,16 +179,12 @@ h2.ak-header {
262 -ms-box-sizing: border-box;
263 }
264
265 -.new-snapshot.stats ul li:first-child,
266 -.new-snapshot.stats ul li:nth-child(2) {
267 +.akismet-new-snapshot ul li:first-child,
268 +.akismet-new-snapshot ul li:nth-child(2) {
269 border-right:1px dotted #ccc;
270 }
271
272 -.new-snapshot.account ul li:nth-child(2) {
273 - border-right: none;
274 -}
275 -
276 -.new-snapshot ul li span {
277 +.akismet-new-snapshot ul li span {
278 color: #52accc;
279 display: block;
280 font-size: 32px;
281 @@ -296,60 +192,6 @@ h2.ak-header {
282 line-height: 1.5em;
283 }
284
285 -.new-snapshot.stats {
286 -}
287 -
288 -.new-snapshot.account,
289 -.new-snapshot.settings {
290 - float: left;
291 - padding: 0;
292 - text-align: left;
293 - width: 50%;
294 - box-sizing: border-box;
295 - -moz-box-sizing: border-box;
296 - -webkit-box-sizing: border-box;
297 - -ms-box-sizing: border-box;
298 -}
299 -
300 -.account-container {
301 - background: #fff;
302 - border: 1px solid #e5e5e5;
303 - margin-right: 0.5em;
304 -}
305 -
306 -.settings-container {
307 - background: #fff;
308 - border: 1px solid #e5e5e5;
309 - margin-left: 0.5em;
310 -}
311 -
312 -.new-snapshot.account ul li {
313 - width:100%
314 -}
315 -
316 -.new-snapshot.account ul li span {
317 - font-size: 14px;
318 - font-weight: normal;
319 -}
320 -
321 -
322 -.new-snapshot.settings ul li {
323 - border: none;
324 - display: block;
325 - width:100%
326 -}
327 -
328 -.new-snapshot.settings ul li span {
329 - display: block;
330 - font-size: 14px;
331 - font-weight: normal;
332 -}
333 -
334 -.new-snapshot.settings p.submit {
335 - margin: 0;
336 - text-align: center;
337 -}
338 -
339 .akismet-settings th:first-child {
340 vertical-align: top;
341 padding-top: 15px;
342 @@ -364,17 +206,13 @@ h2.ak-header {
343 width: 75%;
344 }
345
346 -.akismet-settings span.note{
347 +.akismet-settings span.akismet-note{
348 float: left;
349 padding-left: 23px;
350 font-size: 75%;
351 margin-top: -10px;
352 }
353
354 -.clearfix {
355 - clear:both;
356 -}
357 -
358 /**
359 * For the activation notice on the plugins page.
360 */
361 @@ -471,4 +309,278 @@ h2.ak-header {
362 .akismet_activate .aa_description strong {
363 color: #FFF;
364 font-weight: normal;
365 +}
366 +
367 +.jetpack_page_akismet-key-config #wpcontent, .settings_page_akismet-key-config #wpcontent {
368 + padding-left: 0;
369 +}
370 +
371 +.akismet-masthead {
372 + background-color:#fff;
373 + text-align:center;
374 + box-shadow:0 1px 0 rgba(200,215,225,0.5),0 1px 2px #e9eff3
375 +}
376 +@media (max-width: 45rem) {
377 + .akismet-masthead {
378 + padding:0 1.25rem
379 + }
380 +}
381 +
382 +.akismet-masthead__inside-container {
383 + padding:.375rem 0;
384 + margin:0 auto;
385 + width:100%;
386 + max-width:45rem;
387 + text-align: left;
388 +}
389 +.akismet-masthead__logo-container {
390 + padding:.3125rem 0 0
391 +}
392 +.akismet-masthead__logo {
393 + width:10.375rem;
394 + height:1.8125rem;
395 +}
396 +.akismet-masthead__logo-link {
397 + display:inline-block;
398 + outline:none;
399 + vertical-align:middle
400 +}
401 +.akismet-masthead__logo-link:focus {
402 + line-height:0;
403 + box-shadow:0 0 0 2px #78dcfa
404 +}
405 +.akismet-masthead__logo-link+code {
406 + margin:0 10px;
407 + padding:5px 9px;
408 + border-radius:2px;
409 + background:#e6ecf1;
410 + color:#647a88
411 +}
412 +.akismet-masthead__links {
413 + display:-ms-flexbox;
414 + display:flex;
415 + -ms-flex-flow:row wrap;
416 + flex-flow:row wrap;
417 + -ms-flex:2 50%;
418 + flex:2 50%;
419 + -ms-flex-pack:end;
420 + justify-content:flex-end;
421 + margin:0
422 +}
423 +@media (max-width: 480px) {
424 + .akismet-masthead__links {
425 + padding-right:.625rem
426 + }
427 +}
428 +.akismet-masthead__link-li {
429 + margin:0;
430 + padding:0
431 +}
432 +.akismet-masthead__link {
433 + font-style:normal;
434 + color:#0087be;
435 + padding:.625rem;
436 + display:inline-block
437 +}
438 +.akismet-masthead__link:visited {
439 + color:#0087be
440 +}
441 +.akismet-masthead__link:active,.akismet-masthead__link:hover {
442 + color:#00aadc
443 +}
444 +.akismet-masthead__link:hover {
445 + text-decoration:underline
446 +}
447 +.akismet-masthead__link .dashicons {
448 + display:none
449 +}
450 +@media (max-width: 480px) {
451 + .akismet-masthead__link:hover,.akismet-masthead__link:active {
452 + text-decoration:none
453 + }
454 + .akismet-masthead__link .dashicons {
455 + display:block;
456 + font-size:1.75rem
457 + }
458 + .akismet-masthead__link span+span {
459 + display:none
460 + }
461 +}
462 +.akismet-masthead__link-li:last-of-type .akismet-masthead__link {
463 + padding-right:0
464 +}
465 +
466 +.akismet-lower {
467 + margin: 0 auto;
468 + text-align: left;
469 + max-width: 45rem;
470 + padding: 1.5rem;
471 +}
472 +
473 +.akismet-card {
474 + margin-top: 1rem;
475 + margin-bottom: 0;
476 + position: relative;
477 + margin: 0 auto 0.625rem auto;
478 + box-sizing: border-box;
479 + background: white;
480 + box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
481 +}
482 +
483 +.akismet-card:after, .akismet-card .inside:after, .akismet-masthead__logo-container:after {
484 + content: ".";
485 + display: block;
486 + height: 0;
487 + clear: both;
488 + visibility: hidden;
489 +}
490 +
491 +.akismet-card .inside {
492 + padding: 1.5rem;
493 + padding-top: 1rem;
494 +}
495 +
496 +.akismet-card .akismet-card-actions {
497 + margin-top: 1rem;
498 +}
499 +
500 +.jetpack_page_akismet-key-config .update-nag, .settings_page_akismet-key-config .update-nag {
501 + display: none;
502 +}
503 +
504 +.akismet-masthead .akismet-right {
505 + line-height: 2.125rem;
506 + font-size: 0.9rem;
507 +}
508 +
509 +.akismet-box {
510 + box-sizing: border-box;
511 + background: white;
512 + border: 1px solid rgba(200, 215, 225, 0.5);
513 +}
514 +
515 +.akismet-box h2, .akismet-box h3 {
516 + padding: 1.5rem 1.5rem .5rem 1.5rem;
517 + margin: 0;
518 +}
519 +
520 +.akismet-box p {
521 + padding: 0 1.5rem 1.5rem 1.5rem;
522 + margin: 0;
523 +}
524 +
525 +.akismet-jetpack-email {
526 + font-style: oblique;
527 +}
528 +
529 +.akismet-jetpack-gravatar {
530 + padding: 0 0 0 1.5rem;
531 + float: left;
532 + margin-right: 1rem;
533 + width: 54px;
534 + height: 54px;
535 +}
536 +
537 +.akismet-box p:after {
538 + content: ".";
539 + display: block;
540 + height: 0;
541 + clear: both;
542 + visibility: hidden;
543 +}
544 +
545 +.akismet-box .akismet-right {
546 + padding-right: 1.5rem;
547 +}
548 +
549 +.akismet-boxes .akismet-box {
550 + margin-bottom: 0;
551 + padding: 0;
552 + margin-top: -1px;
553 +}
554 +
555 +.akismet-boxes .akismet-box:last-child {
556 + margin-bottom: 1.5rem;
557 +}
558 +
559 +.akismet-boxes .akismet-box:first-child {
560 + margin-top: 1.5rem;
561 +}
562 +
563 +.akismet-button, .akismet-button:hover, .akismet-button:visited {
564 + background: white;
565 + border-color: #c8d7e1;
566 + border-style: solid;
567 + border-width: 1px 1px 2px;
568 + color: #2e4453;
569 + cursor: pointer;
570 + display: inline-block;
571 + margin: 0;
572 + outline: 0;
573 + overflow: hidden;
574 + font-size: 14px;
575 + font-weight: 500;
576 + text-overflow: ellipsis;
577 + text-decoration: none;
578 + vertical-align: top;
579 + box-sizing: border-box;
580 + font-size: 14px;
581 + line-height: 21px;
582 + border-radius: 4px;
583 + padding: 7px 14px 9px;
584 + -webkit-appearance: none;
585 + -moz-appearance: none;
586 + appearance: none;
587 +}
588 +
589 +.akismet-button:hover {
590 + border-color: #a8bece;
591 +}
592 +
593 +.akismet-button:active {
594 + border-width: 2px 1px 1px;
595 +}
596 +
597 +.akismet-is-primary, .akismet-is-primary:hover, .akismet-is-primary:visited {
598 + background: #00aadc;
599 + border-color: #0087be;
600 + color: white;
601 +}
602 +
603 +.akismet-is-primary:hover, .akismet-is-primary:focus {
604 + border-color: #005082;
605 +}
606 +
607 +.akismet-is-primary:hover {
608 + border-color: #005082;
609 +}
610 +
611 +.akismet-section-header {
612 + position: relative;
613 + margin: 0 auto 0.625rem auto;
614 + padding: 1rem;
615 + box-sizing: border-box;
616 + box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
617 + background: #ffffff;
618 + width: 100%;
619 + padding-top: 0.6875rem;
620 + padding-bottom: 0.6875rem;
621 + display: flex;
622 +}
623 +
624 +.akismet-section-header__label {
625 + display: -ms-flexbox;
626 + display: flex;
627 + -ms-flex-align: center;
628 + align-items: center;
629 + -ms-flex-positive: 1;
630 + flex-grow: 1;
631 + line-height: 1.75rem;
632 + position: relative;
633 + font-size: 0.875rem;
634 + color: #4f748e;
635 +}
636 +
637 +.akismet-section-header__actions {
638 + line-height: 1.75rem;
639 }
640 \ No newline at end of file
641
642 diff --git a/plugins/akismet/_inc/akismet.js b/plugins/akismet/_inc/akismet.js
643 index ca4ebd2..a72e3a9 100644
644 --- a/plugins/akismet/_inc/akismet.js
645 +++ b/plugins/akismet/_inc/akismet.js
646 @@ -3,17 +3,6 @@ jQuery( function ( $ ) {
647 var mshotSecondTryTimer = null
648 var mshotThirdTryTimer = null
649
650 - $( 'a.activate-option' ).click( function(){
651 - var link = $( this );
652 - if ( link.hasClass( 'clicked' ) ) {
653 - link.removeClass( 'clicked' );
654 - }
655 - else {
656 - link.addClass( 'clicked' );
657 - }
658 - $( '.toggle-have-key' ).slideToggle( 'slow', function() {});
659 - return false;
660 - });
661 $('.akismet-status').each(function () {
662 var thisId = $(this).attr('commentid');
663 $(this).prependTo('#comment-' + thisId + ' .column-comment');
664 @@ -162,13 +151,24 @@ jQuery( function ( $ ) {
665 } );
666
667 $('.checkforspam:not(.button-disabled)').click( function(e) {
668 + e.preventDefault();
669 +
670 $('.checkforspam:not(.button-disabled)').addClass('button-disabled');
671 - $('.checkforspam-spinner').addClass( 'spinner' );
672 + $('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
673 +
674 + // Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
675 + $( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
676 +
677 akismet_check_for_spam(0, 100);
678 - e.preventDefault();
679 });
680
681 + var spam_count = 0;
682 + var recheck_count = 0;
683 +
684 function akismet_check_for_spam(offset, limit) {
685 + // Update the progress counter on the "Check for Spam" button.
686 + $( '.checkforspam-progress' ).text( $( '.checkforspam' ).data( 'progress-label-format' ).replace( '%1$s', offset ) );
687 +
688 $.post(
689 ajaxurl,
690 {
691 @@ -177,8 +177,11 @@ jQuery( function ( $ ) {
692 'limit': limit
693 },
694 function(result) {
695 + recheck_count += result.counts.processed;
696 + spam_count += result.counts.spam;
697 +
698 if (result.counts.processed < limit) {
699 - window.location.reload();
700 + window.location.href = $( '.checkforspam' ).data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
701 }
702 else {
703 // Account for comments that were caught as spam and moved out of the queue.
704 @@ -187,6 +190,10 @@ jQuery( function ( $ ) {
705 }
706 );
707 }
708 +
709 + if ( "start_recheck" in WPAkismet && WPAkismet.start_recheck ) {
710 + $( '.checkforspam' ).click();
711 + }
712 });
713 // URL encode plugin
714 jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
715
716 diff --git a/plugins/akismet/_inc/img/logo-full-2x.png b/plugins/akismet/_inc/img/logo-full-2x.png
717 index a9bed8b..c555285 100644
718 Binary files a/plugins/akismet/_inc/img/logo-full-2x.png and b/plugins/akismet/_inc/img/logo-full-2x.png differ
719
720 diff --git a/plugins/akismet/akismet.php b/plugins/akismet/akismet.php
721 index 61b41fa..42d3321 100644
722 --- a/plugins/akismet/akismet.php
723 +++ b/plugins/akismet/akismet.php
724 @@ -3,10 +3,10 @@
725 * @package Akismet
726 */
727 /*
728 -Plugin Name: Akismet
729 +Plugin Name: Akismet Anti-Spam
730 Plugin URI: https://akismet.com/
731 -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="https://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.
732 -Version: 3.2
733 +Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
734 +Version: 3.3
735 Author: Automattic
736 Author URI: https://automattic.com/wordpress-plugins/
737 License: GPLv2 or later
738 @@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
739 exit;
740 }
741
742 -define( 'AKISMET_VERSION', '3.2' );
743 +define( 'AKISMET_VERSION', '3.3' );
744 define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
745 define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
746 define( 'AKISMET_DELETE_LIMIT', 100000 );
747
748 diff --git a/plugins/akismet/class.akismet-admin.php b/plugins/akismet/class.akismet-admin.php
749 index 2d29cab..fe29233 100644
750 --- a/plugins/akismet/class.akismet-admin.php
751 +++ b/plugins/akismet/class.akismet-admin.php
752 @@ -63,6 +63,8 @@ class Akismet_Admin {
753 add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
754
755 add_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 );
756 +
757 + add_filter( 'all_plugins', array( 'Akismet_Admin', 'modify_plugin_description' ) );
758 }
759
760 public static function admin_init() {
761 @@ -102,7 +104,7 @@ class Akismet_Admin {
762 public static function load_resources() {
763 global $hook_suffix;
764
765 - if ( in_array( $hook_suffix, array(
766 + if ( in_array( $hook_suffix, apply_filters( 'akismet_admin_page_hook_suffixes', array(
767 'index.php', # dashboard
768 'edit-comments.php',
769 'comment.php',
770 @@ -110,13 +112,14 @@ class Akismet_Admin {
771 'settings_page_akismet-key-config',
772 'jetpack_page_akismet-key-config',
773 'plugins.php',
774 - ) ) ) {
775 + ) ) ) ) {
776 wp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION );
777 wp_enqueue_style( 'akismet.css');
778
779 - wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery','postbox'), AKISMET_VERSION );
780 + wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery'), AKISMET_VERSION );
781 wp_enqueue_script( 'akismet.js' );
782 - wp_localize_script( 'akismet.js', 'WPAkismet', array(
783 +
784 + $inline_js = array(
785 'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ),
786 'strings' => array(
787 'Remove this URL' => __( 'Remove this URL' , 'akismet'),
788 @@ -125,7 +128,13 @@ class Akismet_Admin {
789 '(undo)' => __( '(undo)' , 'akismet'),
790 'Re-adding...' => __( 'Re-adding...' , 'akismet'),
791 )
792 - ) );
793 + );
794 +
795 + if ( isset( $_GET['akismet_recheck'] ) && wp_verify_nonce( $_GET['akismet_recheck'], 'akismet_recheck' ) ) {
796 + $inline_js['start_recheck'] = true;
797 + }
798 +
799 + wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js );
800 }
801 }
802
803 @@ -349,7 +358,20 @@ class Akismet_Admin {
804 else
805 $link = add_query_arg( array( 'page' => 'akismet-admin', 'recheckqueue' => 'true', 'noheader' => 'true' ), admin_url( 'edit-comments.php' ) );
806
807 - echo '</div><div class="alignleft"><a class="button-secondary checkforspam" href="' . esc_url( $link ) . '">' . esc_html__('Check for Spam', 'akismet') . '</a><span class="checkforspam-spinner"></span>';
808 + echo '</div>';
809 + echo '<div class="alignleft">';
810 + echo '<a
811 + class="button-secondary checkforspam"
812 + href="' . esc_url( $link ) . '"
813 + data-active-label="' . esc_attr( __( 'Checking for Spam', 'akismet' ) ) . '"
814 + data-progress-label-format="' . esc_attr( __( '(%1$s...)', 'akismet' ) ) . '"
815 + data-success-url="' . esc_attr( remove_query_arg( 'akismet_recheck', add_query_arg( array( 'akismet_recheck_complete' => 1, 'recheck_count' => urlencode( '__recheck_count__' ), 'spam_count' => urlencode( '__spam_count__' ) ) ) ) ) . '"
816 + >';
817 + echo '<span class="akismet-label">' . esc_html__('Check for Spam', 'akismet') . '</span>';
818 + echo '<span class="checkforspam-progress"></span>';
819 + echo '</a>';
820 + echo '<span class="checkforspam-spinner"></span>';
821 +
822 }
823
824 public static function recheck_queue() {
825 @@ -487,7 +509,14 @@ class Akismet_Admin {
826 if ( $desc )
827 echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' , 'akismet') . '">'.esc_html( $desc ).'</a></span>';
828
829 - $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') );
830 + $show_user_comments_option = get_option( 'akismet_show_user_comments_approved' );
831 +
832 + if ( $show_user_comments_option === false ) {
833 + // Default to active if the user hasn't made a decision.
834 + $show_user_comments_option = '1';
835 + }
836 +
837 + $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', $show_user_comments_option );
838 $show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true'
839
840 if ( $show_user_comments ) {
841 @@ -793,10 +822,6 @@ class Akismet_Admin {
842 }
843 }
844
845 - public static function display_invalid_version() {
846 - Akismet::view( 'notice', array( 'type' => 'version' ) );
847 - }
848 -
849 public static function display_api_key_warning() {
850 Akismet::view( 'notice', array( 'type' => 'plugin' ) );
851 }
852 @@ -838,18 +863,26 @@ class Akismet_Admin {
853 if ( $_GET['action'] == 'save-key' ) {
854 if ( is_object( $akismet_user ) ) {
855 self::save_key( $akismet_user->api_key );
856 - self::display_notice();
857 self::display_configuration_page();
858 - return;
859 + return;
860 }
861 }
862 }
863
864 - echo '<h2 class="ak-header">'.esc_html__('Akismet', 'akismet').'</h2>';
865 -
866 - self::display_status();
867 + Akismet::view( 'start', compact( 'akismet_user' ) );
868
869 + /*
870 + // To see all variants when testing.
871 + $akismet_user->status = 'no-sub';
872 Akismet::view( 'start', compact( 'akismet_user' ) );
873 + $akismet_user->status = 'cancelled';
874 + Akismet::view( 'start', compact( 'akismet_user' ) );
875 + $akismet_user->status = 'suspended';
876 + Akismet::view( 'start', compact( 'akismet_user' ) );
877 + $akismet_user->status = 'other';
878 + Akismet::view( 'start', compact( 'akismet_user' ) );
879 + $akismet_user = false;
880 + */
881 }
882
883 public static function display_stats_page() {
884 @@ -869,12 +902,15 @@ class Akismet_Admin {
885
886 $stat_totals = self::get_stats( $api_key );
887
888 - // If unset, create the new strictness option using the old discard option to determine its default
889 - if ( get_option( 'akismet_strictness' ) === false )
890 - add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
891 + // If unset, create the new strictness option using the old discard option to determine its default.
892 + // If the old option wasn't set, default to discarding the blatant spam.
893 + if ( get_option( 'akismet_strictness' ) === false ) {
894 + add_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) );
895 + }
896 +
897 + $notices = array();
898
899 if ( empty( self::$notices ) ) {
900 - //show status
901 if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
902
903 $time_saved = false;
904 @@ -892,26 +928,53 @@ class Akismet_Admin {
905 elseif ( $total_in_minutes >= 30 )
906 $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 );
907 }
908 -
909 - Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) );
910 +
911 + $notices[] = array( 'type' => 'active-notice', 'time_saved' => $time_saved );
912 }
913
914 if ( !empty( $akismet_user->limit_reached ) && in_array( $akismet_user->limit_reached, array( 'yellow', 'red' ) ) ) {
915 - Akismet::view( 'notice', array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached ) );
916 + $notices[] = array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached );
917 }
918 }
919
920 - if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) )
921 - Akismet::view( 'notice', array( 'type' => $akismet_user->status ) );
922 + if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) {
923 + $notices[] = array( 'type' => $akismet_user->status );
924 + }
925
926 + /*
927 + // To see all variants when testing.
928 + $notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' );
929 + $notices[] = array( 'type' => 'plugin' );
930 + $notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' );
931 + $notices[] = array( 'type' => 'notice', 'notice_header' => 'This is the notice header.', 'notice_text' => 'This is the notice text.' );
932 + $notices[] = array( 'type' => 'missing-functions' );
933 + $notices[] = array( 'type' => 'servers-be-down' );
934 + $notices[] = array( 'type' => 'active-dunning' );
935 + $notices[] = array( 'type' => 'cancelled' );
936 + $notices[] = array( 'type' => 'suspended' );
937 + $notices[] = array( 'type' => 'missing' );
938 + $notices[] = array( 'type' => 'no-sub' );
939 + $notices[] = array( 'type' => 'new-key-valid' );
940 + $notices[] = array( 'type' => 'new-key-invalid' );
941 + $notices[] = array( 'type' => 'existing-key-invalid' );
942 + $notices[] = array( 'type' => 'new-key-failed' );
943 + $notices[] = array( 'type' => 'limit-reached', 'level' => 'yellow' );
944 + $notices[] = array( 'type' => 'limit-reached', 'level' => 'red' );
945 + */
946 +
947 Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
948 - Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals' ) );
949 + Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals', 'notices' ) );
950 }
951
952 public static function display_notice() {
953 global $hook_suffix;
954
955 - if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config', 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
956 + if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) ) {
957 + // This page manages the notices and puts them inline where they make sense.
958 + return;
959 + }
960 +
961 + if ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
962 Akismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state
963
964 if ( get_option( 'akismet_alert_code' ) > 0 )
965 @@ -923,38 +986,59 @@ class Akismet_Admin {
966 elseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
967 self::display_spam_check_warning();
968 }
969 - elseif ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) && Akismet::get_api_key() ) {
970 - self::display_status();
971 + else if ( isset( $_GET['akismet_recheck_complete'] ) ) {
972 + $recheck_count = (int) $_GET['recheck_count'];
973 + $spam_count = (int) $_GET['spam_count'];
974 +
975 + if ( $recheck_count === 0 ) {
976 + $message = __( 'There were no comments to check. Akismet will only check comments in the Pending queue.', 'akismet' );
977 + }
978 + else {
979 + $message = sprintf( _n( 'Akismet checked %s comment.', 'Akismet checked %s comments.', $recheck_count, 'akismet' ), number_format( $recheck_count ) );
980 + $message .= ' ';
981 +
982 + if ( $spam_count === 0 ) {
983 + $message .= __( 'No comments were caught as spam.' );
984 + }
985 + else {
986 + $message .= sprintf( _n( '%s comment was caught as spam.', '%s comments were caught as spam.', $spam_count, 'akismet' ), number_format( $spam_count ) );
987 + }
988 + }
989 +
990 + echo '<div class="notice notice-success"><p>' . esc_html( $message ) . '</p></div>';
991 }
992 }
993
994 public static function display_status() {
995 - $type = '';
996 -
997 - if ( !self::get_server_connectivity() )
998 - $type = 'servers-be-down';
999 -
1000 - if ( !empty( $type ) )
1001 - Akismet::view( 'notice', compact( 'type' ) );
1002 - elseif ( !empty( self::$notices ) ) {
1003 - foreach ( self::$notices as $type ) {
1004 + if ( ! self::get_server_connectivity() ) {
1005 + Akismet::view( 'notice', compact( 'servers-be-down' ) );
1006 + }
1007 + else if ( ! empty( self::$notices ) ) {
1008 + foreach ( self::$notices as $index => $type ) {
1009 if ( is_object( $type ) ) {
1010 $notice_header = $notice_text = '';
1011
1012 - if ( property_exists( $type, 'notice_header' ) )
1013 + if ( property_exists( $type, 'notice_header' ) ) {
1014 $notice_header = wp_kses( $type->notice_header, self::$allowed );
1015 + }
1016
1017 - if ( property_exists( $type, 'notice_text' ) )
1018 + if ( property_exists( $type, 'notice_text' ) ) {
1019 $notice_text = wp_kses( $type->notice_text, self::$allowed );
1020 + }
1021
1022 if ( property_exists( $type, 'status' ) ) {
1023 $type = wp_kses( $type->status, self::$allowed );
1024 Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );
1025 +
1026 + unset( self::$notices[ $index ] );
1027 }
1028 }
1029 - else
1030 + else {
1031 Akismet::view( 'notice', compact( 'type' ) );
1032 - }
1033 +
1034 + unset( self::$notices[ $index ] );
1035 + }
1036 + }
1037 }
1038 }
1039
1040 @@ -997,4 +1081,20 @@ class Akismet_Admin {
1041
1042 return $exclude;
1043 }
1044 +
1045 + /**
1046 + * When Akismet is active, remove the "Activate Akismet" step from the plugin description.
1047 + */
1048 + public static function modify_plugin_description( $all_plugins ) {
1049 + if ( isset( $all_plugins['akismet/akismet.php'] ) ) {
1050 + if ( Akismet::get_api_key() ) {
1051 + $all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Your site is fully configured and being protected, even while you sleep.', 'akismet' );
1052 + }
1053 + else {
1054 + $all_plugins['akismet/akismet.php']['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, just go to <a href="admin.php?page=akismet-key-config">your Akismet Settings page</a> to set up your API key.', 'akismet' );
1055 + }
1056 + }
1057 +
1058 + return $all_plugins;
1059 + }
1060 }
1061 \ No newline at end of file
1062
1063 diff --git a/plugins/akismet/class.akismet.php b/plugins/akismet/class.akismet.php
1064 index 0d312e9..c8d5d75 100644
1065 --- a/plugins/akismet/class.akismet.php
1066 +++ b/plugins/akismet/class.akismet.php
1067 @@ -129,8 +129,9 @@ class Akismet {
1068 $comment['blog_charset'] = get_option('blog_charset');
1069 $comment['permalink'] = get_permalink( $comment['comment_post_ID'] );
1070
1071 - if ( !empty( $comment['user_ID'] ) )
1072 + if ( ! empty( $comment['user_ID'] ) ) {
1073 $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
1074 + }
1075
1076 /** See filter documentation in init_hooks(). */
1077 $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
1078 @@ -465,8 +466,9 @@ class Akismet {
1079 $c['recheck_reason'] = $recheck_reason;
1080
1081 $c['user_role'] = '';
1082 - if ( isset( $c['user_ID'] ) )
1083 - $c['user_role'] = Akismet::get_user_roles($c['user_ID']);
1084 + if ( ! empty( $c['user_ID'] ) ) {
1085 + $c['user_role'] = Akismet::get_user_roles( $c['user_ID'] );
1086 + }
1087
1088 if ( self::is_test_mode() )
1089 $c['is_test'] = 'true';
1090 @@ -596,8 +598,9 @@ class Akismet {
1091 $comment->site_domain = $current_site->domain;
1092
1093 $comment->user_role = '';
1094 - if ( isset( $comment->user_ID ) )
1095 + if ( ! empty( $comment->user_ID ) ) {
1096 $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
1097 + }
1098
1099 if ( self::is_test_mode() )
1100 $comment->is_test = 'true';
1101 @@ -642,8 +645,9 @@ class Akismet {
1102 if ( is_object($current_site) )
1103 $comment->site_domain = $current_site->domain;
1104
1105 - if ( isset( $comment->user_ID ) )
1106 - $comment->user_role = Akismet::get_user_roles($comment->user_ID);
1107 + if ( ! empty( $comment->user_ID ) ) {
1108 + $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
1109 + }
1110
1111 if ( Akismet::is_test_mode() )
1112 $comment->is_test = 'true';
1113 @@ -1038,7 +1042,7 @@ class Akismet {
1114 }
1115
1116 // given a response from an API call like check_key_status(), update the alert code options if an alert is present.
1117 - private static function update_alert( $response ) {
1118 + public static function update_alert( $response ) {
1119 $code = $msg = null;
1120 if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
1121 $code = $response[0]['x-akismet-alert-code'];
1122
1123 diff --git a/plugins/akismet/readme.txt b/plugins/akismet/readme.txt
1124 index 41c7540..3d7beb0 100644
1125 --- a/plugins/akismet/readme.txt
1126 +++ b/plugins/akismet/readme.txt
1127 @@ -2,15 +2,15 @@
1128 Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
1129 Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
1130 Requires at least: 3.7
1131 -Tested up to: 4.6.1
1132 -Stable tag: 3.2
1133 +Tested up to: 4.7.2
1134 +Stable tag: 3.3
1135 License: GPLv2 or later
1136
1137 -Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
1138 +Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
1139
1140 == Description ==
1141
1142 -Akismet checks your comments against the Akismet Web service to see if they look like spam or not and lets you review the spam it catches under your blog's "Comments" admin screen.
1143 +Akismet checks your comments and contact form submissions against our global database of spam to prevent your site from publishing malicious content. You can review the comment spam it catches on your blog's "Comments" admin screen.
1144
1145 Major features in Akismet include:
1146
1147 @@ -30,6 +30,15 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
1148
1149 == Changelog ==
1150
1151 += 3.3 =
1152 +*Release Date - 23 February 2017*
1153 +
1154 +* Updated the Akismet admin pages with a new clean design.
1155 +* Fixed bugs preventing the `akismet_add_comment_nonce` and `akismet_update_alert` wrapper functions from working properly.
1156 +* Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
1157 +* Added a progress indicator to the "Check for Spam" button.
1158 +* Added a success message after manually rechecking the Pending queue for spam.
1159 +
1160 = 3.2 =
1161 *Release Date - 6 September 2016*
1162
1163
1164 diff --git a/plugins/akismet/views/config.php b/plugins/akismet/views/config.php
1165 index bc8cb97..f7b232e 100644
1166 --- a/plugins/akismet/views/config.php
1167 +++ b/plugins/akismet/views/config.php
1168 @@ -1,216 +1,232 @@
1169 -<div class="wrap">
1170 -
1171 - <h2><?php esc_html_e( 'Akismet' , 'akismet');?></h2>
1172 -
1173 - <div class="have-key">
1174 -
1175 +<div id="akismet-plugin-container">
1176 + <div class="akismet-masthead">
1177 + <div class="akismet-masthead__inside-container">
1178 + <div class="akismet-masthead__logo-container">
1179 + <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
1180 + </div>
1181 + </div>
1182 + </div>
1183 + <div class="akismet-lower">
1184 + <?php if ( Akismet::get_api_key() ) { ?>
1185 + <?php Akismet_Admin::display_status(); ?>
1186 + <?php } ?>
1187 + <?php if ( ! empty( $notices ) ) { ?>
1188 + <?php foreach ( $notices as $notice ) { ?>
1189 + <?php Akismet::view( 'notice', $notice ); ?>
1190 + <?php } ?>
1191 + <?php } ?>
1192 <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
1193 -
1194 - <div class="new-snapshot stats">
1195 -
1196 - <span style="float:right;margin:10px 15px -5px 0px">
1197 - <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
1198 - </span>
1199 -
1200 - <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
1201 - <ul>
1202 - <li>
1203 - <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
1204 - <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
1205 - <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
1206 - </li>
1207 - <li>
1208 - <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
1209 - <span><?php echo number_format( $stat_totals['all']->spam );?></span>
1210 - <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
1211 - </li>
1212 - <li>
1213 - <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
1214 - <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
1215 - <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
1216 - |
1217 - <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
1218 - </li>
1219 - </ul>
1220 - <div class="clearfix"></div>
1221 + <div class="akismet-card">
1222 + <div class="akismet-section-header">
1223 + <div class="akismet-section-header__label">
1224 + <span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>
1225 + </div>
1226 + <div class="akismet-section-header__actions">
1227 + <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
1228 + <?php esc_html_e( 'Detailed Stats' , 'akismet');?>
1229 + </a>
1230 + </div>
1231 + </div>
1232 +
1233 + <div class="akismet-new-snapshot">
1234 + <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
1235 + <ul>
1236 + <li>
1237 + <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
1238 + <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
1239 + <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
1240 + </li>
1241 + <li>
1242 + <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
1243 + <span><?php echo number_format( $stat_totals['all']->spam );?></span>
1244 + <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
1245 + </li>
1246 + <li>
1247 + <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
1248 + <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
1249 + <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
1250 + |
1251 + <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
1252 + </li>
1253 + </ul>
1254 + </div>
1255 </div>
1256 <?php endif;?>
1257
1258 <?php if ( $akismet_user ):?>
1259 + <div class="akismet-card">
1260 + <div class="akismet-section-header">
1261 + <div class="akismet-section-header__label">
1262 + <span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>
1263 + </div>
1264 + </div>
1265
1266 - <div id="wpcom-stats-meta-box-container" class="metabox-holder"><?php
1267 - wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
1268 - wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
1269 - ?>
1270 - <script type="text/javascript">
1271 - jQuery(document).ready( function($) {
1272 - jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
1273 - if(typeof postboxes !== 'undefined')
1274 - postboxes.add_postbox_toggles( 'plugins_page_akismet-key-config' );
1275 - });
1276 - </script>
1277 - <div class="postbox-container" style="width: 55%;margin-right: 10px;">
1278 - <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1279 - <div id="referrers" class="postbox ">
1280 - <div class="handlediv" title="Click to toggle"><br></div>
1281 - <h3 class="hndle"><span><?php esc_html_e( 'Settings' , 'akismet');?></span></h3>
1282 - <form name="akismet_conf" id="akismet-conf" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
1283 - <div class="inside">
1284 - <table cellspacing="0" class="akismet-settings">
1285 - <tbody>
1286 - <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
1287 - <tr>
1288 - <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
1289 - <td width="5%"/>
1290 - <td align="left">
1291 - <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
1292 - </td>
1293 - </tr>
1294 - <?php endif; ?>
1295 - <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
1296 - <tr>
1297 - <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
1298 - <td></td>
1299 - <td align="left">
1300 - <p>
1301 - <?php
1302 + <div class="inside">
1303 + <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
1304 + <table cellspacing="0" class="akismet-settings">
1305 + <tbody>
1306 + <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
1307 + <tr>
1308 + <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
1309 + <td width="5%"/>
1310 + <td align="left">
1311 + <span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
1312 + </td>
1313 + </tr>
1314 + <?php endif; ?>
1315 + <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
1316 + <tr>
1317 + <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
1318 + <td></td>
1319 + <td align="left">
1320 + <p>
1321 + <?php
1322
1323 - if ( ! function_exists( 'wp_http_supports' ) ) {
1324 - ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
1325 - }
1326 - else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
1327 - ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php
1328 - }
1329 - else {
1330 - $ssl_disabled = get_option( 'akismet_ssl_disabled' );
1331 + if ( ! function_exists( 'wp_http_supports' ) ) {
1332 + ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
1333 + }
1334 + else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
1335 + ?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Your Web server cannot make SSL requests; contact your Web host and ask them to add support for SSL requests.', 'akismet' ); ?><?php
1336 + }
1337 + else {
1338 + $ssl_disabled = get_option( 'akismet_ssl_disabled' );
1339
1340 - if ( $ssl_disabled ) {
1341 - ?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?><?php
1342 - }
1343 - else {
1344 - ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
1345 - }
1346 - }
1347 + if ( $ssl_disabled ) {
1348 + ?><b><?php esc_html_e( 'Temporarily disabled.', 'akismet' ); ?></b> <?php esc_html_e( 'Akismet encountered a problem with a previous SSL request and disabled it temporarily. It will begin using SSL for requests again shortly.', 'akismet' ); ?><?php
1349 + }
1350 + else {
1351 + ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
1352 + }
1353 + }
1354
1355 - ?>
1356 - </p>
1357 - </td>
1358 - </tr>
1359 - <?php } ?>
1360 - <tr>
1361 - <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
1362 - <td></td>
1363 - <td align="left">
1364 - <p>
1365 - <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="1" type="checkbox" <?php checked('1', get_option('akismet_show_user_comments_approved')); ?>> <?php esc_html_e('Show the number of approved comments beside each comment author', 'akismet'); ?></label>
1366 - </p>
1367 - </td>
1368 - </tr>
1369 - <tr>
1370 - <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
1371 - <td></td>
1372 - <td align="left">
1373 - <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
1374 - <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
1375 - <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
1376 - </fieldset>
1377 - <span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
1378 + ?>
1379 + </p>
1380 + </td>
1381 + </tr>
1382 + <?php } ?>
1383 + <tr>
1384 + <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
1385 + <td></td>
1386 + <td align="left">
1387 + <p>
1388 + <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
1389 + <input
1390 + name="akismet_show_user_comments_approved"
1391 + id="akismet_show_user_comments_approved"
1392 + value="1"
1393 + type="checkbox"
1394 <?php
1395
1396 - $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
1397 -
1398 - printf(
1399 - _n(
1400 - 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
1401 - 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
1402 - $delete_interval,
1403 - 'akismet'
1404 - ),
1405 - admin_url( 'edit-comments.php?comment_status=spam' ),
1406 - $delete_interval
1407 - );
1408 + // If the option isn't set, or if it's enabled ('1'), or if it was enabled a long time ago ('true'), check the checkbox.
1409 + checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
1410
1411 ?>
1412 - </td>
1413 - </tr>
1414 - </tbody>
1415 - </table>
1416 - </div>
1417 - <div id="major-publishing-actions">
1418 - <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
1419 - <div id="delete-action">
1420 - <a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>
1421 - </div>
1422 - <?php endif; ?>
1423 - <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
1424 - <div id="publishing-action">
1425 - <input type="hidden" name="action" value="enter-key">
1426 - <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
1427 -
1428 - </div>
1429 - <div class="clear"></div>
1430 - </div>
1431 - </form>
1432 + />
1433 + <?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
1434 + </label>
1435 + </p>
1436 + </td>
1437 + </tr>
1438 + <tr>
1439 + <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
1440 + <td></td>
1441 + <td align="left">
1442 + <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
1443 + <p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
1444 + <p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
1445 + </fieldset>
1446 + <span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
1447 + <?php
1448 +
1449 + $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
1450 +
1451 + printf(
1452 + _n(
1453 + 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
1454 + 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
1455 + $delete_interval,
1456 + 'akismet'
1457 + ),
1458 + admin_url( 'edit-comments.php?comment_status=spam' ),
1459 + $delete_interval
1460 + );
1461 +
1462 + ?>
1463 + </td>
1464 + </tr>
1465 + </tbody>
1466 + </table>
1467 + <div class="akismet-card-actions">
1468 + <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
1469 + <div id="delete-action">
1470 + <a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>
1471 + </div>
1472 + <?php endif; ?>
1473 + <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
1474 + <div id="publishing-action">
1475 + <input type="hidden" name="action" value="enter-key">
1476 + <input type="submit" name="submit" id="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
1477 + </div>
1478 + <div class="clear"></div>
1479 </div>
1480 + </form>
1481 + </div>
1482 + </div>
1483 +
1484 + <div class="akismet-card">
1485 + <div class="akismet-section-header">
1486 + <div class="akismet-section-header__label">
1487 + <span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
1488 </div>
1489 </div>
1490 - <div class="postbox-container" style="width:44%;">
1491 - <div id="normal-sortables" class="meta-box-sortables ui-sortable">
1492 - <div id="referrers" class="postbox ">
1493 - <div class="handlediv" title="Click to toggle"><br></div>
1494 - <h3 class="hndle"><span><?php esc_html_e( 'Account' , 'akismet');?></span></h3>
1495 - <div class="inside">
1496 - <table cellspacing="0">
1497 - <tbody>
1498 - <tr>
1499 - <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
1500 - <td width="5%"/>
1501 - <td align="left">
1502 - <span><?php echo esc_html( $akismet_user->account_name ); ?></span>
1503 - </td>
1504 - </tr>
1505 - <tr>
1506 - <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
1507 - <td width="5%"/>
1508 - <td align="left">
1509 - <span><?php
1510 - if ( 'cancelled' == $akismet_user->status ) :
1511 - esc_html_e( 'Cancelled', 'akismet' );
1512 - elseif ( 'suspended' == $akismet_user->status ) :
1513 - esc_html_e( 'Suspended', 'akismet' );
1514 - elseif ( 'missing' == $akismet_user->status ) :
1515 - esc_html_e( 'Missing', 'akismet' );
1516 - elseif ( 'no-sub' == $akismet_user->status ) :
1517 - esc_html_e( 'No Subscription Found', 'akismet' );
1518 - else :
1519 - esc_html_e( 'Active', 'akismet' );
1520 - endif; ?></span>
1521 - </td>
1522 - </tr>
1523 - <?php if ( $akismet_user->next_billing_date ) : ?>
1524 - <tr>
1525 - <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
1526 - <td width="5%"/>
1527 - <td align="left">
1528 - <span><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></span>
1529 - </td>
1530 - </tr>
1531 - <?php endif; ?>
1532 - </tbody>
1533 - </table>
1534 - </div>
1535 - <div id="major-publishing-actions">
1536 - <div id="publishing-action">
1537 - <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
1538 - </div>
1539 - <div class="clear"></div>
1540 - </div>
1541 +
1542 + <div class="inside">
1543 + <table cellspacing="0" border="0" class="akismet-settings">
1544 + <tbody>
1545 + <tr>
1546 + <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
1547 + <td width="5%"/>
1548 + <td align="left">
1549 + <p><?php echo esc_html( $akismet_user->account_name ); ?></p>
1550 + </td>
1551 + </tr>
1552 + <tr>
1553 + <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
1554 + <td width="5%"/>
1555 + <td align="left">
1556 + <p><?php
1557 + if ( 'cancelled' == $akismet_user->status ) :
1558 + esc_html_e( 'Cancelled', 'akismet' );
1559 + elseif ( 'suspended' == $akismet_user->status ) :
1560 + esc_html_e( 'Suspended', 'akismet' );
1561 + elseif ( 'missing' == $akismet_user->status ) :
1562 + esc_html_e( 'Missing', 'akismet' );
1563 + elseif ( 'no-sub' == $akismet_user->status ) :
1564 + esc_html_e( 'No Subscription Found', 'akismet' );
1565 + else :
1566 + esc_html_e( 'Active', 'akismet' );
1567 + endif; ?></p>
1568 + </td>
1569 + </tr>
1570 + <?php if ( $akismet_user->next_billing_date ) : ?>
1571 + <tr>
1572 + <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
1573 + <td width="5%"/>
1574 + <td align="left">
1575 + <p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
1576 + </td>
1577 + </tr>
1578 + <?php endif; ?>
1579 + </tbody>
1580 + </table>
1581 + <div class="akismet-card-actions">
1582 + <div id="publishing-action">
1583 + <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
1584 </div>
1585 + <div class="clear"></div>
1586 </div>
1587 </div>
1588 </div>
1589 -
1590 <?php endif;?>
1591 -
1592 </div>
1593 </div>
1594 \ No newline at end of file
1595
1596 diff --git a/plugins/akismet/views/get.php b/plugins/akismet/views/get.php
1597 index 4bd6a9c..c9dbf10 100644
1598 --- a/plugins/akismet/views/get.php
1599 +++ b/plugins/akismet/views/get.php
1600 @@ -2,5 +2,5 @@
1601 <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1602 <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
1603 <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
1604 - <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
1605 + <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button akismet-is-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
1606 </form>
1607 \ No newline at end of file
1608
1609 diff --git a/plugins/akismet/views/notice.php b/plugins/akismet/views/notice.php
1610 index 8e6e508..e82f168 100644
1611 --- a/plugins/akismet/views/notice.php
1612 +++ b/plugins/akismet/views/notice.php
1613 @@ -5,10 +5,10 @@
1614 <div class="aa_a">A</div>
1615 <div class="aa_button_container">
1616 <div class="aa_button_border">
1617 - <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Activate your Akismet account', 'akismet' ); ?>" />
1618 + <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" />
1619 </div>
1620 </div>
1621 - <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>
1622 + <div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div>
1623 </div>
1624 </form>
1625 </div>
1626 @@ -20,8 +20,6 @@
1627 <p><?php echo $link_text; ?></p>
1628 <?php } ?>
1629 </div>
1630 -<?php elseif ( $type == 'version' ) :?>
1631 -<div id="akismet-warning" class="updated fade"><p><strong><?php printf( esc_html__('Akismet %s requires WordPress 3.0 or higher.', 'akismet'), AKISMET_VERSION);?></strong> <?php printf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');?></p></div>
1632 <?php elseif ( $type == 'alert' ) :?>
1633 <div class='error'>
1634 <p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
1635 @@ -35,88 +33,102 @@
1636 </p>
1637 </div>
1638 <?php elseif ( $type == 'notice' ) :?>
1639 -<div class="wrap alert critical">
1640 - <h3 class="key-status failed"><?php echo $notice_header; ?></h3>
1641 - <p class="description">
1642 +<div class="akismet-alert akismet-critical">
1643 + <h3 class="akismet-key-status failed"><?php echo $notice_header; ?></h3>
1644 + <p class="akismet-description">
1645 <?php echo $notice_text; ?>
1646 </p>
1647 </div>
1648 <?php elseif ( $type == 'missing-functions' ) :?>
1649 -<div class="wrap alert critical">
1650 - <h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
1651 - <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'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1652 +<div class="akismet-alert akismet-critical">
1653 + <h3 class="akismet-key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
1654 + <p class="akismet-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'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1655 </div>
1656 <?php elseif ( $type == 'servers-be-down' ) :?>
1657 -<div class="wrap alert critical">
1658 - <h3 class="key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
1659 - <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'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1660 +<div class="akismet-alert akismet-critical">
1661 + <h3 class="akismet-key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
1662 + <p class="akismet-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'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1663 </div>
1664 <?php elseif ( $type == 'active-dunning' ) :?>
1665 -<div class="wrap alert critical">
1666 - <h3 class="key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
1667 - <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>
1668 +<div class="akismet-alert akismet-critical">
1669 + <h3 class="akismet-key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
1670 + <p class="akismet-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>
1671 </div>
1672 <?php elseif ( $type == 'cancelled' ) :?>
1673 -<div class="wrap alert critical">
1674 - <h3 class="key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
1675 - <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>
1676 +<div class="akismet-alert akismet-critical">
1677 + <h3 class="akismet-key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
1678 + <p class="akismet-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>
1679 </div>
1680 <?php elseif ( $type == 'suspended' ) :?>
1681 -<div class="wrap alert critical">
1682 - <h3 class="key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
1683 - <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
1684 +<div class="akismet-alert akismet-critical">
1685 + <h3 class="akismet-key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
1686 + <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
1687 </div>
1688 <?php elseif ( $type == 'active-notice' && $time_saved ) :?>
1689 -<div class="wrap alert active">
1690 - <h3 class="key-status"><?php echo esc_html( $time_saved ); ?></h3>
1691 - <p class="description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>
1692 +<div class="akismet-alert akismet-active">
1693 + <h3 class="akismet-key-status"><?php echo esc_html( $time_saved ); ?></h3>
1694 + <p class="akismet-description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>
1695 </div>
1696 <?php elseif ( $type == 'missing' ) :?>
1697 -<div class="wrap alert critical">
1698 - <h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
1699 - <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
1700 +<div class="akismet-alert akismet-critical">
1701 + <h3 class="akismet-key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
1702 + <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
1703 </div>
1704 <?php elseif ( $type == 'no-sub' ) :?>
1705 -<div class="wrap alert critical">
1706 - <h3 class="key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
1707 - <p class="description">
1708 +<div class="akismet-alert akismet-critical">
1709 + <h3 class="akismet-key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
1710 + <p class="akismet-description">
1711 <?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/' ); ?>
1712 <br /><br />
1713 <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
1714 </p>
1715 </div>
1716 -<?php elseif ( $type == 'new-key-valid' ) :?>
1717 -<div class="wrap alert active">
1718 - <h3 class="key-status"><?php esc_html_e('Akismet is now activated. Happy blogging!', 'akismet'); ?></h3>
1719 +<?php elseif ( $type == 'new-key-valid' ) :
1720 + global $wpdb;
1721 +
1722 + $check_pending_link = false;
1723 +
1724 + $at_least_one_comment_in_moderation = !! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" );
1725 +
1726 + if ( $at_least_one_comment_in_moderation) {
1727 + $check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );
1728 + }
1729 +
1730 + ?>
1731 +<div class="akismet-alert akismet-active">
1732 + <h3 class="akismet-key-status"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3>
1733 + <?php if ( $check_pending_link ) { ?>
1734 + <p class="akismet-description"><?php printf( __( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p>
1735 + <?php } ?>
1736 </div>
1737 <?php elseif ( $type == 'new-key-invalid' ) :?>
1738 -<div class="wrap alert critical">
1739 - <h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
1740 +<div class="akismet-alert akismet-critical">
1741 + <h3 class="akismet-key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
1742 </div>
1743 <?php elseif ( $type == 'existing-key-invalid' ) :?>
1744 -<div class="wrap alert critical">
1745 - <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>
1746 +<div class="akismet-alert akismet-critical">
1747 + <h3 class="akismet-key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@×××××××.com.' , 'akismet'); ?></h3>
1748 </div>
1749 <?php elseif ( $type == 'new-key-failed' ) :?>
1750 -<div class="wrap alert critical">
1751 - <h3 class="key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
1752 - <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'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1753 +<div class="akismet-alert akismet-critical">
1754 + <h3 class="akismet-key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
1755 + <p class="akismet-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'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
1756 </div>
1757 <?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
1758 -<div class="wrap alert critical">
1759 +<div class="akismet-alert akismet-critical">
1760 <?php if ( $level == 'yellow' ): ?>
1761 - <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>
1762 - <p class="description">
1763 + <h3 class="akismet-key-status failed"><?php esc_html_e( 'You&#8217;re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>
1764 + <p class="akismet-description">
1765 <?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' ), 'https://docs.akismet.com/billing/add-more-sites/' ); ?>
1766 <br /><br />
1767 <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
1768 </p>
1769 <?php elseif ( $level == 'red' ): ?>
1770 - <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>
1771 - <p class="description">
1772 - <?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>
1773 + <h3 class="akismet-key-status failed"><?php esc_html_e( 'You&#8217;re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>
1774 + <p class="akismet-description">
1775 + <?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/' ); ?>
1776 <br /><br />
1777 - <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?></p>
1778 + <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
1779 </p>
1780 <?php endif; ?>
1781 </div>
1782
1783 diff --git a/plugins/akismet/views/start.php b/plugins/akismet/views/start.php
1784 index 751da6e..d17b53d 100644
1785 --- a/plugins/akismet/views/start.php
1786 +++ b/plugins/akismet/views/start.php
1787 @@ -1,97 +1,93 @@
1788 -<div class="no-key config-wrap"><?php
1789 - if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
1790 - if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) :?>
1791 -<p><?php esc_html_e('Akismet eliminates spam from your site. Register below to get started.', 'akismet'); ?></p>
1792 -<div class="activate-highlight activate-option">
1793 - <div class="option-description">
1794 - <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
1795 - <?php echo esc_html( $akismet_user->user_email ); ?>
1796 +<div id="akismet-plugin-container">
1797 + <div class="akismet-masthead">
1798 + <div class="akismet-masthead__inside-container">
1799 + <div class="akismet-masthead__logo-container">
1800 + <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
1801 + </div>
1802 + </div>
1803 </div>
1804 - <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
1805 - <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1806 - <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
1807 - <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
1808 - <input type="hidden" name="redirect" value="plugin-signup"/>
1809 - <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register for Akismet' , 'akismet'); ?>"/>
1810 - </form>
1811 -</div>
1812 -<?php elseif ( $akismet_user->status == 'cancelled' ) :?>
1813 -<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
1814 -<div class="activate-highlight activate-option">
1815 - <div class="option-description" style="width:75%;">
1816 - <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
1817 - <?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ) ); ?>
1818 + <div class="akismet-lower">
1819 + <?php Akismet_Admin::display_status(); ?>
1820 + <div class="akismet-box">
1821 + <h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
1822 + <p><?php esc_html_e( 'Select one of the options below to get started.', 'akismet' ); ?></p>
1823 + </div>
1824 + <div class="akismet-boxes">
1825 + <?php if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { ?>
1826 + <?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
1827 + <div class="akismet-box">
1828 + <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
1829 + <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
1830 + <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
1831 + <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1832 + <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
1833 + <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
1834 + <input type="hidden" name="redirect" value="plugin-signup"/>
1835 + <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
1836 + </form>
1837 + <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
1838 + <p><?php echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
1839 + </div>
1840 + <?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
1841 + <div class="akismet-box">
1842 + <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
1843 + <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
1844 + <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1845 + <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
1846 + <input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
1847 + <input type="hidden" name="redirect" value="upgrade"/>
1848 + <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet' ); ?>"/>
1849 + </form>
1850 + <p><?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
1851 + </div>
1852 + <?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
1853 + <div class="centered akismet-box">
1854 + <h3><?php esc_html_e( 'Connected via Jetpack' , 'akismet' ); ?></h3>
1855 + <p class="akismet-alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
1856 + <p><?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?></p>
1857 + <p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
1858 + </div>
1859 + <?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
1860 + <div class="akismet-box">
1861 + <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
1862 + <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
1863 + <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
1864 + <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
1865 + <input type="hidden" name="action" value="enter-key">
1866 + <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
1867 + <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
1868 + </form>
1869 + <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
1870 + <p><?php echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
1871 + </div>
1872 + <?php } ?>
1873 + <div class="akismet-box">
1874 + <h3><?php esc_html_e( 'Or sign up with a different email address', 'akismet' ); ?></h3>
1875 + <div class="akismet-right">
1876 + <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet' ), 'classes' => array( 'akismet-button' ) ) ); ?>
1877 + </div>
1878 + <p><?php esc_html_e( 'Choose this option to use Akismet independently of your Jetpack connection.', 'akismet' ); ?></p>
1879 + </div>
1880 + <?php } else { ?>
1881 + <div class="akismet-box">
1882 + <h3><?php esc_html_e( 'Activate Akismet' , 'akismet' );?></h3>
1883 + <div class="akismet-right">
1884 + <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
1885 + </div>
1886 + <p><?php esc_html_e( 'Log in or sign up now.', 'akismet' ); ?></p>
1887 + </div>
1888 + <?php } ?>
1889 + <div class="akismet-box">
1890 + <h3><?php esc_html_e( 'Or enter an API key', 'akismet' ); ?></h3>
1891 + <p><?php esc_html_e( 'Already have your key? Enter it here.', 'akismet' ); ?> <a href="https://docs.akismet.com/getting-started/api-key/" target="_blank"><?php esc_html_e( '(What is an API key?)', 'akismet' ); ?></a></p>
1892 + <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
1893 + <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
1894 + <input type="hidden" name="action" value="enter-key">
1895 + <p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
1896 + <input id="key" name="key" type="text" size="15" value="" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
1897 + <input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
1898 + </p>
1899 + </form>
1900 + </div>
1901 </div>
1902 - <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
1903 - <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
1904 - <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
1905 - <input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
1906 - <input type="hidden" name="redirect" value="upgrade"/>
1907 - <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
1908 - </form>
1909 -</div>
1910 -<?php elseif ( $akismet_user->status == 'suspended' ) : ?>
1911 -<p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
1912 -<div class="activate-highlight centered activate-option">
1913 - <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
1914 - <h3 class="alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ) ); ?></h3>
1915 - <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll sort this out.', 'akismet'); ?></p>
1916 - <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
1917 -</div>
1918 -<?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
1919 -<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>
1920 -<div class="activate-highlight activate-option">
1921 - <div class="option-description">
1922 - <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
1923 - <?php echo esc_html( $akismet_user->user_email ); ?>
1924 - </div>
1925 - <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
1926 - <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
1927 - <input type="hidden" name="action" value="enter-key">
1928 - <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
1929 - <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this account' , 'akismet'); ?>"/>
1930 - </form>
1931 -</div>
1932 -<?php endif;?>
1933 -<div class="activate-highlight secondary activate-option">
1934 - <div class="option-description">
1935 - <strong><?php esc_html_e('Sign up for a plan with a different email address', 'akismet'); ?></strong>
1936 - <p><?php esc_html_e('Use this option to use Akismet independently of your Jetpack connection.', 'akismet'); ?></p>
1937 - </div>
1938 - <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
1939 -</div>
1940 -<div class="activate-highlight secondary activate-option">
1941 - <div class="option-description">
1942 - <strong><?php esc_html_e('Enter an API key', 'akismet'); ?></strong>
1943 - <p><?php esc_html_e('Already have your key? Enter it here.', 'akismet'); ?></p>
1944 - </div>
1945 - <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
1946 - <input id="key" name="key" type="text" size="15" value="" class="regular-text code">
1947 - <input type="hidden" name="action" value="enter-key">
1948 - <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
1949 - <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
1950 - </form>
1951 -</div>
1952 -<?php else :?>
1953 -<p><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
1954 -<div class="activate-highlight activate-option">
1955 - <div class="option-description">
1956 - <strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
1957 - <p><?php esc_html_e('Log in or sign up now.', 'akismet'); ?></p>
1958 - </div>
1959 - <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
1960 -</div>
1961 -<div class="activate-highlight secondary activate-option">
1962 - <div class="option-description">
1963 - <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
1964 - <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
1965 - </div>
1966 - <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
1967 - <input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( Akismet::get_api_key() ); ?>" class="regular-text code">
1968 - <input type="hidden" name="action" value="enter-key">
1969 - <?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
1970 - <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
1971 - </form>
1972 -</div><?php
1973 - endif;?>
1974 </div>
1975 \ No newline at end of file
1976
1977 diff --git a/plugins/akismet/views/stats.php b/plugins/akismet/views/stats.php
1978 index a536f3a..2302c11 100644
1979 --- a/plugins/akismet/views/stats.php
1980 +++ b/plugins/akismet/views/stats.php
1981 @@ -1,4 +1,11 @@
1982 -<div class="wrap">
1983 - <h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
1984 - <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
1985 +<div id="akismet-plugin-container">
1986 + <div class="akismet-masthead">
1987 + <div class="akismet-masthead__inside-container">
1988 + <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="akismet-right"><?php esc_html_e( 'Akismet Settings' , 'akismet' ); ?></a>
1989 + <div class="akismet-masthead__logo-container">
1990 + <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
1991 + </div>
1992 + </div>
1993 + </div>
1994 + <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
1995 </div>
1996 \ No newline at end of file
1997
1998 diff --git a/plugins/akismet/views/strict.php b/plugins/akismet/views/strict.php
1999 deleted file mode 100644
2000 index 83d7a50..0000000
2001 --- a/plugins/akismet/views/strict.php
2002 +++ /dev/null
2003 @@ -1,17 +0,0 @@
2004 -<fieldset>
2005 - <legend class="screen-reader-text">
2006 - <span><?php esc_html_e( 'Akismet anti-spam strictness', 'akismet' ); ?></span>
2007 - </legend>
2008 - <p>
2009 - <label for="akismet_strictness_1">
2010 - <input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
2011 - <?php esc_html_e( 'Strict: silently discard the worst and most pervasive spam.', 'akismet' ); ?>
2012 - </label>
2013 - </p>
2014 - <p>
2015 - <label for="akismet_strictness_0">
2016 - <input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
2017 - <?php esc_html_e( 'Safe: always put spam in the Spam folder for review.', 'akismet' ); ?>
2018 - </label>
2019 - </p>
2020 -</fieldset>
2021
2022 diff --git a/plugins/akismet/wrapper.php b/plugins/akismet/wrapper.php
2023 index a77d4ce..f687e09 100644
2024 --- a/plugins/akismet/wrapper.php
2025 +++ b/plugins/akismet/wrapper.php
2026 @@ -175,7 +175,7 @@ function akismet_get_ip_address() {
2027 function akismet_cron_recheck() {
2028 return Akismet::cron_recheck();
2029 }
2030 -function akismet_add_comment_nonce() {
2031 +function akismet_add_comment_nonce( $post_id ) {
2032 return Akismet::add_comment_nonce( $post_id );
2033 }
2034 function akismet_fix_scheduled_recheck() {