Skip to content
Snippets Groups Projects
Commit 4a234fac authored by lucha's avatar lucha Committed by agata
Browse files

removed akismet plugin

parent 75f07ac9
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 5924 deletions
# Only allow direct access to specific Web-available files.
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
\ No newline at end of file
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
.wp-admin.jetpack_page_akismet-key-config, .wp-admin.settings_page_akismet-key-config {
background-color:#f3f6f8;
}
#submitted-on {
position: relative;
}
#the-comment-list .author .akismet-user-comment-count {
display: inline;
}
#the-comment-list .author a span {
text-decoration: none;
color: #999;
}
#the-comment-list .author a span.akismet-span-link {
text-decoration: inherit;
color: inherit;
}
#the-comment-list .akismet_remove_url {
margin-left: 3px;
color: #999;
padding: 2px 3px 2px 0;
}
#the-comment-list .akismet_remove_url:hover {
color: #A7301F;
font-weight: bold;
padding: 2px 2px 2px 0;
}
#dashboard_recent_comments .akismet-status {
display: none;
}
.akismet-status {
float: right;
}
.akismet-status a {
color: #AAA;
font-style: italic;
}
table.comments td.comment p a {
text-decoration: underline;
}
table.comments td.comment p a:after {
content: attr(href);
color: #aaa;
display: inline-block; /* Show the URL without the link's underline extending under it. */
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. */
}
.mshot-arrow {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #5C5C5C;
position: absolute;
left: -6px;
top: 91px;
}
.mshot-container {
background: #5C5C5C;
position: absolute;
top: -94px;
padding: 7px;
width: 450px;
height: 338px;
z-index: 20000;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-border-radius: 6px;
}
.akismet-mshot {
position: absolute;
z-index: 100;
}
.akismet-mshot .mshot-image {
margin: 0;
height: 338px;
width: 450px;
}
.checkforspam {
display: inline-block !important;
}
.checkforspam-progress {
display: none;
}
.checkforspam.checking .checkforspam-progress {
padding-left: 1ex;
}
.checkforspam.button-disabled .checkforspam-progress {
display: inline;
}
.checkforspam-spinner {
display: inline-block;
margin-top: 7px;
}
.akismet-right {
float: right;
}
.akismet-card .akismet-right {
margin: 1em 0;
}
.akismet-alert-text {
color: #dd3d36;
font-weight: bold;
font-size: 120%;
margin-top: .5rem;
}
.akismet-alert {
border: 1px solid #e5e5e5;
padding: 0.4em 1em 1.4em 1em;
border-radius: 3px;
-webkit-border-radius: 3px;
border-width: 1px;
border-style: solid;
}
.akismet-alert h3.akismet-key-status {
color: #fff;
margin: 1em 0 0.5em 0;
}
.akismet-alert.akismet-critical {
background-color: #993300;
}
.akismet-alert.akismet-active {
background-color: #649316;
}
.akismet-alert p.akismet-key-status {
font-size: 24px;
}
.akismet-alert p.akismet-description {
color:#fff;
font-size: 14px;
margin: 0 0;
font-style: normal;
}
.akismet-alert p.akismet-description a,
.akismet-alert p.akismet-description a,
.akismet-alert p.akismet-description a,
.akismet-alert p.akismet-description a {
color: #fff;
}
.akismet-new-snapshot {
margin-top: 1em;
padding: 1em;
text-align: center;
background: #fff;
}
.akismet-new-snapshot h3 {
background: #f5f5f5;
color: #888;
font-size: 11px;
margin: 0;
padding: 3px;
}
.new-snapspot ul {
font-size: 12px;
width: 100%;
}
.akismet-new-snapshot ul li {
color: #999;
float: left;
font-size: 11px;
padding: 0 20px;
text-transform: uppercase;
width: 33%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
}
.akismet-new-snapshot ul li:first-child,
.akismet-new-snapshot ul li:nth-child(2) {
border-right:1px dotted #ccc;
}
.akismet-new-snapshot ul li span {
color: #52accc;
display: block;
font-size: 32px;
font-weight: lighter;
line-height: 1.5em;
}
.akismet-settings th:first-child {
vertical-align: top;
padding-top: 15px;
}
.akismet-settings th.akismet-api-key {
vertical-align: middle;
padding-top: 0;
}
.akismet-settings input[type=text] {
width: 75%;
}
.akismet-settings span.akismet-note{
float: left;
padding-left: 23px;
font-size: 75%;
margin-top: -10px;
}
/**
* For the activation notice on the plugins page.
*/
#akismet_setup_prompt {
background: none;
border: none;
margin: 0;
padding: 0;
width: 100%;
}
.akismet_activate {
border: 1px solid #4F800D;
padding: 5px;
margin: 15px 0;
background: #83AF24;
background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D));
background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24);
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-border-radius: 3px;
position: relative;
overflow: hidden;
}
.akismet_activate .aa_a {
position: absolute;
top: -5px;
right: 10px;
font-size: 140px;
color: #769F33;
font-family: Georgia, "Times New Roman", Times, serif;
}
.akismet_activate .aa_button {
font-weight: bold;
border: 1px solid #029DD6;
border-top: 1px solid #06B9FD;
font-size: 15px;
text-align: center;
padding: 9px 0 8px 0;
color: #FFF;
background: #029DD6;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
width: 100%;
cursor: pointer;
margin: 0;
}
.akismet_activate .aa_button:hover {
text-decoration: none !important;
border: 1px solid #029DD6;
border-bottom: 1px solid #00A8EF;
font-size: 15px;
text-align: center;
padding: 9px 0 8px 0;
color: #F0F8FB;
background: #0079B1;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF));
background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1);
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
}
.akismet_activate .aa_button_border {
border: 1px solid #006699;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
background: #029DD6;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));
background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);
}
.akismet_activate .aa_button_container {
box-sizing: border-box;
display: inline-block;
background: #DEF1B8;
padding: 5px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-border-radius: 2px;
width: 266px;
}
.akismet_activate .aa_description {
position: absolute;
top: 22px;
left: 285px;
margin-left: 25px;
color: #E5F2B1;
font-size: 15px;
}
.akismet_activate .aa_description strong {
color: #FFF;
font-weight: normal;
}
@media (max-width: 550px) {
.akismet_activate .aa_a {
display: none;
}
.akismet_activate .aa_button_container {
width: 100%;
}
}
@media (max-width: 782px) {
.akismet_activate {
min-width: 0;
}
}
@media (max-width: 850px) {
#akismet_setup_prompt .aa_description {
display: none;
}
.akismet_activate {
min-width: 0;
}
}
.jetpack_page_akismet-key-config #wpcontent, .settings_page_akismet-key-config #wpcontent {
padding-left: 0;
}
.akismet-masthead {
background-color:#fff;
text-align:center;
box-shadow:0 1px 0 rgba(200,215,225,0.5),0 1px 2px #e9eff3
}
@media (max-width: 45rem) {
.akismet-masthead {
padding:0 1.25rem
}
}
.akismet-masthead__inside-container {
padding:.375rem 0;
margin:0 auto;
width:100%;
max-width:45rem;
text-align: left;
}
.akismet-masthead__logo-container {
padding:.3125rem 0 0
}
.akismet-masthead__logo {
width:10.375rem;
height:1.8125rem;
}
.akismet-masthead__logo-link {
display:inline-block;
outline:none;
vertical-align:middle
}
.akismet-masthead__logo-link:focus {
line-height:0;
box-shadow:0 0 0 2px #78dcfa
}
.akismet-masthead__logo-link+code {
margin:0 10px;
padding:5px 9px;
border-radius:2px;
background:#e6ecf1;
color:#647a88
}
.akismet-masthead__links {
display:-ms-flexbox;
display:flex;
-ms-flex-flow:row wrap;
flex-flow:row wrap;
-ms-flex:2 50%;
flex:2 50%;
-ms-flex-pack:end;
justify-content:flex-end;
margin:0
}
@media (max-width: 480px) {
.akismet-masthead__links {
padding-right:.625rem
}
}
.akismet-masthead__link-li {
margin:0;
padding:0
}
.akismet-masthead__link {
font-style:normal;
color:#0087be;
padding:.625rem;
display:inline-block
}
.akismet-masthead__link:visited {
color:#0087be
}
.akismet-masthead__link:active,.akismet-masthead__link:hover {
color:#00aadc
}
.akismet-masthead__link:hover {
text-decoration:underline
}
.akismet-masthead__link .dashicons {
display:none
}
@media (max-width: 480px) {
.akismet-masthead__link:hover,.akismet-masthead__link:active {
text-decoration:none
}
.akismet-masthead__link .dashicons {
display:block;
font-size:1.75rem
}
.akismet-masthead__link span+span {
display:none
}
}
.akismet-masthead__link-li:last-of-type .akismet-masthead__link {
padding-right:0
}
.akismet-lower {
margin: 0 auto;
text-align: left;
max-width: 45rem;
padding: 1.5rem;
}
.akismet-lower .notice {
margin-bottom: 2rem;
}
.akismet-card {
margin-top: 1rem;
margin-bottom: 0;
position: relative;
margin: 0 auto 0.625rem auto;
box-sizing: border-box;
background: white;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
}
.akismet-card:after, .akismet-card .inside:after, .akismet-masthead__logo-container:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.akismet-card .inside {
padding: 1.5rem;
padding-top: 1rem;
}
.akismet-card .akismet-card-actions {
margin-top: 1rem;
}
.jetpack_page_akismet-key-config .update-nag, .settings_page_akismet-key-config .update-nag {
display: none;
}
.akismet-masthead .akismet-right {
line-height: 2.125rem;
font-size: 0.9rem;
}
.akismet-box {
box-sizing: border-box;
background: white;
border: 1px solid rgba(200, 215, 225, 0.5);
}
.akismet-box h2, .akismet-box h3 {
padding: 1.5rem 1.5rem .5rem 1.5rem;
margin: 0;
}
.akismet-box p {
padding: 0 1.5rem 1.5rem 1.5rem;
margin: 0;
}
.akismet-jetpack-email {
font-style: oblique;
}
.akismet-jetpack-gravatar {
padding: 0 0 0 1.5rem;
float: left;
margin-right: 1rem;
width: 54px;
height: 54px;
}
.akismet-box p:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.akismet-box .akismet-right {
padding-right: 1.5rem;
}
.akismet-boxes .akismet-box {
margin-bottom: 0;
padding: 0;
margin-top: -1px;
}
.akismet-boxes .akismet-box:last-child {
margin-bottom: 1.5rem;
}
.akismet-boxes .akismet-box:first-child {
margin-top: 1.5rem;
}
.akismet-button, .akismet-button:hover, .akismet-button:visited {
background: white;
border-color: #c8d7e1;
border-style: solid;
border-width: 1px 1px 2px;
color: #2e4453;
cursor: pointer;
display: inline-block;
margin: 0;
outline: 0;
overflow: hidden;
font-size: 14px;
font-weight: 500;
text-overflow: ellipsis;
text-decoration: none;
vertical-align: top;
box-sizing: border-box;
font-size: 14px;
line-height: 21px;
border-radius: 4px;
padding: 7px 14px 9px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.akismet-button:hover {
border-color: #a8bece;
}
.akismet-button:active {
border-width: 2px 1px 1px;
}
.akismet-is-primary, .akismet-is-primary:hover, .akismet-is-primary:visited {
background: #00aadc;
border-color: #0087be;
color: white;
}
.akismet-is-primary:hover, .akismet-is-primary:focus {
border-color: #005082;
}
.akismet-is-primary:hover {
border-color: #005082;
}
.akismet-section-header {
position: relative;
margin: 0 auto 0.625rem auto;
padding: 1rem;
box-sizing: border-box;
box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;
background: #ffffff;
width: 100%;
padding-top: 0.6875rem;
padding-bottom: 0.6875rem;
display: flex;
}
.akismet-section-header__label {
display: -ms-flexbox;
display: flex;
-ms-flex-align: center;
align-items: center;
-ms-flex-positive: 1;
flex-grow: 1;
line-height: 1.75rem;
position: relative;
font-size: 0.875rem;
color: #4f748e;
}
.akismet-section-header__actions {
line-height: 1.75rem;
}
jQuery( function ( $ ) {
var mshotRemovalTimer = null;
var mshotSecondTryTimer = null
var mshotThirdTryTimer = null
var mshotEnabledLinkSelector = 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, td.comment p a';
$('.akismet-status').each(function () {
var thisId = $(this).attr('commentid');
$(this).prependTo('#comment-' + thisId + ' .column-comment');
});
$('.akismet-user-comment-count').each(function () {
var thisId = $(this).attr('commentid');
$(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
});
akismet_enable_comment_author_url_removal();
$( '#the-comment-list' ).on( 'click', '.akismet_remove_url', function () {
var thisId = $(this).attr('commentid');
var data = {
action: 'comment_author_deurl',
_wpnonce: WPAkismet.comment_author_url_nonce,
id: thisId
};
$.ajax({
url: ajaxurl,
type: 'POST',
data: data,
beforeSend: function () {
// Removes "x" link
$("a[commentid='"+ thisId +"']").hide();
// Show temp status
$("#author_comment_url_"+ thisId).html( $( '<span/>' ).text( WPAkismet.strings['Removing...'] ) );
},
success: function (response) {
if (response) {
// Show status/undo link
$("#author_comment_url_"+ thisId)
.attr('cid', thisId)
.addClass('akismet_undo_link_removal')
.html(
$( '<span/>' ).text( WPAkismet.strings['URL removed'] )
)
.append( ' ' )
.append(
$( '<span/>' )
.text( WPAkismet.strings['(undo)'] )
.addClass( 'akismet-span-link' )
);
}
}
});
return false;
}).on( 'click', '.akismet_undo_link_removal', function () {
var thisId = $(this).attr('cid');
var thisUrl = $(this).attr('href');
var data = {
action: 'comment_author_reurl',
_wpnonce: WPAkismet.comment_author_url_nonce,
id: thisId,
url: thisUrl
};
$.ajax({
url: ajaxurl,
type: 'POST',
data: data,
beforeSend: function () {
// Show temp status
$("#author_comment_url_"+ thisId).html( $( '<span/>' ).text( WPAkismet.strings['Re-adding...'] ) );
},
success: function (response) {
if (response) {
// Add "x" link
$("a[commentid='"+ thisId +"']").show();
// Show link. Core strips leading http://, so let's do that too.
$("#author_comment_url_"+ thisId).removeClass('akismet_undo_link_removal').text( thisUrl.replace( /^http:\/\/(www\.)?/ig, '' ) );
}
}
});
return false;
});
// Show a preview image of the hovered URL. Applies to author URLs and URLs inside the comments.
$( '#the-comment-list' ).on( 'mouseover', mshotEnabledLinkSelector, function () {
clearTimeout( mshotRemovalTimer );
if ( $( '.akismet-mshot' ).length > 0 ) {
if ( $( '.akismet-mshot:first' ).data( 'link' ) == this ) {
// The preview is already showing for this link.
return;
}
else {
// A new link is being hovered, so remove the old preview.
$( '.akismet-mshot' ).remove();
}
}
clearTimeout( mshotSecondTryTimer );
clearTimeout( mshotThirdTryTimer );
var thisHref = $( this ).attr( 'href' );
var mShot = $( '<div class="akismet-mshot mshot-container"><div class="mshot-arrow"></div><img src="' + akismet_mshot_url( thisHref ) + '" width="450" height="338" class="mshot-image" /></div>' );
mShot.data( 'link', this );
var offset = $( this ).offset();
mShot.offset( {
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.
top: offset.top + ( $( this ).height() / 2 ) - 101 // 101 = top offset of the arrow plus the top border thickness
} );
// These retries appear to be superfluous if .mshot-image has already loaded, but it's because mShots
// can return a "Generating thumbnail..." image if it doesn't have a thumbnail ready, so we need
// to retry to see if we can get the newly generated thumbnail.
mshotSecondTryTimer = setTimeout( function () {
mShot.find( '.mshot-image' ).attr( 'src', akismet_mshot_url( thisHref, 2 ) );
}, 6000 );
mshotThirdTryTimer = setTimeout( function () {
mShot.find( '.mshot-image' ).attr( 'src', akismet_mshot_url( thisHref, 3 ) );
}, 12000 );
$( 'body' ).append( mShot );
} ).on( 'mouseout', 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, td.comment p a', function () {
mshotRemovalTimer = setTimeout( function () {
clearTimeout( mshotSecondTryTimer );
clearTimeout( mshotThirdTryTimer );
$( '.akismet-mshot' ).remove();
}, 200 );
} ).on( 'mouseover', 'tr', function () {
// When the mouse hovers over a comment row, begin preloading mshots for any links in the comment or the comment author.
var linksToPreloadMshotsFor = $( this ).find( mshotEnabledLinkSelector );
linksToPreloadMshotsFor.each( function () {
// Don't attempt to preload an mshot for a single link twice. Browser caching should cover this, but in case of
// race conditions, save a flag locally when we've begun trying to preload one.
if ( ! $( this ).data( 'akismet-mshot-preloaded' ) ) {
akismet_preload_mshot( $( this ).attr( 'href' ) );
$( this ).data( 'akismet-mshot-preloaded', true );
}
} );
} );
$( '.checkforspam' ).click( function( e ) {
e.preventDefault();
if ( $( this ).hasClass( 'button-disabled' ) ) {
window.location.href = $( this ).data( 'success-url' ).replace( '__recheck_count__', 0 ).replace( '__spam_count__', 0 );
return;
}
$('.checkforspam').addClass('button-disabled').addClass( 'checking' );
$('.checkforspam-spinner').addClass( 'spinner' ).addClass( 'is-active' );
// Update the label on the "Check for Spam" button to use the active "Checking for Spam" language.
$( '.checkforspam .akismet-label' ).text( $( '.checkforspam' ).data( 'active-label' ) );
akismet_check_for_spam(0, 100);
});
var spam_count = 0;
var recheck_count = 0;
function akismet_check_for_spam(offset, limit) {
var check_for_spam_buttons = $( '.checkforspam' );
// We show the percentage complete down to one decimal point so even queues with 100k
// pending comments will show some progress pretty quickly.
var percentage_complete = Math.round( ( recheck_count / check_for_spam_buttons.data( 'pending-comment-count' ) ) * 1000 ) / 10;
// Update the progress counter on the "Check for Spam" button.
$( '.checkforspam-progress' ).text( check_for_spam_buttons.data( 'progress-label-format' ).replace( '%1$s', percentage_complete ) );
$.post(
ajaxurl,
{
'action': 'akismet_recheck_queue',
'offset': offset,
'limit': limit
},
function(result) {
recheck_count += result.counts.processed;
spam_count += result.counts.spam;
if (result.counts.processed < limit) {
window.location.href = check_for_spam_buttons.data( 'success-url' ).replace( '__recheck_count__', recheck_count ).replace( '__spam_count__', spam_count );
}
else {
// Account for comments that were caught as spam and moved out of the queue.
akismet_check_for_spam(offset + limit - result.counts.spam, limit);
}
}
);
}
if ( "start_recheck" in WPAkismet && WPAkismet.start_recheck ) {
$( '.checkforspam' ).click();
}
if ( typeof MutationObserver !== 'undefined' ) {
// Dynamically add the "X" next the the author URL links when a comment is quick-edited.
var comment_list_container = document.getElementById( 'the-comment-list' );
if ( comment_list_container ) {
var observer = new MutationObserver( function ( mutations ) {
for ( var i = 0, _len = mutations.length; i < _len; i++ ) {
if ( mutations[i].addedNodes.length > 0 ) {
akismet_enable_comment_author_url_removal();
// Once we know that we'll have to check for new author links, skip the rest of the mutations.
break;
}
}
} );
observer.observe( comment_list_container, { attributes: true, childList: true, characterData: true } );
}
}
function akismet_enable_comment_author_url_removal() {
$( '#the-comment-list' )
.find( 'tr.comment, tr[id ^= "comment-"]' )
.find( '.column-author a[href^="http"]:first' ) // Ignore mailto: links, which would be the comment author's email.
.each(function () {
if ( $( this ).parent().find( '.akismet_remove_url' ).length > 0 ) {
return;
}
var linkHref = $(this).attr( 'href' );
// Ignore any links to the current domain, which are diagnostic tools, like the IP address link
// or any other links another plugin might add.
var currentHostParts = document.location.href.split( '/' );
var currentHost = currentHostParts[0] + '//' + currentHostParts[2] + '/';
if ( linkHref.indexOf( currentHost ) != 0 ) {
var thisCommentId = $(this).parents('tr:first').attr('id').split("-");
$(this)
.attr("id", "author_comment_url_"+ thisCommentId[1])
.after(
$( '<a href="#" class="akismet_remove_url">x</a>' )
.attr( 'commentid', thisCommentId[1] )
.attr( 'title', WPAkismet.strings['Remove this URL'] )
);
}
});
}
/**
* Generate an mShot URL if given a link URL.
*
* @param string linkUrl
* @param int retry If retrying a request, the number of the retry.
* @return string The mShot URL;
*/
function akismet_mshot_url( linkUrl, retry ) {
var mshotUrl = '//s0.wordpress.com/mshots/v1/' + encodeURIComponent( linkUrl ) + '?w=900';
if ( retry ) {
mshotUrl += '&r=' + encodeURIComponent( retry );
}
return mshotUrl;
}
/**
* Begin loading an mShot preview of a link.
*
* @param string linkUrl
*/
function akismet_preload_mshot( linkUrl ) {
var img = new Image();
img.src = akismet_mshot_url( linkUrl );
}
/**
* Sets the comment form privacy notice display to hide when one clicks Core's dismiss button on the related admin notice.
*/
$( '#akismet-privacy-notice-admin-notice' ).on( 'click', '.notice-dismiss', function(){
$.ajax({
url: './options-general.php?page=akismet-key-config&akismet_comment_form_privacy_notice=hide',
});
});
$( ".akismet-could-be-primary" ).each( function () {
var form = $( this ).closest( 'form' );
form.data( 'initial-state', form.serialize() );
form.on( 'change keyup', function () {
var self = $( this );
var submit_button = self.find( ".akismet-could-be-primary" );
if ( self.serialize() != self.data( 'initial-state' ) ) {
submit_button.addClass( "akismet-is-primary" );
}
else {
submit_button.removeClass( "akismet-is-primary" );
}
} );
} );
});
var ak_js = document.getElementById( "ak_js" );
if ( ! ak_js ) {
ak_js = document.createElement( 'input' );
ak_js.setAttribute( 'id', 'ak_js' );
ak_js.setAttribute( 'name', 'ak_js' );
ak_js.setAttribute( 'type', 'hidden' );
}
else {
ak_js.parentNode.removeChild( ak_js );
}
ak_js.setAttribute( 'value', ( new Date() ).getTime() );
var commentForm = document.getElementById( 'commentform' );
if ( commentForm ) {
commentForm.appendChild( ak_js );
}
else {
var replyRowContainer = document.getElementById( 'replyrow' );
if ( replyRowContainer ) {
var children = replyRowContainer.getElementsByTagName( 'td' );
if ( children.length > 0 ) {
children[0].appendChild( ak_js );
}
}
}
\ No newline at end of file
wp-content/plugins/akismet/_inc/img/logo-full-2x.png

4.93 KiB

<?php
/**
* @package Akismet
*/
/*
Plugin Name: Akismet Anti-Spam
Plugin URI: https://akismet.com/
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. It keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
Version: 4.1.2
Author: Automattic
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later
Text Domain: akismet
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Copyright 2005-2015 Automattic, Inc.
*/
// Make sure we don't expose any info if called directly
if ( !function_exists( 'add_action' ) ) {
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
exit;
}
define( 'AKISMET_VERSION', '4.1.2' );
define( 'AKISMET__MINIMUM_WP_VERSION', '4.0' );
define( 'AKISMET__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'AKISMET_DELETE_LIMIT', 100000 );
register_activation_hook( __FILE__, array( 'Akismet', 'plugin_activation' ) );
register_deactivation_hook( __FILE__, array( 'Akismet', 'plugin_deactivation' ) );
require_once( AKISMET__PLUGIN_DIR . 'class.akismet.php' );
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-widget.php' );
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-rest-api.php' );
add_action( 'init', array( 'Akismet', 'init' ) );
add_action( 'rest_api_init', array( 'Akismet_REST_API', 'init' ) );
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-admin.php' );
add_action( 'init', array( 'Akismet_Admin', 'init' ) );
}
//add wrapper class around deprecated akismet functions that are referenced elsewhere
require_once( AKISMET__PLUGIN_DIR . 'wrapper.php' );
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once( AKISMET__PLUGIN_DIR . 'class.akismet-cli.php' );
}
This diff is collapsed.
<?php
WP_CLI::add_command( 'akismet', 'Akismet_CLI' );
/**
* Filter spam comments.
*/
class Akismet_CLI extends WP_CLI_Command {
/**
* Checks one or more comments against the Akismet API.
*
* ## OPTIONS
* <comment_id>...
* : The ID(s) of the comment(s) to check.
*
* [--noaction]
* : Don't change the status of the comment. Just report what Akismet thinks it is.
*
* ## EXAMPLES
*
* wp akismet check 12345
*
* @alias comment-check
*/
public function check( $args, $assoc_args ) {
foreach ( $args as $comment_id ) {
if ( isset( $assoc_args['noaction'] ) ) {
// Check the comment, but don't reclassify it.
$api_response = Akismet::check_db_comment( $comment_id, 'wp-cli' );
}
else {
$api_response = Akismet::recheck_comment( $comment_id, 'wp-cli' );
}
if ( 'true' === $api_response ) {
WP_CLI::line( sprintf( __( "Comment #%d is spam.", 'akismet' ), $comment_id ) );
}
else if ( 'false' === $api_response ) {
WP_CLI::line( sprintf( __( "Comment #%d is not spam.", 'akismet' ), $comment_id ) );
}
else {
if ( false === $api_response ) {
WP_CLI::error( __( "Failed to connect to Akismet.", 'akismet' ) );
}
else if ( is_wp_error( $api_response ) ) {
WP_CLI::warning( sprintf( __( "Comment #%d could not be checked.", 'akismet' ), $comment_id ) );
}
}
}
}
/**
* Recheck all comments in the Pending queue.
*
* ## EXAMPLES
*
* wp akismet recheck_queue
*
* @alias recheck-queue
*/
public function recheck_queue() {
$batch_size = 100;
$start = 0;
$total_counts = array();
do {
$result_counts = Akismet_Admin::recheck_queue_portion( $start, $batch_size );
if ( $result_counts['processed'] > 0 ) {
foreach ( $result_counts as $key => $count ) {
if ( ! isset( $total_counts[ $key ] ) ) {
$total_counts[ $key ] = $count;
}
else {
$total_counts[ $key ] += $count;
}
}
$start += $batch_size;
$start -= $result_counts['spam']; // These comments will have been removed from the queue.
}
} while ( $result_counts['processed'] > 0 );
WP_CLI::line( sprintf( _n( "Processed %d comment.", "Processed %d comments.", $total_counts['processed'], 'akismet' ), number_format( $total_counts['processed'] ) ) );
WP_CLI::line( sprintf( _n( "%d comment moved to Spam.", "%d comments moved to Spam.", $total_counts['spam'], 'akismet' ), number_format( $total_counts['spam'] ) ) );
if ( $total_counts['error'] ) {
WP_CLI::line( sprintf( _n( "%d comment could not be checked.", "%d comments could not be checked.", $total_counts['error'], 'akismet' ), number_format( $total_counts['error'] ) ) );
}
}
/**
* Fetches stats from the Akismet API.
*
* ## OPTIONS
*
* [<interval>]
* : The time period for which to retrieve stats.
* ---
* default: all
* options:
* - days
* - months
* - all
* ---
*
* [--format=<format>]
* : Allows overriding the output of the command when listing connections.
* ---
* default: table
* options:
* - table
* - json
* - csv
* - yaml
* - count
* ---
*
* [--summary]
* : When set, will display a summary of the stats.
*
* ## EXAMPLES
*
* wp akismet stats
* wp akismet stats all
* wp akismet stats days
* wp akismet stats months
* wp akismet stats all --summary
*/
public function stats( $args, $assoc_args ) {
$api_key = Akismet::get_api_key();
if ( empty( $api_key ) ) {
WP_CLI::error( __( 'API key must be set to fetch stats.', 'akismet' ) );
}
switch ( $args[0] ) {
case 'days':
$interval = '60-days';
break;
case 'months':
$interval = '6-months';
break;
default:
$interval = 'all';
break;
}
$response = Akismet::http_post(
Akismet::build_query( array(
'blog' => get_option( 'home' ),
'key' => $api_key,
'from' => $interval,
) ),
'get-stats'
);
if ( empty( $response[1] ) ) {
WP_CLI::error( __( 'Currently unable to fetch stats. Please try again.', 'akismet' ) );
}
$response_body = json_decode( $response[1], true );
if ( is_null( $response_body ) ) {
WP_CLI::error( __( 'Stats response could not be decoded.', 'akismet' ) );
}
if ( isset( $assoc_args['summary'] ) ) {
$keys = array(
'spam',
'ham',
'missed_spam',
'false_positives',
'accuracy',
'time_saved',
);
WP_CLI\Utils\format_items( $assoc_args['format'], array( $response_body ), $keys );
}
else {
$stats = $response_body['breakdown'];
WP_CLI\Utils\format_items( $assoc_args['format'], $stats, array_keys( end( $stats ) ) );
}
}
}
\ No newline at end of file
<?php
class Akismet_REST_API {
/**
* Register the REST API routes.
*/
public static function init() {
if ( ! function_exists( 'register_rest_route' ) ) {
// The REST API wasn't integrated into core until 4.4, and we support 4.0+ (for now).
return false;
}
register_rest_route( 'akismet/v1', '/key', array(
array(
'methods' => WP_REST_Server::READABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'get_key' ),
), array(
'methods' => WP_REST_Server::EDITABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'set_key' ),
'args' => array(
'key' => array(
'required' => true,
'type' => 'string',
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
),
),
), array(
'methods' => WP_REST_Server::DELETABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'delete_key' ),
)
) );
register_rest_route( 'akismet/v1', '/settings/', array(
array(
'methods' => WP_REST_Server::READABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'get_settings' ),
),
array(
'methods' => WP_REST_Server::EDITABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'set_boolean_settings' ),
'args' => array(
'akismet_strictness' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'If true, Akismet will automatically discard the worst spam automatically rather than putting it in the spam folder.', 'akismet' ),
),
'akismet_show_user_comments_approved' => array(
'required' => false,
'type' => 'boolean',
'description' => __( 'If true, show the number of approved comments beside each comment author in the comments list page.', 'akismet' ),
),
),
)
) );
register_rest_route( 'akismet/v1', '/stats', array(
'methods' => WP_REST_Server::READABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'get_stats' ),
'args' => array(
'interval' => array(
'required' => false,
'type' => 'string',
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_interval' ),
'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),
'default' => 'all',
),
),
) );
register_rest_route( 'akismet/v1', '/stats/(?P<interval>[\w+])', array(
'args' => array(
'interval' => array(
'description' => __( 'The time period for which to retrieve stats. Options: 60-days, 6-months, all', 'akismet' ),
'type' => 'string',
),
),
array(
'methods' => WP_REST_Server::READABLE,
'permission_callback' => array( 'Akismet_REST_API', 'privileged_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'get_stats' ),
)
) );
register_rest_route( 'akismet/v1', '/alert', array(
array(
'methods' => WP_REST_Server::READABLE,
'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'get_alert' ),
'args' => array(
'key' => array(
'required' => false,
'type' => 'string',
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
),
),
),
array(
'methods' => WP_REST_Server::EDITABLE,
'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'set_alert' ),
'args' => array(
'key' => array(
'required' => false,
'type' => 'string',
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
),
),
),
array(
'methods' => WP_REST_Server::DELETABLE,
'permission_callback' => array( 'Akismet_REST_API', 'remote_call_permission_callback' ),
'callback' => array( 'Akismet_REST_API', 'delete_alert' ),
'args' => array(
'key' => array(
'required' => false,
'type' => 'string',
'sanitize_callback' => array( 'Akismet_REST_API', 'sanitize_key' ),
'description' => __( 'A 12-character Akismet API key. Available at akismet.com/get/', 'akismet' ),
),
),
)
) );
}
/**
* Get the current Akismet API key.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function get_key( $request = null ) {
return rest_ensure_response( Akismet::get_api_key() );
}
/**
* Set the API key, if possible.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function set_key( $request ) {
if ( defined( 'WPCOM_API_KEY' ) ) {
return rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\'s API key is hardcoded and cannot be changed via the API.', 'akismet' ), array( 'status'=> 409 ) ) );
}
$new_api_key = $request->get_param( 'key' );
if ( ! self::key_is_valid( $new_api_key ) ) {
return rest_ensure_response( new WP_Error( 'invalid_key', __( 'The value provided is not a valid and registered API key.', 'akismet' ), array( 'status' => 400 ) ) );
}
update_option( 'wordpress_api_key', $new_api_key );
return self::get_key();
}
/**
* Unset the API key, if possible.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function delete_key( $request ) {
if ( defined( 'WPCOM_API_KEY' ) ) {
return rest_ensure_response( new WP_Error( 'hardcoded_key', __( 'This site\'s API key is hardcoded and cannot be deleted.', 'akismet' ), array( 'status'=> 409 ) ) );
}
delete_option( 'wordpress_api_key' );
return rest_ensure_response( true );
}
/**
* Get the Akismet settings.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function get_settings( $request = null ) {
return rest_ensure_response( array(
'akismet_strictness' => ( get_option( 'akismet_strictness', '1' ) === '1' ),
'akismet_show_user_comments_approved' => ( get_option( 'akismet_show_user_comments_approved', '1' ) === '1' ),
) );
}
/**
* Update the Akismet settings.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function set_boolean_settings( $request ) {
foreach ( array(
'akismet_strictness',
'akismet_show_user_comments_approved',
) as $setting_key ) {
$setting_value = $request->get_param( $setting_key );
if ( is_null( $setting_value ) ) {
// This setting was not specified.
continue;
}
// From 4.7+, WP core will ensure that these are always boolean
// values because they are registered with 'type' => 'boolean',
// but we need to do this ourselves for prior versions.
$setting_value = Akismet_REST_API::parse_boolean( $setting_value );
update_option( $setting_key, $setting_value ? '1' : '0' );
}
return self::get_settings();
}
/**
* Parse a numeric or string boolean value into a boolean.
*
* @param mixed $value The value to convert into a boolean.
* @return bool The converted value.
*/
public static function parse_boolean( $value ) {
switch ( $value ) {
case true:
case 'true':
case '1':
case 1:
return true;
case false:
case 'false':
case '0':
case 0:
return false;
default:
return (bool) $value;
}
}
/**
* Get the Akismet stats for a given time period.
*
* Possible `interval` values:
* - all
* - 60-days
* - 6-months
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function get_stats( $request ) {
$api_key = Akismet::get_api_key();
$interval = $request->get_param( 'interval' );
$stat_totals = array();
$response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' );
if ( ! empty( $response[1] ) ) {
$stat_totals[$interval] = json_decode( $response[1] );
}
return rest_ensure_response( $stat_totals );
}
/**
* Get the current alert code and message. Alert codes are used to notify the site owner
* if there's a problem, like a connection issue between their site and the Akismet API,
* invalid requests being sent, etc.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function get_alert( $request ) {
return rest_ensure_response( array(
'code' => get_option( 'akismet_alert_code' ),
'message' => get_option( 'akismet_alert_msg' ),
) );
}
/**
* Update the current alert code and message by triggering a call to the Akismet server.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function set_alert( $request ) {
delete_option( 'akismet_alert_code' );
delete_option( 'akismet_alert_msg' );
// Make a request so the most recent alert code and message are retrieved.
Akismet::verify_key( Akismet::get_api_key() );
return self::get_alert( $request );
}
/**
* Clear the current alert code and message.
*
* @param WP_REST_Request $request
* @return WP_Error|WP_REST_Response
*/
public static function delete_alert( $request ) {
delete_option( 'akismet_alert_code' );
delete_option( 'akismet_alert_msg' );
return self::get_alert( $request );
}
private static function key_is_valid( $key ) {
$response = Akismet::http_post(
Akismet::build_query(
array(
'key' => $key,
'blog' => get_option( 'home' )
)
),
'verify-key'
);
if ( $response[1] == 'valid' ) {
return true;
}
return false;
}
public static function privileged_permission_callback() {
return current_user_can( 'manage_options' );
}
/**
* For calls that Akismet.com makes to the site to clear outdated alert codes, use the API key for authorization.
*/
public static function remote_call_permission_callback( $request ) {
$local_key = Akismet::get_api_key();
return $local_key && ( strtolower( $request->get_param( 'key' ) ) === strtolower( $local_key ) );
}
public static function sanitize_interval( $interval, $request, $param ) {
$interval = trim( $interval );
$valid_intervals = array( '60-days', '6-months', 'all', );
if ( ! in_array( $interval, $valid_intervals ) ) {
$interval = 'all';
}
return $interval;
}
public static function sanitize_key( $key, $request, $param ) {
return trim( $key );
}
}
<?php
/**
* @package Akismet
*/
class Akismet_Widget extends WP_Widget {
function __construct() {
load_plugin_textdomain( 'akismet' );
parent::__construct(
'akismet_widget',
__( 'Akismet Widget' , 'akismet'),
array( 'description' => __( 'Display the number of spam comments Akismet has caught' , 'akismet') )
);
if ( is_active_widget( false, false, $this->id_base ) ) {
add_action( 'wp_head', array( $this, 'css' ) );
}
}
function css() {
?>
<style type="text/css">
.a-stats {
width: auto;
}
.a-stats a {
background: #7CA821;
background-image:-moz-linear-gradient(0% 100% 90deg,#5F8E14,#7CA821);
background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#7CA821),to(#5F8E14));
border: 1px solid #5F8E14;
border-radius:3px;
color: #CFEA93;
cursor: pointer;
display: block;
font-weight: normal;
height: 100%;
-moz-border-radius:3px;
padding: 7px 0 8px;
text-align: center;
text-decoration: none;
-webkit-border-radius:3px;
width: 100%;
}
.a-stats a:hover {
text-decoration: none;
background-image:-moz-linear-gradient(0% 100% 90deg,#6F9C1B,#659417);
background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#659417),to(#6F9C1B));
}
.a-stats .count {
color: #FFF;
display: block;
font-size: 15px;
line-height: 16px;
padding: 0 13px;
white-space: nowrap;
}
</style>
<?php
}
function form( $instance ) {
if ( $instance && isset( $instance['title'] ) ) {
$title = $instance['title'];
}
else {
$title = __( 'Spam Blocked' , 'akismet' );
}
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:' , 'akismet'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
}
function update( $new_instance, $old_instance ) {
$instance['title'] = strip_tags( $new_instance['title'] );
return $instance;
}
function widget( $args, $instance ) {
$count = get_option( 'akismet_spam_count' );
if ( ! isset( $instance['title'] ) ) {
$instance['title'] = __( 'Spam Blocked' , 'akismet' );
}
echo $args['before_widget'];
if ( ! empty( $instance['title'] ) ) {
echo $args['before_title'];
echo esc_html( $instance['title'] );
echo $args['after_title'];
}
?>
<div class="a-stats">
<a href="https://akismet.com" target="_blank" title=""><?php printf( _n( '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', '<strong class="count">%1$s spam</strong> blocked by <strong>Akismet</strong>', $count , 'akismet'), number_format_i18n( $count ) ); ?></a>
</div>
<?php
echo $args['after_widget'];
}
}
function akismet_register_widgets() {
register_widget( 'Akismet_Widget' );
}
add_action( 'widgets_init', 'akismet_register_widgets' );
This diff is collapsed.
<?php
# Silence is golden.
\ No newline at end of file
This diff is collapsed.
<div id="akismet-plugin-container">
<div class="akismet-masthead">
<div class="akismet-masthead__inside-container">
<div class="akismet-masthead__logo-container">
<img class="akismet-masthead__logo" src="<?php echo esc_url( plugins_url( '../_inc/img/logo-full-2x.png', __FILE__ ) ); ?>" alt="Akismet" />
</div>
</div>
</div>
<div class="akismet-lower">
<?php if ( Akismet::get_api_key() ) { ?>
<?php Akismet_Admin::display_status(); ?>
<?php } ?>
<?php if ( ! empty( $notices ) ) { ?>
<?php foreach ( $notices as $notice ) { ?>
<?php Akismet::view( 'notice', $notice ); ?>
<?php } ?>
<?php } ?>
<?php if ( $stat_totals && isset( $stat_totals['all'] ) && (int) $stat_totals['all']->spam > 0 ) : ?>
<div class="akismet-card">
<div class="akismet-section-header">
<div class="akismet-section-header__label">
<span><?php esc_html_e( 'Statistics' , 'akismet'); ?></span>
</div>
<div class="akismet-section-header__actions">
<a href="<?php echo esc_url( Akismet_Admin::get_page_url( 'stats' ) ); ?>">
<?php esc_html_e( 'Detailed Stats' , 'akismet');?>
</a>
</div>
</div>
<div class="akismet-new-snapshot">
<iframe allowtransparency="true" scrolling="no" frameborder="0" style="width: 100%; height: 220px; overflow: hidden;" src="<?php printf( '//akismet.com/web/1.0/snapshot.php?blog=%s&api_key=%s&height=200&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() );?>"></iframe>
<ul>
<li>
<h3><?php esc_html_e( 'Past six months' , 'akismet');?></h3>
<span><?php echo number_format( $stat_totals['6-months']->spam );?></span>
<?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['6-months']->spam, 'akismet' ) ); ?>
</li>
<li>
<h3><?php esc_html_e( 'All time' , 'akismet');?></h3>
<span><?php echo number_format( $stat_totals['all']->spam );?></span>
<?php echo esc_html( _n( 'Spam blocked', 'Spam blocked', $stat_totals['all']->spam, 'akismet' ) ); ?>
</li>
<li>
<h3><?php esc_html_e( 'Accuracy' , 'akismet');?></h3>
<span><?php echo floatval( $stat_totals['all']->accuracy ); ?>%</span>
<?php printf( _n( '%s missed spam', '%s missed spam', $stat_totals['all']->missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?>
|
<?php printf( _n( '%s false positive', '%s false positives', $stat_totals['all']->false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>
</li>
</ul>
</div>
</div>
<?php endif;?>
<?php if ( $akismet_user ):?>
<div class="akismet-card">
<div class="akismet-section-header">
<div class="akismet-section-header__label">
<span><?php esc_html_e( 'Settings' , 'akismet'); ?></span>
</div>
</div>
<div class="inside">
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
<table cellspacing="0" class="akismet-settings">
<tbody>
<?php if ( ! Akismet::predefined_api_key() ) { ?>
<tr>
<th class="akismet-api-key" width="10%" align="left" scope="row"><?php esc_html_e('API Key', 'akismet');?></th>
<td width="5%"/>
<td align="left">
<span class="api-key"><input id="key" name="key" type="text" size="15" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="<?php echo esc_attr( 'regular-text code ' . $akismet_user->status ); ?>"></span>
</td>
</tr>
<?php } ?>
<?php if ( isset( $_GET['ssl_status'] ) ) { ?>
<tr>
<th align="left" scope="row"><?php esc_html_e( 'SSL Status', 'akismet' ); ?></th>
<td></td>
<td align="left">
<p>
<?php
if ( ! wp_http_supports( array( 'ssl' ) ) ) {
?><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
}
else {
$ssl_disabled = get_option( 'akismet_ssl_disabled' );
if ( $ssl_disabled ) {
?><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
}
else {
?><b><?php esc_html_e( 'Enabled.', 'akismet' ); ?></b> <?php esc_html_e( 'All systems functional.', 'akismet' ); ?><?php
}
}
?>
</p>
</td>
</tr>
<?php } ?>
<tr>
<th align="left" scope="row"><?php esc_html_e('Comments', 'akismet');?></th>
<td></td>
<td align="left">
<p>
<label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' , 'akismet'); ?>">
<input
name="akismet_show_user_comments_approved"
id="akismet_show_user_comments_approved"
value="1"
type="checkbox"
<?php
// If the option isn't set, or if it's enabled ('1'), or if it was enabled a long time ago ('true'), check the checkbox.
checked( true, ( in_array( get_option( 'akismet_show_user_comments_approved' ), array( false, '1', 'true' ), true ) ) );
?>
/>
<?php esc_html_e( 'Show the number of approved comments beside each comment author', 'akismet' ); ?>
</label>
</p>
</td>
</tr>
<tr>
<th class="strictness" align="left" scope="row"><?php esc_html_e('Strictness', 'akismet'); ?></th>
<td></td>
<td align="left">
<fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet anti-spam strictness', 'akismet'); ?></span></legend>
<p><label for="akismet_strictness_1"><input type="radio" name="akismet_strictness" id="akismet_strictness_1" value="1" <?php checked('1', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Silently discard the worst and most pervasive spam so I never see it.', 'akismet'); ?></label></p>
<p><label for="akismet_strictness_0"><input type="radio" name="akismet_strictness" id="akismet_strictness_0" value="0" <?php checked('0', get_option('akismet_strictness')); ?> /> <?php esc_html_e('Always put spam in the Spam folder for review.', 'akismet'); ?></label></p>
</fieldset>
<span class="akismet-note"><strong><?php esc_html_e('Note:', 'akismet');?></strong>
<?php
$delete_interval = max( 1, intval( apply_filters( 'akismet_delete_comment_interval', 15 ) ) );
printf(
_n(
'Spam in the <a href="%1$s">spam folder</a> older than 1 day is deleted automatically.',
'Spam in the <a href="%1$s">spam folder</a> older than %2$d days is deleted automatically.',
$delete_interval,
'akismet'
),
admin_url( 'edit-comments.php?comment_status=spam' ),
$delete_interval
);
?>
</td>
</tr>
<tr>
<th class="comment-form-privacy-notice" align="left" scope="row"><?php esc_html_e('Privacy', 'akismet'); ?></th>
<td></td>
<td align="left">
<fieldset><legend class="screen-reader-text"><span><?php esc_html_e('Akismet privacy notice', 'akismet'); ?></span></legend>
<p><label for="akismet_comment_form_privacy_notice_display"><input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_display" value="display" <?php checked('display', get_option('akismet_comment_form_privacy_notice')); ?> /> <?php esc_html_e('Display a privacy notice under your comment forms.', 'akismet'); ?></label></p>
<p><label for="akismet_comment_form_privacy_notice_hide"><input type="radio" name="akismet_comment_form_privacy_notice" id="akismet_comment_form_privacy_notice_hide" value="hide" <?php echo in_array( get_option('akismet_comment_form_privacy_notice'), array('display', 'hide') ) ? checked('hide', get_option('akismet_comment_form_privacy_notice'), false) : 'checked="checked"'; ?> /> <?php esc_html_e('Do not display privacy notice.', 'akismet'); ?></label></p>
</fieldset>
<span class="akismet-note"><?php esc_html_e( 'To help your site with transparency under privacy laws like the GDPR, Akismet can display a notice to your users under your comment forms. This feature is disabled by default, however, you can turn it on above.', 'akismet' );?></span>
</td>
</tr>
</tbody>
</table>
<div class="akismet-card-actions">
<?php if ( ! Akismet::predefined_api_key() ) { ?>
<div id="delete-action">
<a class="submitdelete deletion" href="<?php echo esc_url( Akismet_Admin::get_page_url( 'delete_key' ) ); ?>"><?php esc_html_e('Disconnect this account', 'akismet'); ?></a>
</div>
<?php } ?>
<?php wp_nonce_field(Akismet_Admin::NONCE) ?>
<div id="publishing-action">
<input type="hidden" name="action" value="enter-key">
<input type="submit" name="submit" id="submit" class="akismet-button akismet-could-be-primary" value="<?php esc_attr_e('Save Changes', 'akismet');?>">
</div>
<div class="clear"></div>
</div>
</form>
</div>
</div>
<?php if ( ! Akismet::predefined_api_key() ) { ?>
<div class="akismet-card">
<div class="akismet-section-header">
<div class="akismet-section-header__label">
<span><?php esc_html_e( 'Account' , 'akismet'); ?></span>
</div>
</div>
<div class="inside">
<table cellspacing="0" border="0" class="akismet-settings">
<tbody>
<tr>
<th scope="row" align="left"><?php esc_html_e( 'Subscription Type' , 'akismet');?></th>
<td width="5%"/>
<td align="left">
<p><?php echo esc_html( $akismet_user->account_name ); ?></p>
</td>
</tr>
<tr>
<th scope="row" align="left"><?php esc_html_e( 'Status' , 'akismet');?></th>
<td width="5%"/>
<td align="left">
<p><?php
if ( 'cancelled' == $akismet_user->status ) :
esc_html_e( 'Cancelled', 'akismet' );
elseif ( 'suspended' == $akismet_user->status ) :
esc_html_e( 'Suspended', 'akismet' );
elseif ( 'missing' == $akismet_user->status ) :
esc_html_e( 'Missing', 'akismet' );
elseif ( 'no-sub' == $akismet_user->status ) :
esc_html_e( 'No Subscription Found', 'akismet' );
else :
esc_html_e( 'Active', 'akismet' );
endif; ?></p>
</td>
</tr>
<?php if ( $akismet_user->next_billing_date ) : ?>
<tr>
<th scope="row" align="left"><?php esc_html_e( 'Next Billing Date' , 'akismet');?></th>
<td width="5%"/>
<td align="left">
<p><?php echo date( 'F j, Y', $akismet_user->next_billing_date ); ?></p>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<div class="akismet-card-actions">
<div id="publishing-action">
<?php Akismet::view( 'get', array( 'text' => ( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?php } ?>
<?php endif;?>
</div>
</div>
<?php
//phpcs:disable VariableAnalysis
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
?>
<form name="akismet_activate" action="https://akismet.com/get/" method="POST" target="_blank">
<input type="hidden" name="passback_url" value="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>"/>
<input type="hidden" name="blog" value="<?php echo esc_url( get_option( 'home' ) ); ?>"/>
<input type="hidden" name="redirect" value="<?php echo isset( $redirect ) ? $redirect : 'plugin-signup'; ?>"/>
<input type="submit" class="<?php echo isset( $classes ) && count( $classes ) > 0 ? implode( ' ', $classes ) : 'akismet-button';?>" value="<?php echo esc_attr( $text ); ?>"/>
</form>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment