Akismet Anti-Spam - Version 3.3

Version Description

Release Date - 23 February 2017

  • Updated the Akismet admin pages with a new clean design.
  • Fixed bugs preventing the akismet_add_comment_nonce and akismet_update_alert wrapper functions from working properly.
  • Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
  • Added a progress indicator to the "Check for Spam" button.
  • Added a success message after manually rechecking the Pending queue for spam.
Download this release

Release Info

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

Code changes from version 3.2 to 3.3

_inc/akismet.css CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
 
2
  #submitted-on {
3
  position: relative;
@@ -73,136 +76,37 @@ table.comments td.comment p a:after {
73
  height: 338px;
74
  width: 450px;
75
  }
76
- h2.ak-header {
77
- padding: 30px;
78
- background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
79
- background-size: 185px 33px;
80
- height: 33px;
81
- text-indent: -9999em;
82
- margin-right: 10px;
83
- }
84
  .checkforspam {
85
  display: inline-block !important;
86
  }
87
- .checkforspam-spinner {
88
- display: inline-block;
89
- margin-top: 7px;
90
- }
91
-
92
- .config-wrap {
93
- margin-top: 2em;
94
- max-width: 700px;
95
- }
96
-
97
- .activate-option {
98
- background: #e3e3e3;
99
- border-radius: 3px;
100
- margin-bottom: 30px;
101
- overflow: hidden;
102
- padding: 20px;
103
- }
104
- .activate-option.clicked {
105
- background: #649316;
106
- color: #fff;
107
- }
108
- .activate-option.clicked:hover {
109
- background: #68802E;
110
- color: #fff;
111
- }
112
-
113
- .activate-option .button.button-secondary {
114
- margin: 15px 0;
115
- }
116
-
117
- .activate-option p {
118
- margin: 10px 0 10px;
119
- }
120
-
121
- .activate-highlight {
122
- background: #fff;
123
- padding: 30px;
124
- margin-right: 10px;
125
  }
126
-
127
- .activate-highlight.secondary {
128
- background: #ddd;
129
- padding: 20px 30px;
130
  }
131
 
132
- .activate-highlight h3 {
133
- margin: 0 0 0.3em;
134
- }
135
- .activate-highlight p {
136
- color: #777;
137
- }
138
- .activate-highlight .button-primary {
139
- margin-top: 15px;
140
  }
141
 
142
- #akismet-enter-api-key .regular-text {
143
- width: 18em;
144
- margin-top: 15px;
145
  }
146
 
147
- .right {
148
- float: right;
149
  }
150
 
151
- .alert-text {
152
  color: #dd3d36;
 
 
 
153
  }
154
- .success {
155
- color: #649316;
156
- }
157
- .option-description {
158
- float: left;
159
- font-size: 16px;
160
- }
161
- .option-description span {
162
- color: #666;
163
- display: block;
164
- font-size: 14px;
165
- margin-top: 5px;
166
- }
167
- .option-action {
168
- float: right;
169
- }
170
- .key-config-link {
171
- font-size: 14px;
172
- margin-left: 20px;
173
- }
174
- .jetpack-account {
175
- float: left;
176
- font-size: 18px;
177
- margin-right: 40px;
178
- }
179
- .small-heading {
180
- color: #777;
181
- display: block;
182
- font-size: 12px;
183
- font-weight: bold;
184
- margin-bottom: 5px;
185
- text-transform: uppercase;
186
- }
187
- .inline-label {
188
- background: #ddd;
189
- border-radius: 3px;
190
- font-size: 11px;
191
- padding: 3px 8px;
192
- text-transform: uppercase;
193
- }
194
- .inline-label.alert {
195
- background: #e54747;
196
- color: #fff;
197
- }
198
- .jetpack-account .inline-label {
199
- margin-left: 5px;
200
- }
201
- .option-action .manual-key {
202
- margin-top: 7px;
203
- }
204
-
205
- .alert {
206
  border: 1px solid #e5e5e5;
207
  padding: 0.4em 1em 1.4em 1em;
208
  border-radius: 3px;
@@ -211,49 +115,45 @@ h2.ak-header {
211
  border-style: solid;
212
  }
213
 
214
- .alert h3.key-status {
215
  color: #fff;
216
  margin: 1em 0 0.5em 0;
217
  }
218
 
219
- .alert.critical {
220
  background-color: #993300;
221
  }
222
 
223
- .alert.active {
224
  background-color: #649316;
225
  }
226
 
227
- .alert p.key-status {
228
  font-size: 24px;
229
  }
230
 
231
- .alert p.description {
232
  color:#fff;
233
  font-size: 14px;
234
  margin: 0 0;
235
  font-style: normal;
236
  }
237
 
238
- .alert p.description a,
239
- .alert p.description a,
240
- .alert p.description a,
241
- .alert p.description a {
242
  color: #fff;
243
  }
244
 
245
- .new-snapshot {
246
  margin-top: 1em;
247
  padding: 1em;
248
  text-align: center;
249
- }
250
-
251
- .new-snapshot.stats {
252
  background: #fff;
253
- border: 1px solid #e5e5e5;
254
  }
255
 
256
- .new-snapshot h3 {
257
  background: #f5f5f5;
258
  color: #888;
259
  font-size: 11px;
@@ -266,7 +166,7 @@ h2.ak-header {
266
  width: 100%;
267
  }
268
 
269
- .new-snapshot ul li {
270
  color: #999;
271
  float: left;
272
  font-size: 11px;
@@ -279,16 +179,12 @@ h2.ak-header {
279
  -ms-box-sizing: border-box;
280
  }
281
 
282
- .new-snapshot.stats ul li:first-child,
283
- .new-snapshot.stats ul li:nth-child(2) {
284
  border-right:1px dotted #ccc;
285
  }
286
 
287
- .new-snapshot.account ul li:nth-child(2) {
288
- border-right: none;
289
- }
290
-
291
- .new-snapshot ul li span {
292
  color: #52accc;
293
  display: block;
294
  font-size: 32px;
@@ -296,60 +192,6 @@ h2.ak-header {
296
  line-height: 1.5em;
297
  }
298
 
299
- .new-snapshot.stats {
300
- }
301
-
302
- .new-snapshot.account,
303
- .new-snapshot.settings {
304
- float: left;
305
- padding: 0;
306
- text-align: left;
307
- width: 50%;
308
- box-sizing: border-box;
309
- -moz-box-sizing: border-box;
310
- -webkit-box-sizing: border-box;
311
- -ms-box-sizing: border-box;
312
- }
313
-
314
- .account-container {
315
- background: #fff;
316
- border: 1px solid #e5e5e5;
317
- margin-right: 0.5em;
318
- }
319
-
320
- .settings-container {
321
- background: #fff;
322
- border: 1px solid #e5e5e5;
323
- margin-left: 0.5em;
324
- }
325
-
326
- .new-snapshot.account ul li {
327
- width:100%
328
- }
329
-
330
- .new-snapshot.account ul li span {
331
- font-size: 14px;
332
- font-weight: normal;
333
- }
334
-
335
-
336
- .new-snapshot.settings ul li {
337
- border: none;
338
- display: block;
339
- width:100%
340
- }
341
-
342
- .new-snapshot.settings ul li span {
343
- display: block;
344
- font-size: 14px;
345
- font-weight: normal;
346
- }
347
-
348
- .new-snapshot.settings p.submit {
349
- margin: 0;
350
- text-align: center;
351
- }
352
-
353
  .akismet-settings th:first-child {
354
  vertical-align: top;
355
  padding-top: 15px;
@@ -364,17 +206,13 @@ h2.ak-header {
364
  width: 75%;
365
  }
366
 
367
- .akismet-settings span.note{
368
  float: left;
369
  padding-left: 23px;
370
  font-size: 75%;
371
  margin-top: -10px;
372
  }
373
 
374
- .clearfix {
375
- clear:both;
376
- }
377
-
378
  /**
379
  * For the activation notice on the plugins page.
380
  */
@@ -471,4 +309,278 @@ h2.ak-header {
471
  .akismet_activate .aa_description strong {
472
  color: #FFF;
473
  font-weight: normal;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
  }
1
+ .wp-admin.jetpack_page_akismet-key-config, .wp-admin.settings_page_akismet-key-config {
2
+ background-color:#f3f6f8;
3
+ }
4
 
5
  #submitted-on {
6
  position: relative;
76
  height: 338px;
77
  width: 450px;
78
  }
 
 
 
 
 
 
 
 
79
  .checkforspam {
80
  display: inline-block !important;
81
  }
82
+ .checkforspam-progress {
83
+ padding-left: 1ex;
84
+ display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
+ .checkforspam.button-disabled .checkforspam-progress {
87
+ display: inline;
 
 
88
  }
89
 
90
+ .checkforspam-spinner {
91
+ display: inline-block;
92
+ margin-top: 7px;
 
 
 
 
 
93
  }
94
 
95
+ .akismet-right {
96
+ float: right;
 
97
  }
98
 
99
+ .akismet-card .akismet-right {
100
+ margin: 1em 0;
101
  }
102
 
103
+ .akismet-alert-text {
104
  color: #dd3d36;
105
+ font-weight: bold;
106
+ font-size: 120%;
107
+ margin-top: .5rem;
108
  }
109
+ .akismet-alert {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  border: 1px solid #e5e5e5;
111
  padding: 0.4em 1em 1.4em 1em;
112
  border-radius: 3px;
115
  border-style: solid;
116
  }
117
 
118
+ .akismet-alert h3.akismet-key-status {
119
  color: #fff;
120
  margin: 1em 0 0.5em 0;
121
  }
122
 
123
+ .akismet-alert.akismet-critical {
124
  background-color: #993300;
125
  }
126
 
127
+ .akismet-alert.akismet-active {
128
  background-color: #649316;
129
  }
130
 
131
+ .akismet-alert p.akismet-key-status {
132
  font-size: 24px;
133
  }
134
 
135
+ .akismet-alert p.akismet-description {
136
  color:#fff;
137
  font-size: 14px;
138
  margin: 0 0;
139
  font-style: normal;
140
  }
141
 
142
+ .akismet-alert p.akismet-description a,
143
+ .akismet-alert p.akismet-description a,
144
+ .akismet-alert p.akismet-description a,
145
+ .akismet-alert p.akismet-description a {
146
  color: #fff;
147
  }
148
 
149
+ .akismet-new-snapshot {
150
  margin-top: 1em;
151
  padding: 1em;
152
  text-align: center;
 
 
 
153
  background: #fff;
 
154
  }
155
 
156
+ .akismet-new-snapshot h3 {
157
  background: #f5f5f5;
158
  color: #888;
159
  font-size: 11px;
166
  width: 100%;
167
  }
168
 
169
+ .akismet-new-snapshot ul li {
170
  color: #999;
171
  float: left;
172
  font-size: 11px;
179
  -ms-box-sizing: border-box;
180
  }
181
 
182
+ .akismet-new-snapshot ul li:first-child,
183
+ .akismet-new-snapshot ul li:nth-child(2) {
184
  border-right:1px dotted #ccc;
185
  }
186
 
187
+ .akismet-new-snapshot ul li span {
 
 
 
 
188
  color: #52accc;
189
  display: block;
190
  font-size: 32px;
192
  line-height: 1.5em;
193
  }
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  .akismet-settings th:first-child {
196
  vertical-align: top;
197
  padding-top: 15px;
206
  width: 75%;
207
  }
208
 
209
+ .akismet-settings span.akismet-note{
210
  float: left;
211
  padding-left: 23px;
212
  font-size: 75%;
213
  margin-top: -10px;
214
  }
215
 
 
 
 
 
216
  /**
217
  * For the activation notice on the plugins page.
218
  */
309
  .akismet_activate .aa_description strong {
310
  color: #FFF;
311
  font-weight: normal;
312
+ }
313
+
314
+ .jetpack_page_akismet-key-config #wpcontent, .settings_page_akismet-key-config #wpcontent {
315
+ padding-left: 0;
316
+ }
317
+
318
+ .akismet-masthead {
319
+ background-color:#fff;
320
+ text-align:center;
321
+ box-shadow:0 1px 0 rgba(200,215,225,0.5),0 1px 2px #e9eff3
322
+ }
323
+ @media (max-width: 45rem) {
324
+ .akismet-masthead {
325
+ padding:0 1.25rem
326
+ }
327
+ }
328
+
329
+ .akismet-masthead__inside-container {
330
+ padding:.375rem 0;
331
+ margin:0 auto;
332
+ width:100%;
333
+ max-width:45rem;
334
+ text-align: left;
335
+ }
336
+ .akismet-masthead__logo-container {
337
+ padding:.3125rem 0 0
338
+ }
339
+ .akismet-masthead__logo {
340
+ width:10.375rem;
341
+ height:1.8125rem;
342
+ }
343
+ .akismet-masthead__logo-link {
344
+ display:inline-block;
345
+ outline:none;
346
+ vertical-align:middle
347
+ }
348
+ .akismet-masthead__logo-link:focus {
349
+ line-height:0;
350
+ box-shadow:0 0 0 2px #78dcfa
351
+ }
352
+ .akismet-masthead__logo-link+code {
353
+ margin:0 10px;
354
+ padding:5px 9px;
355
+ border-radius:2px;
356
+ background:#e6ecf1;
357
+ color:#647a88
358
+ }
359
+ .akismet-masthead__links {
360
+ display:-ms-flexbox;
361
+ display:flex;
362
+ -ms-flex-flow:row wrap;
363
+ flex-flow:row wrap;
364
+ -ms-flex:2 50%;
365
+ flex:2 50%;
366
+ -ms-flex-pack:end;
367
+ justify-content:flex-end;
368
+ margin:0
369
+ }
370
+ @media (max-width: 480px) {
371
+ .akismet-masthead__links {
372
+ padding-right:.625rem
373
+ }
374
+ }
375
+ .akismet-masthead__link-li {
376
+ margin:0;
377
+ padding:0
378
+ }
379
+ .akismet-masthead__link {
380
+ font-style:normal;
381
+ color:#0087be;
382
+ padding:.625rem;
383
+ display:inline-block
384
+ }
385
+ .akismet-masthead__link:visited {
386
+ color:#0087be
387
+ }
388
+ .akismet-masthead__link:active,.akismet-masthead__link:hover {
389
+ color:#00aadc
390
+ }
391
+ .akismet-masthead__link:hover {
392
+ text-decoration:underline
393
+ }
394
+ .akismet-masthead__link .dashicons {
395
+ display:none
396
+ }
397
+ @media (max-width: 480px) {
398
+ .akismet-masthead__link:hover,.akismet-masthead__link:active {
399
+ text-decoration:none
400
+ }
401
+ .akismet-masthead__link .dashicons {
402
+ display:block;
403
+ font-size:1.75rem
404
+ }
405
+ .akismet-masthead__link span+span {
406
+ display:none
407
+ }
408
+ }
409
+ .akismet-masthead__link-li:last-of-type .akismet-masthead__link {
410
+ padding-right:0
411
+ }
412
+
413
+ .akismet-lower {
414
+ margin: 0 auto;
415
+ text-align: left;
416
+ max-width: 45rem;
417
+ padding: 1.5rem;
418
+ }
419
+
420
+ .akismet-card {
421
+ margin-top: 1rem;
422
+ margin-bottom: 0;
423
+ position: relative;
424
+ margin: 0 auto 0.625rem auto;
425
+ box-sizing: border-box;
426
+ background: white;
427
+ box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
428
+ }
429
+
430
+ .akismet-card:after, .akismet-card .inside:after, .akismet-masthead__logo-container:after {
431
+ content: ".";
432
+ display: block;
433
+ height: 0;
434
+ clear: both;
435
+ visibility: hidden;
436
+ }
437
+
438
+ .akismet-card .inside {
439
+ padding: 1.5rem;
440
+ padding-top: 1rem;
441
+ }
442
+
443
+ .akismet-card .akismet-card-actions {
444
+ margin-top: 1rem;
445
+ }
446
+
447
+ .jetpack_page_akismet-key-config .update-nag, .settings_page_akismet-key-config .update-nag {
448
+ display: none;
449
+ }
450
+
451
+ .akismet-masthead .akismet-right {
452
+ line-height: 2.125rem;
453
+ font-size: 0.9rem;
454
+ }
455
+
456
+ .akismet-box {
457
+ box-sizing: border-box;
458
+ background: white;
459
+ border: 1px solid rgba(200, 215, 225, 0.5);
460
+ }
461
+
462
+ .akismet-box h2, .akismet-box h3 {
463
+ padding: 1.5rem 1.5rem .5rem 1.5rem;
464
+ margin: 0;
465
+ }
466
+
467
+ .akismet-box p {
468
+ padding: 0 1.5rem 1.5rem 1.5rem;
469
+ margin: 0;
470
+ }
471
+
472
+ .akismet-jetpack-email {
473
+ font-style: oblique;
474
+ }
475
+
476
+ .akismet-jetpack-gravatar {
477
+ padding: 0 0 0 1.5rem;
478
+ float: left;
479
+ margin-right: 1rem;
480
+ width: 54px;
481
+ height: 54px;
482
+ }
483
+
484
+ .akismet-box p:after {
485
+ content: ".";
486
+ display: block;
487
+ height: 0;
488
+ clear: both;
489
+ visibility: hidden;
490
+ }
491
+
492
+ .akismet-box .akismet-right {
493
+ padding-right: 1.5rem;
494
+ }
495
+
496
+ .akismet-boxes .akismet-box {
497
+ margin-bottom: 0;
498
+ padding: 0;
499
+ margin-top: -1px;
500
+ }
501
+
502
+ .akismet-boxes .akismet-box:last-child {
503
+ margin-bottom: 1.5rem;
504
+ }
505
+
506
+ .akismet-boxes .akismet-box:first-child {
507
+ margin-top: 1.5rem;
508
+ }
509
+
510
+ .akismet-button, .akismet-button:hover, .akismet-button:visited {
511
+ background: white;
512
+ border-color: #c8d7e1;
513
+ border-style: solid;
514
+ border-width: 1px 1px 2px;
515
+ color: #2e4453;
516
+ cursor: pointer;
517
+ display: inline-block;
518
+ margin: 0;
519
+ outline: 0;
520
+ overflow: hidden;
521
+ font-size: 14px;
522
+ font-weight: 500;
523
+ text-overflow: ellipsis;
524
+ text-decoration: none;
525
+ vertical-align: top;
526
+ box-sizing: border-box;
527
+ font-size: 14px;
528
+ line-height: 21px;
529
+ border-radius: 4px;
530
+ padding: 7px 14px 9px;
531
+ -webkit-appearance: none;
532
+ -moz-appearance: none;
533
+ appearance: none;
534
+ }
535
+
536
+ .akismet-button:hover {
537
+ border-color: #a8bece;
538
+ }
539
+
540
+ .akismet-button:active {
541
+ border-width: 2px 1px 1px;
542
+ }
543
+
544
+ .akismet-is-primary, .akismet-is-primary:hover, .akismet-is-primary:visited {
545
+ background: #00aadc;
546
+ border-color: #0087be;
547
+ color: white;
548
+ }
549
+
550
+ .akismet-is-primary:hover, .akismet-is-primary:focus {
551
+ border-color: #005082;
552
+ }
553
+
554
+ .akismet-is-primary:hover {
555
+ border-color: #005082;
556
+ }
557
+
558
+ .akismet-section-header {
559
+ position: relative;
560
+ margin: 0 auto 0.625rem auto;
561
+ padding: 1rem;
562
+ box-sizing: border-box;
563
+ box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
564
+ background: #ffffff;
565
+ width: 100%;
566
+ padding-top: 0.6875rem;
567
+ padding-bottom: 0.6875rem;
568
+ display: flex;
569
+ }
570
+
571
+ .akismet-section-header__label {
572
+ display: -ms-flexbox;
573
+ display: flex;
574
+ -ms-flex-align: center;
575
+ align-items: center;
576
+ -ms-flex-positive: 1;
577
+ flex-grow: 1;
578
+ line-height: 1.75rem;
579
+ position: relative;
580
+ font-size: 0.875rem;
581
+ color: #4f748e;
582
+ }
583
+
584
+ .akismet-section-header__actions {
585
+ line-height: 1.75rem;
586
  }
_inc/akismet.js CHANGED
@@ -3,17 +3,6 @@ jQuery( function ( $ ) {
3
  var mshotSecondTryTimer = null
4
  var mshotThirdTryTimer = null
5
 
6
- $( 'a.activate-option' ).click( function(){
7
- var link = $( this );
8
- if ( link.hasClass( 'clicked' ) ) {
9
- link.removeClass( 'clicked' );
10
- }
11
- else {
12
- link.addClass( 'clicked' );
13
- }
14
- $( '.toggle-have-key' ).slideToggle( 'slow', function() {});
15
- return false;
16
- });
17
  $('.akismet-status').each(function () {
18
  var thisId = $(this).attr('commentid');
19
  $(this).prependTo('#comment-' + thisId + ' .column-comment');
@@ -162,13 +151,24 @@ jQuery( function ( $ ) {
162
  } );
163
 
164
  $('.checkforspam:not(.button-disabled)').click( function(e) {
 
 
165
  $('.checkforspam:not(.button-disabled)').addClass('button-disabled');
166
- $('.checkforspam-spinner').addClass( 'spinner' );
 
 
 
 
167
  akismet_check_for_spam(0, 100);
168
- e.preventDefault();
169
  });
170
 
 
 
 
171
  function akismet_check_for_spam(offset, limit) {
 
 
 
172
  $.post(
173
  ajaxurl,
174
  {
@@ -177,8 +177,11 @@ jQuery( function ( $ ) {
177
  'limit': limit
178
  },
179
  function(result) {
 
 
 
180
  if (result.counts.processed < limit) {
181
- window.location.reload();
182
  }
183
  else {
184
  // Account for comments that were caught as spam and moved out of the queue.
@@ -187,6 +190,10 @@ jQuery( function ( $ ) {
187
  }
188
  );
189
  }
 
 
 
 
190
  });
191
  // URL encode plugin
192
  jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
3
  var mshotSecondTryTimer = null
4
  var mshotThirdTryTimer = null
5
 
 
 
 
 
 
 
 
 
 
 
 
6
  $('.akismet-status').each(function () {
7
  var thisId = $(this).attr('commentid');
8
  $(this).prependTo('#comment-' + thisId + ' .column-comment');
151
  } );
152
 
153
  $('.checkforspam:not(.button-disabled)').click( function(e) {
154
+ e.preventDefault();
155
+
156
  $('.checkforspam:not(.button-disabled)').addClass('button-disabled');
157
+ $('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
158
+
159
+ // Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
160
+ $( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
161
+
162
  akismet_check_for_spam(0, 100);
 
163
  });
164
 
165
+ var spam_count = 0;
166
+ var recheck_count = 0;
167
+
168
  function akismet_check_for_spam(offset, limit) {
169
+ // Update the progress counter on the "Check for Spam" button.
170
+ $( '.checkforspam-progress' ).text( $( '.checkforspam' ).data( 'progress-label-format' ).replace( '%1$s', offset ) );
171
+
172
  $.post(
173
  ajaxurl,
174
  {
177
  'limit': limit
178
  },
179
  function(result) {
180
+ recheck_count += result.counts.processed;
181
+ spam_count += result.counts.spam;
182
+
183
  if (result.counts.processed < limit) {
184
+ window.location.href = $( '.checkforspam' ).data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
185
  }
186
  else {
187
  // Account for comments that were caught as spam and moved out of the queue.
190
  }
191
  );
192
  }
193
+
194
+ if ( "start_recheck" in WPAkismet && WPAkismet.start_recheck ) {
195
+ $( '.checkforspam' ).click();
196
+ }
197
  });
198
  // URL encode plugin
199
  jQuery.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
_inc/img/logo-full-2x.png CHANGED
Binary file
akismet.php CHANGED
@@ -3,10 +3,10 @@
3
  * @package Akismet
4
  */
5
  /*
6
- Plugin Name: Akismet
7
  Plugin URI: https://akismet.com/
8
- Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: 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.
9
- Version: 3.2
10
  Author: Automattic
11
  Author URI: https://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
@@ -37,7 +37,7 @@ if ( !function_exists( 'add_action' ) ) {
37
  exit;
38
  }
39
 
40
- define( 'AKISMET_VERSION', '3.2' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
42
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
43
  define( 'AKISMET_DELETE_LIMIT', 100000 );
3
  * @package Akismet
4
  */
5
  /*
6
+ Plugin Name: Akismet Anti-Spam
7
  Plugin URI: https://akismet.com/
8
+ Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
9
+ Version: 3.3
10
  Author: Automattic
11
  Author URI: https://automattic.com/wordpress-plugins/
12
  License: GPLv2 or later
37
  exit;
38
  }
39
 
40
+ define( 'AKISMET_VERSION', '3.3' );
41
  define( 'AKISMET__MINIMUM_WP_VERSION', '3.7' );
42
  define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
43
  define( 'AKISMET_DELETE_LIMIT', 100000 );
class.akismet-admin.php CHANGED
@@ -63,6 +63,8 @@ class Akismet_Admin {
63
  add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
64
 
65
  add_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 );
 
 
66
  }
67
 
68
  public static function admin_init() {
@@ -102,7 +104,7 @@ class Akismet_Admin {
102
  public static function load_resources() {
103
  global $hook_suffix;
104
 
105
- if ( in_array( $hook_suffix, array(
106
  'index.php', # dashboard
107
  'edit-comments.php',
108
  'comment.php',
@@ -110,13 +112,14 @@ class Akismet_Admin {
110
  'settings_page_akismet-key-config',
111
  'jetpack_page_akismet-key-config',
112
  'plugins.php',
113
- ) ) ) {
114
  wp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION );
115
  wp_enqueue_style( 'akismet.css');
116
 
117
- wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery','postbox'), AKISMET_VERSION );
118
  wp_enqueue_script( 'akismet.js' );
119
- wp_localize_script( 'akismet.js', 'WPAkismet', array(
 
120
  'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ),
121
  'strings' => array(
122
  'Remove this URL' => __( 'Remove this URL' , 'akismet'),
@@ -125,7 +128,13 @@ class Akismet_Admin {
125
  '(undo)' => __( '(undo)' , 'akismet'),
126
  'Re-adding...' => __( 'Re-adding...' , 'akismet'),
127
  )
128
- ) );
 
 
 
 
 
 
129
  }
130
  }
131
 
@@ -349,7 +358,20 @@ class Akismet_Admin {
349
  else
350
  $link = add_query_arg( array( 'page' => 'akismet-admin', 'recheckqueue' => 'true', 'noheader' => 'true' ), admin_url( 'edit-comments.php' ) );
351
 
352
- 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>';
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  }
354
 
355
  public static function recheck_queue() {
@@ -487,7 +509,14 @@ class Akismet_Admin {
487
  if ( $desc )
488
  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>';
489
 
490
- $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') );
 
 
 
 
 
 
 
491
  $show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true'
492
 
493
  if ( $show_user_comments ) {
@@ -793,10 +822,6 @@ class Akismet_Admin {
793
  }
794
  }
795
 
796
- public static function display_invalid_version() {
797
- Akismet::view( 'notice', array( 'type' => 'version' ) );
798
- }
799
-
800
  public static function display_api_key_warning() {
801
  Akismet::view( 'notice', array( 'type' => 'plugin' ) );
802
  }
@@ -838,18 +863,26 @@ class Akismet_Admin {
838
  if ( $_GET['action'] == 'save-key' ) {
839
  if ( is_object( $akismet_user ) ) {
840
  self::save_key( $akismet_user->api_key );
841
- self::display_notice();
842
  self::display_configuration_page();
843
- return;
844
  }
845
  }
846
  }
847
 
848
- echo '<h2 class="ak-header">'.esc_html__('Akismet', 'akismet').'</h2>';
849
-
850
- self::display_status();
851
 
 
 
 
852
  Akismet::view( 'start', compact( 'akismet_user' ) );
 
 
 
 
 
 
 
 
853
  }
854
 
855
  public static function display_stats_page() {
@@ -869,12 +902,15 @@ class Akismet_Admin {
869
 
870
  $stat_totals = self::get_stats( $api_key );
871
 
872
- // If unset, create the new strictness option using the old discard option to determine its default
873
- if ( get_option( 'akismet_strictness' ) === false )
874
- add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
 
 
 
 
875
 
876
  if ( empty( self::$notices ) ) {
877
- //show status
878
  if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
879
 
880
  $time_saved = false;
@@ -892,26 +928,53 @@ class Akismet_Admin {
892
  elseif ( $total_in_minutes >= 30 )
893
  $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 );
894
  }
895
-
896
- Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) );
897
  }
898
 
899
  if ( !empty( $akismet_user->limit_reached ) && in_array( $akismet_user->limit_reached, array( 'yellow', 'red' ) ) ) {
900
- Akismet::view( 'notice', array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached ) );
901
  }
902
  }
903
 
904
- if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) )
905
- Akismet::view( 'notice', array( 'type' => $akismet_user->status ) );
 
906
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
907
  Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
908
- Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals' ) );
909
  }
910
 
911
  public static function display_notice() {
912
  global $hook_suffix;
913
 
914
- 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 ) {
 
 
 
 
 
915
  Akismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state
916
 
917
  if ( get_option( 'akismet_alert_code' ) > 0 )
@@ -923,38 +986,59 @@ class Akismet_Admin {
923
  elseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
924
  self::display_spam_check_warning();
925
  }
926
- elseif ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) && Akismet::get_api_key() ) {
927
- self::display_status();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
928
  }
929
  }
930
 
931
  public static function display_status() {
932
- $type = '';
933
-
934
- if ( !self::get_server_connectivity() )
935
- $type = 'servers-be-down';
936
-
937
- if ( !empty( $type ) )
938
- Akismet::view( 'notice', compact( 'type' ) );
939
- elseif ( !empty( self::$notices ) ) {
940
- foreach ( self::$notices as $type ) {
941
  if ( is_object( $type ) ) {
942
  $notice_header = $notice_text = '';
943
 
944
- if ( property_exists( $type, 'notice_header' ) )
945
  $notice_header = wp_kses( $type->notice_header, self::$allowed );
 
946
 
947
- if ( property_exists( $type, 'notice_text' ) )
948
  $notice_text = wp_kses( $type->notice_text, self::$allowed );
 
949
 
950
  if ( property_exists( $type, 'status' ) ) {
951
  $type = wp_kses( $type->status, self::$allowed );
952
  Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );
 
 
953
  }
954
  }
955
- else
956
  Akismet::view( 'notice', compact( 'type' ) );
957
- }
 
 
 
958
  }
959
  }
960
 
@@ -997,4 +1081,20 @@ class Akismet_Admin {
997
 
998
  return $exclude;
999
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  }
63
  add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
64
 
65
  add_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 );
66
+
67
+ add_filter( 'all_plugins', array( 'Akismet_Admin', 'modify_plugin_description' ) );
68
  }
69
 
70
  public static function admin_init() {
104
  public static function load_resources() {
105
  global $hook_suffix;
106
 
107
+ if ( in_array( $hook_suffix, apply_filters( 'akismet_admin_page_hook_suffixes', array(
108
  'index.php', # dashboard
109
  'edit-comments.php',
110
  'comment.php',
112
  'settings_page_akismet-key-config',
113
  'jetpack_page_akismet-key-config',
114
  'plugins.php',
115
+ ) ) ) ) {
116
  wp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION );
117
  wp_enqueue_style( 'akismet.css');
118
 
119
+ wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery'), AKISMET_VERSION );
120
  wp_enqueue_script( 'akismet.js' );
121
+
122
+ $inline_js = array(
123
  'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ),
124
  'strings' => array(
125
  'Remove this URL' => __( 'Remove this URL' , 'akismet'),
128
  '(undo)' => __( '(undo)' , 'akismet'),
129
  'Re-adding...' => __( 'Re-adding...' , 'akismet'),
130
  )
131
+ );
132
+
133
+ if ( isset( $_GET['akismet_recheck'] ) && wp_verify_nonce( $_GET['akismet_recheck'], 'akismet_recheck' ) ) {
134
+ $inline_js['start_recheck'] = true;
135
+ }
136
+
137
+ wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js );
138
  }
139
  }
140
 
358
  else
359
  $link = add_query_arg( array( 'page' => 'akismet-admin', 'recheckqueue' => 'true', 'noheader' => 'true' ), admin_url( 'edit-comments.php' ) );
360
 
361
+ echo '</div>';
362
+ echo '<div class="alignleft">';
363
+ echo '<a
364
+ class="button-secondary checkforspam"
365
+ href="' . esc_url( $link ) . '"
366
+ data-active-label="' . esc_attr( __( 'Checking for Spam', 'akismet' ) ) . '"
367
+ data-progress-label-format="' . esc_attr( __( '(%1$s...)', 'akismet' ) ) . '"
368
+ 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__' ) ) ) ) ) . '"
369
+ >';
370
+ echo '<span class="akismet-label">' . esc_html__('Check for Spam', 'akismet') . '</span>';
371
+ echo '<span class="checkforspam-progress"></span>';
372
+ echo '</a>';
373
+ echo '<span class="checkforspam-spinner"></span>';
374
+
375
  }
376
 
377
  public static function recheck_queue() {
509
  if ( $desc )
510
  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>';
511
 
512
+ $show_user_comments_option = get_option( 'akismet_show_user_comments_approved' );
513
+
514
+ if ( $show_user_comments_option === false ) {
515
+ // Default to active if the user hasn't made a decision.
516
+ $show_user_comments_option = '1';
517
+ }
518
+
519
+ $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', $show_user_comments_option );
520
  $show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true'
521
 
522
  if ( $show_user_comments ) {
822
  }
823
  }
824
 
 
 
 
 
825
  public static function display_api_key_warning() {
826
  Akismet::view( 'notice', array( 'type' => 'plugin' ) );
827
  }
863
  if ( $_GET['action'] == 'save-key' ) {
864
  if ( is_object( $akismet_user ) ) {
865
  self::save_key( $akismet_user->api_key );
 
866
  self::display_configuration_page();
867
+ return;
868
  }
869
  }
870
  }
871
 
872
+ Akismet::view( 'start', compact( 'akismet_user' ) );
 
 
873
 
874
+ /*
875
+ // To see all variants when testing.
876
+ $akismet_user->status = 'no-sub';
877
  Akismet::view( 'start', compact( 'akismet_user' ) );
878
+ $akismet_user->status = 'cancelled';
879
+ Akismet::view( 'start', compact( 'akismet_user' ) );
880
+ $akismet_user->status = 'suspended';
881
+ Akismet::view( 'start', compact( 'akismet_user' ) );
882
+ $akismet_user->status = 'other';
883
+ Akismet::view( 'start', compact( 'akismet_user' ) );
884
+ $akismet_user = false;
885
+ */
886
  }
887
 
888
  public static function display_stats_page() {
902
 
903
  $stat_totals = self::get_stats( $api_key );
904
 
905
+ // If unset, create the new strictness option using the old discard option to determine its default.
906
+ // If the old option wasn't set, default to discarding the blatant spam.
907
+ if ( get_option( 'akismet_strictness' ) === false ) {
908
+ add_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) );
909
+ }
910
+
911
+ $notices = array();
912
 
913
  if ( empty( self::$notices ) ) {
 
914
  if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
915
 
916
  $time_saved = false;
928
  elseif ( $total_in_minutes >= 30 )
929
  $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 );
930
  }
931
+
932
+ $notices[] = array( 'type' => 'active-notice', 'time_saved' => $time_saved );
933
  }
934
 
935
  if ( !empty( $akismet_user->limit_reached ) && in_array( $akismet_user->limit_reached, array( 'yellow', 'red' ) ) ) {
936
+ $notices[] = array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached );
937
  }
938
  }
939
 
940
+ if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) {
941
+ $notices[] = array( 'type' => $akismet_user->status );
942
+ }
943
 
944
+ /*
945
+ // To see all variants when testing.
946
+ $notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' );
947
+ $notices[] = array( 'type' => 'plugin' );
948
+ $notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' );
949
+ $notices[] = array( 'type' => 'notice', 'notice_header' => 'This is the notice header.', 'notice_text' => 'This is the notice text.' );
950
+ $notices[] = array( 'type' => 'missing-functions' );
951
+ $notices[] = array( 'type' => 'servers-be-down' );
952
+ $notices[] = array( 'type' => 'active-dunning' );
953
+ $notices[] = array( 'type' => 'cancelled' );
954
+ $notices[] = array( 'type' => 'suspended' );
955
+ $notices[] = array( 'type' => 'missing' );
956
+ $notices[] = array( 'type' => 'no-sub' );
957
+ $notices[] = array( 'type' => 'new-key-valid' );
958
+ $notices[] = array( 'type' => 'new-key-invalid' );
959
+ $notices[] = array( 'type' => 'existing-key-invalid' );
960
+ $notices[] = array( 'type' => 'new-key-failed' );
961
+ $notices[] = array( 'type' => 'limit-reached', 'level' => 'yellow' );
962
+ $notices[] = array( 'type' => 'limit-reached', 'level' => 'red' );
963
+ */
964
+
965
  Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
966
+ Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals', 'notices' ) );
967
  }
968
 
969
  public static function display_notice() {
970
  global $hook_suffix;
971
 
972
+ if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) ) {
973
+ // This page manages the notices and puts them inline where they make sense.
974
+ return;
975
+ }
976
+
977
+ if ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
978
  Akismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state
979
 
980
  if ( get_option( 'akismet_alert_code' ) > 0 )
986
  elseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
987
  self::display_spam_check_warning();
988
  }
989
+ else if ( isset( $_GET['akismet_recheck_complete'] ) ) {
990
+ $recheck_count = (int) $_GET['recheck_count'];
991
+ $spam_count = (int) $_GET['spam_count'];
992
+
993
+ if ( $recheck_count === 0 ) {
994
+ $message = __( 'There were no comments to check. Akismet will only check comments in the Pending queue.', 'akismet' );
995
+ }
996
+ else {
997
+ $message = sprintf( _n( 'Akismet checked %s comment.', 'Akismet checked %s comments.', $recheck_count, 'akismet' ), number_format( $recheck_count ) );
998
+ $message .= ' ';
999
+
1000
+ if ( $spam_count === 0 ) {
1001
+ $message .= __( 'No comments were caught as spam.' );
1002
+ }
1003
+ else {
1004
+ $message .= sprintf( _n( '%s comment was caught as spam.', '%s comments were caught as spam.', $spam_count, 'akismet' ), number_format( $spam_count ) );
1005
+ }
1006
+ }
1007
+
1008
+ echo '<div class="notice notice-success"><p>' . esc_html( $message ) . '</p></div>';
1009
  }
1010
  }
1011
 
1012
  public static function display_status() {
1013
+ if ( ! self::get_server_connectivity() ) {
1014
+ Akismet::view( 'notice', compact( 'servers-be-down' ) );
1015
+ }
1016
+ else if ( ! empty( self::$notices ) ) {
1017
+ foreach ( self::$notices as $index => $type ) {
 
 
 
 
1018
  if ( is_object( $type ) ) {
1019
  $notice_header = $notice_text = '';
1020
 
1021
+ if ( property_exists( $type, 'notice_header' ) ) {
1022
  $notice_header = wp_kses( $type->notice_header, self::$allowed );
1023
+ }
1024
 
1025
+ if ( property_exists( $type, 'notice_text' ) ) {
1026
  $notice_text = wp_kses( $type->notice_text, self::$allowed );
1027
+ }
1028
 
1029
  if ( property_exists( $type, 'status' ) ) {
1030
  $type = wp_kses( $type->status, self::$allowed );
1031
  Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );
1032
+
1033
+ unset( self::$notices[ $index ] );
1034
  }
1035
  }
1036
+ else {
1037
  Akismet::view( 'notice', compact( 'type' ) );
1038
+
1039
+ unset( self::$notices[ $index ] );
1040
+ }
1041
+ }
1042
  }
1043
  }
1044
 
1081
 
1082
  return $exclude;
1083
  }
