Version Description
Release Date - 13 October 2015
- Closes a potential XSS vulnerability.
Download this release
Release Info
| Developer | cfinke |
| Plugin | |
| Version | 3.0.5 |
| Comparing to | |
| See all releases | |
Code changes from version 3.1.4 to 3.0.5
- LICENSE.txt +0 -339
- _inc/akismet.css +6 -19
- _inc/akismet.js +25 -56
- akismet.php +4 -6
- class.akismet-admin.php +35 -141
- class.akismet.php +35 -229
- readme.txt +7 -37
- views/config.php +3 -33
- views/get.php +0 -1
- views/notice.php +19 -36
- views/start.php +21 -23
- views/strict.php +7 -17
- wrapper.php +86 -6
LICENSE.txt
DELETED
|
@@ -1,339 +0,0 @@
|
|
| 1 |
-
GNU GENERAL PUBLIC LICENSE
|
| 2 |
-
Version 2, June 1991
|
| 3 |
-
|
| 4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
| 5 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
| 6 |
-
Everyone is permitted to copy and distribute verbatim copies
|
| 7 |
-
of this license document, but changing it is not allowed.
|
| 8 |
-
|
| 9 |
-
Preamble
|
| 10 |
-
|
| 11 |
-
The licenses for most software are designed to take away your
|
| 12 |
-
freedom to share and change it. By contrast, the GNU General Public
|
| 13 |
-
License is intended to guarantee your freedom to share and change free
|
| 14 |
-
software--to make sure the software is free for all its users. This
|
| 15 |
-
General Public License applies to most of the Free Software
|
| 16 |
-
Foundation's software and to any other program whose authors commit to
|
| 17 |
-
using it. (Some other Free Software Foundation software is covered by
|
| 18 |
-
the GNU Lesser General Public License instead.) You can apply it to
|
| 19 |
-
your programs, too.
|
| 20 |
-
|
| 21 |
-
When we speak of free software, we are referring to freedom, not
|
| 22 |
-
price. Our General Public Licenses are designed to make sure that you
|
| 23 |
-
have the freedom to distribute copies of free software (and charge for
|
| 24 |
-
this service if you wish), that you receive source code or can get it
|
| 25 |
-
if you want it, that you can change the software or use pieces of it
|
| 26 |
-
in new free programs; and that you know you can do these things.
|
| 27 |
-
|
| 28 |
-
To protect your rights, we need to make restrictions that forbid
|
| 29 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
| 30 |
-
These restrictions translate to certain responsibilities for you if you
|
| 31 |
-
distribute copies of the software, or if you modify it.
|
| 32 |
-
|
| 33 |
-
For example, if you distribute copies of such a program, whether
|
| 34 |
-
gratis or for a fee, you must give the recipients all the rights that
|
| 35 |
-
you have. You must make sure that they, too, receive or can get the
|
| 36 |
-
source code. And you must show them these terms so they know their
|
| 37 |
-
rights.
|
| 38 |
-
|
| 39 |
-
We protect your rights with two steps: (1) copyright the software, and
|
| 40 |
-
(2) offer you this license which gives you legal permission to copy,
|
| 41 |
-
distribute and/or modify the software.
|
| 42 |
-
|
| 43 |
-
Also, for each author's protection and ours, we want to make certain
|
| 44 |
-
that everyone understands that there is no warranty for this free
|
| 45 |
-
software. If the software is modified by someone else and passed on, we
|
| 46 |
-
want its recipients to know that what they have is not the original, so
|
| 47 |
-
that any problems introduced by others will not reflect on the original
|
| 48 |
-
authors' reputations.
|
| 49 |
-
|
| 50 |
-
Finally, any free program is threatened constantly by software
|
| 51 |
-
patents. We wish to avoid the danger that redistributors of a free
|
| 52 |
-
program will individually obtain patent licenses, in effect making the
|
| 53 |
-
program proprietary. To prevent this, we have made it clear that any
|
| 54 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
| 55 |
-
|
| 56 |
-
The precise terms and conditions for copying, distribution and
|
| 57 |
-
modification follow.
|
| 58 |
-
|
| 59 |
-
GNU GENERAL PUBLIC LICENSE
|
| 60 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
| 61 |
-
|
| 62 |
-
0. This License applies to any program or other work which contains
|
| 63 |
-
a notice placed by the copyright holder saying it may be distributed
|
| 64 |
-
under the terms of this General Public License. The "Program", below,
|
| 65 |
-
refers to any such program or work, and a "work based on the Program"
|
| 66 |
-
means either the Program or any derivative work under copyright law:
|
| 67 |
-
that is to say, a work containing the Program or a portion of it,
|
| 68 |
-
either verbatim or with modifications and/or translated into another
|
| 69 |
-
language. (Hereinafter, translation is included without limitation in
|
| 70 |
-
the term "modification".) Each licensee is addressed as "you".
|
| 71 |
-
|
| 72 |
-
Activities other than copying, distribution and modification are not
|
| 73 |
-
covered by this License; they are outside its scope. The act of
|
| 74 |
-
running the Program is not restricted, and the output from the Program
|
| 75 |
-
is covered only if its contents constitute a work based on the
|
| 76 |
-
Program (independent of having been made by running the Program).
|
| 77 |
-
Whether that is true depends on what the Program does.
|
| 78 |
-
|
| 79 |
-
1. You may copy and distribute verbatim copies of the Program's
|
| 80 |
-
source code as you receive it, in any medium, provided that you
|
| 81 |
-
conspicuously and appropriately publish on each copy an appropriate
|
| 82 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
| 83 |
-
notices that refer to this License and to the absence of any warranty;
|
| 84 |
-
and give any other recipients of the Program a copy of this License
|
| 85 |
-
along with the Program.
|
| 86 |
-
|
| 87 |
-
You may charge a fee for the physical act of transferring a copy, and
|
| 88 |
-
you may at your option offer warranty protection in exchange for a fee.
|
| 89 |
-
|
| 90 |
-
2. You may modify your copy or copies of the Program or any portion
|
| 91 |
-
of it, thus forming a work based on the Program, and copy and
|
| 92 |
-
distribute such modifications or work under the terms of Section 1
|
| 93 |
-
above, provided that you also meet all of these conditions:
|
| 94 |
-
|
| 95 |
-
a) You must cause the modified files to carry prominent notices
|
| 96 |
-
stating that you changed the files and the date of any change.
|
| 97 |
-
|
| 98 |
-
b) You must cause any work that you distribute or publish, that in
|
| 99 |
-
whole or in part contains or is derived from the Program or any
|
| 100 |
-
part thereof, to be licensed as a whole at no charge to all third
|
| 101 |
-
parties under the terms of this License.
|
| 102 |
-
|
| 103 |
-
c) If the modified program normally reads commands interactively
|
| 104 |
-
when run, you must cause it, when started running for such
|
| 105 |
-
interactive use in the most ordinary way, to print or display an
|
| 106 |
-
announcement including an appropriate copyright notice and a
|
| 107 |
-
notice that there is no warranty (or else, saying that you provide
|
| 108 |
-
a warranty) and that users may redistribute the program under
|
| 109 |
-
these conditions, and telling the user how to view a copy of this
|
| 110 |
-
License. (Exception: if the Program itself is interactive but
|
| 111 |
-
does not normally print such an announcement, your work based on
|
| 112 |
-
the Program is not required to print an announcement.)
|
| 113 |
-
|
| 114 |
-
These requirements apply to the modified work as a whole. If
|
| 115 |
-
identifiable sections of that work are not derived from the Program,
|
| 116 |
-
and can be reasonably considered independent and separate works in
|
| 117 |
-
themselves, then this License, and its terms, do not apply to those
|
| 118 |
-
sections when you distribute them as separate works. But when you
|
| 119 |
-
distribute the same sections as part of a whole which is a work based
|
| 120 |
-
on the Program, the distribution of the whole must be on the terms of
|
| 121 |
-
this License, whose permissions for other licensees extend to the
|
| 122 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
| 123 |
-
|
| 124 |
-
Thus, it is not the intent of this section to claim rights or contest
|
| 125 |
-
your rights to work written entirely by you; rather, the intent is to
|
| 126 |
-
exercise the right to control the distribution of derivative or
|
| 127 |
-
collective works based on the Program.
|
| 128 |
-
|
| 129 |
-
In addition, mere aggregation of another work not based on the Program
|
| 130 |
-
with the Program (or with a work based on the Program) on a volume of
|
| 131 |
-
a storage or distribution medium does not bring the other work under
|
| 132 |
-
the scope of this License.
|
| 133 |
-
|
| 134 |
-
3. You may copy and distribute the Program (or a work based on it,
|
| 135 |
-
under Section 2) in object code or executable form under the terms of
|
| 136 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
| 137 |
-
|
| 138 |
-
a) Accompany it with the complete corresponding machine-readable
|
| 139 |
-
source code, which must be distributed under the terms of Sections
|
| 140 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
| 141 |
-
|
| 142 |
-
b) Accompany it with a written offer, valid for at least three
|
| 143 |
-
years, to give any third party, for a charge no more than your
|
| 144 |
-
cost of physically performing source distribution, a complete
|
| 145 |
-
machine-readable copy of the corresponding source code, to be
|
| 146 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
| 147 |
-
customarily used for software interchange; or,
|
| 148 |
-
|
| 149 |
-
c) Accompany it with the information you received as to the offer
|
| 150 |
-
to distribute corresponding source code. (This alternative is
|
| 151 |
-
allowed only for noncommercial distribution and only if you
|
| 152 |
-
received the program in object code or executable form with such
|
| 153 |
-
an offer, in accord with Subsection b above.)
|
| 154 |
-
|
| 155 |
-
The source code for a work means the preferred form of the work for
|
| 156 |
-
making modifications to it. For an executable work, complete source
|
| 157 |
-
code means all the source code for all modules it contains, plus any
|
| 158 |
-
associated interface definition files, plus the scripts used to
|
| 159 |
-
control compilation and installation of the executable. However, as a
|
| 160 |
-
special exception, the source code distributed need not include
|
| 161 |
-
anything that is normally distributed (in either source or binary
|
| 162 |
-
form) with the major components (compiler, kernel, and so on) of the
|
| 163 |
-
operating system on which the executable runs, unless that component
|
| 164 |
-
itself accompanies the executable.
|
| 165 |
-
|
| 166 |
-
If distribution of executable or object code is made by offering
|
| 167 |
-
access to copy from a designated place, then offering equivalent
|
| 168 |
-
access to copy the source code from the same place counts as
|
| 169 |
-
distribution of the source code, even though third parties are not
|
| 170 |
-
compelled to copy the source along with the object code.
|
| 171 |
-
|
| 172 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
| 173 |
-
except as expressly provided under this License. Any attempt
|
| 174 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
| 175 |
-
void, and will automatically terminate your rights under this License.
|
| 176 |
-
However, parties who have received copies, or rights, from you under
|
| 177 |
-
this License will not have their licenses terminated so long as such
|
| 178 |
-
parties remain in full compliance.
|
| 179 |
-
|
| 180 |
-
5. You are not required to accept this License, since you have not
|
| 181 |
-
signed it. However, nothing else grants you permission to modify or
|
| 182 |
-
distribute the Program or its derivative works. These actions are
|
| 183 |
-
prohibited by law if you do not accept this License. Therefore, by
|
| 184 |
-
modifying or distributing the Program (or any work based on the
|
| 185 |
-
Program), you indicate your acceptance of this License to do so, and
|
| 186 |
-
all its terms and conditions for copying, distributing or modifying
|
| 187 |
-
the Program or works based on it.
|
| 188 |
-
|
| 189 |
-
6. Each time you redistribute the Program (or any work based on the
|
| 190 |
-
Program), the recipient automatically receives a license from the
|
| 191 |
-
original licensor to copy, distribute or modify the Program subject to
|
| 192 |
-
these terms and conditions. You may not impose any further
|
| 193 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
| 194 |
-
You are not responsible for enforcing compliance by third parties to
|
| 195 |
-
this License.
|
| 196 |
-
|
| 197 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
| 198 |
-
infringement or for any other reason (not limited to patent issues),
|
| 199 |
-
conditions are imposed on you (whether by court order, agreement or
|
| 200 |
-
otherwise) that contradict the conditions of this License, they do not
|
| 201 |
-
excuse you from the conditions of this License. If you cannot
|
| 202 |
-
distribute so as to satisfy simultaneously your obligations under this
|
| 203 |
-
License and any other pertinent obligations, then as a consequence you
|
| 204 |
-
may not distribute the Program at all. For example, if a patent
|
| 205 |
-
license would not permit royalty-free redistribution of the Program by
|
| 206 |
-
all those who receive copies directly or indirectly through you, then
|
| 207 |
-
the only way you could satisfy both it and this License would be to
|
| 208 |
-
refrain entirely from distribution of the Program.
|
| 209 |
-
|
| 210 |
-
If any portion of this section is held invalid or unenforceable under
|
| 211 |
-
any particular circumstance, the balance of the section is intended to
|
| 212 |
-
apply and the section as a whole is intended to apply in other
|
| 213 |
-
circumstances.
|
| 214 |
-
|
| 215 |
-
It is not the purpose of this section to induce you to infringe any
|
| 216 |
-
patents or other property right claims or to contest validity of any
|
| 217 |
-
such claims; this section has the sole purpose of protecting the
|
| 218 |
-
integrity of the free software distribution system, which is
|
| 219 |
-
implemented by public license practices. Many people have made
|
| 220 |
-
generous contributions to the wide range of software distributed
|
| 221 |
-
through that system in reliance on consistent application of that
|
| 222 |
-
system; it is up to the author/donor to decide if he or she is willing
|
| 223 |
-
to distribute software through any other system and a licensee cannot
|
| 224 |
-
impose that choice.
|
| 225 |
-
|
| 226 |
-
This section is intended to make thoroughly clear what is believed to
|
| 227 |
-
be a consequence of the rest of this License.
|
| 228 |
-
|
| 229 |
-
8. If the distribution and/or use of the Program is restricted in
|
| 230 |
-
certain countries either by patents or by copyrighted interfaces, the
|
| 231 |
-
original copyright holder who places the Program under this License
|
| 232 |
-
may add an explicit geographical distribution limitation excluding
|
| 233 |
-
those countries, so that distribution is permitted only in or among
|
| 234 |
-
countries not thus excluded. In such case, this License incorporates
|
| 235 |
-
the limitation as if written in the body of this License.
|
| 236 |
-
|
| 237 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
| 238 |
-
of the General Public License from time to time. Such new versions will
|
| 239 |
-
be similar in spirit to the present version, but may differ in detail to
|
| 240 |
-
address new problems or concerns.
|
| 241 |
-
|
| 242 |
-
Each version is given a distinguishing version number. If the Program
|
| 243 |
-
specifies a version number of this License which applies to it and "any
|
| 244 |
-
later version", you have the option of following the terms and conditions
|
| 245 |
-
either of that version or of any later version published by the Free
|
| 246 |
-
Software Foundation. If the Program does not specify a version number of
|
| 247 |
-
this License, you may choose any version ever published by the Free Software
|
| 248 |
-
Foundation.
|
| 249 |
-
|
| 250 |
-
10. If you wish to incorporate parts of the Program into other free
|
| 251 |
-
programs whose distribution conditions are different, write to the author
|
| 252 |
-
to ask for permission. For software which is copyrighted by the Free
|
| 253 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
| 254 |
-
make exceptions for this. Our decision will be guided by the two goals
|
| 255 |
-
of preserving the free status of all derivatives of our free software and
|
| 256 |
-
of promoting the sharing and reuse of software generally.
|
| 257 |
-
|
| 258 |
-
NO WARRANTY
|
| 259 |
-
|
| 260 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
| 261 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
| 262 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
| 263 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
| 264 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
| 265 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
| 266 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
| 267 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
| 268 |
-
REPAIR OR CORRECTION.
|
| 269 |
-
|
| 270 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 271 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
| 272 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
| 273 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
| 274 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
| 275 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
| 276 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
| 277 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
| 278 |
-
POSSIBILITY OF SUCH DAMAGES.
|
| 279 |
-
|
| 280 |
-
END OF TERMS AND CONDITIONS
|
| 281 |
-
|
| 282 |
-
How to Apply These Terms to Your New Programs
|
| 283 |
-
|
| 284 |
-
If you develop a new program, and you want it to be of the greatest
|
| 285 |
-
possible use to the public, the best way to achieve this is to make it
|
| 286 |
-
free software which everyone can redistribute and change under these terms.
|
| 287 |
-
|
| 288 |
-
To do so, attach the following notices to the program. It is safest
|
| 289 |
-
to attach them to the start of each source file to most effectively
|
| 290 |
-
convey the exclusion of warranty; and each file should have at least
|
| 291 |
-
the "copyright" line and a pointer to where the full notice is found.
|
| 292 |
-
|
| 293 |
-
<one line to give the program's name and a brief idea of what it does.>
|
| 294 |
-
Copyright (C) <year> <name of author>
|
| 295 |
-
|
| 296 |
-
This program is free software; you can redistribute it and/or modify
|
| 297 |
-
it under the terms of the GNU General Public License as published by
|
| 298 |
-
the Free Software Foundation; either version 2 of the License, or
|
| 299 |
-
(at your option) any later version.
|
| 300 |
-
|
| 301 |
-
This program is distributed in the hope that it will be useful,
|
| 302 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 303 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 304 |
-
GNU General Public License for more details.
|
| 305 |
-
|
| 306 |
-
You should have received a copy of the GNU General Public License along
|
| 307 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
| 308 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
| 309 |
-
|
| 310 |
-
Also add information on how to contact you by electronic and paper mail.
|
| 311 |
-
|
| 312 |
-
If the program is interactive, make it output a short notice like this
|
| 313 |
-
when it starts in an interactive mode:
|
| 314 |
-
|
| 315 |
-
Gnomovision version 69, Copyright (C) year name of author
|
| 316 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 317 |
-
This is free software, and you are welcome to redistribute it
|
| 318 |
-
under certain conditions; type `show c' for details.
|
| 319 |
-
|
| 320 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 321 |
-
parts of the General Public License. Of course, the commands you use may
|
| 322 |
-
be called something other than `show w' and `show c'; they could even be
|
| 323 |
-
mouse-clicks or menu items--whatever suits your program.
|
| 324 |
-
|
| 325 |
-
You should also get your employer (if you work as a programmer) or your
|
| 326 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
| 327 |
-
necessary. Here is a sample; alter the names:
|
| 328 |
-
|
| 329 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
| 330 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
| 331 |
-
|
| 332 |
-
<signature of Ty Coon>, 1 April 1989
|
| 333 |
-
Ty Coon, President of Vice
|
| 334 |
-
|
| 335 |
-
This General Public License does not permit incorporating your program into
|
| 336 |
-
proprietary programs. If your program is a subroutine library, you may
|
| 337 |
-
consider it more useful to permit linking proprietary applications with the
|
| 338 |
-
library. If this is what you want to do, use the GNU Lesser General
|
| 339 |
-
Public License instead of this License.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_inc/akismet.css
CHANGED
|
@@ -33,13 +33,14 @@
|
|
| 33 |
color: #AAA;
|
| 34 |
font-style: italic;
|
| 35 |
}
|
| 36 |
-
|
| 37 |
text-decoration: underline;
|
| 38 |
}
|
| 39 |
-
|
| 40 |
-
content:
|
| 41 |
color: #aaa;
|
| 42 |
-
|
|
|
|
| 43 |
}
|
| 44 |
.mshot-arrow {
|
| 45 |
width: 0;
|
|
@@ -63,15 +64,6 @@ span.comment-link:after {
|
|
| 63 |
border-radius: 6px;
|
| 64 |
-webkit-border-radius: 6px;
|
| 65 |
}
|
| 66 |
-
.akismet-mshot {
|
| 67 |
-
position: absolute;
|
| 68 |
-
z-index: 100;
|
| 69 |
-
}
|
| 70 |
-
.akismet-mshot .mshot-image {
|
| 71 |
-
margin: 0;
|
| 72 |
-
height: 338px;
|
| 73 |
-
width: 450px;
|
| 74 |
-
}
|
| 75 |
h2.ak-header {
|
| 76 |
padding: 30px;
|
| 77 |
background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
|
|
@@ -349,16 +341,11 @@ h2.ak-header {
|
|
| 349 |
text-align: center;
|
| 350 |
}
|
| 351 |
|
| 352 |
-
.akismet-settings th
|
| 353 |
vertical-align: top;
|
| 354 |
padding-top: 15px;
|
| 355 |
}
|
| 356 |
|
| 357 |
-
.akismet-settings th.akismet-api-key {
|
| 358 |
-
vertical-align: middle;
|
| 359 |
-
padding-top: 0;
|
| 360 |
-
}
|
| 361 |
-
|
| 362 |
.akismet-settings input[type=text] {
|
| 363 |
width: 75%;
|
| 364 |
}
|
| 33 |
color: #AAA;
|
| 34 |
font-style: italic;
|
| 35 |
}
|
| 36 |
+
table.comments td.comment p a {
|
| 37 |
text-decoration: underline;
|
| 38 |
}
|
| 39 |
+
table.comments td.comment p a:after {
|
| 40 |
+
content: attr(href);
|
| 41 |
color: #aaa;
|
| 42 |
+
display: inline-block; /* Show the URL without the link's underline extending under it. */
|
| 43 |
+
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. */
|
| 44 |
}
|
| 45 |
.mshot-arrow {
|
| 46 |
width: 0;
|
| 64 |
border-radius: 6px;
|
| 65 |
-webkit-border-radius: 6px;
|
| 66 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
h2.ak-header {
|
| 68 |
padding: 30px;
|
| 69 |
background: #649316 url('img/logo-full-2x.png') no-repeat 20px center;
|
| 341 |
text-align: center;
|
| 342 |
}
|
| 343 |
|
| 344 |
+
.akismet-settings th.strictness {
|
| 345 |
vertical-align: top;
|
| 346 |
padding-top: 15px;
|
| 347 |
}
|
| 348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
.akismet-settings input[type=text] {
|
| 350 |
width: 75%;
|
| 351 |
}
|
_inc/akismet.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
| 1 |
jQuery( function ( $ ) {
|
| 2 |
-
var mshotRemovalTimer = null;
|
| 3 |
-
var mshotSecondTryTimer = null
|
| 4 |
-
var mshotThirdTryTimer = null
|
| 5 |
-
|
| 6 |
$( 'a.activate-option' ).click( function(){
|
| 7 |
var link = $( this );
|
| 8 |
if ( link.hasClass( 'clicked' ) ) {
|
|
@@ -22,11 +18,9 @@ jQuery( function ( $ ) {
|
|
| 22 |
var thisId = $(this).attr('commentid');
|
| 23 |
$(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
|
| 24 |
});
|
| 25 |
-
$('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title]').each(function () {
|
| 26 |
-
// Comment author URLs are the only URL with a title attribute in the author column.
|
| 27 |
var thisTitle = $(this).attr('title');
|
| 28 |
-
|
| 29 |
-
var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
|
| 30 |
|
| 31 |
$(this).attr("id", "author_comment_url_"+ thisCommentId[1]);
|
| 32 |
|
|
@@ -105,55 +99,30 @@ jQuery( function ( $ ) {
|
|
| 105 |
|
| 106 |
return false;
|
| 107 |
});
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
}
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
var thisHref = $.URLEncode( $( this ).attr( 'href' ) );
|
| 128 |
-
|
| 129 |
-
var mShot = $( '<div class="akismet-mshot mshot-container"><div class="mshot-arrow"></div><img src="//s0.wordpress.com/mshots/v1/' + thisHref + '?w=450" width="450" height="338" class="mshot-image" /></div>' );
|
| 130 |
-
mShot.data( 'link', this );
|
| 131 |
-
|
| 132 |
-
var offset = $( this ).offset();
|
| 133 |
-
|
| 134 |
-
mShot.offset( {
|
| 135 |
-
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.
|
| 136 |
-
top: offset.top + ( $( this ).height() / 2 ) - 101 // 101 = top offset of the arrow plus the top border thickness
|
| 137 |
-
} );
|
| 138 |
-
|
| 139 |
-
mshotSecondTryTimer = setTimeout( function () {
|
| 140 |
-
mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2' );
|
| 141 |
-
}, 6000 );
|
| 142 |
-
|
| 143 |
-
mshotThirdTryTimer = setTimeout( function () {
|
| 144 |
-
mShot.find( '.mshot-image' ).attr( 'src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3' );
|
| 145 |
-
}, 12000 );
|
| 146 |
-
|
| 147 |
-
$( 'body' ).append( mShot );
|
| 148 |
-
} ).mouseout( function () {
|
| 149 |
-
mshotRemovalTimer = setTimeout( function () {
|
| 150 |
-
clearTimeout( mshotSecondTryTimer );
|
| 151 |
-
clearTimeout( mshotThirdTryTimer );
|
| 152 |
-
|
| 153 |
-
$( '.akismet-mshot' ).remove();
|
| 154 |
-
}, 200 );
|
| 155 |
-
} );
|
| 156 |
-
|
| 157 |
$('.checkforspam:not(.button-disabled)').click( function(e) {
|
| 158 |
$('.checkforspam:not(.button-disabled)').addClass('button-disabled');
|
| 159 |
$('.checkforspam-spinner').addClass( 'spinner' );
|
| 1 |
jQuery( function ( $ ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
$( 'a.activate-option' ).click( function(){
|
| 3 |
var link = $( this );
|
| 4 |
if ( link.hasClass( 'clicked' ) ) {
|
| 18 |
var thisId = $(this).attr('commentid');
|
| 19 |
$(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
|
| 20 |
});
|
| 21 |
+
$('#the-comment-list').find('tr.comment, tr[id ^= "comment-"]').find('.column-author a[title ^= "http://"], .column-author a[title ^= "https://"]').each(function () {
|
|
|
|
| 22 |
var thisTitle = $(this).attr('title');
|
| 23 |
+
thisCommentId = $(this).parents('tr:first').attr('id').split("-");
|
|
|
|
| 24 |
|
| 25 |
$(this).attr("id", "author_comment_url_"+ thisCommentId[1]);
|
| 26 |
|
| 99 |
|
| 100 |
return false;
|
| 101 |
});
|
| 102 |
+
$('a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type').mouseover(function () {
|
| 103 |
+
var wpcomProtocol = ( 'https:' === location.protocol ) ? 'https://' : 'http://';
|
| 104 |
+
// Need to determine size of author column
|
| 105 |
+
var thisParentWidth = $(this).parent().width();
|
| 106 |
+
// It changes based on if there is a gravatar present
|
| 107 |
+
thisParentWidth = ($(this).parent().find('.grav-hijack').length) ? thisParentWidth - 42 + 'px' : thisParentWidth + 'px';
|
| 108 |
+
if ($(this).find('.mShot').length == 0 && !$(this).hasClass('akismet_undo_link_removal')) {
|
| 109 |
+
var self = $( this );
|
| 110 |
+
$('.widefat td').css('overflow', 'visible');
|
| 111 |
+
$(this).css('position', 'relative');
|
| 112 |
+
var thisHref = $.URLEncode( $(this).attr('href') );
|
| 113 |
+
$(this).append('<div class="mShot mshot-container" style="left: '+thisParentWidth+'"><div class="mshot-arrow"></div><img src="//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450" width="450" class="mshot-image" style="margin: 0;" /></div>');
|
| 114 |
+
setTimeout(function () {
|
| 115 |
+
self.find( '.mshot-image' ).attr('src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=2');
|
| 116 |
+
}, 6000);
|
| 117 |
+
setTimeout(function () {
|
| 118 |
+
self.find( '.mshot-image' ).attr('src', '//s0.wordpress.com/mshots/v1/'+thisHref+'?w=450&r=3');
|
| 119 |
+
}, 12000);
|
| 120 |
+
} else {
|
| 121 |
+
$(this).find('.mShot').css('left', thisParentWidth).show();
|
| 122 |
}
|
| 123 |
+
}).mouseout(function () {
|
| 124 |
+
$(this).find('.mShot').hide();
|
| 125 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
$('.checkforspam:not(.button-disabled)').click( function(e) {
|
| 127 |
$('.checkforspam:not(.button-disabled)').addClass('button-disabled');
|
| 128 |
$('.checkforspam-spinner').addClass( 'spinner' );
|
akismet.php
CHANGED
|
@@ -5,8 +5,8 @@
|
|
| 5 |
/*
|
| 6 |
Plugin Name: Akismet
|
| 7 |
Plugin URI: http://akismet.com/
|
| 8 |
-
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/">Sign up for an Akismet
|
| 9 |
-
Version: 3.
|
| 10 |
Author: Automattic
|
| 11 |
Author URI: http://automattic.com/wordpress-plugins/
|
| 12 |
License: GPLv2 or later
|
|
@@ -27,8 +27,6 @@ GNU General Public License for more details.
|
|
| 27 |
You should have received a copy of the GNU General Public License
|
| 28 |
along with this program; if not, write to the Free Software
|
| 29 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
| 30 |
-
|
| 31 |
-
Copyright 2005-2015 Automattic, Inc.
|
| 32 |
*/
|
| 33 |
|
| 34 |
// Make sure we don't expose any info if called directly
|
|
@@ -37,8 +35,8 @@ if ( !function_exists( 'add_action' ) ) {
|
|
| 37 |
exit;
|
| 38 |
}
|
| 39 |
|
| 40 |
-
define( 'AKISMET_VERSION', '3.
|
| 41 |
-
define( 'AKISMET__MINIMUM_WP_VERSION', '3.
|
| 42 |
define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 43 |
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
| 44 |
define( 'AKISMET_DELETE_LIMIT', 100000 );
|
| 5 |
/*
|
| 6 |
Plugin Name: Akismet
|
| 7 |
Plugin URI: http://akismet.com/
|
| 8 |
+
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
|
| 9 |
+
Version: 3.0.5
|
| 10 |
Author: Automattic
|
| 11 |
Author URI: http://automattic.com/wordpress-plugins/
|
| 12 |
License: GPLv2 or later
|
| 27 |
You should have received a copy of the GNU General Public License
|
| 28 |
along with this program; if not, write to the Free Software
|
| 29 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
| 30 |
*/
|
| 31 |
|
| 32 |
// Make sure we don't expose any info if called directly
|
| 35 |
exit;
|
| 36 |
}
|
| 37 |
|
| 38 |
+
define( 'AKISMET_VERSION', '3.0.5' );
|
| 39 |
+
define( 'AKISMET__MINIMUM_WP_VERSION', '3.1' );
|
| 40 |
define( 'AKISMET__PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 41 |
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
| 42 |
define( 'AKISMET_DELETE_LIMIT', 100000 );
|
class.akismet-admin.php
CHANGED
|
@@ -41,7 +41,6 @@ class Akismet_Admin {
|
|
| 41 |
|
| 42 |
add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
|
| 43 |
add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
|
| 44 |
-
add_filter( 'comment_text', array( 'Akismet_Admin', 'text_add_link_class' ) );
|
| 45 |
|
| 46 |
add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
|
| 47 |
|
|
@@ -129,8 +128,8 @@ class Akismet_Admin {
|
|
| 129 |
'title' => __( 'Overview' , 'akismet'),
|
| 130 |
'content' =>
|
| 131 |
'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
|
| 132 |
-
'<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
|
| 133 |
-
'<p>' . esc_html__( 'On this page, you are able to
|
| 134 |
)
|
| 135 |
);
|
| 136 |
|
|
@@ -141,7 +140,7 @@ class Akismet_Admin {
|
|
| 141 |
'content' =>
|
| 142 |
'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
|
| 143 |
'<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '</p>' .
|
| 144 |
-
'<p>' . sprintf( __( '
|
| 145 |
)
|
| 146 |
);
|
| 147 |
|
|
@@ -167,7 +166,7 @@ class Akismet_Admin {
|
|
| 167 |
'title' => __( 'Overview' , 'akismet'),
|
| 168 |
'content' =>
|
| 169 |
'<p><strong>' . esc_html__( 'Akismet Stats' , 'akismet') . '</strong></p>' .
|
| 170 |
-
'<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
|
| 171 |
'<p>' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '</p>',
|
| 172 |
)
|
| 173 |
);
|
|
@@ -180,7 +179,7 @@ class Akismet_Admin {
|
|
| 180 |
'title' => __( 'Overview' , 'akismet'),
|
| 181 |
'content' =>
|
| 182 |
'<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
|
| 183 |
-
'<p>' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '</p>' .
|
| 184 |
'<p>' . esc_html__( 'On this page, you are able to enter/remove an API key, view account information and view spam stats.' , 'akismet') . '</p>',
|
| 185 |
)
|
| 186 |
);
|
|
@@ -232,7 +231,7 @@ class Akismet_Admin {
|
|
| 232 |
if ( defined( 'WPCOM_API_KEY' ) )
|
| 233 |
return false; //shouldn't have option to save key if already defined
|
| 234 |
|
| 235 |
-
$new_key = preg_replace( '/[^a-
|
| 236 |
$old_key = Akismet::get_api_key();
|
| 237 |
|
| 238 |
if ( empty( $new_key ) ) {
|
|
@@ -290,6 +289,15 @@ class Akismet_Admin {
|
|
| 290 |
|
| 291 |
// WP 2.5+
|
| 292 |
public static function rightnow_stats() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
if ( $count = get_option('akismet_spam_count') ) {
|
| 294 |
$intro = sprintf( _n(
|
| 295 |
'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
|
|
@@ -300,16 +308,15 @@ class Akismet_Admin {
|
|
| 300 |
$intro = sprintf( __('<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' );
|
| 301 |
}
|
| 302 |
|
| 303 |
-
$link =
|
| 304 |
-
|
| 305 |
if ( $queue_count = self::get_spam_count() ) {
|
| 306 |
$queue_text = sprintf( _n(
|
| 307 |
'There’s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
|
| 308 |
'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
|
| 309 |
$queue_count
|
| 310 |
-
, 'akismet'), number_format_i18n( $queue_count ),
|
| 311 |
} else {
|
| 312 |
-
$queue_text = sprintf( __( "There’s nothing in your <a href='%s'>spam queue</a> at the moment." , 'akismet'),
|
| 313 |
}
|
| 314 |
|
| 315 |
$text = $intro . '<br />' . $queue_text;
|
|
@@ -371,22 +378,17 @@ class Akismet_Admin {
|
|
| 371 |
update_comment_meta( $c['comment_ID'], 'akismet_result', 'true' );
|
| 372 |
delete_comment_meta( $c['comment_ID'], 'akismet_error' );
|
| 373 |
delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
|
| 374 |
-
Akismet::update_comment_history( $c['comment_ID'], '', '
|
| 375 |
|
| 376 |
} elseif ( 'false' == $response[1] ) {
|
| 377 |
update_comment_meta( $c['comment_ID'], 'akismet_result', 'false' );
|
| 378 |
delete_comment_meta( $c['comment_ID'], 'akismet_error' );
|
| 379 |
delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
|
| 380 |
-
Akismet::update_comment_history( $c['comment_ID'], '', '
|
| 381 |
// abnormal result: error
|
| 382 |
} else {
|
| 383 |
update_comment_meta( $c['comment_ID'], 'akismet_result', 'error' );
|
| 384 |
-
Akismet::update_comment_history(
|
| 385 |
-
$c['comment_ID'],
|
| 386 |
-
'',
|
| 387 |
-
'recheck-error',
|
| 388 |
-
array( 'response' => substr( $response[1], 0, 50 ) )
|
| 389 |
-
);
|
| 390 |
}
|
| 391 |
|
| 392 |
delete_comment_meta( $c['comment_ID'], 'akismet_rechecking' );
|
|
@@ -491,95 +493,11 @@ class Akismet_Admin {
|
|
| 491 |
|
| 492 |
if ( $history ) {
|
| 493 |
echo '<div class="akismet-history" style="margin: 13px;">';
|
| 494 |
-
|
| 495 |
foreach ( $history as $row ) {
|
| 496 |
$time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
|
| 497 |
-
|
| 498 |
-
$message
|
| 499 |
-
|
| 500 |
-
if ( ! empty( $row['message'] ) ) {
|
| 501 |
-
// Old versions of Akismet stored the message as a literal string in the commentmeta.
|
| 502 |
-
// New versions don't do that for two reasons:
|
| 503 |
-
// 1) Save space.
|
| 504 |
-
// 2) The message can be translated into the current language of the blog, not stuck
|
| 505 |
-
// in the language of the blog when the comment was made.
|
| 506 |
-
$message = $row['message'];
|
| 507 |
-
}
|
| 508 |
-
|
| 509 |
-
// If possible, use a current translation.
|
| 510 |
-
switch ( $row['event'] ) {
|
| 511 |
-
case 'recheck-spam';
|
| 512 |
-
$message = __( 'Akismet re-checked and caught this comment as spam.', 'akismet' );
|
| 513 |
-
break;
|
| 514 |
-
case 'check-spam':
|
| 515 |
-
$message = __( 'Akismet caught this comment as spam.', 'akismet' );
|
| 516 |
-
break;
|
| 517 |
-
case 'recheck-ham':
|
| 518 |
-
$message = __( 'Akismet re-checked and cleared this comment.', 'akismet' );
|
| 519 |
-
break;
|
| 520 |
-
case 'check-ham':
|
| 521 |
-
$message = __( 'Akismet cleared this comment.', 'akismet' );
|
| 522 |
-
break;
|
| 523 |
-
case 'wp-blacklisted':
|
| 524 |
-
$message = __( 'Comment was caught by wp_blacklist_check.', 'akismet' );
|
| 525 |
-
break;
|
| 526 |
-
case 'report-spam':
|
| 527 |
-
if ( isset( $row['user'] ) ) {
|
| 528 |
-
$message = sprintf( __( '%s reported this comment as spam.', 'akismet' ), $row['user'] );
|
| 529 |
-
}
|
| 530 |
-
else if ( ! $message ) {
|
| 531 |
-
$message = __( 'This comment was reported as spam.', 'akismet' );
|
| 532 |
-
}
|
| 533 |
-
break;
|
| 534 |
-
case 'report-ham':
|
| 535 |
-
if ( isset( $row['user'] ) ) {
|
| 536 |
-
$message = sprintf( __( '%s reported this comment as not spam.', 'akismet' ), $row['user'] );
|
| 537 |
-
}
|
| 538 |
-
else if ( ! $message ) {
|
| 539 |
-
$message = __( 'This comment was reported as not spam.', 'akismet' );
|
| 540 |
-
}
|
| 541 |
-
break;
|
| 542 |
-
case 'cron-retry-spam':
|
| 543 |
-
$message = __( 'Akismet caught this comment as spam during an automatic retry.' , 'akismet');
|
| 544 |
-
break;
|
| 545 |
-
case 'cron-retry-ham':
|
| 546 |
-
$message = __( 'Akismet cleared this comment during an automatic retry.', 'akismet');
|
| 547 |
-
break;
|
| 548 |
-
case 'check-error':
|
| 549 |
-
if ( isset( $row['meta'], $row['meta']['response'] ) ) {
|
| 550 |
-
$message = sprintf( __( 'Akismet was unable to check this comment (response: %s) but will automatically retry later.', 'akismet'), $row['meta']['response'] );
|
| 551 |
-
}
|
| 552 |
-
break;
|
| 553 |
-
case 'recheck-error':
|
| 554 |
-
if ( isset( $row['meta'], $row['meta']['response'] ) ) {
|
| 555 |
-
$message = sprintf( __( 'Akismet was unable to recheck this comment (response: %s).', 'akismet'), $row['meta']['response'] );
|
| 556 |
-
}
|
| 557 |
-
break;
|
| 558 |
-
default:
|
| 559 |
-
if ( preg_match( '/^status-changed/', $row['event'] ) ) {
|
| 560 |
-
// Half of these used to be saved without the dash after 'status-changed'.
|
| 561 |
-
// See https://plugins.trac.wordpress.org/changeset/1150658/akismet/trunk
|
| 562 |
-
$new_status = preg_replace( '/^status-changed-?/', '', $row['event'] );
|
| 563 |
-
$message = sprintf( __( 'Comment status was changed to %s', 'akismet' ), $new_status );
|
| 564 |
-
}
|
| 565 |
-
else if ( preg_match( '/^status-/', $row['event'] ) ) {
|
| 566 |
-
$new_status = preg_replace( '/^status-/', '', $row['event'] );
|
| 567 |
-
|
| 568 |
-
if ( isset( $row['user'] ) ) {
|
| 569 |
-
$message = sprintf( __( '%1$s changed the comment status to %2$s.', 'akismet' ), $row['user'], $new_status );
|
| 570 |
-
}
|
| 571 |
-
}
|
| 572 |
-
break;
|
| 573 |
-
|
| 574 |
-
}
|
| 575 |
-
|
| 576 |
-
echo '<div style="margin-bottom: 13px;">';
|
| 577 |
-
echo '<span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( esc_html__('%s ago', 'akismet'), human_time_diff( $row['time'] ) ) . '</span>';
|
| 578 |
-
echo ' - ';
|
| 579 |
-
echo esc_html( $message );
|
| 580 |
-
echo '</div>';
|
| 581 |
}
|
| 582 |
-
|
| 583 |
echo '</div>';
|
| 584 |
}
|
| 585 |
}
|
|
@@ -592,18 +510,6 @@ class Akismet_Admin {
|
|
| 592 |
return $links;
|
| 593 |
}
|
| 594 |
|
| 595 |
-
public static function text_add_link_callback( $m ) {
|
| 596 |
-
// bare link?
|
| 597 |
-
if ( $m[4] == $m[2] )
|
| 598 |
-
return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
|
| 599 |
-
else
|
| 600 |
-
return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
|
| 601 |
-
}
|
| 602 |
-
|
| 603 |
-
public static function text_add_link_class( $comment_text ) {
|
| 604 |
-
return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', array( 'Akismet_Admin', 'text_add_link_callback' ), $comment_text );
|
| 605 |
-
}
|
| 606 |
-
|
| 607 |
// Total spam in queue
|
| 608 |
// get_option( 'akismet_spam_count' ) is the total caught ever
|
| 609 |
public static function get_spam_count( $type = false ) {
|
|
@@ -712,16 +618,13 @@ class Akismet_Admin {
|
|
| 712 |
}
|
| 713 |
|
| 714 |
public static function get_akismet_user( $api_key ) {
|
| 715 |
-
$akismet_user =
|
| 716 |
-
|
| 717 |
-
$subscription_verification = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key, 'blog' => get_bloginfo( 'url' ) ) ), 'get-subscription' );
|
| 718 |
-
|
| 719 |
-
if ( ! empty( $subscription_verification[1] ) ) {
|
| 720 |
-
if ( 'invalid' !== $subscription_verification[1] ) {
|
| 721 |
-
$akismet_user = json_decode( $subscription_verification[1] );
|
| 722 |
-
}
|
| 723 |
-
}
|
| 724 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 725 |
return $akismet_user;
|
| 726 |
}
|
| 727 |
|
|
@@ -729,13 +632,12 @@ class Akismet_Admin {
|
|
| 729 |
$stat_totals = array();
|
| 730 |
|
| 731 |
foreach( array( '6-months', 'all' ) as $interval ) {
|
| 732 |
-
$response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_bloginfo(
|
| 733 |
|
| 734 |
if ( ! empty( $response[1] ) ) {
|
| 735 |
$stat_totals[$interval] = json_decode( $response[1] );
|
| 736 |
}
|
| 737 |
}
|
| 738 |
-
|
| 739 |
return $stat_totals;
|
| 740 |
}
|
| 741 |
|
|
@@ -812,7 +714,7 @@ class Akismet_Admin {
|
|
| 812 |
}
|
| 813 |
}
|
| 814 |
|
| 815 |
-
if ( $api_key = Akismet::get_api_key()
|
| 816 |
self::display_configuration_page();
|
| 817 |
return;
|
| 818 |
}
|
|
@@ -853,16 +755,8 @@ class Akismet_Admin {
|
|
| 853 |
public static function display_configuration_page() {
|
| 854 |
$api_key = Akismet::get_api_key();
|
| 855 |
$akismet_user = self::get_akismet_user( $api_key );
|
| 856 |
-
|
| 857 |
-
if ( ! $akismet_user ) {
|
| 858 |
-
// This could happen if the user's key became invalid after it was previously valid and successfully set up.
|
| 859 |
-
self::$notices['status'] = 'existing-key-invalid';
|
| 860 |
-
self::display_start_page();
|
| 861 |
-
return;
|
| 862 |
-
}
|
| 863 |
-
|
| 864 |
$stat_totals = self::get_stats( $api_key );
|
| 865 |
-
|
| 866 |
// If unset, create the new strictness option using the old discard option to determine its default
|
| 867 |
if ( get_option( 'akismet_strictness' ) === false )
|
| 868 |
add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
|
|
@@ -880,11 +774,11 @@ class Akismet_Admin {
|
|
| 880 |
$cleaning_up = __( 'Cleaning up spam takes time.' , 'akismet');
|
| 881 |
|
| 882 |
if ( $total_in_days > 1 )
|
| 883 |
-
$time_saved = $cleaning_up . ' ' . sprintf( __( 'Akismet has saved you %s days!' , 'akismet'), number_format_i18n( $total_in_days ) );
|
| 884 |
elseif ( $total_in_hours > 1 )
|
| 885 |
-
$time_saved = $cleaning_up . ' ' . sprintf( __( 'Akismet has saved you %d hours!' , 'akismet'), $total_in_hours );
|
| 886 |
elseif ( $total_in_minutes >= 30 )
|
| 887 |
-
$time_saved = $cleaning_up . ' ' . sprintf( __( 'Akismet has saved you %d minutes!' , 'akismet'), $total_in_minutes );
|
| 888 |
}
|
| 889 |
|
| 890 |
Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) );
|
| 41 |
|
| 42 |
add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 );
|
| 43 |
add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 );
|
|
|
|
| 44 |
|
| 45 |
add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) );
|
| 46 |
|
| 128 |
'title' => __( 'Overview' , 'akismet'),
|
| 129 |
'content' =>
|
| 130 |
'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
|
| 131 |
+
'<p>' . esc_html__( 'Akismet filters out your comment and trackback spam for you, so you can focus on more important things.' , 'akismet') . '</p>' .
|
| 132 |
+
'<p>' . esc_html__( 'On this page, you are able to setup the Akismet plugin.' , 'akismet') . '</p>',
|
| 133 |
)
|
| 134 |
);
|
| 135 |
|
| 140 |
'content' =>
|
| 141 |
'<p><strong>' . esc_html__( 'Akismet Setup' , 'akismet') . '</strong></p>' .
|
| 142 |
'<p>' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '</p>' .
|
| 143 |
+
'<p>' . sprintf( __( 'Signup for an account on %s to get an API Key.' , 'akismet'), '<a href="https://akismet.com/plugin-signup/" target="_blank">Akismet.com</a>' ) . '</p>',
|
| 144 |
)
|
| 145 |
);
|
| 146 |
|
| 166 |
'title' => __( 'Overview' , 'akismet'),
|
| 167 |
'content' =>
|
| 168 |
'<p><strong>' . esc_html__( 'Akismet Stats' , 'akismet') . '</strong></p>' .
|
| 169 |
+
'<p>' . esc_html__( 'Akismet filters out your comment and trackback spam for you, so you can focus on more important things.' , 'akismet') . '</p>' .
|
| 170 |
'<p>' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '</p>',
|
| 171 |
)
|
| 172 |
);
|
| 179 |
'title' => __( 'Overview' , 'akismet'),
|
| 180 |
'content' =>
|
| 181 |
'<p><strong>' . esc_html__( 'Akismet Configuration' , 'akismet') . '</strong></p>' .
|
| 182 |
+
'<p>' . esc_html__( 'Akismet filters out your comment and trackback spam for you, so you can focus on more important things.' , 'akismet') . '</p>' .
|
| 183 |
'<p>' . esc_html__( 'On this page, you are able to enter/remove an API key, view account information and view spam stats.' , 'akismet') . '</p>',
|
| 184 |
)
|
| 185 |
);
|
| 231 |
if ( defined( 'WPCOM_API_KEY' ) )
|
| 232 |
return false; //shouldn't have option to save key if already defined
|
| 233 |
|
| 234 |
+
$new_key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
|
| 235 |
$old_key = Akismet::get_api_key();
|
| 236 |
|
| 237 |
if ( empty( $new_key ) ) {
|
| 289 |
|
| 290 |
// WP 2.5+
|
| 291 |
public static function rightnow_stats() {
|
| 292 |
+
global $submenu, $wp_db_version;
|
| 293 |
+
|
| 294 |
+
if ( 8645 < $wp_db_version ) // 2.7
|
| 295 |
+
$link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) );
|
| 296 |
+
elseif ( isset( $submenu['edit-comments.php'] ) )
|
| 297 |
+
$link = add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( 'edit-comments.php' ) );
|
| 298 |
+
else
|
| 299 |
+
$link = add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( 'edit.php' ) );
|
| 300 |
+
|
| 301 |
if ( $count = get_option('akismet_spam_count') ) {
|
| 302 |
$intro = sprintf( _n(
|
| 303 |
'<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
|
| 308 |
$intro = sprintf( __('<a href="%s">Akismet</a> blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' );
|
| 309 |
}
|
| 310 |
|
| 311 |
+
$link = function_exists( 'esc_url' ) ? esc_url( $link ) : clean_url( $link );
|
|
|
|
| 312 |
if ( $queue_count = self::get_spam_count() ) {
|
| 313 |
$queue_text = sprintf( _n(
|
| 314 |
'There’s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
|
| 315 |
'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
|
| 316 |
$queue_count
|
| 317 |
+
, 'akismet'), number_format_i18n( $queue_count ), $link );
|
| 318 |
} else {
|
| 319 |
+
$queue_text = sprintf( __( "There’s nothing in your <a href='%s'>spam queue</a> at the moment." , 'akismet'), $link );
|
| 320 |
}
|
| 321 |
|
| 322 |
$text = $intro . '<br />' . $queue_text;
|
| 378 |
update_comment_meta( $c['comment_ID'], 'akismet_result', 'true' );
|
| 379 |
delete_comment_meta( $c['comment_ID'], 'akismet_error' );
|
| 380 |
delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
|
| 381 |
+
Akismet::update_comment_history( $c['comment_ID'], __('Akismet re-checked and caught this comment as spam', 'akismet'), 'check-spam' );
|
| 382 |
|
| 383 |
} elseif ( 'false' == $response[1] ) {
|
| 384 |
update_comment_meta( $c['comment_ID'], 'akismet_result', 'false' );
|
| 385 |
delete_comment_meta( $c['comment_ID'], 'akismet_error' );
|
| 386 |
delete_comment_meta( $c['comment_ID'], 'akismet_delayed_moderation_email' );
|
| 387 |
+
Akismet::update_comment_history( $c['comment_ID'], __('Akismet re-checked and cleared this comment', 'akismet'), 'check-ham' );
|
| 388 |
// abnormal result: error
|
| 389 |
} else {
|
| 390 |
update_comment_meta( $c['comment_ID'], 'akismet_result', 'error' );
|
| 391 |
+
Akismet::update_comment_history( $c['comment_ID'], sprintf( __('Akismet was unable to re-check this comment (response: %s)', 'akismet'), substr($response[1], 0, 50)), 'check-error' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
}
|
| 393 |
|
| 394 |
delete_comment_meta( $c['comment_ID'], 'akismet_rechecking' );
|
| 493 |
|
| 494 |
if ( $history ) {
|
| 495 |
echo '<div class="akismet-history" style="margin: 13px;">';
|
|
|
|
| 496 |
foreach ( $history as $row ) {
|
| 497 |
$time = date( 'D d M Y @ h:i:m a', $row['time'] ) . ' GMT';
|
| 498 |
+
echo '<div style="margin-bottom: 13px;"><span style="color: #999;" alt="' . $time . '" title="' . $time . '">' . sprintf( esc_html__('%s ago', 'akismet'), human_time_diff( $row['time'] ) ) . '</span> - ';
|
| 499 |
+
echo esc_html( $row['message'] ) . '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 500 |
}
|
|
|
|
| 501 |
echo '</div>';
|
| 502 |
}
|
| 503 |
}
|
| 510 |
return $links;
|
| 511 |
}
|
| 512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 513 |
// Total spam in queue
|
| 514 |
// get_option( 'akismet_spam_count' ) is the total caught ever
|
| 515 |
public static function get_spam_count( $type = false ) {
|
| 618 |
}
|
| 619 |
|
| 620 |
public static function get_akismet_user( $api_key ) {
|
| 621 |
+
$akismet_user = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key ) ), 'get-subscription' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 622 |
|
| 623 |
+
if ( ! empty( $akismet_user[1] ) )
|
| 624 |
+
$akismet_user = json_decode( $akismet_user[1] );
|
| 625 |
+
else
|
| 626 |
+
$akismet_user = false;
|
| 627 |
+
|
| 628 |
return $akismet_user;
|
| 629 |
}
|
| 630 |
|
| 632 |
$stat_totals = array();
|
| 633 |
|
| 634 |
foreach( array( '6-months', 'all' ) as $interval ) {
|
| 635 |
+
$response = Akismet::http_post( Akismet::build_query( array( 'blog' => urlencode( get_bloginfo('url') ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
|
| 636 |
|
| 637 |
if ( ! empty( $response[1] ) ) {
|
| 638 |
$stat_totals[$interval] = json_decode( $response[1] );
|
| 639 |
}
|
| 640 |
}
|
|
|
|
| 641 |
return $stat_totals;
|
| 642 |
}
|
| 643 |
|
| 714 |
}
|
| 715 |
}
|
| 716 |
|
| 717 |
+
if ( $api_key = Akismet::get_api_key() ) {
|
| 718 |
self::display_configuration_page();
|
| 719 |
return;
|
| 720 |
}
|
| 755 |
public static function display_configuration_page() {
|
| 756 |
$api_key = Akismet::get_api_key();
|
| 757 |
$akismet_user = self::get_akismet_user( $api_key );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 758 |
$stat_totals = self::get_stats( $api_key );
|
| 759 |
+
|
| 760 |
// If unset, create the new strictness option using the old discard option to determine its default
|
| 761 |
if ( get_option( 'akismet_strictness' ) === false )
|
| 762 |
add_option( 'akismet_strictness', (get_option('akismet_discard_month') === 'true' ? '1' : '0') );
|
| 774 |
$cleaning_up = __( 'Cleaning up spam takes time.' , 'akismet');
|
| 775 |
|
| 776 |
if ( $total_in_days > 1 )
|
| 777 |
+
$time_saved = $cleaning_up . ' ' . sprintf( __( 'Since you joined us, Akismet has saved you %s days!' , 'akismet'), number_format_i18n( $total_in_days ) );
|
| 778 |
elseif ( $total_in_hours > 1 )
|
| 779 |
+
$time_saved = $cleaning_up . ' ' . sprintf( __( 'Since you joined us, Akismet has saved you %d hours!' , 'akismet'), $total_in_hours );
|
| 780 |
elseif ( $total_in_minutes >= 30 )
|
| 781 |
+
$time_saved = $cleaning_up . ' ' . sprintf( __( 'Since you joined us, Akismet has saved you %d minutes!' , 'akismet'), $total_in_minutes );
|
| 782 |
}
|
| 783 |
|
| 784 |
Akismet::view( 'notice', array( 'type' => 'active-notice', 'time_saved' => $time_saved ) );
|
class.akismet.php
CHANGED
|
@@ -9,8 +9,7 @@ class Akismet {
|
|
| 9 |
private static $initiated = false;
|
| 10 |
private static $prevent_moderation_email_for_these_comments = array();
|
| 11 |
private static $last_comment_result = null;
|
| 12 |
-
|
| 13 |
-
|
| 14 |
public static function init() {
|
| 15 |
if ( ! self::$initiated ) {
|
| 16 |
self::init_hooks();
|
|
@@ -24,7 +23,7 @@ class Akismet {
|
|
| 24 |
self::$initiated = true;
|
| 25 |
|
| 26 |
add_action( 'wp_insert_comment', array( 'Akismet', 'auto_check_update_meta' ), 10, 2 );
|
| 27 |
-
|
| 28 |
add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments' ) );
|
| 29 |
add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
|
| 30 |
add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
|
|
@@ -43,9 +42,6 @@ class Akismet {
|
|
| 43 |
|
| 44 |
add_action( 'transition_comment_status', array( 'Akismet', 'transition_comment_status' ), 10, 3 );
|
| 45 |
|
| 46 |
-
// Run this early in the pingback call, before doing a remote fetch of the source uri
|
| 47 |
-
add_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) );
|
| 48 |
-
|
| 49 |
if ( '3.0.5' == $GLOBALS['wp_version'] ) {
|
| 50 |
remove_filter( 'comment_text', 'wp_kses_data' );
|
| 51 |
if ( is_admin() )
|
|
@@ -67,14 +63,7 @@ class Akismet {
|
|
| 67 |
if ( $response[1] != 'valid' && $response[1] != 'invalid' )
|
| 68 |
return 'failed';
|
| 69 |
|
| 70 |
-
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
public static function deactivate_key( $key ) {
|
| 74 |
-
$response = self::http_post( Akismet::build_query( array( 'key' => $key, 'blog' => get_option('home') ) ), 'deactivate' );
|
| 75 |
-
|
| 76 |
-
if ( $response[1] != 'deactivated' )
|
| 77 |
-
return 'failed';
|
| 78 |
|
| 79 |
return $response[1];
|
| 80 |
}
|
|
@@ -132,7 +121,9 @@ class Akismet {
|
|
| 132 |
|
| 133 |
do_action( 'akismet_comment_check_response', $response );
|
| 134 |
|
| 135 |
-
|
|
|
|
|
|
|
| 136 |
$commentdata['akismet_result'] = $response[1];
|
| 137 |
|
| 138 |
if ( isset( $response[0]['x-akismet-pro-tip'] ) )
|
|
@@ -170,7 +161,6 @@ class Akismet {
|
|
| 170 |
if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_single_event') ) {
|
| 171 |
if ( !wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
|
| 172 |
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
| 173 |
-
do_action( 'akismet_scheduled_recheck', 'invalid-response-' . $response[1] );
|
| 174 |
}
|
| 175 |
}
|
| 176 |
|
|
@@ -190,7 +180,7 @@ class Akismet {
|
|
| 190 |
self::set_last_comment( $commentdata );
|
| 191 |
self::fix_scheduled_recheck();
|
| 192 |
|
| 193 |
-
return
|
| 194 |
}
|
| 195 |
|
| 196 |
public static function get_last_comment() {
|
|
@@ -234,32 +224,23 @@ class Akismet {
|
|
| 234 |
// normal result: true or false
|
| 235 |
if ( self::$last_comment['akismet_result'] == 'true' ) {
|
| 236 |
update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
|
| 237 |
-
self::update_comment_history( $comment->comment_ID, '', 'check-spam' );
|
| 238 |
if ( $comment->comment_approved != 'spam' )
|
| 239 |
-
self::update_comment_history(
|
| 240 |
-
$comment->comment_ID,
|
| 241 |
-
'',
|
| 242 |
-
'status-changed-'.$comment->comment_approved
|
| 243 |
-
);
|
| 244 |
}
|
| 245 |
elseif ( self::$last_comment['akismet_result'] == 'false' ) {
|
| 246 |
update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
|
| 247 |
-
self::update_comment_history( $comment->comment_ID, '', 'check-ham' );
|
| 248 |
if ( $comment->comment_approved == 'spam' ) {
|
| 249 |
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) )
|
| 250 |
-
self::update_comment_history( $comment->comment_ID, '', 'wp-blacklisted' );
|
| 251 |
else
|
| 252 |
-
self::update_comment_history( $comment->comment_ID, '', 'status-changed-'.$comment->comment_approved );
|
| 253 |
}
|
| 254 |
} // abnormal result: error
|
| 255 |
else {
|
| 256 |
update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
|
| 257 |
-
self::update_comment_history(
|
| 258 |
-
$comment->comment_ID,
|
| 259 |
-
'',
|
| 260 |
-
'check-error',
|
| 261 |
-
array( 'response' => substr( self::$last_comment['akismet_result'], 0, 50 ) )
|
| 262 |
-
);
|
| 263 |
}
|
| 264 |
|
| 265 |
// record the complete original data as submitted for checking
|
|
@@ -365,15 +346,8 @@ class Akismet {
|
|
| 365 |
return $history;
|
| 366 |
}
|
| 367 |
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
*
|
| 371 |
-
* @param int $comment_id The ID of the relevant comment.
|
| 372 |
-
* @param string $message The string description of the event. No longer used.
|
| 373 |
-
* @param string $event The event code.
|
| 374 |
-
* @param array $meta Metadata about the history entry. e.g., the user that reported or changed the status of a given comment.
|
| 375 |
-
*/
|
| 376 |
-
public static function update_comment_history( $comment_id, $message, $event=null, $meta=null ) {
|
| 377 |
global $current_user;
|
| 378 |
|
| 379 |
// failsafe for old WP versions
|
|
@@ -381,19 +355,15 @@ class Akismet {
|
|
| 381 |
return false;
|
| 382 |
|
| 383 |
$user = '';
|
|
|
|
|
|
|
| 384 |
|
| 385 |
$event = array(
|
| 386 |
'time' => self::_get_microtime(),
|
|
|
|
| 387 |
'event' => $event,
|
|
|
|
| 388 |
);
|
| 389 |
-
|
| 390 |
-
if ( is_object( $current_user ) && isset( $current_user->user_login ) ) {
|
| 391 |
-
$event['user'] = $current_user->user_login;
|
| 392 |
-
}
|
| 393 |
-
|
| 394 |
-
if ( ! empty( $meta ) ) {
|
| 395 |
-
$event['meta'] = $meta;
|
| 396 |
-
}
|
| 397 |
|
| 398 |
// $unique = false so as to allow multiple values per comment
|
| 399 |
$r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
|
|
@@ -469,7 +439,7 @@ class Akismet {
|
|
| 469 |
}
|
| 470 |
}
|
| 471 |
|
| 472 |
-
self::update_comment_history( $comment->comment_ID, '', 'status-' . $new_status );
|
| 473 |
}
|
| 474 |
|
| 475 |
public static function submit_spam_comment( $comment_id ) {
|
|
@@ -486,7 +456,7 @@ class Akismet {
|
|
| 486 |
return;
|
| 487 |
|
| 488 |
// use the original version stored in comment_meta if available
|
| 489 |
-
$as_submitted =
|
| 490 |
|
| 491 |
if ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) )
|
| 492 |
$comment = (object) array_merge( (array)$comment, $as_submitted );
|
|
@@ -514,7 +484,7 @@ class Akismet {
|
|
| 514 |
|
| 515 |
$response = Akismet::http_post( Akismet::build_query( $comment ), 'submit-spam' );
|
| 516 |
if ( $comment->reporter ) {
|
| 517 |
-
self::update_comment_history( $comment_id, '', 'report-spam' );
|
| 518 |
update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
|
| 519 |
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
|
| 520 |
}
|
|
@@ -532,7 +502,7 @@ class Akismet {
|
|
| 532 |
return;
|
| 533 |
|
| 534 |
// use the original version stored in comment_meta if available
|
| 535 |
-
$as_submitted =
|
| 536 |
|
| 537 |
if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) )
|
| 538 |
$comment = (object) array_merge( (array)$comment, $as_submitted );
|
|
@@ -560,7 +530,7 @@ class Akismet {
|
|
| 560 |
|
| 561 |
$response = self::http_post( Akismet::build_query( $comment ), 'submit-ham' );
|
| 562 |
if ( $comment->reporter ) {
|
| 563 |
-
self::update_comment_history( $comment_id, '', 'report-ham' );
|
| 564 |
update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
|
| 565 |
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
|
| 566 |
}
|
|
@@ -577,7 +547,6 @@ class Akismet {
|
|
| 577 |
if ( get_option( 'akismet_alert_code' ) || $status == 'invalid' ) {
|
| 578 |
// since there is currently a problem with the key, reschedule a check for 6 hours hence
|
| 579 |
wp_schedule_single_event( time() + 21600, 'akismet_schedule_cron_recheck' );
|
| 580 |
-
do_action( 'akismet_scheduled_recheck', 'key-problem-' . get_option( 'akismet_alert_code' ) . '-' . $status );
|
| 581 |
return false;
|
| 582 |
}
|
| 583 |
|
|
@@ -599,19 +568,19 @@ class Akismet {
|
|
| 599 |
add_comment_meta( $comment_id, 'akismet_rechecking', true );
|
| 600 |
$status = self::check_db_comment( $comment_id, 'retry' );
|
| 601 |
|
| 602 |
-
$
|
| 603 |
if ( $status == 'true' ) {
|
| 604 |
-
$
|
| 605 |
} elseif ( $status == 'false' ) {
|
| 606 |
-
$
|
| 607 |
}
|
| 608 |
|
| 609 |
// If we got back a legit response then update the comment history
|
| 610 |
// other wise just bail now and try again later. No point in
|
| 611 |
// re-trying all the comments once we hit one failure.
|
| 612 |
-
if ( !empty( $
|
| 613 |
delete_comment_meta( $comment_id, 'akismet_error' );
|
| 614 |
-
self::update_comment_history( $comment_id, ''
|
| 615 |
update_comment_meta( $comment_id, 'akismet_result', $status );
|
| 616 |
// make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
|
| 617 |
$comment = get_comment( $comment_id );
|
|
@@ -639,7 +608,6 @@ class Akismet {
|
|
| 639 |
|
| 640 |
delete_comment_meta( $comment_id, 'akismet_rechecking' );
|
| 641 |
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
| 642 |
-
do_action( 'akismet_scheduled_recheck', 'check-db-comment-' . $status );
|
| 643 |
return;
|
| 644 |
}
|
| 645 |
delete_comment_meta( $comment_id, 'akismet_rechecking' );
|
|
@@ -648,7 +616,6 @@ class Akismet {
|
|
| 648 |
$remaining = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->commentmeta} WHERE meta_key = 'akismet_error'" );
|
| 649 |
if ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {
|
| 650 |
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
| 651 |
-
do_action( 'akismet_scheduled_recheck', 'remaining' );
|
| 652 |
}
|
| 653 |
}
|
| 654 |
|
|
@@ -666,7 +633,6 @@ class Akismet {
|
|
| 666 |
if ( $future_check > $check_range ) {
|
| 667 |
wp_clear_scheduled_hook( 'akismet_schedule_cron_recheck' );
|
| 668 |
wp_schedule_single_event( time() + 300, 'akismet_schedule_cron_recheck' );
|
| 669 |
-
do_action( 'akismet_scheduled_recheck', 'fix-scheduled-recheck' );
|
| 670 |
}
|
| 671 |
}
|
| 672 |
|
|
@@ -707,21 +673,8 @@ class Akismet {
|
|
| 707 |
return (
|
| 708 |
isset( $comment1['comment_post_ID'], $comment2['comment_post_ID'] )
|
| 709 |
&& intval( $comment1['comment_post_ID'] ) == intval( $comment2['comment_post_ID'] )
|
| 710 |
-
&&
|
| 711 |
-
|
| 712 |
-
substr( $comment1['comment_author'], 0, 255 ) == substr( $comment2['comment_author'], 0, 255 )
|
| 713 |
-
|| substr( stripslashes( $comment1['comment_author'] ), 0, 255 ) == substr( $comment2['comment_author'], 0, 255 )
|
| 714 |
-
|| substr( $comment1['comment_author'], 0, 255 ) == substr( stripslashes( $comment2['comment_author'] ), 0, 255 )
|
| 715 |
-
)
|
| 716 |
-
&& (
|
| 717 |
-
// The email max length is 100 characters, limited by the VARCHAR(100) column type.
|
| 718 |
-
substr( $comment1['comment_author_email'], 0, 100 ) == substr( $comment2['comment_author_email'], 0, 100 )
|
| 719 |
-
|| substr( stripslashes( $comment1['comment_author_email'] ), 0, 100 ) == substr( $comment2['comment_author_email'], 0, 100 )
|
| 720 |
-
|| substr( $comment1['comment_author_email'], 0, 100 ) == substr( stripslashes( $comment2['comment_author_email'] ), 0, 100 )
|
| 721 |
-
// Very long emails can be truncated and then stripped if the [0:100] substring isn't a valid address.
|
| 722 |
-
|| ( ! $comment1['comment_author_email'] && strlen( $comment2['comment_author_email'] ) > 100 )
|
| 723 |
-
|| ( ! $comment2['comment_author_email'] && strlen( $comment1['comment_author_email'] ) > 100 )
|
| 724 |
-
)
|
| 725 |
);
|
| 726 |
}
|
| 727 |
|
|
@@ -856,77 +809,13 @@ class Akismet {
|
|
| 856 |
'timeout' => 15
|
| 857 |
);
|
| 858 |
|
| 859 |
-
$akismet_url =
|
| 860 |
-
|
| 861 |
-
/**
|
| 862 |
-
* Try SSL first; if that fails, try without it and don't try it again for a while.
|
| 863 |
-
*/
|
| 864 |
-
|
| 865 |
-
$ssl = $ssl_failed = false;
|
| 866 |
-
|
| 867 |
-
// Check if SSL requests were disabled fewer than X hours ago.
|
| 868 |
-
$ssl_disabled = get_option( 'akismet_ssl_disabled' );
|
| 869 |
-
|
| 870 |
-
if ( $ssl_disabled && $ssl_disabled < ( time() - 60 * 60 * 24 ) ) { // 24 hours
|
| 871 |
-
$ssl_disabled = false;
|
| 872 |
-
delete_option( 'akismet_ssl_disabled' );
|
| 873 |
-
}
|
| 874 |
-
else if ( $ssl_disabled ) {
|
| 875 |
-
do_action( 'akismet_ssl_disabled' );
|
| 876 |
-
}
|
| 877 |
-
|
| 878 |
-
if ( ! $ssl_disabled && function_exists( 'wp_http_supports') && ( $ssl = wp_http_supports( array( 'ssl' ) ) ) ) {
|
| 879 |
-
$akismet_url = set_url_scheme( $akismet_url, 'https' );
|
| 880 |
-
|
| 881 |
-
do_action( 'akismet_https_request_pre' );
|
| 882 |
-
}
|
| 883 |
-
|
| 884 |
$response = wp_remote_post( $akismet_url, $http_args );
|
| 885 |
-
|
| 886 |
Akismet::log( compact( 'akismet_url', 'http_args', 'response' ) );
|
| 887 |
-
|
| 888 |
-
if ( $ssl && is_wp_error( $response ) ) {
|
| 889 |
-
do_action( 'akismet_https_request_failure', $response );
|
| 890 |
-
|
| 891 |
-
// Intermittent connection problems may cause the first HTTPS
|
| 892 |
-
// request to fail and subsequent HTTP requests to succeed randomly.
|
| 893 |
-
// Retry the HTTPS request once before disabling SSL for a time.
|
| 894 |
-
$response = wp_remote_post( $akismet_url, $http_args );
|
| 895 |
-
|
| 896 |
-
Akismet::log( compact( 'akismet_url', 'http_args', 'response' ) );
|
| 897 |
-
|
| 898 |
-
if ( is_wp_error( $response ) ) {
|
| 899 |
-
$ssl_failed = true;
|
| 900 |
-
|
| 901 |
-
do_action( 'akismet_https_request_failure', $response );
|
| 902 |
-
|
| 903 |
-
do_action( 'akismet_http_request_pre' );
|
| 904 |
-
|
| 905 |
-
// Try the request again without SSL.
|
| 906 |
-
$response = wp_remote_post( $http_akismet_url, $http_args );
|
| 907 |
-
|
| 908 |
-
Akismet::log( compact( 'http_akismet_url', 'http_args', 'response' ) );
|
| 909 |
-
}
|
| 910 |
-
}
|
| 911 |
-
|
| 912 |
-
if ( is_wp_error( $response ) ) {
|
| 913 |
-
do_action( 'akismet_request_failure', $response );
|
| 914 |
-
|
| 915 |
return array( '', '' );
|
| 916 |
-
}
|
| 917 |
|
| 918 |
-
|
| 919 |
-
// The request failed when using SSL but succeeded without it. Disable SSL for future requests.
|
| 920 |
-
update_option( 'akismet_ssl_disabled', time() );
|
| 921 |
-
|
| 922 |
-
do_action( 'akismet_https_disabled' );
|
| 923 |
-
}
|
| 924 |
-
|
| 925 |
-
$simplified_response = array( $response['headers'], $response['body'] );
|
| 926 |
-
|
| 927 |
-
self::update_alert( $simplified_response );
|
| 928 |
-
|
| 929 |
-
return $simplified_response;
|
| 930 |
}
|
| 931 |
|
| 932 |
// given a response from an API call like check_key_status(), update the alert code options if an alert is present.
|
|
@@ -1042,7 +931,7 @@ p {
|
|
| 1042 |
* @static
|
| 1043 |
*/
|
| 1044 |
public static function plugin_deactivation( ) {
|
| 1045 |
-
|
| 1046 |
}
|
| 1047 |
|
| 1048 |
/**
|
|
@@ -1067,87 +956,4 @@ p {
|
|
| 1067 |
error_log( print_r( compact( 'akismet_debug' ), true ) );
|
| 1068 |
}
|
| 1069 |
}
|
| 1070 |
-
|
| 1071 |
-
public static function pre_check_pingback( $method ) {
|
| 1072 |
-
if ( $method !== 'pingback.ping' )
|
| 1073 |
-
return;
|
| 1074 |
-
|
| 1075 |
-
global $wp_xmlrpc_server;
|
| 1076 |
-
|
| 1077 |
-
if ( !is_object( $wp_xmlrpc_server ) )
|
| 1078 |
-
return false;
|
| 1079 |
-
|
| 1080 |
-
// Lame: tightly coupled with the IXR class.
|
| 1081 |
-
$args = $wp_xmlrpc_server->message->params;
|
| 1082 |
-
|
| 1083 |
-
if ( !empty( $args[1] ) ) {
|
| 1084 |
-
$post_id = url_to_postid( $args[1] );
|
| 1085 |
-
|
| 1086 |
-
// If this gets through the pre-check, make sure we properly identify the outbound request as a pingback verification
|
| 1087 |
-
Akismet::pingback_forwarded_for( null, $args[0] );
|
| 1088 |
-
add_filter( 'http_request_args', array( 'Akismet', 'pingback_forwarded_for' ), 10, 2 );
|
| 1089 |
-
|
| 1090 |
-
$comment = array(
|
| 1091 |
-
'comment_author_url' => $args[0],
|
| 1092 |
-
'comment_post_ID' => $post_id,
|
| 1093 |
-
'comment_author' => '',
|
| 1094 |
-
'comment_author_email' => '',
|
| 1095 |
-
'comment_content' => '',
|
| 1096 |
-
'comment_type' => 'pingback',
|
| 1097 |
-
'akismet_pre_check' => '1',
|
| 1098 |
-
'comment_pingback_target' => $args[1],
|
| 1099 |
-
);
|
| 1100 |
-
|
| 1101 |
-
$comment = Akismet::auto_check_comment( $comment );
|
| 1102 |
-
|
| 1103 |
-
if ( isset( $comment['akismet_result'] ) && 'true' == $comment['akismet_result'] ) {
|
| 1104 |
-
// Lame: tightly coupled with the IXR classes. Unfortunately the action provides no context and no way to return anything.
|
| 1105 |
-
$wp_xmlrpc_server->error( new IXR_Error( 0, 'Invalid discovery target' ) );
|
| 1106 |
-
}
|
| 1107 |
-
}
|
| 1108 |
-
}
|
| 1109 |
-
|
| 1110 |
-
public static function pingback_forwarded_for( $r, $url ) {
|
| 1111 |
-
static $urls = array();
|
| 1112 |
-
|
| 1113 |
-
// Call this with $r == null to prime the callback to add headers on a specific URL
|
| 1114 |
-
if ( is_null( $r ) && !in_array( $url, $urls ) ) {
|
| 1115 |
-
$urls[] = $url;
|
| 1116 |
-
}
|
| 1117 |
-
|
| 1118 |
-
// Add X-Pingback-Forwarded-For header, but only for requests to a specific URL (the apparent pingback source)
|
| 1119 |
-
if ( is_array( $r ) && is_array( $r['headers'] ) && !isset( $r['headers']['X-Pingback-Forwarded-For'] ) && in_array( $url, $urls ) ) {
|
| 1120 |
-
$remote_ip = preg_replace( '/[^a-fx0-9:.,]/i', '', $_SERVER['REMOTE_ADDR'] );
|
| 1121 |
-
|
| 1122 |
-
// Note: this assumes REMOTE_ADDR is correct, and it may not be if a reverse proxy or CDN is in use
|
| 1123 |
-
$r['headers']['X-Pingback-Forwarded-For'] = $remote_ip;
|
| 1124 |
-
|
| 1125 |
-
// Also identify the request as a pingback verification in the UA string so it appears in logs
|
| 1126 |
-
$r['user-agent'] .= '; verifying pingback from ' . $remote_ip;
|
| 1127 |
-
}
|
| 1128 |
-
|
| 1129 |
-
return $r;
|
| 1130 |
-
}
|
| 1131 |
-
|
| 1132 |
-
/**
|
| 1133 |
-
* Ensure that we are loading expected scalar values from akismet_as_submitted commentmeta.
|
| 1134 |
-
*
|
| 1135 |
-
* @param mixed $meta_value
|
| 1136 |
-
* @return mixed
|
| 1137 |
-
*/
|
| 1138 |
-
private static function sanitize_comment_as_submitted( $meta_value ) {
|
| 1139 |
-
if ( empty( $meta_value ) ) {
|
| 1140 |
-
return $meta_value;
|
| 1141 |
-
}
|
| 1142 |
-
|
| 1143 |
-
$meta_value = (array) $meta_value;
|
| 1144 |
-
|
| 1145 |
-
foreach ( $meta_value as $key => $value ) {
|
| 1146 |
-
if ( ! isset( self::$comment_as_submitted_allowed_keys[$key] ) || ! is_scalar( $value ) ) {
|
| 1147 |
-
unset( $meta_value[$key] );
|
| 1148 |
-
}
|
| 1149 |
-
}
|
| 1150 |
-
|
| 1151 |
-
return $meta_value;
|
| 1152 |
-
}
|
| 1153 |
}
|
| 9 |
private static $initiated = false;
|
| 10 |
private static $prevent_moderation_email_for_these_comments = array();
|
| 11 |
private static $last_comment_result = null;
|
| 12 |
+
|
|
|
|
| 13 |
public static function init() {
|
| 14 |
if ( ! self::$initiated ) {
|
| 15 |
self::init_hooks();
|
| 23 |
self::$initiated = true;
|
| 24 |
|
| 25 |
add_action( 'wp_insert_comment', array( 'Akismet', 'auto_check_update_meta' ), 10, 2 );
|
| 26 |
+
add_action( 'preprocess_comment', array( 'Akismet', 'auto_check_comment' ), 1 );
|
| 27 |
add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments' ) );
|
| 28 |
add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) );
|
| 29 |
add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) );
|
| 42 |
|
| 43 |
add_action( 'transition_comment_status', array( 'Akismet', 'transition_comment_status' ), 10, 3 );
|
| 44 |
|
|
|
|
|
|
|
|
|
|
| 45 |
if ( '3.0.5' == $GLOBALS['wp_version'] ) {
|
| 46 |
remove_filter( 'comment_text', 'wp_kses_data' );
|
| 47 |
if ( is_admin() )
|
| 63 |
if ( $response[1] != 'valid' && $response[1] != 'invalid' )
|
| 64 |
return 'failed';
|
| 65 |
|
| 66 |
+
self::update_alert( $response );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
return $response[1];
|
| 69 |
}
|
| 121 |
|
| 122 |
do_action( 'akismet_comment_check_response', $response );
|
| 123 |
|
| 124 |
+
self::update_alert( $response );
|
| 125 |
+
|
| 126 |
+
$commentdata['comment_as_submitted'] = array_intersect_key( $comment, array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' ) );
|
| 127 |
$commentdata['akismet_result'] = $response[1];
|
| 128 |
|
| 129 |
if ( isset( $response[0]['x-akismet-pro-tip'] ) )
|
| 161 |
if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_single_event') ) {
|
| 162 |
if ( !wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) {
|
| 163 |
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
|
|
|
| 164 |
}
|
| 165 |
}
|
| 166 |
|
| 180 |
self::set_last_comment( $commentdata );
|
| 181 |
self::fix_scheduled_recheck();
|
| 182 |
|
| 183 |
+
return self::$last_comment;
|
| 184 |
}
|
| 185 |
|
| 186 |
public static function get_last_comment() {
|
| 224 |
// normal result: true or false
|
| 225 |
if ( self::$last_comment['akismet_result'] == 'true' ) {
|
| 226 |
update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
|
| 227 |
+
self::update_comment_history( $comment->comment_ID, __('Akismet caught this comment as spam', 'akismet'), 'check-spam' );
|
| 228 |
if ( $comment->comment_approved != 'spam' )
|
| 229 |
+
self::update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s', 'akismet'), $comment->comment_approved), 'status-changed'.$comment->comment_approved );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
}
|
| 231 |
elseif ( self::$last_comment['akismet_result'] == 'false' ) {
|
| 232 |
update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
|
| 233 |
+
self::update_comment_history( $comment->comment_ID, __('Akismet cleared this comment', 'akismet'), 'check-ham' );
|
| 234 |
if ( $comment->comment_approved == 'spam' ) {
|
| 235 |
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) )
|
| 236 |
+
self::update_comment_history( $comment->comment_ID, __('Comment was caught by wp_blacklist_check', 'akismet'), 'wp-blacklisted' );
|
| 237 |
else
|
| 238 |
+
self::update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s', 'akismet'), $comment->comment_approved), 'status-changed-'.$comment->comment_approved );
|
| 239 |
}
|
| 240 |
} // abnormal result: error
|
| 241 |
else {
|
| 242 |
update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
|
| 243 |
+
self::update_comment_history( $comment->comment_ID, sprintf( __('Akismet was unable to check this comment (response: %s), will automatically retry again later.', 'akismet'), substr(self::$last_comment['akismet_result'], 0, 50)), 'check-error' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
}
|
| 245 |
|
| 246 |
// record the complete original data as submitted for checking
|
| 346 |
return $history;
|
| 347 |
}
|
| 348 |
|
| 349 |
+
// log an event for a given comment, storing it in comment_meta
|
| 350 |
+
public static function update_comment_history( $comment_id, $message, $event=null ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
global $current_user;
|
| 352 |
|
| 353 |
// failsafe for old WP versions
|
| 355 |
return false;
|
| 356 |
|
| 357 |
$user = '';
|
| 358 |
+
if ( is_object( $current_user ) && isset( $current_user->user_login ) )
|
| 359 |
+
$user = $current_user->user_login;
|
| 360 |
|
| 361 |
$event = array(
|
| 362 |
'time' => self::_get_microtime(),
|
| 363 |
+
'message' => $message,
|
| 364 |
'event' => $event,
|
| 365 |
+
'user' => $user,
|
| 366 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
|
| 368 |
// $unique = false so as to allow multiple values per comment
|
| 369 |
$r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
|
| 439 |
}
|
| 440 |
}
|
| 441 |
|
| 442 |
+
self::update_comment_history( $comment->comment_ID, sprintf( __('%1$s changed the comment status to %2$s', 'akismet'), $reporter, $new_status ), 'status-' . $new_status );
|
| 443 |
}
|
| 444 |
|
| 445 |
public static function submit_spam_comment( $comment_id ) {
|
| 456 |
return;
|
| 457 |
|
| 458 |
// use the original version stored in comment_meta if available
|
| 459 |
+
$as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
|
| 460 |
|
| 461 |
if ( $as_submitted && is_array( $as_submitted ) && isset( $as_submitted['comment_content'] ) )
|
| 462 |
$comment = (object) array_merge( (array)$comment, $as_submitted );
|
| 484 |
|
| 485 |
$response = Akismet::http_post( Akismet::build_query( $comment ), 'submit-spam' );
|
| 486 |
if ( $comment->reporter ) {
|
| 487 |
+
self::update_comment_history( $comment_id, sprintf( __('%s reported this comment as spam', 'akismet'), $comment->reporter ), 'report-spam' );
|
| 488 |
update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
|
| 489 |
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
|
| 490 |
}
|
| 502 |
return;
|
| 503 |
|
| 504 |
// use the original version stored in comment_meta if available
|
| 505 |
+
$as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
|
| 506 |
|
| 507 |
if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) )
|
| 508 |
$comment = (object) array_merge( (array)$comment, $as_submitted );
|
| 530 |
|
| 531 |
$response = self::http_post( Akismet::build_query( $comment ), 'submit-ham' );
|
| 532 |
if ( $comment->reporter ) {
|
| 533 |
+
self::update_comment_history( $comment_id, sprintf( __('%s reported this comment as not spam', 'akismet'), $comment->reporter ), 'report-ham' );
|
| 534 |
update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
|
| 535 |
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
|
| 536 |
}
|
| 547 |
if ( get_option( 'akismet_alert_code' ) || $status == 'invalid' ) {
|
| 548 |
// since there is currently a problem with the key, reschedule a check for 6 hours hence
|
| 549 |
wp_schedule_single_event( time() + 21600, 'akismet_schedule_cron_recheck' );
|
|
|
|
| 550 |
return false;
|
| 551 |
}
|
| 552 |
|
| 568 |
add_comment_meta( $comment_id, 'akismet_rechecking', true );
|
| 569 |
$status = self::check_db_comment( $comment_id, 'retry' );
|
| 570 |
|
| 571 |
+
$msg = '';
|
| 572 |
if ( $status == 'true' ) {
|
| 573 |
+
$msg = __( 'Akismet caught this comment as spam during an automatic retry.' , 'akismet');
|
| 574 |
} elseif ( $status == 'false' ) {
|
| 575 |
+
$msg = __( 'Akismet cleared this comment during an automatic retry.' , 'akismet');
|
| 576 |
}
|
| 577 |
|
| 578 |
// If we got back a legit response then update the comment history
|
| 579 |
// other wise just bail now and try again later. No point in
|
| 580 |
// re-trying all the comments once we hit one failure.
|
| 581 |
+
if ( !empty( $msg ) ) {
|
| 582 |
delete_comment_meta( $comment_id, 'akismet_error' );
|
| 583 |
+
self::update_comment_history( $comment_id, $msg, 'cron-retry' );
|
| 584 |
update_comment_meta( $comment_id, 'akismet_result', $status );
|
| 585 |
// make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
|
| 586 |
$comment = get_comment( $comment_id );
|
| 608 |
|
| 609 |
delete_comment_meta( $comment_id, 'akismet_rechecking' );
|
| 610 |
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
|
|
|
| 611 |
return;
|
| 612 |
}
|
| 613 |
delete_comment_meta( $comment_id, 'akismet_rechecking' );
|
| 616 |
$remaining = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->commentmeta} WHERE meta_key = 'akismet_error'" );
|
| 617 |
if ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {
|
| 618 |
wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
|
|
|
|
| 619 |
}
|
| 620 |
}
|
| 621 |
|
| 633 |
if ( $future_check > $check_range ) {
|
| 634 |
wp_clear_scheduled_hook( 'akismet_schedule_cron_recheck' );
|
| 635 |
wp_schedule_single_event( time() + 300, 'akismet_schedule_cron_recheck' );
|
|
|
|
| 636 |
}
|
| 637 |
}
|
| 638 |
|
| 673 |
return (
|
| 674 |
isset( $comment1['comment_post_ID'], $comment2['comment_post_ID'] )
|
| 675 |
&& intval( $comment1['comment_post_ID'] ) == intval( $comment2['comment_post_ID'] )
|
| 676 |
+
&& $comment1['comment_author'] == $comment2['comment_author']
|
| 677 |
+
&& $comment1['comment_author_email'] == $comment2['comment_author_email']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 678 |
);
|
| 679 |
}
|
| 680 |
|
| 809 |
'timeout' => 15
|
| 810 |
);
|
| 811 |
|
| 812 |
+
$akismet_url = "http://{$http_host}/1.1/{$path}";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 813 |
$response = wp_remote_post( $akismet_url, $http_args );
|
|
|
|
| 814 |
Akismet::log( compact( 'akismet_url', 'http_args', 'response' ) );
|
| 815 |
+
if ( is_wp_error( $response ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 816 |
return array( '', '' );
|
|
|
|
| 817 |
|
| 818 |
+
return array( $response['headers'], $response['body'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 819 |
}
|
| 820 |
|
| 821 |
// given a response from an API call like check_key_status(), update the alert code options if an alert is present.
|
| 931 |
* @static
|
| 932 |
*/
|
| 933 |
public static function plugin_deactivation( ) {
|
| 934 |
+
//tidy up
|
| 935 |
}
|
| 936 |
|
| 937 |
/**
|
| 956 |
error_log( print_r( compact( 'akismet_debug' ), true ) );
|
| 957 |
}
|
| 958 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 959 |
}
|
readme.txt
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
=== Akismet ===
|
| 2 |
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
|
| 3 |
-
Tags: akismet, comments, spam
|
| 4 |
-
Requires at least: 3.
|
| 5 |
-
Tested up to: 4.
|
| 6 |
-
Stable tag: 3.
|
| 7 |
License: GPLv2 or later
|
| 8 |
|
| 9 |
Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
|
|
@@ -30,40 +30,10 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
|
|
| 30 |
|
| 31 |
== Changelog ==
|
| 32 |
|
| 33 |
-
= 3.
|
| 34 |
-
*Release Date -
|
| 35 |
|
| 36 |
-
*
|
| 37 |
-
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
|
| 38 |
-
* Error messages and instructions have been simplified to be more understandable.
|
| 39 |
-
* Link previews are enabled for all links inside comments, not just the author's website link.
|
| 40 |
-
|
| 41 |
-
= 3.1.3 =
|
| 42 |
-
*Release Date - 6 July 2015*
|
| 43 |
-
|
| 44 |
-
* 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.
|
| 45 |
-
|
| 46 |
-
= 3.1.2 =
|
| 47 |
-
*Release Date - 7 June 2015*
|
| 48 |
-
|
| 49 |
-
* Reduced the amount of space Akismet uses in the commentmeta table.
|
| 50 |
-
* Fixed a bug where some comments with quotes in the author name weren't getting history entries
|
| 51 |
-
* Pre-emptive security improvements to ensure that the Akismet plugin can't be used by attackers to compromise a WordPress installation.
|
| 52 |
-
* 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.
|
| 53 |
-
* When deactivating the plugin, notify the Akismet API so the site can be marked as inactive.
|
| 54 |
-
* Clearer error messages.
|
| 55 |
-
|
| 56 |
-
= 3.1.1 =
|
| 57 |
-
*Release Date - 17th March, 2015*
|
| 58 |
-
|
| 59 |
-
* Improvements to the "Remove comment author URL" JavaScript
|
| 60 |
-
* Include the pingback pre-check from the 2.6 branch.
|
| 61 |
-
|
| 62 |
-
= 3.1 =
|
| 63 |
-
*Release Date - 11th March, 2015*
|
| 64 |
-
|
| 65 |
-
* Use HTTPS by default for all requests to Akismet.
|
| 66 |
-
* Fix for a situation where Akismet might strip HTML from a comment.
|
| 67 |
|
| 68 |
= 3.0.4 =
|
| 69 |
*Release Date - 11th December, 2014*
|
| 1 |
=== Akismet ===
|
| 2 |
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs
|
| 3 |
+
Tags: akismet, comments, spam
|
| 4 |
+
Requires at least: 3.1
|
| 5 |
+
Tested up to: 4.1
|
| 6 |
+
Stable tag: 3.0.4
|
| 7 |
License: GPLv2 or later
|
| 8 |
|
| 9 |
Akismet checks your comments against the Akismet Web service to see if they look like spam or not.
|
| 30 |
|
| 31 |
== Changelog ==
|
| 32 |
|
| 33 |
+
= 3.0.5 =
|
| 34 |
+
*Release Date - 13 October 2015*
|
| 35 |
|
| 36 |
+
* Closes a potential XSS vulnerability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
= 3.0.4 =
|
| 39 |
*Release Date - 11th December, 2014*
|
views/config.php
CHANGED
|
@@ -64,43 +64,13 @@
|
|
| 64 |
<tbody>
|
| 65 |
<?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
|
| 66 |
<tr>
|
| 67 |
-
<th
|
| 68 |
<td width="5%"/>
|
| 69 |
<td align="left">
|
| 70 |
-
<span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $akismet_user->status;?>"></span>
|
| 71 |
</td>
|
| 72 |
</tr>
|
| 73 |
<?php endif; ?>
|
| 74 |
-
<?php if ( isset( $_GET['ssl_status'] ) ) { ?>
|
| 75 |
-
<tr>
|
| 76 |
-
<th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
|
| 77 |
-
<td></td>
|
| 78 |
-
<td align="left">
|
| 79 |
-
<p>
|
| 80 |
-
<?php
|
| 81 |
-
|
| 82 |
-
if ( ! function_exists( 'wp_http_supports' ) ) {
|
| 83 |
-
?><b><?php esc_html_e( 'Disabled.', 'akismet' ); ?></b> <?php printf( esc_html( 'Your WordPress installation does not include the function %s; upgrade to the latest version of WordPress.', 'akismet' ), '<code>wp_http_supports</code>' ); ?><?php
|
| 84 |
-
}
|
| 85 |
-
else if ( ! wp_http_supports( array( 'ssl' ) ) ) {
|
| 86 |
-
?><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
|
| 87 |
-
}
|
| 88 |
-
else {
|
| 89 |
-
$ssl_disabled = get_option( 'akismet_ssl_disabled' );
|
| 90 |
-
|
| 91 |
-
if ( $ssl_disabled ) {
|
| 92 |
-
?><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
|
| 93 |
-
}
|
| 94 |
-
else {
|
| 95 |
-
?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
|
| 96 |
-
}
|
| 97 |
-
}
|
| 98 |
-
|
| 99 |
-
?>
|
| 100 |
-
</p>
|
| 101 |
-
</td>
|
| 102 |
-
</tr>
|
| 103 |
-
<?php } ?>
|
| 104 |
<tr>
|
| 105 |
<th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
|
| 106 |
<td></td>
|
|
@@ -125,7 +95,7 @@
|
|
| 125 |
|
| 126 |
printf(
|
| 127 |
_n(
|
| 128 |
-
'Spam in the <a href="%
|
| 129 |
'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
|
| 130 |
$delete_interval,
|
| 131 |
'akismet'
|
| 64 |
<tbody>
|
| 65 |
<?php if ( !defined( 'WPCOM_API_KEY' ) ):?>
|
| 66 |
<tr>
|
| 67 |
+
<th width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
|
| 68 |
<td width="5%"/>
|
| 69 |
<td align="left">
|
| 70 |
+
<span class="api-key"><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $akismet_user->status;?>"></span>
|
| 71 |
</td>
|
| 72 |
</tr>
|
| 73 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
<tr>
|
| 75 |
<th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
|
| 76 |
<td></td>
|
| 95 |
|
| 96 |
printf(
|
| 97 |
_n(
|
| 98 |
+
'Spam in the <a href="%s">spam folder</a> older than 1 day is deleted automatically.',
|
| 99 |
'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
|
| 100 |
$delete_interval,
|
| 101 |
'akismet'
|
views/get.php
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
|
| 2 |
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
|
| 3 |
-
<input type="hidden" name="blog" value="<?php echo esc_url( get_bloginfo('url') ); ?>"/>
|
| 4 |
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
|
| 5 |
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
|
| 6 |
</form>
|
| 1 |
<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
|
| 2 |
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
|
|
|
|
| 3 |
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
|
| 4 |
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'button button-primary';?>" value="<?php echo esc_attr( $text ); ?>"/>
|
| 5 |
</form>
|
views/notice.php
CHANGED
|
@@ -11,7 +11,7 @@
|
|
| 11 |
<div class="aa_button"><?php esc_html_e('Activate your Akismet account', 'akismet');?></div>
|
| 12 |
</div>
|
| 13 |
</div>
|
| 14 |
-
<div class="aa_description"><?php _e('<strong>Almost done</strong> - activate
|
| 15 |
</div>
|
| 16 |
</form>
|
| 17 |
</div>
|
|
@@ -40,26 +40,26 @@
|
|
| 40 |
<?php elseif ( $type == 'missing-functions' ) :?>
|
| 41 |
<div class="wrap alert critical">
|
| 42 |
<h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
|
| 43 |
-
<p class="description"><?php printf( __('Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code>
|
| 44 |
</div>
|
| 45 |
<?php elseif ( $type == 'servers-be-down' ) :?>
|
| 46 |
<div class="wrap alert critical">
|
| 47 |
-
<h3 class="key-status failed"><?php esc_html_e("
|
| 48 |
-
<p class="description"><?php printf( __('Your firewall may be blocking
|
| 49 |
</div>
|
| 50 |
<?php elseif ( $type == 'active-dunning' ) :?>
|
| 51 |
<div class="wrap alert critical">
|
| 52 |
-
<h3 class="key-status"><?php esc_html_e("Please update your payment
|
| 53 |
-
<p class="description"><?php printf( __('We cannot process your
|
| 54 |
</div>
|
| 55 |
<?php elseif ( $type == 'cancelled' ) :?>
|
| 56 |
<div class="wrap alert critical">
|
| 57 |
-
<h3 class="key-status"><?php esc_html_e("Your
|
| 58 |
-
<p class="description"><?php printf( __('Please visit
|
| 59 |
</div>
|
| 60 |
<?php elseif ( $type == 'suspended' ) :?>
|
| 61 |
<div class="wrap alert critical">
|
| 62 |
-
<h3 class="key-status failed"><?php esc_html_e("Your
|
| 63 |
<p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
|
| 64 |
</div>
|
| 65 |
<?php elseif ( $type == 'active-notice' && $time_saved ) :?>
|
|
@@ -69,51 +69,34 @@
|
|
| 69 |
</div>
|
| 70 |
<?php elseif ( $type == 'missing' ) :?>
|
| 71 |
<div class="wrap alert critical">
|
| 72 |
-
<h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your
|
| 73 |
<p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
|
| 74 |
</div>
|
| 75 |
<?php elseif ( $type == 'no-sub' ) :?>
|
| 76 |
<div class="wrap alert critical">
|
| 77 |
-
<h3 class="key-status failed"><?php esc_html_e( '
|
| 78 |
-
<p class="description">
|
| 79 |
-
<?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’d appreciate it if you’d <a href="%s" target="_blank">sign into your account</a> and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>
|
| 80 |
-
<br /><br />
|
| 81 |
-
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
|
| 82 |
-
</p>
|
| 83 |
</div>
|
| 84 |
<?php elseif ( $type == 'new-key-valid' ) :?>
|
| 85 |
<div class="wrap alert active">
|
| 86 |
-
<h3 class="key-status"><?php esc_html_e('Akismet
|
| 87 |
</div>
|
| 88 |
<?php elseif ( $type == 'new-key-invalid' ) :?>
|
| 89 |
<div class="wrap alert critical">
|
| 90 |
<h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
|
| 91 |
</div>
|
| 92 |
-
<?php elseif ( $type == 'existing-key-invalid' ) :?>
|
| 93 |
-
<div class="wrap alert critical">
|
| 94 |
-
<h3 class="key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
|
| 95 |
-
</div>
|
| 96 |
<?php elseif ( $type == 'new-key-failed' ) :?>
|
| 97 |
<div class="wrap alert critical">
|
| 98 |
-
<h3 class="key-status"><?php esc_html_e( 'The
|
| 99 |
-
<p class="description"><?php printf( __('The connection to akismet.com could not be established. Please refer to <a href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
| 100 |
</div>
|
| 101 |
<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
|
| 102 |
<div class="wrap alert critical">
|
| 103 |
<?php if ( $level == 'yellow' ): ?>
|
| 104 |
-
<h3 class="key-status failed"><?php esc_html_e(
|
| 105 |
-
<p class="description">
|
| 106 |
-
<?php printf( __( 'Your Pro subscription allows the use of Akismet on only one site. Please <a href="%s" target="_blank">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'http://docs.akismet.com/billing/add-more-sites/' ); ?>
|
| 107 |
-
<br /><br />
|
| 108 |
-
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
|
| 109 |
-
</p>
|
| 110 |
<?php elseif ( $level == 'red' ): ?>
|
| 111 |
-
<h3 class="key-status failed"><?php esc_html_e(
|
| 112 |
-
<p class="description">
|
| 113 |
-
<?php printf( __( 'To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?></p>
|
| 114 |
-
<br /><br />
|
| 115 |
-
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?></p>
|
| 116 |
-
</p>
|
| 117 |
<?php endif; ?>
|
| 118 |
</div>
|
| 119 |
-
<?php endif;?>
|
| 11 |
<div class="aa_button"><?php esc_html_e('Activate your Akismet account', 'akismet');?></div>
|
| 12 |
</div>
|
| 13 |
</div>
|
| 14 |
+
<div class="aa_description"><?php _e('<strong>Almost done</strong> - activate your account and say goodbye to comment spam', 'akismet');?></div>
|
| 15 |
</div>
|
| 16 |
</form>
|
| 17 |
</div>
|
| 40 |
<?php elseif ( $type == 'missing-functions' ) :?>
|
| 41 |
<div class="wrap alert critical">
|
| 42 |
<h3 class="key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
|
| 43 |
+
<p class="description"><?php printf( __('Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet’s system requirements</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
| 44 |
</div>
|
| 45 |
<?php elseif ( $type == 'servers-be-down' ) :?>
|
| 46 |
<div class="wrap alert critical">
|
| 47 |
+
<h3 class="key-status failed"><?php esc_html_e("We can’t connect to your site.", 'akismet'); ?></h3>
|
| 48 |
+
<p class="description"><?php printf( __('Your firewall may be blocking us. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
| 49 |
</div>
|
| 50 |
<?php elseif ( $type == 'active-dunning' ) :?>
|
| 51 |
<div class="wrap alert critical">
|
| 52 |
+
<h3 class="key-status"><?php esc_html_e("Please update your payment details.", 'akismet'); ?></h3>
|
| 53 |
+
<p class="description"><?php printf( __('We cannot process your transaction. Please contact your bank for assistance, and <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
|
| 54 |
</div>
|
| 55 |
<?php elseif ( $type == 'cancelled' ) :?>
|
| 56 |
<div class="wrap alert critical">
|
| 57 |
+
<h3 class="key-status"><?php esc_html_e("Your subscription is cancelled.", 'akismet'); ?></h3>
|
| 58 |
+
<p class="description"><?php printf( __('Please visit the <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
|
| 59 |
</div>
|
| 60 |
<?php elseif ( $type == 'suspended' ) :?>
|
| 61 |
<div class="wrap alert critical">
|
| 62 |
+
<h3 class="key-status failed"><?php esc_html_e("Your subscription is suspended.", 'akismet'); ?></h3>
|
| 63 |
<p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
|
| 64 |
</div>
|
| 65 |
<?php elseif ( $type == 'active-notice' && $time_saved ) :?>
|
| 69 |
</div>
|
| 70 |
<?php elseif ( $type == 'missing' ) :?>
|
| 71 |
<div class="wrap alert critical">
|
| 72 |
+
<h3 class="key-status failed"><?php esc_html_e( 'There is a problem with your key.', 'akismet'); ?></h3>
|
| 73 |
<p class="description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
|
| 74 |
</div>
|
| 75 |
<?php elseif ( $type == 'no-sub' ) :?>
|
| 76 |
<div class="wrap alert critical">
|
| 77 |
+
<h3 class="key-status failed"><?php esc_html_e( 'Your subscription is missing.', 'akismet'); ?></h3>
|
| 78 |
+
<p class="description"><?php printf( __('Since 2012, Akismet began using subscriptions for all accounts (even free ones). It looks like a subscription has not been assigned to your account, and we’d appreciate it if you’d <a href="%s" target="_blank">sign into your account</a> and choose one. Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/' ); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
</div>
|
| 80 |
<?php elseif ( $type == 'new-key-valid' ) :?>
|
| 81 |
<div class="wrap alert active">
|
| 82 |
+
<h3 class="key-status"><?php esc_html_e('Your Akismet account has been successfully set up and activated. Happy blogging!', 'akismet'); ?></h3>
|
| 83 |
</div>
|
| 84 |
<?php elseif ( $type == 'new-key-invalid' ) :?>
|
| 85 |
<div class="wrap alert critical">
|
| 86 |
<h3 class="key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
|
| 87 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
<?php elseif ( $type == 'new-key-failed' ) :?>
|
| 89 |
<div class="wrap alert critical">
|
| 90 |
+
<h3 class="key-status"><?php esc_html_e( 'The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.' , 'akismet'); ?></h3>
|
|
|
|
| 91 |
</div>
|
| 92 |
<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
|
| 93 |
<div class="wrap alert critical">
|
| 94 |
<?php if ( $level == 'yellow' ): ?>
|
| 95 |
+
<h3 class="key-status failed"><?php esc_html_e("You're using your Akismet key on more sites than your Pro subscription allows.", 'akismet'); ?></h3>
|
| 96 |
+
<p class="description"><?php printf( __('If you would like to use Akismet on more than 10 sites, you will need to <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>. If you have any questions, please <a href="%s" target="_blank">get in touch with our support team</a>', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
<?php elseif ( $level == 'red' ): ?>
|
| 98 |
+
<h3 class="key-status failed"><?php esc_html_e("You're using Akismet on far too many sites for your Pro subscription.", 'akismet'); ?></h3>
|
| 99 |
+
<p class="description"><?php printf( __('To continue your service, <a href="%s" target="_blank">upgrade to an Enterprise subscription</a>, which covers an unlimited number of sites. Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet'), 'https://akismet.com/account/upgrade/', 'https://akismet.com/contact/'); ?></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
<?php endif; ?>
|
| 101 |
</div>
|
| 102 |
+
<?php endif;?>
|
views/start.php
CHANGED
|
@@ -1,83 +1,81 @@
|
|
| 1 |
<div class="no-key config-wrap"><?php
|
| 2 |
if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
|
| 3 |
-
if (
|
| 4 |
-
<p><?php esc_html_e('Akismet eliminates spam
|
| 5 |
<div class="activate-highlight activate-option">
|
| 6 |
<div class="option-description">
|
| 7 |
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
|
| 8 |
-
<?php echo
|
| 9 |
</div>
|
| 10 |
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
|
| 11 |
-
<input type="hidden" name="passback_url" value="<?php echo
|
| 12 |
-
<input type="hidden" name="blog" value="<?php echo esc_url( get_bloginfo('url') ); ?>"/>
|
| 13 |
<input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
|
| 14 |
<input type="hidden" name="redirect" value="plugin-signup"/>
|
| 15 |
-
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register
|
| 16 |
</form>
|
| 17 |
</div>
|
| 18 |
<?php elseif ( $akismet_user->status == 'cancelled' ) :?>
|
| 19 |
-
<p><?php esc_html_e('Akismet eliminates spam
|
| 20 |
<div class="activate-highlight activate-option">
|
| 21 |
<div class="option-description" style="width:75%;">
|
| 22 |
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
|
| 23 |
<?php printf( esc_html__( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ); ?>
|
| 24 |
</div>
|
| 25 |
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
|
| 26 |
-
<input type="hidden" name="passback_url" value="<?php echo
|
| 27 |
-
<input type="hidden" name="blog" value="<?php echo esc_url( get_bloginfo('url') ); ?>"/>
|
| 28 |
<input type="hidden" name="user_id" value="<?php echo $akismet_user->ID;?>"/>
|
| 29 |
<input type="hidden" name="redirect" value="upgrade"/>
|
| 30 |
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
|
| 31 |
</form>
|
| 32 |
</div>
|
| 33 |
<?php elseif ( $akismet_user->status == 'suspended' ) : ?>
|
| 34 |
-
<p><?php esc_html_e('Akismet eliminates spam
|
| 35 |
<div class="activate-highlight centered activate-option">
|
| 36 |
<strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
|
| 37 |
<h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
|
| 38 |
-
<p><?php esc_html_e('No worries! Get in touch and we’ll sort this out.', 'akismet'); ?></p>
|
| 39 |
<a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
|
| 40 |
</div>
|
| 41 |
<?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
|
| 42 |
-
<p style="margin-right:10px"><?php esc_html_e('Akismet eliminates spam
|
| 43 |
<div class="activate-highlight activate-option">
|
| 44 |
<div class="option-description">
|
| 45 |
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
|
| 46 |
-
<?php echo
|
| 47 |
</div>
|
| 48 |
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
|
| 49 |
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
|
| 50 |
<input type="hidden" name="action" value="enter-key">
|
| 51 |
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
|
| 52 |
-
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this account' , 'akismet'); ?>"/>
|
| 53 |
</form>
|
| 54 |
</div>
|
| 55 |
<?php endif;?>
|
| 56 |
<div class="activate-highlight secondary activate-option">
|
| 57 |
<div class="option-description">
|
| 58 |
-
<strong><?php esc_html_e('
|
| 59 |
-
<p><?php esc_html_e('Use this option
|
| 60 |
</div>
|
| 61 |
-
<?php Akismet::view( 'get', array( 'text' => __( '
|
| 62 |
</div>
|
| 63 |
<div class="activate-highlight secondary activate-option">
|
| 64 |
<div class="option-description">
|
| 65 |
-
<strong><?php esc_html_e('
|
| 66 |
-
<p><?php esc_html_e('
|
| 67 |
</div>
|
| 68 |
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
|
| 69 |
-
<input id="key" name="key" type="text" size="15" value="" class="regular-text code">
|
| 70 |
<input type="hidden" name="action" value="enter-key">
|
| 71 |
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
|
| 72 |
<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
|
| 73 |
</form>
|
| 74 |
</div>
|
| 75 |
<?php else :?>
|
| 76 |
-
<p><?php esc_html_e('Akismet eliminates spam
|
| 77 |
<div class="activate-highlight activate-option">
|
| 78 |
<div class="option-description">
|
| 79 |
<strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
|
| 80 |
-
<p><?php esc_html_e('Log in or
|
| 81 |
</div>
|
| 82 |
<?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
|
| 83 |
</div>
|
|
@@ -87,7 +85,7 @@
|
|
| 87 |
<p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
|
| 88 |
</div>
|
| 89 |
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
|
| 90 |
-
<input id="key" name="key" type="text" size="15"
|
| 91 |
<input type="hidden" name="action" value="enter-key">
|
| 92 |
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
| 93 |
<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
|
| 1 |
<div class="no-key config-wrap"><?php
|
| 2 |
if ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) :
|
| 3 |
+
if ( $akismet_user->status == 'missing' ) :?>
|
| 4 |
+
<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. Register your email address below to get started.', 'akismet'); ?></p>
|
| 5 |
<div class="activate-highlight activate-option">
|
| 6 |
<div class="option-description">
|
| 7 |
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
|
| 8 |
+
<?php echo esc_attr( $akismet_user->user_email ); ?>
|
| 9 |
</div>
|
| 10 |
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
|
| 11 |
+
<input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
|
|
|
|
| 12 |
<input type="hidden" name="auto-connect" value="<?php echo $akismet_user->ID;?>"/>
|
| 13 |
<input type="hidden" name="redirect" value="plugin-signup"/>
|
| 14 |
+
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Register Akismet' , 'akismet'); ?>"/>
|
| 15 |
</form>
|
| 16 |
</div>
|
| 17 |
<?php elseif ( $akismet_user->status == 'cancelled' ) :?>
|
| 18 |
+
<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
|
| 19 |
<div class="activate-highlight activate-option">
|
| 20 |
<div class="option-description" style="width:75%;">
|
| 21 |
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
|
| 22 |
<?php printf( esc_html__( 'Your subscription for %s is cancelled' , 'akismet'), $akismet_user->user_email ); ?>
|
| 23 |
</div>
|
| 24 |
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="right" target="_blank">
|
| 25 |
+
<input type="hidden" name="passback_url" value="<?php echo esc_attr( Akismet_Admin::get_page_url() ); ?>"/>
|
|
|
|
| 26 |
<input type="hidden" name="user_id" value="<?php echo $akismet_user->ID;?>"/>
|
| 27 |
<input type="hidden" name="redirect" value="upgrade"/>
|
| 28 |
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Reactivate Akismet' , 'akismet'); ?>"/>
|
| 29 |
</form>
|
| 30 |
</div>
|
| 31 |
<?php elseif ( $akismet_user->status == 'suspended' ) : ?>
|
| 32 |
+
<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site.', 'akismet'); ?></p>
|
| 33 |
<div class="activate-highlight centered activate-option">
|
| 34 |
<strong class="small-heading"><?php esc_html_e( 'Connected via Jetpack' , 'akismet'); ?></strong>
|
| 35 |
<h3 class="alert-text"><?php printf( esc_html__( 'Your subscription for %s is suspended' , 'akismet'), $akismet_user->user_email ); ?></h3>
|
| 36 |
+
<p><?php esc_html_e('No worries! Get in touch and we’ll help sort this out.', 'akismet'); ?></p>
|
| 37 |
<a href="https://akismet.com/contact" class="button button-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet'); ?></a>
|
| 38 |
</div>
|
| 39 |
<?php else : // ask do they want to use akismet account found using jetpack wpcom connection ?>
|
| 40 |
+
<p style="margin-right:10px"><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
|
| 41 |
<div class="activate-highlight activate-option">
|
| 42 |
<div class="option-description">
|
| 43 |
<strong class="small-heading"><?php esc_html_e('Connected via Jetpack', 'akismet'); ?></strong>
|
| 44 |
+
<?php echo esc_attr( $akismet_user->user_email ); ?>
|
| 45 |
</div>
|
| 46 |
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="right">
|
| 47 |
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
|
| 48 |
<input type="hidden" name="action" value="enter-key">
|
| 49 |
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
|
| 50 |
+
<input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Use this Akismet account' , 'akismet'); ?>"/>
|
| 51 |
</form>
|
| 52 |
</div>
|
| 53 |
<?php endif;?>
|
| 54 |
<div class="activate-highlight secondary activate-option">
|
| 55 |
<div class="option-description">
|
| 56 |
+
<strong><?php esc_html_e('Create a new API key with a different email address', 'akismet'); ?></strong>
|
| 57 |
+
<p><?php esc_html_e('Use this option if you want to setup a new Akismet account.', 'akismet'); ?></p>
|
| 58 |
</div>
|
| 59 |
+
<?php Akismet::view( 'get', array( 'text' => __( 'Register a different email address' , 'akismet'), 'classes' => array( 'right', 'button', 'button-secondary' ) ) ); ?>
|
| 60 |
</div>
|
| 61 |
<div class="activate-highlight secondary activate-option">
|
| 62 |
<div class="option-description">
|
| 63 |
+
<strong><?php esc_html_e('Manually enter an API key', 'akismet'); ?></strong>
|
| 64 |
+
<p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
|
| 65 |
</div>
|
| 66 |
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
|
| 67 |
+
<input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
|
| 68 |
<input type="hidden" name="action" value="enter-key">
|
| 69 |
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
|
| 70 |
<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
|
| 71 |
</form>
|
| 72 |
</div>
|
| 73 |
<?php else :?>
|
| 74 |
+
<p><?php esc_html_e('Akismet eliminates the comment and trackback spam you get on your site. To setup Akismet, select one of the options below.', 'akismet'); ?></p>
|
| 75 |
<div class="activate-highlight activate-option">
|
| 76 |
<div class="option-description">
|
| 77 |
<strong><?php esc_html_e( 'Activate Akismet' , 'akismet');?></strong>
|
| 78 |
+
<p><?php esc_html_e('Log in or create an account to get your API key.', 'akismet'); ?></p>
|
| 79 |
</div>
|
| 80 |
<?php Akismet::view( 'get', array( 'text' => __( 'Get your API key' , 'akismet'), 'classes' => array( 'right', 'button', 'button-primary' ) ) ); ?>
|
| 81 |
</div>
|
| 85 |
<p><?php esc_html_e('If you already know your API key.', 'akismet'); ?></p>
|
| 86 |
</div>
|
| 87 |
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-enter-api-key" class="right">
|
| 88 |
+
<input id="key" name="key" type="text" size="15" maxlength="12" value="" class="regular-text code">
|
| 89 |
<input type="hidden" name="action" value="enter-key">
|
| 90 |
<?php wp_nonce_field( Akismet_Admin::NONCE ); ?>
|
| 91 |
<input type="submit" name="submit" id="submit" class="button button-secondary" value="<?php esc_attr_e('Use this key', 'akismet');?>">
|
views/strict.php
CHANGED
|
@@ -1,17 +1,7 @@
|
|
| 1 |
-
<
|
| 2 |
-
<
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
<p>
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
<?php esc_html_e( 'Strict: silently discard the worst and most pervasive spam.', 'akismet' ); ?>
|
| 9 |
-
</label>
|
| 10 |
-
</p>
|
| 11 |
-
<p>
|
| 12 |
-
<label for="akismet_strictness_0">
|
| 13 |
-
<input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked( '0', get_option( 'akismet_strictness' ) ); ?> />
|
| 14 |
-
<?php esc_html_e( 'Safe: always put spam in the Spam folder for review.', 'akismet' ); ?>
|
| 15 |
-
</label>
|
| 16 |
-
</p>
|
| 17 |
-
</fieldset>
|
| 1 |
+
<tr valign="top">
|
| 2 |
+
<th scope="row"><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></th>
|
| 3 |
+
<td><fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
|
| 4 |
+
<p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Strict: silently discard the worst and most pervasive spam.', 'akismet'); ?></label></p>
|
| 5 |
+
<p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Safe: always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
|
| 6 |
+
</fieldset></td>
|
| 7 |
+
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wrapper.php
CHANGED
|
@@ -7,32 +7,46 @@ $akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com';
|
|
| 7 |
$akismet_api_port = 80;
|
| 8 |
|
| 9 |
function akismet_test_mode() {
|
|
|
|
|
|
|
| 10 |
return Akismet::is_test_mode();
|
| 11 |
}
|
| 12 |
|
| 13 |
function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {
|
|
|
|
|
|
|
| 14 |
$path = str_replace( '/1.1/', '', $path );
|
| 15 |
|
| 16 |
return Akismet::http_post( $request, $path, $ip );
|
| 17 |
}
|
| 18 |
|
| 19 |
function akismet_microtime() {
|
|
|
|
|
|
|
| 20 |
return Akismet::_get_microtime();
|
| 21 |
}
|
| 22 |
|
| 23 |
function akismet_delete_old() {
|
|
|
|
|
|
|
| 24 |
return Akismet::delete_old_comments();
|
| 25 |
}
|
| 26 |
|
| 27 |
function akismet_delete_old_metadata() {
|
|
|
|
|
|
|
| 28 |
return Akismet::delete_old_comments_meta();
|
| 29 |
}
|
| 30 |
|
| 31 |
function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
|
|
|
|
|
|
|
| 32 |
return Akismet::check_db_comment( $id, $recheck_reason );
|
| 33 |
}
|
| 34 |
|
| 35 |
function akismet_rightnow() {
|
|
|
|
|
|
|
| 36 |
if ( !class_exists( 'Akismet_Admin' ) )
|
| 37 |
return false;
|
| 38 |
|
|
@@ -49,9 +63,13 @@ function akismet_load_js_and_css() {
|
|
| 49 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 50 |
}
|
| 51 |
function akismet_nonce_field( $action = -1 ) {
|
|
|
|
|
|
|
| 52 |
return wp_nonce_field( $action );
|
| 53 |
}
|
| 54 |
function akismet_plugin_action_links( $links, $file ) {
|
|
|
|
|
|
|
| 55 |
return Akismet_Admin::plugin_action_links( $links, $file );
|
| 56 |
}
|
| 57 |
function akismet_conf() {
|
|
@@ -61,15 +79,21 @@ function akismet_stats_display() {
|
|
| 61 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 62 |
}
|
| 63 |
function akismet_stats() {
|
|
|
|
|
|
|
| 64 |
return Akismet_Admin::dashboard_stats();
|
| 65 |
}
|
| 66 |
function akismet_admin_warnings() {
|
| 67 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 68 |
}
|
| 69 |
function akismet_comment_row_action( $a, $comment ) {
|
|
|
|
|
|
|
| 70 |
return Akismet_Admin::comment_row_actions( $a, $comment );
|
| 71 |
}
|
| 72 |
function akismet_comment_status_meta_box( $comment ) {
|
|
|
|
|
|
|
| 73 |
return Akismet_Admin::comment_status_meta_box( $comment );
|
| 74 |
}
|
| 75 |
function akismet_comments_columns( $columns ) {
|
|
@@ -81,39 +105,63 @@ function akismet_comment_column_row( $column, $comment_id ) {
|
|
| 81 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 82 |
}
|
| 83 |
function akismet_text_add_link_callback( $m ) {
|
|
|
|
|
|
|
| 84 |
return Akismet_Admin::text_add_link_callback( $m );
|
| 85 |
}
|
| 86 |
function akismet_text_add_link_class( $comment_text ) {
|
|
|
|
|
|
|
| 87 |
return Akismet_Admin::text_add_link_class( $comment_text );
|
| 88 |
}
|
| 89 |
function akismet_check_for_spam_button( $comment_status ) {
|
|
|
|
|
|
|
| 90 |
return Akismet_Admin::check_for_spam_button( $comment_status );
|
| 91 |
}
|
| 92 |
function akismet_submit_nonspam_comment( $comment_id ) {
|
|
|
|
|
|
|
| 93 |
return Akismet::submit_nonspam_comment( $comment_id );
|
| 94 |
}
|
| 95 |
function akismet_submit_spam_comment( $comment_id ) {
|
|
|
|
|
|
|
| 96 |
return Akismet::submit_spam_comment( $comment_id );
|
| 97 |
}
|
| 98 |
function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
|
|
|
|
|
|
|
| 99 |
return Akismet::transition_comment_status( $new_status, $old_status, $comment );
|
| 100 |
}
|
| 101 |
function akismet_spam_count( $type = false ) {
|
|
|
|
|
|
|
| 102 |
return Akismet_Admin::get_spam_count( $type );
|
| 103 |
}
|
| 104 |
function akismet_recheck_queue() {
|
|
|
|
|
|
|
| 105 |
return Akismet_Admin::recheck_queue();
|
| 106 |
}
|
| 107 |
function akismet_remove_comment_author_url() {
|
|
|
|
|
|
|
| 108 |
return Akismet_Admin::remove_comment_author_url();
|
| 109 |
}
|
| 110 |
function akismet_add_comment_author_url() {
|
|
|
|
|
|
|
| 111 |
return Akismet_Admin::add_comment_author_url();
|
| 112 |
}
|
| 113 |
function akismet_check_server_connectivity() {
|
|
|
|
|
|
|
| 114 |
return Akismet_Admin::check_server_connectivity();
|
| 115 |
}
|
| 116 |
function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
|
|
|
|
|
|
|
| 117 |
return Akismet_Admin::get_server_connectivity( $cache_timeout );
|
| 118 |
}
|
| 119 |
function akismet_server_connectivity_ok() {
|
|
@@ -122,63 +170,101 @@ function akismet_server_connectivity_ok() {
|
|
| 122 |
return true;
|
| 123 |
}
|
| 124 |
function akismet_admin_menu() {
|
|
|
|
|
|
|
| 125 |
return Akismet_Admin::admin_menu();
|
| 126 |
}
|
| 127 |
function akismet_load_menu() {
|
|
|
|
|
|
|
| 128 |
return Akismet_Admin::load_menu();
|
| 129 |
}
|
| 130 |
function akismet_init() {
|
| 131 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 132 |
}
|
| 133 |
function akismet_get_key() {
|
|
|
|
|
|
|
| 134 |
return Akismet::get_api_key();
|
| 135 |
}
|
| 136 |
function akismet_check_key_status( $key, $ip = null ) {
|
|
|
|
|
|
|
| 137 |
return Akismet::check_key_status( $key, $ip );
|
| 138 |
}
|
| 139 |
function akismet_update_alert( $response ) {
|
|
|
|
|
|
|
| 140 |
return Akismet::update_alert( $response );
|
| 141 |
}
|
| 142 |
function akismet_verify_key( $key, $ip = null ) {
|
|
|
|
|
|
|
| 143 |
return Akismet::verify_key( $key, $ip );
|
| 144 |
}
|
| 145 |
function akismet_get_user_roles( $user_id ) {
|
|
|
|
|
|
|
| 146 |
return Akismet::get_user_roles( $user_id );
|
| 147 |
}
|
| 148 |
function akismet_result_spam( $approved ) {
|
|
|
|
|
|
|
| 149 |
return Akismet::comment_is_spam( $approved );
|
| 150 |
}
|
| 151 |
function akismet_result_hold( $approved ) {
|
|
|
|
|
|
|
| 152 |
return Akismet::comment_needs_moderation( $approved );
|
| 153 |
}
|
| 154 |
function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
|
|
|
|
|
|
|
| 155 |
return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );
|
| 156 |
}
|
| 157 |
function akismet_update_comment_history( $comment_id, $message, $event = null ) {
|
|
|
|
|
|
|
| 158 |
return Akismet::update_comment_history( $comment_id, $message, $event );
|
| 159 |
}
|
| 160 |
function akismet_get_comment_history( $comment_id ) {
|
|
|
|
|
|
|
| 161 |
return Akismet::get_comment_history( $comment_id );
|
| 162 |
}
|
| 163 |
function akismet_cmp_time( $a, $b ) {
|
|
|
|
|
|
|
| 164 |
return Akismet::_cmp_time( $a, $b );
|
| 165 |
}
|
| 166 |
function akismet_auto_check_update_meta( $id, $comment ) {
|
|
|
|
|
|
|
| 167 |
return Akismet::auto_check_update_meta( $id, $comment );
|
| 168 |
}
|
| 169 |
function akismet_auto_check_comment( $commentdata ) {
|
|
|
|
|
|
|
| 170 |
return Akismet::auto_check_comment( $commentdata );
|
| 171 |
}
|
| 172 |
function akismet_get_ip_address() {
|
|
|
|
|
|
|
| 173 |
return Akismet::get_ip_address();
|
| 174 |
}
|
| 175 |
function akismet_cron_recheck() {
|
|
|
|
|
|
|
| 176 |
return Akismet::cron_recheck();
|
| 177 |
}
|
| 178 |
function akismet_add_comment_nonce() {
|
|
|
|
|
|
|
| 179 |
return Akismet::add_comment_nonce( $post_id );
|
| 180 |
}
|
| 181 |
function akismet_fix_scheduled_recheck() {
|
|
|
|
|
|
|
| 182 |
return Akismet::fix_scheduled_recheck();
|
| 183 |
}
|
| 184 |
function akismet_spam_comments() {
|
|
@@ -204,10 +290,4 @@ function akismet_kill_proxy_check( $option ) {
|
|
| 204 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 205 |
|
| 206 |
return 0;
|
| 207 |
-
}
|
| 208 |
-
function akismet_pingback_forwarded_for( $r, $url ) {
|
| 209 |
-
return Akismet::pingback_forwarded_for( $r, $url );
|
| 210 |
-
}
|
| 211 |
-
function akismet_pre_check_pingback( $method ) {
|
| 212 |
-
return Akismet::pre_check_pingback( $method );
|
| 213 |
}
|
| 7 |
$akismet_api_port = 80;
|
| 8 |
|
| 9 |
function akismet_test_mode() {
|
| 10 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::is_test_mode()' );
|
| 11 |
+
|
| 12 |
return Akismet::is_test_mode();
|
| 13 |
}
|
| 14 |
|
| 15 |
function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {
|
| 16 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::http_post()' );
|
| 17 |
+
|
| 18 |
$path = str_replace( '/1.1/', '', $path );
|
| 19 |
|
| 20 |
return Akismet::http_post( $request, $path, $ip );
|
| 21 |
}
|
| 22 |
|
| 23 |
function akismet_microtime() {
|
| 24 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::_get_microtime()' );
|
| 25 |
+
|
| 26 |
return Akismet::_get_microtime();
|
| 27 |
}
|
| 28 |
|
| 29 |
function akismet_delete_old() {
|
| 30 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::delete_old_comments()' );
|
| 31 |
+
|
| 32 |
return Akismet::delete_old_comments();
|
| 33 |
}
|
| 34 |
|
| 35 |
function akismet_delete_old_metadata() {
|
| 36 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::delete_old_comments_meta()' );
|
| 37 |
+
|
| 38 |
return Akismet::delete_old_comments_meta();
|
| 39 |
}
|
| 40 |
|
| 41 |
function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
|
| 42 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::check_db_comment()' );
|
| 43 |
+
|
| 44 |
return Akismet::check_db_comment( $id, $recheck_reason );
|
| 45 |
}
|
| 46 |
|
| 47 |
function akismet_rightnow() {
|
| 48 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::rightnow_stats()' );
|
| 49 |
+
|
| 50 |
if ( !class_exists( 'Akismet_Admin' ) )
|
| 51 |
return false;
|
| 52 |
|
| 63 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 64 |
}
|
| 65 |
function akismet_nonce_field( $action = -1 ) {
|
| 66 |
+
_deprecated_function( __FUNCTION__, '3.0', 'wp_nonce_field' );
|
| 67 |
+
|
| 68 |
return wp_nonce_field( $action );
|
| 69 |
}
|
| 70 |
function akismet_plugin_action_links( $links, $file ) {
|
| 71 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::plugin_action_links()' );
|
| 72 |
+
|
| 73 |
return Akismet_Admin::plugin_action_links( $links, $file );
|
| 74 |
}
|
| 75 |
function akismet_conf() {
|
| 79 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 80 |
}
|
| 81 |
function akismet_stats() {
|
| 82 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::dashboard_stats()' );
|
| 83 |
+
|
| 84 |
return Akismet_Admin::dashboard_stats();
|
| 85 |
}
|
| 86 |
function akismet_admin_warnings() {
|
| 87 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 88 |
}
|
| 89 |
function akismet_comment_row_action( $a, $comment ) {
|
| 90 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::comment_row_action()' );
|
| 91 |
+
|
| 92 |
return Akismet_Admin::comment_row_actions( $a, $comment );
|
| 93 |
}
|
| 94 |
function akismet_comment_status_meta_box( $comment ) {
|
| 95 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::comment_status_meta_box()' );
|
| 96 |
+
|
| 97 |
return Akismet_Admin::comment_status_meta_box( $comment );
|
| 98 |
}
|
| 99 |
function akismet_comments_columns( $columns ) {
|
| 105 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 106 |
}
|
| 107 |
function akismet_text_add_link_callback( $m ) {
|
| 108 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::text_add_link_callback()' );
|
| 109 |
+
|
| 110 |
return Akismet_Admin::text_add_link_callback( $m );
|
| 111 |
}
|
| 112 |
function akismet_text_add_link_class( $comment_text ) {
|
| 113 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::text_add_link_class()' );
|
| 114 |
+
|
| 115 |
return Akismet_Admin::text_add_link_class( $comment_text );
|
| 116 |
}
|
| 117 |
function akismet_check_for_spam_button( $comment_status ) {
|
| 118 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::check_for_spam_button()' );
|
| 119 |
+
|
| 120 |
return Akismet_Admin::check_for_spam_button( $comment_status );
|
| 121 |
}
|
| 122 |
function akismet_submit_nonspam_comment( $comment_id ) {
|
| 123 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::submit_nonspam_comment()' );
|
| 124 |
+
|
| 125 |
return Akismet::submit_nonspam_comment( $comment_id );
|
| 126 |
}
|
| 127 |
function akismet_submit_spam_comment( $comment_id ) {
|
| 128 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::submit_spam_comment()' );
|
| 129 |
+
|
| 130 |
return Akismet::submit_spam_comment( $comment_id );
|
| 131 |
}
|
| 132 |
function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
|
| 133 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::transition_comment_status()' );
|
| 134 |
+
|
| 135 |
return Akismet::transition_comment_status( $new_status, $old_status, $comment );
|
| 136 |
}
|
| 137 |
function akismet_spam_count( $type = false ) {
|
| 138 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::get_spam_count()' );
|
| 139 |
+
|
| 140 |
return Akismet_Admin::get_spam_count( $type );
|
| 141 |
}
|
| 142 |
function akismet_recheck_queue() {
|
| 143 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::recheck_queue()' );
|
| 144 |
+
|
| 145 |
return Akismet_Admin::recheck_queue();
|
| 146 |
}
|
| 147 |
function akismet_remove_comment_author_url() {
|
| 148 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::remove_comment_author_url()' );
|
| 149 |
+
|
| 150 |
return Akismet_Admin::remove_comment_author_url();
|
| 151 |
}
|
| 152 |
function akismet_add_comment_author_url() {
|
| 153 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::add_comment_author_url()' );
|
| 154 |
+
|
| 155 |
return Akismet_Admin::add_comment_author_url();
|
| 156 |
}
|
| 157 |
function akismet_check_server_connectivity() {
|
| 158 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::check_server_connectivity()' );
|
| 159 |
+
|
| 160 |
return Akismet_Admin::check_server_connectivity();
|
| 161 |
}
|
| 162 |
function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
|
| 163 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::()' );
|
| 164 |
+
|
| 165 |
return Akismet_Admin::get_server_connectivity( $cache_timeout );
|
| 166 |
}
|
| 167 |
function akismet_server_connectivity_ok() {
|
| 170 |
return true;
|
| 171 |
}
|
| 172 |
function akismet_admin_menu() {
|
| 173 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::admin_menu()' );
|
| 174 |
+
|
| 175 |
return Akismet_Admin::admin_menu();
|
| 176 |
}
|
| 177 |
function akismet_load_menu() {
|
| 178 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet_Admin::load_menu()' );
|
| 179 |
+
|
| 180 |
return Akismet_Admin::load_menu();
|
| 181 |
}
|
| 182 |
function akismet_init() {
|
| 183 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 184 |
}
|
| 185 |
function akismet_get_key() {
|
| 186 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_api_key()' );
|
| 187 |
+
|
| 188 |
return Akismet::get_api_key();
|
| 189 |
}
|
| 190 |
function akismet_check_key_status( $key, $ip = null ) {
|
| 191 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::check_key_status()' );
|
| 192 |
+
|
| 193 |
return Akismet::check_key_status( $key, $ip );
|
| 194 |
}
|
| 195 |
function akismet_update_alert( $response ) {
|
| 196 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::update_alert()' );
|
| 197 |
+
|
| 198 |
return Akismet::update_alert( $response );
|
| 199 |
}
|
| 200 |
function akismet_verify_key( $key, $ip = null ) {
|
| 201 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::verify_key()' );
|
| 202 |
+
|
| 203 |
return Akismet::verify_key( $key, $ip );
|
| 204 |
}
|
| 205 |
function akismet_get_user_roles( $user_id ) {
|
| 206 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_user_roles()' );
|
| 207 |
+
|
| 208 |
return Akismet::get_user_roles( $user_id );
|
| 209 |
}
|
| 210 |
function akismet_result_spam( $approved ) {
|
| 211 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::comment_is_spam()' );
|
| 212 |
+
|
| 213 |
return Akismet::comment_is_spam( $approved );
|
| 214 |
}
|
| 215 |
function akismet_result_hold( $approved ) {
|
| 216 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::comment_needs_moderation()' );
|
| 217 |
+
|
| 218 |
return Akismet::comment_needs_moderation( $approved );
|
| 219 |
}
|
| 220 |
function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
|
| 221 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_user_comments_approved()' );
|
| 222 |
+
|
| 223 |
return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );
|
| 224 |
}
|
| 225 |
function akismet_update_comment_history( $comment_id, $message, $event = null ) {
|
| 226 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::update_comment_history()' );
|
| 227 |
+
|
| 228 |
return Akismet::update_comment_history( $comment_id, $message, $event );
|
| 229 |
}
|
| 230 |
function akismet_get_comment_history( $comment_id ) {
|
| 231 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_comment_history()' );
|
| 232 |
+
|
| 233 |
return Akismet::get_comment_history( $comment_id );
|
| 234 |
}
|
| 235 |
function akismet_cmp_time( $a, $b ) {
|
| 236 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::_cmp_time()' );
|
| 237 |
+
|
| 238 |
return Akismet::_cmp_time( $a, $b );
|
| 239 |
}
|
| 240 |
function akismet_auto_check_update_meta( $id, $comment ) {
|
| 241 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::auto_check_update_meta()' );
|
| 242 |
+
|
| 243 |
return Akismet::auto_check_update_meta( $id, $comment );
|
| 244 |
}
|
| 245 |
function akismet_auto_check_comment( $commentdata ) {
|
| 246 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::auto_check_comment()' );
|
| 247 |
+
|
| 248 |
return Akismet::auto_check_comment( $commentdata );
|
| 249 |
}
|
| 250 |
function akismet_get_ip_address() {
|
| 251 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::get_ip_address()' );
|
| 252 |
+
|
| 253 |
return Akismet::get_ip_address();
|
| 254 |
}
|
| 255 |
function akismet_cron_recheck() {
|
| 256 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::cron_recheck()' );
|
| 257 |
+
|
| 258 |
return Akismet::cron_recheck();
|
| 259 |
}
|
| 260 |
function akismet_add_comment_nonce() {
|
| 261 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::add_comment_nonce()' );
|
| 262 |
+
|
| 263 |
return Akismet::add_comment_nonce( $post_id );
|
| 264 |
}
|
| 265 |
function akismet_fix_scheduled_recheck() {
|
| 266 |
+
_deprecated_function( __FUNCTION__, '3.0', 'Akismet::fix_scheduled_recheck()' );
|
| 267 |
+
|
| 268 |
return Akismet::fix_scheduled_recheck();
|
| 269 |
}
|
| 270 |
function akismet_spam_comments() {
|
| 290 |
_deprecated_function( __FUNCTION__, '3.0' );
|
| 291 |
|
| 292 |
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
}
|
