Gentoo Archives: gentoo-commits

From: Yury German <blueknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/blogs-gentoo:master commit in: plugins/akismet/_inc/img/, plugins/google-authenticator/, ...
Date: Wed, 22 May 2019 04:56:30
Message-Id: 1558500876.1885405d20bcfdcd83b39d93c90d1af4b4424ce0.blueknight@gentoo
1 commit: 1885405d20bcfdcd83b39d93c90d1af4b4424ce0
2 Author: Yury German <blueknight <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 22 04:54:36 2019 +0000
4 Commit: Yury German <blueknight <AT> gentoo <DOT> org>
5 CommitDate: Wed May 22 04:54:36 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/blogs-gentoo.git/commit/?id=1885405d
7
8 Deleting plugins for update
9
10 Signed-off-by: Yury German <blueknight <AT> gentoo.org>
11
12 plugins/akismet/.htaccess | 34 -
13 plugins/akismet/LICENSE.txt | 339 -----
14 plugins/akismet/_inc/akismet.css | 625 ---------
15 plugins/akismet/_inc/akismet.js | 308 -----
16 plugins/akismet/_inc/form.js | 30 -
17 plugins/akismet/_inc/img/logo-full-2x.png | Bin 5052 -> 0 bytes
18 plugins/akismet/akismet.php | 66 -
19 plugins/akismet/class.akismet-admin.php | 1244 -----------------
20 plugins/akismet/class.akismet-cli.php | 185 ---
21 plugins/akismet/class.akismet-rest-api.php | 366 -----
22 plugins/akismet/class.akismet-widget.php | 114 --
23 plugins/akismet/class.akismet.php | 1423 --------------------
24 plugins/akismet/index.php | 2 -
25 plugins/akismet/readme.txt | 466 -------
26 plugins/akismet/views/config.php | 242 ----
27 plugins/akismet/views/get.php | 12 -
28 plugins/akismet/views/notice.php | 141 --
29 plugins/akismet/views/start.php | 102 --
30 plugins/akismet/views/stats.php | 11 -
31 plugins/akismet/wrapper.php | 214 ---
32 plugins/google-authenticator/LICENSE | 339 -----
33 plugins/google-authenticator/base32.php | 82 --
34 .../google-authenticator/google-authenticator.php | 1007 --------------
35 plugins/google-authenticator/jquery.qrcode.min.js | 28 -
36 .../lang/google-authenticator-da_DK.mo | Bin 2736 -> 0 bytes
37 .../lang/google-authenticator-da_DK.po | 113 --
38 .../lang/google-authenticator-de_DE.mo | Bin 2565 -> 0 bytes
39 .../lang/google-authenticator-de_DE.po | 119 --
40 .../lang/google-authenticator-es_ES.mo | Bin 2749 -> 0 bytes
41 .../lang/google-authenticator-es_ES.po | 131 --
42 .../lang/google-authenticator-fr_FR.mo | Bin 2635 -> 0 bytes
43 .../lang/google-authenticator-fr_FR.po | 133 --
44 .../lang/google-authenticator-it_IT.mo | Bin 3324 -> 0 bytes
45 .../lang/google-authenticator-it_IT.po | 143 --
46 .../lang/google-authenticator-nl_NL.mo | Bin 7309 -> 0 bytes
47 .../lang/google-authenticator-nl_NL.po | 317 -----
48 .../lang/google-authenticator-pt_BR.mo | Bin 2971 -> 0 bytes
49 .../lang/google-authenticator-pt_BR.po | 123 --
50 .../lang/google-authenticator-zh_CN.mo | Bin 3026 -> 0 bytes
51 .../lang/google-authenticator-zh_CN.po | 126 --
52 .../lang/google-authenticator.pot | 260 ----
53 plugins/google-authenticator/readme.txt | 194 ---
54 plugins/google-authenticator/screenshot-1.jpg | Bin 28821 -> 0 bytes
55 plugins/google-authenticator/screenshot-2.jpg | Bin 101559 -> 0 bytes
56 plugins/google-authenticator/screenshot-3.jpg | Bin 148800 -> 0 bytes
57 plugins/google-authenticator/screenshot-4.jpg | Bin 64993 -> 0 bytes
58 plugins/google-authenticator/screenshot-5.jpg | Bin 24141 -> 0 bytes
59 47 files changed, 9039 deletions(-)
60
61 diff --git a/plugins/akismet/.htaccess b/plugins/akismet/.htaccess
62 deleted file mode 100644
63 index 49d72d71..00000000
64 --- a/plugins/akismet/.htaccess
65 +++ /dev/null
66 @@ -1,34 +0,0 @@
67 -# Only allow direct access to specific Web-available files.
68 -
69 -# Apache 2.2
70 -<IfModule !mod_authz_core.c>
71 - Order Deny,Allow
72 - Deny from all
73 -</IfModule>
74 -
75 -# Apache 2.4
76 -<IfModule mod_authz_core.c>
77 - Require all denied
78 -</IfModule>
79 -
80 -# Akismet CSS and JS
81 -<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
82 - <IfModule !mod_authz_core.c>
83 - Allow from all
84 - </IfModule>
85 -
86 - <IfModule mod_authz_core.c>
87 - Require all granted
88 - </IfModule>
89 -</FilesMatch>
90 -
91 -# Akismet images
92 -<FilesMatch "^logo-full-2x\.png$">
93 - <IfModule !mod_authz_core.c>
94 - Allow from all
95 - </IfModule>
96 -
97 - <IfModule mod_authz_core.c>
98 - Require all granted
99 - </IfModule>
100 -</FilesMatch>
101 \ No newline at end of file
102
103 diff --git a/plugins/akismet/LICENSE.txt b/plugins/akismet/LICENSE.txt
104 deleted file mode 100644
105 index d159169d..00000000
106 --- a/plugins/akismet/LICENSE.txt
107 +++ /dev/null
108 @@ -1,339 +0,0 @@
109 - GNU GENERAL PUBLIC LICENSE
110 - Version 2, June 1991
111 -
112 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
113 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
114 - Everyone is permitted to copy and distribute verbatim copies
115 - of this license document, but changing it is not allowed.
116 -
117 - Preamble
118 -
119 - The licenses for most software are designed to take away your
120 -freedom to share and change it. By contrast, the GNU General Public
121 -License is intended to guarantee your freedom to share and change free
122 -software--to make sure the software is free for all its users. This
123 -General Public License applies to most of the Free Software
124 -Foundation's software and to any other program whose authors commit to
125 -using it. (Some other Free Software Foundation software is covered by
126 -the GNU Lesser General Public License instead.) You can apply it to
127 -your programs, too.
128 -
129 - When we speak of free software, we are referring to freedom, not
130 -price. Our General Public Licenses are designed to make sure that you
131 -have the freedom to distribute copies of free software (and charge for
132 -this service if you wish), that you receive source code or can get it
133 -if you want it, that you can change the software or use pieces of it
134 -in new free programs; and that you know you can do these things.
135 -
136 - To protect your rights, we need to make restrictions that forbid
137 -anyone to deny you these rights or to ask you to surrender the rights.
138 -These restrictions translate to certain responsibilities for you if you
139 -distribute copies of the software, or if you modify it.
140 -
141 - For example, if you distribute copies of such a program, whether
142 -gratis or for a fee, you must give the recipients all the rights that
143 -you have. You must make sure that they, too, receive or can get the
144 -source code. And you must show them these terms so they know their
145 -rights.
146 -
147 - We protect your rights with two steps: (1) copyright the software, and
148 -(2) offer you this license which gives you legal permission to copy,
149 -distribute and/or modify the software.
150 -
151 - Also, for each author's protection and ours, we want to make certain
152 -that everyone understands that there is no warranty for this free
153 -software. If the software is modified by someone else and passed on, we
154 -want its recipients to know that what they have is not the original, so
155 -that any problems introduced by others will not reflect on the original
156 -authors' reputations.
157 -
158 - Finally, any free program is threatened constantly by software
159 -patents. We wish to avoid the danger that redistributors of a free
160 -program will individually obtain patent licenses, in effect making the
161 -program proprietary. To prevent this, we have made it clear that any
162 -patent must be licensed for everyone's free use or not licensed at all.
163 -
164 - The precise terms and conditions for copying, distribution and
165 -modification follow.
166 -
167 - GNU GENERAL PUBLIC LICENSE
168 - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
169 -
170 - 0. This License applies to any program or other work which contains
171 -a notice placed by the copyright holder saying it may be distributed
172 -under the terms of this General Public License. The "Program", below,
173 -refers to any such program or work, and a "work based on the Program"
174 -means either the Program or any derivative work under copyright law:
175 -that is to say, a work containing the Program or a portion of it,
176 -either verbatim or with modifications and/or translated into another
177 -language. (Hereinafter, translation is included without limitation in
178 -the term "modification".) Each licensee is addressed as "you".
179 -
180 -Activities other than copying, distribution and modification are not
181 -covered by this License; they are outside its scope. The act of
182 -running the Program is not restricted, and the output from the Program
183 -is covered only if its contents constitute a work based on the
184 -Program (independent of having been made by running the Program).
185 -Whether that is true depends on what the Program does.
186 -
187 - 1. You may copy and distribute verbatim copies of the Program's
188 -source code as you receive it, in any medium, provided that you
189 -conspicuously and appropriately publish on each copy an appropriate
190 -copyright notice and disclaimer of warranty; keep intact all the
191 -notices that refer to this License and to the absence of any warranty;
192 -and give any other recipients of the Program a copy of this License
193 -along with the Program.
194 -
195 -You may charge a fee for the physical act of transferring a copy, and
196 -you may at your option offer warranty protection in exchange for a fee.
197 -
198 - 2. You may modify your copy or copies of the Program or any portion
199 -of it, thus forming a work based on the Program, and copy and
200 -distribute such modifications or work under the terms of Section 1
201 -above, provided that you also meet all of these conditions:
202 -
203 - a) You must cause the modified files to carry prominent notices
204 - stating that you changed the files and the date of any change.
205 -
206 - b) You must cause any work that you distribute or publish, that in
207 - whole or in part contains or is derived from the Program or any
208 - part thereof, to be licensed as a whole at no charge to all third
209 - parties under the terms of this License.
210 -
211 - c) If the modified program normally reads commands interactively
212 - when run, you must cause it, when started running for such
213 - interactive use in the most ordinary way, to print or display an
214 - announcement including an appropriate copyright notice and a
215 - notice that there is no warranty (or else, saying that you provide
216 - a warranty) and that users may redistribute the program under
217 - these conditions, and telling the user how to view a copy of this
218 - License. (Exception: if the Program itself is interactive but
219 - does not normally print such an announcement, your work based on
220 - the Program is not required to print an announcement.)
221 -
222 -These requirements apply to the modified work as a whole. If
223 -identifiable sections of that work are not derived from the Program,
224 -and can be reasonably considered independent and separate works in
225 -themselves, then this License, and its terms, do not apply to those
226 -sections when you distribute them as separate works. But when you
227 -distribute the same sections as part of a whole which is a work based
228 -on the Program, the distribution of the whole must be on the terms of
229 -this License, whose permissions for other licensees extend to the
230 -entire whole, and thus to each and every part regardless of who wrote it.
231 -
232 -Thus, it is not the intent of this section to claim rights or contest
233 -your rights to work written entirely by you; rather, the intent is to
234 -exercise the right to control the distribution of derivative or
235 -collective works based on the Program.
236 -
237 -In addition, mere aggregation of another work not based on the Program
238 -with the Program (or with a work based on the Program) on a volume of
239 -a storage or distribution medium does not bring the other work under
240 -the scope of this License.
241 -
242 - 3. You may copy and distribute the Program (or a work based on it,
243 -under Section 2) in object code or executable form under the terms of
244 -Sections 1 and 2 above provided that you also do one of the following:
245 -
246 - a) Accompany it with the complete corresponding machine-readable
247 - source code, which must be distributed under the terms of Sections
248 - 1 and 2 above on a medium customarily used for software interchange; or,
249 -
250 - b) Accompany it with a written offer, valid for at least three
251 - years, to give any third party, for a charge no more than your
252 - cost of physically performing source distribution, a complete
253 - machine-readable copy of the corresponding source code, to be
254 - distributed under the terms of Sections 1 and 2 above on a medium
255 - customarily used for software interchange; or,
256 -
257 - c) Accompany it with the information you received as to the offer
258 - to distribute corresponding source code. (This alternative is
259 - allowed only for noncommercial distribution and only if you
260 - received the program in object code or executable form with such
261 - an offer, in accord with Subsection b above.)
262 -
263 -The source code for a work means the preferred form of the work for
264 -making modifications to it. For an executable work, complete source
265 -code means all the source code for all modules it contains, plus any
266 -associated interface definition files, plus the scripts used to
267 -control compilation and installation of the executable. However, as a
268 -special exception, the source code distributed need not include
269 -anything that is normally distributed (in either source or binary
270 -form) with the major components (compiler, kernel, and so on) of the
271 -operating system on which the executable runs, unless that component
272 -itself accompanies the executable.
273 -
274 -If distribution of executable or object code is made by offering
275 -access to copy from a designated place, then offering equivalent
276 -access to copy the source code from the same place counts as
277 -distribution of the source code, even though third parties are not
278 -compelled to copy the source along with the object code.
279 -
280 - 4. You may not copy, modify, sublicense, or distribute the Program
281 -except as expressly provided under this License. Any attempt
282 -otherwise to copy, modify, sublicense or distribute the Program is
283 -void, and will automatically terminate your rights under this License.
284 -However, parties who have received copies, or rights, from you under
285 -this License will not have their licenses terminated so long as such
286 -parties remain in full compliance.
287 -
288 - 5. You are not required to accept this License, since you have not
289 -signed it. However, nothing else grants you permission to modify or
290 -distribute the Program or its derivative works. These actions are
291 -prohibited by law if you do not accept this License. Therefore, by
292 -modifying or distributing the Program (or any work based on the
293 -Program), you indicate your acceptance of this License to do so, and
294 -all its terms and conditions for copying, distributing or modifying
295 -the Program or works based on it.
296 -
297 - 6. Each time you redistribute the Program (or any work based on the
298 -Program), the recipient automatically receives a license from the
299 -original licensor to copy, distribute or modify the Program subject to
300 -these terms and conditions. You may not impose any further
301 -restrictions on the recipients' exercise of the rights granted herein.
302 -You are not responsible for enforcing compliance by third parties to
303 -this License.
304 -
305 - 7. If, as a consequence of a court judgment or allegation of patent
306 -infringement or for any other reason (not limited to patent issues),
307 -conditions are imposed on you (whether by court order, agreement or
308 -otherwise) that contradict the conditions of this License, they do not
309 -excuse you from the conditions of this License. If you cannot
310 -distribute so as to satisfy simultaneously your obligations under this
311 -License and any other pertinent obligations, then as a consequence you
312 -may not distribute the Program at all. For example, if a patent
313 -license would not permit royalty-free redistribution of the Program by
314 -all those who receive copies directly or indirectly through you, then
315 -the only way you could satisfy both it and this License would be to
316 -refrain entirely from distribution of the Program.
317 -
318 -If any portion of this section is held invalid or unenforceable under
319 -any particular circumstance, the balance of the section is intended to
320 -apply and the section as a whole is intended to apply in other
321 -circumstances.
322 -
323 -It is not the purpose of this section to induce you to infringe any
324 -patents or other property right claims or to contest validity of any
325 -such claims; this section has the sole purpose of protecting the
326 -integrity of the free software distribution system, which is
327 -implemented by public license practices. Many people have made
328 -generous contributions to the wide range of software distributed
329 -through that system in reliance on consistent application of that
330 -system; it is up to the author/donor to decide if he or she is willing
331 -to distribute software through any other system and a licensee cannot
332 -impose that choice.
333 -
334 -This section is intended to make thoroughly clear what is believed to
335 -be a consequence of the rest of this License.
336 -
337 - 8. If the distribution and/or use of the Program is restricted in
338 -certain countries either by patents or by copyrighted interfaces, the
339 -original copyright holder who places the Program under this License
340 -may add an explicit geographical distribution limitation excluding
341 -those countries, so that distribution is permitted only in or among
342 -countries not thus excluded. In such case, this License incorporates
343 -the limitation as if written in the body of this License.
344 -
345 - 9. The Free Software Foundation may publish revised and/or new versions
346 -of the General Public License from time to time. Such new versions will
347 -be similar in spirit to the present version, but may differ in detail to
348 -address new problems or concerns.
349 -
350 -Each version is given a distinguishing version number. If the Program
351 -specifies a version number of this License which applies to it and "any
352 -later version", you have the option of following the terms and conditions
353 -either of that version or of any later version published by the Free
354 -Software Foundation. If the Program does not specify a version number of
355 -this License, you may choose any version ever published by the Free Software
356 -Foundation.
357 -
358 - 10. If you wish to incorporate parts of the Program into other free
359 -programs whose distribution conditions are different, write to the author
360 -to ask for permission. For software which is copyrighted by the Free
361 -Software Foundation, write to the Free Software Foundation; we sometimes
362 -make exceptions for this. Our decision will be guided by the two goals
363 -of preserving the free status of all derivatives of our free software and
364 -of promoting the sharing and reuse of software generally.
365 -
366 - NO WARRANTY
367 -
368 - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
369 -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
370 -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
371 -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
372 -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
373 -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
374 -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
375 -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
376 -REPAIR OR CORRECTION.
377 -
378 - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
379 -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
380 -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
381 -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
382 -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
383 -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
384 -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
385 -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
386 -POSSIBILITY OF SUCH DAMAGES.
387 -
388 - END OF TERMS AND CONDITIONS
389 -
390 - How to Apply These Terms to Your New Programs
391 -
392 - If you develop a new program, and you want it to be of the greatest
393 -possible use to the public, the best way to achieve this is to make it
394 -free software which everyone can redistribute and change under these terms.
395 -
396 - To do so, attach the following notices to the program. It is safest
397 -to attach them to the start of each source file to most effectively
398 -convey the exclusion of warranty; and each file should have at least
399 -the "copyright" line and a pointer to where the full notice is found.
400 -
401 - <one line to give the program's name and a brief idea of what it does.>
402 - Copyright (C) <year> <name of author>
403 -
404 - This program is free software; you can redistribute it and/or modify
405 - it under the terms of the GNU General Public License as published by
406 - the Free Software Foundation; either version 2 of the License, or
407 - (at your option) any later version.
408 -
409 - This program is distributed in the hope that it will be useful,
410 - but WITHOUT ANY WARRANTY; without even the implied warranty of
411 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
412 - GNU General Public License for more details.
413 -
414 - You should have received a copy of the GNU General Public License along
415 - with this program; if not, write to the Free Software Foundation, Inc.,
416 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
417 -
418 -Also add information on how to contact you by electronic and paper mail.
419 -
420 -If the program is interactive, make it output a short notice like this
421 -when it starts in an interactive mode:
422 -
423 - Gnomovision version 69, Copyright (C) year name of author
424 - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
425 - This is free software, and you are welcome to redistribute it
426 - under certain conditions; type `show c' for details.
427 -
428 -The hypothetical commands `show w' and `show c' should show the appropriate
429 -parts of the General Public License. Of course, the commands you use may
430 -be called something other than `show w' and `show c'; they could even be
431 -mouse-clicks or menu items--whatever suits your program.
432 -
433 -You should also get your employer (if you work as a programmer) or your
434 -school, if any, to sign a "copyright disclaimer" for the program, if
435 -necessary. Here is a sample; alter the names:
436 -
437 - Yoyodyne, Inc., hereby disclaims all copyright interest in the program
438 - `Gnomovision' (which makes passes at compilers) written by James Hacker.
439 -
440 - <signature of Ty Coon>, 1 April 1989
441 - Ty Coon, President of Vice
442 -
443 -This General Public License does not permit incorporating your program into
444 -proprietary programs. If your program is a subroutine library, you may
445 -consider it more useful to permit linking proprietary applications with the
446 -library. If this is what you want to do, use the GNU Lesser General
447 -Public License instead of this License.
448
449 diff --git a/plugins/akismet/_inc/akismet.css b/plugins/akismet/_inc/akismet.css
450 deleted file mode 100644
451 index bc56f061..00000000
452 --- a/plugins/akismet/_inc/akismet.css
453 +++ /dev/null
454 @@ -1,625 +0,0 @@
455 -.wp-admin.jetpack_page_akismet-key-config, .wp-admin.settings_page_akismet-key-config {
456 - background-color:#f3f6f8;
457 -}
458 -
459 -#submitted-on {
460 - position: relative;
461 -}
462 -#the-comment-list .author .akismet-user-comment-count {
463 - display: inline;
464 -}
465 -#the-comment-list .author a span {
466 - text-decoration: none;
467 - color: #999;
468 -}
469 -#the-comment-list .author a span.akismet-span-link {
470 - text-decoration: inherit;
471 - color: inherit;
472 -}
473 -#the-comment-list .akismet_remove_url {
474 - margin-left: 3px;
475 - color: #999;
476 - padding: 2px 3px 2px 0;
477 -}
478 -#the-comment-list .akismet_remove_url:hover {
479 - color: #A7301F;
480 - font-weight: bold;
481 - padding: 2px 2px 2px 0;
482 -}
483 -#dashboard_recent_comments .akismet-status {
484 - display: none;
485 -}
486 -.akismet-status {
487 - float: right;
488 -}
489 -.akismet-status a {
490 - color: #AAA;
491 - font-style: italic;
492 -}
493 -table.comments td.comment p a {
494 - text-decoration: underline;
495 -}
496 -table.comments td.comment p a:after {
497 - content: attr(href);
498 - color: #aaa;
499 - display: inline-block; /* Show the URL without the link's underline extending under it. */
500 - padding: 0 1ex; /* Because it's inline block, we can't just use spaces in the content: attribute to separate it from the link text. */
501 -}
502 -.mshot-arrow {
503 - width: 0;
504 - height: 0;
505 - border-top: 10px solid transparent;
506 - border-bottom: 10px solid transparent;
507 - border-right: 10px solid #5C5C5C;
508 - position: absolute;
509 - left: -6px;
510 - top: 91px;
511 -}
512 -.mshot-container {
513 - background: #5C5C5C;
514 - position: absolute;
515 - top: -94px;
516 - padding: 7px;
517 - width: 450px;
518 - height: 338px;
519 - z-index: 20000;
520 - -moz-border-radius: 6px;
521 - border-radius: 6px;
522 - -webkit-border-radius: 6px;
523 -}
524 -.akismet-mshot {
525 - position: absolute;
526 - z-index: 100;
527 -}
528 -.akismet-mshot .mshot-image {
529 - margin: 0;
530 - height: 338px;
531 - width: 450px;
532 -}
533 -.checkforspam {
534 - display: inline-block !important;
535 -}
536 -.checkforspam-progress {
537 - display: none;
538 -}
539 -.checkforspam.checking .checkforspam-progress {
540 - padding-left: 1ex;
541 -}
542 -.checkforspam.button-disabled .checkforspam-progress {
543 - display: inline;
544 -}
545 -
546 -.checkforspam-spinner {
547 - display: inline-block;
548 - margin-top: 7px;
549 -}
550 -
551 -.akismet-right {
552 - float: right;
553 -}
554 -
555 -.akismet-card .akismet-right {
556 - margin: 1em 0;
557 -}
558 -
559 -.akismet-alert-text {
560 - color: #dd3d36;
561 - font-weight: bold;
562 - font-size: 120%;
563 - margin-top: .5rem;
564 -}
565 -.akismet-alert {
566 - border: 1px solid #e5e5e5;
567 - padding: 0.4em 1em 1.4em 1em;
568 - border-radius: 3px;
569 - -webkit-border-radius: 3px;
570 - border-width: 1px;
571 - border-style: solid;
572 -}
573 -
574 -.akismet-alert h3.akismet-key-status {
575 - color: #fff;
576 - margin: 1em 0 0.5em 0;
577 -}
578 -
579 -.akismet-alert.akismet-critical {
580 - background-color: #993300;
581 -}
582 -
583 -.akismet-alert.akismet-active {
584 - background-color: #649316;
585 -}
586 -
587 -.akismet-alert p.akismet-key-status {
588 - font-size: 24px;
589 -}
590 -
591 -.akismet-alert p.akismet-description {
592 - color:#fff;
593 - font-size: 14px;
594 - margin: 0 0;
595 - font-style: normal;
596 -}
597 -
598 -.akismet-alert p.akismet-description a,
599 -.akismet-alert p.akismet-description a,
600 -.akismet-alert p.akismet-description a,
601 -.akismet-alert p.akismet-description a {
602 - color: #fff;
603 -}
604 -
605 -.akismet-new-snapshot {
606 - margin-top: 1em;
607 - padding: 1em;
608 - text-align: center;
609 - background: #fff;
610 -}
611 -
612 -.akismet-new-snapshot h3 {
613 - background: #f5f5f5;
614 - color: #888;
615 - font-size: 11px;
616 - margin: 0;
617 - padding: 3px;
618 -}
619 -
620 -.new-snapspot ul {
621 - font-size: 12px;
622 - width: 100%;
623 -}
624 -
625 -.akismet-new-snapshot ul li {
626 - color: #999;
627 - float: left;
628 - font-size: 11px;
629 - padding: 0 20px;
630 - text-transform: uppercase;
631 - width: 33%;
632 - box-sizing: border-box;
633 - -moz-box-sizing: border-box;
634 - -webkit-box-sizing: border-box;
635 - -ms-box-sizing: border-box;
636 -}
637 -
638 -.akismet-new-snapshot ul li:first-child,
639 -.akismet-new-snapshot ul li:nth-child(2) {
640 - border-right:1px dotted #ccc;
641 -}
642 -
643 -.akismet-new-snapshot ul li span {
644 - color: #52accc;
645 - display: block;
646 - font-size: 32px;
647 - font-weight: lighter;
648 - line-height: 1.5em;
649 -}
650 -
651 -.akismet-settings th:first-child {
652 - vertical-align: top;
653 - padding-top: 15px;
654 -}
655 -
656 -.akismet-settings th.akismet-api-key {
657 - vertical-align: middle;
658 - padding-top: 0;
659 -}
660 -
661 -.akismet-settings input[type=text] {
662 - width: 75%;
663 -}
664 -
665 -.akismet-settings span.akismet-note{
666 - float: left;
667 - padding-left: 23px;
668 - font-size: 75%;
669 - margin-top: -10px;
670 -}
671 -
672 -/**
673 - * For the activation notice on the plugins page.
674 - */
675 -
676 -#akismet_setup_prompt {
677 - background: none;
678 - border: none;
679 - margin: 0;
680 - padding: 0;
681 - width: 100%;
682 -}
683 -
684 -.akismet_activate {
685 - border: 1px solid #4F800D;
686 - padding: 5px;
687 - margin: 15px 0;
688 - background: #83AF24;
689 - background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D));
690 - background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24);
691 - -moz-border-radius: 3px;
692 - border-radius: 3px;
693 - -webkit-border-radius: 3px;
694 - position: relative;
695 - overflow: hidden;
696 -}
697 -
698 -.akismet_activate .aa_a {
699 - position: absolute;
700 - top: -5px;
701 - right: 10px;
702 - font-size: 140px;
703 - color: #769F33;
704 - font-family: Georgia, "Times New Roman", Times, serif;
705 -}
706 -
707 -.akismet_activate .aa_button {
708 - font-weight: bold;
709 - border: 1px solid #029DD6;
710 - border-top: 1px solid #06B9FD;
711 - font-size: 15px;
712 - text-align: center;
713 - padding: 9px 0 8px 0;
714 - color: #FFF;
715 - background: #029DD6;
716 - background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
717 - background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
718 - -moz-border-radius: 2px;
719 - border-radius: 2px;
720 - -webkit-border-radius: 2px;
721 - width: 100%;
722 - cursor: pointer;
723 - margin: 0;
724 -}
725 -
726 -.akismet_activate .aa_button:hover {
727 - text-decoration: none !important;
728 - border: 1px solid #029DD6;
729 - border-bottom: 1px solid #00A8EF;
730 - font-size: 15px;
731 - text-align: center;
732 - padding: 9px 0 8px 0;
733 - color: #F0F8FB;
734 - background: #0079B1;
735 - background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF));
736 - background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1);
737 - -moz-border-radius: 2px;
738 - border-radius: 2px;
739 - -webkit-border-radius: 2px;
740 -}
741 -
742 -.akismet_activate .aa_button_border {
743 - border: 1px solid #006699;
744 - -moz-border-radius: 2px;
745 - border-radius: 2px;
746 - -webkit-border-radius: 2px;
747 - background: #029DD6;
748 - background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
749 - background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
750 -}
751 -
752 -.akismet_activate .aa_button_container {
753 - box-sizing: border-box;
754 - display: inline-block;
755 - background: #DEF1B8;
756 - padding: 5px;
757 - -moz-border-radius: 2px;
758 - border-radius: 2px;
759 - -webkit-border-radius: 2px;
760 - width: 266px;
761 -}
762 -
763 -.akismet_activate .aa_description {
764 - position: absolute;
765 - top: 22px;
766 - left: 285px;
767 - margin-left: 25px;
768 - color: #E5F2B1;
769 - font-size: 15px;
770 -}
771 -
772 -.akismet_activate .aa_description strong {
773 - color: #FFF;
774 - font-weight: normal;
775 -}
776 -
777 -@media (max-width: 550px) {
778 - .akismet_activate .aa_a {
779 - display: none;
780 - }
781 -
782 - .akismet_activate .aa_button_container {
783 - width: 100%;
784 - }
785 -}
786 -
787 -@media (max-width: 782px) {
788 - .akismet_activate {
789 - min-width: 0;
790 - }
791 -}
792 -
793 -@media (max-width: 850px) {
794 - #akismet_setup_prompt .aa_description {
795 - display: none;
796 - }
797 -
798 - .akismet_activate {
799 - min-width: 0;
800 - }
801 -}
802 -
803 -.jetpack_page_akismet-key-config #wpcontent, .settings_page_akismet-key-config #wpcontent {
804 - padding-left: 0;
805 -}
806 -
807 -.akismet-masthead {
808 - background-color:#fff;
809 - text-align:center;
810 - box-shadow:0 1px 0 rgba(200,215,225,0.5),0 1px 2px #e9eff3
811 -}
812 -@media (max-width: 45rem) {
813 - .akismet-masthead {
814 - padding:0 1.25rem
815 - }
816 -}
817 -
818 -.akismet-masthead__inside-container {
819 - padding:.375rem 0;
820 - margin:0 auto;
821 - width:100%;
822 - max-width:45rem;
823 - text-align: left;
824 -}
825 -.akismet-masthead__logo-container {
826 - padding:.3125rem 0 0
827 -}
828 -.akismet-masthead__logo {
829 - width:10.375rem;
830 - height:1.8125rem;
831 -}
832 -.akismet-masthead__logo-link {
833 - display:inline-block;
834 - outline:none;
835 - vertical-align:middle
836 -}
837 -.akismet-masthead__logo-link:focus {
838 - line-height:0;
839 - box-shadow:0 0 0 2px #78dcfa
840 -}
841 -.akismet-masthead__logo-link+code {
842 - margin:0 10px;
843 - padding:5px 9px;
844 - border-radius:2px;
845 - background:#e6ecf1;
846 - color:#647a88
847 -}
848 -.akismet-masthead__links {
849 - display:-ms-flexbox;
850 - display:flex;
851 - -ms-flex-flow:row wrap;
852 - flex-flow:row wrap;
853 - -ms-flex:2 50%;
854 - flex:2 50%;
855 - -ms-flex-pack:end;
856 - justify-content:flex-end;
857 - margin:0
858 -}
859 -@media (max-width: 480px) {
860 - .akismet-masthead__links {
861 - padding-right:.625rem
862 - }
863 -}
864 -.akismet-masthead__link-li {
865 - margin:0;
866 - padding:0
867 -}
868 -.akismet-masthead__link {
869 - font-style:normal;
870 - color:#0087be;
871 - padding:.625rem;
872 - display:inline-block
873 -}
874 -.akismet-masthead__link:visited {
875 - color:#0087be
876 -}
877 -.akismet-masthead__link:active,.akismet-masthead__link:hover {
878 - color:#00aadc
879 -}
880 -.akismet-masthead__link:hover {
881 - text-decoration:underline
882 -}
883 -.akismet-masthead__link .dashicons {
884 - display:none
885 -}
886 -@media (max-width: 480px) {
887 - .akismet-masthead__link:hover,.akismet-masthead__link:active {
888 - text-decoration:none
889 - }
890 - .akismet-masthead__link .dashicons {
891 - display:block;
892 - font-size:1.75rem
893 - }
894 - .akismet-masthead__link span+span {
895 - display:none
896 - }
897 -}
898 -.akismet-masthead__link-li:last-of-type .akismet-masthead__link {
899 - padding-right:0
900 -}
901 -
902 -.akismet-lower {
903 - margin: 0 auto;
904 - text-align: left;
905 - max-width: 45rem;
906 - padding: 1.5rem;
907 -}
908 -
909 -.akismet-lower .notice {
910 - margin-bottom: 2rem;
911 -}
912 -
913 -.akismet-card {
914 - margin-top: 1rem;
915 - margin-bottom: 0;
916 - position: relative;
917 - margin: 0 auto 0.625rem auto;
918 - box-sizing: border-box;
919 - background: white;
920 - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
921 -}
922 -
923 -.akismet-card:after, .akismet-card .inside:after, .akismet-masthead__logo-container:after {
924 - content: ".";
925 - display: block;
926 - height: 0;
927 - clear: both;
928 - visibility: hidden;
929 -}
930 -
931 -.akismet-card .inside {
932 - padding: 1.5rem;
933 - padding-top: 1rem;
934 -}
935 -
936 -.akismet-card .akismet-card-actions {
937 - margin-top: 1rem;
938 -}
939 -
940 -.jetpack_page_akismet-key-config .update-nag, .settings_page_akismet-key-config .update-nag {
941 - display: none;
942 -}
943 -
944 -.akismet-masthead .akismet-right {
945 - line-height: 2.125rem;
946 - font-size: 0.9rem;
947 -}
948 -
949 -.akismet-box {
950 - box-sizing: border-box;
951 - background: white;
952 - border: 1px solid rgba(200, 215, 225, 0.5);
953 -}
954 -
955 -.akismet-box h2, .akismet-box h3 {
956 - padding: 1.5rem 1.5rem .5rem 1.5rem;
957 - margin: 0;
958 -}
959 -
960 -.akismet-box p {
961 - padding: 0 1.5rem 1.5rem 1.5rem;
962 - margin: 0;
963 -}
964 -
965 -.akismet-jetpack-email {
966 - font-style: oblique;
967 -}
968 -
969 -.akismet-jetpack-gravatar {
970 - padding: 0 0 0 1.5rem;
971 - float: left;
972 - margin-right: 1rem;
973 - width: 54px;
974 - height: 54px;
975 -}
976 -
977 -.akismet-box p:after {
978 - content: ".";
979 - display: block;
980 - height: 0;
981 - clear: both;
982 - visibility: hidden;
983 -}
984 -
985 -.akismet-box .akismet-right {
986 - padding-right: 1.5rem;
987 -}
988 -
989 -.akismet-boxes .akismet-box {
990 - margin-bottom: 0;
991 - padding: 0;
992 - margin-top: -1px;
993 -}
994 -
995 -.akismet-boxes .akismet-box:last-child {
996 - margin-bottom: 1.5rem;
997 -}
998 -
999 -.akismet-boxes .akismet-box:first-child {
1000 - margin-top: 1.5rem;
1001 -}
1002 -
1003 -.akismet-button, .akismet-button:hover, .akismet-button:visited {
1004 - background: white;
1005 - border-color: #c8d7e1;
1006 - border-style: solid;
1007 - border-width: 1px 1px 2px;
1008 - color: #2e4453;
1009 - cursor: pointer;
1010 - display: inline-block;
1011 - margin: 0;
1012 - outline: 0;
1013 - overflow: hidden;
1014 - font-size: 14px;
1015 - font-weight: 500;
1016 - text-overflow: ellipsis;
1017 - text-decoration: none;
1018 - vertical-align: top;
1019 - box-sizing: border-box;
1020 - font-size: 14px;
1021 - line-height: 21px;
1022 - border-radius: 4px;
1023 - padding: 7px 14px 9px;
1024 - -webkit-appearance: none;
1025 - -moz-appearance: none;
1026 - appearance: none;
1027 -}
1028 -
1029 -.akismet-button:hover {
1030 - border-color: #a8bece;
1031 -}
1032 -
1033 -.akismet-button:active {
1034 - border-width: 2px 1px 1px;
1035 -}
1036 -
1037 -.akismet-is-primary, .akismet-is-primary:hover, .akismet-is-primary:visited {
1038 - background: #00aadc;
1039 - border-color: #0087be;
1040 - color: white;
1041 -}
1042 -
1043 -.akismet-is-primary:hover, .akismet-is-primary:focus {
1044 - border-color: #005082;
1045 -}
1046 -
1047 -.akismet-is-primary:hover {
1048 - border-color: #005082;
1049 -}
1050 -
1051 -.akismet-section-header {
1052 - position: relative;
1053 - margin: 0 auto 0.625rem auto;
1054 - padding: 1rem;
1055 - box-sizing: border-box;
1056 - box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
1057 - background: #ffffff;
1058 - width: 100%;
1059 - padding-top: 0.6875rem;
1060 - padding-bottom: 0.6875rem;
1061 - display: flex;
1062 -}
1063 -
1064 -.akismet-section-header__label {
1065 - display: -ms-flexbox;
1066 - display: flex;
1067 - -ms-flex-align: center;
1068 - align-items: center;
1069 - -ms-flex-positive: 1;
1070 - flex-grow: 1;
1071 - line-height: 1.75rem;
1072 - position: relative;
1073 - font-size: 0.875rem;
1074 - color: #4f748e;
1075 -}
1076 -
1077 -.akismet-section-header__actions {
1078 - line-height: 1.75rem;
1079 -}
1080
1081 diff --git a/plugins/akismet/_inc/akismet.js b/plugins/akismet/_inc/akismet.js
1082 deleted file mode 100644
1083 index 6cb85e6c..00000000
1084 --- a/plugins/akismet/_inc/akismet.js
1085 +++ /dev/null
1086 @@ -1,308 +0,0 @@
1087 -jQuery( function ( $ ) {
1088 - var mshotRemovalTimer = null;
1089 - var mshotSecondTryTimer = null
1090 - var mshotThirdTryTimer = null
1091 -
1092 - var mshotEnabledLinkSelector = 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, td.comment p a';
1093 -
1094 - $('.akismet-status').each(function () {
1095 - var thisId = $(this).attr('commentid');
1096 - $(this).prependTo('#comment-' + thisId + ' .column-comment');
1097 - });
1098 - $('.akismet-user-comment-count').each(function () {
1099 - var thisId = $(this).attr('commentid');
1100 - $(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
1101 - });
1102 -
1103 - akismet_enable_comment_author_url_removal();
1104 -
1105 - $( '#the-comment-list' ).on( 'click', '.akismet_remove_url', function () {
1106 - var thisId = $(this).attr('commentid');
1107 - var data = {
1108 - action: 'comment_author_deurl',
1109 - _wpnonce: WPAkismet.comment_author_url_nonce,
1110 - id: thisId
1111 - };
1112 - $.ajax({
1113 - url: ajaxurl,
1114 - type: 'POST',
1115 - data: data,
1116 - beforeSend: function () {
1117 - // Removes "x" link
1118 - $("a[commentid='"+ thisId +"']").hide();
1119 - // Show temp status
1120 - $("#author_comment_url_"+ thisId).html( $( '<span/>' ).text( WPAkismet.strings['Removing...'] ) );
1121 - },
1122 - success: function (response) {
1123 - if (response) {
1124 - // Show status/undo link
1125 - $("#author_comment_url_"+ thisId)
1126 - .attr('cid', thisId)
1127 - .addClass('akismet_undo_link_removal')
1128 - .html(
1129 - $( '<span/>' ).text( WPAkismet.strings['URL removed'] )
1130 - )
1131 - .append( ' ' )
1132 - .append(
1133 - $( '<span/>' )
1134 - .text( WPAkismet.strings['(undo)'] )
1135 - .addClass( 'akismet-span-link' )
1136 - );
1137 - }
1138 - }
1139 - });
1140 -
1141 - return false;
1142 - }).on( 'click', '.akismet_undo_link_removal', function () {
1143 - var thisId = $(this).attr('cid');
1144 - var thisUrl = $(this).attr('href');
1145 - var data = {
1146 - action: 'comment_author_reurl',
1147 - _wpnonce: WPAkismet.comment_author_url_nonce,
1148 - id: thisId,
1149 - url: thisUrl
1150 - };
1151 - $.ajax({
1152 - url: ajaxurl,
1153 - type: 'POST',
1154 - data: data,
1155 - beforeSend: function () {
1156 - // Show temp status
1157 - $("#author_comment_url_"+ thisId).html( $( '<span/>' ).text( WPAkismet.strings['Re-adding...'] ) );
1158 - },
1159 - success: function (response) {
1160 - if (response) {
1161 - // Add "x" link
1162 - $("a[commentid='"+ thisId +"']").show();
1163 - // Show link. Core strips leading http://, so let's do that too.
1164 - $("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').text( thisUrl.replace( /^http:\/\/(www\.)?/ig, '' ) );
1165 - }
1166 - }
1167 - });
1168 -
1169 - return false;
1170 - });
1171 -
1172 - // Show a preview image of the hovered URL. Applies to author URLs and URLs inside the comments.
1173 - $( '#the-comment-list' ).on( 'mouseover', mshotEnabledLinkSelector, function () {
1174 - clearTimeout( mshotRemovalTimer );
1175 -
1176 - if ( $( '.akismet-mshot' ).length > 0 ) {
1177 - if ( $( '.akismet-mshot:first' ).data( 'link' ) == this ) {
1178 - // The preview is already showing for this link.
1179 - return;
1180 - }
1181 - else {
1182 - // A new link is being hovered, so remove the old preview.
1183 - $( '.akismet-mshot' ).remove();
1184 - }
1185 - }
1186 -
1187 - clearTimeout( mshotSecondTryTimer );
1188 - clearTimeout( mshotThirdTryTimer );
1189 -
1190 - var thisHref = $( this ).attr( 'href' );
1191 -
1192 - var mShot = $( '<div class="akismet-mshot mshot-container"><div class="mshot-arrow"></div><img src="' + akismet_mshot_url( thisHref ) + '" width="450" height="338" class="mshot-image" /></div>' );
1193 - mShot.data( 'link', this );
1194 -
1195 - var offset = $( this ).offset();
1196 -
1197 - mShot.offset( {
1198 - left : Math.min( $( window ).width() - 475, offset.left + $( this ).width() + 10 ), // Keep it on the screen if the link is near the edge of the window.
1199 - top: offset.top + ( $( this ).height() / 2 ) - 101 // 101 = top offset of the arrow plus the top border thickness
1200 - } );
1201 -
1202 - // These retries appear to be superfluous if .mshot-image has already loaded, but it's because mShots
1203 - // can return a "Generating thumbnail..." image if it doesn't have a thumbnail ready, so we need
1204 - // to retry to see if we can get the newly generated thumbnail.
1205 - mshotSecondTryTimer = setTimeout( function () {
1206 - mShot.find( '.mshot-image' ).attr( 'src', akismet_mshot_url( thisHref, 2 ) );
1207 - }, 6000 );
1208 -
1209 - mshotThirdTryTimer = setTimeout( function () {
1210 - mShot.find( '.mshot-image' ).attr( 'src', akismet_mshot_url( thisHref, 3 ) );
1211 - }, 12000 );
1212 -
1213 - $( 'body' ).append( mShot );
1214 - } ).on( 'mouseout', 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, td.comment p a', function () {
1215 - mshotRemovalTimer = setTimeout( function () {
1216 - clearTimeout( mshotSecondTryTimer );
1217 - clearTimeout( mshotThirdTryTimer );
1218 -
1219 - $( '.akismet-mshot' ).remove();
1220 - }, 200 );
1221 - } ).on( 'mouseover', 'tr', function () {
1222 - // When the mouse hovers over a comment row, begin preloading mshots for any links in the comment or the comment author.
1223 - var linksToPreloadMshotsFor = $( this ).find( mshotEnabledLinkSelector );
1224 -
1225 - linksToPreloadMshotsFor.each( function () {
1226 - // Don't attempt to preload an mshot for a single link twice. Browser caching should cover this, but in case of
1227 - // race conditions, save a flag locally when we've begun trying to preload one.
1228 - if ( ! $( this ).data( 'akismet-mshot-preloaded' ) ) {
1229 - akismet_preload_mshot( $( this ).attr( 'href' ) );
1230 - $( this ).data( 'akismet-mshot-preloaded', true );
1231 - }
1232 - } );
1233 - } );
1234 -
1235 - $( '.checkforspam' ).click( function( e ) {
1236 - e.preventDefault();
1237 -
1238 - if ( $( this ).hasClass( 'button-disabled' ) ) {
1239 - window.location.href = $( this ).data( 'success-url' ).replace( '__recheck_count__', 0 ).replace( '__spam_count__', 0 );
1240 - return;
1241 - }
1242 -
1243 - $('.checkforspam').addClass('button-disabled').addClass( 'checking' );
1244 - $('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
1245 -
1246 - // Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
1247 - $( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
1248 -
1249 - akismet_check_for_spam(0, 100);
1250 - });
1251 -
1252 - var spam_count = 0;
1253 - var recheck_count = 0;
1254 -
1255 - function akismet_check_for_spam(offset, limit) {
1256 - var check_for_spam_buttons = $( '.checkforspam' );
1257 -
1258 - // We show the percentage complete down to one decimal point so even queues with 100k
1259 - // pending comments will show some progress pretty quickly.
1260 - var percentage_complete = Math.round( ( recheck_count / check_for_spam_buttons.data( 'pending-comment-count' ) ) * 1000 ) / 10;
1261 -
1262 - // Update the progress counter on the "Check for Spam" button.
1263 - $( '.checkforspam-progress' ).text( check_for_spam_buttons.data( 'progress-label-format' ).replace( '%1$s', percentage_complete ) );
1264 -
1265 - $.post(
1266 - ajaxurl,
1267 - {
1268 - 'action': 'akismet_recheck_queue',
1269 - 'offset': offset,
1270 - 'limit': limit
1271 - },
1272 - function(result) {
1273 - recheck_count += result.counts.processed;
1274 - spam_count += result.counts.spam;
1275 -
1276 - if (result.counts.processed < limit) {
1277 - window.location.href = check_for_spam_buttons.data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
1278 - }
1279 - else {
1280 - // Account for comments that were caught as spam and moved out of the queue.
1281 - akismet_check_for_spam(offset + limit - result.counts.spam, limit);
1282 - }
1283 - }
1284 - );
1285 - }
1286 -
1287 - if ( "start_recheck" in WPAkismet && WPAkismet.start_recheck ) {
1288 - $( '.checkforspam' ).click();
1289 - }
1290 -
1291 - if ( typeof MutationObserver !== 'undefined' ) {
1292 - // Dynamically add the "X" next the the author URL links when a comment is quick-edited.
1293 - var comment_list_container = document.getElementById( 'the-comment-list' );
1294 -
1295 - if ( comment_list_container ) {
1296 - var observer = new MutationObserver( function ( mutations ) {
1297 - for ( var i = 0, _len = mutations.length; i < _len; i++ ) {
1298 - if ( mutations[i].addedNodes.length > 0 ) {
1299 - akismet_enable_comment_author_url_removal();
1300 -
1301 - // Once we know that we'll have to check for new author links, skip the rest of the mutations.
1302 - break;
1303 - }
1304 - }
1305 - } );
1306 -
1307 - observer.observe( comment_list_container, { attributes: true, childList: true, characterData: true } );
1308 - }
1309 - }
1310 -
1311 - function akismet_enable_comment_author_url_removal() {
1312 - $( '#the-comment-list' )
1313 - .find( 'tr.comment, tr[id ^= "comment-"]' )
1314 - .find( '.column-author a[href^="http"]:first' ) // Ignore mailto: links, which would be the comment author's email.
1315 - .each(function () {
1316 - if ( $( this ).parent().find( '.akismet_remove_url' ).length > 0 ) {
1317 - return;
1318 - }
1319 -
1320 - var linkHref = $(this).attr( 'href' );
1321 -
1322 - // Ignore any links to the current domain, which are diagnostic tools, like the IP address link
1323 - // or any other links another plugin might add.
1324 - var currentHostParts = document.location.href.split( '/' );
1325 - var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/';
1326 -
1327 - if ( linkHref.indexOf( currentHost ) != 0 ) {
1328 - var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
1329 -
1330 - $(this)
1331 - .attr("id", "author_comment_url_"+ thisCommentId[1])
1332 - .after(
1333 - $( '<a href="#" class="akismet_remove_url">x</a>' )
1334 - .attr( 'commentid', thisCommentId[1] )
1335 - .attr( 'title', WPAkismet.strings['Remove this URL'] )
1336 - );
1337 - }
1338 - });
1339 - }
1340 -
1341 - /**
1342 - * Generate an mShot URL if given a link URL.
1343 - *
1344 - * @param string linkUrl
1345 - * @param int retry If retrying a request, the number of the retry.
1346 - * @return string The mShot URL;
1347 - */
1348 - function akismet_mshot_url( linkUrl, retry ) {
1349 - var mshotUrl = '//s0.wordpress.com/mshots/v1/' + encodeURIComponent( linkUrl ) + '?w=900';
1350 -
1351 - if ( retry ) {
1352 - mshotUrl += '&r=' + encodeURIComponent( retry );
1353 - }
1354 -
1355 - return mshotUrl;
1356 - }
1357 -
1358 - /**
1359 - * Begin loading an mShot preview of a link.
1360 - *
1361 - * @param string linkUrl
1362 - */
1363 - function akismet_preload_mshot( linkUrl ) {
1364 - var img = new Image();
1365 - img.src = akismet_mshot_url( linkUrl );
1366 - }
1367 -
1368 - /**
1369 - * Sets the comment form privacy notice display to hide when one clicks Core's dismiss button on the related admin notice.
1370 - */
1371 - $( '#akismet-privacy-notice-admin-notice' ).on( 'click', '.notice-dismiss', function(){
1372 - $.ajax({
1373 - url: './options-general.php?page=akismet-key-config&akismet_comment_form_privacy_notice=hide',
1374 - });
1375 - });
1376 -
1377 - $( ".akismet-could-be-primary" ).each( function () {
1378 - var form = $( this ).closest( 'form' );
1379 -
1380 - form.data( 'initial-state', form.serialize() );
1381 -
1382 - form.on( 'change keyup', function () {
1383 - var self = $( this );
1384 - var submit_button = self.find( ".akismet-could-be-primary" );
1385 -
1386 - if ( self.serialize() != self.data( 'initial-state' ) ) {
1387 - submit_button.addClass( "akismet-is-primary" );
1388 - }
1389 - else {
1390 - submit_button.removeClass( "akismet-is-primary" );
1391 - }
1392 - } );
1393 - } );
1394 -});
1395
1396 diff --git a/plugins/akismet/_inc/form.js b/plugins/akismet/_inc/form.js
1397 deleted file mode 100644
1398 index 3a5be8af..00000000
1399 --- a/plugins/akismet/_inc/form.js
1400 +++ /dev/null
1401 @@ -1,30 +0,0 @@
1402 -var ak_js = document.getElementById( "ak_js" );
1403 -
1404 -if ( ! ak_js ) {
1405 - ak_js = document.createElement( 'input' );
1406 - ak_js.setAttribute( 'id', 'ak_js' );
1407 - ak_js.setAttribute( 'name', 'ak_js' );
1408 - ak_js.setAttribute( 'type', 'hidden' );
1409 -}
1410 -else {
1411 - ak_js.parentNode.removeChild( ak_js );
1412 -}
1413 -
1414 -ak_js.setAttribute( 'value', ( new Date() ).getTime() );
1415 -
1416 -var commentForm = document.getElementById( 'commentform' );
1417 -
1418 -if ( commentForm ) {
1419 - commentForm.appendChild( ak_js );
1420 -}
1421 -else {
1422 - var replyRowContainer = document.getElementById( 'replyrow' );
1423 -
1424 - if ( replyRowContainer ) {
1425 - var children = replyRowContainer.getElementsByTagName( 'td' );
1426 -
1427 - if ( children.length > 0 ) {
1428 - children[0].appendChild( ak_js );
1429 - }
1430 - }
1431 -}
1432 \ No newline at end of file
1433
1434 diff --git a/plugins/akismet/_inc/img/logo-full-2x.png b/plugins/akismet/_inc/img/logo-full-2x.png
1435 deleted file mode 100644
1436 index 79545854..00000000
1437 Binary files a/plugins/akismet/_inc/img/logo-full-2x.png and /dev/null differ
1438
1439 diff --git a/plugins/akismet/akismet.php b/plugins/akismet/akismet.php
1440 deleted file mode 100644
1441 index 49608e5a..00000000
1442 --- a/plugins/akismet/akismet.php
1443 +++ /dev/null
1444 @@ -1,66 +0,0 @@
1445 -<?php
1446 -/**
1447 - * @package Akismet
1448 - */
1449 -/*
1450 -Plugin Name: Akismet Anti-Spam
1451 -Plugin URI: https://akismet.com/
1452 -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.
1453 -Version: 4.1.2
1454 -Author: Automattic
1455 -Author URI: https://automattic.com/wordpress-plugins/
1456 -License: GPLv2 or later
1457 -Text Domain: akismet
1458 -*/
1459 -
1460 -/*
1461 -This program is free software; you can redistribute it and/or
1462 -modify it under the terms of the GNU General Public License
1463 -as published by the Free Software Foundation; either version 2
1464 -of the License, or (at your option) any later version.
1465 -
1466 -This program is distributed in the hope that it will be useful,
1467 -but WITHOUT ANY WARRANTY; without even the implied warranty of
1468 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1469 -GNU General Public License for more details.
1470 -
1471 -You should have received a copy of the GNU General Public License
1472 -along with this program; if not, write to the Free Software
1473 -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1474 -
1475 -Copyright 2005-2015 Automattic, Inc.
1476 -*/
1477 -
1478 -// Make sure we don't expose any info if called directly
1479 -if ( !function_exists( 'add_action' ) ) {
1480 - echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
1481 - exit;
1482 -}
1483 -
1484 -define( 'AKISMET_VERSION', '4.1.2' );
1485 -define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );
1486 -define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
1487 -define( 'AKISMET_DELETE_LIMIT', 100000 );
1488 -
1489 -register_activation_hook( __FILE__, array( 'Akismet', 'plugin_activation' ) );
1490 -register_deactivation_hook( __FILE__, array( 'Akismet', 'plugin_deactivation' ) );
1491 -
1492 -require_once( AKISMET__PLUGIN_DIR . 'class.akismet.php' );
1493 -require_once( AKISMET__PLUGIN_DIR . 'class.akismet-widget.php' );
1494 -require_once( AKISMET__PLUGIN_DIR . 'class.akismet-rest-api.php' );
1495 -
1496 -add_action( 'init', array( 'Akismet', 'init' ) );
1497 -
1498 -add_action( 'rest_api_init', array( 'Akismet_REST_API', 'init' ) );
1499 -
1500 -if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
1501 - require_once( AKISMET__PLUGIN_DIR . 'class.akismet-admin.php' );
1502 - add_action( 'init', array( 'Akismet_Admin', 'init' ) );
1503 -}
1504 -
1505 -//add wrapper class around deprecated akismet functions that are referenced elsewhere
1506 -require_once( AKISMET__PLUGIN_DIR . 'wrapper.php' );
1507 -
1508 -if ( defined( 'WP_CLI' ) && WP_CLI ) {
1509 - require_once( AKISMET__PLUGIN_DIR . 'class.akismet-cli.php' );
1510 -}
1511
1512 diff --git a/plugins/akismet/class.akismet-admin.php b/plugins/akismet/class.akismet-admin.php
1513 deleted file mode 100644
1514 index f0766ebe..00000000
1515 --- a/plugins/akismet/class.akismet-admin.php
1516 +++ /dev/null
1517 @@ -1,1244 +0,0 @@
1518 -<?php
1519 -
1520 -class Akismet_Admin {
1521 - const NONCE = 'akismet-update-key';
1522 -
1523 - private static $initiated = false;
1524 - private static $notices = array();
1525 - private static $allowed = array(
1526 - 'a' => array(
1527 - 'href' => true,
1528 - 'title' => true,
1529 - ),
1530 - 'b' => array(),
1531 - 'code' => array(),
1532 - 'del' => array(
1533 - 'datetime' => true,
1534 - ),
1535 - 'em' => array(),
1536 - 'i' => array(),
1537 - 'q' => array(
1538 - 'cite' => true,
1539 - ),
1540 - 'strike' => array(),
1541 - 'strong' => array(),
1542 - );
1543 -
1544 - public static function init() {
1545 - if ( ! self::$initiated ) {
1546 - self::init_hooks();
1547 - }
1548 -
1549 - if ( isset( $_POST['action'] ) && $_POST['action'] == 'enter-key' ) {
1550 - self::enter_api_key();
1551 - }
1552 -
1553 - if ( ! empty( $_GET['akismet_comment_form_privacy_notice'] ) && empty( $_GET['settings-updated']) ) {
1554 - self::set_form_privacy_notice_option( $_GET['akismet_comment_form_privacy_notice'] );
1555 - }
1556 - }
1557 -
1558 - public static function init_hooks() {
1559 - // The standalone stats page was removed in 3.0 for an all-in-one config and stats page.
1560 - // Redirect any links that might have been bookmarked or in browser history.
1561 - if ( isset( $_GET['page'] ) && 'akismet-stats-display' == $_GET['page'] ) {
1562 - wp_safe_redirect( esc_url_raw( self::get_page_url( 'stats' ) ), 301 );
1563 - die;
1564 - }
1565 -
1566 - self::$initiated = true;
1567 -
1568 - add_action( 'admin_init', array( 'Akismet_Admin', 'admin_init' ) );
1569 - add_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); # Priority 5, so it's called before Jetpack's admin_menu.
1570 - add_action( 'admin_notices', array( 'Akismet_Admin', 'display_notice' ) );
1571 - add_action( 'admin_enqueue_scripts', array( 'Akismet_Admin', 'load_resources' ) );
1572 - add_action( 'activity_box_end', array( 'Akismet_Admin', 'dashboard_stats' ) );
1573 - add_action( 'rightnow_end', array( 'Akismet_Admin', 'rightnow_stats' ) );
1574 - add_action( 'manage_comments_nav', array( 'Akismet_Admin', 'check_for_spam_button' ) );
1575 - add_action( 'admin_action_akismet_recheck_queue', array( 'Akismet_Admin', 'recheck_queue' ) );
1576 - add_action( 'wp_ajax_akismet_recheck_queue', array( 'Akismet_Admin', 'recheck_queue' ) );
1577 - add_action( 'wp_ajax_comment_author_deurl', array( 'Akismet_Admin', 'remove_comment_author_url' ) );
1578 - add_action( 'wp_ajax_comment_author_reurl', array( 'Akismet_Admin', 'add_comment_author_url' ) );
1579 - add_action( 'jetpack_auto_activate_akismet', array( 'Akismet_Admin', 'connect_jetpack_user' ) );
1580 -
1581 - add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
1582 - add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
1583 -
1584 - add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
1585 -
1586 - add_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 );
1587 -
1588 - add_filter( 'all_plugins', array( 'Akismet_Admin', 'modify_plugin_description' ) );
1589 -
1590 - if ( class_exists( 'Jetpack' ) ) {
1591 - add_filter( 'akismet_comment_form_privacy_notice_url_display', array( 'Akismet_Admin', 'jetpack_comment_form_privacy_notice_url' ) );
1592 - add_filter( 'akismet_comment_form_privacy_notice_url_hide', array( 'Akismet_Admin', 'jetpack_comment_form_privacy_notice_url' ) );
1593 - }
1594 -
1595 - // priority=1 because we need ours to run before core's comment anonymizer runs, and that's registered at priority=10
1596 - add_filter( 'wp_privacy_personal_data_erasers', array( 'Akismet_Admin', 'register_personal_data_eraser' ), 1 );
1597 - }
1598 -
1599 - public static function admin_init() {
1600 - load_plugin_textdomain( 'akismet' );
1601 - add_meta_box( 'akismet-status', __('Comment History', 'akismet'), array( 'Akismet_Admin', 'comment_status_meta_box' ), 'comment', 'normal' );
1602 -
1603 - if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
1604 - wp_add_privacy_policy_content(
1605 - __( 'Akismet', 'akismet' ),
1606 - __( 'We collect information about visitors who comment on Sites that use our Akismet anti-spam service. The information we collect depends on how the User sets up Akismet for the Site, but typically includes the commenter\'s IP address, user agent, referrer, and Site URL (along with other information directly provided by the commenter such as their name, username, email address, and the comment itself).', 'akismet' )
1607 - );
1608 - }
1609 - }
1610 -
1611 - public static function admin_menu() {
1612 - if ( class_exists( 'Jetpack' ) )
1613 - add_action( 'jetpack_admin_menu', array( 'Akismet_Admin', 'load_menu' ) );
1614 - else
1615 - self::load_menu();
1616 - }
1617 -
1618 - public static function admin_head() {
1619 - if ( !current_user_can( 'manage_options' ) )
1620 - return;
1621 - }
1622 -
1623 - public static function admin_plugin_settings_link( $links ) {
1624 - $settings_link = '<a href="'.esc_url( self::get_page_url() ).'">'.__('Settings', 'akismet').'</a>';
1625 - array_unshift( $links, $settings_link );
1626 - return $links;
1627 - }
1628 -
1629 - public static function load_menu() {
1630 - if ( class_exists( 'Jetpack' ) ) {
1631 - $hook = add_submenu_page( 'jetpack', __( 'Akismet Anti-Spam' , 'akismet'), __( 'Akismet Anti-Spam' , 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
1632 - }
1633 - else {
1634 - $hook = add_options_page( __('Akismet Anti-Spam', 'akismet'), __('Akismet Anti-Spam', 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) );
1635 - }
1636 -
1637 - if ( $hook ) {
1638 - add_action( "load-$hook", array( 'Akismet_Admin', 'admin_help' ) );
1639 - }
1640 - }
1641 -
1642 - public static function load_resources() {
1643 - global $hook_suffix;
1644 -
1645 - if ( in_array( $hook_suffix, apply_filters( 'akismet_admin_page_hook_suffixes', array(
1646 - 'index.php', # dashboard
1647 - 'edit-comments.php',
1648 - 'comment.php',
1649 - 'post.php',
1650 - 'settings_page_akismet-key-config',
1651 - 'jetpack_page_akismet-key-config',
1652 - 'plugins.php',
1653 - ) ) ) ) {
1654 - wp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION );
1655 - wp_enqueue_style( 'akismet.css');
1656 -
1657 - wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery'), AKISMET_VERSION );
1658 - wp_enqueue_script( 'akismet.js' );
1659 -
1660 - $inline_js = array(
1661 - 'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ),
1662 - 'strings' => array(
1663 - 'Remove this URL' => __( 'Remove this URL' , 'akismet'),
1664 - 'Removing...' => __( 'Removing...' , 'akismet'),
1665 - 'URL removed' => __( 'URL removed' , 'akismet'),
1666 - '(undo)' => __( '(undo)' , 'akismet'),
1667 - 'Re-adding...' => __( 'Re-adding...' , 'akismet'),
1668 - )
1669 - );
1670 -
1671 - if ( isset( $_GET['akismet_recheck'] ) && wp_verify_nonce( $_GET['akismet_recheck'], 'akismet_recheck' ) ) {
1672 - $inline_js['start_recheck'] = true;
1673 - }
1674 -
1675 - wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js );
1676 - }
1677 - }
1678 -
1679 - /**
1680 - * Add help to the Akismet page
1681 - *
1682 - * @return false if not the Akismet page
1683 - */
1684 - public static function admin_help() {
1685 - $current_screen = get_current_screen();
1686 -
1687 - // Screen Content
1688 - if ( current_user_can( 'manage_options' ) ) {
1689 - if ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) ) {
1690 - //setup page
1691 - $current_screen->add_help_tab(
1692 - array(
1693 - 'id' => 'overview',
1694 - 'title' => __( 'Overview' , 'akismet'),
1695 - 'content' =>
1696 - '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
1697 - '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
1698 - '<p>' . esc_html__( 'On this page, you are able to set up the Akismet plugin.' , 'akismet') . '</p>',
1699 - )
1700 - );
1701 -
1702 - $current_screen->add_help_tab(
1703 - array(
1704 - 'id' => 'setup-signup',
1705 - 'title' => __( 'New to Akismet' , 'akismet'),
1706 - 'content' =>
1707 - '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
1708 - '<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '</p>' .
1709 - '<p>' . sprintf( __( 'Sign up for an account on %s to get an API Key.' , 'akismet'), '<a href="https://akismet.com/plugin-signup/" target="_blank">Akismet.com</a>' ) . '</p>',
1710 - )
1711 - );
1712 -
1713 - $current_screen->add_help_tab(
1714 - array(
1715 - 'id' => 'setup-manual',
1716 - 'title' => __( 'Enter an API Key' , 'akismet'),
1717 - 'content' =>
1718 - '<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
1719 - '<p>' . esc_html__( 'If you already have an API key' , 'akismet') . '</p>' .
1720 - '<ol>' .
1721 - '<li>' . esc_html__( 'Copy and paste the API key into the text field.' , 'akismet') . '</li>' .
1722 - '<li>' . esc_html__( 'Click the Use this Key button.' , 'akismet') . '</li>' .
1723 - '</ol>',
1724 - )
1725 - );
1726 - }
1727 - elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' ) {
1728 - //stats page
1729 - $current_screen->add_help_tab(
1730 - array(
1731 - 'id' => 'overview',
1732 - 'title' => __( 'Overview' , 'akismet'),
1733 - 'content' =>
1734 - '<p><strong>' . esc_html__( 'Akismet Stats' , 'akismet') . '</strong></p>' .
1735 - '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
1736 - '<p>' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '</p>',
1737 - )
1738 - );
1739 - }
1740 - else {
1741 - //configuration page
1742 - $current_screen->add_help_tab(
1743 - array(
1744 - 'id' => 'overview',
1745 - 'title' => __( 'Overview' , 'akismet'),
1746 - 'content' =>
1747 - '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
1748 - '<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
1749 - '<p>' . esc_html__( 'On this page, you are able to update your Akismet settings and view spam stats.' , 'akismet') . '</p>',
1750 - )
1751 - );
1752 -
1753 - $current_screen->add_help_tab(
1754 - array(
1755 - 'id' => 'settings',
1756 - 'title' => __( 'Settings' , 'akismet'),
1757 - 'content' =>
1758 - '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
1759 - ( Akismet::predefined_api_key() ? '' : '<p><strong>' . esc_html__( 'API Key' , 'akismet') . '</strong> - ' . esc_html__( 'Enter/remove an API key.' , 'akismet') . '</p>' ) .
1760 - '<p><strong>' . esc_html__( 'Comments' , 'akismet') . '</strong> - ' . esc_html__( 'Show the number of approved comments beside each comment author in the comments list page.' , 'akismet') . '</p>' .
1761 - '<p><strong>' . esc_html__( 'Strictness' , 'akismet') . '</strong> - ' . esc_html__( 'Choose to either discard the worst spam automatically or to always put all spam in spam folder.' , 'akismet') . '</p>',
1762 - )
1763 - );
1764 -
1765 - if ( ! Akismet::predefined_api_key() ) {
1766 - $current_screen->add_help_tab(
1767 - array(
1768 - 'id' => 'account',
1769 - 'title' => __( 'Account' , 'akismet'),
1770 - 'content' =>
1771 - '<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
1772 - '<p><strong>' . esc_html__( 'Subscription Type' , 'akismet') . '</strong> - ' . esc_html__( 'The Akismet subscription plan' , 'akismet') . '</p>' .
1773 - '<p><strong>' . esc_html__( 'Status' , 'akismet') . '</strong> - ' . esc_html__( 'The subscription status - active, cancelled or suspended' , 'akismet') . '</p>',
1774 - )
1775 - );
1776 - }
1777 - }
1778 - }
1779 -
1780 - // Help Sidebar
1781 - $current_screen->set_help_sidebar(
1782 - '<p><strong>' . esc_html__( 'For more information:' , 'akismet') . '</strong></p>' .
1783 - '<p><a href="https://akismet.com/faq/" target="_blank">' . esc_html__( 'Akismet FAQ' , 'akismet') . '</a></p>' .
1784 - '<p><a href="https://akismet.com/support/" target="_blank">' . esc_html__( 'Akismet Support' , 'akismet') . '</a></p>'
1785 - );
1786 - }
1787 -
1788 - public static function enter_api_key() {
1789 - if ( ! current_user_can( 'manage_options' ) ) {
1790 - die( __( 'Cheatin&#8217; uh?', 'akismet' ) );
1791 - }
1792 -
1793 - if ( !wp_verify_nonce( $_POST['_wpnonce'], self::NONCE ) )
1794 - return false;
1795 -
1796 - foreach( array( 'akismet_strictness', 'akismet_show_user_comments_approved' ) as $option ) {
1797 - update_option( $option, isset( $_POST[$option] ) && (int) $_POST[$option] == 1 ? '1' : '0' );
1798 - }
1799 -
1800 - if ( ! empty( $_POST['akismet_comment_form_privacy_notice'] ) ) {
1801 - self::set_form_privacy_notice_option( $_POST['akismet_comment_form_privacy_notice'] );
1802 - } else {
1803 - self::set_form_privacy_notice_option( 'hide' );
1804 - }
1805 -
1806 - if ( Akismet::predefined_api_key() ) {
1807 - return false; //shouldn't have option to save key if already defined
1808 - }
1809 -
1810 - $new_key = preg_replace( '/[^a-f0-9]/i', '', $_POST['key'] );
1811 - $old_key = Akismet::get_api_key();
1812 -
1813 - if ( empty( $new_key ) ) {
1814 - if ( !empty( $old_key ) ) {
1815 - delete_option( 'wordpress_api_key' );
1816 - self::$notices[] = 'new-key-empty';
1817 - }
1818 - }
1819 - elseif ( $new_key != $old_key ) {
1820 - self::save_key( $new_key );
1821 - }
1822 -
1823 - return true;
1824 - }
1825 -
1826 - public static function save_key( $api_key ) {
1827 - $key_status = Akismet::verify_key( $api_key );
1828 -
1829 - if ( $key_status == 'valid' ) {
1830 - $akismet_user = self::get_akismet_user( $api_key );
1831 -
1832 - if ( $akismet_user ) {
1833 - if ( in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ) )
1834 - update_option( 'wordpress_api_key', $api_key );
1835 -
1836 - if ( $akismet_user->status == 'active' )
1837 - self::$notices['status'] = 'new-key-valid';
1838 - elseif ( $akismet_user->status == 'notice' )
1839 - self::$notices['status'] = $akismet_user;
1840 - else
1841 - self::$notices['status'] = $akismet_user->status;
1842 - }
1843 - else
1844 - self::$notices['status'] = 'new-key-invalid';
1845 - }
1846 - elseif ( in_array( $key_status, array( 'invalid', 'failed' ) ) )
1847 - self::$notices['status'] = 'new-key-'.$key_status;
1848 - }
1849 -
1850 - public static function dashboard_stats() {
1851 - if ( did_action( 'rightnow_end' ) ) {
1852 - return; // We already displayed this info in the "Right Now" section
1853 - }
1854 -
1855 - if ( !$count = get_option('akismet_spam_count') )
1856 - return;
1857 -
1858 - global $submenu;
1859 -
1860 - echo '<h3>' . esc_html( _x( 'Spam', 'comments' , 'akismet') ) . '</h3>';
1861 -
1862 - echo '<p>'.sprintf( _n(
1863 - '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comment</a>.',
1864 - '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.',
1865 - $count
1866 - , 'akismet'), 'https://akismet.com/wordpress/', esc_url( add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( isset( $submenu['edit-comments.php'] ) ? 'edit-comments.php' : 'edit.php' ) ) ), number_format_i18n($count) ).'</p>';
1867 - }
1868 -
1869 - // WP 2.5+
1870 - public static function rightnow_stats() {
1871 - if ( $count = get_option('akismet_spam_count') ) {
1872 - $intro = sprintf( _n(
1873 - '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
1874 - '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
1875 - $count
1876 - , 'akismet'), 'https://akismet.com/wordpress/', number_format_i18n( $count ) );
1877 - } else {
1878 - $intro = sprintf( __('<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' );
1879 - }
1880 -
1881 - $link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );
1882 -
1883 - if ( $queue_count = self::get_spam_count() ) {
1884 - $queue_text = sprintf( _n(
1885 - 'There&#8217;s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
1886 - 'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
1887 - $queue_count
1888 - , 'akismet'), number_format_i18n( $queue_count ), esc_url( $link ) );
1889 - } else {
1890 - $queue_text = sprintf( __( "There&#8217;s nothing in your <a href='%s'>spam queue</a> at the moment." , 'akismet'), esc_url( $link ) );
1891 - }
1892 -
1893 - $text = $intro . '<br />' . $queue_text;
1894 - echo "<p class='akismet-right-now'>$text</p>\n";
1895 - }
1896 -
1897 - public static function check_for_spam_button( $comment_status ) {
1898 - // The "Check for Spam" button should only appear when the page might be showing
1899 - // a comment with comment_approved=0, which means an un-trashed, un-spammed,
1900 - // not-yet-moderated comment.
1901 - if ( 'all' != $comment_status && 'moderated' != $comment_status ) {
1902 - return;
1903 - }
1904 -
1905 - $link = add_query_arg( array( 'action' => 'akismet_recheck_queue' ), admin_url( 'admin.php' ) );
1906 -
1907 - $comments_count = wp_count_comments();
1908 -
1909 - echo '</div>';
1910 - echo '<div class="alignleft actions">';
1911 - echo '<a
1912 - class="button-secondary checkforspam' . ( $comments_count->moderated == 0 ? ' button-disabled' : '' ) . '"
1913 - href="' . esc_url( $link ) . '"
1914 - data-active-label="' . esc_attr( __( 'Checking for Spam', 'akismet' ) ) . '"
1915 - data-progress-label-format="' . esc_attr( __( '(%1$s%)', 'akismet' ) ) . '"
1916 - 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__' ) ) ) ) ) . '"
1917 - data-pending-comment-count="' . esc_attr( $comments_count->moderated ) . '"
1918 - >';
1919 - echo '<span class="akismet-label">' . esc_html__('Check for Spam', 'akismet') . '</span>';
1920 - echo '<span class="checkforspam-progress"></span>';
1921 - echo '</a>';
1922 - echo '<span class="checkforspam-spinner"></span>';
1923 -
1924 - }
1925 -
1926 - public static function recheck_queue() {
1927 - global $wpdb;
1928 -
1929 - Akismet::fix_scheduled_recheck();
1930 -
1931 - if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) ) {
1932 - return;
1933 - }
1934 -
1935 - $result_counts = self::recheck_queue_portion( empty( $_POST['offset'] ) ? 0 : $_POST['offset'], empty( $_POST['limit'] ) ? 100 : $_POST['limit'] );
1936 -
1937 - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1938 - wp_send_json( array(
1939 - 'counts' => $result_counts,
1940 - ));
1941 - }
1942 - else {
1943 - $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url( 'edit-comments.php' );
1944 - wp_safe_redirect( $redirect_to );
1945 - exit;
1946 - }
1947 - }
1948 -
1949 - public static function recheck_queue_portion( $start = 0, $limit = 100 ) {
1950 - global $wpdb;
1951 -
1952 - $paginate = '';
1953 -
1954 - if ( $limit <= 0 ) {
1955 - $limit = 100;
1956 - }
1957 -
1958 - if ( $start < 0 ) {
1959 - $start = 0;
1960 - }
1961 -
1962 - $moderation = $wpdb->get_col( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT %d OFFSET %d", $limit, $start ) );
1963 -
1964 - $result_counts = array(
1965 - 'processed' => count( $moderation ),
1966 - 'spam' => 0,
1967 - 'ham' => 0,
1968 - 'error' => 0,
1969 - );
1970 -
1971 - foreach ( $moderation as $comment_id ) {
1972 - $api_response = Akismet::recheck_comment( $comment_id, 'recheck_queue' );
1973 -
1974 - if ( 'true' === $api_response ) {
1975 - ++$result_counts['spam'];
1976 - }
1977 - elseif ( 'false' === $api_response ) {
1978 - ++$result_counts['ham'];
1979 - }
1980 - else {
1981 - ++$result_counts['error'];
1982 - }
1983 - }
1984 -
1985 - return $result_counts;
1986 - }
1987 -
1988 - // Adds an 'x' link next to author URLs, clicking will remove the author URL and show an undo link
1989 - public static function remove_comment_author_url() {
1990 - if ( !empty( $_POST['id'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) {
1991 - $comment_id = intval( $_POST['id'] );
1992 - $comment = get_comment( $comment_id, ARRAY_A );
1993 - if ( $comment && current_user_can( 'edit_comment', $comment['comment_ID'] ) ) {
1994 - $comment['comment_author_url'] = '';
1995 - do_action( 'comment_remove_author_url' );
1996 - print( wp_update_comment( $comment ) );
1997 - die();
1998 - }
1999 - }
2000 - }
2001 -
2002 - public static function add_comment_author_url() {
2003 - if ( !empty( $_POST['id'] ) && !empty( $_POST['url'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) {
2004 - $comment_id = intval( $_POST['id'] );
2005 - $comment = get_comment( $comment_id, ARRAY_A );
2006 - if ( $comment && current_user_can( 'edit_comment', $comment['comment_ID'] ) ) {
2007 - $comment['comment_author_url'] = esc_url( $_POST['url'] );
2008 - do_action( 'comment_add_author_url' );
2009 - print( wp_update_comment( $comment ) );
2010 - die();
2011 - }
2012 - }
2013 - }
2014 -
2015 - public static function comment_row_action( $a, $comment ) {
2016 - $akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
2017 - $akismet_error = get_comment_meta( $comment->comment_ID, 'akismet_error', true );
2018 - $user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
2019 - $comment_status = wp_get_comment_status( $comment->comment_ID );
2020 - $desc = null;
2021 - if ( $akismet_error ) {
2022 - $desc = __( 'Awaiting spam check' , 'akismet');
2023 - } elseif ( !$user_result || $user_result == $akismet_result ) {
2024 - // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same
2025 - if ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' )
2026 - $desc = __( 'Flagged as spam by Akismet' , 'akismet');
2027 - elseif ( $akismet_result == 'false' && $comment_status == 'spam' )
2028 - $desc = __( 'Cleared by Akismet' , 'akismet');
2029 - } else {
2030 - $who = get_comment_meta( $comment->comment_ID, 'akismet_user', true );
2031 - if ( $user_result == 'true' )
2032 - $desc = sprintf( __('Flagged as spam by %s', 'akismet'), $who );
2033 - else
2034 - $desc = sprintf( __('Un-spammed by %s', 'akismet'), $who );
2035 - }
2036 -
2037 - // add a History item to the hover links, just after Edit
2038 - if ( $akismet_result ) {
2039 - $b = array();
2040 - foreach ( $a as $k => $item ) {
2041 - $b[ $k ] = $item;
2042 - if (
2043 - $k == 'edit'
2044 - || $k == 'unspam'
2045 - ) {
2046 - $b['history'] = '<a href="comment.php?action=editcomment&amp;c='.$comment->comment_ID.'#akismet-status" title="'. esc_attr__( 'View comment history' , 'akismet') . '"> '. esc_html__('History', 'akismet') . '</a>';
2047 - }
2048 - }
2049 -
2050 - $a = $b;
2051 - }
2052 -
2053 - if ( $desc )
2054 - 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>';
2055 -
2056 - $show_user_comments_option = get_option( 'akismet_show_user_comments_approved' );
2057 -
2058 - if ( $show_user_comments_option === false ) {
2059 - // Default to active if the user hasn't made a decision.
2060 - $show_user_comments_option = '1';
2061 - }
2062 -
2063 - $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', $show_user_comments_option );
2064 - $show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true'
2065 -
2066 - if ( $show_user_comments ) {
2067 - $comment_count = Akismet::get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
2068 - $comment_count = intval( $comment_count );
2069 - echo '<span class="akismet-user-comment-count" commentid="'.$comment->comment_ID.'" style="display:none;"><br><span class="akismet-user-comment-counts">'. sprintf( esc_html( _n( '%s approved', '%s approved', $comment_count , 'akismet') ), number_format_i18n( $comment_count ) ) . '</span></span>';
2070 - }
2071 -
2072 - return $a;
2073 - }
2074 -
2075 - public static function comment_status_meta_box( $comment ) {
2076 - $history = Akismet::get_comment_history( $comment->comment_ID );
2077 -
2078 - if ( $history ) {
2079 - echo '<div class="akismet-history" style="margin: 13px;">';
2080 -
2081 - foreach ( $history as $row ) {
2082 - $time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
2083 -
2084 - $message = '';
2085 -
2086 - if ( ! empty( $row['message'] ) ) {
2087 - // Old versions of Akismet stored the message as a literal string in the commentmeta.
2088 - // New versions don't do that for two reasons:
2089 - // 1) Save space.
2090 - // 2) The message can be translated into the current language of the blog, not stuck
2091 - // in the language of the blog when the comment was made.
2092 - $message = $row['message'];
2093 - }
2094 -
2095 - // If possible, use a current translation.
2096 - switch ( $row['event'] ) {
2097 - case 'recheck-spam';
2098 - $message = __( 'Akismet re-checked and caught this comment as spam.', 'akismet' );
2099 - break;
2100 - case 'check-spam':
2101 - $message = __( 'Akismet caught this comment as spam.', 'akismet' );
2102 - break;
2103 - case 'recheck-ham':
2104 - $message = __( 'Akismet re-checked and cleared this comment.', 'akismet' );
2105 - break;
2106 - case 'check-ham':
2107 - $message = __( 'Akismet cleared this comment.', 'akismet' );
2108 - break;
2109 - case 'wp-blacklisted':
2110 - $message = __( 'Comment was caught by wp_blacklist_check.', 'akismet' );
2111 - break;
2112 - case 'report-spam':
2113 - if ( isset( $row['user'] ) ) {
2114 - $message = sprintf( __( '%s reported this comment as spam.', 'akismet' ), $row['user'] );
2115 - }
2116 - else if ( ! $message ) {
2117 - $message = __( 'This comment was reported as spam.', 'akismet' );
2118 - }
2119 - break;
2120 - case 'report-ham':
2121 - if ( isset( $row['user'] ) ) {
2122 - $message = sprintf( __( '%s reported this comment as not spam.', 'akismet' ), $row['user'] );
2123 - }
2124 - else if ( ! $message ) {
2125 - $message = __( 'This comment was reported as not spam.', 'akismet' );
2126 - }
2127 - break;
2128 - case 'cron-retry-spam':
2129 - $message = __( 'Akismet caught this comment as spam during an automatic retry.' , 'akismet');
2130 - break;
2131 - case 'cron-retry-ham':
2132 - $message = __( 'Akismet cleared this comment during an automatic retry.', 'akismet');
2133 - break;
2134 - case 'check-error':
2135 - if ( isset( $row['meta'], $row['meta']['response'] ) ) {
2136 - $message = sprintf( __( 'Akismet was unable to check this comment (response: %s) but will automatically retry later.', 'akismet'), $row['meta']['response'] );
2137 - }
2138 - break;
2139 - case 'recheck-error':
2140 - if ( isset( $row['meta'], $row['meta']['response'] ) ) {
2141 - $message = sprintf( __( 'Akismet was unable to recheck this comment (response: %s).', 'akismet'), $row['meta']['response'] );
2142 - }
2143 - break;
2144 - default:
2145 - if ( preg_match( '/^status-changed/', $row['event'] ) ) {
2146 - // Half of these used to be saved without the dash after 'status-changed'.
2147 - // See https://plugins.trac.wordpress.org/changeset/1150658/akismet/trunk
2148 - $new_status = preg_replace( '/^status-changed-?/', '', $row['event'] );
2149 - $message = sprintf( __( 'Comment status was changed to %s', 'akismet' ), $new_status );
2150 - }
2151 - else if ( preg_match( '/^status-/', $row['event'] ) ) {
2152 - $new_status = preg_replace( '/^status-/', '', $row['event'] );
2153 -
2154 - if ( isset( $row['user'] ) ) {
2155 - $message = sprintf( __( '%1$s changed the comment status to %2$s.', 'akismet' ), $row['user'], $new_status );
2156 - }
2157 - }
2158 - break;
2159 -
2160 - }
2161 -
2162 - echo '<div style="margin-bottom: 13px;">';
2163 - echo '<span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( esc_html__('%s ago', 'akismet'), human_time_diff( $row['time'] ) ) . '</span>';
2164 - echo ' - ';
2165 - echo esc_html( $message );
2166 - echo '</div>';
2167 - }
2168 -
2169 - echo '</div>';
2170 - }
2171 - }
2172 -
2173 - public static function plugin_action_links( $links, $file ) {
2174 - if ( $file == plugin_basename( plugin_dir_url( __FILE__ ) . '/akismet.php' ) ) {
2175 - $links[] = '<a href="' . esc_url( self::get_page_url() ) . '">'.esc_html__( 'Settings' , 'akismet').'</a>';
2176 - }
2177 -
2178 - return $links;
2179 - }
2180 -
2181 - // Total spam in queue
2182 - // get_option( 'akismet_spam_count' ) is the total caught ever
2183 - public static function get_spam_count( $type = false ) {
2184 - global $wpdb;
2185 -
2186 - if ( !$type ) { // total
2187 - $count = wp_cache_get( 'akismet_spam_count', 'widget' );
2188 - if ( false === $count ) {
2189 - $count = wp_count_comments();
2190 - $count = $count->spam;
2191 - wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );
2192 - }
2193 - return $count;
2194 - } elseif ( 'comments' == $type || 'comment' == $type ) { // comments
2195 - $type = '';
2196 - }
2197 -
2198 - return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE comment_approved = 'spam' AND comment_type = %s", $type ) );
2199 - }
2200 -
2201 - // Check connectivity between the WordPress blog and Akismet's servers.
2202 - // Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).
2203 - public static function check_server_ip_connectivity() {
2204 -
2205 - $servers = $ips = array();
2206 -
2207 - // Some web hosts may disable this function
2208 - if ( function_exists('gethostbynamel') ) {
2209 -
2210 - $ips = gethostbynamel( 'rest.akismet.com' );
2211 - if ( $ips && is_array($ips) && count($ips) ) {
2212 - $api_key = Akismet::get_api_key();
2213 -
2214 - foreach ( $ips as $ip ) {
2215 - $response = Akismet::verify_key( $api_key, $ip );
2216 - // even if the key is invalid, at least we know we have connectivity
2217 - if ( $response == 'valid' || $response == 'invalid' )
2218 - $servers[$ip] = 'connected';
2219 - else
2220 - $servers[$ip] = $response ? $response : 'unable to connect';
2221 - }
2222 - }
2223 - }
2224 -
2225 - return $servers;
2226 - }
2227 -
2228 - // Simpler connectivity check
2229 - public static function check_server_connectivity($cache_timeout = 86400) {
2230 -
2231 - $debug = array();
2232 - $debug[ 'PHP_VERSION' ] = PHP_VERSION;
2233 - $debug[ 'WORDPRESS_VERSION' ] = $GLOBALS['wp_version'];
2234 - $debug[ 'AKISMET_VERSION' ] = AKISMET_VERSION;
2235 - $debug[ 'AKISMET__PLUGIN_DIR' ] = AKISMET__PLUGIN_DIR;
2236 - $debug[ 'SITE_URL' ] = site_url();
2237 - $debug[ 'HOME_URL' ] = home_url();
2238 -
2239 - $servers = get_option('akismet_available_servers');
2240 - if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false ) {
2241 - $servers = self::check_server_ip_connectivity();
2242 - update_option('akismet_available_servers', $servers);
2243 - update_option('akismet_connectivity_time', time());
2244 - }
2245 -
2246 - if ( wp_http_supports( array( 'ssl' ) ) ) {
2247 - $response = wp_remote_get( 'https://rest.akismet.com/1.1/test' );
2248 - }
2249 - else {
2250 - $response = wp_remote_get( 'http://rest.akismet.com/1.1/test' );
2251 - }
2252 -
2253 - $debug[ 'gethostbynamel' ] = function_exists('gethostbynamel') ? 'exists' : 'not here';
2254 - $debug[ 'Servers' ] = $servers;
2255 - $debug[ 'Test Connection' ] = $response;
2256 -
2257 - Akismet::log( $debug );
2258 -
2259 - if ( $response && 'connected' == wp_remote_retrieve_body( $response ) )
2260 - return true;
2261 -
2262 - return false;
2263 - }
2264 -
2265 - // Check the server connectivity and store the available servers in an option.
2266 - public static function get_server_connectivity($cache_timeout = 86400) {
2267 - return self::check_server_connectivity( $cache_timeout );
2268 - }
2269 -
2270 - /**
2271 - * Find out whether any comments in the Pending queue have not yet been checked by Akismet.
2272 - *
2273 - * @return bool
2274 - */
2275 - public static function are_any_comments_waiting_to_be_checked() {
2276 - return !! get_comments( array(
2277 - // Exclude comments that are not pending. This would happen if someone manually approved or spammed a comment
2278 - // that was waiting to be checked. The akismet_error meta entry will eventually be removed by the cron recheck job.
2279 - 'status' => 'hold',
2280 -
2281 - // This is the commentmeta that is saved when a comment couldn't be checked.
2282 - 'meta_key' => 'akismet_error',
2283 -
2284 - // We only need to know whether at least one comment is waiting for a check.
2285 - 'number' => 1,
2286 - ) );
2287 - }
2288 -
2289 - public static function get_page_url( $page = 'config' ) {
2290 -
2291 - $args = array( 'page' => 'akismet-key-config' );
2292 -
2293 - if ( $page == 'stats' )
2294 - $args = array( 'page' => 'akismet-key-config', 'view' => 'stats' );
2295 - elseif ( $page == 'delete_key' )
2296 - $args = array( 'page' => 'akismet-key-config', 'view' => 'start', 'action' => 'delete-key', '_wpnonce' => wp_create_nonce( self::NONCE ) );
2297 -
2298 - $url = add_query_arg( $args, class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'options-general.php' ) );
2299 -
2300 - return $url;
2301 - }
2302 -
2303 - public static function get_akismet_user( $api_key ) {
2304 - $akismet_user = false;
2305 -
2306 - $subscription_verification = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key, 'blog' => get_option( 'home' ) ) ), 'get-subscription' );
2307 -
2308 - if ( ! empty( $subscription_verification[1] ) ) {
2309 - if ( 'invalid' !== $subscription_verification[1] ) {
2310 - $akismet_user = json_decode( $subscription_verification[1] );
2311 - }
2312 - }
2313 -
2314 - return $akismet_user;
2315 - }
2316 -
2317 - public static function get_stats( $api_key ) {
2318 - $stat_totals = array();
2319 -
2320 - foreach( array( '6-months', 'all' ) as $interval ) {
2321 - $response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
2322 -
2323 - if ( ! empty( $response[1] ) ) {
2324 - $stat_totals[$interval] = json_decode( $response[1] );
2325 - }
2326 - }
2327 -
2328 - return $stat_totals;
2329 - }
2330 -
2331 - public static function verify_wpcom_key( $api_key, $user_id, $extra = array() ) {
2332 - $akismet_account = Akismet::http_post( Akismet::build_query( array_merge( array(
2333 - 'user_id' => $user_id,
2334 - 'api_key' => $api_key,
2335 - 'get_account_type' => 'true'
2336 - ), $extra ) ), 'verify-wpcom-key' );
2337 -
2338 - if ( ! empty( $akismet_account[1] ) )
2339 - $akismet_account = json_decode( $akismet_account[1] );
2340 -
2341 - Akismet::log( compact( 'akismet_account' ) );
2342 -
2343 - return $akismet_account;
2344 - }
2345 -
2346 - public static function connect_jetpack_user() {
2347 -
2348 - if ( $jetpack_user = self::get_jetpack_user() ) {
2349 - if ( isset( $jetpack_user['user_id'] ) && isset( $jetpack_user['api_key'] ) ) {
2350 - $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'], array( 'action' => 'connect_jetpack_user' ) );
2351 -
2352 - if ( is_object( $akismet_user ) ) {
2353 - self::save_key( $akismet_user->api_key );
2354 - return in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) );
2355 - }
2356 - }
2357 - }
2358 -
2359 - return false;
2360 - }
2361 -
2362 - public static function display_alert() {
2363 - Akismet::view( 'notice', array(
2364 - 'type' => 'alert',
2365 - 'code' => (int) get_option( 'akismet_alert_code' ),
2366 - 'msg' => get_option( 'akismet_alert_msg' )
2367 - ) );
2368 - }
2369 -
2370 - public static function display_privacy_notice_control_warning() {
2371 - if ( !current_user_can( 'manage_options' ) )
2372 - return;
2373 - Akismet::view( 'notice', array(
2374 - 'type' => 'privacy',
2375 - ) );
2376 - }
2377 -
2378 - public static function display_spam_check_warning() {
2379 - Akismet::fix_scheduled_recheck();
2380 -
2381 - if ( wp_next_scheduled('akismet_schedule_cron_recheck') > time() && self::are_any_comments_waiting_to_be_checked() ) {
2382 - $link_text = apply_filters( 'akismet_spam_check_warning_link_text', sprintf( __( 'Please check your <a href="%s">Akismet configuration</a> and contact your web host if problems persist.', 'akismet'), esc_url( self::get_page_url() ) ) );
2383 - Akismet::view( 'notice', array( 'type' => 'spam-check', 'link_text' => $link_text ) );
2384 - }
2385 - }
2386 -
2387 - public static function display_api_key_warning() {
2388 - Akismet::view( 'notice', array( 'type' => 'plugin' ) );
2389 - }
2390 -
2391 - public static function display_page() {
2392 - if ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) )
2393 - self::display_start_page();
2394 - elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' )
2395 - self::display_stats_page();
2396 - else
2397 - self::display_configuration_page();
2398 - }
2399 -
2400 - public static function display_start_page() {
2401 - if ( isset( $_GET['action'] ) ) {
2402 - if ( $_GET['action'] == 'delete-key' ) {
2403 - if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], self::NONCE ) )
2404 - delete_option( 'wordpress_api_key' );
2405 - }
2406 - }
2407 -
2408 - if ( $api_key = Akismet::get_api_key() && ( empty( self::$notices['status'] ) || 'existing-key-invalid' != self::$notices['status'] ) ) {
2409 - self::display_configuration_page();
2410 - return;
2411 - }
2412 -
2413 - //the user can choose to auto connect their API key by clicking a button on the akismet done page
2414 - //if jetpack, get verified api key by using connected wpcom user id
2415 - //if no jetpack, get verified api key by using an akismet token
2416 -
2417 - $akismet_user = false;
2418 -
2419 - if ( isset( $_GET['token'] ) && preg_match('/^(\d+)-[0-9a-f]{20}$/', $_GET['token'] ) )
2420 - $akismet_user = self::verify_wpcom_key( '', '', array( 'token' => $_GET['token'] ) );
2421 - elseif ( $jetpack_user = self::get_jetpack_user() )
2422 - $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] );
2423 -
2424 - if ( isset( $_GET['action'] ) ) {
2425 - if ( $_GET['action'] == 'save-key' ) {
2426 - if ( is_object( $akismet_user ) ) {
2427 - self::save_key( $akismet_user->api_key );
2428 - self::display_configuration_page();
2429 - return;
2430 - }
2431 - }
2432 - }
2433 -
2434 - Akismet::view( 'start', compact( 'akismet_user' ) );
2435 -
2436 - /*
2437 - // To see all variants when testing.
2438 - $akismet_user->status = 'no-sub';
2439 - Akismet::view( 'start', compact( 'akismet_user' ) );
2440 - $akismet_user->status = 'cancelled';
2441 - Akismet::view( 'start', compact( 'akismet_user' ) );
2442 - $akismet_user->status = 'suspended';
2443 - Akismet::view( 'start', compact( 'akismet_user' ) );
2444 - $akismet_user->status = 'other';
2445 - Akismet::view( 'start', compact( 'akismet_user' ) );
2446 - $akismet_user = false;
2447 - */
2448 - }
2449 -
2450 - public static function display_stats_page() {
2451 - Akismet::view( 'stats' );
2452 - }
2453 -
2454 - public static function display_configuration_page() {
2455 - $api_key = Akismet::get_api_key();
2456 - $akismet_user = self::get_akismet_user( $api_key );
2457 -
2458 - if ( ! $akismet_user ) {
2459 - // This could happen if the user's key became invalid after it was previously valid and successfully set up.
2460 - self::$notices['status'] = 'existing-key-invalid';
2461 - self::display_start_page();
2462 - return;
2463 - }
2464 -
2465 - $stat_totals = self::get_stats( $api_key );
2466 -
2467 - // If unset, create the new strictness option using the old discard option to determine its default.
2468 - // If the old option wasn't set, default to discarding the blatant spam.
2469 - if ( get_option( 'akismet_strictness' ) === false ) {
2470 - add_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) );
2471 - }
2472 -
2473 - // Sync the local "Total spam blocked" count with the authoritative count from the server.
2474 - if ( isset( $stat_totals['all'], $stat_totals['all']->spam ) ) {
2475 - update_option( 'akismet_spam_count', $stat_totals['all']->spam );
2476 - }
2477 -
2478 - $notices = array();
2479 -
2480 - if ( empty( self::$notices ) ) {
2481 - if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) {
2482 -
2483 - $time_saved = false;
2484 -
2485 - if ( $stat_totals['all']->time_saved > 1800 ) {
2486 - $total_in_minutes = round( $stat_totals['all']->time_saved / 60 );
2487 - $total_in_hours = round( $total_in_minutes / 60 );
2488 - $total_in_days = round( $total_in_hours / 8 );
2489 - $cleaning_up = __( 'Cleaning up spam takes time.' , 'akismet');
2490 -
2491 - if ( $total_in_days > 1 )
2492 - $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %s day!', 'Akismet has saved you %s days!', $total_in_days, 'akismet' ), number_format_i18n( $total_in_days ) );
2493 - elseif ( $total_in_hours > 1 )
2494 - $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d hour!', 'Akismet has saved you %d hours!', $total_in_hours, 'akismet' ), $total_in_hours );
2495 - elseif ( $total_in_minutes >= 30 )
2496 - $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 );
2497 - }
2498 -
2499 - $notices[] = array( 'type' => 'active-notice', 'time_saved' => $time_saved );
2500 - }
2501 -
2502 - if ( !empty( $akismet_user->limit_reached ) && in_array( $akismet_user->limit_reached, array( 'yellow', 'red' ) ) ) {
2503 - $notices[] = array( 'type' => 'limit-reached', 'level' => $akismet_user->limit_reached );
2504 - }
2505 - }
2506 -
2507 - if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) {
2508 - $notices[] = array( 'type' => $akismet_user->status );
2509 - }
2510 -
2511 - if ( false === get_option( 'akismet_comment_form_privacy_notice' ) ) {
2512 - $notices[] = array( 'type' => 'privacy' );
2513 - }
2514 -
2515 - /*
2516 - // To see all variants when testing.
2517 - $notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' );
2518 - $notices[] = array( 'type' => 'plugin' );
2519 - $notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' );
2520 - $notices[] = array( 'type' => 'notice', 'notice_header' => 'This is the notice header.', 'notice_text' => 'This is the notice text.' );
2521 - $notices[] = array( 'type' => 'missing-functions' );
2522 - $notices[] = array( 'type' => 'servers-be-down' );
2523 - $notices[] = array( 'type' => 'active-dunning' );
2524 - $notices[] = array( 'type' => 'cancelled' );
2525 - $notices[] = array( 'type' => 'suspended' );
2526 - $notices[] = array( 'type' => 'missing' );
2527 - $notices[] = array( 'type' => 'no-sub' );
2528 - $notices[] = array( 'type' => 'new-key-valid' );
2529 - $notices[] = array( 'type' => 'new-key-invalid' );
2530 - $notices[] = array( 'type' => 'existing-key-invalid' );
2531 - $notices[] = array( 'type' => 'new-key-failed' );
2532 - $notices[] = array( 'type' => 'limit-reached', 'level' => 'yellow' );
2533 - $notices[] = array( 'type' => 'limit-reached', 'level' => 'red' );
2534 - */
2535 -
2536 - Akismet::log( compact( 'stat_totals', 'akismet_user' ) );
2537 - Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals', 'notices' ) );
2538 - }
2539 -
2540 - public static function display_notice() {
2541 - global $hook_suffix;
2542 -
2543 - if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) ) {
2544 - // This page manages the notices and puts them inline where they make sense.
2545 - return;
2546 - }
2547 -
2548 - if ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) {
2549 - Akismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state
2550 -
2551 - if ( get_option( 'akismet_alert_code' ) > 0 )
2552 - self::display_alert();
2553 - }
2554 - elseif ( $hook_suffix == 'plugins.php' && !Akismet::get_api_key() ) {
2555 - self::display_api_key_warning();
2556 - }
2557 - elseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
2558 - self::display_spam_check_warning();
2559 - }
2560 - else if ( isset( $_GET['akismet_recheck_complete'] ) ) {
2561 - $recheck_count = (int) $_GET['recheck_count'];
2562 - $spam_count = (int) $_GET['spam_count'];
2563 -
2564 - if ( $recheck_count === 0 ) {
2565 - $message = __( 'There were no comments to check. Akismet will only check comments in the Pending queue.', 'akismet' );
2566 - }
2567 - else {
2568 - $message = sprintf( _n( 'Akismet checked %s comment.', 'Akismet checked %s comments.', $recheck_count, 'akismet' ), number_format( $recheck_count ) );
2569 - $message .= ' ';
2570 -
2571 - if ( $spam_count === 0 ) {
2572 - $message .= __( 'No comments were caught as spam.', 'akismet' );
2573 - }
2574 - else {
2575 - $message .= sprintf( _n( '%s comment was caught as spam.', '%s comments were caught as spam.', $spam_count, 'akismet' ), number_format( $spam_count ) );
2576 - }
2577 - }
2578 -
2579 - echo '<div class="notice notice-success"><p>' . esc_html( $message ) . '</p></div>';
2580 - }
2581 -
2582 - $akismet_comment_form_privacy_notice_option = get_option( 'akismet_comment_form_privacy_notice' );
2583 - if ( ! in_array( $akismet_comment_form_privacy_notice_option, array( 'hide', 'display' ) ) ) {
2584 - $api_key = Akismet::get_api_key();
2585 - if ( ! empty( $api_key ) ) {
2586 - self::display_privacy_notice_control_warning();
2587 - }
2588 - }
2589 - }
2590 -
2591 - public static function display_status() {
2592 - if ( ! self::get_server_connectivity() ) {
2593 - Akismet::view( 'notice', array( 'type' => 'servers-be-down' ) );
2594 - }
2595 - else if ( ! empty( self::$notices ) ) {
2596 - foreach ( self::$notices as $index => $type ) {
2597 - if ( is_object( $type ) ) {
2598 - $notice_header = $notice_text = '';
2599 -
2600 - if ( property_exists( $type, 'notice_header' ) ) {
2601 - $notice_header = wp_kses( $type->notice_header, self::$allowed );
2602 - }
2603 -
2604 - if ( property_exists( $type, 'notice_text' ) ) {
2605 - $notice_text = wp_kses( $type->notice_text, self::$allowed );
2606 - }
2607 -
2608 - if ( property_exists( $type, 'status' ) ) {
2609 - $type = wp_kses( $type->status, self::$allowed );
2610 - Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) );
2611 -
2612 - unset( self::$notices[ $index ] );
2613 - }
2614 - }
2615 - else {
2616 - Akismet::view( 'notice', compact( 'type' ) );
2617 -
2618 - unset( self::$notices[ $index ] );
2619 - }
2620 - }
2621 - }
2622 - }
2623 -
2624 - private static function get_jetpack_user() {
2625 - if ( !class_exists('Jetpack') )
2626 - return false;
2627 -
2628 - Jetpack::load_xml_rpc_client();
2629 - $xml = new Jetpack_IXR_ClientMulticall( array( 'user_id' => get_current_user_id() ) );
2630 -
2631 - $xml->addCall( 'wpcom.getUserID' );
2632 - $xml->addCall( 'akismet.getAPIKey' );
2633 - $xml->query();
2634 -
2635 - Akismet::log( compact( 'xml' ) );
2636 -
2637 - if ( !$xml->isError() ) {
2638 - $responses = $xml->getResponse();
2639 - if ( count( $responses ) > 1 ) {
2640 - // Due to a quirk in how Jetpack does multi-calls, the response order
2641 - // can't be trusted to match the call order. It's a good thing our
2642 - // return values can be mostly differentiated from each other.
2643 - $first_response_value = array_shift( $responses[0] );
2644 - $second_response_value = array_shift( $responses[1] );
2645 -
2646 - // If WPCOM ever reaches 100 billion users, this will fail. :-)
2647 - if ( preg_match( '/^[a-f0-9]{12}$/i', $first_response_value ) ) {
2648 - $api_key = $first_response_value;
2649 - $user_id = (int) $second_response_value;
2650 - }
2651 - else {
2652 - $api_key = $second_response_value;
2653 - $user_id = (int) $first_response_value;
2654 - }
2655 -
2656 - return compact( 'api_key', 'user_id' );
2657 - }
2658 - }
2659 - return false;
2660 - }
2661 -
2662 - /**
2663 - * Some commentmeta isn't useful in an export file. Suppress it (when supported).
2664 - *
2665 - * @param bool $exclude
2666 - * @param string $key The meta key
2667 - * @param object $meta The meta object
2668 - * @return bool Whether to exclude this meta entry from the export.
2669 - */
2670 - public static function exclude_commentmeta_from_export( $exclude, $key, $meta ) {
2671 - if ( in_array( $key, array( 'akismet_as_submitted', 'akismet_rechecking', 'akismet_delayed_moderation_email' ) ) ) {
2672 - return true;
2673 - }
2674 -
2675 - return $exclude;
2676 - }
2677 -
2678 - /**
2679 - * When Akismet is active, remove the "Activate Akismet" step from the plugin description.
2680 - */
2681 - public static function modify_plugin_description( $all_plugins ) {
2682 - if ( isset( $all_plugins['akismet/akismet.php'] ) ) {
2683 - if ( Akismet::get_api_key() ) {
2684 - $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' );
2685 - }
2686 - else {
2687 - $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' );
2688 - }
2689 - }
2690 -
2691 - return $all_plugins;
2692 - }
2693 -
2694 - private static function set_form_privacy_notice_option( $state ) {
2695 - if ( in_array( $state, array( 'display', 'hide' ) ) ) {
2696 - update_option( 'akismet_comment_form_privacy_notice', $state );
2697 - }
2698 - }
2699 -
2700 - public static function jetpack_comment_form_privacy_notice_url( $url ) {
2701 - return str_replace( 'options-general.php', 'admin.php', $url );
2702 - }
2703 -
2704 - public static function register_personal_data_eraser( $erasers ) {
2705 - $erasers['akismet'] = array(
2706 - 'eraser_friendly_name' => __( 'Akismet', 'akismet' ),
2707 - 'callback' => array( 'Akismet_Admin', 'erase_personal_data' ),
2708 - );
2709 -
2710 - return $erasers;
2711 - }
2712 -
2713 - /**
2714 - * When a user requests that their personal data be removed, Akismet has a duty to discard
2715 - * any personal data we store outside of the comment itself. Right now, that is limited
2716 - * to the copy of the comment we store in the akismet_as_submitted commentmeta.
2717 - *
2718 - * FWIW, this information would be automatically deleted after 15 days.
2719 - *
2720 - * @param $email_address string The email address of the user who has requested erasure.
2721 - * @param $page int This function can (and will) be called multiple times to prevent timeouts,
2722 - * so this argument is used for pagination.
2723 - * @return array
2724 - * @see https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/
2725 - */
2726 - public static function erase_personal_data( $email_address, $page = 1 ) {
2727 - $items_removed = false;
2728 -
2729 - $number = 50;
2730 - $page = (int) $page;
2731 -
2732 - $comments = get_comments(
2733 - array(
2734 - 'author_email' => $email_address,
2735 - 'number' => $number,
2736 - 'paged' => $page,
2737 - 'order_by' => 'comment_ID',
2738 - 'order' => 'ASC',
2739 - )
2740 - );
2741 -
2742 - foreach ( (array) $comments as $comment ) {
2743 - $comment_as_submitted = get_comment_meta( $comment->comment_ID, 'akismet_as_submitted', true );
2744 -
2745 - if ( $comment_as_submitted ) {
2746 - delete_comment_meta( $comment->comment_ID, 'akismet_as_submitted' );
2747 - $items_removed = true;
2748 - }
2749 - }
2750 -
2751 - // Tell core if we have more comments to work on still
2752 - $done = count( $comments ) < $number;
2753 -
2754 - return array(
2755 - 'items_removed' => $items_removed,
2756 - 'items_retained' => false, // always false in this example
2757 - 'messages' => array(), // no messages in this example
2758 - 'done' => $done,
2759 - );
2760 - }
2761 -}
2762
2763 diff --git a/plugins/akismet/class.akismet-cli.php b/plugins/akismet/class.akismet-cli.php
2764 deleted file mode 100644
2765 index 9cbe7a92..00000000
2766 --- a/plugins/akismet/class.akismet-cli.php
2767 +++ /dev/null
2768 @@ -1,185 +0,0 @@
2769 -<?php
2770 -
2771 -WP_CLI::add_command( 'akismet', 'Akismet_CLI' );
2772 -
2773 -/**
2774 - * Filter spam comments.
2775 - */
2776 -class Akismet_CLI extends WP_CLI_Command {
2777 - /**
2778 - * Checks one or more comments against the Akismet API.
2779 - *
2780 - * ## OPTIONS
2781 - * <comment_id>...
2782 - * : The ID(s) of the comment(s) to check.
2783 - *
2784 - * [--noaction]
2785 - * : Don't change the status of the comment. Just report what Akismet thinks it is.
2786 - *
2787 - * ## EXAMPLES
2788 - *
2789 - * wp akismet check 12345
2790 - *
2791 - * @alias comment-check
2792 - */
2793 - public function check( $args, $assoc_args ) {
2794 - foreach ( $args as $comment_id ) {
2795 - if ( isset( $assoc_args['noaction'] ) ) {
2796 - // Check the comment, but don't reclassify it.
2797 - $api_response = Akismet::check_db_comment( $comment_id, 'wp-cli' );
2798 - }
2799 - else {
2800 - $api_response = Akismet::recheck_comment( $comment_id, 'wp-cli' );
2801 - }
2802 -
2803 - if ( 'true' === $api_response ) {
2804 - WP_CLI::line( sprintf( __( "Comment #%d is spam.", 'akismet' ), $comment_id ) );
2805 - }
2806 - else if ( 'false' === $api_response ) {
2807 - WP_CLI::line( sprintf( __( "Comment #%d is not spam.", 'akismet' ), $comment_id ) );
2808 - }
2809 - else {
2810 - if ( false === $api_response ) {
2811 - WP_CLI::error( __( "Failed to connect to Akismet.", 'akismet' ) );
2812 - }
2813 - else if ( is_wp_error( $api_response ) ) {
2814 - WP_CLI::warning( sprintf( __( "Comment #%d could not be checked.", 'akismet' ), $comment_id ) );
2815 - }
2816 - }
2817 - }
2818 - }
2819 -
2820 - /**
2821 - * Recheck all comments in the Pending queue.
2822 - *
2823 - * ## EXAMPLES
2824 - *
2825 - * wp akismet recheck_queue
2826 - *
2827 - * @alias recheck-queue
2828 - */
2829 - public function recheck_queue() {
2830 - $batch_size = 100;
2831 - $start = 0;
2832 -
2833 - $total_counts = array();
2834 -
2835 - do {
2836 - $result_counts = Akismet_Admin::recheck_queue_portion( $start, $batch_size );
2837 -
2838 - if ( $result_counts['processed'] > 0 ) {
2839 - foreach ( $result_counts as $key => $count ) {
2840 - if ( ! isset( $total_counts[ $key ] ) ) {
2841 - $total_counts[ $key ] = $count;
2842 - }
2843 - else {
2844 - $total_counts[ $key ] += $count;
2845 - }
2846 - }
2847 - $start += $batch_size;
2848 - $start -= $result_counts['spam']; // These comments will have been removed from the queue.
2849 - }
2850 - } while ( $result_counts['processed'] > 0 );
2851 -
2852 - WP_CLI::line( sprintf( _n( "Processed %d comment.", "Processed %d comments.", $total_counts['processed'], 'akismet' ), number_format( $total_counts['processed'] ) ) );
2853 - WP_CLI::line( sprintf( _n( "%d comment moved to Spam.", "%d comments moved to Spam.", $total_counts['spam'], 'akismet' ), number_format( $total_counts['spam'] ) ) );
2854 -
2855 - if ( $total_counts['error'] ) {
2856 - WP_CLI::line( sprintf( _n( "%d comment could not be checked.", "%d comments could not be checked.", $total_counts['error'], 'akismet' ), number_format( $total_counts['error'] ) ) );
2857 - }
2858 - }
2859 -
2860 - /**
2861 - * Fetches stats from the Akismet API.
2862 - *
2863 - * ## OPTIONS
2864 - *
2865 - * [<interval>]
2866 - * : The time period for which to retrieve stats.
2867 - * ---
2868 - * default: all
2869 - * options:
2870 - * - days
2871 - * - months
2872 - * - all
2873 - * ---
2874 - *
2875 - * [--format=<format>]
2876 - * : Allows overriding the output of the command when listing connections.
2877 - * ---
2878 - * default: table
2879 - * options:
2880 - * - table
2881 - * - json
2882 - * - csv
2883 - * - yaml
2884 - * - count
2885 - * ---
2886 - *
2887 - * [--summary]
2888 - * : When set, will display a summary of the stats.
2889 - *
2890 - * ## EXAMPLES
2891 - *
2892 - * wp akismet stats
2893 - * wp akismet stats all
2894 - * wp akismet stats days
2895 - * wp akismet stats months
2896 - * wp akismet stats all --summary
2897 - */
2898 - public function stats( $args, $assoc_args ) {
2899 - $api_key = Akismet::get_api_key();
2900 -
2901 - if ( empty( $api_key ) ) {
2902 - WP_CLI::error( __( 'API key must be set to fetch stats.', 'akismet' ) );
2903 - }
2904 -
2905 - switch ( $args[0] ) {
2906 - case 'days':
2907 - $interval = '60-days';
2908 - break;
2909 - case 'months':
2910 - $interval = '6-months';
2911 - break;
2912 - default:
2913 - $interval = 'all';
2914 - break;
2915 - }
2916 -
2917 - $response = Akismet::http_post(
2918 - Akismet::build_query( array(
2919 - 'blog' => get_option( 'home' ),
2920 - 'key' => $api_key,
2921 - 'from' => $interval,
2922 - ) ),
2923 - 'get-stats'
2924 - );
2925 -
2926 - if ( empty( $response[1] ) ) {
2927 - WP_CLI::error( __( 'Currently unable to fetch stats. Please try again.', 'akismet' ) );
2928 - }
2929 -
2930 - $response_body = json_decode( $response[1], true );
2931 -
2932 - if ( is_null( $response_body ) ) {
2933 - WP_CLI::error( __( 'Stats response could not be decoded.', 'akismet' ) );
2934 - }
2935 -
2936 - if ( isset( $assoc_args['summary'] ) ) {
2937 - $keys = array(
2938 - 'spam',
2939 - 'ham',
2940 - 'missed_spam',
2941 - 'false_positives',
2942 - 'accuracy',
2943 - 'time_saved',
2944 - );
2945 -
2946 - WP_CLI\Utils\format_items( $assoc_args['format'], array( $response_body ), $keys );
2947 - }
2948 - else {
2949 - $stats = $response_body['breakdown'];
2950 - WP_CLI\Utils\format_items( $assoc_args['format'], $stats, array_keys( end( $stats ) ) );
2951 - }
2952 - }
2953 -}
2954 \ No newline at end of file
2955
2956 diff --git a/plugins/akismet/class.akismet-rest-api.php b/plugins/akismet/class.akismet-rest-api.php
2957 deleted file mode 100644
2958 index bf71998b..00000000
2959 --- a/plugins/akismet/class.akismet-rest-api.php
2960 +++ /dev/null
2961 @@ -1,366 +0,0 @@
2962 -<?php
2963 -
2964 -class Akismet_REST_API {
2965 - /**
2966 - * Register the REST API routes.
2967 - */
2968 - public static function init() {
2969 - if ( ! function_exists( 'register_rest_route' ) ) {
2970 - // The REST API wasn't integrated into core until 4.4, and we support 4.0+ (for now).
2971 - return false;
2972 - }
2973 -
2974 - register_rest_route( 'akismet/v1', '/key', array(
2975 - array(
2976 - 'methods' => WP_REST_Server::READABLE,
2977 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
2978 - 'callback' => array( 'Akismet_REST_API', 'get_key' ),
2979 - ), array(
2980 - 'methods' => WP_REST_Server::EDITABLE,
2981 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
2982 - 'callback' => array( 'Akismet_REST_API', 'set_key' ),
2983 - 'args' => array(
2984 - 'key' => array(
2985 - 'required' => true,
2986 - 'type' => 'string',
2987 - 'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
2988 - 'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
2989 - ),
2990 - ),
2991 - ), array(
2992 - 'methods' => WP_REST_Server::DELETABLE,
2993 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
2994 - 'callback' => array( 'Akismet_REST_API', 'delete_key' ),
2995 - )
2996 - ) );
2997 -
2998 - register_rest_route( 'akismet/v1', '/settings/', array(
2999 - array(
3000 - 'methods' => WP_REST_Server::READABLE,
3001 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
3002 - 'callback' => array( 'Akismet_REST_API', 'get_settings' ),
3003 - ),
3004 - array(
3005 - 'methods' => WP_REST_Server::EDITABLE,
3006 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
3007 - 'callback' => array( 'Akismet_REST_API', 'set_boolean_settings' ),
3008 - 'args' => array(
3009 - 'akismet_strictness' => array(
3010 - 'required' => false,
3011 - 'type' => 'boolean',
3012 - 'description' => __( 'If true, Akismet will automatically discard the worst spam automatically rather than putting it in the spam folder.', 'akismet' ),
3013 - ),
3014 - 'akismet_show_user_comments_approved' => array(
3015 - 'required' => false,
3016 - 'type' => 'boolean',
3017 - 'description' => __( 'If true, show the number of approved comments beside each comment author in the comments list page.', 'akismet' ),
3018 - ),
3019 - ),
3020 - )
3021 - ) );
3022 -
3023 - register_rest_route( 'akismet/v1', '/stats', array(
3024 - 'methods' => WP_REST_Server::READABLE,
3025 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
3026 - 'callback' => array( 'Akismet_REST_API', 'get_stats' ),
3027 - 'args' => array(
3028 - 'interval' => array(
3029 - 'required' => false,
3030 - 'type' => 'string',
3031 - 'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_interval' ),
3032 - 'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),
3033 - 'default' => 'all',
3034 - ),
3035 - ),
3036 - ) );
3037 -
3038 - register_rest_route( 'akismet/v1', '/stats/(?P<interval>[\w+])', array(
3039 - 'args' => array(
3040 - 'interval' => array(
3041 - 'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),
3042 - 'type' => 'string',
3043 - ),
3044 - ),
3045 - array(
3046 - 'methods' => WP_REST_Server::READABLE,
3047 - 'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
3048 - 'callback' => array( 'Akismet_REST_API', 'get_stats' ),
3049 - )
3050 - ) );
3051 -
3052 - register_rest_route( 'akismet/v1', '/alert', array(
3053 - array(
3054 - 'methods' => WP_REST_Server::READABLE,
3055 - 'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),
3056 - 'callback' => array( 'Akismet_REST_API', 'get_alert' ),
3057 - 'args' => array(
3058 - 'key' => array(
3059 - 'required' => false,
3060 - 'type' => 'string',
3061 - 'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
3062 - 'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
3063 - ),
3064 - ),
3065 - ),
3066 - array(
3067 - 'methods' => WP_REST_Server::EDITABLE,
3068 - 'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),
3069 - 'callback' => array( 'Akismet_REST_API', 'set_alert' ),
3070 - 'args' => array(
3071 - 'key' => array(
3072 - 'required' => false,
3073 - 'type' => 'string',
3074 - 'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
3075 - 'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
3076 - ),
3077 - ),
3078 - ),
3079 - array(
3080 - 'methods' => WP_REST_Server::DELETABLE,
3081 - 'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),
3082 - 'callback' => array( 'Akismet_REST_API', 'delete_alert' ),
3083 - 'args' => array(
3084 - 'key' => array(
3085 - 'required' => false,
3086 - 'type' => 'string',
3087 - 'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
3088 - 'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
3089 - ),
3090 - ),
3091 - )
3092 - ) );
3093 - }
3094 -
3095 - /**
3096 - * Get the current Akismet API key.
3097 - *
3098 - * @param WP_REST_Request $request
3099 - * @return WP_Error|WP_REST_Response
3100 - */
3101 - public static function get_key( $request = null ) {
3102 - return rest_ensure_response( Akismet::get_api_key() );
3103 - }
3104 -
3105 - /**
3106 - * Set the API key, if possible.
3107 - *
3108 - * @param WP_REST_Request $request
3109 - * @return WP_Error|WP_REST_Response
3110 - */
3111 - public static function set_key( $request ) {
3112 - if ( defined( 'WPCOM_API_KEY' ) ) {
3113 - return rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\'s API key is hardcoded and cannot be changed via the API.', 'akismet' ), array( 'status'=> 409 ) ) );
3114 - }
3115 -
3116 - $new_api_key = $request->get_param( 'key' );
3117 -
3118 - if ( ! self::key_is_valid( $new_api_key ) ) {
3119 - return rest_ensure_response( new WP_Error( 'invalid_key', __( 'The value provided is not a valid and registered API key.', 'akismet' ), array( 'status' => 400 ) ) );
3120 - }
3121 -
3122 - update_option( 'wordpress_api_key', $new_api_key );
3123 -
3124 - return self::get_key();
3125 - }
3126 -
3127 - /**
3128 - * Unset the API key, if possible.
3129 - *
3130 - * @param WP_REST_Request $request
3131 - * @return WP_Error|WP_REST_Response
3132 - */
3133 - public static function delete_key( $request ) {
3134 - if ( defined( 'WPCOM_API_KEY' ) ) {
3135 - return rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\'s API key is hardcoded and cannot be deleted.', 'akismet' ), array( 'status'=> 409 ) ) );
3136 - }
3137 -
3138 - delete_option( 'wordpress_api_key' );
3139 -
3140 - return rest_ensure_response( true );
3141 - }
3142 -
3143 - /**
3144 - * Get the Akismet settings.
3145 - *
3146 - * @param WP_REST_Request $request
3147 - * @return WP_Error|WP_REST_Response
3148 - */
3149 - public static function get_settings( $request = null ) {
3150 - return rest_ensure_response( array(
3151 - 'akismet_strictness' => ( get_option( 'akismet_strictness', '1' ) === '1' ),
3152 - 'akismet_show_user_comments_approved' => ( get_option( 'akismet_show_user_comments_approved', '1' ) === '1' ),
3153 - ) );
3154 - }
3155 -
3156 - /**
3157 - * Update the Akismet settings.
3158 - *
3159 - * @param WP_REST_Request $request
3160 - * @return WP_Error|WP_REST_Response
3161 - */
3162 - public static function set_boolean_settings( $request ) {
3163 - foreach ( array(
3164 - 'akismet_strictness',
3165 - 'akismet_show_user_comments_approved',
3166 - ) as $setting_key ) {
3167 -
3168 - $setting_value = $request->get_param( $setting_key );
3169 - if ( is_null( $setting_value ) ) {
3170 - // This setting was not specified.
3171 - continue;
3172 - }
3173 -
3174 - // From 4.7+, WP core will ensure that these are always boolean
3175 - // values because they are registered with 'type' => 'boolean',
3176 - // but we need to do this ourselves for prior versions.
3177 - $setting_value = Akismet_REST_API::parse_boolean( $setting_value );
3178 -
3179 - update_option( $setting_key, $setting_value ? '1' : '0' );
3180 - }
3181 -
3182 - return self::get_settings();
3183 - }
3184 -
3185 - /**
3186 - * Parse a numeric or string boolean value into a boolean.
3187 - *
3188 - * @param mixed $value The value to convert into a boolean.
3189 - * @return bool The converted value.
3190 - */
3191 - public static function parse_boolean( $value ) {
3192 - switch ( $value ) {
3193 - case true:
3194 - case 'true':
3195 - case '1':
3196 - case 1:
3197 - return true;
3198 -
3199 - case false:
3200 - case 'false':
3201 - case '0':
3202 - case 0:
3203 - return false;
3204 -
3205 - default:
3206 - return (bool) $value;
3207 - }
3208 - }
3209 -
3210 - /**
3211 - * Get the Akismet stats for a given time period.
3212 - *
3213 - * Possible `interval` values:
3214 - * - all
3215 - * - 60-days
3216 - * - 6-months
3217 - *
3218 - * @param WP_REST_Request $request
3219 - * @return WP_Error|WP_REST_Response
3220 - */
3221 - public static function get_stats( $request ) {
3222 - $api_key = Akismet::get_api_key();
3223 -
3224 - $interval = $request->get_param( 'interval' );
3225 -
3226 - $stat_totals = array();
3227 -
3228 - $response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
3229 -
3230 - if ( ! empty( $response[1] ) ) {
3231 - $stat_totals[$interval] = json_decode( $response[1] );
3232 - }
3233 -
3234 - return rest_ensure_response( $stat_totals );
3235 - }
3236 -
3237 - /**
3238 - * Get the current alert code and message. Alert codes are used to notify the site owner
3239 - * if there's a problem, like a connection issue between their site and the Akismet API,
3240 - * invalid requests being sent, etc.
3241 - *
3242 - * @param WP_REST_Request $request
3243 - * @return WP_Error|WP_REST_Response
3244 - */
3245 - public static function get_alert( $request ) {
3246 - return rest_ensure_response( array(
3247 - 'code' => get_option( 'akismet_alert_code' ),
3248 - 'message' => get_option( 'akismet_alert_msg' ),
3249 - ) );
3250 - }
3251 -
3252 - /**
3253 - * Update the current alert code and message by triggering a call to the Akismet server.
3254 - *
3255 - * @param WP_REST_Request $request
3256 - * @return WP_Error|WP_REST_Response
3257 - */
3258 - public static function set_alert( $request ) {
3259 - delete_option( 'akismet_alert_code' );
3260 - delete_option( 'akismet_alert_msg' );
3261 -
3262 - // Make a request so the most recent alert code and message are retrieved.
3263 - Akismet::verify_key( Akismet::get_api_key() );
3264 -
3265 - return self::get_alert( $request );
3266 - }
3267 -
3268 - /**
3269 - * Clear the current alert code and message.
3270 - *
3271 - * @param WP_REST_Request $request
3272 - * @return WP_Error|WP_REST_Response
3273 - */
3274 - public static function delete_alert( $request ) {
3275 - delete_option( 'akismet_alert_code' );
3276 - delete_option( 'akismet_alert_msg' );
3277 -
3278 - return self::get_alert( $request );
3279 - }
3280 -
3281 - private static function key_is_valid( $key ) {
3282 - $response = Akismet::http_post(
3283 - Akismet::build_query(
3284 - array(
3285 - 'key' => $key,
3286 - 'blog' => get_option( 'home' )
3287 - )
3288 - ),
3289 - 'verify-key'
3290 - );
3291 -
3292 - if ( $response[1] == 'valid' ) {
3293 - return true;
3294 - }
3295 -
3296 - return false;
3297 - }
3298 -
3299 - public static function privileged_permission_callback() {
3300 - return current_user_can( 'manage_options' );
3301 - }
3302 -
3303 - /**
3304 - * For calls that Akismet.com makes to the site to clear outdated alert codes, use the API key for authorization.
3305 - */
3306 - public static function remote_call_permission_callback( $request ) {
3307 - $local_key = Akismet::get_api_key();
3308 -
3309 - return $local_key && ( strtolower( $request->get_param( 'key' ) ) === strtolower( $local_key ) );
3310 - }
3311 -
3312 - public static function sanitize_interval( $interval, $request, $param ) {
3313 - $interval = trim( $interval );
3314 -
3315 - $valid_intervals = array( '60-days', '6-months', 'all', );
3316 -
3317 - if ( ! in_array( $interval, $valid_intervals ) ) {
3318 - $interval = 'all';
3319 - }
3320 -
3321 - return $interval;
3322 - }
3323 -
3324 - public static function sanitize_key( $key, $request, $param ) {
3325 - return trim( $key );
3326 - }
3327 -}
3328
3329 diff --git a/plugins/akismet/class.akismet-widget.php b/plugins/akismet/class.akismet-widget.php
3330 deleted file mode 100644
3331 index 55b0f35c..00000000
3332 --- a/plugins/akismet/class.akismet-widget.php
3333 +++ /dev/null
3334 @@ -1,114 +0,0 @@
3335 -<?php
3336 -/**
3337 - * @package Akismet
3338 - */
3339 -class Akismet_Widget extends WP_Widget {
3340 -
3341 - function __construct() {
3342 - load_plugin_textdomain( 'akismet' );
3343 -
3344 - parent::__construct(
3345 - 'akismet_widget',
3346 - __( 'Akismet Widget' , 'akismet'),
3347 - array( 'description' => __( 'Display the number of spam comments Akismet has caught' , 'akismet') )
3348 - );
3349 -
3350 - if ( is_active_widget( false, false, $this->id_base ) ) {
3351 - add_action( 'wp_head', array( $this, 'css' ) );
3352 - }
3353 - }
3354 -
3355 - function css() {
3356 -?>
3357 -
3358 -<style type="text/css">
3359 -.a-stats {
3360 - width: auto;
3361 -}
3362 -.a-stats a {
3363 - background: #7CA821;
3364 - background-image:-moz-linear-gradient(0% 100% 90deg,#5F8E14,#7CA821);
3365 - background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#7CA821),to(#5F8E14));
3366 - border: 1px solid #5F8E14;
3367 - border-radius:3px;
3368 - color: #CFEA93;
3369 - cursor: pointer;
3370 - display: block;
3371 - font-weight: normal;
3372 - height: 100%;
3373 - -moz-border-radius:3px;
3374 - padding: 7px 0 8px;
3375 - text-align: center;
3376 - text-decoration: none;
3377 - -webkit-border-radius:3px;
3378 - width: 100%;
3379 -}
3380 -.a-stats a:hover {
3381 - text-decoration: none;
3382 - background-image:-moz-linear-gradient(0% 100% 90deg,#6F9C1B,#659417);
3383 - background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#659417),to(#6F9C1B));
3384 -}
3385 -.a-stats .count {
3386 - color: #FFF;
3387 - display: block;
3388 - font-size: 15px;
3389 - line-height: 16px;
3390 - padding: 0 13px;
3391 - white-space: nowrap;
3392 -}
3393 -</style>
3394 -
3395 -<?php
3396 - }
3397 -
3398 - function form( $instance ) {
3399 - if ( $instance && isset( $instance['title'] ) ) {
3400 - $title = $instance['title'];
3401 - }
3402 - else {
3403 - $title = __( 'Spam Blocked' , 'akismet' );
3404 - }
3405 -?>
3406 -
3407 - <p>
3408 - <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:' , 'akismet'); ?></label>
3409 - <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
3410 - </p>
3411 -
3412 -<?php
3413 - }
3414 -
3415 - function update( $new_instance, $old_instance ) {
3416 - $instance['title'] = strip_tags( $new_instance['title'] );
3417 - return $instance;
3418 - }
3419 -
3420 - function widget( $args, $instance ) {
3421 - $count = get_option( 'akismet_spam_count' );
3422 -
3423 - if ( ! isset( $instance['title'] ) ) {
3424 - $instance['title'] = __( 'Spam Blocked' , 'akismet' );
3425 - }
3426 -
3427 - echo $args['before_widget'];
3428 - if ( ! empty( $instance['title'] ) ) {
3429 - echo $args['before_title'];
3430 - echo esc_html( $instance['title'] );
3431 - echo $args['after_title'];
3432 - }
3433 -?>
3434 -
3435 - <div class="a-stats">
3436 - <a href="https://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a>
3437 - </div>
3438 -
3439 -<?php
3440 - echo $args['after_widget'];
3441 - }
3442 -}
3443 -
3444 -function akismet_register_widgets() {
3445 - register_widget( 'Akismet_Widget' );
3446 -}
3447 -
3448 -add_action( 'widgets_init', 'akismet_register_widgets' );
3449
3450 diff --git a/plugins/akismet/class.akismet.php b/plugins/akismet/class.akismet.php
3451 deleted file mode 100644
3452 index f24fd63d..00000000
3453 --- a/plugins/akismet/class.akismet.php
3454 +++ /dev/null
3455 @@ -1,1423 +0,0 @@
3456 -<?php
3457 -
3458 -class Akismet {
3459 - const API_HOST = 'rest.akismet.com';
3460 - const API_PORT = 80;
3461 - const MAX_DELAY_BEFORE_MODERATION_EMAIL = 86400; // One day in seconds
3462 -
3463 - private static $last_comment = '';
3464 - private static $initiated = false;
3465 - private static $prevent_moderation_email_for_these_comments = array();
3466 - private static $last_comment_result = null;
3467 - private static $comment_as_submitted_allowed_keys = array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' );
3468 - private static $is_rest_api_call = false;
3469 -
3470 - public static function init() {
3471 - if ( ! self::$initiated ) {
3472 - self::init_hooks();
3473 - }
3474 - }
3475 -
3476 - /**
3477 - * Initializes WordPress hooks
3478 - */
3479 - private static function init_hooks() {
3480 - self::$initiated = true;
3481 -
3482 - add_action( 'wp_insert_comment', array( 'Akismet', 'auto_check_update_meta' ), 10, 2 );
3483 - add_filter( 'preprocess_comment', array( 'Akismet', 'auto_check_comment' ), 1 );
3484 - add_filter( 'rest_pre_insert_comment', array( 'Akismet', 'rest_auto_check_comment' ), 1 );
3485 -
3486 - add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments' ) );
3487 - add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
3488 - add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_orphaned_commentmeta' ) );
3489 - add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
3490 -
3491 - add_action( 'comment_form', array( 'Akismet', 'add_comment_nonce' ), 1 );
3492 -
3493 - add_action( 'admin_head-edit-comments.php', array( 'Akismet', 'load_form_js' ) );
3494 - add_action( 'comment_form', array( 'Akismet', 'load_form_js' ) );
3495 - add_action( 'comment_form', array( 'Akismet', 'inject_ak_js' ) );
3496 - add_filter( 'script_loader_tag', array( 'Akismet', 'set_form_js_async' ), 10, 3 );
3497 -
3498 - add_filter( 'comment_moderation_recipients', array( 'Akismet', 'disable_moderation_emails_if_unreachable' ), 1000, 2 );
3499 - add_filter( 'pre_comment_approved', array( 'Akismet', 'last_comment_status' ), 10, 2 );
3500 -
3501 - add_action( 'transition_comment_status', array( 'Akismet', 'transition_comment_status' ), 10, 3 );
3502 -
3503 - // Run this early in the pingback call, before doing a remote fetch of the source uri
3504 - add_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) );
3505 -
3506 - // Jetpack compatibility
3507 - add_filter( 'jetpack_options_whitelist', array( 'Akismet', 'add_to_jetpack_options_whitelist' ) );
3508 - add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 );
3509 - add_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 );
3510 -
3511 - add_action( 'comment_form_after', array( 'Akismet', 'display_comment_form_privacy_notice' ) );
3512 - }
3513 -
3514 - public static function get_api_key() {
3515 - return apply_filters( 'akismet_get_api_key', defined('WPCOM_API_KEY') ? constant('WPCOM_API_KEY') : get_option('wordpress_api_key') );
3516 - }
3517 -
3518 - public static function check_key_status( $key, $ip = null ) {
3519 - return self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option( 'home' ) ) ), 'verify-key', $ip );
3520 - }
3521 -
3522 - public static function verify_key( $key, $ip = null ) {
3523 - // Shortcut for obviously invalid keys.
3524 - if ( strlen( $key ) != 12 ) {
3525 - return 'invalid';
3526 - }
3527 -
3528 - $response = self::check_key_status( $key, $ip );
3529 -
3530 - if ( $response[1] != 'valid' && $response[1] != 'invalid' )
3531 - return 'failed';
3532 -
3533 - return $response[1];
3534 - }
3535 -
3536 - public static function deactivate_key( $key ) {
3537 - $response = self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option( 'home' ) ) ), 'deactivate' );
3538 -
3539 - if ( $response[1] != 'deactivated' )
3540 - return 'failed';
3541 -
3542 - return $response[1];
3543 - }
3544 -
3545 - /**
3546 - * Add the akismet option to the Jetpack options management whitelist.
3547 - *
3548 - * @param array $options The list of whitelisted option names.
3549 - * @return array The updated whitelist
3550 - */
3551 - public static function add_to_jetpack_options_whitelist( $options ) {
3552 - $options[] = 'wordpress_api_key';
3553 - return $options;
3554 - }
3555 -
3556 - /**
3557 - * When the akismet option is updated, run the registration call.
3558 - *
3559 - * This should only be run when the option is updated from the Jetpack/WP.com
3560 - * API call, and only if the new key is different than the old key.
3561 - *
3562 - * @param mixed $old_value The old option value.
3563 - * @param mixed $value The new option value.
3564 - */
3565 - public static function updated_option( $old_value, $value ) {
3566 - // Not an API call
3567 - if ( ! class_exists( 'WPCOM_JSON_API_Update_Option_Endpoint' ) ) {
3568 - return;
3569 - }
3570 - // Only run the registration if the old key is different.
3571 - if ( $old_value !== $value ) {
3572 - self::verify_key( $value );
3573 - }
3574 - }
3575 -
3576 - /**
3577 - * Treat the creation of an API key the same as updating the API key to a new value.
3578 - *
3579 - * @param mixed $option_name Will always be "wordpress_api_key", until something else hooks in here.
3580 - * @param mixed $value The option value.
3581 - */
3582 - public static function added_option( $option_name, $value ) {
3583 - if ( 'wordpress_api_key' === $option_name ) {
3584 - return self::updated_option( '', $value );
3585 - }
3586 - }
3587 -
3588 - public static function rest_auto_check_comment( $commentdata ) {
3589 - self::$is_rest_api_call = true;
3590 -
3591 - return self::auto_check_comment( $commentdata );
3592 - }
3593 -
3594 - public static function auto_check_comment( $commentdata ) {
3595 - self::$last_comment_result = null;
3596 -
3597 - $comment = $commentdata;
3598 -
3599 - $comment['user_ip'] = self::get_ip_address();
3600 - $comment['user_agent'] = self::get_user_agent();
3601 - $comment['referrer'] = self::get_referer();
3602 - $comment['blog'] = get_option( 'home' );
3603 - $comment['blog_lang'] = get_locale();
3604 - $comment['blog_charset'] = get_option('blog_charset');
3605 - $comment['permalink'] = get_permalink( $comment['comment_post_ID'] );
3606 -
3607 - if ( ! empty( $comment['user_ID'] ) ) {
3608 - $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] );
3609 - }
3610 -
3611 - /** See filter documentation in init_hooks(). */
3612 - $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
3613 - $comment['akismet_comment_nonce'] = 'inactive';
3614 - if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
3615 - $comment['akismet_comment_nonce'] = 'failed';
3616 - if ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) )
3617 - $comment['akismet_comment_nonce'] = 'passed';
3618 -
3619 - // comment reply in wp-admin
3620 - if ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) )
3621 - $comment['akismet_comment_nonce'] = 'passed';
3622 -
3623 - }
3624 -
3625 - if ( self::is_test_mode() )
3626 - $comment['is_test'] = 'true';
3627 -
3628 - foreach( $_POST as $key => $value ) {
3629 - if ( is_string( $value ) )
3630 - $comment["POST_{$key}"] = $value;
3631 - }
3632 -
3633 - foreach ( $_SERVER as $key => $value ) {
3634 - if ( ! is_string( $value ) ) {
3635 - continue;
3636 - }
3637 -
3638 - if ( preg_match( "/^HTTP_COOKIE/", $key ) ) {
3639 - continue;
3640 - }
3641 -
3642 - // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need.
3643 - if ( preg_match( "/^(HTTP_|REMOTE_ADDR|REQUEST_URI|DOCUMENT_URI)/", $key ) ) {
3644 - $comment[ "$key" ] = $value;
3645 - }
3646 - }
3647 -
3648 - $post = get_post( $comment['comment_post_ID'] );
3649 -
3650 - if ( ! is_null( $post ) ) {
3651 - // $post can technically be null, although in the past, it's always been an indicator of another plugin interfering.
3652 - $comment[ 'comment_post_modified_gmt' ] = $post->post_modified_gmt;
3653 - }
3654 -
3655 - $response = self::http_post( Akismet::build_query( $comment ), 'comment-check' );
3656 -
3657 - do_action( 'akismet_comment_check_response', $response );
3658 -
3659 - $commentdata['comment_as_submitted'] = array_intersect_key( $comment, self::$comment_as_submitted_allowed_keys );
3660 - $commentdata['akismet_result'] = $response[1];
3661 -
3662 - if ( isset( $response[0]['x-akismet-pro-tip'] ) )
3663 - $commentdata['akismet_pro_tip'] = $response[0]['x-akismet-pro-tip'];
3664 -
3665 - if ( isset( $response[0]['x-akismet-error'] ) ) {
3666 - // An error occurred that we anticipated (like a suspended key) and want the user to act on.
3667 - // Send to moderation.
3668 - self::$last_comment_result = '0';
3669 - }
3670 - else if ( 'true' == $response[1] ) {
3671 - // akismet_spam_count will be incremented later by comment_is_spam()
3672 - self::$last_comment_result = 'spam';
3673 -
3674 - $discard = ( isset( $commentdata['akismet_pro_tip'] ) && $commentdata['akismet_pro_tip'] === 'discard' && self::allow_discard() );
3675 -
3676 - do_action( 'akismet_spam_caught', $discard );
3677 -
3678 - if ( $discard ) {
3679 - // The spam is obvious, so we're bailing out early.
3680 - // akismet_result_spam() won't be called so bump the counter here
3681 - if ( $incr = apply_filters( 'akismet_spam_count_incr', 1 ) ) {
3682 - update_option( 'akismet_spam_count', get_option( 'akismet_spam_count' ) + $incr );
3683 - }
3684 -
3685 - if ( self::$is_rest_api_call ) {
3686 - return new WP_Error( 'akismet_rest_comment_discarded', __( 'Comment discarded.', 'akismet' ) );
3687 - }
3688 - else {
3689 - // Redirect back to the previous page, or failing that, the post permalink, or failing that, the homepage of the blog.
3690 - $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ( $post ? get_permalink( $post ) : home_url() );
3691 - wp_safe_redirect( esc_url_raw( $redirect_to ) );
3692 - die();
3693 - }
3694 - }
3695 - else if ( self::$is_rest_api_call ) {
3696 - // The way the REST API structures its calls, we can set the comment_approved value right away.
3697 - $commentdata['comment_approved'] = 'spam';
3698 - }
3699 - }
3700 -
3701 - // if the response is neither true nor false, hold the comment for moderation and schedule a recheck
3702 - if ( 'true' != $response[1] && 'false' != $response[1] ) {
3703 - if ( !current_user_can('moderate_comments') ) {
3704 - // Comment status should be moderated
3705 - self::$last_comment_result = '0';
3706 - }
3707 -
3708 - if ( ! wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
3709 - wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
3710 - do_action( 'akismet_scheduled_recheck', 'invalid-response-' . $response[1] );
3711 - }
3712 -
3713 - self::$prevent_moderation_email_for_these_comments[] = $commentdata;
3714 - }
3715 -
3716 - // Delete old comments daily
3717 - if ( ! wp_next_scheduled( 'akismet_scheduled_delete' ) ) {
3718 - wp_schedule_event( time(), 'daily', 'akismet_scheduled_delete' );
3719 - }
3720 -
3721 - self::set_last_comment( $commentdata );
3722 - self::fix_scheduled_recheck();
3723 -
3724 - return $commentdata;
3725 - }
3726 -
3727 - public static function get_last_comment() {
3728 - return self::$last_comment;
3729 - }
3730 -
3731 - public static function set_last_comment( $comment ) {
3732 - if ( is_null( $comment ) ) {
3733 - self::$last_comment = null;
3734 - }
3735 - else {
3736 - // We filter it here so that it matches the filtered comment data that we'll have to compare against later.
3737 - // wp_filter_comment expects comment_author_IP
3738 - self::$last_comment = wp_filter_comment(
3739 - array_merge(
3740 - array( 'comment_author_IP' => self::get_ip_address() ),
3741 - $comment
3742 - )
3743 - );
3744 - }
3745 - }
3746 -
3747 - // this fires on wp_insert_comment. we can't update comment_meta when auto_check_comment() runs
3748 - // because we don't know the comment ID at that point.
3749 - public static function auto_check_update_meta( $id, $comment ) {
3750 - // wp_insert_comment() might be called in other contexts, so make sure this is the same comment
3751 - // as was checked by auto_check_comment
3752 - if ( is_object( $comment ) && !empty( self::$last_comment ) && is_array( self::$last_comment ) ) {
3753 - if ( self::matches_last_comment( $comment ) ) {
3754 -
3755 - load_plugin_textdomain( 'akismet' );
3756 -
3757 - // normal result: true or false
3758 - if ( self::$last_comment['akismet_result'] == 'true' ) {
3759 - update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
3760 - self::update_comment_history( $comment->comment_ID, '', 'check-spam' );
3761 - if ( $comment->comment_approved != 'spam' )
3762 - self::update_comment_history(
3763 - $comment->comment_ID,
3764 - '',
3765 - 'status-changed-'.$comment->comment_approved
3766 - );
3767 - }
3768 - elseif ( self::$last_comment['akismet_result'] == 'false' ) {
3769 - update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
3770 - self::update_comment_history( $comment->comment_ID, '', 'check-ham' );
3771 - // Status could be spam or trash, depending on the WP version and whether this change applies:
3772 - // https://core.trac.wordpress.org/changeset/34726
3773 - if ( $comment->comment_approved == 'spam' || $comment->comment_approved == 'trash' ) {
3774 - if ( wp_blacklist_check($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent) )
3775 - self::update_comment_history( $comment->comment_ID, '', 'wp-blacklisted' );
3776 - else
3777 - self::update_comment_history( $comment->comment_ID, '', 'status-changed-'.$comment->comment_approved );
3778 - }
3779 - } // abnormal result: error
3780 - else {
3781 - update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
3782 - self::update_comment_history(
3783 - $comment->comment_ID,
3784 - '',
3785 - 'check-error',
3786 - array( 'response' => substr( self::$last_comment['akismet_result'], 0, 50 ) )
3787 - );
3788 - }
3789 -
3790 - // record the complete original data as submitted for checking
3791 - if ( isset( self::$last_comment['comment_as_submitted'] ) )
3792 - update_comment_meta( $comment->comment_ID, 'akismet_as_submitted', self::$last_comment['comment_as_submitted'] );
3793 -
3794 - if ( isset( self::$last_comment['akismet_pro_tip'] ) )
3795 - update_comment_meta( $comment->comment_ID, 'akismet_pro_tip', self::$last_comment['akismet_pro_tip'] );
3796 - }
3797 - }
3798 - }
3799 -
3800 - public static function delete_old_comments() {
3801 - global $wpdb;
3802 -
3803 - /**
3804 - * Determines how many comments will be deleted in each batch.
3805 - *
3806 - * @param int The default, as defined by AKISMET_DELETE_LIMIT.
3807 - */
3808 - $delete_limit = apply_filters( 'akismet_delete_comment_limit', defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 );
3809 - $delete_limit = max( 1, intval( $delete_limit ) );
3810 -
3811 - /**
3812 - * Determines how many days a comment will be left in the Spam queue before being deleted.
3813 - *
3814 - * @param int The default number of days.
3815 - */
3816 - $delete_interval = apply_filters( 'akismet_delete_comment_interval', 15 );
3817 - $delete_interval = max( 1, intval( $delete_interval ) );
3818 -
3819 - while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL %d DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", $delete_interval, $delete_limit ) ) ) {
3820 - if ( empty( $comment_ids ) )
3821 - return;
3822 -
3823 - $wpdb->queries = array();
3824 -
3825 - foreach ( $comment_ids as $comment_id ) {
3826 - do_action( 'delete_comment', $comment_id );
3827 - do_action( 'akismet_batch_delete_count', __FUNCTION__ );
3828 - }
3829 -
3830 - // Prepared as strings since comment_id is an unsigned BIGINT, and using %d will constrain the value to the maximum signed BIGINT.
3831 - $format_string = implode( ", ", array_fill( 0, count( $comment_ids ), '%s' ) );
3832 -
3833 - $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->comments} WHERE comment_id IN ( " . $format_string . " )", $comment_ids ) );
3834 - $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->commentmeta} WHERE comment_id IN ( " . $format_string . " )", $comment_ids ) );
3835 -
3836 - clean_comment_cache( $comment_ids );
3837 - do_action( 'akismet_delete_comment_batch', count( $comment_ids ) );
3838 - }
3839 -
3840 - if ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->comments ) ) // lucky number
3841 - $wpdb->query("OPTIMIZE TABLE {$wpdb->comments}");
3842 - }
3843 -
3844 - public static function delete_old_comments_meta() {
3845 - global $wpdb;
3846 -
3847 - $interval = apply_filters( 'akismet_delete_commentmeta_interval', 15 );
3848 -
3849 - # enforce a minimum of 1 day
3850 - $interval = absint( $interval );
3851 - if ( $interval < 1 )
3852 - $interval = 1;
3853 -
3854 - // akismet_as_submitted meta values are large, so expire them
3855 - // after $interval days regardless of the comment status
3856 - while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT m.comment_id FROM {$wpdb->commentmeta} as m INNER JOIN {$wpdb->comments} as c USING(comment_id) WHERE m.meta_key = 'akismet_as_submitted' AND DATE_SUB(NOW(), INTERVAL %d DAY) > c.comment_date_gmt LIMIT 10000", $interval ) ) ) {
3857 - if ( empty( $comment_ids ) )
3858 - return;
3859 -
3860 - $wpdb->queries = array();
3861 -
3862 - foreach ( $comment_ids as $comment_id ) {
3863 - delete_comment_meta( $comment_id, 'akismet_as_submitted' );
3864 - do_action( 'akismet_batch_delete_count', __FUNCTION__ );
3865 - }
3866 -
3867 - do_action( 'akismet_delete_commentmeta_batch', count( $comment_ids ) );
3868 - }
3869 -
3870 - if ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->commentmeta ) ) // lucky number
3871 - $wpdb->query("OPTIMIZE TABLE {$wpdb->commentmeta}");
3872 - }
3873 -
3874 - // Clear out comments meta that no longer have corresponding comments in the database
3875 - public static function delete_orphaned_commentmeta() {
3876 - global $wpdb;
3877 -
3878 - $last_meta_id = 0;
3879 - $start_time = isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ? $_SERVER['REQUEST_TIME_FLOAT'] : microtime( true );
3880 - $max_exec_time = max( ini_get('max_execution_time') - 5, 3 );
3881 -
3882 - while ( $commentmeta_results = $wpdb->get_results( $wpdb->prepare( "SELECT m.meta_id, m.comment_id, m.meta_key FROM {$wpdb->commentmeta} as m LEFT JOIN {$wpdb->comments} as c USING(comment_id) WHERE c.comment_id IS NULL AND m.meta_id > %d ORDER BY m.meta_id LIMIT 1000", $last_meta_id ) ) ) {
3883 - if ( empty( $commentmeta_results ) )
3884 - return;
3885 -
3886 - $wpdb->queries = array();
3887 -
3888 - $commentmeta_deleted = 0;
3889 -
3890 - foreach ( $commentmeta_results as $commentmeta ) {
3891 - if ( 'akismet_' == substr( $commentmeta->meta_key, 0, 8 ) ) {
3892 - delete_comment_meta( $commentmeta->comment_id, $commentmeta->meta_key );
3893 - do_action( 'akismet_batch_delete_count', __FUNCTION__ );
3894 - $commentmeta_deleted++;
3895 - }
3896 -
3897 - $last_meta_id = $commentmeta->meta_id;
3898 - }
3899 -
3900 - do_action( 'akismet_delete_commentmeta_batch', $commentmeta_deleted );
3901 -
3902 - // If we're getting close to max_execution_time, quit for this round.
3903 - if ( microtime(true) - $start_time > $max_exec_time )
3904 - return;
3905 - }
3906 -
3907 - if ( apply_filters( 'akismet_optimize_table', ( mt_rand(1, 5000) == 11), $wpdb->commentmeta ) ) // lucky number
3908 - $wpdb->query("OPTIMIZE TABLE {$wpdb->commentmeta}");
3909 - }
3910 -
3911 - // how many approved comments does this author have?
3912 - public static function get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
3913 - global $wpdb;
3914 -
3915 - if ( !empty( $user_id ) )
3916 - return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE user_id = %d AND comment_approved = 1", $user_id ) );
3917 -
3918 - if ( !empty( $comment_author_email ) )
3919 - return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1", $comment_author_email, $comment_author, $comment_author_url ) );
3920 -
3921 - return 0;
3922 - }
3923 -
3924 - // get the full comment history for a given comment, as an array in reverse chronological order
3925 - public static function get_comment_history( $comment_id ) {
3926 - $history = get_comment_meta( $comment_id, 'akismet_history', false );
3927 - usort( $history, array( 'Akismet', '_cmp_time' ) );
3928 - return $history;
3929 - }
3930 -
3931 - /**
3932 - * Log an event for a given comment, storing it in comment_meta.
3933 - *
3934 - * @param int $comment_id The ID of the relevant comment.
3935 - * @param string $message The string description of the event. No longer used.
3936 - * @param string $event The event code.
3937 - * @param array $meta Metadata about the history entry. e.g., the user that reported or changed the status of a given comment.
3938 - */
3939 - public static function update_comment_history( $comment_id, $message, $event=null, $meta=null ) {
3940 - global $current_user;
3941 -
3942 - $user = '';
3943 -
3944 - $event = array(
3945 - 'time' => self::_get_microtime(),
3946 - 'event' => $event,
3947 - );
3948 -
3949 - if ( is_object( $current_user ) && isset( $current_user->user_login ) ) {
3950 - $event['user'] = $current_user->user_login;
3951 - }
3952 -
3953 - if ( ! empty( $meta ) ) {
3954 - $event['meta'] = $meta;
3955 - }
3956 -
3957 - // $unique = false so as to allow multiple values per comment
3958 - $r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
3959 - }
3960 -
3961 - public static function check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
3962 - global $wpdb;
3963 -
3964 - $c = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_ID = %d", $id ), ARRAY_A );
3965 -
3966 - if ( ! $c ) {
3967 - return new WP_Error( 'invalid-comment-id', __( 'Comment not found.', 'akismet' ) );
3968 - }
3969 -
3970 - $c['user_ip'] = $c['comment_author_IP'];
3971 - $c['user_agent'] = $c['comment_agent'];
3972 - $c['referrer'] = '';
3973 - $c['blog'] = get_option( 'home' );
3974 - $c['blog_lang'] = get_locale();
3975 - $c['blog_charset'] = get_option('blog_charset');
3976 - $c['permalink'] = get_permalink($c['comment_post_ID']);
3977 - $c['recheck_reason'] = $recheck_reason;
3978 -
3979 - $c['user_role'] = '';
3980 - if ( ! empty( $c['user_ID'] ) ) {
3981 - $c['user_role'] = Akismet::get_user_roles( $c['user_ID'] );
3982 - }
3983 -
3984 - if ( self::is_test_mode() )
3985 - $c['is_test'] = 'true';
3986 -
3987 - $response = self::http_post( Akismet::build_query( $c ), 'comment-check' );
3988 -
3989 - if ( ! empty( $response[1] ) ) {
3990 - return $response[1];
3991 - }
3992 -
3993 - return false;
3994 - }
3995 -
3996 - public static function recheck_comment( $id, $recheck_reason = 'recheck_queue' ) {
3997 - add_comment_meta( $id, 'akismet_rechecking', true );
3998 -
3999 - $api_response = self::check_db_comment( $id, $recheck_reason );
4000 -
4001 - delete_comment_meta( $id, 'akismet_rechecking' );
4002 -
4003 - if ( is_wp_error( $api_response ) ) {
4004 - // Invalid comment ID.
4005 - }
4006 - else if ( 'true' === $api_response ) {
4007 - wp_set_comment_status( $id, 'spam' );
4008 - update_comment_meta( $id, 'akismet_result', 'true' );
4009 - delete_comment_meta( $id, 'akismet_error' );
4010 - delete_comment_meta( $id, 'akismet_delayed_moderation_email' );
4011 - Akismet::update_comment_history( $id, '', 'recheck-spam' );
4012 - }
4013 - elseif ( 'false' === $api_response ) {
4014 - update_comment_meta( $id, 'akismet_result', 'false' );
4015 - delete_comment_meta( $id, 'akismet_error' );
4016 - delete_comment_meta( $id, 'akismet_delayed_moderation_email' );
4017 - Akismet::update_comment_history( $id, '', 'recheck-ham' );
4018 - }
4019 - else {
4020 - // abnormal result: error
4021 - update_comment_meta( $id, 'akismet_result', 'error' );
4022 - Akismet::update_comment_history(
4023 - $id,
4024 - '',
4025 - 'recheck-error',
4026 - array( 'response' => substr( $api_response, 0, 50 ) )
4027 - );
4028 - }
4029 -
4030 - return $api_response;
4031 - }
4032 -
4033 - public static function transition_comment_status( $new_status, $old_status, $comment ) {
4034 -
4035 - if ( $new_status == $old_status )
4036 - return;
4037 -
4038 - if ( 'spam' === $new_status || 'spam' === $old_status ) {
4039 - // Clear the cache of the "X comments in your spam queue" count on the dashboard.
4040 - wp_cache_delete( 'akismet_spam_count', 'widget' );
4041 - }
4042 -
4043 - # we don't need to record a history item for deleted comments
4044 - if ( $new_status == 'delete' )
4045 - return;
4046 -
4047 - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
4048 - return;
4049 -
4050 - if ( defined('WP_IMPORTING') && WP_IMPORTING == true )
4051 - return;
4052 -
4053 - // if this is present, it means the status has been changed by a re-check, not an explicit user action
4054 - if ( get_comment_meta( $comment->comment_ID, 'akismet_rechecking' ) )
4055 - return;
4056 -
4057 - // Assumption alert:
4058 - // We want to submit comments to Akismet only when a moderator explicitly spams or approves it - not if the status
4059 - // is changed automatically by another plugin. Unfortunately WordPress doesn't provide an unambiguous way to
4060 - // determine why the transition_comment_status action was triggered. And there are several different ways by which
4061 - // to spam and unspam comments: bulk actions, ajax, links in moderation emails, the dashboard, and perhaps others.
4062 - // We'll assume that this is an explicit user action if certain POST/GET variables exist.
4063 - if (
4064 - // status=spam: Marking as spam via the REST API or...
4065 - // status=unspam: I'm not sure. Maybe this used to be used instead of status=approved? Or the UI for removing from spam but not approving has been since removed?...
4066 - // status=approved: Unspamming via the REST API (Calypso) or...
4067 - ( isset( $_POST['status'] ) && in_array( $_POST['status'], array( 'spam', 'unspam', 'approved', ) ) )
4068 - // spam=1: Clicking "Spam" underneath a comment in wp-admin and allowing the AJAX request to happen.
4069 - || ( isset( $_POST['spam'] ) && (int) $_POST['spam'] == 1 )
4070 - // unspam=1: Clicking "Not Spam" underneath a comment in wp-admin and allowing the AJAX request to happen. Or, clicking "Undo" after marking something as spam.
4071 - || ( isset( $_POST['unspam'] ) && (int) $_POST['unspam'] == 1 )
4072 - // comment_status=spam/unspam: It's unclear where this is happening.
4073 - || ( isset( $_POST['comment_status'] ) && in_array( $_POST['comment_status'], array( 'spam', 'unspam' ) ) )
4074 - // action=spam: Choosing "Mark as Spam" from the Bulk Actions dropdown in wp-admin (or the "Spam it" link in notification emails).
4075 - // action=unspam: Choosing "Not Spam" from the Bulk Actions dropdown in wp-admin.
4076 - // action=spamcomment: Following the "Spam" link below a comment in wp-admin (not allowing AJAX request to happen).
4077 - // action=unspamcomment: Following the "Not Spam" link below a comment in wp-admin (not allowing AJAX request to happen).
4078 - || ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'spam', 'unspam', 'spamcomment', 'unspamcomment', ) ) )
4079 - // action=editedcomment: Editing a comment via wp-admin (and possibly changing its status).
4080 - || ( isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'editedcomment' ) ) )
4081 - // for=jetpack: Moderation via the WordPress app, Calypso, anything powered by the Jetpack connection.
4082 - || ( isset( $_GET['for'] ) && ( 'jetpack' == $_GET['for'] ) && ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) )
4083 - // Certain WordPress.com API requests
4084 - || ( defined( 'REST_API_REQUEST' ) && REST_API_REQUEST )
4085 - // WordPress.org REST API requests
4086 - || ( defined( 'REST_REQUEST' ) && REST_REQUEST )
4087 - ) {
4088 - if ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) {
4089 - return self::submit_spam_comment( $comment->comment_ID );
4090 - } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
4091 - return self::submit_nonspam_comment( $comment->comment_ID );
4092 - }
4093 - }
4094 -
4095 - self::update_comment_history( $comment->comment_ID, '', 'status-' . $new_status );
4096 - }
4097 -
4098 - public static function submit_spam_comment( $comment_id ) {
4099 - global $wpdb, $current_user, $current_site;
4100 -
4101 - $comment_id = (int) $comment_id;
4102 -
4103 - $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_ID = %d", $comment_id ) );
4104 -
4105 - if ( !$comment ) // it was deleted
4106 - return;
4107 -
4108 - if ( 'spam' != $comment->comment_approved )
4109 - return;
4110 -
4111 - // use the original version stored in comment_meta if available
4112 - $as_submitted = self::sanitize_comment_as_submitted( get_comment_meta( $comment_id, 'akismet_as_submitted', true ) );
4113 -
4114 - if ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) )
4115 - $comment = (object) array_merge( (array)$comment, $as_submitted );
4116 -
4117 - $comment->blog = get_option( 'home' );
4118 - $comment->blog_lang = get_locale();
4119 - $comment->blog_charset = get_option('blog_charset');
4120 - $comment->permalink = get_permalink($comment->comment_post_ID);
4121 -
4122 - if ( is_object($current_user) )
4123 - $comment->reporter = $current_user->user_login;
4124 -
4125 - if ( is_object($current_site) )
4126 - $comment->site_domain = $current_site->domain;
4127 -
4128 - $comment->user_role = '';
4129 - if ( ! empty( $comment->user_ID ) ) {
4130 - $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
4131 - }
4132 -
4133 - if ( self::is_test_mode() )
4134 - $comment->is_test = 'true';
4135 -
4136 - $post = get_post( $comment->comment_post_ID );
4137 -
4138 - if ( ! is_null( $post ) ) {
4139 - $comment->comment_post_modified_gmt = $post->post_modified_gmt;
4140 - }
4141 -
4142 - $response = Akismet::http_post( Akismet::build_query( $comment ), 'submit-spam' );
4143 - if ( $comment->reporter ) {
4144 - self::update_comment_history( $comment_id, '', 'report-spam' );
4145 - update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
4146 - update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
4147 - }
4148 -
4149 - do_action('akismet_submit_spam_comment', $comment_id, $response[1]);
4150 - }
4151 -
4152 - public static function submit_nonspam_comment( $comment_id ) {
4153 - global $wpdb, $current_user, $current_site;
4154 -
4155 - $comment_id = (int) $comment_id;
4156 -
4157 - $comment = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_ID = %d", $comment_id ) );
4158 - if ( !$comment ) // it was deleted
4159 - return;
4160 -
4161 - // use the original version stored in comment_meta if available
4162 - $as_submitted = self::sanitize_comment_as_submitted( get_comment_meta( $comment_id, 'akismet_as_submitted', true ) );
4163 -
4164 - if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) )
4165 - $comment = (object) array_merge( (array)$comment, $as_submitted );
4166 -
4167 - $comment->blog = get_option( 'home' );
4168 - $comment->blog_lang = get_locale();
4169 - $comment->blog_charset = get_option('blog_charset');
4170 - $comment->permalink = get_permalink( $comment->comment_post_ID );
4171 - $comment->user_role = '';
4172 -
4173 - if ( is_object($current_user) )
4174 - $comment->reporter = $current_user->user_login;
4175 -
4176 - if ( is_object($current_site) )
4177 - $comment->site_domain = $current_site->domain;
4178 -
4179 - if ( ! empty( $comment->user_ID ) ) {
4180 - $comment->user_role = Akismet::get_user_roles( $comment->user_ID );
4181 - }
4182 -
4183 - if ( Akismet::is_test_mode() )
4184 - $comment->is_test = 'true';
4185 -
4186 - $post = get_post( $comment->comment_post_ID );
4187 -
4188 - if ( ! is_null( $post ) ) {
4189 - $comment->comment_post_modified_gmt = $post->post_modified_gmt;
4190 - }
4191 -
4192 - $response = self::http_post( Akismet::build_query( $comment ), 'submit-ham' );
4193 - if ( $comment->reporter ) {
4194 - self::update_comment_history( $comment_id, '', 'report-ham' );
4195 - update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
4196 - update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
4197 - }
4198 -
4199 - do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
4200 - }
4201 -
4202 - public static function cron_recheck() {
4203 - global $wpdb;
4204 -
4205 - $api_key = self::get_api_key();
4206 -
4207 - $status = self::verify_key( $api_key );
4208 - if ( get_option( 'akismet_alert_code' ) || $status == 'invalid' ) {
4209 - // since there is currently a problem with the key, reschedule a check for 6 hours hence
4210 - wp_schedule_single_event( time() + 21600, 'akismet_schedule_cron_recheck' );
4211 - do_action( 'akismet_scheduled_recheck', 'key-problem-' . get_option( 'akismet_alert_code' ) . '-' . $status );
4212 - return false;
4213 - }
4214 -
4215 - delete_option('akismet_available_servers');
4216 -
4217 - $comment_errors = $wpdb->get_col( "SELECT comment_id FROM {$wpdb->commentmeta} WHERE meta_key = 'akismet_error' LIMIT 100" );
4218 -
4219 - load_plugin_textdomain( 'akismet' );
4220 -
4221 - foreach ( (array) $comment_errors as $comment_id ) {
4222 - // if the comment no longer exists, or is too old, remove the meta entry from the queue to avoid getting stuck
4223 - $comment = get_comment( $comment_id );
4224 -
4225 - if (
4226 - ! $comment // Comment has been deleted
4227 - || strtotime( $comment->comment_date_gmt ) < strtotime( "-15 days" ) // Comment is too old.
4228 - || $comment->comment_approved !== "0" // Comment is no longer in the Pending queue
4229 - ) {
4230 - delete_comment_meta( $comment_id, 'akismet_error' );
4231 - delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );
4232 - continue;
4233 - }
4234 -
4235 - add_comment_meta( $comment_id, 'akismet_rechecking', true );
4236 - $status = self::check_db_comment( $comment_id, 'retry' );
4237 -
4238 - $event = '';
4239 - if ( $status == 'true' ) {
4240 - $event = 'cron-retry-spam';
4241 - } elseif ( $status == 'false' ) {
4242 - $event = 'cron-retry-ham';
4243 - }
4244 -
4245 - // If we got back a legit response then update the comment history
4246 - // other wise just bail now and try again later. No point in
4247 - // re-trying all the comments once we hit one failure.
4248 - if ( !empty( $event ) ) {
4249 - delete_comment_meta( $comment_id, 'akismet_error' );
4250 - self::update_comment_history( $comment_id, '', $event );
4251 - update_comment_meta( $comment_id, 'akismet_result', $status );
4252 - // make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
4253 - $comment = get_comment( $comment_id );
4254 - if ( $comment && 'unapproved' == wp_get_comment_status( $comment_id ) ) {
4255 - if ( $status == 'true' ) {
4256 - wp_spam_comment( $comment_id );
4257 - } elseif ( $status == 'false' ) {
4258 - // comment is good, but it's still in the pending queue. depending on the moderation settings
4259 - // we may need to change it to approved.
4260 - if ( check_comment($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent, $comment->comment_type) )
4261 - wp_set_comment_status( $comment_id, 1 );
4262 - else if ( get_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true ) )
4263 - wp_notify_moderator( $comment_id );
4264 - }
4265 - }
4266 -
4267 - delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );
4268 - } else {
4269 - // If this comment has been pending moderation for longer than MAX_DELAY_BEFORE_MODERATION_EMAIL,
4270 - // send a moderation email now.
4271 - if ( ( intval( gmdate( 'U' ) ) - strtotime( $comment->comment_date_gmt ) ) < self::MAX_DELAY_BEFORE_MODERATION_EMAIL ) {
4272 - delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );
4273 - wp_notify_moderator( $comment_id );
4274 - }
4275 -
4276 - delete_comment_meta( $comment_id, 'akismet_rechecking' );
4277 - wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
4278 - do_action( 'akismet_scheduled_recheck', 'check-db-comment-' . $status );
4279 - return;
4280 - }
4281 - delete_comment_meta( $comment_id, 'akismet_rechecking' );
4282 - }
4283 -
4284 - $remaining = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->commentmeta} WHERE meta_key = 'akismet_error'" );
4285 - if ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {
4286 - wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
4287 - do_action( 'akismet_scheduled_recheck', 'remaining' );
4288 - }
4289 - }
4290 -
4291 - public static function fix_scheduled_recheck() {
4292 - $future_check = wp_next_scheduled( 'akismet_schedule_cron_recheck' );
4293 - if ( !$future_check ) {
4294 - return;
4295 - }
4296 -
4297 - if ( get_option( 'akismet_alert_code' ) > 0 ) {
4298 - return;
4299 - }
4300 -
4301 - $check_range = time() + 1200;
4302 - if ( $future_check > $check_range ) {
4303 - wp_clear_scheduled_hook( 'akismet_schedule_cron_recheck' );
4304 - wp_schedule_single_event( time() + 300, 'akismet_schedule_cron_recheck' );
4305 - do_action( 'akismet_scheduled_recheck', 'fix-scheduled-recheck' );
4306 - }
4307 - }
4308 -
4309 - public static function add_comment_nonce( $post_id ) {
4310 - /**
4311 - * To disable the Akismet comment nonce, add a filter for the 'akismet_comment_nonce' tag
4312 - * and return any string value that is not 'true' or '' (empty string).
4313 - *
4314 - * Don't return boolean false, because that implies that the 'akismet_comment_nonce' option
4315 - * has not been set and that Akismet should just choose the default behavior for that
4316 - * situation.
4317 - */
4318 - $akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
4319 -
4320 - if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' ) {
4321 - echo '<p style="display: none;">';
4322 - wp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE );
4323 - echo '</p>';
4324 - }
4325 - }
4326 -
4327 - public static function is_test_mode() {
4328 - return defined('AKISMET_TEST_MODE') && AKISMET_TEST_MODE;
4329 - }
4330 -
4331 - public static function allow_discard() {
4332 - if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
4333 - return false;
4334 - if ( is_user_logged_in() )
4335 - return false;
4336 -
4337 - return ( get_option( 'akismet_strictness' ) === '1' );
4338 - }
4339 -
4340 - public static function get_ip_address() {
4341 - return isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;
4342 - }
4343 -
4344 - /**
4345 - * Do these two comments, without checking the comment_ID, "match"?
4346 - *
4347 - * @param mixed $comment1 A comment object or array.
4348 - * @param mixed $comment2 A comment object or array.
4349 - * @return bool Whether the two comments should be treated as the same comment.
4350 - */
4351 - private static function comments_match( $comment1, $comment2 ) {
4352 - $comment1 = (array) $comment1;
4353 - $comment2 = (array) $comment2;
4354 -
4355 - // Set default values for these strings that we check in order to simplify
4356 - // the checks and avoid PHP warnings.
4357 - if ( ! isset( $comment1['comment_author'] ) ) {
4358 - $comment1['comment_author'] = '';
4359 - }
4360 -
4361 - if ( ! isset( $comment2['comment_author'] ) ) {
4362 - $comment2['comment_author'] = '';
4363 - }
4364 -
4365 - if ( ! isset( $comment1['comment_author_email'] ) ) {
4366 - $comment1['comment_author_email'] = '';
4367 - }
4368 -
4369 - if ( ! isset( $comment2['comment_author_email'] ) ) {
4370 - $comment2['comment_author_email'] = '';
4371 - }
4372 -
4373 - $comments_match = (
4374 - isset( $comment1['comment_post_ID'], $comment2['comment_post_ID'] )
4375 - && intval( $comment1['comment_post_ID'] ) == intval( $comment2['comment_post_ID'] )
4376 - && (
4377 - // The comment author length max is 255 characters, limited by the TINYTEXT column type.
4378 - // If the comment author includes multibyte characters right around the 255-byte mark, they
4379 - // may be stripped when the author is saved in the DB, so a 300+ char author may turn into
4380 - // a 253-char author when it's saved, not 255 exactly. The longest possible character is
4381 - // theoretically 6 bytes, so we'll only look at the first 248 bytes to be safe.
4382 - substr( $comment1['comment_author'], 0, 248 ) == substr( $comment2['comment_author'], 0, 248 )
4383 - || substr( stripslashes( $comment1['comment_author'] ), 0, 248 ) == substr( $comment2['comment_author'], 0, 248 )
4384 - || substr( $comment1['comment_author'], 0, 248 ) == substr( stripslashes( $comment2['comment_author'] ), 0, 248 )
4385 - // Certain long comment author names will be truncated to nothing, depending on their encoding.
4386 - || ( ! $comment1['comment_author'] && strlen( $comment2['comment_author'] ) > 248 )
4387 - || ( ! $comment2['comment_author'] && strlen( $comment1['comment_author'] ) > 248 )
4388 - )
4389 - && (
4390 - // The email max length is 100 characters, limited by the VARCHAR(100) column type.
4391 - // Same argument as above for only looking at the first 93 characters.
4392 - substr( $comment1['comment_author_email'], 0, 93 ) == substr( $comment2['comment_author_email'], 0, 93 )
4393 - || substr( stripslashes( $comment1['comment_author_email'] ), 0, 93 ) == substr( $comment2['comment_author_email'], 0, 93 )
4394 - || substr( $comment1['comment_author_email'], 0, 93 ) == substr( stripslashes( $comment2['comment_author_email'] ), 0, 93 )
4395 - // Very long emails can be truncated and then stripped if the [0:100] substring isn't a valid address.
4396 - || ( ! $comment1['comment_author_email'] && strlen( $comment2['comment_author_email'] ) > 100 )
4397 - || ( ! $comment2['comment_author_email'] && strlen( $comment1['comment_author_email'] ) > 100 )
4398 - )
4399 - );
4400 -
4401 - return $comments_match;
4402 - }
4403 -
4404 - // Does the supplied comment match the details of the one most recently stored in self::$last_comment?
4405 - public static function matches_last_comment( $comment ) {
4406 - return self::comments_match( self::$last_comment, $comment );
4407 - }
4408 -
4409 - private static function get_user_agent() {
4410 - return isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null;
4411 - }
4412 -
4413 - private static function get_referer() {
4414 - return isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : null;
4415 - }
4416 -
4417 - // return a comma-separated list of role names for the given user
4418 - public static function get_user_roles( $user_id ) {
4419 - $roles = false;
4420 -
4421 - if ( !class_exists('WP_User') )
4422 - return false;
4423 -
4424 - if ( $user_id > 0 ) {
4425 - $comment_user = new WP_User( $user_id );
4426 - if ( isset( $comment_user->roles ) )
4427 - $roles = join( ',', $comment_user->roles );
4428 - }
4429 -
4430 - if ( is_multisite() && is_super_admin( $user_id ) ) {
4431 - if ( empty( $roles ) ) {
4432 - $roles = 'super_admin';
4433 - } else {
4434 - $comment_user->roles[] = 'super_admin';
4435 - $roles = join( ',', $comment_user->roles );
4436 - }
4437 - }
4438 -
4439 - return $roles;
4440 - }
4441 -
4442 - // filter handler used to return a spam result to pre_comment_approved
4443 - public static function last_comment_status( $approved, $comment ) {
4444 - if ( is_null( self::$last_comment_result ) ) {
4445 - // We didn't have reason to store the result of the last check.
4446 - return $approved;
4447 - }
4448 -
4449 - // Only do this if it's the correct comment
4450 - if ( ! self::matches_last_comment( $comment ) ) {
4451 - self::log( "comment_is_spam mismatched comment, returning unaltered $approved" );
4452 - return $approved;
4453 - }
4454 -
4455 - if ( 'trash' === $approved ) {
4456 - // If the last comment we checked has had its approval set to 'trash',
4457 - // then it failed the comment blacklist check. Let that blacklist override
4458 - // the spam check, since users have the (valid) expectation that when
4459 - // they fill out their blacklists, comments that match it will always
4460 - // end up in the trash.
4461 - return $approved;
4462 - }
4463 -
4464 - // bump the counter here instead of when the filter is added to reduce the possibility of overcounting
4465 - if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
4466 - update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
4467 -
4468 - return self::$last_comment_result;
4469 - }
4470 -
4471 - /**
4472 - * If Akismet is temporarily unreachable, we don't want to "spam" the blogger with
4473 - * moderation emails for comments that will be automatically cleared or spammed on
4474 - * the next retry.
4475 - *
4476 - * For comments that will be rechecked later, empty the list of email addresses that
4477 - * the moderation email would be sent to.
4478 - *
4479 - * @param array $emails An array of email addresses that the moderation email will be sent to.
4480 - * @param int $comment_id The ID of the relevant comment.
4481 - * @return array An array of email addresses that the moderation email will be sent to.
4482 - */
4483 - public static function disable_moderation_emails_if_unreachable( $emails, $comment_id ) {
4484 - if ( ! empty( self::$prevent_moderation_email_for_these_comments ) && ! empty( $emails ) ) {
4485 - $comment = get_comment( $comment_id );
4486 -
4487 - foreach ( self::$prevent_moderation_email_for_these_comments as $possible_match ) {
4488 - if ( self::comments_match( $possible_match, $comment ) ) {
4489 - update_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true );
4490 - return array();
4491 - }
4492 - }
4493 - }
4494 -
4495 - return $emails;
4496 - }
4497 -
4498 - public static function _cmp_time( $a, $b ) {
4499 - return $a['time'] > $b['time'] ? -1 : 1;
4500 - }
4501 -
4502 - public static function _get_microtime() {
4503 - $mtime = explode( ' ', microtime() );
4504 - return $mtime[1] + $mtime[0];
4505 - }
4506 -
4507 - /**
4508 - * Make a POST request to the Akismet API.
4509 - *
4510 - * @param string $request The body of the request.
4511 - * @param string $path The path for the request.
4512 - * @param string $ip The specific IP address to hit.
4513 - * @return array A two-member array consisting of the headers and the response body, both empty in the case of a failure.
4514 - */
4515 - public static function http_post( $request, $path, $ip=null ) {
4516 -
4517 - $akismet_ua = sprintf( 'WordPress/%s | Akismet/%s', $GLOBALS['wp_version'], constant( 'AKISMET_VERSION' ) );
4518 - $akismet_ua = apply_filters( 'akismet_ua', $akismet_ua );
4519 -
4520 - $content_length = strlen( $request );
4521 -
4522 - $api_key = self::get_api_key();
4523 - $host = self::API_HOST;
4524 -
4525 - if ( !empty( $api_key ) )
4526 - $host = $api_key.'.'.$host;
4527 -
4528 - $http_host = $host;
4529 - // use a specific IP if provided
4530 - // needed by Akismet_Admin::check_server_connectivity()
4531 - if ( $ip && long2ip( ip2long( $ip ) ) ) {
4532 - $http_host = $ip;
4533 - }
4534 -
4535 - $http_args = array(
4536 - 'body' => $request,
4537 - 'headers' => array(
4538 - 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ),
4539 - 'Host' => $host,
4540 - 'User-Agent' => $akismet_ua,
4541 - ),
4542 - 'httpversion' => '1.0',
4543 - 'timeout' => 15
4544 - );
4545 -
4546 - $akismet_url = $http_akismet_url = "http://{$http_host}/1.1/{$path}";
4547 -
4548 - /**
4549 - * Try SSL first; if that fails, try without it and don't try it again for a while.
4550 - */
4551 -
4552 - $ssl = $ssl_failed = false;
4553 -
4554 - // Check if SSL requests were disabled fewer than X hours ago.
4555 - $ssl_disabled = get_option( 'akismet_ssl_disabled' );
4556 -
4557 - if ( $ssl_disabled && $ssl_disabled < ( time() - 60 * 60 * 24 ) ) { // 24 hours
4558 - $ssl_disabled = false;
4559 - delete_option( 'akismet_ssl_disabled' );
4560 - }
4561 - else if ( $ssl_disabled ) {
4562 - do_action( 'akismet_ssl_disabled' );
4563 - }
4564 -
4565 - if ( ! $ssl_disabled && ( $ssl = wp_http_supports( array( 'ssl' ) ) ) ) {
4566 - $akismet_url = set_url_scheme( $akismet_url, 'https' );
4567 -
4568 - do_action( 'akismet_https_request_pre' );
4569 - }
4570 -
4571 - $response = wp_remote_post( $akismet_url, $http_args );
4572 -
4573 - Akismet::log( compact( 'akismet_url', 'http_args', 'response' ) );
4574 -
4575 - if ( $ssl && is_wp_error( $response ) ) {
4576 - do_action( 'akismet_https_request_failure', $response );
4577 -
4578 - // Intermittent connection problems may cause the first HTTPS
4579 - // request to fail and subsequent HTTP requests to succeed randomly.
4580 - // Retry the HTTPS request once before disabling SSL for a time.
4581 - $response = wp_remote_post( $akismet_url, $http_args );
4582 -
4583 - Akismet::log( compact( 'akismet_url', 'http_args', 'response' ) );
4584 -
4585 - if ( is_wp_error( $response ) ) {
4586 - $ssl_failed = true;
4587 -
4588 - do_action( 'akismet_https_request_failure', $response );
4589 -
4590 - do_action( 'akismet_http_request_pre' );
4591 -
4592 - // Try the request again without SSL.
4593 - $response = wp_remote_post( $http_akismet_url, $http_args );
4594 -
4595 - Akismet::log( compact( 'http_akismet_url', 'http_args', 'response' ) );
4596 - }
4597 - }
4598 -
4599 - if ( is_wp_error( $response ) ) {
4600 - do_action( 'akismet_request_failure', $response );
4601 -
4602 - return array( '', '' );
4603 - }
4604 -
4605 - if ( $ssl_failed ) {
4606 - // The request failed when using SSL but succeeded without it. Disable SSL for future requests.
4607 - update_option( 'akismet_ssl_disabled', time() );
4608 -
4609 - do_action( 'akismet_https_disabled' );
4610 - }
4611 -
4612 - $simplified_response = array( $response['headers'], $response['body'] );
4613 -
4614 - self::update_alert( $simplified_response );
4615 -
4616 - return $simplified_response;
4617 - }
4618 -
4619 - // given a response from an API call like check_key_status(), update the alert code options if an alert is present.
4620 - public static function update_alert( $response ) {
4621 - $code = $msg = null;
4622 - if ( isset( $response[0]['x-akismet-alert-code'] ) ) {
4623 - $code = $response[0]['x-akismet-alert-code'];
4624 - $msg = $response[0]['x-akismet-alert-msg'];
4625 - }
4626 -
4627 - // only call update_option() if the value has changed
4628 - if ( $code != get_option( 'akismet_alert_code' ) ) {
4629 - if ( ! $code ) {
4630 - delete_option( 'akismet_alert_code' );
4631 - delete_option( 'akismet_alert_msg' );
4632 - }
4633 - else {
4634 - update_option( 'akismet_alert_code', $code );
4635 - update_option( 'akismet_alert_msg', $msg );
4636 - }
4637 - }
4638 - }
4639 -
4640 - public static function load_form_js() {
4641 - if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
4642 - return;
4643 - }
4644 -
4645 - wp_register_script( 'akismet-form', plugin_dir_url( __FILE__ ) . '_inc/form.js', array(), AKISMET_VERSION, true );
4646 - wp_enqueue_script( 'akismet-form' );
4647 - }
4648 -
4649 - /**
4650 - * Mark form.js as async. Because nothing depends on it, it can run at any time
4651 - * after it's loaded, and the browser won't have to wait for it to load to continue
4652 - * parsing the rest of the page.
4653 - */
4654 - public static function set_form_js_async( $tag, $handle, $src ) {
4655 - if ( 'akismet-form' !== $handle ) {
4656 - return $tag;
4657 - }
4658 -
4659 - return preg_replace( '/^<script /i', '<script async="async" ', $tag );
4660 - }
4661 -
4662 - public static function inject_ak_js( $fields ) {
4663 - echo '<p style="display: none;">';
4664 - echo '<input type="hidden" id="ak_js" name="ak_js" value="' . mt_rand( 0, 250 ) . '"/>';
4665 - echo '</p>';
4666 - }
4667 -
4668 - private static function bail_on_activation( $message, $deactivate = true ) {
4669 -?>
4670 -<!doctype html>
4671 -<html>
4672 -<head>
4673 -<meta charset="<?php bloginfo( 'charset' ); ?>" />
4674 -<style>
4675 -* {
4676 - text-align: center;
4677 - margin: 0;
4678 - padding: 0;
4679 - font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
4680 -}
4681 -p {
4682 - margin-top: 1em;
4683 - font-size: 18px;
4684 -}
4685 -</style>
4686 -</head>
4687 -<body>
4688 -<p><?php echo esc_html( $message ); ?></p>
4689 -</body>
4690 -</html>
4691 -<?php
4692 - if ( $deactivate ) {
4693 - $plugins = get_option( 'active_plugins' );
4694 - $akismet = plugin_basename( AKISMET__PLUGIN_DIR . 'akismet.php' );
4695 - $update = false;
4696 - foreach ( $plugins as $i => $plugin ) {
4697 - if ( $plugin === $akismet ) {
4698 - $plugins[$i] = false;
4699 - $update = true;
4700 - }
4701 - }
4702 -
4703 - if ( $update ) {
4704 - update_option( 'active_plugins', array_filter( $plugins ) );
4705 - }
4706 - }
4707 - exit;
4708 - }
4709 -
4710 - public static function view( $name, array $args = array() ) {
4711 - $args = apply_filters( 'akismet_view_arguments', $args, $name );
4712 -
4713 - foreach ( $args AS $key => $val ) {
4714 - $$key = $val;
4715 - }
4716 -
4717 - load_plugin_textdomain( 'akismet' );
4718 -
4719 - $file = AKISMET__PLUGIN_DIR . 'views/'. $name . '.php';
4720 -
4721 - include( $file );
4722 - }
4723 -
4724 - /**
4725 - * Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook()
4726 - * @static
4727 - */
4728 - public static function plugin_activation() {
4729 - if ( version_compare( $GLOBALS['wp_version'], AKISMET__MINIMUM_WP_VERSION, '<' ) ) {
4730 - load_plugin_textdomain( 'akismet' );
4731 -
4732 - $message = '<strong>'.sprintf(esc_html__( 'Akismet %s requires WordPress %s or higher.' , 'akismet'), AKISMET_VERSION, AKISMET__MINIMUM_WP_VERSION ).'</strong> '.sprintf(__('Please <a href="%1$s">upgrade WordPress</a> to a current version, or <a href="%2$s">downgrade to version 2.4 of the Akismet plugin</a>.', 'akismet'), 'https://codex.wordpress.org/Upgrading_WordPress', 'https://wordpress.org/extend/plugins/akismet/download/');
4733 -
4734 - Akismet::bail_on_activation( $message );
4735 - }
4736 - }
4737 -
4738 - /**
4739 - * Removes all connection options
4740 - * @static
4741 - */
4742 - public static function plugin_deactivation( ) {
4743 - self::deactivate_key( self::get_api_key() );
4744 -
4745 - // Remove any scheduled cron jobs.
4746 - $akismet_cron_events = array(
4747 - 'akismet_schedule_cron_recheck',
4748 - 'akismet_scheduled_delete',
4749 - );
4750 -
4751 - foreach ( $akismet_cron_events as $akismet_cron_event ) {
4752 - $timestamp = wp_next_scheduled( $akismet_cron_event );
4753 -
4754 - if ( $timestamp ) {
4755 - wp_unschedule_event( $timestamp, $akismet_cron_event );
4756 - }
4757 - }
4758 - }
4759 -
4760 - /**
4761 - * Essentially a copy of WP's build_query but one that doesn't expect pre-urlencoded values.
4762 - *
4763 - * @param array $args An array of key => value pairs
4764 - * @return string A string ready for use as a URL query string.
4765 - */
4766 - public static function build_query( $args ) {
4767 - return _http_build_query( $args, '', '&' );
4768 - }
4769 -
4770 - /**
4771 - * Log debugging info to the error log.
4772 - *
4773 - * Enabled when WP_DEBUG_LOG is enabled (and WP_DEBUG, since according to
4774 - * core, "WP_DEBUG_DISPLAY and WP_DEBUG_LOG perform no function unless
4775 - * WP_DEBUG is true), but can be disabled via the akismet_debug_log filter.
4776 - *
4777 - * @param mixed $akismet_debug The data to log.
4778 - */
4779 - public static function log( $akismet_debug ) {
4780 - if ( apply_filters( 'akismet_debug_log', defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG && defined( 'AKISMET_DEBUG' ) && AKISMET_DEBUG ) ) {
4781 - error_log( print_r( compact( 'akismet_debug' ), true ) );
4782 - }
4783 - }
4784 -
4785 - public static function pre_check_pingback( $method ) {
4786 - if ( $method !== 'pingback.ping' )
4787 - return;
4788 -
4789 - global $wp_xmlrpc_server;
4790 -
4791 - if ( !is_object( $wp_xmlrpc_server ) )
4792 - return false;
4793 -
4794 - // Lame: tightly coupled with the IXR class.
4795 - $args = $wp_xmlrpc_server->message->params;
4796 -
4797 - if ( !empty( $args[1] ) ) {
4798 - $post_id = url_to_postid( $args[1] );
4799 -
4800 - // If pingbacks aren't open on this post, we'll still check whether this request is part of a potential DDOS,
4801 - // but indicate to the server that pingbacks are indeed closed so we don't include this request in the user's stats,
4802 - // since the user has already done their part by disabling pingbacks.
4803 - $pingbacks_closed = false;
4804 -
4805 - $post = get_post( $post_id );
4806 -
4807 - if ( ! $post || ! pings_open( $post ) ) {
4808 - $pingbacks_closed = true;
4809 - }
4810 -
4811 - $comment = array(
4812 - 'comment_author_url' => $args[0],
4813 - 'comment_post_ID' => $post_id,
4814 - 'comment_author' => '',
4815 - 'comment_author_email' => '',
4816 - 'comment_content' => '',
4817 - 'comment_type' => 'pingback',
4818 - 'akismet_pre_check' => '1',
4819 - 'comment_pingback_target' => $args[1],
4820 - 'pingbacks_closed' => $pingbacks_closed ? '1' : '0',
4821 - );
4822 -
4823 - $comment = Akismet::auto_check_comment( $comment );
4824 -
4825 - if ( isset( $comment['akismet_result'] ) && 'true' == $comment['akismet_result'] ) {
4826 - // Lame: tightly coupled with the IXR classes. Unfortunately the action provides no context and no way to return anything.
4827 - $wp_xmlrpc_server->error( new IXR_Error( 0, 'Invalid discovery target' ) );
4828 - }
4829 - }
4830 - }
4831 -
4832 - /**
4833 - * Ensure that we are loading expected scalar values from akismet_as_submitted commentmeta.
4834 - *
4835 - * @param mixed $meta_value
4836 - * @return mixed
4837 - */
4838 - private static function sanitize_comment_as_submitted( $meta_value ) {
4839 - if ( empty( $meta_value ) ) {
4840 - return $meta_value;
4841 - }
4842 -
4843 - $meta_value = (array) $meta_value;
4844 -
4845 - foreach ( $meta_value as $key => $value ) {
4846 - if ( ! isset( self::$comment_as_submitted_allowed_keys[$key] ) || ! is_scalar( $value ) ) {
4847 - unset( $meta_value[$key] );
4848 - }
4849 - }
4850 -
4851 - return $meta_value;
4852 - }
4853 -
4854 - public static function predefined_api_key() {
4855 - if ( defined( 'WPCOM_API_KEY' ) ) {
4856 - return true;
4857 - }
4858 -
4859 - return apply_filters( 'akismet_predefined_api_key', false );
4860 - }
4861 -
4862 - /**
4863 - * Controls the display of a privacy related notice underneath the comment form using the `akismet_comment_form_privacy_notice` option and filter respectively.
4864 - * Default is top not display the notice, leaving the choice to site admins, or integrators.
4865 - */
4866 - public static function display_comment_form_privacy_notice() {
4867 - if ( 'display' !== apply_filters( 'akismet_comment_form_privacy_notice', get_option( 'akismet_comment_form_privacy_notice', 'hide' ) ) ) {
4868 - return;
4869 - }
4870 - echo apply_filters(
4871 - 'akismet_comment_form_privacy_notice_markup',
4872 - '<p class="akismet_comment_form_privacy_notice">' . sprintf(
4873 - __( 'This site uses Akismet to reduce spam. <a href="%s" target="_blank" rel="nofollow noopener">Learn how your comment data is processed</a>.', 'akismet' ),
4874 - 'https://akismet.com/privacy/'
4875 - ) . '</p>'
4876 - );
4877 - }
4878 -}
4879
4880 diff --git a/plugins/akismet/index.php b/plugins/akismet/index.php
4881 deleted file mode 100644
4882 index cf879a5e..00000000
4883 --- a/plugins/akismet/index.php
4884 +++ /dev/null
4885 @@ -1,2 +0,0 @@
4886 -<?php
4887 -# Silence is golden.
4888 \ No newline at end of file
4889
4890 diff --git a/plugins/akismet/readme.txt b/plugins/akismet/readme.txt
4891 deleted file mode 100644
4892 index 15526e9a..00000000
4893 --- a/plugins/akismet/readme.txt
4894 +++ /dev/null
4895 @@ -1,466 +0,0 @@
4896 -=== Akismet Anti-Spam ===
4897 -Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs, procifer, stephdau
4898 -Tags: akismet, comments, spam, antispam, anti-spam, anti spam, comment moderation, comment spam, contact form spam, spam comments
4899 -Requires at least: 4.0
4900 -Tested up to: 5.2
4901 -Stable tag: 4.1.2
4902 -License: GPLv2 or later
4903 -
4904 -Akismet checks your comments and contact form submissions against our global database of spam to protect you and your site from malicious content.
4905 -
4906 -== Description ==
4907 -
4908 -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.
4909 -
4910 -Major features in Akismet include:
4911 -
4912 -* Automatically checks all comments and filters out the ones that look like spam.
4913 -* Each comment has a status history, so you can easily see which comments were caught or cleared by Akismet and which were spammed or unspammed by a moderator.
4914 -* URLs are shown in the comment body to reveal hidden or misleading links.
4915 -* Moderators can see the number of approved comments for each user.
4916 -* A discard feature that outright blocks the worst spam, saving you disk space and speeding up your site.
4917 -
4918 -PS: You'll need an [Akismet.com API key](https://akismet.com/get/) to use it. Keys are free for personal blogs; paid subscriptions are available for businesses and commercial sites.
4919 -
4920 -== Installation ==
4921 -
4922 -Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.com API key](https://akismet.com/get/).
4923 -
4924 -1, 2, 3: You're done!
4925 -
4926 -== Changelog ==
4927 -
4928 -= 4.1.2 =
4929 -*Release Date - 14 May 2019*
4930 -
4931 -* Fixed a conflict between the Akismet setup banner and other plugin notices.
4932 -* Reduced the number of API requests made by the plugin when attempting to verify the API key.
4933 -* Include additional data in the pingback pre-check API request to help make the stats more accurate.
4934 -* Fixed a bug that was enabling the "Check for Spam" button when no comments were eligible to be checked.
4935 -* Improved Akismet's AMP compatibility.
4936 -
4937 -= 4.1.1 =
4938 -*Release Date - 31 January 2019*
4939 -
4940 -* Fixed the "Setup Akismet" notice so it resizes responsively.
4941 -* Only highlight the "Save Changes" button in the Akismet config when changes have been made.
4942 -* The count of comments in your spam queue shown on the dashboard show now always be up-to-date.
4943 -
4944 -= 4.1 =
4945 -*Release Date - 12 November 2018*
4946 -
4947 -* Added a WP-CLI method for retrieving stats.
4948 -* Hooked into the new "Personal Data Eraser" functionality from WordPress 4.9.6.
4949 -* Added functionality to clear outdated alerts from Akismet.com.
4950 -
4951 -= 4.0.8 =
4952 -*Release Date - 19 June 2018*
4953 -
4954 -* Improved the grammar and consistency of the in-admin privacy related notes (notice and config).
4955 -* Revised in-admin explanation of the comment form privacy notice to make its usage clearer.
4956 -* Added `rel="nofollow noopener"` to the comment form privacy notice to improve SEO and security.
4957 -
4958 -= 4.0.7 =
4959 -*Release Date - 28 May 2018*
4960 -
4961 -* Based on user feedback, the link on "Learn how your comment data is processed." in the optional privacy notice now has a `target` of `_blank` and opens in a new tab/window.
4962 -* Updated the in-admin privacy notice to use the term "comment" instead of "contact" in "Akismet can display a notice to your users under your comment forms."
4963 -* Only show in-admin privacy notice if Akismet has an API Key configured
4964 -
4965 -= 4.0.6 =
4966 -*Release Date - 26 May 2018*
4967 -
4968 -* Moved away from using `empty( get_option() )` to instantiating a variable to be compatible with older versions of PHP (5.3, 5.4, etc).
4969 -
4970 -= 4.0.5 =
4971 -*Release Date - 26 May 2018*
4972 -
4973 -* Corrected version number after tagging. Sorry...
4974 -
4975 -= 4.0.4 =
4976 -*Release Date - 26 May 2018*
4977 -
4978 -* Added a hook to provide Akismet-specific privacy information for a site's privacy policy.
4979 -* Added tools to control the display of a privacy related notice under comment forms.
4980 -* Fixed HTML in activation failure message to close META and HEAD tag properly.
4981 -* Fixed a bug that would sometimes prevent Akismet from being correctly auto-configured.
4982 -
4983 -= 4.0.3 =
4984 -*Release Date - 19 February 2018*
4985 -
4986 -* Added a scheduled task to remove entries in wp_commentmeta that no longer have corresponding comments in wp_comments.
4987 -* Added a new `akismet_batch_delete_count` action to the batch delete methods for people who'd like to keep track of the numbers of records being processed by those methods.
4988 -
4989 -= 4.0.2 =
4990 -*Release Date - 18 December 2017*
4991 -
4992 -* Fixed a bug that could cause Akismet to recheck a comment that has already been manually approved or marked as spam.
4993 -* Fixed a bug that could cause Akismet to claim that some comments are still waiting to be checked when no comments are waiting to be checked.
4994 -
4995 -= 4.0.1 =
4996 -*Release Date - 6 November 2017*
4997 -
4998 -* Fixed a bug that could prevent some users from connecting Akismet via their Jetpack connection.
4999 -* Ensured that any pending Akismet-related events are unscheduled if the plugin is deactivated.
5000 -* Allow some JavaScript to be run asynchronously to avoid affecting page render speeds.
5001 -
5002 -= 4.0 =
5003 -*Release Date - 19 September 2017*
5004 -
5005 -* Added REST API endpoints for configuring Akismet and retrieving stats.
5006 -* Increased the minimum supported WordPress version to 4.0.
5007 -* Added compatibility with comments submitted via the REST API.
5008 -* Improved the progress indicator on the "Check for Spam" button.
5009 -
5010 -= 3.3.4 =
5011 -*Release Date - 3 August 2017*
5012 -
5013 -* Disabled Akismet's debug log output by default unless AKISMET_DEBUG is defined.
5014 -* URL previews now begin preloading when the mouse moves near them in the comments section of wp-admin.
5015 -* When a comment is caught by the Comment Blacklist, Akismet will always allow it to stay in the trash even if it is spam as well.
5016 -* Fixed a bug that was preventing an error from being shown when a site can't reach Akismet's servers.
5017 -
5018 -= 3.3.3 =
5019 -*Release Date - 13 July 2017*
5020 -
5021 -* Reduced amount of bandwidth used by the URL Preview feature.
5022 -* Improved the admin UI when the API key is manually pre-defined for the site.
5023 -* Removed a workaround for WordPress installations older than 3.3 that will improve Akismet's compatibility with other plugins.
5024 -* The number of spam blocked that is displayed on the WordPress dashboard will now be more accurate and updated more frequently.
5025 -* Fixed a bug in the Akismet widget that could cause PHP warnings.
5026 -
5027 -= 3.3.2 =
5028 -*Release Date - 10 May 2017*
5029 -
5030 -* Fixed a bug causing JavaScript errors in some browsers.
5031 -
5032 -= 3.3.1 =
5033 -*Release Date - 2 May 2017*
5034 -
5035 -* Improve performance by only requesting the akismet_comment_nonce option when absolutely necessary.
5036 -* Fixed two bugs that could cause PHP warnings.
5037 -* Fixed a bug that was preventing the "Remove author URL" feature from working after a comment was edited using "Quick Edit."
5038 -* Fixed a bug that was preventing the URL preview feature from working after a comment was edited using "Quick Edit."
5039 -
5040 -= 3.3 =
5041 -*Release Date - 23 February 2017*
5042 -
5043 -* Updated the Akismet admin pages with a new clean design.
5044 -* Fixed bugs preventing the `akismet_add_comment_nonce` and `akismet_update_alert` wrapper functions from working properly.
5045 -* Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
5046 -* Added a progress indicator to the "Check for Spam" button.
5047 -* Added a success message after manually rechecking the Pending queue for spam.
5048 -
5049 -= 3.2 =
5050 -*Release Date - 6 September 2016*
5051 -
5052 -* Added a WP-CLI module. You can now check comments and recheck the moderation queue from the command line.
5053 -* Stopped using the deprecated jQuery function `.live()`.
5054 -* Fixed a bug in `remove_comment_author_url()` and `add_comment_author_url()` that could generate PHP notices.
5055 -* Fixed a bug that could cause an infinite loop for sites with very very very large comment IDs.
5056 -* Fixed a bug that could cause the Akismet widget title to be blank.
5057 -
5058 -= 3.1.11 =
5059 -*Release Date - 12 May 2016*
5060 -
5061 -* Fixed a bug that could cause the "Check for Spam" button to skip some comments.
5062 -* Fixed a bug that could prevent some spam submissions from being sent to Akismet.
5063 -* Updated all links to use https:// when possible.
5064 -* Disabled Akismet debug logging unless WP_DEBUG and WP_DEBUG_LOG are both enabled.
5065 -
5066 -= 3.1.10 =
5067 -*Release Date - 1 April 2016*
5068 -
5069 -* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
5070 -* Fixed a bug that could have resulted in comments that were caught by the core WordPress comment blacklist not to have a corresponding History entry.
5071 -* Fixed a bug that could have caused avoidable PHP warnings in the error log.
5072 -
5073 -= 3.1.9 =
5074 -*Release Date - 28 March 2016*
5075 -
5076 -* Add compatibility with Jetpack so that Jetpack can automatically configure Akismet settings when appropriate.
5077 -* Fixed a bug preventing some comment data from being sent to Akismet.
5078 -
5079 -= 3.1.8 =
5080 -*Release Date - 4 March 2016*
5081 -
5082 -* Fixed a bug preventing Akismet from being used with some plugins that rewrite admin URLs.
5083 -* Reduced the amount of bandwidth used on Akismet API calls
5084 -* Reduced the amount of space Akismet uses in the database
5085 -* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
5086 -
5087 -= 3.1.7 =
5088 -*Release Date - 4 January 2016*
5089 -
5090 -* Added documentation for the 'akismet_comment_nonce' filter.
5091 -* The post-install activation button is now accessible to screen readers and keyboard-only users.
5092 -* Fixed a bug that was preventing the "Remove author URL" feature from working in WordPress 4.4
5093 -
5094 -= 3.1.6 =
5095 -*Release Date - 14 December 2015*
5096 -
5097 -* Improve the notices shown after activating Akismet.
5098 -* Update some strings to allow for the proper plural forms in all languages.
5099 -
5100 -= 3.1.5 =
5101 -*Release Date - 13 October 2015*
5102 -
5103 -* Closes a potential XSS vulnerability.
5104 -
5105 -= 3.1.4 =
5106 -*Release Date - 24 September 2015*
5107 -
5108 -* Fixed a bug that was preventing some users from automatically connecting using Jetpack if they didn't have a current Akismet subscription.
5109 -* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
5110 -* Error messages and instructions have been simplified to be more understandable.
5111 -* Link previews are enabled for all links inside comments, not just the author's website link.
5112 -
5113 -= 3.1.3 =
5114 -*Release Date - 6 July 2015*
5115 -
5116 -* Notify users when their account status changes after previously being successfully set up. This should help any users who are seeing blank Akismet settings screens.
5117 -
5118 -= 3.1.2 =
5119 -*Release Date - 7 June 2015*
5120 -
5121 -* Reduced the amount of space Akismet uses in the commentmeta table.
5122 -* Fixed a bug where some comments with quotes in the author name weren't getting history entries
5123 -* Pre-emptive security improvements to ensure that the Akismet plugin can't be used by attackers to compromise a WordPress installation.
5124 -* Better UI for the key entry field: allow whitespace to be included at the beginning or end of the key and strip it out automatically when the form is submitted.
5125 -* When deactivating the plugin, notify the Akismet API so the site can be marked as inactive.
5126 -* Clearer error messages.
5127 -
5128 -= 3.1.1 =
5129 -*Release Date - 17th March, 2015*
5130 -
5131 -* Improvements to the "Remove comment author URL" JavaScript
5132 -* Include the pingback pre-check from the 2.6 branch.
5133 -
5134 -= 3.1 =
5135 -*Release Date - 11th March, 2015*
5136 -
5137 -* Use HTTPS by default for all requests to Akismet.
5138 -* Fix for a situation where Akismet might strip HTML from a comment.
5139 -
5140 -= 3.0.4 =
5141 -*Release Date - 11th December, 2014*
5142 -
5143 -* Fix to make .htaccess compatible with Apache 2.4.
5144 -* Fix to allow removal of https author URLs.
5145 -* Fix to avoid stripping part of the author URL when removing and re-adding.
5146 -* Removed the "Check for Spam" button from the "Trash" and "Approved" queues, where it would have no effect.
5147 -* Allow automatic API key configuration when Jetpack is installed and connected to a WordPress.com account
5148 -
5149 -= 3.0.3 =
5150 -*Release Date - 3rd November, 2014*
5151 -
5152 -* Fix for sending the wrong data to delete_comment action that could have prevented old spam comments from being deleted.
5153 -* Added a filter to disable logging of Akismet debugging information.
5154 -* Added a filter for the maximum comment age when deleting old spam comments.
5155 -* Added a filter for the number per batch when deleting old spam comments.
5156 -* Removed the "Check for Spam" button from the Spam folder.
5157 -
5158 -= 3.0.2 =
5159 -*Release Date - 18th August, 2014*
5160 -
5161 -* Performance improvements.
5162 -* Fixed a bug that could truncate the comment data being sent to Akismet for checking.
5163 -
5164 -= 3.0.1 =
5165 -*Release Date - 9th July, 2014*
5166 -
5167 -* Removed dependency on PHP's fsockopen function
5168 -* Fix spam/ham reports to work when reported outside of the WP dashboard, e.g., from Notifications or the WP app
5169 -* Remove jQuery dependency for comment form JavaScript
5170 -* Remove unnecessary data from some Akismet comment meta
5171 -* Suspended keys will now result in all comments being put in moderation, not spam.
5172 -
5173 -= 3.0.0 =
5174 -*Release Date - 15th April, 2014*
5175 -
5176 -* Move Akismet to Settings menu
5177 -* Drop Akismet Stats menu
5178 -* Add stats snapshot to Akismet settings
5179 -* Add Akismet subscription details and status to Akismet settings
5180 -* Add contextual help for each page
5181 -* Improve Akismet setup to use Jetpack to automate plugin setup
5182 -* Fix "Check for Spam" to use AJAX to avoid page timing out
5183 -* Fix Akismet settings page to be responsive
5184 -* Drop legacy code
5185 -* Tidy up CSS and Javascript
5186 -* Replace the old discard setting with a new "discard pervasive spam" feature.
5187 -
5188 -= 2.6.0 =
5189 -*Release Date - 18th March, 2014*
5190 -
5191 -* Add ajax paging to the check for spam button to handle large volumes of comments
5192 -* Optimize javascript and add localization support
5193 -* Fix bug in link to spam comments from right now dashboard widget
5194 -* Fix bug with deleting old comments to avoid timeouts dealing with large volumes of comments
5195 -* Include X-Pingback-Forwarded-For header in outbound WordPress pingback verifications
5196 -* Add pre-check for pingbacks, to stop spam before an outbound verification request is made
5197 -
5198 -= 2.5.9 =
5199 -*Release Date - 1st August, 2013*
5200 -
5201 -* Update 'Already have a key' link to redirect page rather than depend on javascript
5202 -* Fix some non-translatable strings to be translatable
5203 -* Update Activation banner in plugins page to redirect user to Akismet config page
5204 -
5205 -= 2.5.8 =
5206 -*Release Date - 20th January, 2013*
5207 -
5208 -* Simplify the activation process for new users
5209 -* Remove the reporter_ip parameter
5210 -* Minor preventative security improvements
5211 -
5212 -= 2.5.7 =
5213 -*Release Date - 13th December, 2012*
5214 -
5215 -* FireFox Stats iframe preview bug
5216 -* Fix mshots preview when using https
5217 -* Add .htaccess to block direct access to files
5218 -* Prevent some PHP notices
5219 -* Fix Check For Spam return location when referrer is empty
5220 -* Fix Settings links for network admins
5221 -* Fix prepare() warnings in WP 3.5
5222 -
5223 -= 2.5.6 =
5224 -*Release Date - 26th April, 2012*
5225 -
5226 -* Prevent retry scheduling problems on sites where wp_cron is misbehaving
5227 -* Preload mshot previews
5228 -* Modernize the widget code
5229 -* Fix a bug where comments were not held for moderation during an error condition
5230 -* Improve the UX and display when comments are temporarily held due to an error
5231 -* Make the Check For Spam button force a retry when comments are held due to an error
5232 -* Handle errors caused by an invalid key
5233 -* Don't retry comments that are too old
5234 -* Improve error messages when verifying an API key
5235 -
5236 -= 2.5.5 =
5237 -*Release Date - 11th January, 2012*
5238 -
5239 -* Add nonce check for comment author URL remove action
5240 -* Fix the settings link
5241 -
5242 -= 2.5.4 =
5243 -*Release Date - 5th January, 2012*
5244 -
5245 -* Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
5246 -* Added author URL quick removal functionality
5247 -* Added mShot preview on Author URL hover
5248 -* Added empty index.php to prevent directory listing
5249 -* Move wp-admin menu items under Jetpack, if it is installed
5250 -* Purge old Akismet comment meta data, default of 15 days
5251 -
5252 -= 2.5.3 =
5253 -*Release Date - 8th Febuary, 2011*
5254 -
5255 -* Specify the license is GPL v2 or later
5256 -* Fix a bug that could result in orphaned commentmeta entries
5257 -* Include hotfix for WordPress 3.0.5 filter issue
5258 -
5259 -= 2.5.2 =
5260 -*Release Date - 14th January, 2011*
5261 -
5262 -* Properly format the comment count for author counts
5263 -* Look for super admins on multisite installs when looking up user roles
5264 -* Increase the HTTP request timeout
5265 -* Removed padding for author approved count
5266 -* Fix typo in function name
5267 -* Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
5268 -
5269 -= 2.5.1 =
5270 -*Release Date - 17th December, 2010*
5271 -
5272 -* Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
5273 -* Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
5274 -* Fixed padding bug in "author" column of posts screen
5275 -* Added margin-top to "cleared by ..." badges on dashboard
5276 -* Fix possible error when calling akismet_cron_recheck()
5277 -* Fix more PHP warnings
5278 -* Clean up XHTML warnings for comment nonce
5279 -* Fix for possible condition where scheduled comment re-checks could get stuck
5280 -* Clean up the comment meta details after deleting a comment
5281 -* Only show the status badge if the comment status has been changed by someone/something other than Akismet
5282 -* Show a 'History' link in the row-actions
5283 -* Translation fixes
5284 -* Reduced font-size on author name
5285 -* Moved "flagged by..." notification to top right corner of comment container and removed heavy styling
5286 -* Hid "flagged by..." notification while on dashboard
5287 -
5288 -= 2.5.0 =
5289 -*Release Date - 7th December, 2010*
5290 -
5291 -* Track comment actions under 'Akismet Status' on the edit comment screen
5292 -* Fix a few remaining deprecated function calls ( props Mike Glendinning )
5293 -* Use HTTPS for the stats IFRAME when wp-admin is using HTTPS
5294 -* Use the WordPress HTTP class if available
5295 -* Move the admin UI code to a separate file, only loaded when needed
5296 -* Add cron retry feature, to replace the old connectivity check
5297 -* Display Akismet status badge beside each comment
5298 -* Record history for each comment, and display it on the edit page
5299 -* Record the complete comment as originally submitted in comment_meta, to use when reporting spam and ham
5300 -* Highlight links in comment content
5301 -* New option, "Show the number of comments you've approved beside each comment author."
5302 -* New option, "Use a nonce on the comment form."
5303 -
5304 -= 2.4.0 =
5305 -*Release Date - 23rd August, 2010*
5306 -
5307 -* Spell out that the license is GPLv2
5308 -* Fix PHP warnings
5309 -* Fix WordPress deprecated function calls
5310 -* Fire the delete_comment action when deleting comments
5311 -* Move code specific for older WP versions to legacy.php
5312 -* General code clean up
5313 -
5314 -= 2.3.0 =
5315 -*Release Date - 5th June, 2010*
5316 -
5317 -* Fix "Are you sure" nonce message on config screen in WPMU
5318 -* Fix XHTML compliance issue in sidebar widget
5319 -* Change author link; remove some old references to WordPress.com accounts
5320 -* Localize the widget title (core ticket #13879)
5321 -
5322 -= 2.2.9 =
5323 -*Release Date - 2nd June, 2010*
5324 -
5325 -* Eliminate a potential conflict with some plugins that may cause spurious reports
5326 -
5327 -= 2.2.8 =
5328 -*Release Date - 27th May, 2010*
5329 -
5330 -* Fix bug in initial comment check for ipv6 addresses
5331 -* Report comments as ham when they are moved from spam to moderation
5332 -* Report comments as ham when clicking undo after spam
5333 -* Use transition_comment_status action when available instead of older actions for spam/ham submissions
5334 -* Better diagnostic messages when PHP network functions are unavailable
5335 -* Better handling of comments by logged-in users
5336 -
5337 -= 2.2.7 =
5338 -*Release Date - 17th December, 2009*
5339 -
5340 -* Add a new AKISMET_VERSION constant
5341 -* Reduce the possibility of over-counting spam when another spam filter plugin is in use
5342 -* Disable the connectivity check when the API key is hard-coded for WPMU
5343 -
5344 -= 2.2.6 =
5345 -*Release Date - 20th July, 2009*
5346 -
5347 -* Fix a global warning introduced in 2.2.5
5348 -* Add changelog and additional readme.txt tags
5349 -* Fix an array conversion warning in some versions of PHP
5350 -* Support a new WPCOM_API_KEY constant for easier use with WordPress MU
5351 -
5352 -= 2.2.5 =
5353 -*Release Date - 13th July, 2009*
5354 -
5355 -* Include a new Server Connectivity diagnostic check, to detect problems caused by firewalls
5356 -
5357 -= 2.2.4 =
5358 -*Release Date - 3rd June, 2009*
5359 -
5360 -* Fixed a key problem affecting the stats feature in WordPress MU
5361 -* Provide additional blog information in Akismet API calls
5362
5363 diff --git a/plugins/akismet/views/config.php b/plugins/akismet/views/config.php
5364 deleted file mode 100644
5365 index 6bbcd6d4..00000000
5366 --- a/plugins/akismet/views/config.php
5367 +++ /dev/null
5368 @@ -1,242 +0,0 @@
5369 -<div id="akismet-plugin-container">
5370 - <div class="akismet-masthead">
5371 - <div class="akismet-masthead__inside-container">
5372 - <div class="akismet-masthead__logo-container">
5373 - <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
5374 - </div>
5375 - </div>
5376 - </div>
5377 - <div class="akismet-lower">
5378 - <?php if ( Akismet::get_api_key() ) { ?>
5379 - <?php Akismet_Admin::display_status(); ?>
5380 - <?php } ?>
5381 - <?php if ( ! empty( $notices ) ) { ?>
5382 - <?php foreach ( $notices as $notice ) { ?>
5383 - <?php Akismet::view( 'notice', $notice ); ?>
5384 - <?php } ?>
5385 - <?php } ?>
5386 - <?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
5387 - <div class="akismet-card">
5388 - <div class="akismet-section-header">
5389 - <div class="akismet-section-header__label">
5390 - <span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>
5391 - </div>
5392 - <div class="akismet-section-header__actions">
5393 - <a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
5394 - <?php esc_html_e( 'Detailed Stats' , 'akismet');?>
5395 - </a>
5396 - </div>
5397 - </div>
5398 -
5399 - <div class="akismet-new-snapshot">
5400 - <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>
5401 - <ul>
5402 - <li>
5403 - <h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
5404 - <span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
5405 - <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
5406 - </li>
5407 - <li>
5408 - <h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
5409 - <span><?php echo number_format( $stat_totals['all']->spam );?></span>
5410 - <?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
5411 - </li>
5412 - <li>
5413 - <h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
5414 - <span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
5415 - <?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
5416 - |
5417 - <?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
5418 - </li>
5419 - </ul>
5420 - </div>
5421 - </div>
5422 - <?php endif;?>
5423 -
5424 - <?php if ( $akismet_user ):?>
5425 - <div class="akismet-card">
5426 - <div class="akismet-section-header">
5427 - <div class="akismet-section-header__label">
5428 - <span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>
5429 - </div>
5430 - </div>
5431 -
5432 - <div class="inside">
5433 - <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
5434 - <table cellspacing="0" class="akismet-settings">
5435 - <tbody>
5436 - <?php if ( ! Akismet::predefined_api_key() ) { ?>
5437 - <tr>
5438 - <th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
5439 - <td width="5%"/>
5440 - <td align="left">
5441 - <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>
5442 - </td>
5443 - </tr>
5444 - <?php } ?>
5445 - <?php if ( isset( $_GET['ssl_status'] ) ) { ?>
5446 - <tr>
5447 - <th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
5448 - <td></td>
5449 - <td align="left">
5450 - <p>
5451 - <?php
5452 -
5453 - if ( ! wp_http_supports( array( 'ssl' ) ) ) {
5454 - ?><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
5455 - }
5456 - else {
5457 - $ssl_disabled = get_option( 'akismet_ssl_disabled' );
5458 -
5459 - if ( $ssl_disabled ) {
5460 - ?><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
5461 - }
5462 - else {
5463 - ?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
5464 - }
5465 - }
5466 -
5467 - ?>
5468 - </p>
5469 - </td>
5470 - </tr>
5471 - <?php } ?>
5472 - <tr>
5473 - <th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
5474 - <td></td>
5475 - <td align="left">
5476 - <p>
5477 - <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
5478 - <input
5479 - name="akismet_show_user_comments_approved"
5480 - id="akismet_show_user_comments_approved"
5481 - value="1"
5482 - type="checkbox"
5483 - <?php
5484 -
5485 - // 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.
5486 - checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
5487 -
5488 - ?>
5489 - />
5490 - <?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
5491 - </label>
5492 - </p>
5493 - </td>
5494 - </tr>
5495 - <tr>
5496 - <th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
5497 - <td></td>
5498 - <td align="left">
5499 - <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
5500 - <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>
5501 - <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>
5502 - </fieldset>
5503 - <span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
5504 - <?php
5505 -
5506 - $delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
5507 -
5508 - printf(
5509 - _n(
5510 - 'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
5511 - 'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
5512 - $delete_interval,
5513 - 'akismet'
5514 - ),
5515 - admin_url( 'edit-comments.php?comment_status=spam' ),
5516 - $delete_interval
5517 - );
5518 -
5519 - ?>
5520 - </td>
5521 - </tr>
5522 - <tr>
5523 - <th class="comment-form-privacy-notice" align="left" scope="row"><?php esc_html_e('Privacy', 'akismet'); ?></th>
5524 - <td></td>
5525 - <td align="left">
5526 - <fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet privacy notice', 'akismet'); ?></span></legend>
5527 - <p><label for="akismet_comment_form_privacy_notice_display"><input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_display" value="display" <?php checked('display', get_option('akismet_comment_form_privacy_notice')); ?> /> <?php esc_html_e('Display a privacy notice under your comment forms.', 'akismet'); ?></label></p>
5528 - <p><label for="akismet_comment_form_privacy_notice_hide"><input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_hide" value="hide" <?php echo in_array( get_option('akismet_comment_form_privacy_notice'), array('display', 'hide') ) ? checked('hide', get_option('akismet_comment_form_privacy_notice'), false) : 'checked="checked"'; ?> /> <?php esc_html_e('Do not display privacy notice.', 'akismet'); ?></label></p>
5529 - </fieldset>
5530 - <span class="akismet-note"><?php esc_html_e( 'To help your site with transparency under privacy laws like the GDPR, Akismet can display a notice to your users under your comment forms. This feature is disabled by default, however, you can turn it on above.', 'akismet' );?></span>
5531 - </td>
5532 - </tr>
5533 - </tbody>
5534 - </table>
5535 - <div class="akismet-card-actions">
5536 - <?php if ( ! Akismet::predefined_api_key() ) { ?>
5537 - <div id="delete-action">
5538 - <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>
5539 - </div>
5540 - <?php } ?>
5541 - <?php wp_nonce_field(Akismet_Admin::NONCE) ?>
5542 - <div id="publishing-action">
5543 - <input type="hidden" name="action" value="enter-key">
5544 - <input type="submit" name="submit" id="submit" class="akismet-button akismet-could-be-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
5545 - </div>
5546 - <div class="clear"></div>
5547 - </div>
5548 - </form>
5549 - </div>
5550 - </div>
5551 -
5552 - <?php if ( ! Akismet::predefined_api_key() ) { ?>
5553 - <div class="akismet-card">
5554 - <div class="akismet-section-header">
5555 - <div class="akismet-section-header__label">
5556 - <span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
5557 - </div>
5558 - </div>
5559 -
5560 - <div class="inside">
5561 - <table cellspacing="0" border="0" class="akismet-settings">
5562 - <tbody>
5563 - <tr>
5564 - <th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
5565 - <td width="5%"/>
5566 - <td align="left">
5567 - <p><?php echo esc_html( $akismet_user->account_name ); ?></p>
5568 - </td>
5569 - </tr>
5570 - <tr>
5571 - <th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
5572 - <td width="5%"/>
5573 - <td align="left">
5574 - <p><?php
5575 - if ( 'cancelled' == $akismet_user->status ) :
5576 - esc_html_e( 'Cancelled', 'akismet' );
5577 - elseif ( 'suspended' == $akismet_user->status ) :
5578 - esc_html_e( 'Suspended', 'akismet' );
5579 - elseif ( 'missing' == $akismet_user->status ) :
5580 - esc_html_e( 'Missing', 'akismet' );
5581 - elseif ( 'no-sub' == $akismet_user->status ) :
5582 - esc_html_e( 'No Subscription Found', 'akismet' );
5583 - else :
5584 - esc_html_e( 'Active', 'akismet' );
5585 - endif; ?></p>
5586 - </td>
5587 - </tr>
5588 - <?php if ( $akismet_user->next_billing_date ) : ?>
5589 - <tr>
5590 - <th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
5591 - <td width="5%"/>
5592 - <td align="left">
5593 - <p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
5594 - </td>
5595 - </tr>
5596 - <?php endif; ?>
5597 - </tbody>
5598 - </table>
5599 - <div class="akismet-card-actions">
5600 - <div id="publishing-action">
5601 - <?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
5602 - </div>
5603 - <div class="clear"></div>
5604 - </div>
5605 - </div>
5606 - </div>
5607 - <?php } ?>
5608 - <?php endif;?>
5609 - </div>
5610 -</div>
5611
5612 diff --git a/plugins/akismet/views/get.php b/plugins/akismet/views/get.php
5613 deleted file mode 100644
5614 index b1abe0eb..00000000
5615 --- a/plugins/akismet/views/get.php
5616 +++ /dev/null
5617 @@ -1,12 +0,0 @@
5618 -<?php
5619 -
5620 -//phpcs:disable VariableAnalysis
5621 -// There are "undefined" variables here because they're defined in the code that includes this file as a template.
5622 -
5623 -?>
5624 -<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
5625 - <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
5626 - <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
5627 - <input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
5628 - <input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button';?>" value="<?php echo esc_attr( $text ); ?>"/>
5629 -</form>
5630 \ No newline at end of file
5631
5632 diff --git a/plugins/akismet/views/notice.php b/plugins/akismet/views/notice.php
5633 deleted file mode 100644
5634 index 7f70fc12..00000000
5635 --- a/plugins/akismet/views/notice.php
5636 +++ /dev/null
5637 @@ -1,141 +0,0 @@
5638 -<?php if ( $type == 'plugin' ) :?>
5639 -<div class="updated" id="akismet_setup_prompt">
5640 - <form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
5641 - <div class="akismet_activate">
5642 - <div class="aa_a">A</div>
5643 - <div class="aa_button_container">
5644 - <div class="aa_button_border">
5645 - <input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" />
5646 - </div>
5647 - </div>
5648 - <div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div>
5649 - </div>
5650 - </form>
5651 -</div>
5652 -<?php elseif ( $type == 'spam-check' ) :?>
5653 -<div class="notice notice-warning">
5654 - <p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' );?></strong></p>
5655 - <p><?php esc_html_e( 'Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation and will automatically be rechecked later.', 'akismet' ); ?></p>
5656 - <?php if ( $link_text ) { ?>
5657 - <p><?php echo $link_text; ?></p>
5658 - <?php } ?>
5659 -</div>
5660 -<?php elseif ( $type == 'alert' ) :?>
5661 -<div class='error'>
5662 - <p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
5663 - <p><?php echo esc_html( $msg ); ?></p>
5664 - <p><?php
5665 -
5666 - /* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */
5667 - printf( esc_html__( 'For more information: %s' , 'akismet'), '<a href="https://akismet.com/errors/' . $code . '">https://akismet.com/errors/' . $code . '</a>' );
5668 -
5669 - ?>
5670 - </p>
5671 -</div>
5672 -<?php elseif ( $type == 'notice' ) :?>
5673 -<div class="akismet-alert akismet-critical">
5674 - <h3 class="akismet-key-status failed"><?php echo $notice_header; ?></h3>
5675 - <p class="akismet-description">
5676 - <?php echo $notice_text; ?>
5677 - </p>
5678 -</div>
5679 -<?php elseif ( $type == 'missing-functions' ) :?>
5680 -<div class="akismet-alert akismet-critical">
5681 - <h3 class="akismet-key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
5682 - <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>
5683 -</div>
5684 -<?php elseif ( $type == 'servers-be-down' ) :?>
5685 -<div class="akismet-alert akismet-critical">
5686 - <h3 class="akismet-key-status failed"><?php esc_html_e("Your site can&#8217;t connect to the Akismet servers.", 'akismet'); ?></h3>
5687 - <p class="akismet-description"><?php printf( __('Your firewall may be blocking Akismet from connecting to its API. 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>
5688 -</div>
5689 -<?php elseif ( $type == 'active-dunning' ) :?>
5690 -<div class="akismet-alert akismet-critical">
5691 - <h3 class="akismet-key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
5692 - <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>
5693 -</div>
5694 -<?php elseif ( $type == 'cancelled' ) :?>
5695 -<div class="akismet-alert akismet-critical">
5696 - <h3 class="akismet-key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
5697 - <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>
5698 -</div>
5699 -<?php elseif ( $type == 'suspended' ) :?>
5700 -<div class="akismet-alert akismet-critical">
5701 - <h3 class="akismet-key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
5702 - <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
5703 -</div>
5704 -<?php elseif ( $type == 'active-notice' && $time_saved ) :?>
5705 -<div class="akismet-alert akismet-active">
5706 - <h3 class="akismet-key-status"><?php echo esc_html( $time_saved ); ?></h3>
5707 - <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>
5708 -</div>
5709 -<?php elseif ( $type == 'missing' ) :?>
5710 -<div class="akismet-alert akismet-critical">
5711 - <h3 class="akismet-key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
5712 - <p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
5713 -</div>
5714 -<?php elseif ( $type == 'no-sub' ) :?>
5715 -<div class="akismet-alert akismet-critical">
5716 - <h3 class="akismet-key-status failed"><?php esc_html_e( 'You don&#8217;t have an Akismet plan.', 'akismet'); ?></h3>
5717 - <p class="akismet-description">
5718 - <?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/' ); ?>
5719 - <br /><br />
5720 - <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
5721 - </p>
5722 -</div>
5723 -<?php elseif ( $type == 'new-key-valid' ) :
5724 - global $wpdb;
5725 -
5726 - $check_pending_link = false;
5727 -
5728 - $at_least_one_comment_in_moderation = !! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" );
5729 -
5730 - if ( $at_least_one_comment_in_moderation) {
5731 - $check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );
5732 - }
5733 -
5734 - ?>
5735 -<div class="akismet-alert akismet-active">
5736 - <h3 class="akismet-key-status"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3>
5737 - <?php if ( $check_pending_link ) { ?>
5738 - <p class="akismet-description"><?php printf( __( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p>
5739 - <?php } ?>
5740 -</div>
5741 -<?php elseif ( $type == 'new-key-invalid' ) :?>
5742 -<div class="akismet-alert akismet-critical">
5743 - <h3 class="akismet-key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
5744 -</div>
5745 -<?php elseif ( $type == 'existing-key-invalid' ) :?>
5746 -<div class="akismet-alert akismet-critical">
5747 - <h3 class="akismet-key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@×××××××.com.' , 'akismet'); ?></h3>
5748 -</div>
5749 -<?php elseif ( $type == 'new-key-failed' ) :?>
5750 -<div class="akismet-alert akismet-critical">
5751 - <h3 class="akismet-key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
5752 - <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>
5753 -</div>
5754 -<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
5755 -<div class="akismet-alert akismet-critical">
5756 - <?php if ( $level == 'yellow' ): ?>
5757 - <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>
5758 - <p class="akismet-description">
5759 - <?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/' ); ?>
5760 - <br /><br />
5761 - <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
5762 - </p>
5763 - <?php elseif ( $level == 'red' ): ?>
5764 - <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>
5765 - <p class="akismet-description">
5766 - <?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/' ); ?>
5767 - <br /><br />
5768 - <?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
5769 - </p>
5770 - <?php endif; ?>
5771 -</div>
5772 -<?php elseif ( $type == 'privacy' ) :?>
5773 -<div class="notice notice-warning is-dismissible" id="akismet-privacy-notice-admin-notice">
5774 - <p><strong><?php esc_html_e( 'Akismet & Privacy.', 'akismet' );?></strong></p>
5775 - <p><?php esc_html_e( 'To help your site with transparency under privacy laws like the GDPR, Akismet can display a notice to your users under your comment forms. This feature is disabled by default, however, you can turn it on below.', 'akismet' ); ?></p>
5776 - <p><?php printf( __(' Please <a href="%s">enable</a> or <a href="%s">disable</a> this feature. <a href="%s" id="akismet-privacy-notice-control-notice-info-link" target="_blank">More information</a>.', 'akismet' ), admin_url( apply_filters( 'akismet_comment_form_privacy_notice_url_display', 'options-general.php?page=akismet-key-config&akismet_comment_form_privacy_notice=display' ) ), admin_url( apply_filters( 'akismet_comment_form_privacy_notice_url_hide', 'options-general.php?page=akismet-key-config&akismet_comment_form_privacy_notice=hide' ) ), 'https://akismet.com/privacy/' ); ?></p>
5777 -</div>
5778 -<?php endif;?>
5779
5780 diff --git a/plugins/akismet/views/start.php b/plugins/akismet/views/start.php
5781 deleted file mode 100644
5782 index 0ec35fdb..00000000
5783 --- a/plugins/akismet/views/start.php
5784 +++ /dev/null
5785 @@ -1,102 +0,0 @@
5786 -<div id="akismet-plugin-container">
5787 - <div class="akismet-masthead">
5788 - <div class="akismet-masthead__inside-container">
5789 - <div class="akismet-masthead__logo-container">
5790 - <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
5791 - </div>
5792 - </div>
5793 - </div>
5794 - <div class="akismet-lower">
5795 - <?php Akismet_Admin::display_status(); ?>
5796 -
5797 - <div class="akismet-box">
5798 - <h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
5799 - <p><?php esc_html_e( 'Select one of the options below to get started.', 'akismet' ); ?></p>
5800 - </div>
5801 - <div class="akismet-boxes">
5802 - <?php if ( ! Akismet::predefined_api_key() ) { ?>
5803 - <?php if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { ?>
5804 - <?php if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) { ?>
5805 - <div class="akismet-box">
5806 - <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
5807 - <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
5808 - <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
5809 - <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
5810 - <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
5811 - <input type="hidden" name="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
5812 - <input type="hidden" name="redirect" value="plugin-signup"/>
5813 - <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
5814 - </form>
5815 - <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
5816 - <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>
5817 - </div>
5818 - <?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
5819 - <div class="akismet-box">
5820 - <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
5821 - <form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" target="_blank">
5822 - <input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
5823 - <input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
5824 - <input type="hidden" name="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
5825 - <input type="hidden" name="redirect" value="upgrade"/>
5826 - <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet' ); ?>"/>
5827 - </form>
5828 - <p><?php echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
5829 - </div>
5830 - <?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
5831 - <div class="centered akismet-box">
5832 - <h3><?php esc_html_e( 'Connected via Jetpack' , 'akismet' ); ?></h3>
5833 - <p class="akismet-alert-text"><?php echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></p>
5834 - <p><?php esc_html_e( 'No worries! Get in touch and we&#8217;ll sort this out.', 'akismet' ); ?></p>
5835 - <p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
5836 - </div>
5837 - <?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
5838 - <div class="akismet-box">
5839 - <h3><?php esc_html_e( 'Connect via Jetpack', 'akismet' ); ?></h3>
5840 - <p><?php esc_html_e( 'Use your Jetpack connection to activate Akismet.', 'akismet' ); ?></p>
5841 - <form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
5842 - <input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
5843 - <input type="hidden" name="action" value="enter-key">
5844 - <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
5845 - <input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
5846 - </form>
5847 - <?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
5848 - <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>
5849 - </div>
5850 - <?php } ?>
5851 - <div class="akismet-box">
5852 - <h3><?php esc_html_e( 'Or sign up with a different email address', 'akismet' ); ?></h3>
5853 - <div class="akismet-right">
5854 - <?php Akismet::view( 'get', array( 'text' => __( 'Sign up with a different email address' , 'akismet' ), 'classes' => array( 'akismet-button' ) ) ); ?>
5855 - </div>
5856 - <p><?php esc_html_e( 'Choose this option to use Akismet independently of your Jetpack connection.', 'akismet' ); ?></p>
5857 - </div>
5858 - <?php } else { ?>
5859 - <div class="akismet-box">
5860 - <h3><?php esc_html_e( 'Activate Akismet' , 'akismet' );?></h3>
5861 - <div class="akismet-right">
5862 - <?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
5863 - </div>
5864 - <p><?php esc_html_e( 'Log in or sign up now.', 'akismet' ); ?></p>
5865 - </div>
5866 - <?php } ?>
5867 - <div class="akismet-box">
5868 - <h3><?php esc_html_e( 'Or enter an API key', 'akismet' ); ?></h3>
5869 - <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>
5870 - <form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
5871 - <?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
5872 - <input type="hidden" name="action" value="enter-key">
5873 - <p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
5874 - <input id="key" name="key" type="text" size="15" value="" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
5875 - <input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
5876 - </p>
5877 - </form>
5878 - </div>
5879 - <?php } else { ?>
5880 - <div class="akismet-box">
5881 - <h2><?php esc_html_e( 'Manual Configuration', 'akismet' ); ?></h2>
5882 - <p><?php echo sprintf( esc_html__( 'An Akismet API key has been defined in the %s file for this site.', 'akismet' ), '<code>wp-config.php</code>' ); ?></p>
5883 - </div>
5884 - <?php } ?>
5885 - </div>
5886 - </div>
5887 -</div>
5888 \ No newline at end of file
5889
5890 diff --git a/plugins/akismet/views/stats.php b/plugins/akismet/views/stats.php
5891 deleted file mode 100644
5892 index 2302c11a..00000000
5893 --- a/plugins/akismet/views/stats.php
5894 +++ /dev/null
5895 @@ -1,11 +0,0 @@
5896 -<div id="akismet-plugin-container">
5897 - <div class="akismet-masthead">
5898 - <div class="akismet-masthead__inside-container">
5899 - <a href="<?php echo esc_url( Akismet_Admin::get_page_url() );?>" class="akismet-right"><?php esc_html_e( 'Akismet Settings' , 'akismet' ); ?></a>
5900 - <div class="akismet-masthead__logo-container">
5901 - <img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
5902 - </div>
5903 - </div>
5904 - </div>
5905 - <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>
5906 -</div>
5907 \ No newline at end of file
5908
5909 diff --git a/plugins/akismet/wrapper.php b/plugins/akismet/wrapper.php
5910 deleted file mode 100644
5911 index 2dfe8705..00000000
5912 --- a/plugins/akismet/wrapper.php
5913 +++ /dev/null
5914 @@ -1,214 +0,0 @@
5915 -<?php
5916 -
5917 -global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
5918 -
5919 -$wpcom_api_key = defined( 'WPCOM_API_KEY' ) ? constant( 'WPCOM_API_KEY' ) : '';
5920 -$akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com';
5921 -$akismet_api_port = 80;
5922 -
5923 -function akismet_test_mode() {
5924 - return Akismet::is_test_mode();
5925 -}
5926 -
5927 -function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {
5928 - $path = str_replace( '/1.1/', '', $path );
5929 -
5930 - return Akismet::http_post( $request, $path, $ip );
5931 -}
5932 -
5933 -function akismet_microtime() {
5934 - return Akismet::_get_microtime();
5935 -}
5936 -
5937 -function akismet_delete_old() {
5938 - return Akismet::delete_old_comments();
5939 -}
5940 -
5941 -function akismet_delete_old_metadata() {
5942 - return Akismet::delete_old_comments_meta();
5943 -}
5944 -
5945 -function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
5946 - return Akismet::check_db_comment( $id, $recheck_reason );
5947 -}
5948 -
5949 -function akismet_rightnow() {
5950 - if ( !class_exists( 'Akismet_Admin' ) )
5951 - return false;
5952 -
5953 - return Akismet_Admin::rightnow_stats();
5954 -}
5955 -
5956 -function akismet_admin_init() {
5957 - _deprecated_function( __FUNCTION__, '3.0' );
5958 -}
5959 -function akismet_version_warning() {
5960 - _deprecated_function( __FUNCTION__, '3.0' );
5961 -}
5962 -function akismet_load_js_and_css() {
5963 - _deprecated_function( __FUNCTION__, '3.0' );
5964 -}
5965 -function akismet_nonce_field( $action = -1 ) {
5966 - return wp_nonce_field( $action );
5967 -}
5968 -function akismet_plugin_action_links( $links, $file ) {
5969 - return Akismet_Admin::plugin_action_links( $links, $file );
5970 -}
5971 -function akismet_conf() {
5972 - _deprecated_function( __FUNCTION__, '3.0' );
5973 -}
5974 -function akismet_stats_display() {
5975 - _deprecated_function( __FUNCTION__, '3.0' );
5976 -}
5977 -function akismet_stats() {
5978 - return Akismet_Admin::dashboard_stats();
5979 -}
5980 -function akismet_admin_warnings() {
5981 - _deprecated_function( __FUNCTION__, '3.0' );
5982 -}
5983 -function akismet_comment_row_action( $a, $comment ) {
5984 - return Akismet_Admin::comment_row_actions( $a, $comment );
5985 -}
5986 -function akismet_comment_status_meta_box( $comment ) {
5987 - return Akismet_Admin::comment_status_meta_box( $comment );
5988 -}
5989 -function akismet_comments_columns( $columns ) {
5990 - _deprecated_function( __FUNCTION__, '3.0' );
5991 -
5992 - return $columns;
5993 -}
5994 -function akismet_comment_column_row( $column, $comment_id ) {
5995 - _deprecated_function( __FUNCTION__, '3.0' );
5996 -}
5997 -function akismet_text_add_link_callback( $m ) {
5998 - return Akismet_Admin::text_add_link_callback( $m );
5999 -}
6000 -function akismet_text_add_link_class( $comment_text ) {
6001 - return Akismet_Admin::text_add_link_class( $comment_text );
6002 -}
6003 -function akismet_check_for_spam_button( $comment_status ) {
6004 - return Akismet_Admin::check_for_spam_button( $comment_status );
6005 -}
6006 -function akismet_submit_nonspam_comment( $comment_id ) {
6007 - return Akismet::submit_nonspam_comment( $comment_id );
6008 -}
6009 -function akismet_submit_spam_comment( $comment_id ) {
6010 - return Akismet::submit_spam_comment( $comment_id );
6011 -}
6012 -function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
6013 - return Akismet::transition_comment_status( $new_status, $old_status, $comment );
6014 -}
6015 -function akismet_spam_count( $type = false ) {
6016 - return Akismet_Admin::get_spam_count( $type );
6017 -}
6018 -function akismet_recheck_queue() {
6019 - return Akismet_Admin::recheck_queue();
6020 -}
6021 -function akismet_remove_comment_author_url() {
6022 - return Akismet_Admin::remove_comment_author_url();
6023 -}
6024 -function akismet_add_comment_author_url() {
6025 - return Akismet_Admin::add_comment_author_url();
6026 -}
6027 -function akismet_check_server_connectivity() {
6028 - return Akismet_Admin::check_server_connectivity();
6029 -}
6030 -function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
6031 - return Akismet_Admin::get_server_connectivity( $cache_timeout );
6032 -}
6033 -function akismet_server_connectivity_ok() {
6034 - _deprecated_function( __FUNCTION__, '3.0' );
6035 -
6036 - return true;
6037 -}
6038 -function akismet_admin_menu() {
6039 - return Akismet_Admin::admin_menu();
6040 -}
6041 -function akismet_load_menu() {
6042 - return Akismet_Admin::load_menu();
6043 -}
6044 -function akismet_init() {
6045 - _deprecated_function( __FUNCTION__, '3.0' );
6046 -}
6047 -function akismet_get_key() {
6048 - return Akismet::get_api_key();
6049 -}
6050 -function akismet_check_key_status( $key, $ip = null ) {
6051 - return Akismet::check_key_status( $key, $ip );
6052 -}
6053 -function akismet_update_alert( $response ) {
6054 - return Akismet::update_alert( $response );
6055 -}
6056 -function akismet_verify_key( $key, $ip = null ) {
6057 - return Akismet::verify_key( $key, $ip );
6058 -}
6059 -function akismet_get_user_roles( $user_id ) {
6060 - return Akismet::get_user_roles( $user_id );
6061 -}
6062 -function akismet_result_spam( $approved ) {
6063 - return Akismet::comment_is_spam( $approved );
6064 -}
6065 -function akismet_result_hold( $approved ) {
6066 - return Akismet::comment_needs_moderation( $approved );
6067 -}
6068 -function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
6069 - return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );
6070 -}
6071 -function akismet_update_comment_history( $comment_id, $message, $event = null ) {
6072 - return Akismet::update_comment_history( $comment_id, $message, $event );
6073 -}
6074 -function akismet_get_comment_history( $comment_id ) {
6075 - return Akismet::get_comment_history( $comment_id );
6076 -}
6077 -function akismet_cmp_time( $a, $b ) {
6078 - return Akismet::_cmp_time( $a, $b );
6079 -}
6080 -function akismet_auto_check_update_meta( $id, $comment ) {
6081 - return Akismet::auto_check_update_meta( $id, $comment );
6082 -}
6083 -function akismet_auto_check_comment( $commentdata ) {
6084 - return Akismet::auto_check_comment( $commentdata );
6085 -}
6086 -function akismet_get_ip_address() {
6087 - return Akismet::get_ip_address();
6088 -}
6089 -function akismet_cron_recheck() {
6090 - return Akismet::cron_recheck();
6091 -}
6092 -function akismet_add_comment_nonce( $post_id ) {
6093 - return Akismet::add_comment_nonce( $post_id );
6094 -}
6095 -function akismet_fix_scheduled_recheck() {
6096 - return Akismet::fix_scheduled_recheck();
6097 -}
6098 -function akismet_spam_comments() {
6099 - _deprecated_function( __FUNCTION__, '3.0' );
6100 -
6101 - return array();
6102 -}
6103 -function akismet_spam_totals() {
6104 - _deprecated_function( __FUNCTION__, '3.0' );
6105 -
6106 - return array();
6107 -}
6108 -function akismet_manage_page() {
6109 - _deprecated_function( __FUNCTION__, '3.0' );
6110 -}
6111 -function akismet_caught() {
6112 - _deprecated_function( __FUNCTION__, '3.0' );
6113 -}
6114 -function redirect_old_akismet_urls() {
6115 - _deprecated_function( __FUNCTION__, '3.0' );
6116 -}
6117 -function akismet_kill_proxy_check( $option ) {
6118 - _deprecated_function( __FUNCTION__, '3.0' );
6119 -
6120 - return 0;
6121 -}
6122 -function akismet_pingback_forwarded_for( $r, $url ) {
6123 - // This functionality is now in core.
6124 - return false;
6125 -}
6126 -function akismet_pre_check_pingback( $method ) {
6127 - return Akismet::pre_check_pingback( $method );
6128 -}
6129 \ No newline at end of file
6130
6131 diff --git a/plugins/google-authenticator/LICENSE b/plugins/google-authenticator/LICENSE
6132 deleted file mode 100644
6133 index d159169d..00000000
6134 --- a/plugins/google-authenticator/LICENSE
6135 +++ /dev/null
6136 @@ -1,339 +0,0 @@
6137 - GNU GENERAL PUBLIC LICENSE
6138 - Version 2, June 1991
6139 -
6140 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
6141 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6142 - Everyone is permitted to copy and distribute verbatim copies
6143 - of this license document, but changing it is not allowed.
6144 -
6145 - Preamble
6146 -
6147 - The licenses for most software are designed to take away your
6148 -freedom to share and change it. By contrast, the GNU General Public
6149 -License is intended to guarantee your freedom to share and change free
6150 -software--to make sure the software is free for all its users. This
6151 -General Public License applies to most of the Free Software
6152 -Foundation's software and to any other program whose authors commit to
6153 -using it. (Some other Free Software Foundation software is covered by
6154 -the GNU Lesser General Public License instead.) You can apply it to
6155 -your programs, too.
6156 -
6157 - When we speak of free software, we are referring to freedom, not
6158 -price. Our General Public Licenses are designed to make sure that you
6159 -have the freedom to distribute copies of free software (and charge for
6160 -this service if you wish), that you receive source code or can get it
6161 -if you want it, that you can change the software or use pieces of it
6162 -in new free programs; and that you know you can do these things.
6163 -
6164 - To protect your rights, we need to make restrictions that forbid
6165 -anyone to deny you these rights or to ask you to surrender the rights.
6166 -These restrictions translate to certain responsibilities for you if you
6167 -distribute copies of the software, or if you modify it.
6168 -
6169 - For example, if you distribute copies of such a program, whether
6170 -gratis or for a fee, you must give the recipients all the rights that
6171 -you have. You must make sure that they, too, receive or can get the
6172 -source code. And you must show them these terms so they know their
6173 -rights.
6174 -
6175 - We protect your rights with two steps: (1) copyright the software, and
6176 -(2) offer you this license which gives you legal permission to copy,
6177 -distribute and/or modify the software.
6178 -
6179 - Also, for each author's protection and ours, we want to make certain
6180 -that everyone understands that there is no warranty for this free
6181 -software. If the software is modified by someone else and passed on, we
6182 -want its recipients to know that what they have is not the original, so
6183 -that any problems introduced by others will not reflect on the original
6184 -authors' reputations.
6185 -
6186 - Finally, any free program is threatened constantly by software
6187 -patents. We wish to avoid the danger that redistributors of a free
6188 -program will individually obtain patent licenses, in effect making the
6189 -program proprietary. To prevent this, we have made it clear that any
6190 -patent must be licensed for everyone's free use or not licensed at all.
6191 -
6192 - The precise terms and conditions for copying, distribution and
6193 -modification follow.
6194 -
6195 - GNU GENERAL PUBLIC LICENSE
6196 - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
6197 -
6198 - 0. This License applies to any program or other work which contains
6199 -a notice placed by the copyright holder saying it may be distributed
6200 -under the terms of this General Public License. The "Program", below,
6201 -refers to any such program or work, and a "work based on the Program"
6202 -means either the Program or any derivative work under copyright law:
6203 -that is to say, a work containing the Program or a portion of it,
6204 -either verbatim or with modifications and/or translated into another
6205 -language. (Hereinafter, translation is included without limitation in
6206 -the term "modification".) Each licensee is addressed as "you".
6207 -
6208 -Activities other than copying, distribution and modification are not
6209 -covered by this License; they are outside its scope. The act of
6210 -running the Program is not restricted, and the output from the Program
6211 -is covered only if its contents constitute a work based on the
6212 -Program (independent of having been made by running the Program).
6213 -Whether that is true depends on what the Program does.
6214 -
6215 - 1. You may copy and distribute verbatim copies of the Program's
6216 -source code as you receive it, in any medium, provided that you
6217 -conspicuously and appropriately publish on each copy an appropriate
6218 -copyright notice and disclaimer of warranty; keep intact all the
6219 -notices that refer to this License and to the absence of any warranty;
6220 -and give any other recipients of the Program a copy of this License
6221 -along with the Program.
6222 -
6223 -You may charge a fee for the physical act of transferring a copy, and
6224 -you may at your option offer warranty protection in exchange for a fee.
6225 -
6226 - 2. You may modify your copy or copies of the Program or any portion
6227 -of it, thus forming a work based on the Program, and copy and
6228 -distribute such modifications or work under the terms of Section 1
6229 -above, provided that you also meet all of these conditions:
6230 -
6231 - a) You must cause the modified files to carry prominent notices
6232 - stating that you changed the files and the date of any change.
6233 -
6234 - b) You must cause any work that you distribute or publish, that in
6235 - whole or in part contains or is derived from the Program or any
6236 - part thereof, to be licensed as a whole at no charge to all third
6237 - parties under the terms of this License.
6238 -
6239 - c) If the modified program normally reads commands interactively
6240 - when run, you must cause it, when started running for such
6241 - interactive use in the most ordinary way, to print or display an
6242 - announcement including an appropriate copyright notice and a
6243 - notice that there is no warranty (or else, saying that you provide
6244 - a warranty) and that users may redistribute the program under
6245 - these conditions, and telling the user how to view a copy of this
6246 - License. (Exception: if the Program itself is interactive but
6247 - does not normally print such an announcement, your work based on
6248 - the Program is not required to print an announcement.)
6249 -
6250 -These requirements apply to the modified work as a whole. If
6251 -identifiable sections of that work are not derived from the Program,
6252 -and can be reasonably considered independent and separate works in
6253 -themselves, then this License, and its terms, do not apply to those
6254 -sections when you distribute them as separate works. But when you
6255 -distribute the same sections as part of a whole which is a work based
6256 -on the Program, the distribution of the whole must be on the terms of
6257 -this License, whose permissions for other licensees extend to the
6258 -entire whole, and thus to each and every part regardless of who wrote it.
6259 -
6260 -Thus, it is not the intent of this section to claim rights or contest
6261 -your rights to work written entirely by you; rather, the intent is to
6262 -exercise the right to control the distribution of derivative or
6263 -collective works based on the Program.
6264 -
6265 -In addition, mere aggregation of another work not based on the Program
6266 -with the Program (or with a work based on the Program) on a volume of
6267 -a storage or distribution medium does not bring the other work under
6268 -the scope of this License.
6269 -
6270 - 3. You may copy and distribute the Program (or a work based on it,
6271 -under Section 2) in object code or executable form under the terms of
6272 -Sections 1 and 2 above provided that you also do one of the following:
6273 -
6274 - a) Accompany it with the complete corresponding machine-readable
6275 - source code, which must be distributed under the terms of Sections
6276 - 1 and 2 above on a medium customarily used for software interchange; or,
6277 -
6278 - b) Accompany it with a written offer, valid for at least three
6279 - years, to give any third party, for a charge no more than your
6280 - cost of physically performing source distribution, a complete
6281 - machine-readable copy of the corresponding source code, to be
6282 - distributed under the terms of Sections 1 and 2 above on a medium
6283 - customarily used for software interchange; or,
6284 -
6285 - c) Accompany it with the information you received as to the offer
6286 - to distribute corresponding source code. (This alternative is
6287 - allowed only for noncommercial distribution and only if you
6288 - received the program in object code or executable form with such
6289 - an offer, in accord with Subsection b above.)
6290 -
6291 -The source code for a work means the preferred form of the work for
6292 -making modifications to it. For an executable work, complete source
6293 -code means all the source code for all modules it contains, plus any
6294 -associated interface definition files, plus the scripts used to
6295 -control compilation and installation of the executable. However, as a
6296 -special exception, the source code distributed need not include
6297 -anything that is normally distributed (in either source or binary
6298 -form) with the major components (compiler, kernel, and so on) of the
6299 -operating system on which the executable runs, unless that component
6300 -itself accompanies the executable.
6301 -
6302 -If distribution of executable or object code is made by offering
6303 -access to copy from a designated place, then offering equivalent
6304 -access to copy the source code from the same place counts as
6305 -distribution of the source code, even though third parties are not
6306 -compelled to copy the source along with the object code.
6307 -
6308 - 4. You may not copy, modify, sublicense, or distribute the Program
6309 -except as expressly provided under this License. Any attempt
6310 -otherwise to copy, modify, sublicense or distribute the Program is
6311 -void, and will automatically terminate your rights under this License.
6312 -However, parties who have received copies, or rights, from you under
6313 -this License will not have their licenses terminated so long as such
6314 -parties remain in full compliance.
6315 -
6316 - 5. You are not required to accept this License, since you have not
6317 -signed it. However, nothing else grants you permission to modify or
6318 -distribute the Program or its derivative works. These actions are
6319 -prohibited by law if you do not accept this License. Therefore, by
6320 -modifying or distributing the Program (or any work based on the
6321 -Program), you indicate your acceptance of this License to do so, and
6322 -all its terms and conditions for copying, distributing or modifying
6323 -the Program or works based on it.
6324 -
6325 - 6. Each time you redistribute the Program (or any work based on the
6326 -Program), the recipient automatically receives a license from the
6327 -original licensor to copy, distribute or modify the Program subject to
6328 -these terms and conditions. You may not impose any further
6329 -restrictions on the recipients' exercise of the rights granted herein.
6330 -You are not responsible for enforcing compliance by third parties to
6331 -this License.
6332 -
6333 - 7. If, as a consequence of a court judgment or allegation of patent
6334 -infringement or for any other reason (not limited to patent issues),
6335 -conditions are imposed on you (whether by court order, agreement or
6336 -otherwise) that contradict the conditions of this License, they do not
6337 -excuse you from the conditions of this License. If you cannot
6338 -distribute so as to satisfy simultaneously your obligations under this
6339 -License and any other pertinent obligations, then as a consequence you
6340 -may not distribute the Program at all. For example, if a patent
6341 -license would not permit royalty-free redistribution of the Program by
6342 -all those who receive copies directly or indirectly through you, then
6343 -the only way you could satisfy both it and this License would be to
6344 -refrain entirely from distribution of the Program.
6345 -
6346 -If any portion of this section is held invalid or unenforceable under
6347 -any particular circumstance, the balance of the section is intended to
6348 -apply and the section as a whole is intended to apply in other
6349 -circumstances.
6350 -
6351 -It is not the purpose of this section to induce you to infringe any
6352 -patents or other property right claims or to contest validity of any
6353 -such claims; this section has the sole purpose of protecting the
6354 -integrity of the free software distribution system, which is
6355 -implemented by public license practices. Many people have made
6356 -generous contributions to the wide range of software distributed
6357 -through that system in reliance on consistent application of that
6358 -system; it is up to the author/donor to decide if he or she is willing
6359 -to distribute software through any other system and a licensee cannot
6360 -impose that choice.
6361 -
6362 -This section is intended to make thoroughly clear what is believed to
6363 -be a consequence of the rest of this License.
6364 -
6365 - 8. If the distribution and/or use of the Program is restricted in
6366 -certain countries either by patents or by copyrighted interfaces, the
6367 -original copyright holder who places the Program under this License
6368 -may add an explicit geographical distribution limitation excluding
6369 -those countries, so that distribution is permitted only in or among
6370 -countries not thus excluded. In such case, this License incorporates
6371 -the limitation as if written in the body of this License.
6372 -
6373 - 9. The Free Software Foundation may publish revised and/or new versions
6374 -of the General Public License from time to time. Such new versions will
6375 -be similar in spirit to the present version, but may differ in detail to
6376 -address new problems or concerns.
6377 -
6378 -Each version is given a distinguishing version number. If the Program
6379 -specifies a version number of this License which applies to it and "any
6380 -later version", you have the option of following the terms and conditions
6381 -either of that version or of any later version published by the Free
6382 -Software Foundation. If the Program does not specify a version number of
6383 -this License, you may choose any version ever published by the Free Software
6384 -Foundation.
6385 -
6386 - 10. If you wish to incorporate parts of the Program into other free
6387 -programs whose distribution conditions are different, write to the author
6388 -to ask for permission. For software which is copyrighted by the Free
6389 -Software Foundation, write to the Free Software Foundation; we sometimes
6390 -make exceptions for this. Our decision will be guided by the two goals
6391 -of preserving the free status of all derivatives of our free software and
6392 -of promoting the sharing and reuse of software generally.
6393 -
6394 - NO WARRANTY
6395 -
6396 - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
6397 -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
6398 -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
6399 -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
6400 -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
6401 -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
6402 -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
6403 -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
6404 -REPAIR OR CORRECTION.
6405 -
6406 - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
6407 -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
6408 -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
6409 -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
6410 -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
6411 -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
6412 -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
6413 -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
6414 -POSSIBILITY OF SUCH DAMAGES.
6415 -
6416 - END OF TERMS AND CONDITIONS
6417 -
6418 - How to Apply These Terms to Your New Programs
6419 -
6420 - If you develop a new program, and you want it to be of the greatest
6421 -possible use to the public, the best way to achieve this is to make it
6422 -free software which everyone can redistribute and change under these terms.
6423 -
6424 - To do so, attach the following notices to the program. It is safest
6425 -to attach them to the start of each source file to most effectively
6426 -convey the exclusion of warranty; and each file should have at least
6427 -the "copyright" line and a pointer to where the full notice is found.
6428 -
6429 - <one line to give the program's name and a brief idea of what it does.>
6430 - Copyright (C) <year> <name of author>
6431 -
6432 - This program is free software; you can redistribute it and/or modify
6433 - it under the terms of the GNU General Public License as published by
6434 - the Free Software Foundation; either version 2 of the License, or
6435 - (at your option) any later version.
6436 -
6437 - This program is distributed in the hope that it will be useful,
6438 - but WITHOUT ANY WARRANTY; without even the implied warranty of
6439 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6440 - GNU General Public License for more details.
6441 -
6442 - You should have received a copy of the GNU General Public License along
6443 - with this program; if not, write to the Free Software Foundation, Inc.,
6444 - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
6445 -
6446 -Also add information on how to contact you by electronic and paper mail.
6447 -
6448 -If the program is interactive, make it output a short notice like this
6449 -when it starts in an interactive mode:
6450 -
6451 - Gnomovision version 69, Copyright (C) year name of author
6452 - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
6453 - This is free software, and you are welcome to redistribute it
6454 - under certain conditions; type `show c' for details.
6455 -
6456 -The hypothetical commands `show w' and `show c' should show the appropriate
6457 -parts of the General Public License. Of course, the commands you use may
6458 -be called something other than `show w' and `show c'; they could even be
6459 -mouse-clicks or menu items--whatever suits your program.
6460 -
6461 -You should also get your employer (if you work as a programmer) or your
6462 -school, if any, to sign a "copyright disclaimer" for the program, if
6463 -necessary. Here is a sample; alter the names:
6464 -
6465 - Yoyodyne, Inc., hereby disclaims all copyright interest in the program
6466 - `Gnomovision' (which makes passes at compilers) written by James Hacker.
6467 -
6468 - <signature of Ty Coon>, 1 April 1989
6469 - Ty Coon, President of Vice
6470 -
6471 -This General Public License does not permit incorporating your program into
6472 -proprietary programs. If your program is a subroutine library, you may
6473 -consider it more useful to permit linking proprietary applications with the
6474 -library. If this is what you want to do, use the GNU Lesser General
6475 -Public License instead of this License.
6476
6477 diff --git a/plugins/google-authenticator/base32.php b/plugins/google-authenticator/base32.php
6478 deleted file mode 100644
6479 index 91bd93e9..00000000
6480 --- a/plugins/google-authenticator/base32.php
6481 +++ /dev/null
6482 @@ -1,82 +0,0 @@
6483 -<?php
6484 -
6485 -/**
6486 - * Encode in Base32 based on RFC 4648.
6487 - * Requires 20% more space than base64
6488 - * Great for case-insensitive filesystems like Windows and URL's (except for = char which can be excluded using the pad option for urls)
6489 - *
6490 - * @package default
6491 - * @author Bryan Ruiz
6492 - **/
6493 -class Base32 {
6494 -
6495 - private static $map = array(
6496 - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7
6497 - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15
6498 - 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23
6499 - 'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31
6500 - '=' // padding char
6501 - );
6502 -
6503 - private static $flippedMap = array(
6504 - 'A'=>'0', 'B'=>'1', 'C'=>'2', 'D'=>'3', 'E'=>'4', 'F'=>'5', 'G'=>'6', 'H'=>'7',
6505 - 'I'=>'8', 'J'=>'9', 'K'=>'10', 'L'=>'11', 'M'=>'12', 'N'=>'13', 'O'=>'14', 'P'=>'15',
6506 - 'Q'=>'16', 'R'=>'17', 'S'=>'18', 'T'=>'19', 'U'=>'20', 'V'=>'21', 'W'=>'22', 'X'=>'23',
6507 - 'Y'=>'24', 'Z'=>'25', '2'=>'26', '3'=>'27', '4'=>'28', '5'=>'29', '6'=>'30', '7'=>'31'
6508 - );
6509 -
6510 - /**
6511 - * Use padding false when encoding for urls
6512 - *
6513 - * @return base32 encoded string
6514 - * @author Bryan Ruiz
6515 - **/
6516 - public static function encode($input, $padding = true) {
6517 - if(empty($input)) return "";
6518 - $input = str_split($input);
6519 - $binaryString = "";
6520 - for($i = 0; $i < count($input); $i++) {
6521 - $binaryString .= str_pad(base_convert(ord($input[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
6522 - }
6523 - $fiveBitBinaryArray = str_split($binaryString, 5);
6524 - $base32 = "";
6525 - $i=0;
6526 - while($i < count($fiveBitBinaryArray)) {
6527 - $base32 .= self::$map[base_convert(str_pad($fiveBitBinaryArray[$i], 5,'0'), 2, 10)];
6528 - $i++;
6529 - }
6530 - if($padding && ($x = strlen($binaryString) % 40) != 0) {
6531 - if($x == 8) $base32 .= str_repeat(self::$map[32], 6);
6532 - else if($x == 16) $base32 .= str_repeat(self::$map[32], 4);
6533 - else if($x == 24) $base32 .= str_repeat(self::$map[32], 3);
6534 - else if($x == 32) $base32 .= self::$map[32];
6535 - }
6536 - return $base32;
6537 - }
6538 -
6539 - public static function decode($input) {
6540 - if(empty($input)) return;
6541 - $paddingCharCount = substr_count($input, self::$map[32]);
6542 - $allowedValues = array(6,4,3,1,0);
6543 - if(!in_array($paddingCharCount, $allowedValues)) return false;
6544 - for($i=0; $i<4; $i++){
6545 - if($paddingCharCount == $allowedValues[$i] &&
6546 - substr($input, -($allowedValues[$i])) != str_repeat(self::$map[32], $allowedValues[$i])) return false;
6547 - }
6548 - $input = str_replace('=','', $input);
6549 - $input = str_split($input);
6550 - $binaryString = "";
6551 - for($i=0; $i < count($input); $i = $i+8) {
6552 - $x = "";
6553 - if(!in_array($input[$i], self::$map)) return false;
6554 - for($j=0; $j < 8; $j++) {
6555 - $x .= str_pad(base_convert(@self::$flippedMap[@$input[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT);
6556 - }
6557 - $eightBits = str_split($x, 8);
6558 - for($z = 0; $z < count($eightBits); $z++) {
6559 - $binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:"";
6560 - }
6561 - }
6562 - return $binaryString;
6563 - }
6564 -}
6565 \ No newline at end of file
6566
6567 diff --git a/plugins/google-authenticator/google-authenticator.php b/plugins/google-authenticator/google-authenticator.php
6568 deleted file mode 100644
6569 index 5d5f8601..00000000
6570 --- a/plugins/google-authenticator/google-authenticator.php
6571 +++ /dev/null
6572 @@ -1,1007 +0,0 @@
6573 -<?php
6574 -/*
6575 -Plugin Name: Google Authenticator
6576 -Plugin URI: https://github.com/ivankruchkoff/google-authenticator
6577 -Description: Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry app as One Time Password generator.
6578 -Author: Ivan Kruchkoff
6579 -Version: 0.52
6580 -Author URI: https://github.com/ivankruchkoff
6581 -Compatibility: WordPress 5.2
6582 -Text Domain: google-authenticator
6583 -Domain Path: /lang
6584 -
6585 -----------------------------------------------------------------------------
6586 -
6587 -
6588 - Thanks to Fabio Zumbi for Portuguese translation.
6589 - Thanks to Guido Schalkx for the Dutch translation.
6590 - Thanks to Henrik Schack for creating / maintaining versions 0.20 to 0.48
6591 - Thanks to Ivan Kruchkoff for his UX improvements in user signup.
6592 - Thanks to Bryan Ruiz for his Base32 encode/decode class, found at php.net.
6593 - Thanks to Tobias Bäthge for his major code rewrite and German translation.
6594 - Thanks to Pascal de Bruijn for his relaxed mode idea.
6595 - Thanks to Daniel Werl for his usability tips.
6596 - Thanks to Dion Hulse for his bugfixes.
6597 - Thanks to Aldo Latino for his Italian translation.
6598 - Thanks to Kaijia Feng for his Simplified Chinese translation.
6599 - Thanks to Ian Dunn for fixing some depricated function calls.
6600 - Thanks to Kimmo Suominen for fixing the iPhone description issue.
6601 - Thanks to Alex Concha for some security tips.
6602 - Thanks to Sébastien Prunier for his Spanish and French translations.
6603 -
6604 -----------------------------------------------------------------------------
6605 -
6606 - Versions from 0.49 onwards
6607 - Copyright 2019 Ivan Kruchkoff
6608 -
6609 - Versions up to and including 0.48
6610 - Copyright 2013 Henrik Schack (email : henrik@××××××.dk)
6611 -
6612 - This program is free software; you can redistribute it and/or modify
6613 - it under the terms of the GNU General Public License as published by
6614 - the Free Software Foundation; either version 2 of the License, or
6615 - (at your option) any later version.
6616 -
6617 - This program is distributed in the hope that it will be useful,
6618 - but WITHOUT ANY WARRANTY; without even the implied warranty of
6619 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6620 - GNU General Public License for more details.
6621 -
6622 - You should have received a copy of the GNU General Public License
6623 - along with this program; if not, write to the Free Software
6624 - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6625 -*/
6626 -
6627 -class GoogleAuthenticator {
6628 -
6629 -static $instance; // to store a reference to the plugin, allows other plugins to remove actions
6630 -const SETUP_PAGE = 'google_authenticator_user_page';
6631 -protected $error_message = null;
6632 -
6633 -/**
6634 - * Constructor, entry point of the plugin
6635 - */
6636 -function __construct() {
6637 - self::$instance = $this;
6638 - add_action( 'init', array( $this, 'init' ) );
6639 -}
6640 -
6641 -/**
6642 - * Initialization, Hooks, and localization
6643 - */
6644 -function init() {
6645 - if ( ! class_exists( 'Base32' ) ) {
6646 - require_once( 'base32.php' );
6647 - }
6648 -
6649 - if ( ! $this->is_two_screen_signin_enabled() ) {
6650 - add_action( 'login_form', array( $this, 'loginform' ) );
6651 - add_action( 'login_footer', array( $this, 'loginfooter' ) );
6652 - }
6653 -
6654 - add_filter( 'authenticate', array( $this, 'check_otp' ), 50, 3 );
6655 -
6656 - if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
6657 - add_action( 'wp_ajax_GoogleAuthenticator_action', array( $this, 'ajax_callback' ) );
6658 - }
6659 -
6660 - add_action( 'personal_options_update', array( $this, 'personal_options_update' ) );
6661 - add_action( 'profile_personal_options', array( $this, 'profile_personal_options' ) );
6662 - add_action( 'edit_user_profile', array( $this, 'edit_user_profile' ) );
6663 - add_action( 'edit_user_profile_update', array( $this, 'edit_user_profile_update' ) );
6664 -
6665 - add_action( 'admin_enqueue_scripts', array( $this, 'add_qrcode_script' ) );
6666 - add_action( 'admin_menu', array ( $this, 'add_pages' ) );
6667 - add_action( 'network_admin_menu', array ( $this, 'add_pages' ) );
6668 - add_action( 'current_screen', array ( $this, 'redirect_if_setup_required' ) );
6669 - add_action( 'admin_notices', array ( $this, 'successful_signup_message' ) );
6670 - add_action( 'load-admin_page_google_authenticator_user_page', array( $this, 'save_submitted_setup_page' ) );
6671 -
6672 - load_plugin_textdomain( 'google-authenticator', false, basename( dirname( __FILE__ ) ) . '/lang' );
6673 -}
6674 -
6675 -/**
6676 - * Whether we show Google Auth code on the login screen, or after the user has entered their username and password.
6677 - *
6678 - * If it's on a separate screen, it means username / passwords can still be bruteforced, but logins can't occur without 2fa
6679 - *
6680 - * @return bool
6681 - */
6682 -function is_two_screen_signin_enabled() {
6683 - $two_screen_mfa = is_multisite() ? get_site_option( 'googleauthenticator_two_screen_signin' ) : get_option( 'googleauthenticator_two_screen_signin' );
6684 - return !! $two_screen_mfa;
6685 -}
6686 -
6687 -/**
6688 - * Check the verification code entered by the user.
6689 - */
6690 -
6691 -function verify( $secretkey, $thistry, $relaxedmode, $lasttimeslot ) {
6692 - // Did the user enter 6 digits ?
6693 - if ( strlen( $thistry ) != 6) {
6694 - return false;
6695 - } else {
6696 - $thistry = intval ( $thistry );
6697 - }
6698 - // If user is running in relaxed mode, we allow more time drifting
6699 - // ±4 min, as opposed to ± 30 seconds in normal mode.
6700 - if ( $relaxedmode == 'enabled' ) {
6701 - $firstcount = -8;
6702 - $lastcount = 8;
6703 - } else {
6704 - $firstcount = -1;
6705 - $lastcount = 1;
6706 - }
6707 -
6708 - $tm = floor( time() / 30 );
6709 -
6710 - $secretkey=Base32::decode($secretkey);
6711 - // Keys from 30 seconds before and after are valid aswell.
6712 - for ($i=$firstcount; $i<=$lastcount; $i++) {
6713 - // Pack time into binary string
6714 - $time=chr(0).chr(0).chr(0).chr(0).pack('N*',$tm+$i);
6715 - // Hash it with users secret key
6716 - $hm = hash_hmac( 'SHA1', $time, $secretkey, true );
6717 - // Use last nipple of result as index/offset
6718 - $offset = ord(substr($hm,-1)) & 0x0F;
6719 - // grab 4 bytes of the result
6720 - $hashpart=substr($hm,$offset,4);
6721 - // Unpak binary value
6722 - $value=unpack("N",$hashpart);
6723 - $value=$value[1];
6724 - // Only 32 bits
6725 - $value = $value & 0x7FFFFFFF;
6726 - $value = $value % 1000000;
6727 - if ( $value === $thistry ) {
6728 - // Check for replay (Man-in-the-middle) attack.
6729 - // Since this is not Star Trek, time can only move forward,
6730 - // meaning current login attempt has to be in the future compared to
6731 - // last successful login.
6732 - if ( $lasttimeslot >= ($tm+$i) ) {
6733 - error_log("Google Authenticator plugin: Man-in-the-middle attack detected (Could also be 2 legit login attempts within the same 30 second period)");
6734 - return false;
6735 - }
6736 - // Return timeslot in which login happened.
6737 - return $tm+$i;
6738 - }
6739 - }
6740 - return false;
6741 -}
6742 -
6743 -/**
6744 - * Create a new random secret for the Google Authenticator app.
6745 - * 16 characters, randomly chosen from the allowed Base32 characters
6746 - * equals 10 bytes = 80 bits, as 256^10 = 32^16 = 2^80
6747 - */
6748 -function create_secret() {
6749 - $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; // allowed characters in Base32
6750 - $secret = '';
6751 - for ( $i = 0; $i < 16; $i++ ) {
6752 - $secret .= substr( $chars, wp_rand( 0, strlen( $chars ) - 1 ), 1 );
6753 - }
6754 - return $secret;
6755 -}
6756 -
6757 -/**
6758 - * Add the script to generate QR codes.
6759 - */
6760 -function add_qrcode_script() {
6761 - wp_enqueue_script('jquery');
6762 - wp_register_script('qrcode_script', plugins_url('jquery.qrcode.min.js', __FILE__),array("jquery"));
6763 - wp_enqueue_script('qrcode_script');
6764 -}
6765 -
6766 -/**
6767 - * Add 2fa pages to menus
6768 - */
6769 -function add_pages() {
6770 - // No menu entry for this page
6771 - add_submenu_page( null, esc_html__( 'Google Authenticator', 'google-authenticator' ), null, 'read', self::SETUP_PAGE, array( $this, 'user_setup_page' ) );
6772 -
6773 - // Site admin screen
6774 - add_submenu_page( 'options-general.php', esc_html__( 'Google Authenticator', 'google-authenticator' ), esc_html__( 'Google Authenticator', 'google-authenticator' ), 'manage_options', 'google_authenticator', array( $this, 'admin_setup_page' ) );
6775 -
6776 - // Network admin screen
6777 - add_submenu_page( 'settings.php', esc_html__( 'Google Authenticator', 'google-authenticator' ), esc_html__( 'Google Authenticator', 'google-authenticator' ), 'manage_network_options', 'google_authenticator', array( $this, 'network_admin_setup_page' ) );
6778 -}
6779 -
6780 -/**
6781 - * Determine if a user needs to setup authy 2fa
6782 - * @return bool
6783 - */
6784 -function user_needs_to_setup_google_authenticator() {
6785 - $user = wp_get_current_user();
6786 - $enabled = trim(get_user_option( 'googleauthenticator_enabled', $user->ID ) ) === 'enabled';
6787 - if ( $enabled ) {
6788 - return false;
6789 - }
6790 -
6791 - $must_signup = false;
6792 - $user_role = $user->roles[0];
6793 - $check_single_site_admin_options = true;
6794 -
6795 - if ( is_multisite() ) {
6796 - $roles = get_site_option( 'googleauthenticator_mandatory_mfa_roles', array() );
6797 - if ( in_array( $user_role, $roles ) ) {
6798 - $must_signup = true;
6799 - }
6800 - $check_single_site_admin_options = '1' !== get_site_option( 'googleauthenticator_network_only' ) ;
6801 - }
6802 -
6803 - if ( ! $must_signup && $check_single_site_admin_options ) {
6804 - $roles = get_option( 'googleauthenticator_mandatory_mfa_roles', array() );
6805 - if ( in_array( $user_role, $roles ) ) {
6806 - $must_signup = true;
6807 - }
6808 -
6809 - }
6810 -
6811 - return apply_filters( 'google_authenticator_needs_setup', $must_signup, $user );
6812 -}
6813 -
6814 -/**
6815 - * Send users to the signup page if they must signup.
6816 - */
6817 -function redirect_if_setup_required() {
6818 - if ( $this->user_needs_to_setup_google_authenticator() ) {
6819 - $screen = get_current_screen();
6820 - $pagename = 'admin_page_' . self::SETUP_PAGE;
6821 - if ( is_a( $screen, 'WP_Screen') && in_array( $screen->id, array( $pagename, 'profile' ) ) ) {
6822 - return;
6823 - }
6824 -
6825 - // Some check against super admin so they can enable/disable the plugin.
6826 - $location = admin_url( 'admin.php?page=' . self::SETUP_PAGE );
6827 - wp_redirect( $location);
6828 - exit;
6829 - }
6830 -}
6831 -
6832 -/**
6833 - * Save the GA secret if valid totp is provided
6834 - * @return void
6835 - */
6836 -function save_submitted_setup_page() {
6837 - $this->error_message = null; // Reset a previous error message if it was set
6838 - $user = wp_get_current_user();
6839 - $secret = empty( $_POST['GA_secret'] ) ? false : sanitize_text_field( $_POST['GA_secret']);
6840 - $otp = empty( $_POST['GA_otp_code'] ) ? false : sanitize_text_field( $_POST['GA_otp_code']);
6841 - if ( ! strlen( $secret ) || ! strlen( $otp ) ) {
6842 - return;
6843 - }
6844 - $relaxed_mode = trim( get_user_option( 'googleauthenticator_relaxedmode', $user->ID ) );
6845 - $relaxed_mode = 'enabled' === $relaxed_mode ? 'enabled' : 'disabled';
6846 - if ( $timeslot = $this->verify( $secret, $otp, $relaxed_mode, '' ) ) {
6847 - update_user_option( $user->ID, 'googleauthenticator_lasttimeslot', $timeslot, true );
6848 - update_user_option( $user->ID, 'googleauthenticator_secret', $secret, true );
6849 - update_user_option( $user->ID, 'googleauthenticator_enabled', 'enabled', true );
6850 - $location = admin_url( 'index.php?googleauthenticator=enabled' );
6851 - wp_redirect( $location );
6852 - exit;
6853 - };
6854 -
6855 - $this->error_message = new WP_Error( 'invalid-otp', esc_html__( "OTP code doesn't match supplied secret, please check you've configured Authenticator correctly.", 'google-authenticator' ) );
6856 -}
6857 -
6858 -/**
6859 - * Show the user a success message after we redirect them following successful google authenticator setup
6860 - */
6861 -function successful_signup_message() {
6862 - if ( ! empty( $_GET['googleauthenticator'] ) && 'enabled' === $_GET['googleauthenticator'] ) : ?>
6863 - <div class="updated notice">
6864 - <p><?php esc_html_e( 'Congratulations, you have successfully enabled Google Authenticator for your account', 'google-authenticator' ); ?></p>
6865 - </div>
6866 -
6867 - <?php endif;
6868 -}
6869 -
6870 -/**
6871 - * Callback function to render the google authenticator setup page
6872 - */
6873 -function user_setup_page() {
6874 - $user = wp_get_current_user();
6875 - $enabled = trim(get_user_option( 'googleauthenticator_enabled', $user->ID ) ) === 'enabled';
6876 - if ( $enabled ) {
6877 - $location = admin_url( 'index.php' );
6878 - wp_redirect( $location );
6879 - exit;
6880 - }
6881 - $error = $this->error_message;
6882 -
6883 - $app_links = array(
6884 - array(
6885 - 'text' => __( 'iOS: Authy', 'google-authenticator' ),
6886 - 'link' => 'https://itunes.apple.com/app/authy/id494168017',
6887 - ),
6888 - array(
6889 - 'text' => __( 'iOS: Google Authenticator', 'google-authenticator' ),
6890 - 'link' => 'https://itunes.apple.com/app/google-authenticator/id388497605',
6891 - ),
6892 - array(
6893 - 'text' => __( 'Android: Authy', 'google-authenticator' ),
6894 - 'link' => 'https://play.google.com/store/apps/details?id=com.authy.authy',
6895 - ),
6896 - array(
6897 - 'text' => __( 'Android: Google Authenticator', 'google-authenticator' ),
6898 - 'link' => 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2',
6899 - ),
6900 - array(
6901 - 'text' => __( 'Windows Phone', 'google-authenticator' ),
6902 - 'link' => 'https://www.microsoft.com/store/p/authenticator/9nblggh08h54',
6903 - ),
6904 - array(
6905 - 'text' => __( 'Chrome Browser', 'google-authenticator' ),
6906 - 'link' => 'https://chrome.google.com/webstore/detail/authy-chrome-extension/fhgenkpocbhhddlgkjnfghpjanffonno',
6907 - ),
6908 - array(
6909 - 'text' => __( 'Desktop', 'google-authenticator' ),
6910 - 'link' => 'https://authy.com/download/',
6911 - ),
6912 -
6913 - );
6914 -
6915 - ?>
6916 - <div class="wrap">
6917 - <h1><?php esc_html_e( 'Google Authenticator Settings', 'google-authenticator' ); ?></h1>
6918 - <?php if (is_wp_error( $error ) ): ?>
6919 - <div class="error notice"><p><?php esc_html_e( $error->get_error_message() ); ?></p></div>
6920 - <?php endif; ?>
6921 - <p><?php echo esc_html__( "If you haven't already done so, please install the Authy or Google Authenticator app on your mobile device from the App Store:", 'google-authenticator' ); ?></p>
6922 - <ul>
6923 - <?php foreach( $app_links as $app_link ): ?>
6924 - <li><a href="<?php echo esc_url( $app_link[ 'link' ] ); ?>"><?php echo esc_html( $app_link[ 'text' ] ); ?></a></li>
6925 - <?php endforeach; ?>
6926 - </ul>
6927 - <p><?php echo esc_html__( 'The easiest way to enable your account is to add an account by scanning the QR code using the app.', 'google-authenticator' ); ?></p>
6928 - <p>
6929 - <?php echo esc_html__( "An account can also be added by typing in the secret. After you've added your account to the App, please type the code you see on the screen into the Authenticator Code field and press the Verify Authenticator Code button.", 'google-authenticator' ); ?>
6930 - </p>
6931 - <p>
6932 - <?php echo esc_html__( 'If the account setup was successful, you will be logged out, and will need to login again using your Username, Password and Authenticator code generated using the App on your mobile device.', 'google-authenticator' ); ?>
6933 - </p>
6934 - <form method="post">
6935 - <?php $this->profile_personal_options( array(
6936 - 'show_active' => false,
6937 - 'show_relaxed_mode' => false,
6938 - 'show_description' => false,
6939 - 'show_secret_qr' => true,
6940 - 'show_secret_buttons' => false,
6941 - 'show_authenticator_code' => true,
6942 - 'show_app_password' => false,
6943 - )); ?>
6944 - </form>
6945 - </div>
6946 - <?php
6947 -}
6948 -
6949 -/**
6950 - * Save site / network wide settings
6951 - * @param $is_network
6952 - */
6953 -function save_submitted_admin_setup_page( $is_network ) {
6954 - $nonce = filter_input( INPUT_POST, 'googleauthenticator', FILTER_SANITIZE_STRING );
6955 - if ( wp_verify_nonce( $nonce, 'googleauthenticator' ) ) {
6956 - if ( $is_network ) {
6957 - $network_settings_only = array_key_exists( 'network_settings_only', $_POST );
6958 - if ( current_user_can( 'manage_network_options' ) ) {
6959 - update_site_option( 'googleauthenticator_network_only', $network_settings_only );
6960 - }
6961 - }
6962 - $two_screen_mfa = array_key_exists( 'two_screen_approach', $_POST ) && 'true' === $_POST[ 'two_screen_approach' ];
6963 - if ( is_multisite() && $is_network ) {
6964 - if ( current_user_can( 'manage_network_options' ) ) {
6965 - update_site_option( 'googleauthenticator_two_screen_signin', $two_screen_mfa );
6966 - }
6967 - } elseif ( ! $is_network ) {
6968 - if ( current_user_can( 'manage_options' ) ) {
6969 - update_option( 'googleauthenticator_two_screen_signin', $two_screen_mfa );
6970 - }
6971 - }
6972 - $roles = isset( $_POST['roles'] ) ? (array) $_POST['roles'] : array();
6973 - $roles = array_map( 'sanitize_text_field', $roles );
6974 -
6975 - if ( $is_network ) {
6976 - if ( current_user_can( 'manage_network_options' ) ) {
6977 - update_site_option( 'googleauthenticator_mandatory_mfa_roles', $roles );
6978 - }
6979 - } else {
6980 - if ( current_user_can( 'manage_options' ) ) {
6981 - update_option( 'googleauthenticator_mandatory_mfa_roles', $roles );
6982 - }
6983 - }
6984 - return true;
6985 - }
6986 -}
6987 -
6988 -/**
6989 - * Callback function to render the google authenticator setup page
6990 - */
6991 -function common_admin_setup_page( $is_network = false ) {
6992 - if ( $is_network ) {
6993 - $site_ids = get_sites( 'fields=ids' );
6994 - $roles = get_editable_roles();
6995 - foreach( $site_ids as $site_id ) {
6996 - switch_to_blog( $site_id );
6997 - $roles = array_merge( $roles, get_editable_roles() );
6998 - restore_current_blog();
6999 - }
7000 - $edit_enabled = true;
7001 - } else {
7002 - $roles = get_editable_roles();
7003 - $edit_enabled = is_multisite() ? boolval( get_site_option( 'googleauthenticator_network_only') ) : true;
7004 - }
7005 - $is_updated = $this->save_submitted_admin_setup_page( $is_network );
7006 - ?>
7007 - <div class="wrap">
7008 - <h1><?php esc_html_e( 'Google Authenticator Settings', 'google-authenticator' ); ?></h1>
7009 - <?php if ( $is_updated ): ?>
7010 - <?php if ( $is_network ): ?>
7011 - <div class="notice notice-success is-dismissible"><p><?php esc_html_e( 'Successfullly saved your settings for the network', 'google-authenticator' ); ?></p></div>
7012 - <?php else: ?>
7013 - <div class="notice notice-success is-dismissible"><p><?php esc_html_e( 'Successfullly saved your settings for the site', 'google-authenticator' ); ?></p></div>
7014 - <?php endif; ?>
7015 - <?php endif; ?>
7016 - <form method="post">
7017 - <?php if ( $is_network ): ?>
7018 - <h2><?php esc_html_e( 'Network Settings', 'google-authenticator' ); ?></h2>
7019 - <p>
7020 - <label>
7021 - <input name="network_settings_only" type="checkbox" value="true" <?php checked( get_site_option( 'googleauthenticator_network_only' ) ); ?>>
7022 - <?php esc_html_e( 'Only use network-wide settings, ignoring site settings.', 'google-authenticator' ); ?>
7023 - </label>
7024 - </p>
7025 - <?php endif; ?>
7026 - <?php if ( is_multisite() && $is_network || ! is_multisite() ): ?>
7027 - <?php $two_screen_mfa = is_multisite() ? get_site_option( 'googleauthenticator_two_screen_signin' ) : get_option( 'googleauthenticator_two_screen_signin' ); ?>
7028 - <h2><?php esc_html_e( 'Two Screen Signin', 'google-authenticator' ); ?></h2>
7029 - <p>
7030 - <label>
7031 - <input name="two_screen_approach" type="checkbox" value="true" <?php checked( $two_screen_mfa ); ?>>
7032 - <?php esc_html_e( 'Ask for authenticator code on secondary login screen', 'google-authenticator' ); ?>
7033 - </label>
7034 - </p>
7035 - <?php endif; ?>
7036 - <h2><?php esc_html_e( 'Roles requiring Google Authenticator Enabled', 'google-authenticator' ); ?></h2>
7037 - <?php foreach ($roles as $role_key => $role) {
7038 - $this->show_role_checkbox( $role_key, $role, $is_network );
7039 - }
7040 - if ( $edit_enabled ) {
7041 - wp_nonce_field( 'googleauthenticator', 'googleauthenticator' );
7042 - submit_button();
7043 - } else {
7044 - esc_html_e( 'Network-wide settings in effect, only a super admin can modify them.', 'google-authenticator' );
7045 - if ( current_user_can( 'manage_network' ) ) :?>
7046 - <a href="<?php echo network_admin_url( 'settings.php?page=google_authenticator' ) ?>"><?php esc_html_e( 'Change network wide Google Authenticator settings', 'google-authenticator' ); ?></a>
7047 - <?php endif;
7048 - }
7049 - ?>
7050 -
7051 - </form>
7052 - </div>
7053 - <?php
7054 -}
7055 -
7056 -/**
7057 - * Render a checkbox for a role
7058 - * @param $role_key
7059 - * @param $role
7060 - * @param $is_network
7061 - */
7062 -function show_role_checkbox( $role_key, $role, $is_network ) {
7063 - $network_roles = get_site_option( 'googleauthenticator_mandatory_mfa_roles', array() );
7064 - $network_only = is_multisite() && boolval( get_site_option( 'googleauthenticator_network_only' ) );
7065 - $roles = get_option( 'googleauthenticator_mandatory_mfa_roles', array() );
7066 - if ( $network_only ) {
7067 - $checked = in_array( $role_key, $network_roles );
7068 - } else {
7069 - $checked = in_array( $role_key, array_merge( $roles, $network_roles ) );
7070 - }
7071 -
7072 - /**
7073 - * Criteria under which permission field can be readonly.
7074 - * 1. Site must be a multisite AND
7075 - * Either
7076 - * a. googleauthenticator_network_only network option is set via /wp-admin/network/settings.php?page=google_authenticator
7077 - *
7078 - * OR
7079 - * b. the network option for this role is set via /wp-admin/network/settings.php?page=google_authenticator
7080 - */
7081 - $readonly = is_multisite() && ( ( ! $is_network && $network_only ) || ( ! $is_network && in_array( $role_key, $network_roles ) && ! in_array( $role_key, $roles ) ) );
7082 - $readonly_label = '';
7083 -
7084 - if ( $readonly ) {
7085 - if ( current_user_can( 'manage_network' ) ) {
7086 - $readonly_label = __( "Sorry, you can't disable checks for this role as it's enabled at the network level.", 'google-authenticator' );
7087 - } else {
7088 - $readonly_label = sprintf( __( 'Sorry, this role is enabled at the network level and can only be disabled via the <a href="%s">network settings</a>', 'google-authenticator' ), network_admin_url( 'settings.php?page=google_authenticator' ) );
7089 - }
7090 - }
7091 -
7092 - $readonly = $readonly ? ' readonly="readonly"' : '';
7093 - ?>
7094 - <p><label><input name="roles[]" type="checkbox"<?php echo esc_html( $readonly ) . checked( $checked, true, false ); ?>value="<?php esc_attr_e( $role_key ); ?>"><strong><?php esc_html_e( $role[ 'name' ] ); ?></strong></label> <?php echo $readonly_label; ?></p>
7095 - <?php
7096 -}
7097 -
7098 -/**
7099 - * Admin setup screen
7100 - */
7101 -function admin_setup_page() {
7102 - $this->common_admin_setup_page();
7103 -
7104 -}
7105 -
7106 -/**
7107 - * Network admin setup screen
7108 - */
7109 -function network_admin_setup_page() {
7110 - $this->common_admin_setup_page( true );
7111 -}
7112 -/**
7113 - * Add verification code field to login form.
7114 - */
7115 -function loginform() {
7116 - echo "\t<p>\n";
7117 - echo "\t\t<label title=\"".__('If you don\'t have Google Authenticator enabled for your WordPress account, leave this field empty.','google-authenticator')."\">".__('Google Authenticator code','google-authenticator')."<span id=\"google-auth-info\"></span><br />\n";
7118 - echo "\t\t<input type=\"text\" name=\"googleotp\" id=\"googleotp\" class=\"input\" value=\"\" size=\"20\" style=\"ime-mode: inactive;\" autocomplete=\"off\" /></label>\n";
7119 - echo "\t</p>\n";
7120 -}
7121 -
7122 -/**
7123 - * Disable autocomplete on Google Authenticator code input field.
7124 - */
7125 -function loginfooter() {
7126 - echo "\n<script type=\"text/javascript\">\n";
7127 - echo "\ttry{\n";
7128 - echo "\t\tdocument.getElementById('user_email').setAttribute('autocomplete','off');\n";
7129 - echo "\t} catch(e){}\n";
7130 - echo "</script>\n";
7131 -}
7132 -
7133 -/**
7134 - * Login form handling.
7135 - * Check Google Authenticator verification code, if user has been setup to do so.
7136 - * @param wordpressuser / WP_Error
7137 - * @return user/loginstatus
7138 - */
7139 -function check_otp( $user, $username = '', $password = '' ) {
7140 - // Store result of loginprocess, so far.
7141 - $userstate = $user;
7142 -
7143 - // Get information on user, we need this in case an app password has been enabled,
7144 - // since the $user var only contain an error at this point in the login flow.
7145 - if ( get_user_by( 'email', $username ) === false ) {
7146 - $user = get_user_by( 'login', $username );
7147 - } else {
7148 - $user = get_user_by( 'email', $username );
7149 - }
7150 -
7151 - // Does the user have the Google Authenticator enabled ?
7152 - if ( isset( $user->ID ) && trim(get_user_option( 'googleauthenticator_enabled', $user->ID ) ) == 'enabled' ) {
7153 -
7154 - // Get the users secret
7155 - $GA_secret = trim( get_user_option( 'googleauthenticator_secret', $user->ID ) );
7156 -
7157 - // Figure out if user is using relaxed mode ?
7158 - $GA_relaxedmode = trim( get_user_option( 'googleauthenticator_relaxedmode', $user->ID ) );
7159 -
7160 - // Get the verification code entered by the user trying to login
7161 - if ( !empty( $_POST['googleotp'] )) { // Prevent PHP notices when using app password login
7162 - $otp = trim( $_POST[ 'googleotp' ] );
7163 - } else {
7164 - $otp = '';
7165 - }
7166 - // When was the last successful login performed ?
7167 - $lasttimeslot = trim( get_user_option( 'googleauthenticator_lasttimeslot', $user->ID ) );
7168 - // Valid code ?
7169 - if ( $timeslot = $this->verify( $GA_secret, $otp, $GA_relaxedmode, $lasttimeslot ) ) {
7170 - // Store the timeslot in which login was successful.
7171 - update_user_option( $user->ID, 'googleauthenticator_lasttimeslot', $timeslot, true );
7172 - return $userstate;
7173 - } else {
7174 - // No, lets see if an app password is enabled, and this is an XMLRPC / APP login ?
7175 - if ( trim( get_user_option( 'googleauthenticator_pwdenabled', $user->ID ) ) == 'enabled' && ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') ) ) {
7176 - $GA_passwords = json_decode( get_user_option( 'googleauthenticator_passwords', $user->ID ) );
7177 - $passwordhash = trim($GA_passwords->{'password'} );
7178 - $usersha1 = sha1( strtoupper( str_replace( ' ', '', $password ) ) );
7179 - if ( $passwordhash == $usersha1 ) { // ToDo: Remove after some time when users have migrated to new format
7180 - return new WP_User( $user->ID );
7181 - // Try the new version based on thee wp_hash_password function
7182 - } elseif (wp_check_password( strtoupper( str_replace( ' ', '', $password ) ), $passwordhash)) {
7183 - return new WP_User( $user->ID );
7184 - } else {
7185 - // Wrong XMLRPC/APP password !
7186 - return new WP_Error( 'invalid_google_authenticator_password', __( '<strong>ERROR</strong>: The Google Authenticator password is incorrect.', 'google-authenticator' ) );
7187 - }
7188 - } else {
7189 - if ( ! $this->is_two_screen_signin_enabled() ) {
7190 - return new WP_Error( 'invalid_google_authenticator_token', __( '<strong>ERROR</strong>: The Google Authenticator code is incorrect or has expired.', 'google-authenticator' ) );
7191 - } else {
7192 - wp_logout();
7193 - $this->secondary_login_screen();
7194 - exit;
7195 - }
7196 - }
7197 - }
7198 - }
7199 - // Google Authenticator isn't enabled for this account,
7200 - // just resume normal authentication.
7201 - return $userstate;
7202 -}
7203 -
7204 -function secondary_login_screen() {
7205 - $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : admin_url();
7206 - login_header( esc_html__('Secondary Login Screen', 'google-authenticator' ) );
7207 - if ( array_key_exists( 'googleotp', $_REQUEST ) ) {
7208 - if ( 0 === strlen( $_REQUEST[ 'googleotp'] ) ) {
7209 - $error_message = __( '<strong>ERROR</strong>: The Google Authenticator code is missing.', 'google-authenticator' );
7210 - } else {
7211 - $error_message = __( '<strong>ERROR</strong>: The Google Authenticator code is incorrect or has expired.', 'google-authenticator' );
7212 - }
7213 - echo '<div id="login_error">' . $error_message . '</div>';
7214 - }?>
7215 - <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
7216 - <input type="hidden" name="log" value="<?php echo esc_attr( $_REQUEST['log'] ); ?>" />
7217 - <input type="hidden" name="pwd" value="<?php echo esc_attr( $_REQUEST['pwd'] ); ?>" />
7218 - <input type="hidden" name="wp-submit" value="<?php echo esc_attr( $_REQUEST['wp-submit'] ); ?>" />
7219 - <?php if ( array_key_exists( 'rememberme', $_REQUEST ) && 'forever' === $_REQUEST[ 'rememberme']): ?>
7220 - <input name="rememberme" type="hidden" id="rememberme" value="forever" />
7221 - <?php endif; ?>
7222 - <?php $this->loginform(); ?>
7223 - <p><?php esc_html_e( 'Please enter the Google Authenticator code using the app on your device.', 'google-authenticator' ); ?></p>
7224 - <p class="submit">
7225 - <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Log In'); ?>" />
7226 - <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
7227 - <input type="hidden" name="testcookie" value="1" />
7228 - </p>
7229 - </form>
7230 - <?php
7231 - login_footer();
7232 -}
7233 -
7234 -
7235 -/**
7236 - * Extend personal profile page with Google Authenticator settings.
7237 - */
7238 -function profile_personal_options( $args = array() ) {
7239 - $defaults = array(
7240 - 'show_active' => true,
7241 - 'show_relaxed_mode' => true,
7242 - 'show_description' => true,
7243 - 'show_secret_qr' => false,
7244 - 'show_secret_buttons' => true,
7245 - 'show_authenticator_code' => false,
7246 - 'show_app_password' => true,
7247 - );
7248 -
7249 - $args = wp_parse_args( $args, $defaults );
7250 -
7251 - $user = wp_get_current_user();
7252 - $user_id = $user->ID;
7253 -
7254 - // If editing of Google Authenticator settings has been disabled, just return
7255 - $GA_hidefromuser = trim( get_user_option( 'googleauthenticator_hidefromuser', $user_id ) );
7256 - if ( $GA_hidefromuser == 'enabled') return;
7257 -
7258 - $GA_secret = trim( get_user_option( 'googleauthenticator_secret', $user_id ) );
7259 - $GA_enabled = trim( get_user_option( 'googleauthenticator_enabled', $user_id ) );
7260 - $GA_relaxedmode = trim( get_user_option( 'googleauthenticator_relaxedmode', $user_id ) );
7261 - $GA_description = trim( get_user_option( 'googleauthenticator_description', $user_id ) );
7262 - $GA_pwdenabled = trim( get_user_option( 'googleauthenticator_pwdenabled', $user_id ) );
7263 - $GA_password = trim( get_user_option( 'googleauthenticator_passwords', $user_id ) );
7264 -
7265 - // We dont store the generated app password in cleartext so there is no point in trying
7266 - // to show the user anything except from the fact that a password exists.
7267 - if ( $GA_password != '' ) {
7268 - $GA_password = "XXXX XXXX XXXX XXXX";
7269 - }
7270 -
7271 - // In case the user has no secret ready (new install), we create one. or use the one they just posted
7272 - if ( '' == $GA_secret ) {
7273 - $GA_secret = array_key_exists( 'GA_secret', $_REQUEST ) ? sanitize_text_field( $_REQUEST[ 'GA_secret' ] ) : $this->create_secret();
7274 - }
7275 -
7276 - if ( '' == $GA_description ) {
7277 - // Super admins and users with accounts on more than one site get the network name as the helpful name,
7278 - // everyone else gets the site that they're on
7279 - if ( is_multisite() && ( 1 < count( get_blogs_of_user( $user_id ) || is_super_admin() ) ) ) {
7280 - $GA_description = sanitize_text_field( get_blog_details( get_network()->id )->blogname );
7281 - } else {
7282 - $GA_description = sanitize_text_field( get_bloginfo( 'name' ) );
7283 - }
7284 - }
7285 -
7286 - echo "<h3>".__( 'Google Authenticator Settings', 'google-authenticator' )."</h3>\n";
7287 -
7288 - echo "<table class=\"form-table\">\n";
7289 - echo "<tbody>\n";
7290 -
7291 - if ( $args['show_active'] ) {
7292 - echo "<tr>\n";
7293 - echo "<th scope=\"row\">".__( 'Active', 'google-authenticator' )."</th>\n";
7294 - echo "<td>\n";
7295 - echo "<input name=\"GA_enabled\" id=\"GA_enabled\" class=\"tog\" type=\"checkbox\"" . checked( $GA_enabled, 'enabled', false ) . "/>\n";
7296 - echo "</td>\n";
7297 - echo "</tr>\n";
7298 - }
7299 -
7300 - if ( $args['show_relaxed_mode'] ) {
7301 - echo "<tr>\n";
7302 - echo "<th scope=\"row\">" . __( 'Relaxed mode', 'google-authenticator' ) . "</th>\n";
7303 - echo "<td>\n";
7304 - echo "<input name=\"GA_relaxedmode\" id=\"GA_relaxedmode\" class=\"tog\" type=\"checkbox\"" . checked( $GA_relaxedmode, 'enabled', false ) . "/><span class=\"description\">" . __( ' Relaxed mode allows for more time drifting on your phone clock (&#177;4 min).', 'google-authenticator' ) . "</span>\n";
7305 - echo "</td>\n";
7306 - echo "</tr>\n";
7307 - }
7308 -
7309 - $show_description_style = $args['show_description'] ? '' : 'display:none';
7310 - echo "<tr style=\"{$show_description_style}\">\n";
7311 - echo "<th><label for=\"GA_description\">" . esc_html__( 'Description', 'google-authenticator' ) . "</label></th>\n";
7312 - echo "<td><input name=\"GA_description\" id=\"GA_description\" value=\"{$GA_description}\" type=\"text\" size=\"25\" /><span class=\"description\">" . __( ' Description that you\'ll see in the Google Authenticator app on your phone.', 'google-authenticator' ) . "</span><br /></td>\n";
7313 - echo "</tr>\n";
7314 -
7315 - echo "<tr>\n";
7316 - echo "<th><label for=\"GA_secret\">".__('Secret','google-authenticator')."</label></th>\n";
7317 - echo "<td>\n";
7318 - echo "<input name=\"GA_secret\" id=\"GA_secret\" value=\"" . esc_attr( $GA_secret) . "\" readonly=\"readonly\" type=\"text\" size=\"25\" />";
7319 - if ( $args['show_secret_buttons']) {
7320 - echo "<input name=\"GA_newsecret\" id=\"GA_newsecret\" value=\"".__("Create new secret",'google-authenticator')."\" type=\"button\" class=\"button\" />";
7321 - echo "<input name=\"show_qr\" id=\"show_qr\" value=\"".__("Show/Hide QR code",'google-authenticator')."\" type=\"button\" class=\"button\" onclick=\"ShowOrHideQRCode();\" />";
7322 - }
7323 - echo "</td>\n";
7324 - echo "</tr>\n";
7325 -
7326 - echo "<tr>\n";
7327 - echo "<th></th>\n";
7328 -
7329 - $qr_style = $args['show_secret_qr'] ? '' : 'display: none';
7330 - echo "<td><div id=\"GA_QR_INFO\" style=\"{$qr_style}\" >";
7331 - echo "<div id=\"GA_QRCODE\"/></div>";
7332 -
7333 - echo '<span class="description"><br/> ' . __( 'Scan this with the Google Authenticator app.', 'google-authenticator' ) . '</span>';
7334 - echo "</div></td>\n";
7335 - echo "</tr>\n";
7336 - if ( $args['show_secret_qr']) : ?>
7337 - <script>
7338 - var qrcode="otpauth://totp/WordPress:"+escape(jQuery('#GA_description').val())+"?secret="+jQuery('#GA_secret').val()+"&issuer=WordPress";
7339 - jQuery('#GA_QRCODE').qrcode(qrcode);
7340 - </script>
7341 - <?php endif;
7342 -
7343 - if ( $args['show_app_password']) {
7344 - echo "<tr>\n";
7345 - echo "<th scope=\"row\">".__( 'Enable App password', 'google-authenticator' )."</th>\n";
7346 - echo "<td>\n";
7347 - echo "<input name=\"GA_pwdenabled\" id=\"GA_pwdenabled\" class=\"tog\" type=\"checkbox\"" . checked( $GA_pwdenabled, 'enabled', false ) . "/><span class=\"description\">".__(' Enabling an App password will decrease your overall login security.','google-authenticator')."</span>\n";
7348 - echo "</td>\n";
7349 - echo "</tr>\n";
7350 -
7351 - echo "<tr>\n";
7352 - echo "<th></th>\n";
7353 - echo "<td>\n";
7354 - echo "<input name=\"GA_password\" id=\"GA_password\" readonly=\"readonly\" value=\"".$GA_password."\" type=\"text\" size=\"25\" />";
7355 - echo "<input name=\"GA_createpassword\" id=\"GA_createpassword\" value=\"".__("Create new password",'google-authenticator')."\" type=\"button\" class=\"button\" />";
7356 - echo "<span class=\"description\" id=\"GA_passworddesc\"> ".__(' Password is not stored in cleartext, this is your only chance to see it.','google-authenticator')."</span>\n";
7357 - echo "</td>\n";
7358 - echo "</tr>\n";
7359 - }
7360 -
7361 -
7362 - if ( $args['show_authenticator_code']) {
7363 - echo "<tr>\n";
7364 - echo "<th><label for=\"GA_otp_code\">" . __( 'Authenticator Code', 'google-authenticator' ) . "</label></th>\n";
7365 - echo "<td><input name=\"GA_otp_code\" id=\"GA_otp_code\" type=\"text\" size=\"25\" /><span class=\"description\">" . __( 'After adding the site to your google authy account, add your authenticator code here.', 'google-authenticator' ) . "</span><br /></td>\n";
7366 - echo "</tr>\n";
7367 - }
7368 -
7369 - echo "</tbody></table>\n";
7370 - if ( $args['show_authenticator_code']) {
7371 - submit_button( esc_html__( 'Verify Authenticator Code', 'google-authenticator' ) );
7372 - }
7373 - echo "<script type=\"text/javascript\">\n";
7374 - echo "var GAnonce='".wp_create_nonce('GoogleAuthenticatoraction')."';\n";
7375 -
7376 - echo <<<ENDOFJS
7377 - //Create new secret and display it
7378 - jQuery('#GA_newsecret').bind('click', function() {
7379 - // Remove existing QRCode
7380 - jQuery('#GA_QRCODE').html("");
7381 - var data=new Object();
7382 - data['action'] = 'GoogleAuthenticator_action';
7383 - data['nonce'] = GAnonce;
7384 - jQuery.post(ajaxurl, data, function(response) {
7385 - jQuery('#GA_secret').val(response['new-secret']);
7386 - var qrcode="otpauth://totp/WordPress:"+escape(jQuery('#GA_description').val())+"?secret="+jQuery('#GA_secret').val()+"&issuer=WordPress";
7387 - jQuery('#GA_QRCODE').qrcode(qrcode);
7388 - jQuery('#GA_QR_INFO').show('slow');
7389 - });
7390 - });
7391 -
7392 - // If the user starts modifying the description, hide the qrcode
7393 - jQuery('#GA_description').bind('focus blur change keyup', function() {
7394 - // Only remove QR Code if it's visible
7395 - if (jQuery('#GA_QR_INFO').is(':visible')) {
7396 - jQuery('#GA_QR_INFO').hide('slow');
7397 - jQuery('#GA_QRCODE').html("");
7398 - }
7399 - });
7400 -
7401 - // Create new app password
7402 - jQuery('#GA_createpassword').bind('click',function() {
7403 - var data=new Object();
7404 - data['action'] = 'GoogleAuthenticator_action';
7405 - data['nonce'] = GAnonce;
7406 - data['save'] = 1;
7407 - jQuery.post(ajaxurl, data, function(response) {
7408 - jQuery('#GA_password').val(response['new-secret'].match(new RegExp(".{0,4}","g")).join(' '));
7409 - jQuery('#GA_passworddesc').show();
7410 - });
7411 - });
7412 -
7413 - jQuery('#GA_enabled').bind('change',function() {
7414 - GoogleAuthenticator_apppasswordcontrol();
7415 - });
7416 -
7417 - jQuery(document).ready(function() {
7418 - jQuery('#GA_passworddesc').hide();
7419 - GoogleAuthenticator_apppasswordcontrol();
7420 - });
7421 -
7422 - function GoogleAuthenticator_apppasswordcontrol() {
7423 - if (jQuery('#GA_enabled').is(':checked')) {
7424 - jQuery('#GA_pwdenabled').removeAttr('disabled');
7425 - jQuery('#GA_createpassword').removeAttr('disabled');
7426 - } else {
7427 - jQuery('#GA_pwdenabled').removeAttr('checked')
7428 - jQuery('#GA_pwdenabled').attr('disabled', true);
7429 - jQuery('#GA_createpassword').attr('disabled', true);
7430 - }
7431 - }
7432 -
7433 - function ShowOrHideQRCode() {
7434 - if (jQuery('#GA_QR_INFO').is(':hidden')) {
7435 - var qrcode="otpauth://totp/WordPress:"+escape(jQuery('#GA_description').val())+"?secret="+jQuery('#GA_secret').val()+"&issuer=WordPress";
7436 - jQuery('#GA_QRCODE').qrcode(qrcode);
7437 - jQuery('#GA_QR_INFO').show('slow');
7438 - } else {
7439 - jQuery('#GA_QR_INFO').hide('slow');
7440 - jQuery('#GA_QRCODE').html("");
7441 - }
7442 - }
7443 -</script>
7444 -ENDOFJS;
7445 -}
7446 -
7447 -/**
7448 - * Form handling of Google Authenticator options added to personal profile page (user editing his own profile)
7449 - */
7450 -function personal_options_update() {
7451 - global $user_id;
7452 -
7453 - // If editing of Google Authenticator settings has been disabled, just return
7454 - $GA_hidefromuser = trim( get_user_option( 'googleauthenticator_hidefromuser', $user_id ) );
7455 - if ( $GA_hidefromuser == 'enabled') return;
7456 -
7457 -
7458 - $GA_enabled = ! empty( $_POST['GA_enabled'] );
7459 - $GA_description = trim( sanitize_text_field($_POST['GA_description'] ) );
7460 - $GA_relaxedmode = ! empty( $_POST['GA_relaxedmode'] );
7461 - $GA_secret = trim( $_POST['GA_secret'] );
7462 - $GA_pwdenabled = ! empty( $_POST['GA_pwdenabled'] );
7463 - $GA_password = str_replace(' ', '', trim( $_POST['GA_password'] ) );
7464 -
7465 - if ( ! $GA_enabled ) {
7466 - $GA_enabled = 'disabled';
7467 - } else {
7468 - $GA_enabled = 'enabled';
7469 - }
7470 -
7471 - if ( ! $GA_relaxedmode ) {
7472 - $GA_relaxedmode = 'disabled';
7473 - } else {
7474 - $GA_relaxedmode = 'enabled';
7475 - }
7476 -
7477 -
7478 - if ( ! $GA_pwdenabled ) {
7479 - $GA_pwdenabled = 'disabled';
7480 - } else {
7481 - $GA_pwdenabled = 'enabled';
7482 - }
7483 -
7484 - // Only store password if a new one has been generated.
7485 - if (strtoupper($GA_password) != 'XXXXXXXXXXXXXXXX' ) {
7486 - // Store the password in a format that can be expanded easily later on if needed.
7487 - $GA_password = array( 'appname' => 'Default', 'password' => wp_hash_password( $GA_password ) );
7488 - update_user_option( $user_id, 'googleauthenticator_passwords', json_encode( $GA_password ), true );
7489 - }
7490 -
7491 - update_user_option( $user_id, 'googleauthenticator_enabled', $GA_enabled, true );
7492 - update_user_option( $user_id, 'googleauthenticator_description', $GA_description, true );
7493 - update_user_option( $user_id, 'googleauthenticator_relaxedmode', $GA_relaxedmode, true );
7494 - update_user_option( $user_id, 'googleauthenticator_secret', $GA_secret, true );
7495 - update_user_option( $user_id, 'googleauthenticator_pwdenabled', $GA_pwdenabled, true );
7496 -
7497 -}
7498 -
7499 -/**
7500 - * Extend profile page with ability to enable/disable Google Authenticator authentication requirement.
7501 - * Used by an administrator when editing other users.
7502 - */
7503 -function edit_user_profile() {
7504 - global $user_id;
7505 - $GA_enabled = trim( get_user_option( 'googleauthenticator_enabled', $user_id ) );
7506 - $GA_hidefromuser = trim( get_user_option( 'googleauthenticator_hidefromuser', $user_id ) );
7507 - echo "<h3>".__('Google Authenticator Settings','google-authenticator')."</h3>\n";
7508 - echo "<table class=\"form-table\">\n";
7509 - echo "<tbody>\n";
7510 -
7511 - echo "<tr>\n";
7512 - echo "<th scope=\"row\">".__('Hide settings from user','google-authenticator')."</th>\n";
7513 - echo "<td>\n";
7514 - echo "<div><input name=\"GA_hidefromuser\" id=\"GA_hidefromuser\" class=\"tog\" type=\"checkbox\"" . checked( $GA_hidefromuser, 'enabled', false ) . "/>\n";
7515 - echo "</td>\n";
7516 - echo "</tr>\n";
7517 -
7518 - echo "<tr>\n";
7519 - echo "<th scope=\"row\">".__('Active','google-authenticator')."</th>\n";
7520 - echo "<td>\n";
7521 - echo "<div><input name=\"GA_enabled\" id=\"GA_enabled\" class=\"tog\" type=\"checkbox\"" . checked( $GA_enabled, 'enabled', false ) . "/>\n";
7522 - echo "</td>\n";
7523 - echo "</tr>\n";
7524 -
7525 - echo "</tbody>\n";
7526 - echo "</table>\n";
7527 -}
7528 -
7529 -/**
7530 - * Form handling of Google Authenticator options on edit profile page (admin user editing other user)
7531 - */
7532 -function edit_user_profile_update() {
7533 - global $user_id;
7534 -
7535 - $GA_enabled = ! empty( $_POST['GA_enabled'] );
7536 - $GA_hidefromuser = ! empty( $_POST['GA_hidefromuser'] );
7537 -
7538 - if ( ! $GA_enabled ) {
7539 - $GA_enabled = 'disabled';
7540 - } else {
7541 - $GA_enabled = 'enabled';
7542 - }
7543 -
7544 - if ( ! $GA_hidefromuser ) {
7545 - $GA_hidefromuser = 'disabled';
7546 - } else {
7547 - $GA_hidefromuser = 'enabled';
7548 - }
7549 -
7550 - update_user_option( $user_id, 'googleauthenticator_enabled', $GA_enabled, true );
7551 - update_user_option( $user_id, 'googleauthenticator_hidefromuser', $GA_hidefromuser, true );
7552 -
7553 -}
7554 -
7555 -
7556 -/**
7557 -* AJAX callback function used to generate new secret
7558 -*/
7559 -function ajax_callback() {
7560 - global $user_id;
7561 -
7562 - // Some AJAX security.
7563 - check_ajax_referer( 'GoogleAuthenticatoraction', 'nonce' );
7564 -
7565 - // Create new secret.
7566 - $secret = $this->create_secret();
7567 -
7568 - $result = array( 'new-secret' => $secret );
7569 - header( 'Content-Type: application/json' );
7570 - echo json_encode( $result );
7571 -
7572 - // die() is required to return a proper result
7573 - die();
7574 -}
7575 -
7576 -} // end class
7577 -
7578 -$google_authenticator = new GoogleAuthenticator;
7579 -
7580
7581 diff --git a/plugins/google-authenticator/jquery.qrcode.min.js b/plugins/google-authenticator/jquery.qrcode.min.js
7582 deleted file mode 100644
7583 index fe9680e6..00000000
7584 --- a/plugins/google-authenticator/jquery.qrcode.min.js
7585 +++ /dev/null
7586 @@ -1,28 +0,0 @@
7587 -(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
7588 -write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
7589 -for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
7590 -7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
7591 -0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
7592 -setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
7593 -j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
7594 -b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
7595 -c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
7596 -0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
7597 -(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
7598 -78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
7599 -j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
7600 -a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
7601 -a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
7602 -2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
7603 -LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
7604 -this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
7605 -[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
7606 -116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
7607 -43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
7608 -3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
7609 -55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
7610 -45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
7611 -(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
7612 -correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
7613 -j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
7614 -d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
7615
7616 diff --git a/plugins/google-authenticator/lang/google-authenticator-da_DK.mo b/plugins/google-authenticator/lang/google-authenticator-da_DK.mo
7617 deleted file mode 100644
7618 index d4b4b1fd..00000000
7619 Binary files a/plugins/google-authenticator/lang/google-authenticator-da_DK.mo and /dev/null differ
7620
7621 diff --git a/plugins/google-authenticator/lang/google-authenticator-da_DK.po b/plugins/google-authenticator/lang/google-authenticator-da_DK.po
7622 deleted file mode 100644
7623 index 28fe9911..00000000
7624 --- a/plugins/google-authenticator/lang/google-authenticator-da_DK.po
7625 +++ /dev/null
7626 @@ -1,113 +0,0 @@
7627 -msgid ""
7628 -msgstr ""
7629 -"Project-Id-Version: Google Authenticator\n"
7630 -"POT-Creation-Date: 2014-01-11 08:17+0100\n"
7631 -"PO-Revision-Date: 2014-01-11 08:20+0100\n"
7632 -"Last-Translator: Henrik Schack <henrik@××××××.dk>\n"
7633 -"Language-Team: \n"
7634 -"Language: da\n"
7635 -"MIME-Version: 1.0\n"
7636 -"Content-Type: text/plain; charset=UTF-8\n"
7637 -"Content-Transfer-Encoding: 8bit\n"
7638 -"X-Generator: Poedit 1.6.3\n"
7639 -"X-Poedit-Basepath: ..\n"
7640 -"X-Poedit-SourceCharset: UTF-8\n"
7641 -"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
7642 -"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
7643 -"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
7644 -"Plural-Forms: nplurals=2; plural=(n != 1);\n"
7645 -"X-Poedit-SearchPath-0: .\n"
7646 -
7647 -#: google-authenticator.php:166
7648 -msgid ""
7649 -"If you don't have Google Authenticator enabled for your WordPress account, "
7650 -"leave this field empty."
7651 -msgstr ""
7652 -"Hvis ikke du har aktiveret Google Authenticator for din konto, så lad være "
7653 -"med at skrive noget her."
7654 -
7655 -#: google-authenticator.php:166
7656 -msgid "Google Authenticator code"
7657 -msgstr "Google Authenticator kode"
7658 -
7659 -#: google-authenticator.php:231
7660 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
7661 -msgstr "<strong>ERROR</strong>: Google Authenticator kodeordet er forkert."
7662 -
7663 -#: google-authenticator.php:234
7664 -msgid ""
7665 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
7666 -"expired."
7667 -msgstr ""
7668 -"<strong>ERROR</strong>: Google Authenticator koden er forkert eller udløbet."
7669 -
7670 -#: google-authenticator.php:274
7671 -msgid "WordPressBlog"
7672 -msgstr "WordPressBlog"
7673 -
7674 -#: google-authenticator.php:277 google-authenticator.php:469
7675 -msgid "Google Authenticator Settings"
7676 -msgstr "Google Authenticator indstillinger"
7677 -
7678 -#: google-authenticator.php:282 google-authenticator.php:481
7679 -msgid "Active"
7680 -msgstr "Aktiv"
7681 -
7682 -#: google-authenticator.php:290
7683 -msgid "Relaxed mode"
7684 -msgstr "Afslappet tilstand"
7685 -
7686 -#: google-authenticator.php:292
7687 -msgid ""
7688 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
7689 -"min)."
7690 -msgstr ""
7691 -"Afslappet tilstand tillader mere upræcis tid på din telefon (&#177;4 min)."
7692 -
7693 -#: google-authenticator.php:297
7694 -msgid "Description"
7695 -msgstr "Beskrivelse"
7696 -
7697 -#: google-authenticator.php:298
7698 -msgid ""
7699 -" Description that you'll see in the Google Authenticator app on your phone."
7700 -msgstr "Beskrivelsen du vil se i Google Authenticator app'en på din telefon."
7701 -
7702 -#: google-authenticator.php:302
7703 -msgid "Secret"
7704 -msgstr "Hemmelig kode"
7705 -
7706 -#: google-authenticator.php:305
7707 -msgid "Create new secret"
7708 -msgstr "Opret ny hemmelig kode"
7709 -
7710 -#: google-authenticator.php:306
7711 -msgid "Show/Hide QR code"
7712 -msgstr "Vis/Gem QR kode"
7713 -
7714 -#: google-authenticator.php:315
7715 -msgid "Scan this with the Google Authenticator app."
7716 -msgstr "Scan dette med Google Authenticator app'en."
7717 -
7718 -#: google-authenticator.php:320
7719 -msgid "Enable App password"
7720 -msgstr "Aktiver app kodeord"
7721 -
7722 -#: google-authenticator.php:322
7723 -msgid " Enabling an App password will decrease your overall login security."
7724 -msgstr ""
7725 -"Aktiverer du app kodeords featuren, påvirker det din sikkerhed generelt."
7726 -
7727 -#: google-authenticator.php:330
7728 -msgid "Create new password"
7729 -msgstr "Opret nyt kodeord"
7730 -
7731 -#: google-authenticator.php:331
7732 -msgid ""
7733 -" Password is not stored in cleartext, this is your only chance to see it."
7734 -msgstr ""
7735 -"Kodeordet gemmes ikke i klartekst, dette er din eneste chance for at se det."
7736 -
7737 -#: google-authenticator.php:474
7738 -msgid "Hide settings from user"
7739 -msgstr "Skjul indstillinger for bruger"
7740
7741 diff --git a/plugins/google-authenticator/lang/google-authenticator-de_DE.mo b/plugins/google-authenticator/lang/google-authenticator-de_DE.mo
7742 deleted file mode 100644
7743 index 3ac64c79..00000000
7744 Binary files a/plugins/google-authenticator/lang/google-authenticator-de_DE.mo and /dev/null differ
7745
7746 diff --git a/plugins/google-authenticator/lang/google-authenticator-de_DE.po b/plugins/google-authenticator/lang/google-authenticator-de_DE.po
7747 deleted file mode 100644
7748 index 66afca41..00000000
7749 --- a/plugins/google-authenticator/lang/google-authenticator-de_DE.po
7750 +++ /dev/null
7751 @@ -1,119 +0,0 @@
7752 -msgid ""
7753 -msgstr ""
7754 -"Project-Id-Version: Google Authenticator 0.30\n"
7755 -"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-authenticator\n"
7756 -"POT-Creation-Date: 2011-05-17 19:38:36+00:00\n"
7757 -"PO-Revision-Date: 2011-06-25 16:20+0100\n"
7758 -"Last-Translator: Tobias Bäthge <wordpress@××××××××××××××.com>\n"
7759 -"Language-Team: \n"
7760 -"MIME-Version: 1.0\n"
7761 -"Content-Type: text/plain; charset=UTF-8\n"
7762 -"Content-Transfer-Encoding: 8bit\n"
7763 -"Plural-Forms: nplurals=2; plural=n != 1;\n"
7764 -"X-Poedit-Language: \n"
7765 -"X-Poedit-Country: \n"
7766 -"X-Poedit-SourceCharset: utf-8\n"
7767 -"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
7768 -"X-Poedit-Basepath: \n"
7769 -"X-Poedit-Bookmarks: \n"
7770 -"X-Poedit-SearchPath-0: .\n"
7771 -"X-Textdomain-Support: yes"
7772 -
7773 -#: google-authenticator.php:118
7774 -#@ google-authenticator
7775 -msgid "Google Authenticator code"
7776 -msgstr "&quot;Google Authenticator&quot;-Code"
7777 -
7778 -#: google-authenticator.php:172
7779 -#: google-authenticator.php:267
7780 -#@ google-authenticator
7781 -msgid "Active"
7782 -msgstr "Aktivieren"
7783 -
7784 -#: google-authenticator.php:184
7785 -#@ google-authenticator
7786 -msgid "Description"
7787 -msgstr "Beschreibung"
7788 -
7789 -#: google-authenticator.php:189
7790 -#@ google-authenticator
7791 -msgid "Secret"
7792 -msgstr "Geheimschlüssel"
7793 -
7794 -#: google-authenticator.php:192
7795 -#@ google-authenticator
7796 -msgid "Create new secret"
7797 -msgstr "Neuen Geheimschlüssel erzeugen"
7798 -
7799 -#: google-authenticator.php:193
7800 -#@ google-authenticator
7801 -msgid "Show/Hide QR code"
7802 -msgstr "QR-Code anzeigen/verstecken"
7803 -
7804 -#. translators: plugin header field 'Name'
7805 -#: google-authenticator.php:0
7806 -#@ google-authenticator
7807 -msgid "Google Authenticator"
7808 -msgstr "Google Authenticator"
7809 -
7810 -#. translators: plugin header field 'PluginURI'
7811 -#: google-authenticator.php:0
7812 -#@ google-authenticator
7813 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
7814 -msgstr "http://henrik.schack.dk/google-authenticator-for-wordpress"
7815 -
7816 -#. translators: plugin header field 'Author'
7817 -#: google-authenticator.php:0
7818 -#@ google-authenticator
7819 -msgid "Henrik Schack"
7820 -msgstr "Henrik Schack"
7821 -
7822 -#. translators: plugin header field 'AuthorURI'
7823 -#: google-authenticator.php:0
7824 -#@ google-authenticator
7825 -msgid "http://henrik.schack.dk/"
7826 -msgstr "http://henrik.schack.dk/"
7827 -
7828 -#. translators: plugin header field 'Version'
7829 -#: google-authenticator.php:0
7830 -#@ google-authenticator
7831 -msgid "0.30"
7832 -msgstr "0.30"
7833 -
7834 -#: google-authenticator.php:143
7835 -#@ google-authenticator
7836 -msgid "<strong>ERROR</strong>: The Google Authenticator code is incorrect or has expired."
7837 -msgstr "<strong>FEHLER</strong>: Der eingegebene &quot;Google Authenticator&quot;-Code ist falsch oder abgelaufen."
7838 -
7839 -#: google-authenticator.php:165
7840 -#@ google-authenticator
7841 -msgid "WordPress Blog"
7842 -msgstr "WordPress-Blog"
7843 -
7844 -#: google-authenticator.php:167
7845 -#: google-authenticator.php:263
7846 -#@ google-authenticator
7847 -msgid "Google Authenticator Settings"
7848 -msgstr "Einstellungen zu Google Authenticator"
7849 -
7850 -#: google-authenticator.php:201
7851 -#@ google-authenticator
7852 -msgid "Scan this with the Google Authenticator app."
7853 -msgstr "Scanne diesen QR-Code mit der &quot;Google Authenticator&quot;-App deines Smartphones."
7854 -
7855 -#: google-authenticator.php:118
7856 -#@ google-authenticator
7857 -msgid "If you don't have Google Authenticator enabled for your WordPress account, leave this field empty."
7858 -msgstr "Falls die Nutzung von &quot;Google Authenticator&quot; für dieses WordPress-Konto nicht aktiviert ist, dieses Feld leer lassen."
7859 -
7860 -#: google-authenticator.php:185
7861 -#@ google-authenticator
7862 -msgid " Description that you'll see in the Google Authenticator app on your phone."
7863 -msgstr "Beschreibung, die in der &quot;Google Authenticator&quot;-App auf dem Smartphone angezeigt wird."
7864 -
7865 -#. translators: plugin header field 'Description'
7866 -#: google-authenticator.php:0
7867 -#@ google-authenticator
7868 -msgid "Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry app as One Time Password generator."
7869 -msgstr "Zwei-Faktor-Authentifizierung für WordPress mit der &quot;Google Authenticator&quot;-App für Android/iPhone/Blackberry"
7870 -
7871
7872 diff --git a/plugins/google-authenticator/lang/google-authenticator-es_ES.mo b/plugins/google-authenticator/lang/google-authenticator-es_ES.mo
7873 deleted file mode 100644
7874 index 5bf1304b..00000000
7875 Binary files a/plugins/google-authenticator/lang/google-authenticator-es_ES.mo and /dev/null differ
7876
7877 diff --git a/plugins/google-authenticator/lang/google-authenticator-es_ES.po b/plugins/google-authenticator/lang/google-authenticator-es_ES.po
7878 deleted file mode 100644
7879 index ce9ab6aa..00000000
7880 --- a/plugins/google-authenticator/lang/google-authenticator-es_ES.po
7881 +++ /dev/null
7882 @@ -1,131 +0,0 @@
7883 -# Copyright (C) 2010 Google Authenticator
7884 -# This file is distributed under the same license as the Google Authenticator package.
7885 -msgid ""
7886 -msgstr ""
7887 -"Project-Id-Version: Google Authenticator 0.37\n"
7888 -"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-authenticator\n"
7889 -"POT-Creation-Date: 2011-08-21 14:25:45+00:00\n"
7890 -"MIME-Version: 1.0\n"
7891 -"Content-Type: text/plain; charset=UTF-8\n"
7892 -"Content-Transfer-Encoding: 8bit\n"
7893 -"PO-Revision-Date: 2014-01-11 10:07+0100\n"
7894 -"Last-Translator: \n"
7895 -"Language-Team: LANGUAGE <LL@××.org>\n"
7896 -"X-Generator: Poedit 1.6.3\n"
7897 -"Plural-Forms: nplurals=2; plural=(n != 1);\n"
7898 -"Language: es_ES\n"
7899 -
7900 -#: google-authenticator.php:131
7901 -msgid ""
7902 -"If you don't have Google Authenticator enabled for your WordPress account, "
7903 -"leave this field empty."
7904 -msgstr ""
7905 -"Si no tiene Google Authenticator habilitado en su cuenta de WordPress, deje "
7906 -"este campo vacío."
7907 -
7908 -#: google-authenticator.php:131
7909 -msgid "Google Authenticator code"
7910 -msgstr "Código Google Authenticator"
7911 -
7912 -#: google-authenticator.php:176
7913 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
7914 -msgstr "<strong>ERROR</strong>: El codigo es incorrecto."
7915 -
7916 -#: google-authenticator.php:179
7917 -msgid ""
7918 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
7919 -"expired."
7920 -msgstr "<strong>ERROR</strong>: El código es incorrecto o caducado."
7921 -
7922 -#: google-authenticator.php:215
7923 -msgid "WordPress Blog"
7924 -msgstr "Blog de WordPress"
7925 -
7926 -#: google-authenticator.php:218 google-authenticator.php:392
7927 -msgid "Google Authenticator Settings"
7928 -msgstr "Opciones Google Authenticator"
7929 -
7930 -#: google-authenticator.php:223 google-authenticator.php:396
7931 -msgid "Active"
7932 -msgstr "Activar"
7933 -
7934 -#: google-authenticator.php:235
7935 -msgid "Relaxed mode"
7936 -msgstr "Modo relajado"
7937 -
7938 -#: google-authenticator.php:237
7939 -msgid ""
7940 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
7941 -"min)."
7942 -msgstr ""
7943 -"El modo relajado permite tener más tiempo de reloj en su teléfono (&#177;4 "
7944 -"min)."
7945 -
7946 -#: google-authenticator.php:242
7947 -msgid "Description"
7948 -msgstr "Descripción"
7949 -
7950 -#: google-authenticator.php:243
7951 -msgid ""
7952 -" Description that you'll see in the Google Authenticator app on your phone."
7953 -msgstr ""
7954 -"Descripción que se verá en la aplicación Google Authenticator en su teléfono."
7955 -
7956 -#: google-authenticator.php:247
7957 -msgid "Secret"
7958 -msgstr "Secreto"
7959 -
7960 -#: google-authenticator.php:250
7961 -msgid "Create new secret"
7962 -msgstr "Crear nueva clave secreta"
7963 -
7964 -#: google-authenticator.php:251
7965 -msgid "Show/Hide QR code"
7966 -msgstr "Mostar/Esconder QR Code"
7967 -
7968 -#: google-authenticator.php:259
7969 -msgid "Scan this with the Google Authenticator app."
7970 -msgstr "Escanear esto con la aplicación Google Authenticator."
7971 -
7972 -#: google-authenticator.php:264
7973 -msgid "Enable App password"
7974 -msgstr "Permitir contraseña de aplicación"
7975 -
7976 -#: google-authenticator.php:266
7977 -msgid " Enabling an App password will decrease your overall login security."
7978 -msgstr "Permitir una contraseña de aplicación disminuirá su seguridad global."
7979 -
7980 -#: google-authenticator.php:274
7981 -msgid "Create new password"
7982 -msgstr "Crear nueva contraseña"
7983 -
7984 -#: google-authenticator.php:275
7985 -msgid ""
7986 -" Password is not stored in cleartext, this is your only chance to see it."
7987 -msgstr ""
7988 -"La contraseña no está almacenada en formato de texto, es su única "
7989 -"oportunidad de verla."
7990 -
7991 -#. Plugin Name of the plugin/theme
7992 -msgid "Google Authenticator"
7993 -msgstr ""
7994 -
7995 -#. Plugin URI of the plugin/theme
7996 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
7997 -msgstr ""
7998 -
7999 -#. Description of the plugin/theme
8000 -msgid ""
8001 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
8002 -"app as One Time Password generator."
8003 -msgstr ""
8004 -"La autentificación en dos pasos por wordpress utiliza una app Android/iPhone/"
8005 -"Blackberry como 'One Time Password generator.'"
8006 -
8007 -#. Author of the plugin/theme
8008 -msgid "Henrik Schack"
8009 -msgstr ""
8010 -
8011 -#. Author URI of the plugin/theme
8012 -msgid "http://henrik.schack.dk/"
8013 -msgstr ""
8014
8015 diff --git a/plugins/google-authenticator/lang/google-authenticator-fr_FR.mo b/plugins/google-authenticator/lang/google-authenticator-fr_FR.mo
8016 deleted file mode 100644
8017 index 000ac747..00000000
8018 Binary files a/plugins/google-authenticator/lang/google-authenticator-fr_FR.mo and /dev/null differ
8019
8020 diff --git a/plugins/google-authenticator/lang/google-authenticator-fr_FR.po b/plugins/google-authenticator/lang/google-authenticator-fr_FR.po
8021 deleted file mode 100644
8022 index 9dcbd951..00000000
8023 --- a/plugins/google-authenticator/lang/google-authenticator-fr_FR.po
8024 +++ /dev/null
8025 @@ -1,133 +0,0 @@
8026 -# Copyright (C) 2010 Google Authenticator
8027 -# This file is distributed under the same license as the Google Authenticator package.
8028 -msgid ""
8029 -msgstr ""
8030 -"Project-Id-Version: Google Authenticator 0.37\n"
8031 -"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-authenticator\n"
8032 -"POT-Creation-Date: 2011-08-21 14:25:45+00:00\n"
8033 -"MIME-Version: 1.0\n"
8034 -"Content-Type: text/plain; charset=UTF-8\n"
8035 -"Content-Transfer-Encoding: 8bit\n"
8036 -"PO-Revision-Date: 2014-01-11 10:15+0100\n"
8037 -"Last-Translator: \n"
8038 -"Language-Team: LANGUAGE <LL@××.org>\n"
8039 -"X-Generator: Poedit 1.6.3\n"
8040 -"Plural-Forms: nplurals=2; plural=(n > 1);\n"
8041 -"Language: fr_FR\n"
8042 -
8043 -#: google-authenticator.php:131
8044 -msgid ""
8045 -"If you don't have Google Authenticator enabled for your WordPress account, "
8046 -"leave this field empty."
8047 -msgstr ""
8048 -"Si vous n'avez pas activé Google ASuthenticator pour votre compte wordpress, "
8049 -"laissez ce champ vide."
8050 -
8051 -#: google-authenticator.php:131
8052 -msgid "Google Authenticator code"
8053 -msgstr "Code Google Authenticator"
8054 -
8055 -#: google-authenticator.php:176
8056 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
8057 -msgstr "<strong>ERREUR</strong>: Le code Google Authenticator est incorrect."
8058 -
8059 -#: google-authenticator.php:179
8060 -msgid ""
8061 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
8062 -"expired."
8063 -msgstr ""
8064 -"<strong>ERREUR</strong>: Le code Google Authenticator est incorrect ou "
8065 -"périmé."
8066 -
8067 -#: google-authenticator.php:215
8068 -msgid "WordPress Blog"
8069 -msgstr "Blog WordPress"
8070 -
8071 -#: google-authenticator.php:218 google-authenticator.php:392
8072 -msgid "Google Authenticator Settings"
8073 -msgstr "Réglages Google Authenticator"
8074 -
8075 -#: google-authenticator.php:223 google-authenticator.php:396
8076 -msgid "Active"
8077 -msgstr "Activer"
8078 -
8079 -#: google-authenticator.php:235
8080 -msgid "Relaxed mode"
8081 -msgstr "Mode relax"
8082 -
8083 -#: google-authenticator.php:237
8084 -msgid ""
8085 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
8086 -"min)."
8087 -msgstr ""
8088 -"Le mode relax vous permet d'avoir plus de temps de latence sur le chrono de "
8089 -"votre téléphone (&#177;4 min)."
8090 -
8091 -#: google-authenticator.php:242
8092 -msgid "Description"
8093 -msgstr "Description"
8094 -
8095 -#: google-authenticator.php:243
8096 -msgid ""
8097 -" Description that you'll see in the Google Authenticator app on your phone."
8098 -msgstr ""
8099 -"Voici la description que vous verrez dans l'app Gogogle Authentiator de "
8100 -"votre téléphone."
8101 -
8102 -#: google-authenticator.php:247
8103 -msgid "Secret"
8104 -msgstr "Code secret"
8105 -
8106 -#: google-authenticator.php:250
8107 -msgid "Create new secret"
8108 -msgstr "Créer nouveau code secret"
8109 -
8110 -#: google-authenticator.php:251
8111 -msgid "Show/Hide QR code"
8112 -msgstr "Montrer/Cacher le QR Code"
8113 -
8114 -#: google-authenticator.php:259
8115 -msgid "Scan this with the Google Authenticator app."
8116 -msgstr "Scanner ceci avec votre app Google Authenticator"
8117 -
8118 -#: google-authenticator.php:264
8119 -msgid "Enable App password"
8120 -msgstr "Autoriser mot de passe de l'app"
8121 -
8122 -#: google-authenticator.php:266
8123 -msgid " Enabling an App password will decrease your overall login security."
8124 -msgstr ""
8125 -"Autoriser un mot de passe d'app réduira votre sécurité globale de connexion."
8126 -
8127 -#: google-authenticator.php:274
8128 -msgid "Create new password"
8129 -msgstr "Créer nouveau mot de passe"
8130 -
8131 -#: google-authenticator.php:275
8132 -msgid ""
8133 -" Password is not stored in cleartext, this is your only chance to see it."
8134 -msgstr ""
8135 -"Le mot de passe n'est pas stocké en texte clair, c'est votre seule "
8136 -"opportunité de le voir."
8137 -
8138 -#. Plugin Name of the plugin/theme
8139 -msgid "Google Authenticator"
8140 -msgstr "Google Authenticator"
8141 -
8142 -#. Plugin URI of the plugin/theme
8143 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
8144 -msgstr ""
8145 -
8146 -#. Description of the plugin/theme
8147 -msgid ""
8148 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
8149 -"app as One Time Password generator."
8150 -msgstr ""
8151 -
8152 -#. Author of the plugin/theme
8153 -msgid "Henrik Schack"
8154 -msgstr ""
8155 -
8156 -#. Author URI of the plugin/theme
8157 -msgid "http://henrik.schack.dk/"
8158 -msgstr ""
8159
8160 diff --git a/plugins/google-authenticator/lang/google-authenticator-it_IT.mo b/plugins/google-authenticator/lang/google-authenticator-it_IT.mo
8161 deleted file mode 100644
8162 index dae99aef..00000000
8163 Binary files a/plugins/google-authenticator/lang/google-authenticator-it_IT.mo and /dev/null differ
8164
8165 diff --git a/plugins/google-authenticator/lang/google-authenticator-it_IT.po b/plugins/google-authenticator/lang/google-authenticator-it_IT.po
8166 deleted file mode 100644
8167 index 361d5810..00000000
8168 --- a/plugins/google-authenticator/lang/google-authenticator-it_IT.po
8169 +++ /dev/null
8170 @@ -1,143 +0,0 @@
8171 -# Copyright (C) 2010 Google Authenticator
8172 -# This file is distributed under the same license as the Google Authenticator package.
8173 -# Aldo Latino <aldolat@×××××.com>, 2012, 2014.
8174 -msgid ""
8175 -msgstr ""
8176 -"Project-Id-Version: Google Authenticator 0.37\n"
8177 -"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-authenticator\n"
8178 -"POT-Creation-Date: 2014-01-11 07:14:22+00:00\n"
8179 -"PO-Revision-Date: 2014-01-12 21:24+0100\n"
8180 -"Last-Translator: Aldo Latino <aldolat@×××××.com>\n"
8181 -"Language-Team: Italian <kde-i18n-it@×××.org>\n"
8182 -"Language: it\n"
8183 -"MIME-Version: 1.0\n"
8184 -"Content-Type: text/plain; charset=UTF-8\n"
8185 -"Content-Transfer-Encoding: 8bit\n"
8186 -"Plural-Forms: nplurals=2; plural=(n != 1);\n"
8187 -"X-Generator: Lokalize 1.5\n"
8188 -
8189 -#: google-authenticator.php:166
8190 -msgid ""
8191 -"If you don't have Google Authenticator enabled for your WordPress account, "
8192 -"leave this field empty."
8193 -msgstr ""
8194 -"Se Google Authenticator non è attivo per il tuo account WordPress, lascia "
8195 -"vuoto questo campo."
8196 -
8197 -#: google-authenticator.php:166
8198 -msgid "Google Authenticator code"
8199 -msgstr "Codice di Google Authenticator"
8200 -
8201 -#: google-authenticator.php:231
8202 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
8203 -msgstr ""
8204 -"<strong>ERRORE</strong>: la password di Google Authenticator non è corretta.."
8205 -
8206 -#: google-authenticator.php:234
8207 -msgid ""
8208 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
8209 -"expired."
8210 -msgstr ""
8211 -"<strong>ERRORE</strong>: Il codice di Google Authenticator non è corretto o "
8212 -"è scaduto."
8213 -
8214 -#: google-authenticator.php:274
8215 -msgid "WordPressBlog"
8216 -msgstr "WordPress Blog"
8217 -
8218 -#: google-authenticator.php:277 google-authenticator.php:469
8219 -msgid "Google Authenticator Settings"
8220 -msgstr "Impostazioni di Google Authenticator"
8221 -
8222 -#: google-authenticator.php:282 google-authenticator.php:481
8223 -msgid "Active"
8224 -msgstr "Attivo"
8225 -
8226 -#: google-authenticator.php:290
8227 -msgid "Relaxed mode"
8228 -msgstr "Modalità comoda"
8229 -
8230 -#: google-authenticator.php:292
8231 -msgid ""
8232 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
8233 -"min)."
8234 -msgstr ""
8235 -" La modalità comoda permette uno scostamento di tempo più esteso rispetto "
8236 -"all'orologio del telefono (&#177;4 min)."
8237 -
8238 -#: google-authenticator.php:297
8239 -msgid "Description"
8240 -msgstr "Descrizione"
8241 -
8242 -#: google-authenticator.php:298
8243 -msgid ""
8244 -" Description that you'll see in the Google Authenticator app on your phone."
8245 -msgstr ""
8246 -" La descrizione che si vede nell'app Google Authenticator sul telefono."
8247 -
8248 -#: google-authenticator.php:302
8249 -msgid "Secret"
8250 -msgstr "Chiave segreta"
8251 -
8252 -#: google-authenticator.php:305
8253 -msgid "Create new secret"
8254 -msgstr "Crea una nuova chiave segreta"
8255 -
8256 -#: google-authenticator.php:306
8257 -msgid "Show/Hide QR code"
8258 -msgstr "Mostra/nascondi il codice QR"
8259 -
8260 -#: google-authenticator.php:315
8261 -msgid "Scan this with the Google Authenticator app."
8262 -msgstr "Effettua la scansione con l'app Google Authenticator."
8263 -
8264 -#: google-authenticator.php:320
8265 -msgid "Enable App password"
8266 -msgstr "Abilita la password delle App"
8267 -
8268 -#: google-authenticator.php:322
8269 -msgid " Enabling an App password will decrease your overall login security."
8270 -msgstr ""
8271 -" L'abilitazione della password delle App abbasserà il livello di sicurezza "
8272 -"generale del login."
8273 -
8274 -#: google-authenticator.php:330
8275 -msgid "Create new password"
8276 -msgstr "Crea una nuova password"
8277 -
8278 -#: google-authenticator.php:331
8279 -msgid ""
8280 -" Password is not stored in cleartext, this is your only chance to see it."
8281 -msgstr ""
8282 -" La password non è conservata in chiaro: questo l'unico momento in cui la si "
8283 -"può vedere."
8284 -
8285 -#: google-authenticator.php:474
8286 -msgid "Hide settings from user"
8287 -msgstr "Nascondi le impostazioni agli utenti"
8288 -
8289 -#. Plugin Name of the plugin/theme
8290 -msgid "Google Authenticator"
8291 -msgstr "Google Authenticator"
8292 -
8293 -#. Plugin URI of the plugin/theme
8294 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
8295 -msgstr "http://henrik.schack.dk/google-authenticator-for-wordpress"
8296 -
8297 -#. Description of the plugin/theme
8298 -msgid ""
8299 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
8300 -"app as One Time Password generator."
8301 -msgstr ""
8302 -"Autenticazione a due fattori per WordPress utilizzando un'app su Android/"
8303 -"iPhone/Blackberry come generatore di Password usa-e-getta."
8304 -
8305 -#. Author of the plugin/theme
8306 -msgid "Henrik Schack"
8307 -msgstr "Henrik Schack"
8308 -
8309 -#. Author URI of the plugin/theme
8310 -msgid "http://henrik.schack.dk/"
8311 -msgstr "http://henrik.schack.dk/"
8312 -
8313 -
8314
8315 diff --git a/plugins/google-authenticator/lang/google-authenticator-nl_NL.mo b/plugins/google-authenticator/lang/google-authenticator-nl_NL.mo
8316 deleted file mode 100644
8317 index 0fbdcb13..00000000
8318 Binary files a/plugins/google-authenticator/lang/google-authenticator-nl_NL.mo and /dev/null differ
8319
8320 diff --git a/plugins/google-authenticator/lang/google-authenticator-nl_NL.po b/plugins/google-authenticator/lang/google-authenticator-nl_NL.po
8321 deleted file mode 100644
8322 index 2e0fc09b..00000000
8323 --- a/plugins/google-authenticator/lang/google-authenticator-nl_NL.po
8324 +++ /dev/null
8325 @@ -1,317 +0,0 @@
8326 -msgid ""
8327 -msgstr ""
8328 -"Project-Id-Version: Google Authenticator\n"
8329 -"POT-Creation-Date: 2019-04-12 17:20+0200\n"
8330 -"PO-Revision-Date: 2019-04-12 17:38+0200\n"
8331 -"Last-Translator: \n"
8332 -"Language-Team: \n"
8333 -"Language: nl_NL\n"
8334 -"MIME-Version: 1.0\n"
8335 -"Content-Type: text/plain; charset=UTF-8\n"
8336 -"Content-Transfer-Encoding: 8bit\n"
8337 -"X-Generator: Poedit 2.2.1\n"
8338 -"X-Poedit-Basepath: ..\n"
8339 -"Plural-Forms: nplurals=2; plural=(n != 1);\n"
8340 -"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
8341 -"X-Poedit-WPHeader: google-authenticator.php\n"
8342 -"X-Poedit-SourceCharset: UTF-8\n"
8343 -"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
8344 -"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
8345 -"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
8346 -"X-Poedit-SearchPath-0: .\n"
8347 -"X-Poedit-SearchPathExcluded-0: *.js\n"
8348 -
8349 -#. Plugin Name of the plugin/theme
8350 -#: google-authenticator.php:196 google-authenticator.php:199
8351 -#: google-authenticator.php:202
8352 -msgid "Google Authenticator"
8353 -msgstr ""
8354 -
8355 -#: google-authenticator.php:280
8356 -msgid ""
8357 -"OTP code doesn't match supplied secret, please check you've configured "
8358 -"Authenticator correctly."
8359 -msgstr ""
8360 -"OTP-code komt niet overeen met de opgegeven geheime code, controleer of je "
8361 -"de Authenticator goed hebt ingesteld."
8362 -
8363 -#: google-authenticator.php:289
8364 -msgid ""
8365 -"Congratulations, you have successfully enabled Google Authenticator for your "
8366 -"account"
8367 -msgstr ""
8368 -"Gefeliciteerd, je hebt Google Authenticator met succes ingeschakeld voor je "
8369 -"account"
8370 -
8371 -#: google-authenticator.php:310
8372 -msgid "iOS: Authy"
8373 -msgstr ""
8374 -
8375 -#: google-authenticator.php:314
8376 -msgid "iOS: Google Authenticator"
8377 -msgstr ""
8378 -
8379 -#: google-authenticator.php:318
8380 -msgid "Android: Authy"
8381 -msgstr ""
8382 -
8383 -#: google-authenticator.php:322
8384 -msgid "Android: Google Authenticator"
8385 -msgstr ""
8386 -
8387 -#: google-authenticator.php:326
8388 -msgid "Windows Phone"
8389 -msgstr ""
8390 -
8391 -#: google-authenticator.php:330
8392 -msgid "Chrome Browser"
8393 -msgstr ""
8394 -
8395 -#: google-authenticator.php:334
8396 -msgid "Desktop"
8397 -msgstr ""
8398 -
8399 -#: google-authenticator.php:342 google-authenticator.php:433
8400 -#: google-authenticator.php:715 google-authenticator.php:936
8401 -msgid "Google Authenticator Settings"
8402 -msgstr "Google Authenticator instellingen"
8403 -
8404 -#: google-authenticator.php:346
8405 -msgid ""
8406 -"If you haven't already done so, please install the Authy or Google "
8407 -"Authenticator app on your mobile device from the App Store:"
8408 -msgstr ""
8409 -"Mocht je dit nog niet gedaan hebben, installeer dan de Authy of Google "
8410 -"Authenticator app vanuit de App Store op je mobiele apparaat:"
8411 -
8412 -#: google-authenticator.php:352
8413 -msgid ""
8414 -"The easiest way to enable your account is to add an account by scanning the "
8415 -"QR code using the app."
8416 -msgstr ""
8417 -"De makkelijkste manier om je account in te schakelen is een account toe te "
8418 -"voegen door het scannen van de QR-code met de app."
8419 -
8420 -#: google-authenticator.php:354
8421 -msgid ""
8422 -"An account can also be added by typing in the secret. After you've added "
8423 -"your account to the App, please type the code you see on the screen into the "
8424 -"Authenticator Code field and press the Verify Authenticator Code button."
8425 -msgstr ""
8426 -"Een account kan ook worden toegevoegd door de geheim code in te typen. Nadat "
8427 -"je je account hebt toegevoegd in de app, type je de code die je op het "
8428 -"scherm ziet in het veld Authenticatiecode en druk je op de knop Verifieer "
8429 -"authenticatiecode."
8430 -
8431 -#: google-authenticator.php:357
8432 -msgid ""
8433 -"If the account setup was successful, you will be logged out, and will need "
8434 -"to login again using your Username, Password and Authenticator code "
8435 -"generated using the App on your mobile device."
8436 -msgstr ""
8437 -"Als het instellen van het account is gelukt, wordt je uitgelogd en moet je "
8438 -"opnieuw inloggen met je gebruikersnaam, wachtwoord en authenticatiecode die "
8439 -"in de app op je mobiele apparaat wordt gegenereerd."
8440 -
8441 -#: google-authenticator.php:436
8442 -msgid "Successfullly saved your settings for the network"
8443 -msgstr "Instellingen succesvol opgeslagen voor het netwerk"
8444 -
8445 -#: google-authenticator.php:438
8446 -msgid "Successfullly saved your settings for the site"
8447 -msgstr "Instellingen succesvol opgeslagen voor de site"
8448 -
8449 -#: google-authenticator.php:443
8450 -msgid "Network Settings"
8451 -msgstr "Netwerk instellingen"
8452 -
8453 -#: google-authenticator.php:447
8454 -msgid "Only use network-wide settings, ignoring site settings."
8455 -msgstr ""
8456 -"Gebruik alleen instellingen voor het hele netwerk en negeer de instellingen "
8457 -"van de site."
8458 -
8459 -#: google-authenticator.php:453
8460 -msgid "Two Screen Signin"
8461 -msgstr "Aanmelden op twee schermen"
8462 -
8463 -#: google-authenticator.php:457
8464 -msgid "Ask for authenticator code on secondary login screen"
8465 -msgstr "Vraag naar de authenticatiecode op een secundair inlogscherm"
8466 -
8467 -#: google-authenticator.php:461
8468 -msgid "Roles requiring Google Authenticator Enabled"
8469 -msgstr "Rollen waarbij gebruik Google Authenticator is vereist"
8470 -
8471 -#: google-authenticator.php:469
8472 -msgid "Network-wide settings in effect, only a super admin can modify them."
8473 -msgstr ""
8474 -"Netwerk brede instellingen zijn van kracht, alleen een super-beheerder kan "
8475 -"deze wijzigen."
8476 -
8477 -#: google-authenticator.php:471
8478 -msgid "Change network wide Google Authenticator settings"
8479 -msgstr "Verander netwerk brede Google Authenticator instellingen"
8480 -
8481 -#: google-authenticator.php:511
8482 -msgid ""
8483 -"Sorry, you can't disable checks for this role as it's enabled at the network "
8484 -"level."
8485 -msgstr ""
8486 -"Sorry, je kunt de controles voor deze rol niet uitschakelen omdat deze op "
8487 -"het netwerkniveau is ingeschakeld."
8488 -
8489 -#: google-authenticator.php:513
8490 -#, php-format
8491 -msgid ""
8492 -"Sorry, this role is enabled at the network level and can only be disabled "
8493 -"via the <a href=\"%s\">network settings</a>"
8494 -msgstr ""
8495 -"Sorry, deze rol is ingeschakeld op netwerkniveau en kan alleen worden "
8496 -"uitgeschakeld via de <a href=“%s”>netwerkinstellingen</a>"
8497 -
8498 -#: google-authenticator.php:542
8499 -msgid ""
8500 -"If you don't have Google Authenticator enabled for your WordPress account, "
8501 -"leave this field empty."
8502 -msgstr ""
8503 -"Als Google Authenticator niet is ingeschakeld voor je WordPress-account, "
8504 -"laat dit veld dan leeg."
8505 -
8506 -#: google-authenticator.php:542
8507 -msgid "Google Authenticator code"
8508 -msgstr "Google Authenticator-code"
8509 -
8510 -#: google-authenticator.php:615
8511 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
8512 -msgstr "<strong>ERROR</strong>: De Google Authenticator-wachtwoord is onjuist."
8513 -
8514 -#: google-authenticator.php:619 google-authenticator.php:640
8515 -msgid ""
8516 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
8517 -"expired."
8518 -msgstr ""
8519 -"<strong>ERROR</strong>: De Google Authenticator-code is onjuist of verlopen."
8520 -
8521 -#: google-authenticator.php:635
8522 -msgid "Secondary Login Screen"
8523 -msgstr "Secundair inlogscherm"
8524 -
8525 -#: google-authenticator.php:638
8526 -msgid "<strong>ERROR</strong>: The Google Authenticator code is missing."
8527 -msgstr "<strong>ERROR</strong>: De Google Authenticator-code ontbreekt."
8528 -
8529 -#: google-authenticator.php:652
8530 -msgid ""
8531 -"Please enter the Google Authenticator code using the app on your device."
8532 -msgstr ""
8533 -"Voer de Google Authenticator-code in met behulp van de app op je mobiele "
8534 -"apparaat."
8535 -
8536 -#: google-authenticator.php:654
8537 -msgid "Log In"
8538 -msgstr "Inloggen"
8539 -
8540 -#: google-authenticator.php:722 google-authenticator.php:948
8541 -msgid "Active"
8542 -msgstr "Actief"
8543 -
8544 -#: google-authenticator.php:731
8545 -msgid "Relaxed mode"
8546 -msgstr "Ontspannen modus"
8547 -
8548 -#: google-authenticator.php:733
8549 -msgid ""
8550 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
8551 -"min)."
8552 -msgstr ""
8553 -" Ontspannen modus geeft meer ruimte voor een afwijkende klok op je mobiele "
8554 -"apparaat (&#177;4 min)."
8555 -
8556 -#: google-authenticator.php:740
8557 -msgid "Description"
8558 -msgstr "Omschrijving"
8559 -
8560 -#: google-authenticator.php:741
8561 -msgid ""
8562 -" Description that you'll see in the Google Authenticator app on your phone."
8563 -msgstr ""
8564 -" Omschrijving die je ziet in de Google Authenticator app op je mobiele "
8565 -"apparaat."
8566 -
8567 -#: google-authenticator.php:745
8568 -msgid "Secret"
8569 -msgstr "Geheime code"
8570 -
8571 -#: google-authenticator.php:749
8572 -msgid "Create new secret"
8573 -msgstr "Nieuw geheime code maken"
8574 -
8575 -#: google-authenticator.php:750
8576 -msgid "Show/Hide QR code"
8577 -msgstr "Toon/verberg QR-code"
8578 -
8579 -#: google-authenticator.php:762
8580 -msgid "Scan this with the Google Authenticator app."
8581 -msgstr "Scan dit met de Google Authenticator-app."
8582 -
8583 -#: google-authenticator.php:774
8584 -msgid "Enable App password"
8585 -msgstr "Schakel in App-wachtwoord"
8586 -
8587 -#: google-authenticator.php:776
8588 -msgid " Enabling an App password will decrease your overall login security."
8589 -msgstr ""
8590 -" Als je een App-wachtwoord inschakelt, wordt je totale inlog beveiliging "
8591 -"minder."
8592 -
8593 -#: google-authenticator.php:784
8594 -msgid "Create new password"
8595 -msgstr "Nieuw wachtwoord maken"
8596 -
8597 -#: google-authenticator.php:785
8598 -msgid ""
8599 -" Password is not stored in cleartext, this is your only chance to see it."
8600 -msgstr ""
8601 -" Wachtwoord wordt niet als platte tekst opgeslagen, dit is je enige kans om "
8602 -"het te zien."
8603 -
8604 -#: google-authenticator.php:793
8605 -msgid "Authenticator Code"
8606 -msgstr "Authenticatiecode"
8607 -
8608 -#: google-authenticator.php:794
8609 -msgid ""
8610 -"After adding the site to your google authy account, add your authenticator "
8611 -"code here."
8612 -msgstr ""
8613 -"Na het toevoegen van de site aan je Google Authy-account, voeg je hier je "
8614 -"authenticatiecode toe."
8615 -
8616 -#: google-authenticator.php:800
8617 -msgid "Verify Authenticator Code"
8618 -msgstr "Verifieer authenticatiecode"
8619 -
8620 -#: google-authenticator.php:941
8621 -msgid "Hide settings from user"
8622 -msgstr "Verberg gebruikers instellingen"
8623 -
8624 -#. Plugin URI of the plugin/theme
8625 -msgid "https://github.com/ivankruchkoff/google-authenticator"
8626 -msgstr ""
8627 -
8628 -#. Description of the plugin/theme
8629 -msgid ""
8630 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
8631 -"app as One Time Password generator."
8632 -msgstr ""
8633 -"Twee-staps-authenticatie voor WordPress met behulp van de Android/iPhone/"
8634 -"Blackberry app als eenmalig wachtwoord generator."
8635 -
8636 -#. Author of the plugin/theme
8637 -msgid "Ivan Kruchkoff"
8638 -msgstr ""
8639 -
8640 -#. Author URI of the plugin/theme
8641 -msgid "https://github.com/ivankruchkoff"
8642 -msgstr ""
8643
8644 diff --git a/plugins/google-authenticator/lang/google-authenticator-pt_BR.mo b/plugins/google-authenticator/lang/google-authenticator-pt_BR.mo
8645 deleted file mode 100644
8646 index e318239e..00000000
8647 Binary files a/plugins/google-authenticator/lang/google-authenticator-pt_BR.mo and /dev/null differ
8648
8649 diff --git a/plugins/google-authenticator/lang/google-authenticator-pt_BR.po b/plugins/google-authenticator/lang/google-authenticator-pt_BR.po
8650 deleted file mode 100644
8651 index 54c213fa..00000000
8652 --- a/plugins/google-authenticator/lang/google-authenticator-pt_BR.po
8653 +++ /dev/null
8654 @@ -1,123 +0,0 @@
8655 -# Copyright (C) 2010 Google Authenticator
8656 -# This file is distributed under the same license as the Google Authenticator package.
8657 -msgid ""
8658 -msgstr ""
8659 -"Project-Id-Version: Google Authenticator 0.37\n"
8660 -"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-authenticator\n"
8661 -"POT-Creation-Date: 2011-08-21 14:25:45+00:00\n"
8662 -"MIME-Version: 1.0\n"
8663 -"Content-Type: text/plain; charset=UTF-8\n"
8664 -"Content-Transfer-Encoding: 8bit\n"
8665 -"PO-Revision-Date: 2014-01-11 10:07+0100\n"
8666 -"Last-Translator: \n"
8667 -"Language-Team: LANGUAGE <LL@××.org>\n"
8668 -"X-Generator: Poedit 1.6.3\n"
8669 -"Plural-Forms: nplurals=2; plural=(n != 1);\n"
8670 -"Language: pt_BR\n"
8671 -
8672 -#: google-authenticator.php:131
8673 -msgid ""
8674 -"If you don't have Google Authenticator enabled for your WordPress account, "
8675 -"leave this field empty."
8676 -msgstr "Se você não tiver o Google Authenticator ativado para sua conta do WordPress, deixe este campo vazio."
8677 -
8678 -#: google-authenticator.php:131
8679 -msgid "Google Authenticator code"
8680 -msgstr "Código do Google Authenticator"
8681 -
8682 -#: google-authenticator.php:176
8683 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
8684 -msgstr "<strong>ERRO</strong>: a senha do Google Authenticator está incorreta."
8685 -
8686 -#: google-authenticator.php:179
8687 -msgid ""
8688 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
8689 -"expired."
8690 -msgstr "<strong>ERRO</strong>: o código do Google Authenticator está incorreto ou expirou."
8691 -
8692 -#: google-authenticator.php:215
8693 -msgid "WordPress Blog"
8694 -msgstr "Blog WordPress"
8695 -
8696 -#: google-authenticator.php:218 google-authenticator.php:392
8697 -msgid "Google Authenticator Settings"
8698 -msgstr "Configurações do Google Authenticator"
8699 -
8700 -#: google-authenticator.php:223 google-authenticator.php:396
8701 -msgid "Active"
8702 -msgstr "Ativar"
8703 -
8704 -#: google-authenticator.php:235
8705 -msgid "Relaxed mode"
8706 -msgstr "Modo relaxado"
8707 -
8708 -#: google-authenticator.php:237
8709 -msgid ""
8710 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
8711 -"min)."
8712 -msgstr "O modo relaxado permite mais tempo à deriva no relógio do seu telefone (&#177;4 min)."
8713 -
8714 -#: google-authenticator.php:242
8715 -msgid "Description"
8716 -msgstr "Descrição"
8717 -
8718 -#: google-authenticator.php:243
8719 -msgid ""
8720 -" Description that you'll see in the Google Authenticator app on your phone."
8721 -msgstr "Descrição que você verá no aplicativo Google Authenticator em seu telefone."
8722 -
8723 -#: google-authenticator.php:247
8724 -msgid "Secret"
8725 -msgstr "Secreto"
8726 -
8727 -#: google-authenticator.php:250
8728 -msgid "Create new secret"
8729 -msgstr "Crie um novo segredo"
8730 -
8731 -#: google-authenticator.php:251
8732 -msgid "Show/Hide QR code"
8733 -msgstr "Mostar/Esconder QR Code"
8734 -
8735 -#: google-authenticator.php:259
8736 -msgid "Scan this with the Google Authenticator app."
8737 -msgstr "Escaneie isso com o aplicativo Google Authenticator."
8738 -
8739 -#: google-authenticator.php:264
8740 -msgid "Enable App password"
8741 -msgstr "Ativar senha do aplicativo"
8742 -
8743 -#: google-authenticator.php:266
8744 -msgid " Enabling an App password will decrease your overall login security."
8745 -msgstr "Ativar uma senha de aplicativo diminuirá sua segurança geral de login."
8746 -
8747 -#: google-authenticator.php:274
8748 -msgid "Create new password"
8749 -msgstr "Crie uma nova senha"
8750 -
8751 -#: google-authenticator.php:275
8752 -msgid ""
8753 -" Password is not stored in cleartext, this is your only chance to see it."
8754 -msgstr "A senha não é armazenada em texto puro, essa é sua única chance de vê-la."
8755 -
8756 -#. Plugin Name of the plugin/theme
8757 -msgid "Google Authenticator"
8758 -msgstr "Google Authenticator"
8759 -
8760 -#. Plugin URI of the plugin/theme
8761 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
8762 -msgstr "http://henrik.schack.dk/google-authenticator-for-wordpress"
8763 -
8764 -#. Description of the plugin/theme
8765 -msgid ""
8766 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
8767 -"app as One Time Password generator."
8768 -msgstr "Autenticação de dois fatores para WordPress usando o aplicativo Android / iPhone / Blackberry como gerador de senha única."
8769 -
8770 -#. Author of the plugin/theme
8771 -msgid "Henrik Schack"
8772 -msgstr "Henrik Schack"
8773 -
8774 -#. Author URI of the plugin/theme
8775 -msgid "http://henrik.schack.dk/"
8776 -msgstr "http://henrik.schack.dk/"
8777 -
8778
8779 diff --git a/plugins/google-authenticator/lang/google-authenticator-zh_CN.mo b/plugins/google-authenticator/lang/google-authenticator-zh_CN.mo
8780 deleted file mode 100644
8781 index cdf342ea..00000000
8782 Binary files a/plugins/google-authenticator/lang/google-authenticator-zh_CN.mo and /dev/null differ
8783
8784 diff --git a/plugins/google-authenticator/lang/google-authenticator-zh_CN.po b/plugins/google-authenticator/lang/google-authenticator-zh_CN.po
8785 deleted file mode 100644
8786 index 8b6cb67e..00000000
8787 --- a/plugins/google-authenticator/lang/google-authenticator-zh_CN.po
8788 +++ /dev/null
8789 @@ -1,126 +0,0 @@
8790 -# Copyright (C) 2010 Google Authenticator
8791 -# This file is distributed under the same license as the Google Authenticator package.
8792 -msgid ""
8793 -msgstr ""
8794 -"Project-Id-Version: Google Authenticator 0.37\n"
8795 -"Report-Msgid-Bugs-To: http://wordpress.org/tag/google-authenticator\n"
8796 -"POT-Creation-Date: 2014-01-11 07:14:22+00:00\n"
8797 -"PO-Revision-Date: 2014-01-13 13:48+0800\n"
8798 -"Last-Translator: Kaijia Feng <fengkaijia@×××××.com>\n"
8799 -"Language-Team: \n"
8800 -"Language: zh_CN\n"
8801 -"MIME-Version: 1.0\n"
8802 -"Content-Type: text/plain; charset=UTF-8\n"
8803 -"Content-Transfer-Encoding: 8bit\n"
8804 -"X-Generator: Poedit 1.5.5\n"
8805 -
8806 -#: google-authenticator.php:166
8807 -msgid ""
8808 -"If you don't have Google Authenticator enabled for your WordPress account, "
8809 -"leave this field empty."
8810 -msgstr "如果您的帐号没有启用Google Authenticator身份验证功能,请不必填写此栏。"
8811 -
8812 -#: google-authenticator.php:166
8813 -msgid "Google Authenticator code"
8814 -msgstr "Google Authenticator验证码"
8815 -
8816 -#: google-authenticator.php:231
8817 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
8818 -msgstr "<strong>错误</strong>:Google Authenticator验证码有误。"
8819 -
8820 -#: google-authenticator.php:234
8821 -msgid ""
8822 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
8823 -"expired."
8824 -msgstr "<strong>错误</strong>:Google Authenticator验证码有误或者已经失效。"
8825 -
8826 -#: google-authenticator.php:274
8827 -msgid "WordPressBlog"
8828 -msgstr "WordPressBlog"
8829 -
8830 -#: google-authenticator.php:277 google-authenticator.php:469
8831 -msgid "Google Authenticator Settings"
8832 -msgstr "Google Authenticator设置"
8833 -
8834 -#: google-authenticator.php:282 google-authenticator.php:481
8835 -msgid "Active"
8836 -msgstr "启用"
8837 -
8838 -#: google-authenticator.php:290
8839 -msgid "Relaxed mode"
8840 -msgstr "宽松模式"
8841 -
8842 -#: google-authenticator.php:292
8843 -msgid ""
8844 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
8845 -"min)."
8846 -msgstr " 在宽松模式下你可以有更长的时间输入验证码(&#177;4分钟)。"
8847 -
8848 -#: google-authenticator.php:297
8849 -msgid "Description"
8850 -msgstr "描述"
8851 -
8852 -#: google-authenticator.php:298
8853 -msgid ""
8854 -" Description that you'll see in the Google Authenticator app on your phone."
8855 -msgstr " 在Google Authenticator应用中显示的帐户描述。"
8856 -
8857 -#: google-authenticator.php:302
8858 -msgid "Secret"
8859 -msgstr "密钥"
8860 -
8861 -#: google-authenticator.php:305
8862 -msgid "Create new secret"
8863 -msgstr "创建新密钥"
8864 -
8865 -#: google-authenticator.php:306
8866 -msgid "Show/Hide QR code"
8867 -msgstr "显示/隐藏QR码"
8868 -
8869 -#: google-authenticator.php:315
8870 -msgid "Scan this with the Google Authenticator app."
8871 -msgstr "使用Google Authenticator应用扫描此图像。"
8872 -
8873 -#: google-authenticator.php:320
8874 -msgid "Enable App password"
8875 -msgstr "启用应用专用密码"
8876 -
8877 -#: google-authenticator.php:322
8878 -msgid " Enabling an App password will decrease your overall login security."
8879 -msgstr " 启用应用专用密码将会在总体上降低登录的安全性。"
8880 -
8881 -#: google-authenticator.php:330
8882 -msgid "Create new password"
8883 -msgstr "创建新密码"
8884 -
8885 -#: google-authenticator.php:331
8886 -msgid ""
8887 -" Password is not stored in cleartext, this is your only chance to see it."
8888 -msgstr " 密码将不会明文储存,这将是你唯一一次看见密码。"
8889 -
8890 -#: google-authenticator.php:474
8891 -msgid "Hide settings from user"
8892 -msgstr "不对用户显示设置"
8893 -
8894 -#. Plugin Name of the plugin/theme
8895 -msgid "Google Authenticator"
8896 -msgstr "Google Authenticator"
8897 -
8898 -#. Plugin URI of the plugin/theme
8899 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
8900 -msgstr "http://henrik.schack.dk/google-authenticator-for-wordpress"
8901 -
8902 -#. Description of the plugin/theme
8903 -msgid ""
8904 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
8905 -"app as One Time Password generator."
8906 -msgstr ""
8907 -"使用Android/iPhone/Blackberry一次性密码生成应用为WordPress提供两步验证。"
8908 -
8909 -#. Author of the plugin/theme
8910 -msgid "Henrik Schack"
8911 -msgstr "Henrik Schack"
8912 -
8913 -#. Author URI of the plugin/theme
8914 -msgid "http://henrik.schack.dk/"
8915 -msgstr "http://henrik.schack.dk/"
8916
8917 diff --git a/plugins/google-authenticator/lang/google-authenticator.pot b/plugins/google-authenticator/lang/google-authenticator.pot
8918 deleted file mode 100644
8919 index a300d648..00000000
8920 --- a/plugins/google-authenticator/lang/google-authenticator.pot
8921 +++ /dev/null
8922 @@ -1,260 +0,0 @@
8923 -# Copyright (C) 2017 Google Authenticator
8924 -# This file is distributed under the same license as the Google Authenticator package.
8925 -msgid ""
8926 -msgstr ""
8927 -"Project-Id-Version: Google Authenticator 0.49\n"
8928 -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/google-"
8929 -"authenticator\n"
8930 -"POT-Creation-Date: 2017-10-28 00:02:58+00:00\n"
8931 -"MIME-Version: 1.0\n"
8932 -"Content-Type: text/plain; charset=UTF-8\n"
8933 -"Content-Transfer-Encoding: 8bit\n"
8934 -"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
8935 -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8936 -"Language-Team: LANGUAGE <LL@××.org>\n"
8937 -
8938 -#. #-#-#-#-# google-authenticator.pot (Google Authenticator 0.49) #-#-#-#-#
8939 -#. Plugin Name of the plugin/theme
8940 -#: google-authenticator.php:190 google-authenticator.php:193
8941 -msgid "Google Authenticator"
8942 -msgstr ""
8943 -
8944 -#: google-authenticator.php:268
8945 -msgid ""
8946 -"OTP code doesn't match supplied secret, please check you've configured "
8947 -"Authenticator correctly."
8948 -msgstr ""
8949 -
8950 -#: google-authenticator.php:277
8951 -msgid ""
8952 -"Congratulations, you have successfully enabled Google Authenticator for your "
8953 -"account "
8954 -msgstr ""
8955 -
8956 -#: google-authenticator.php:298
8957 -msgid "iOS: Authy"
8958 -msgstr ""
8959 -
8960 -#: google-authenticator.php:302
8961 -msgid "iOS: Google Authenticator"
8962 -msgstr ""
8963 -
8964 -#: google-authenticator.php:306
8965 -msgid "Android: Authy"
8966 -msgstr ""
8967 -
8968 -#: google-authenticator.php:310
8969 -msgid "Android: Google Authenticator"
8970 -msgstr ""
8971 -
8972 -#: google-authenticator.php:314
8973 -msgid "Windows Phone"
8974 -msgstr ""
8975 -
8976 -#: google-authenticator.php:318
8977 -msgid "Chrome Browser"
8978 -msgstr ""
8979 -
8980 -#: google-authenticator.php:322
8981 -msgid "Desktop"
8982 -msgstr ""
8983 -
8984 -#: google-authenticator.php:330 google-authenticator.php:415
8985 -#: google-authenticator.php:693 google-authenticator.php:914
8986 -msgid "Google Authenticator Settings"
8987 -msgstr ""
8988 -
8989 -#: google-authenticator.php:334
8990 -msgid ""
8991 -"If you haven't already done so, please install the Authy or Google "
8992 -"Authenticator app on your mobile device from the App Store:"
8993 -msgstr ""
8994 -
8995 -#: google-authenticator.php:340
8996 -msgid ""
8997 -"The easiest way to enable your account is to add an account by scanning the "
8998 -"QR code using the app."
8999 -msgstr ""
9000 -
9001 -#: google-authenticator.php:342
9002 -msgid ""
9003 -"An account can also be added by typing in the secret. After you've added "
9004 -"your account to the App, please type the code you see on the screen into the "
9005 -"Authenticator Code field and press the Verify Authenticator Code button."
9006 -msgstr ""
9007 -
9008 -#: google-authenticator.php:345
9009 -msgid ""
9010 -"If the account setup was successful, you will be logged out, and will need "
9011 -"to login again using your Username, Password and Authenticator code "
9012 -"generated using the App on your mobile device."
9013 -msgstr ""
9014 -
9015 -#: google-authenticator.php:417
9016 -msgid "foo"
9017 -msgstr ""
9018 -
9019 -#: google-authenticator.php:421
9020 -msgid "Network Settings"
9021 -msgstr ""
9022 -
9023 -#: google-authenticator.php:425
9024 -msgid "Only use network-wide settings, ignoring site settings."
9025 -msgstr ""
9026 -
9027 -#: google-authenticator.php:431
9028 -msgid "Two Screen Signin"
9029 -msgstr ""
9030 -
9031 -#: google-authenticator.php:435
9032 -msgid "Ask for authenticator code on secondary login screen"
9033 -msgstr ""
9034 -
9035 -#: google-authenticator.php:439
9036 -msgid "Roles requiring Google Authenticator Enabled"
9037 -msgstr ""
9038 -
9039 -#: google-authenticator.php:447
9040 -msgid "Network-wide settings in effect, only a super admin can modify them."
9041 -msgstr ""
9042 -
9043 -#: google-authenticator.php:449
9044 -msgid "Change network wide Google Authenticator settings"
9045 -msgstr ""
9046 -
9047 -#: google-authenticator.php:489
9048 -msgid ""
9049 -"Sorry, you can't disable checks for this role as it's enabled at the network "
9050 -"level."
9051 -msgstr ""
9052 -
9053 -#: google-authenticator.php:491
9054 -msgid ""
9055 -"Sorry, this role is enabled at the network level and can only be disabled "
9056 -"via the <a href=\"%s\">network settings</a>"
9057 -msgstr ""
9058 -
9059 -#: google-authenticator.php:520
9060 -msgid ""
9061 -"If you don't have Google Authenticator enabled for your WordPress account, "
9062 -"leave this field empty."
9063 -msgstr ""
9064 -
9065 -#: google-authenticator.php:520
9066 -msgid "Google Authenticator code"
9067 -msgstr ""
9068 -
9069 -#: google-authenticator.php:593
9070 -msgid "<strong>ERROR</strong>: The Google Authenticator password is incorrect."
9071 -msgstr ""
9072 -
9073 -#: google-authenticator.php:597 google-authenticator.php:618
9074 -msgid ""
9075 -"<strong>ERROR</strong>: The Google Authenticator code is incorrect or has "
9076 -"expired."
9077 -msgstr ""
9078 -
9079 -#: google-authenticator.php:616
9080 -msgid "<strong>ERROR</strong>: The Google Authenticator code is missing."
9081 -msgstr ""
9082 -
9083 -#: google-authenticator.php:630
9084 -msgid ""
9085 -"Please enter the Google Authenticator code using the app on your device."
9086 -msgstr ""
9087 -
9088 -#: google-authenticator.php:632
9089 -msgid "Log In"
9090 -msgstr ""
9091 -
9092 -#: google-authenticator.php:700 google-authenticator.php:926
9093 -msgid "Active"
9094 -msgstr ""
9095 -
9096 -#: google-authenticator.php:709
9097 -msgid "Relaxed mode"
9098 -msgstr ""
9099 -
9100 -#: google-authenticator.php:711
9101 -msgid ""
9102 -" Relaxed mode allows for more time drifting on your phone clock (&#177;4 "
9103 -"min)."
9104 -msgstr ""
9105 -
9106 -#: google-authenticator.php:718
9107 -msgid "Description"
9108 -msgstr ""
9109 -
9110 -#: google-authenticator.php:719
9111 -msgid ""
9112 -" Description that you'll see in the Google Authenticator app on your phone."
9113 -msgstr ""
9114 -
9115 -#: google-authenticator.php:723
9116 -msgid "Secret"
9117 -msgstr ""
9118 -
9119 -#: google-authenticator.php:727
9120 -msgid "Create new secret"
9121 -msgstr ""
9122 -
9123 -#: google-authenticator.php:728
9124 -msgid "Show/Hide QR code"
9125 -msgstr ""
9126 -
9127 -#: google-authenticator.php:740
9128 -msgid "Scan this with the Google Authenticator app."
9129 -msgstr ""
9130 -
9131 -#: google-authenticator.php:752
9132 -msgid "Enable App password"
9133 -msgstr ""
9134 -
9135 -#: google-authenticator.php:754
9136 -msgid " Enabling an App password will decrease your overall login security."
9137 -msgstr ""
9138 -
9139 -#: google-authenticator.php:762
9140 -msgid "Create new password"
9141 -msgstr ""
9142 -
9143 -#: google-authenticator.php:763
9144 -msgid ""
9145 -" Password is not stored in cleartext, this is your only chance to see it."
9146 -msgstr ""
9147 -
9148 -#: google-authenticator.php:771
9149 -msgid "Authenticator Code"
9150 -msgstr ""
9151 -
9152 -#: google-authenticator.php:772
9153 -msgid ""
9154 -"After adding the site to your google authy account, add your authenticator "
9155 -"code here."
9156 -msgstr ""
9157 -
9158 -#: google-authenticator.php:778
9159 -msgid "Verify Authenticator Code"
9160 -msgstr ""
9161 -
9162 -#: google-authenticator.php:919
9163 -msgid "Hide settings from user"
9164 -msgstr ""
9165 -
9166 -#. Plugin URI of the plugin/theme
9167 -msgid "http://henrik.schack.dk/google-authenticator-for-wordpress"
9168 -msgstr ""
9169 -
9170 -#. Description of the plugin/theme
9171 -msgid ""
9172 -"Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry "
9173 -"app as One Time Password generator."
9174 -msgstr ""
9175 -
9176 -#. Author of the plugin/theme
9177 -msgid "Henrik Schack"
9178 -msgstr ""
9179 -
9180 -#. Author URI of the plugin/theme
9181 -msgid "http://henrik.schack.dk/"
9182 -msgstr ""
9183
9184 diff --git a/plugins/google-authenticator/readme.txt b/plugins/google-authenticator/readme.txt
9185 deleted file mode 100644
9186 index a35ef72e..00000000
9187 --- a/plugins/google-authenticator/readme.txt
9188 +++ /dev/null
9189 @@ -1,194 +0,0 @@
9190 -=== Google Authenticator ===
9191 -Contributors: ivankk
9192 -Tags: authentication,otp,password,security,login,android,iphone,blackberry
9193 -Requires at least: 4.5
9194 -Tested up to: 5.2
9195 -Stable tag: 0.52
9196 -License: GPLv2 or later
9197 -License URI: http://www.gnu.org/licenses/gpl-2.0.html
9198 -
9199 -Google Authenticator for your WordPress blog.
9200 -
9201 -== Description ==
9202 -
9203 -The Google Authenticator plugin for WordPress gives you two-factor authentication using the Google Authenticator app for Android/iPhone/Blackberry.
9204 -
9205 -If you are security aware, you may already have the Google Authenticator app installed on your smartphone, using it for two-factor authentication on Gmail/Dropbox/Lastpass/Amazon etc.
9206 -
9207 -The two-factor authentication requirement can be enabled on a per-user basis. You could enable it for your administrator account, but log in as usual with less privileged accounts.
9208 -
9209 -If You need to maintain your blog using an Android/iPhone app, or any other software using the XMLRPC interface, you can enable the App password feature in this plugin,
9210 -but please note that enabling the App password feature will make your blog less secure.
9211 -
9212 -== Installation ==
9213 -1. Make sure your webhost is capable of providing accurate time information for PHP/WordPress, ie. make sure a NTP daemon is running on the server.
9214 -2. Install and activate the plugin.
9215 -3. Enter a description on the Users -> Profile and Personal options page, in the Google Authenticator section.
9216 -4. Scan the generated QR code with your phone, or enter the secret manually, remember to pick the time based one.
9217 -You may also want to write down the secret on a piece of paper and store it in a safe place.
9218 -5. Remember to hit the **Update profile** button at the bottom of the page before leaving the Personal options page.
9219 -6. That's it, your WordPress blog is now a little more secure.
9220 -
9221 -== Frequently Asked Questions ==
9222 -
9223 -= Can I use Google Authenticator for WordPress with the Android/iPhone apps for WordPress? =
9224 -
9225 -Yes, you can enable the App password feature to make that possible, but notice that the XMLRPC interface isn't protected by two-factor authentication, only a long password.
9226 -
9227 -= I want to update the secret, should I just scan the new QR code after creating a new secret? =
9228 -
9229 -No, you'll have to delete the existing account from the Google Authenticator app on your smartphone before you scan the new QR code, that is unless you change the description as well.
9230 -
9231 -= I am unable to log in using this plugin, what's wrong ? =
9232 -
9233 -The Google Authenticator verification codes are time based, so it's crucial that the clock in your phone is accurate and in sync with the clock on the server where your WordPress installation is hosted.
9234 -If you have an Android phone, you can use an app like [ClockSync](https://market.android.com/details?id=ru.org.amip.ClockSync) to set your clock in case your Cell provider doesn't provide accurate time information
9235 -Another option is to enable "relaxed mode" in the settings for the plugin, this will enable more valid codes by allowing up to a 4 min. timedrift in each direction.
9236 -
9237 -= I have several users on my WordPress installation, is that a supported configuration ? =
9238 -
9239 -Yes, each user has his own Google Authenticator settings.
9240 -
9241 -= During installation I forgot the thing about making sure my webhost is capable of providing accurate time information, I'm now unable to login, please help. =
9242 -
9243 -If you have SSH or FTP access to your webhosting account, you can manually delete the plugin from your WordPress installation,
9244 -just delete the wp-content/plugins/google-authenticator directory, and you'll be able to login using username/password again.
9245 -
9246 -= I don't own a Smartphone, isn't there another way to generate these secret codes ? =
9247 -
9248 -Yes, there is a webbased version here : https://gauth.apps.gbraad.nl/
9249 -Github project here : https://github.com/gbraad/gauth
9250 -
9251 -= Can I create backupcodes ? =
9252 -
9253 -No, but if you're using an Android smartphone you can replace the Google Authenticator app with [Authenticator Plus](https://play.google.com/store/apps/details?id=com.mufri.authenticatorplus).
9254 -It's a really nice app that can import your existing settings, sync between devices and backup/restore using your sd-card.
9255 -It's not a free app, but it's well worth the money.
9256 -
9257 -= Any known incompatabilities ? =
9258 -
9259 -Yes, the Man-in-the-middle attack/replay detection code isn't compatible with the test/setup mode in the "Stop spammer registration plugin",
9260 -please remember to remove the "Check credentials on all login attempts" checkmark before installing my plugin.
9261 -
9262 -
9263 -
9264 -== Screenshots ==
9265 -
9266 -1. The enhanced log-in box.
9267 -2. Google Authenticator section on the Profile and Personal options page.
9268 -3. QR code on the Profile and Personal options page.
9269 -4. Google Authenticator app on Android
9270 -
9271 -== Changelog ==
9272 -= 0.52 =
9273 -* Add a Dutch translation
9274 -* Add a Portuguese translation
9275 -
9276 -= 0.51 =
9277 -* Fix a regression that broke app passwords
9278 -
9279 -= 0.50 =
9280 -* New maintainer ivankk
9281 -* Conditionally include base32 class
9282 -
9283 -= 0.49 =
9284 -* More streamlined sign-up flow for users, configuration screen for admins.
9285 -* Multisite support to either enable 2fa by role on a site, and/or on a network.
9286 -* Added filter google_authenticator_needs_setup to determine if user needs to enable 2fa.
9287 -* Added two part login process that can ask for 2fa code on a second login screen.
9288 -* Fixed a security bug that continued check_otp even if authenticate had already returned an error.
9289 -
9290 -= 0.48 =
9291 -* Security fix / compatability with WordPress 4.5
9292 -
9293 -= 0.47 =
9294 -* Google chart API replaced with jquery-qrcode
9295 -* QR codes now contain a heading saying WordPress (Feature request by Flemming Mahler)
9296 -* Danish translation & updated .pot file.
9297 -* Plugin now logs login attempts recognized as Man-in-the-middle attacks.
9298 -
9299 -= 0.46 =
9300 -* Man-in-the-middle attack protection added.
9301 -* Show warning before displaying the QR code.
9302 -* FAQ updated.
9303 -
9304 -= 0.45 =
9305 -* Spaces in the description field should now work on iPhones.
9306 -* Some depricated function calls replaced.
9307 -* Code inputfield easier to use for .jp users now.
9308 -* Sanitize description field input.
9309 -* App password hash function switched to one that doesn't have rainbow tables available.
9310 -* PHP notices occurring during app password login removed.
9311 -
9312 -= 0.44 =
9313 -* Installation/FAQ section updated.
9314 -* Simplified Chinese translation by Kaijia Feng added.
9315 -* Tabindex on loginpage removed, no longer needed, was used by older WordPress installations.
9316 -* Inputfield renamed to "googleotp".
9317 -* Defaultdescription changed to "WordPressBlog" to avoid trouble for iPhone users.
9318 -* Compatibility with Ryan Hellyer's plugin http://geek.ryanhellyer.net/products/deactivate-google-authenticator/
9319 -* Must enter all 6 code digits.
9320 -
9321 -= 0.43 =
9322 -* It's now possible for an admin to hide the Google Authenticaator settings on a per-user basis. (Feature request by : Skate-O)
9323 -
9324 -= 0.42 =
9325 -* Autocomplete disabled on code input field. (Feature request by : hiphopsmurf)
9326 -
9327 -= 0.41 =
9328 -* Italian translation by Aldo Latino added.
9329 -
9330 -= 0.40 =
9331 -* Bugfix, typo corrected and PHP notices removed. Thanks to Dion Hulse for his patch.
9332 -
9333 -= 0.39 =
9334 -* Bugfix, Description was not saved to WordPress database when updating profile. Thanks to xxdesmus for noticing this.
9335 -
9336 -= 0.38 =
9337 -* Usability fix, input field for codes changed from password to text type.
9338 -
9339 -= 0.37 =
9340 -* The plugin now supports "relaxed mode" when authenticating. If selected, codes from 4 minutes before and 4 minutes after will work. 30 seconds before and after is still the default setting.
9341 -
9342 -= 0.36 =
9343 -* Bugfix, now an App password can only be used for XMLRPC/APP-Request logins.
9344 -
9345 -= 0.35 =
9346 -* Initial WordPress app support added (XMLRPC).
9347 -
9348 -= 0.30 =
9349 -* Code cleanup
9350 -* Changed generation of secret key, to no longer have requirement of SHA256 on the server
9351 -* German translation
9352 -
9353 -= 0.20 =
9354 -* Initial release
9355 -
9356 -
9357 -== Credits ==
9358 -
9359 -Thanks to:
9360 -
9361 -[Fabio Zumbi](https://github.com/FabioZumbi12) for the Portuguese translation
9362 -
9363 -[Guido Schalkx](https://www.guidoschalkx.com/) for the Dutch translation.
9364 -
9365 -[Henrik.Schack](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=henrik%40schack%2edk&lc=US&item_name=Google%20Authenticator&item_number=Google%20Authenticator&no_shipping=0&no_note=1&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8) for writing/maintaining versions 0.20 through 0.48
9366 -
9367 -[Tobias Bäthge](http://tobias.baethge.com/) for his code rewrite and German translation.
9368 -
9369 -[Pascal de Bruijn](http://blog.pcode.nl/) for his "relaxed mode" idea.
9370 -
9371 -[Daniel Werl](http://technobabbl.es/) for his usability tips.
9372 -
9373 -[Dion Hulse](http://dd32.id.au/) for his bugfixes.
9374 -
9375 -[Aldo Latino](http://profiles.wordpress.org/users/aldolat/) for his Italian translation.
9376 -
9377 -[Kaijia Feng](http://www.kaijia.me/) for his Simplified Chinese translation.
9378 -
9379 -[Alex Concha](http://www.buayacorp.com/) for his security tips.
9380 -
9381 -[Jerome Etienne](http://jetienne.com/) for his jquery-qrcode plugin.
9382 -
9383 -[Sébastien Prunier](http://orizhial.com/) for his Spanish and French translation.
9384
9385 diff --git a/plugins/google-authenticator/screenshot-1.jpg b/plugins/google-authenticator/screenshot-1.jpg
9386 deleted file mode 100644
9387 index 252831f3..00000000
9388 Binary files a/plugins/google-authenticator/screenshot-1.jpg and /dev/null differ
9389
9390 diff --git a/plugins/google-authenticator/screenshot-2.jpg b/plugins/google-authenticator/screenshot-2.jpg
9391 deleted file mode 100644
9392 index 13bb25c2..00000000
9393 Binary files a/plugins/google-authenticator/screenshot-2.jpg and /dev/null differ
9394
9395 diff --git a/plugins/google-authenticator/screenshot-3.jpg b/plugins/google-authenticator/screenshot-3.jpg
9396 deleted file mode 100644
9397 index b74aeae5..00000000
9398 Binary files a/plugins/google-authenticator/screenshot-3.jpg and /dev/null differ
9399
9400 diff --git a/plugins/google-authenticator/screenshot-4.jpg b/plugins/google-authenticator/screenshot-4.jpg
9401 deleted file mode 100644
9402 index 804f3cad..00000000
9403 Binary files a/plugins/google-authenticator/screenshot-4.jpg and /dev/null differ
9404
9405 diff --git a/plugins/google-authenticator/screenshot-5.jpg b/plugins/google-authenticator/screenshot-5.jpg
9406 deleted file mode 100644
9407 index 1b396294..00000000
9408 Binary files a/plugins/google-authenticator/screenshot-5.jpg and /dev/null differ