1084
+
1085
+ /**
1086
+ * When Akismet is active, remove the "Activate Akismet" step from the plugin description.
1087
+ */
1088
+ public static function modify_plugin_description( $all_plugins ) {
1089
+ if ( isset( $all_plugins['akismet/akismet.php'] ) ) {
1090
+ if ( Akismet::get_api_key() ) {
1091
+ $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' );
1092
+ }
1093
+ else {
1094
+ $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' );
1095
+ }
1096
+ }
1097
+
1098
+ return $all_plugins;
1099
+ }
1100
  }
class.akismet.php CHANGED
@@ -129,8 +129,9 @@ class Akismet {
129
  $comment['blog_charset'] = get_option('blog_charset');
130
  $comment['permalink'] = get_permalink( $comment['comment_post_ID'] );
131
 
132
- if ( !empty( $comment['user_ID'] ) )
133
  $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
 
134
 
135
  /** See filter documentation in init_hooks(). */
136
  $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
@@ -465,8 +466,9 @@ class Akismet {
465
  $c['recheck_reason'] = $recheck_reason;
466
 
467
  $c['user_role'] = '';
468
- if ( isset( $c['user_ID'] ) )
469
- $c['user_role'] = Akismet::get_user_roles($c['user_ID']);
 
470
 
471
  if ( self::is_test_mode() )
472
  $c['is_test'] = 'true';
@@ -596,8 +598,9 @@ class Akismet {
596
  $comment->site_domain = $current_site->domain;
597
 
598
  $comment->user_role = '';
599
- if ( isset( $comment->user_ID ) )
600
  $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
 
601
 
602
  if ( self::is_test_mode() )
603
  $comment->is_test = 'true';
@@ -642,8 +645,9 @@ class Akismet {
642
  if ( is_object($current_site) )
643
  $comment->site_domain = $current_site->domain;
644
 
645
- if ( isset( $comment->user_ID ) )
646
- $comment->user_role = Akismet::get_user_roles($comment->user_ID);
 
647
 
648
  if ( Akismet::is_test_mode() )
649
  $comment->is_test = 'true';
@@ -1038,7 +1042,7 @@ class Akismet {
1038
  }
1039
 
1040
  // given a response from an API call like check_key_status(), update the alert code options if an alert is present.
1041
- private static function update_alert( $response ) {
1042
  $code = $msg = null;
1043
  if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
1044
  $code = $response[0]['x-akismet-alert-code'];
129
  $comment['blog_charset'] = get_option('blog_charset');
130
  $comment['permalink'] = get_permalink( $comment['comment_post_ID'] );
131
 
132
+ if ( ! empty( $comment['user_ID'] ) ) {
133
  $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
134
+ }
135
 
136
  /** See filter documentation in init_hooks(). */
137
  $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
466
  $c['recheck_reason'] = $recheck_reason;
467
 
468
  $c['user_role'] = '';
469
+ if ( ! empty( $c['user_ID'] ) ) {
470
+ $c['user_role'] = Akismet::get_user_roles( $c['user_ID'] );
471
+ }
472
 
473
  if ( self::is_test_mode() )
474
  $c['is_test'] = 'true';
598
  $comment->site_domain = $current_site->domain;
599
 
600
  $comment->user_role = '';
601
+ if ( ! empty( $comment->user_ID ) ) {
602
  $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
603
+ }
604
 
605
  if ( self::is_test_mode() )
606
  $comment->is_test = 'true';
645
  if ( is_object($current_site) )
646
  $comment->site_domain = $current_site->domain;
647
 
648
+ if ( ! empty( $comment->user_ID ) ) {
649
+ $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
650
+ }
651
 
652
  if ( Akismet::is_test_mode() )
653
  $comment->is_test = 'true';
1042
  }
1043
 
1044
  // given a response from an API call like check_key_status(), update the alert code options if an alert is present.
1045
+ public static function update_alert( $response ) {
1046
  $code = $msg = null;
1047
  if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
1048
  $code = $response[0]['x-akismet-alert-code'];
readme.txt CHANGED
@@ -2,15 +2,15 @@
2
  Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
3
  Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
4
  Requires at least: 3.7
5
- Tested up to: 4.7
6
- Stable tag: 3.2
7
  License: GPLv2 or later
8
 
9
- Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
10
 
11
  == Description ==
12
 
13
- 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.
14
 
15
  Major features in Akismet include:
16
 
@@ -30,6 +30,15 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
30
 
31
  == Changelog ==
32
 
 
 
 
 
 
 
 
 
 
33
  = 3.2 =
34
  *Release Date - 6 September 2016*
35
 
2
  Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
3
  Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
4
  Requires at least: 3.7
5
+ Tested up to: 4.7.2
6
+ Stable tag: 3.3
7
  License: GPLv2 or later
8
 
9
+ Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
10
 
11
  == Description ==
12
 
13
+ 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.
14
 
15
  Major features in Akismet include:
16
 
30
 
31
  == Changelog ==
32
 
33
+ = 3.3 =
34
+ *Release Date - 23 February 2017*
35
+
36
+ * Updated the Akismet admin pages with a new clean design.
37
+ * Fixed bugs preventing the `akismet_add_comment_nonce` and `akismet_update_alert` wrapper functions from working properly.
38
+ * Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
39
+ * Added a progress indicator to the "Check for Spam" button.
40
+ * Added a success message after manually rechecking the Pending queue for spam.
41
+
42
  = 3.2 =
43
  *Release Date - 6 September 2016*
44
 
views/config.php CHANGED
@@ -1,216 +1,232 @@
1
- <div class="wrap">
2
-
3
- <h2><?php esc_html_e( 'Akismet' , 'akismet');?></h2>
4
-
5
- <div class="have-key">
6
-
 
 
 
 
 
 
 
 
 
 
 
7
  <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
8
-
9
- <div class="new-snapshot stats">
10
-
11
- <span style="float:right;margin:10px 15px -5px 0px">
12
- <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>" class=""><?php esc_html_e( 'Summaries' , 'akismet');?></a>
13
- </span>
14
-
15
- <iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 215px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=180&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
16
- <ul>
17
- <li>
18
- <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
19
- <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
20
- <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
21
- </li>
22
- <li>
23
- <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
24
- <span><?php echo number_format( $stat_totals['all']->spam );?></span>
25
- <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
26
- </li>
27
- <li>
28
- <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
29
- <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
30
- <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
31
- |
32
- <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
33
- </li>
34
- </ul>
35
- <div class="clearfix"></div>
 
 
 
 
 
 
36
  </div>
37
  <?php endif;?>
38
 
39
  <?php if ( $akismet_user ):?>
 
 
 
 
 
 
40
 
41
- <div id="wpcom-stats-meta-box-container" class="metabox-holder"><?php
42
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
43
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
44
- ?>
45
- <script type="text/javascript">
46
- jQuery(document).ready( function($) {
47
- jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
48
- if(typeof postboxes !== 'undefined')
49
- postboxes.add_postbox_toggles( 'plugins_page_akismet-key-config' );
50
- });
51
- </script>
52
- <div class="postbox-container" style="width: 55%;margin-right: 10px;">
53
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
54
- <div id="referrers" class="postbox ">
55
- <div class="handlediv" title="Click to toggle"><br></div>
56
- <h3 class="hndle"><span><?php esc_html_e( 'Settings' , 'akismet');?></span></h3>
57
- <form name="akismet_conf" id="akismet-conf" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
58
- <div class="inside">
59
- <table cellspacing="0" class="akismet-settings">
60
- <tbody>
61
- <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
62
- <tr>
63
- <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
64
- <td width="5%"/>
65
- <td align="left">
66
- <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>
67
- </td>
68
- </tr>
69
- <?php endif; ?>
70
- <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
71
- <tr>
72
- <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
73
- <td></td>
74
- <td align="left">
75
- <p>
76
- <?php
77
 
78
- if ( ! function_exists( 'wp_http_supports' ) ) {
79
- ?><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
80
- }
81
- else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
82
- ?><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
83
- }
84
- else {
85
- $ssl_disabled = get_option( 'akismet_ssl_disabled' );
86
 
87
- if ( $ssl_disabled ) {
88
- ?><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
89
- }
90
- else {
91
- ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
92
- }
93
- }
94
 
95
- ?>
96
- </p>
97
- </td>
98
- </tr>
99
- <?php } ?>
100
- <tr>
101
- <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
102
- <td></td>
103
- <td align="left">
104
- <p>
105
- <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>
106
- </p>
107
- </td>
108
- </tr>
109
- <tr>
110
- <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
111
- <td></td>
112
- <td align="left">
113
- <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
114
- <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>
115
- <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>
116
- </fieldset>
117
- <span class="note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
118
  <?php
119
 
120
- $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
121
-
122
- printf(
123
- _n(
124
- 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
125
- 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
126
- $delete_interval,
127
- 'akismet'
128
- ),
129
- admin_url( 'edit-comments.php?comment_status=spam' ),
130
- $delete_interval
131
- );
132
 
133
  ?>
134
- </td>
135
- </tr>
136
- </tbody>
137
- </table>
138
- </div>
139
- <div id="major-publishing-actions">
140
- <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
141
- <div id="delete-action">
142
- <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>
143
- </div>
144
- <?php endif; ?>
145
- <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
146
- <div id="publishing-action">
147
- <input type="hidden" name="action" value="enter-key">
148
- <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
149
-
150
- </div>
151
- <div class="clear"></div>
152
- </div>
153
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  </div>
 
 
 
 
 
 
 
 
155
  </div>
156
  </div>
157
- <div class="postbox-container" style="width:44%;">
158
- <div id="normal-sortables" class="meta-box-sortables ui-sortable">
159
- <div id="referrers" class="postbox ">
160
- <div class="handlediv" title="Click to toggle"><br></div>
161
- <h3 class="hndle"><span><?php esc_html_e( 'Account' , 'akismet');?></span></h3>
162
- <div class="inside">
163
- <table cellspacing="0">
164
- <tbody>
165
- <tr>
166
- <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
167
- <td width="5%"/>
168
- <td align="left">
169
- <span><?php echo esc_html( $akismet_user->account_name ); ?></span>
170
- </td>
171
- </tr>
172
- <tr>
173
- <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
174
- <td width="5%"/>
175
- <td align="left">
176
- <span><?php
177
- if ( 'cancelled' == $akismet_user->status ) :
178
- esc_html_e( 'Cancelled', 'akismet' );
179
- elseif ( 'suspended' == $akismet_user->status ) :
180
- esc_html_e( 'Suspended', 'akismet' );
181
- elseif ( 'missing' == $akismet_user->status ) :
182
- esc_html_e( 'Missing', 'akismet' );
183
- elseif ( 'no-sub' == $akismet_user->status ) :
184
- esc_html_e( 'No Subscription Found', 'akismet' );
185
- else :
186
- esc_html_e( 'Active', 'akismet' );
187
- endif; ?></span>
188
- </td>
189
- </tr>
190
- <?php if ( $akismet_user->next_billing_date ) : ?>
191
- <tr>
192
- <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
193
- <td width="5%"/>
194
- <td align="left">
195
- <span><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></span>
196
- </td>
197
- </tr>
198
- <?php endif; ?>
199
- </tbody>
200
- </table>
201
- </div>
202
- <div id="major-publishing-actions">
203
- <div id="publishing-action">
204
- <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
205
- </div>
206
- <div class="clear"></div>
207
- </div>
208
  </div>
 
209
  </div>
210
  </div>
211
  </div>
212
-
213
  <?php endif;?>
214
-
215
  </div>
216
  </div>
1
+ <div id="akismet-plugin-container">
2
+ <div class="akismet-masthead">
3
+ <div class="akismet-masthead__inside-container">
4
+ <div class="akismet-masthead__logo-container">
5
+ <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
6
+ </div>
7
+ </div>
8
+ </div>
9
+ <div class="akismet-lower">
10
+ <?php if ( Akismet::get_api_key() ) { ?>
11
+ <?php Akismet_Admin::display_status(); ?>
12
+ <?php } ?>
13
+ <?php if ( ! empty( $notices ) ) { ?>
14
+ <?php foreach ( $notices as $notice ) { ?>
15
+ <?php Akismet::view( 'notice', $notice ); ?>
16
+ <?php } ?>
17
+ <?php } ?>
18
  <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
19
+ <div class="akismet-card">
20
+ <div class="akismet-section-header">
21
+ <div class="akismet-section-header__label">
22
+ <span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>
23
+ </div>
24
+ <div class="akismet-section-header__actions">
25
+ <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
26
+ <?php esc_html_e( 'Detailed Stats' , 'akismet');?>
27
+ </a>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="akismet-new-snapshot">
32
+ <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>
33
+ <ul>
34
+ <li>
35
+ <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
36
+ <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
37
+ <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
38
+ </li>
39
+ <li>
40
+ <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
41
+ <span><?php echo number_format( $stat_totals['all']->spam );?></span>
42
+ <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
43
+ </li>
44
+ <li>
45
+ <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
46
+ <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
47
+ <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
48
+ |
49
+ <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
50
+ </li>
51
+ </ul>
52
+ </div>
53
  </div>
54
  <?php endif;?>
55
 
56
  <?php if ( $akismet_user ):?>
57
+ <div class="akismet-card">
58
+ <div class="akismet-section-header">
59
+ <div class="akismet-section-header__label">
60
+ <span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>
61
+ </div>
62
+ </div>
63
 
64
+ <div class="inside">
65
+ <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
66
+ <table cellspacing="0" class="akismet-settings">
67
+ <tbody>
68
+ <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
69
+ <tr>
70
+ <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
71
+ <td width="5%"/>
72
+ <td align="left">
73
+ <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>
74
+ </td>
75
+ </tr>
76
+ <?php endif; ?>
77
+ <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
78
+ <tr>
79
+ <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
80
+ <td></td>
81
+ <td align="left">
82
+ <p>
83
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
+ if ( ! function_exists( 'wp_http_supports' ) ) {
86
+ ?><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
87
+ }
88
+ else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
89
+ ?><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
90
+ }
91
+ else {
92
+ $ssl_disabled = get_option( 'akismet_ssl_disabled' );
93
 
94
+ if ( $ssl_disabled ) {
95
+ ?><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
96
+ }
97
+ else {
98
+ ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
99
+ }
100
+ }
101
 
102
+ ?>
103
+ </p>
104
+ </td>
105
+ </tr>
106
+ <?php } ?>
107
+ <tr>
108
+ <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
109
+ <td></td>
110
+ <td align="left">
111
+ <p>
112
+ <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
113
+ <input
114
+ name="akismet_show_user_comments_approved"
115
+ id="akismet_show_user_comments_approved"
116
+ value="1"
117
+ type="checkbox"
 
 
 
 
 
 
 
118
  <?php
119
 
120
+ // 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.
121
+ checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
 
 
 
 
 
 
 
 
 
 
122
 
123
  ?>
124
+ />
125
+ <?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
126
+ </label>
127
+ </p>
128
+ </td>
129
+ </tr>
130
+ <tr>
131
+ <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
132
+ <td></td>
133
+ <td align="left">
134
+ <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
135
+ <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>
136
+ <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>
137
+ </fieldset>
138
+ <span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
139
+ <?php
140
+
141
+ $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
142
+
143
+ printf(
144
+ _n(
145
+ 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
146
+ 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
147
+ $delete_interval,
148
+ 'akismet'
149
+ ),
150
+ admin_url( 'edit-comments.php?comment_status=spam' ),
151
+ $delete_interval
152
+ );
153
+
154
+ ?>
155
+ </td>
156
+ </tr>
157
+ </tbody>
158
+ </table>
159
+ <div class="akismet-card-actions">
160
+ <?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
161
+ <div id="delete-action">
162
+ <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>
163
+ </div>
164
+ <?php endif; ?>
165
+ <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
166
+ <div id="publishing-action">
167
+ <input type="hidden" name="action" value="enter-key">
168
+ <input type="submit" name="submit" id="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
169
+ </div>
170
+ <div class="clear"></div>
171
  </div>
172
+ </form>
173
+ </div>
174
+ </div>
175
+
176
+ <div class="akismet-card">
177
+ <div class="akismet-section-header">
178
+ <div class="akismet-section-header__label">
179
+ <span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
180
  </div>
181
  </div>
182
+
183
+ <div class="inside">
184
+ <table cellspacing="0" border="0" class="akismet-settings">
185
+ <tbody>
186
+ <tr>
187
+ <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
188
+ <td width="5%"/>
189
+ <td align="left">
190
+ <p><?php echo esc_html( $akismet_user->account_name ); ?></p>
191
+ </td>
192
+ </tr>
193
+ <tr>
194
+ <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
195
+ <td width="5%"/>
196
+ <td align="left">
197
+ <p><?php
198
+ if ( 'cancelled' == $akismet_user->status ) :
199
+ esc_html_e( 'Cancelled', 'akismet' );
200
+ elseif ( 'suspended' == $akismet_user->status ) :
201
+ esc_html_e( 'Suspended', 'akismet' );
202
+ elseif ( 'missing' == $akismet_user->status ) :
203
+ esc_html_e( 'Missing', 'akismet' );
204
+ elseif ( 'no-sub' == $akismet_user->status ) :
205
+ esc_html_e( 'No Subscription Found', 'akismet' );
206
+ else :
207
+ esc_html_e( 'Active', 'akismet' );
208
+ endif; ?></p>
209
+ </td>
210
+ </tr>
211
+ <?php if ( $akismet_user->next_billing_date ) : ?>
212
+ <tr>
213
+ <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
214
+ <td width="5%"/>
215
+ <td align="left">
216
+ <p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
217
+ </td>
218
+ </tr>
219
+ <?php endif; ?>
220
+ </tbody>
221
+ </table>
222
+ <div class="akismet-card-actions">
223
+ <div id="publishing-action">
224
+ <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
 
 
 
 
 
 
 
 
225
  </div>
226
+ <div class="clear"></div>
227
  </div>
228
  </div>
229
  </div>
 
230
  <?php endif;?>
 
231
  </div>
232
  </div>
views/get.php CHANGED
@@ -2,5 +2,5 @@
2
  <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
3
  <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
4
  <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
5
- <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
6
  </form>
2
  <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
3
  <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
4
  <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
5
+ <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button akismet-is-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
6
  </form>
views/notice.php CHANGED
@@ -5,10 +5,10 @@
5
  <div class="aa_a">A</div>
6
  <div class="aa_button_container">
7
  <div class="aa_button_border">
8
- <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Activate your Akismet account', 'akismet' ); ?>" />
9
  </div>
10
  </div>
11
- <div class="aa_description"><?php _e('<strong>Almost done</strong> - activate Akismet and say goodbye to spam', 'akismet');?></div>
12
  </div>
13
  </form>
14
  </div>
@@ -20,8 +20,6 @@
20
  <p><?php echo $link_text; ?></p>
21
  <?php } ?>
22
  </div>
23
- <?php elseif ( $type == 'version' ) :?>
24
- <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>
25
  <?php elseif ( $type == 'alert' ) :?>
26
  <div class='error'>
27
  <p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
@@ -35,88 +33,102 @@
35
  </p>
36
  </div>
37
  <?php elseif ( $type == 'notice' ) :?>
38
- <div class="wrap alert critical">
39
- <h3 class="key-status failed"><?php echo $notice_header; ?></h3>
40
- <p class="description">
41
  <?php echo $notice_text; ?>
42
  </p>
43
  </div>
44
  <?php elseif ( $type == 'missing-functions' ) :?>
45
- <div class="wrap alert critical">
46
- <h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
47
- <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>
48
  </div>
49
  <?php elseif ( $type == 'servers-be-down' ) :?>
50
- <div class="wrap alert critical">
51
- <h3 class="key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
52
- <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>
53
  </div>
54
  <?php elseif ( $type == 'active-dunning' ) :?>
55
- <div class="wrap alert critical">
56
- <h3 class="key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
57
- <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>
58
  </div>
59
  <?php elseif ( $type == 'cancelled' ) :?>
60
- <div class="wrap alert critical">
61
- <h3 class="key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
62
- <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>
63
  </div>
64
  <?php elseif ( $type == 'suspended' ) :?>
65
- <div class="wrap alert critical">
66
- <h3 class="key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
67
- <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
68
  </div>
69
  <?php elseif ( $type == 'active-notice' && $time_saved ) :?>
70
- <div class="wrap alert active">
71
- <h3 class="key-status"><?php echo esc_html( $time_saved ); ?></h3>
72
- <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>
73
  </div>
74
  <?php elseif ( $type == 'missing' ) :?>
75
- <div class="wrap alert critical">
76
- <h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
77
- <p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
78
  </div>
79
  <?php elseif ( $type == 'no-sub' ) :?>
80
- <div class="wrap alert critical">
81
- <h3 class="key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
82
- <p class="description">
83
  <?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/' ); ?>
84
  <br /><br />
85
  <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
86
  </p>
87
  </div>
88
- <?php elseif ( $type == 'new-key-valid' ) :?>
89
- <div class="wrap alert active">
90
- <h3 class="key-status"><?php esc_html_e('Akismet is now activated. Happy blogging!', 'akismet'); ?></h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  </div>
92
  <?php elseif ( $type == 'new-key-invalid' ) :?>
93
- <div class="wrap alert critical">
94
- <h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
95
  </div>
96
  <?php elseif ( $type == 'existing-key-invalid' ) :?>
97
- <div class="wrap alert critical">
98
- <h3 class="key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
99
  </div>
100
  <?php elseif ( $type == 'new-key-failed' ) :?>
101
- <div class="wrap alert critical">
102
- <h3 class="key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
103
- <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>
104
  </div>
105
  <?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
106
- <div class="wrap alert critical">
107
  <?php if ( $level == 'yellow' ): ?>
108
- <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>
109
- <p class="description">
110
  <?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/' ); ?>
111
  <br /><br />
112
  <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
113
  </p>
114
  <?php elseif ( $level == 'red' ): ?>
115
- <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>
116
- <p class="description">
117
- <?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>
118
  <br /><br />
119
- <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?></p>
120
  </p>
121
  <?php endif; ?>
122
  </div>
5
  <div class="aa_a">A</div>
6
  <div class="aa_button_container">
7
  <div class="aa_button_border">
8
+ <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" />
9
  </div>
10
  </div>
11
+ <div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div>
12
  </div>
13
  </form>
14
  </div>
20
  <p><?php echo $link_text; ?></p>
21
  <?php } ?>
22
  </div>
 
 
23
  <?php elseif ( $type == 'alert' ) :?>
24
  <div class='error'>
25
  <p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
33
  </p>
34
  </div>
35
  <?php elseif ( $type == 'notice' ) :?>
36
+ <div class="akismet-alert akismet-critical">
37
+ <h3 class="akismet-key-status failed"><?php echo $notice_header; ?></h3>
38
+ <p class="akismet-description">
39
  <?php echo $notice_text; ?>
40
  </p>
41
  </div>
42
  <?php elseif ( $type == 'missing-functions' ) :?>
43
+ <div class="akismet-alert akismet-critical">
44
+ <h3 class="akismet-key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
45
+ <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>
46
  </div>
47
  <?php elseif ( $type == 'servers-be-down' ) :?>
48
+ <div class="akismet-alert akismet-critical">
49
+ <h3 class="akismet-key-status failed"><?php esc_html_e("Akismet can&#8217;t connect to your site.", 'akismet'); ?></h3>
50
+ <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>
51
  </div>
52
  <?php elseif ( $type == 'active-dunning' ) :?>
53
+ <div class="akismet-alert akismet-critical">
54
+ <h3 class="akismet-key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
55
+ <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>
56
  </div>
57
  <?php elseif ( $type == 'cancelled' ) :?>
58
+ <div class="akismet-alert akismet-critical">
59
+ <h3 class="akismet-key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
60
+ <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>
61
  </div>
62
  <?php elseif ( $type == 'suspended' ) :?>
63
+ <div class="akismet-alert akismet-critical">
64
+ <h3 class="akismet-key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
65
+ <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
66
  </div>
67
  <?php elseif ( $type == 'active-notice' && $time_saved ) :?>
68
+ <div class="akismet-alert akismet-active">
69
+ <h3 class="akismet-key-status"><?php echo esc_html( $time_saved ); ?></h3>
70
+ <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>
71
  </div>
72
  <?php elseif ( $type == 'missing' ) :?>
73
+ <div class="akismet-alert akismet-critical">
74
+ <h3 class="akismet-key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
75
+ <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
76
  </div>
77
  <?php elseif ( $type == 'no-sub' ) :?>
78
+ <div class="akismet-alert akismet-critical">
79
+ <h3 class="akismet-key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
80
+ <p class="akismet-description">
81
  <?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/' ); ?>
82
  <br /><br />
83
  <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
84
  </p>
85
  </div>
86
+ <?php elseif ( $type == 'new-key-valid' ) :
87
+ global $wpdb;
88
+
89
+ $check_pending_link = false;
90
+
91
+ $at_least_one_comment_in_moderation = !! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" );
92
+
93
+ if ( $at_least_one_comment_in_moderation) {
94
+ $check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );
95
+ }
96
+
97
+ ?>
98
+ <div class="akismet-alert akismet-active">
99
+ <h3 class="akismet-key-status"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3>
100
+ <?php if ( $check_pending_link ) { ?>
101
+ <p class="akismet-description"><?php printf( __( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p>
102
+ <?php } ?>
103
  </div>
104
  <?php elseif ( $type == 'new-key-invalid' ) :?>
105
+ <div class="akismet-alert akismet-critical">
106
+ <h3 class="akismet-key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
107
  </div>
108
  <?php elseif ( $type == 'existing-key-invalid' ) :?>
109
+ <div class="akismet-alert akismet-critical">
110
+ <h3 class="akismet-key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
111
  </div>
112
  <?php elseif ( $type == 'new-key-failed' ) :?>
113
+ <div class="akismet-alert akismet-critical">
114
+ <h3 class="akismet-key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
115
+ <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>
116
  </div>
117
  <?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
118
+ <div class="akismet-alert akismet-critical">
119
  <?php if ( $level == 'yellow' ): ?>
120
+ <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>
121
+ <p class="akismet-description">
122
  <?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/' ); ?>
123
  <br /><br />
124
  <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
125
  </p>
126
  <?php elseif ( $level == 'red' ): ?>
127
+ <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>
128
+ <p class="akismet-description">
129
+ <?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/' ); ?>
130
  <br /><br />
131
+ <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
132
  </p>
133
  <?php endif; ?>
134
  </div>
views/start.php CHANGED
@@ -1,97 +1,93 @@
1
- <div class="no-key config-wrap"><?php
2
- if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
3
- if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) :?>
4
- <p><?php esc_html_e('Akismet eliminates spam from your site. Register below to get started.', 'akismet'); ?></p>
5
- <div class="activate-highlight activate-option">
6
- <div class="option-description">
7
- <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
8
- <?php echo esc_html( $akismet_user->user_email ); ?>
9
  </div>
10
- <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
11
- <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
12
- <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
13
- <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
14
- <input type="hidden" name="redirect" value="plugin-signup"/>
15
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register for Akismet' , 'akismet'); ?>"/>
16
- </form>
17
- </div>
18
- <?php elseif ( $akismet_user->status == 'cancelled' ) :?>
19
- <p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
20
- <div class="activate-highlight activate-option">
21
- <div class="option-description" style="width:75%;">
22
- <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
23
- <?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ) ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </div>
25
- <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
26
- <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
27
- <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
28
- <input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
29
- <input type="hidden" name="redirect" value="upgrade"/>
30
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
31
- </form>
32
- </div>
33
- <?php elseif ( $akismet_user->status == 'suspended' ) : ?>
34
- <p><?php esc_html_e('Akismet eliminates spam from your site.', 'akismet'); ?></p>
35
- <div class="activate-highlight centered activate-option">
36
- <strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
37
- <h3 class="alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ) ); ?></h3>
38
- <p><?php esc_html_e('No worries! Get in touch and we&#8217;ll sort this out.', 'akismet'); ?></p>
39
- <a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
40
- </div>
41
- <?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
42
- <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>
43
- <div class="activate-highlight activate-option">
44
- <div class="option-description">
45
- <strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
46
- <?php echo esc_html( $akismet_user->user_email ); ?>
47
- </div>
48
- <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
49
- <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
50
- <input type="hidden" name="action" value="enter-key">
51
- <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
52
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this account' , 'akismet'); ?>"/>
53
- </form>
54
- </div>
55
- <?php endif;?>
56
- <div class="activate-highlight secondary activate-option">
57
- <div class="option-description">
58
- <strong><?php esc_html_e('Sign up for a plan with a different email address', 'akismet'); ?></strong>
59
- <p><?php esc_html_e('Use this option to use Akismet independently of your Jetpack connection.', 'akismet'); ?></p>
60
- </div>
61
- <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
62
- </div>
63
- <div class="activate-highlight secondary activate-option">
64
- <div class="option-description">
65
- <strong><?php esc_html_e('Enter an API key', 'akismet'); ?></strong>
66
- <p><?php esc_html_e('Already have your key? Enter it here.', 'akismet'); ?></p>
67
- </div>
68
- <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
69
- <input id="key" name="key" type="text" size="15" value="" class="regular-text code">
70
- <input type="hidden" name="action" value="enter-key">
71
- <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
72
- <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
73
- </form>
74
- </div>
75
- <?php else :?>
76
- <p><?php esc_html_e('Akismet eliminates spam from your site. To set up Akismet, select one of the options below.', 'akismet'); ?></p>
77
- <div class="activate-highlight activate-option">
78
- <div class="option-description">
79
- <strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
80
- <p><?php esc_html_e('Log in or sign up now.', 'akismet'); ?></p>
81
- </div>
82
- <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
83
- </div>
84
- <div class="activate-highlight secondary activate-option">
85
- <div class="option-description">
86
- <strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
87
- <p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
88
- </div>
89
- <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
90
- <input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( Akismet::get_api_key() ); ?>" class="regular-text code">
91
- <input type="hidden" name="action" value="enter-key">
92
- <?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
93
- <input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
94
- </form>
95
- </div><?php
96
- endif;?>
97
  </div>
1
+ <div id="akismet-plugin-container">
2
+ <div class="akismet-masthead">
3
+ <div class="akismet-masthead__inside-container">
4
+ <div class="akismet-masthead__logo-container">
5
+ <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
6
+ </div>
7
+ </div>
 
8
  </div>
9
+ <div class="akismet-lower">
10
+ <?php Akismet_Admin::display_status(); ?>
11
+ <div class="akismet-box">
12
+ <h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
13
+ <p><?php esc_html_e( 'Select one of the options below to get started.', 'akismet' ); ?></p>
14
+ </div>
15
+ <div class="akismet-boxes">
16
+ <?php if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { ?>
17
+ <?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
18
+ <div class="akismet-box">
19
+ <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
20
+ <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
21
+ <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
22
+ <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
23
+ <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
24
+ <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
25
+ <input type="hidden" name="redirect" value="plugin-signup"/>
26
+ <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
27
+ </form>
28
+ <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
29
+ <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>
30
+ </div>
31
+ <?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
32
+ <div class="akismet-box">
33
+ <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
34
+ <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
35
+ <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
36
+ <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
37
+ <input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
38
+ <input type="hidden" name="redirect" value="upgrade"/>
39
+ <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet' ); ?>"/>
40
+ </form>
41
+ <p><?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
42
+ </div>
43
+ <?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
44
+ <div class="centered akismet-box">
45
+ <h3><?php esc_html_e( 'Connected via Jetpack' , 'akismet' ); ?></h3>
46
+ <p class="akismet-alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
47
+ <p><?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?></p>
48
+ <p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
49
+ </div>
50
+ <?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
51
+ <div class="akismet-box">
52
+ <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
53
+ <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
54
+ <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
55
+ <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
56
+ <input type="hidden" name="action" value="enter-key">
57
+ <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
58
+ <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
59
+ </form>
60
+ <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
61
+ <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>
62
+ </div>
63
+ <?php } ?>
64
+ <div class="akismet-box">
65
+ <h3><?php esc_html_e( 'Or sign up with a different email address', 'akismet' ); ?></h3>
66
+ <div class="akismet-right">
67
+ <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet' ), 'classes' => array( 'akismet-button' ) ) ); ?>
68
+ </div>
69
+ <p><?php esc_html_e( 'Choose this option to use Akismet independently of your Jetpack connection.', 'akismet' ); ?></p>
70
+ </div>
71
+ <?php } else { ?>
72
+ <div class="akismet-box">
73
+ <h3><?php esc_html_e( 'Activate Akismet' , 'akismet' );?></h3>
74
+ <div class="akismet-right">
75
+ <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
76
+ </div>
77
+ <p><?php esc_html_e( 'Log in or sign up now.', 'akismet' ); ?></p>
78
+ </div>
79
+ <?php } ?>
80
+ <div class="akismet-box">
81
+ <h3><?php esc_html_e( 'Or enter an API key', 'akismet' ); ?></h3>
82
+ <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>
83
+ <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
84
+ <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
85
+ <input type="hidden" name="action" value="enter-key">
86
+ <p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
87
+ <input id="key" name="key" type="text" size="15" value="" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
88
+ <input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
89
+ </p>
90
+ </form>
91
+ </div>
92
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  </div>
views/stats.php CHANGED
@@ -1,4 +1,11 @@
1
- <div class="wrap">
2
- <h2><?php esc_html_e( 'Akismet Stats' , 'akismet');?><?php if ( !isset( $hide_settings_link ) ): ?> <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="add-new-h2"><?php esc_html_e( 'Settings' , 'akismet');?></a><?php endif;?></h2>
3
- <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe>
 
 
 
 
 
 
 
4
  </div>
1
+ <div id="akismet-plugin-container">
2
+ <div class="akismet-masthead">
3
+ <div class="akismet-masthead__inside-container">
4
+ <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="akismet-right"><?php esc_html_e( 'Akismet Settings' , 'akismet' ); ?></a>
5
+ <div class="akismet-masthead__logo-container">
6
+ <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
7
+ </div>
8
+ </div>
9
+ </div>
10
+ <iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
11
  </div>
views/strict.php DELETED
@@ -1,17 +0,0 @@
1
- <fieldset>
2
- <legend class="screen-reader-text">
3
- <span><?php esc_html_e( 'Akismet anti-spam strictness', 'akismet' ); ?></span>
4
- </legend>
5
- <p>
6
- <label for="akismet_strictness_1">
7
- <input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked( '1', get_option( 'akismet_strictness' ) ); ?> />
8
- <?php esc_html_e( 'Strict: silently discard the worst and most pervasive spam.', 'akismet' ); ?>
9
- </label>
10
- </p>
11
- <p>
12
- <label for="akismet_strictness_0">
13
- <input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
14
- <?php esc_html_e( 'Safe: always put spam in the Spam folder for review.', 'akismet' ); ?>
15
- </label>
16
- </p>
17
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wrapper.php CHANGED
@@ -175,7 +175,7 @@ function akismet_get_ip_address() {
175
  function akismet_cron_recheck() {
176
  return Akismet::cron_recheck();
177
  }
178
- function akismet_add_comment_nonce() {
179
  return Akismet::add_comment_nonce( $post_id );
180
  }
181
  function akismet_fix_scheduled_recheck() {
175
  function akismet_cron_recheck() {
176
  return Akismet::cron_recheck();
177
  }
178
+ function akismet_add_comment_nonce( $post_id ) {
179
  return Akismet::add_comment_nonce( $post_id );
180
  }
181
  function akismet_fix_scheduled_recheck() {