Compare commits
4 Commits
97f5aa333f
...
6ef144b4f3
Author | SHA1 | Date |
---|---|---|
Alen Kolarić | 6ef144b4f3 | 2 years ago |
Alen Kolarić | c477145e1a | 2 years ago |
Alen Kolarić | f79af63158 | 2 years ago |
Alen Kolarić | 0770b19af5 | 2 years ago |
@ -1,3 +1,5 @@
|
|||||||
# biztime-web
|
# biztime-web
|
||||||
|
|
||||||
kolarix.com/biztime
|
kolarix.com/biztime
|
||||||
|
|
||||||
|
Website for BizTime, a WordPress plugin that shows available times and displays different messages depending on availability.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
@ -0,0 +1,34 @@
|
|||||||
|
# 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>
|
@ -0,0 +1,339 @@
|
|||||||
|
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.
|
@ -0,0 +1,662 @@
|
|||||||
|
.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-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-box-header {
|
||||||
|
max-width: 700px;
|
||||||
|
margin: 0 auto 40px auto;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-box-header h2 {
|
||||||
|
margin: 1.5rem 10% 0;
|
||||||
|
font-size: 1.375rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-box .centered {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-enter-api-key-box {
|
||||||
|
margin: 1.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-box .enter-api-key {
|
||||||
|
display: none;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-box .akismet-toggles {
|
||||||
|
margin: 3rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-box .akismet-ak-connect, .akismet-box .toggle-jp-connect {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-box .enter-api-key p {
|
||||||
|
padding: 0 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-setup-instructions {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.akismet-setup-instructions form {
|
||||||
|
padding-bottom: 1.5rem;
|
||||||
|
}
|
@ -0,0 +1,350 @@
|
|||||||
|
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.
|
||||||
|
if ( "enable_mshots" in WPAkismet && WPAkismet.enable_mshots ) {
|
||||||
|
$( '#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.enable-on-load' ).click( function( e ) {
|
||||||
|
if ( $( this ).hasClass( 'ajax-disabled' ) ) {
|
||||||
|
// Akismet hasn't been configured yet. Allow the user to proceed to the button's link.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
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' );
|
||||||
|
|
||||||
|
akismet_check_for_spam(0, 100);
|
||||||
|
});
|
||||||
|
$( '.checkforspam.enable-on-load' ).removeClass( 'button-disabled' );
|
||||||
|
|
||||||
|
var spam_count = 0;
|
||||||
|
var recheck_count = 0;
|
||||||
|
|
||||||
|
function akismet_check_for_spam(offset, limit) {
|
||||||
|
var check_for_spam_buttons = $( '.checkforspam' );
|
||||||
|
|
||||||
|
var nonce = check_for_spam_buttons.data( 'nonce' );
|
||||||
|
|
||||||
|
// 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' ).text( check_for_spam_buttons.data( 'progress-label' ).replace( '%1$s', percentage_complete ) );
|
||||||
|
|
||||||
|
$.post(
|
||||||
|
ajaxurl,
|
||||||
|
{
|
||||||
|
'action': 'akismet_recheck_queue',
|
||||||
|
'offset': offset,
|
||||||
|
'limit': limit,
|
||||||
|
'nonce': nonce
|
||||||
|
},
|
||||||
|
function(result) {
|
||||||
|
if ( 'error' in result ) {
|
||||||
|
// An error is only returned in the case of a missing nonce, so we don't need the actual error message.
|
||||||
|
window.location.href = check_for_spam_buttons.data( 'failure-url' );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
$( '.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' );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows the Enter API key form
|
||||||
|
*/
|
||||||
|
$( '.akismet-enter-api-key-box a' ).on( 'click', function ( e ) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var div = $( '.enter-api-key' );
|
||||||
|
div.show( 500 );
|
||||||
|
div.find( 'input[name=key]' ).focus();
|
||||||
|
|
||||||
|
$( this ).hide();
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hides the Connect with Jetpack form | Shows the Activate Akismet Account form
|
||||||
|
*/
|
||||||
|
$( 'a.toggle-ak-connect' ).on( 'click', function ( e ) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
$( '.akismet-ak-connect' ).slideToggle('slow');
|
||||||
|
$( 'a.toggle-ak-connect' ).hide();
|
||||||
|
$( '.akismet-jp-connect' ).hide();
|
||||||
|
$( 'a.toggle-jp-connect' ).show();
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows the Connect with Jetpack form | Hides the Activate Akismet Account form
|
||||||
|
*/
|
||||||
|
$( 'a.toggle-jp-connect' ).on( 'click', function ( e ) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
$( '.akismet-jp-connect' ).slideToggle('slow');
|
||||||
|
$( 'a.toggle-jp-connect' ).hide();
|
||||||
|
$( '.akismet-ak-connect' ).hide();
|
||||||
|
$( 'a.toggle-ak-connect' ).show();
|
||||||
|
} );
|
||||||
|
});
|
@ -0,0 +1,30 @@
|
|||||||
|
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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 4.9 KiB |
@ -0,0 +1,66 @@
|
|||||||
|
<?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.7
|
||||||
|
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.7' );
|
||||||
|
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' );
|
||||||
|
}
|
@ -0,0 +1,465 @@
|
|||||||
|
=== Akismet Anti-Spam ===
|
||||||
|
|
||||||
|
== Archived Changelog Entries ==
|
||||||
|
|
||||||
|
This file contains older changelog entries, so we can keep the size of the standard WordPress readme.txt file reasonable.
|
||||||
|
For the latest changes, please see the "Changelog" section of the [readme.txt file](https://plugins.svn.wordpress.org/akismet/trunk/readme.txt).
|
||||||
|
|
||||||
|
= 4.1.5 =
|
||||||
|
*Release Date - 29 April 2020*
|
||||||
|
|
||||||
|
* Based on user feedback, we have dropped the in-admin notice explaining the availability of the "privacy notice" option in the AKismet settings screen. The option itself is available, but after displaying the notice for the last 2 years, it is now considered a known fact.
|
||||||
|
* Updated the "Requires at least" to WP 4.6, based on recommendations from https://wp-info.org/tools/checkplugini18n.php?slug=akismet
|
||||||
|
* Moved older changelog entries to a separate file to keep the size of this readme reasonable, also based on recommendations from https://wp-info.org/tools/checkplugini18n.php?slug=akismet
|
||||||
|
|
||||||
|
= 4.1.4 =
|
||||||
|
*Release Date - 17 March 2020*
|
||||||
|
|
||||||
|
* Only redirect to the Akismet setup screen upon plugin activation if the plugin was activated manually from within the plugin-related screens, to help users with non-standard install workflows, like WP-CLI.
|
||||||
|
* Update the layout of the initial setup screen to be more readable on small screens.
|
||||||
|
* If no API key has been entered, don't run code that expects an API key.
|
||||||
|
* Improve the readability of the comment history entries.
|
||||||
|
* Don't modify the comment form HTML if no API key has been set.
|
||||||
|
|
||||||
|
= 4.1.3 =
|
||||||
|
*Release Date - 31 October 2019*
|
||||||
|
|
||||||
|
* Prevented an attacker from being able to cause a user to unknowingly recheck their Pending comments for spam.
|
||||||
|
* Improved compatibility with Jetpack 7.7+.
|
||||||
|
* Updated the plugin activation page to use consistent language and markup.
|
||||||
|
* Redirecting users to the Akismet connnection/settings screen upon plugin activation, in an effort to make it easier for people to get setup.
|
||||||
|
|
||||||
|
= 4.1.2 =
|
||||||
|
*Release Date - 14 May 2019*
|
||||||
|
|
||||||
|
* Fixed a conflict between the Akismet setup banner and other plugin notices.
|
||||||
|
* Reduced the number of API requests made by the plugin when attempting to verify the API key.
|
||||||
|
* Include additional data in the pingback pre-check API request to help make the stats more accurate.
|
||||||
|
* Fixed a bug that was enabling the "Check for Spam" button when no comments were eligible to be checked.
|
||||||
|
* Improved Akismet's AMP compatibility.
|
||||||
|
|
||||||
|
= 4.1.1 =
|
||||||
|
*Release Date - 31 January 2019*
|
||||||
|
|
||||||
|
* Fixed the "Setup Akismet" notice so it resizes responsively.
|
||||||
|
* Only highlight the "Save Changes" button in the Akismet config when changes have been made.
|
||||||
|
* The count of comments in your spam queue shown on the dashboard show now always be up-to-date.
|
||||||
|
|
||||||
|
= 4.1 =
|
||||||
|
*Release Date - 12 November 2018*
|
||||||
|
|
||||||
|
* Added a WP-CLI method for retrieving stats.
|
||||||
|
* Hooked into the new "Personal Data Eraser" functionality from WordPress 4.9.6.
|
||||||
|
* Added functionality to clear outdated alerts from Akismet.com.
|
||||||
|
|
||||||
|
= 4.0.8 =
|
||||||
|
*Release Date - 19 June 2018*
|
||||||
|
|
||||||
|
* Improved the grammar and consistency of the in-admin privacy related notes (notice and config).
|
||||||
|
* Revised in-admin explanation of the comment form privacy notice to make its usage clearer.
|
||||||
|
* Added `rel="nofollow noopener"` to the comment form privacy notice to improve SEO and security.
|
||||||
|
|
||||||
|
= 4.0.7 =
|
||||||
|
*Release Date - 28 May 2018*
|
||||||
|
|
||||||
|
* Based on user feedback, the link on "Learn how your comment data is processed." in the optional privacy notice now has a `target` of `_blank` and opens in a new tab/window.
|
||||||
|
* Updated the in-admin privacy notice to use the term "comment" instead of "contact" in "Akismet can display a notice to your users under your comment forms."
|
||||||
|
* Only show in-admin privacy notice if Akismet has an API Key configured
|
||||||
|
|
||||||
|
= 4.0.6 =
|
||||||
|
*Release Date - 26 May 2018*
|
||||||
|
|
||||||
|
* Moved away from using `empty( get_option() )` to instantiating a variable to be compatible with older versions of PHP (5.3, 5.4, etc).
|
||||||
|
|
||||||
|
= 4.0.5 =
|
||||||
|
*Release Date - 26 May 2018*
|
||||||
|
|
||||||
|
* Corrected version number after tagging. Sorry...
|
||||||
|
|
||||||
|
= 4.0.4 =
|
||||||
|
*Release Date - 26 May 2018*
|
||||||
|
|
||||||
|
* Added a hook to provide Akismet-specific privacy information for a site's privacy policy.
|
||||||
|
* Added tools to control the display of a privacy related notice under comment forms.
|
||||||
|
* Fixed HTML in activation failure message to close META and HEAD tag properly.
|
||||||
|
* Fixed a bug that would sometimes prevent Akismet from being correctly auto-configured.
|
||||||
|
|
||||||
|
= 4.0.3 =
|
||||||
|
*Release Date - 19 February 2018*
|
||||||
|
|
||||||
|
* Added a scheduled task to remove entries in wp_commentmeta that no longer have corresponding comments in wp_comments.
|
||||||
|
* Added a new `akismet_batch_delete_count` action to the batch delete methods for people who'd like to keep track of the numbers of records being processed by those methods.
|
||||||
|
|
||||||
|
= 4.0.2 =
|
||||||
|
*Release Date - 18 December 2017*
|
||||||
|
|
||||||
|
* Fixed a bug that could cause Akismet to recheck a comment that has already been manually approved or marked as spam.
|
||||||
|
* Fixed a bug that could cause Akismet to claim that some comments are still waiting to be checked when no comments are waiting to be checked.
|
||||||
|
|
||||||
|
= 4.0.1 =
|
||||||
|
*Release Date - 6 November 2017*
|
||||||
|
|
||||||
|
* Fixed a bug that could prevent some users from connecting Akismet via their Jetpack connection.
|
||||||
|
* Ensured that any pending Akismet-related events are unscheduled if the plugin is deactivated.
|
||||||
|
* Allow some JavaScript to be run asynchronously to avoid affecting page render speeds.
|
||||||
|
|
||||||
|
= 4.0 =
|
||||||
|
*Release Date - 19 September 2017*
|
||||||
|
|
||||||
|
* Added REST API endpoints for configuring Akismet and retrieving stats.
|
||||||
|
* Increased the minimum supported WordPress version to 4.0.
|
||||||
|
* Added compatibility with comments submitted via the REST API.
|
||||||
|
* Improved the progress indicator on the "Check for Spam" button.
|
||||||
|
|
||||||
|
= 3.3.4 =
|
||||||
|
*Release Date - 3 August 2017*
|
||||||
|
|
||||||
|
* Disabled Akismet's debug log output by default unless AKISMET_DEBUG is defined.
|
||||||
|
* URL previews now begin preloading when the mouse moves near them in the comments section of wp-admin.
|
||||||
|
* When a comment is caught by the Comment Blacklist, Akismet will always allow it to stay in the trash even if it is spam as well.
|
||||||
|
* Fixed a bug that was preventing an error from being shown when a site can't reach Akismet's servers.
|
||||||
|
|
||||||
|
= 3.3.3 =
|
||||||
|
*Release Date - 13 July 2017*
|
||||||
|
|
||||||
|
* Reduced amount of bandwidth used by the URL Preview feature.
|
||||||
|
* Improved the admin UI when the API key is manually pre-defined for the site.
|
||||||
|
* Removed a workaround for WordPress installations older than 3.3 that will improve Akismet's compatibility with other plugins.
|
||||||
|
* The number of spam blocked that is displayed on the WordPress dashboard will now be more accurate and updated more frequently.
|
||||||
|
* Fixed a bug in the Akismet widget that could cause PHP warnings.
|
||||||
|
|
||||||
|
= 3.3.2 =
|
||||||
|
*Release Date - 10 May 2017*
|
||||||
|
|
||||||
|
* Fixed a bug causing JavaScript errors in some browsers.
|
||||||
|
|
||||||
|
= 3.3.1 =
|
||||||
|
*Release Date - 2 May 2017*
|
||||||
|
|
||||||
|
* Improve performance by only requesting the akismet_comment_nonce option when absolutely necessary.
|
||||||
|
* Fixed two bugs that could cause PHP warnings.
|
||||||
|
* Fixed a bug that was preventing the "Remove author URL" feature from working after a comment was edited using "Quick Edit."
|
||||||
|
* Fixed a bug that was preventing the URL preview feature from working after a comment was edited using "Quick Edit."
|
||||||
|
|
||||||
|
= 3.3 =
|
||||||
|
*Release Date - 23 February 2017*
|
||||||
|
|
||||||
|
* Updated the Akismet admin pages with a new clean design.
|
||||||
|
* Fixed bugs preventing the `akismet_add_comment_nonce` and `akismet_update_alert` wrapper functions from working properly.
|
||||||
|
* Fixed bug preventing the loading indicator from appearing when re-checking all comments for spam.
|
||||||
|
* Added a progress indicator to the "Check for Spam" button.
|
||||||
|
* Added a success message after manually rechecking the Pending queue for spam.
|
||||||
|
|
||||||
|
= 3.2 =
|
||||||
|
*Release Date - 6 September 2016*
|
||||||
|
|
||||||
|
* Added a WP-CLI module. You can now check comments and recheck the moderation queue from the command line.
|
||||||
|
* Stopped using the deprecated jQuery function `.live()`.
|
||||||
|
* Fixed a bug in `remove_comment_author_url()` and `add_comment_author_url()` that could generate PHP notices.
|
||||||
|
* Fixed a bug that could cause an infinite loop for sites with very very very large comment IDs.
|
||||||
|
* Fixed a bug that could cause the Akismet widget title to be blank.
|
||||||
|
|
||||||
|
= 3.1.11 =
|
||||||
|
*Release Date - 12 May 2016*
|
||||||
|
|
||||||
|
* Fixed a bug that could cause the "Check for Spam" button to skip some comments.
|
||||||
|
* Fixed a bug that could prevent some spam submissions from being sent to Akismet.
|
||||||
|
* Updated all links to use https:// when possible.
|
||||||
|
* Disabled Akismet debug logging unless WP_DEBUG and WP_DEBUG_LOG are both enabled.
|
||||||
|
|
||||||
|
= 3.1.10 =
|
||||||
|
*Release Date - 1 April 2016*
|
||||||
|
|
||||||
|
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
|
||||||
|
* Fixed a bug that could have resulted in comments that were caught by the core WordPress comment blacklist not to have a corresponding History entry.
|
||||||
|
* Fixed a bug that could have caused avoidable PHP warnings in the error log.
|
||||||
|
|
||||||
|
= 3.1.9 =
|
||||||
|
*Release Date - 28 March 2016*
|
||||||
|
|
||||||
|
* Add compatibility with Jetpack so that Jetpack can automatically configure Akismet settings when appropriate.
|
||||||
|
* Fixed a bug preventing some comment data from being sent to Akismet.
|
||||||
|
|
||||||
|
= 3.1.8 =
|
||||||
|
*Release Date - 4 March 2016*
|
||||||
|
|
||||||
|
* Fixed a bug preventing Akismet from being used with some plugins that rewrite admin URLs.
|
||||||
|
* Reduced the amount of bandwidth used on Akismet API calls
|
||||||
|
* Reduced the amount of space Akismet uses in the database
|
||||||
|
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
|
||||||
|
|
||||||
|
= 3.1.7 =
|
||||||
|
*Release Date - 4 January 2016*
|
||||||
|
|
||||||
|
* Added documentation for the 'akismet_comment_nonce' filter.
|
||||||
|
* The post-install activation button is now accessible to screen readers and keyboard-only users.
|
||||||
|
* Fixed a bug that was preventing the "Remove author URL" feature from working in WordPress 4.4
|
||||||
|
|
||||||
|
= 3.1.6 =
|
||||||
|
*Release Date - 14 December 2015*
|
||||||
|
|
||||||
|
* Improve the notices shown after activating Akismet.
|
||||||
|
* Update some strings to allow for the proper plural forms in all languages.
|
||||||
|
|
||||||
|
= 3.1.5 =
|
||||||
|
*Release Date - 13 October 2015*
|
||||||
|
|
||||||
|
* Closes a potential XSS vulnerability.
|
||||||
|
|
||||||
|
= 3.1.4 =
|
||||||
|
*Release Date - 24 September 2015*
|
||||||
|
|
||||||
|
* Fixed a bug that was preventing some users from automatically connecting using Jetpack if they didn't have a current Akismet subscription.
|
||||||
|
* Fixed a bug that could cause comments caught as spam to be placed in the Pending queue.
|
||||||
|
* Error messages and instructions have been simplified to be more understandable.
|
||||||
|
* Link previews are enabled for all links inside comments, not just the author's website link.
|
||||||
|
|
||||||
|
= 3.1.3 =
|
||||||
|
*Release Date - 6 July 2015*
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
|
= 3.1.2 =
|
||||||
|
*Release Date - 7 June 2015*
|
||||||
|
|
||||||
|
* Reduced the amount of space Akismet uses in the commentmeta table.
|
||||||
|
* Fixed a bug where some comments with quotes in the author name weren't getting history entries
|
||||||
|
* Pre-emptive security improvements to ensure that the Akismet plugin can't be used by attackers to compromise a WordPress installation.
|
||||||
|
* 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.
|
||||||
|
* When deactivating the plugin, notify the Akismet API so the site can be marked as inactive.
|
||||||
|
* Clearer error messages.
|
||||||
|
|
||||||
|
= 3.1.1 =
|
||||||
|
*Release Date - 17th March, 2015*
|
||||||
|
|
||||||
|
* Improvements to the "Remove comment author URL" JavaScript
|
||||||
|
* Include the pingback pre-check from the 2.6 branch.
|
||||||
|
|
||||||
|
= 3.1 =
|
||||||
|
*Release Date - 11th March, 2015*
|
||||||
|
|
||||||
|
* Use HTTPS by default for all requests to Akismet.
|
||||||
|
* Fix for a situation where Akismet might strip HTML from a comment.
|
||||||
|
|
||||||
|
= 3.0.4 =
|
||||||
|
*Release Date - 11th December, 2014*
|
||||||
|
|
||||||
|
* Fix to make .htaccess compatible with Apache 2.4.
|
||||||
|
* Fix to allow removal of https author URLs.
|
||||||
|
* Fix to avoid stripping part of the author URL when removing and re-adding.
|
||||||
|
* Removed the "Check for Spam" button from the "Trash" and "Approved" queues, where it would have no effect.
|
||||||
|
* Allow automatic API key configuration when Jetpack is installed and connected to a WordPress.com account
|
||||||
|
|
||||||
|
= 3.0.3 =
|
||||||
|
*Release Date - 3rd November, 2014*
|
||||||
|
|
||||||
|
* Fix for sending the wrong data to delete_comment action that could have prevented old spam comments from being deleted.
|
||||||
|
* Added a filter to disable logging of Akismet debugging information.
|
||||||
|
* Added a filter for the maximum comment age when deleting old spam comments.
|
||||||
|
* Added a filter for the number per batch when deleting old spam comments.
|
||||||
|
* Removed the "Check for Spam" button from the Spam folder.
|
||||||
|
|
||||||
|
= 3.0.2 =
|
||||||
|
*Release Date - 18th August, 2014*
|
||||||
|
|
||||||
|
* Performance improvements.
|
||||||
|
* Fixed a bug that could truncate the comment data being sent to Akismet for checking.
|
||||||
|
|
||||||
|
= 3.0.1 =
|
||||||
|
*Release Date - 9th July, 2014*
|
||||||
|
|
||||||
|
* Removed dependency on PHP's fsockopen function
|
||||||
|
* Fix spam/ham reports to work when reported outside of the WP dashboard, e.g., from Notifications or the WP app
|
||||||
|
* Remove jQuery dependency for comment form JavaScript
|
||||||
|
* Remove unnecessary data from some Akismet comment meta
|
||||||
|
* Suspended keys will now result in all comments being put in moderation, not spam.
|
||||||
|
|
||||||
|
= 3.0.0 =
|
||||||
|
*Release Date - 15th April, 2014*
|
||||||
|
|
||||||
|
* Move Akismet to Settings menu
|
||||||
|
* Drop Akismet Stats menu
|
||||||
|
* Add stats snapshot to Akismet settings
|
||||||
|
* Add Akismet subscription details and status to Akismet settings
|
||||||
|
* Add contextual help for each page
|
||||||
|
* Improve Akismet setup to use Jetpack to automate plugin setup
|
||||||
|
* Fix "Check for Spam" to use AJAX to avoid page timing out
|
||||||
|
* Fix Akismet settings page to be responsive
|
||||||
|
* Drop legacy code
|
||||||
|
* Tidy up CSS and Javascript
|
||||||
|
* Replace the old discard setting with a new "discard pervasive spam" feature.
|
||||||
|
|
||||||
|
= 2.6.0 =
|
||||||
|
*Release Date - 18th March, 2014*
|
||||||
|
|
||||||
|
* Add ajax paging to the check for spam button to handle large volumes of comments
|
||||||
|
* Optimize javascript and add localization support
|
||||||
|
* Fix bug in link to spam comments from right now dashboard widget
|
||||||
|
* Fix bug with deleting old comments to avoid timeouts dealing with large volumes of comments
|
||||||
|
* Include X-Pingback-Forwarded-For header in outbound WordPress pingback verifications
|
||||||
|
* Add pre-check for pingbacks, to stop spam before an outbound verification request is made
|
||||||
|
|
||||||
|
= 2.5.9 =
|
||||||
|
*Release Date - 1st August, 2013*
|
||||||
|
|
||||||
|
* Update 'Already have a key' link to redirect page rather than depend on javascript
|
||||||
|
* Fix some non-translatable strings to be translatable
|
||||||
|
* Update Activation banner in plugins page to redirect user to Akismet config page
|
||||||
|
|
||||||
|
= 2.5.8 =
|
||||||
|
*Release Date - 20th January, 2013*
|
||||||
|
|
||||||
|
* Simplify the activation process for new users
|
||||||
|
* Remove the reporter_ip parameter
|
||||||
|
* Minor preventative security improvements
|
||||||
|
|
||||||
|
= 2.5.7 =
|
||||||
|
*Release Date - 13th December, 2012*
|
||||||
|
|
||||||
|
* FireFox Stats iframe preview bug
|
||||||
|
* Fix mshots preview when using https
|
||||||
|
* Add .htaccess to block direct access to files
|
||||||
|
* Prevent some PHP notices
|
||||||
|
* Fix Check For Spam return location when referrer is empty
|
||||||
|
* Fix Settings links for network admins
|
||||||
|
* Fix prepare() warnings in WP 3.5
|
||||||
|
|
||||||
|
= 2.5.6 =
|
||||||
|
*Release Date - 26th April, 2012*
|
||||||
|
|
||||||
|
* Prevent retry scheduling problems on sites where wp_cron is misbehaving
|
||||||
|
* Preload mshot previews
|
||||||
|
* Modernize the widget code
|
||||||
|
* Fix a bug where comments were not held for moderation during an error condition
|
||||||
|
* Improve the UX and display when comments are temporarily held due to an error
|
||||||
|
* Make the Check For Spam button force a retry when comments are held due to an error
|
||||||
|
* Handle errors caused by an invalid key
|
||||||
|
* Don't retry comments that are too old
|
||||||
|
* Improve error messages when verifying an API key
|
||||||
|
|
||||||
|
= 2.5.5 =
|
||||||
|
*Release Date - 11th January, 2012*
|
||||||
|
|
||||||
|
* Add nonce check for comment author URL remove action
|
||||||
|
* Fix the settings link
|
||||||
|
|
||||||
|
= 2.5.4 =
|
||||||
|
*Release Date - 5th January, 2012*
|
||||||
|
|
||||||
|
* Limit Akismet CSS and Javascript loading in wp-admin to just the pages that need it
|
||||||
|
* Added author URL quick removal functionality
|
||||||
|
* Added mShot preview on Author URL hover
|
||||||
|
* Added empty index.php to prevent directory listing
|
||||||
|
* Move wp-admin menu items under Jetpack, if it is installed
|
||||||
|
* Purge old Akismet comment meta data, default of 15 days
|
||||||
|
|
||||||
|
= 2.5.3 =
|
||||||
|
*Release Date - 8th Febuary, 2011*
|
||||||
|
|
||||||
|
* Specify the license is GPL v2 or later
|
||||||
|
* Fix a bug that could result in orphaned commentmeta entries
|
||||||
|
* Include hotfix for WordPress 3.0.5 filter issue
|
||||||
|
|
||||||
|
= 2.5.2 =
|
||||||
|
*Release Date - 14th January, 2011*
|
||||||
|
|
||||||
|
* Properly format the comment count for author counts
|
||||||
|
* Look for super admins on multisite installs when looking up user roles
|
||||||
|
* Increase the HTTP request timeout
|
||||||
|
* Removed padding for author approved count
|
||||||
|
* Fix typo in function name
|
||||||
|
* Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
|
||||||
|
|
||||||
|
= 2.5.1 =
|
||||||
|
*Release Date - 17th December, 2010*
|
||||||
|
|
||||||
|
* Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
|
||||||
|
* Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
|
||||||
|
* Fixed padding bug in "author" column of posts screen
|
||||||
|
* Added margin-top to "cleared by ..." badges on dashboard
|
||||||
|
* Fix possible error when calling akismet_cron_recheck()
|
||||||
|
* Fix more PHP warnings
|
||||||
|
* Clean up XHTML warnings for comment nonce
|
||||||
|
* Fix for possible condition where scheduled comment re-checks could get stuck
|
||||||
|
* Clean up the comment meta details after deleting a comment
|
||||||
|
* Only show the status badge if the comment status has been changed by someone/something other than Akismet
|
||||||
|
* Show a 'History' link in the row-actions
|
||||||
|
* Translation fixes
|
||||||
|
* Reduced font-size on author name
|
||||||
|
* Moved "flagged by..." notification to top right corner of comment container and removed heavy styling
|
||||||
|
* Hid "flagged by..." notification while on dashboard
|
||||||
|
|
||||||
|
= 2.5.0 =
|
||||||
|
*Release Date - 7th December, 2010*
|
||||||
|
|
||||||
|
* Track comment actions under 'Akismet Status' on the edit comment screen
|
||||||
|
* Fix a few remaining deprecated function calls ( props Mike Glendinning )
|
||||||
|
* Use HTTPS for the stats IFRAME when wp-admin is using HTTPS
|
||||||
|
* Use the WordPress HTTP class if available
|
||||||
|
* Move the admin UI code to a separate file, only loaded when needed
|
||||||
|
* Add cron retry feature, to replace the old connectivity check
|
||||||
|
* Display Akismet status badge beside each comment
|
||||||
|
* Record history for each comment, and display it on the edit page
|
||||||
|
* Record the complete comment as originally submitted in comment_meta, to use when reporting spam and ham
|
||||||
|
* Highlight links in comment content
|
||||||
|
* New option, "Show the number of comments you've approved beside each comment author."
|
||||||
|
* New option, "Use a nonce on the comment form."
|
||||||
|
|
||||||
|
= 2.4.0 =
|
||||||
|
*Release Date - 23rd August, 2010*
|
||||||
|
|
||||||
|
* Spell out that the license is GPLv2
|
||||||
|
* Fix PHP warnings
|
||||||
|
* Fix WordPress deprecated function calls
|
||||||
|
* Fire the delete_comment action when deleting comments
|
||||||
|
* Move code specific for older WP versions to legacy.php
|
||||||
|
* General code clean up
|
||||||
|
|
||||||
|
= 2.3.0 =
|
||||||
|
*Release Date - 5th June, 2010*
|
||||||
|
|
||||||
|
* Fix "Are you sure" nonce message on config screen in WPMU
|
||||||
|
* Fix XHTML compliance issue in sidebar widget
|
||||||
|
* Change author link; remove some old references to WordPress.com accounts
|
||||||
|
* Localize the widget title (core ticket #13879)
|
||||||
|
|
||||||
|
= 2.2.9 =
|
||||||
|
*Release Date - 2nd June, 2010*
|
||||||
|
|
||||||
|
* Eliminate a potential conflict with some plugins that may cause spurious reports
|
||||||
|
|
||||||
|
= 2.2.8 =
|
||||||
|
*Release Date - 27th May, 2010*
|
||||||
|
|
||||||
|
* Fix bug in initial comment check for ipv6 addresses
|
||||||
|
* Report comments as ham when they are moved from spam to moderation
|
||||||
|
* Report comments as ham when clicking undo after spam
|
||||||
|
* Use transition_comment_status action when available instead of older actions for spam/ham submissions
|
||||||
|
* Better diagnostic messages when PHP network functions are unavailable
|
||||||
|
* Better handling of comments by logged-in users
|
||||||
|
|
||||||
|
= 2.2.7 =
|
||||||
|
*Release Date - 17th December, 2009*
|
||||||
|
|
||||||
|
* Add a new AKISMET_VERSION constant
|
||||||
|
* Reduce the possibility of over-counting spam when another spam filter plugin is in use
|
||||||
|
* Disable the connectivity check when the API key is hard-coded for WPMU
|
||||||
|
|
||||||
|
= 2.2.6 =
|
||||||
|
*Release Date - 20th July, 2009*
|
||||||
|
|
||||||
|
* Fix a global warning introduced in 2.2.5
|
||||||
|
* Add changelog and additional readme.txt tags
|
||||||
|
* Fix an array conversion warning in some versions of PHP
|
||||||
|
* Support a new WPCOM_API_KEY constant for easier use with WordPress MU
|
||||||
|
|
||||||
|
= 2.2.5 =
|
||||||
|
*Release Date - 13th July, 2009*
|
||||||
|
|
||||||
|
* Include a new Server Connectivity diagnostic check, to detect problems caused by firewalls
|
||||||
|
|
||||||
|
= 2.2.4 =
|
||||||
|
*Release Date - 3rd June, 2009*
|
||||||
|
|
||||||
|
* Fixed a key problem affecting the stats feature in WordPress MU
|
||||||
|
* Provide additional blog information in Akismet API calls
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,185 @@
|
|||||||
|
<?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 ) ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,366 @@
|
|||||||
|
<?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 );
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
<?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' );
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
# Silence is golden.
|
@ -0,0 +1,45 @@
|
|||||||
|
=== Akismet Spam Protection ===
|
||||||
|
Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eoigal, cfinke, automattic, jgs, procifer, stephdau
|
||||||
|
Tags: comments, spam, antispam, anti-spam, contact form, anti spam, comment moderation, comment spam, contact form spam, spam comments
|
||||||
|
Requires at least: 4.6
|
||||||
|
Tested up to: 5.5
|
||||||
|
Stable tag: 4.1.7
|
||||||
|
License: GPLv2 or later
|
||||||
|
|
||||||
|
The best anti-spam protection to block spam comments and spam in a contact form. The most trusted antispam solution for WordPress and WooCommerce.
|
||||||
|
|
||||||
|
== Description ==
|
||||||
|
|
||||||
|
Akismet checks your comments and contact form submissions against our global database of spam to prevent your site from publishing malicious content. You can review the comment spam it catches on your blog's "Comments" admin screen.
|
||||||
|
|
||||||
|
Major features in Akismet include:
|
||||||
|
|
||||||
|
* Automatically checks all comments and filters out the ones that look like spam.
|
||||||
|
* Each comment has a status history, so you can easily see which comments were caught or cleared by Akismet and which were spammed or unspammed by a moderator.
|
||||||
|
* URLs are shown in the comment body to reveal hidden or misleading links.
|
||||||
|
* Moderators can see the number of approved comments for each user.
|
||||||
|
* A discard feature that outright blocks the worst spam, saving you disk space and speeding up your site.
|
||||||
|
|
||||||
|
PS: You'll be prompted to get an Akismet.com API key to use it, once activated. Keys are free for personal blogs; paid subscriptions are available for businesses and commercial sites.
|
||||||
|
|
||||||
|
== Installation ==
|
||||||
|
|
||||||
|
Upload the Akismet plugin to your blog, activate it, and then enter your Akismet.com API key.
|
||||||
|
|
||||||
|
1, 2, 3: You're done!
|
||||||
|
|
||||||
|
== Changelog ==
|
||||||
|
|
||||||
|
= 4.1.7 =
|
||||||
|
*Release Date - 22 October 2020*
|
||||||
|
|
||||||
|
* Show the "Set up your Akismet account" banner on the comments admin screen, where it's relevant to mention if Akismet hasn't been configured.
|
||||||
|
* Don't use wp_blacklist_check when the new wp_check_comment_disallowed_list function is available.
|
||||||
|
|
||||||
|
= 4.1.6 =
|
||||||
|
*Release Date - 4 June 2020*
|
||||||
|
|
||||||
|
* Disable "Check for Spam" button until the page is loaded to avoid errors with clicking through to queue recheck endpoint directly.
|
||||||
|
* Add filter "akismet_enable_mshots" to allow disabling screenshot popups on the edit comments admin page.
|
||||||
|
|
||||||
|
For older changelog entries, please see the [additional changelog.txt file](https://plugins.svn.wordpress.org/akismet/trunk/changelog.txt) delivered with the plugin.
|
@ -0,0 +1,8 @@
|
|||||||
|
<div class="akismet-box">
|
||||||
|
<?php Akismet::view( 'title' ); ?>
|
||||||
|
<?php Akismet::view( 'setup' );?>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<div class="akismet-box">
|
||||||
|
<?php Akismet::view( 'enter' );?>
|
||||||
|
</div>
|
@ -0,0 +1,242 @@
|
|||||||
|
<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>
|
@ -0,0 +1,72 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//phpcs:disable VariableAnalysis
|
||||||
|
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="akismet-box">
|
||||||
|
<?php Akismet::view( 'title' ); ?>
|
||||||
|
<div class="akismet-jp-connect">
|
||||||
|
<h3><?php esc_html_e( 'Connect with Jetpack', 'akismet' ); ?></h3><?php
|
||||||
|
if ( in_array( $akismet_user->status, array( 'no-sub', 'missing' ) ) ) {?>
|
||||||
|
<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>
|
||||||
|
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" 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="auto-connect" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
|
||||||
|
<input type="hidden" name="redirect" value="plugin-signup"/>
|
||||||
|
<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
|
||||||
|
</form>
|
||||||
|
<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
|
||||||
|
<p><?php
|
||||||
|
/* translators: %s is the WordPress.com username */
|
||||||
|
echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
|
||||||
|
<?php } elseif ( $akismet_user->status == 'cancelled' ) { ?>
|
||||||
|
<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>
|
||||||
|
<form name="akismet_activate" id="akismet_activate" action="https://akismet.com/get/" method="post" class="akismet-right" 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="user_id" value="<?php echo esc_attr( $akismet_user->ID ); ?>"/>
|
||||||
|
<input type="hidden" name="redirect" value="upgrade"/>
|
||||||
|
<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
|
||||||
|
</form>
|
||||||
|
<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
|
||||||
|
<p><?php
|
||||||
|
/* translators: %s is the WordPress.com email address */
|
||||||
|
echo esc_html( sprintf( __( 'Your subscription for %s is cancelled.' , 'akismet' ), $akismet_user->user_email ) ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
|
||||||
|
<?php } elseif ( $akismet_user->status == 'suspended' ) { ?>
|
||||||
|
<div class="akismet-right">
|
||||||
|
<p><a href="https://akismet.com/contact" class="akismet-button akismet-is-primary"><?php esc_html_e( 'Contact Akismet support' , 'akismet' ); ?></a></p>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<span class="akismet-alert-text"><?php
|
||||||
|
/* translators: %s is the WordPress.com email address */
|
||||||
|
echo esc_html( sprintf( __( 'Your subscription for %s is suspended.' , 'akismet' ), $akismet_user->user_email ) ); ?></span>
|
||||||
|
<?php esc_html_e( 'No worries! Get in touch and we’ll sort this out.', 'akismet' ); ?>
|
||||||
|
</p>
|
||||||
|
<?php } else { // ask do they want to use akismet account found using jetpack wpcom connection ?>
|
||||||
|
<p><?php esc_html_e( 'Use your Jetpack connection to set up Akismet.', 'akismet' ); ?></p>
|
||||||
|
<form name="akismet_use_wpcom_key" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post" id="akismet-activate" class="akismet-right">
|
||||||
|
<input type="hidden" name="key" value="<?php echo esc_attr( $akismet_user->api_key );?>"/>
|
||||||
|
<input type="hidden" name="action" value="enter-key">
|
||||||
|
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
|
||||||
|
<input type="submit" class="akismet-button akismet-is-primary" value="<?php esc_attr_e( 'Connect with Jetpack' , 'akismet' ); ?>"/>
|
||||||
|
</form>
|
||||||
|
<?php echo get_avatar( $akismet_user->user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>
|
||||||
|
<p><?php
|
||||||
|
/* translators: %s is the WordPress.com username */
|
||||||
|
echo sprintf( esc_html( __( 'You are connected as %s.', 'akismet' ) ), '<b>' . esc_html( $akismet_user->user_login ) . '</b>' ); ?><br /><span class="akismet-jetpack-email"><?php echo esc_html( $akismet_user->user_email ); ?></span></p>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<div class="akismet-ak-connect">
|
||||||
|
<?php Akismet::view( 'setup' );?>
|
||||||
|
</div>
|
||||||
|
<div class="centered akismet-toggles">
|
||||||
|
<a href="#" class="toggle-jp-connect"><?php esc_html_e( 'Connect with Jetpack' ); ?></a>
|
||||||
|
<a href="#" class="toggle-ak-connect"><?php esc_html_e( 'Set up a different account' ); ?></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<div class="akismet-box">
|
||||||
|
<?php Akismet::view( 'enter' );?>
|
||||||
|
</div>
|
@ -0,0 +1,13 @@
|
|||||||
|
<div class="akismet-enter-api-key-box centered">
|
||||||
|
<a href="#"><?php esc_html_e( 'Manually enter an API key' ); ?></a>
|
||||||
|
<div class="enter-api-key">
|
||||||
|
<form action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="post">
|
||||||
|
<?php wp_nonce_field( Akismet_Admin::NONCE ) ?>
|
||||||
|
<input type="hidden" name="action" value="enter-key">
|
||||||
|
<p style="width: 100%; display: flex; flex-wrap: nowrap; box-sizing: border-box;">
|
||||||
|
<input id="key" name="key" type="text" size="15" value="" placeholder="<?php esc_attr_e( 'Enter your API key' , 'akismet' ); ?>" class="regular-text code" style="flex-grow: 1; margin-right: 1rem;">
|
||||||
|
<input type="submit" name="submit" id="submit" class="akismet-button" value="<?php esc_attr_e( 'Connect with API key', 'akismet' );?>">
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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>
|
@ -0,0 +1,141 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//phpcs:disable VariableAnalysis
|
||||||
|
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||||
|
|
||||||
|
?>
|
||||||
|
<?php if ( $type == 'plugin' ) :?>
|
||||||
|
<div class="updated" id="akismet_setup_prompt">
|
||||||
|
<form name="akismet_activate" action="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" method="POST">
|
||||||
|
<div class="akismet_activate">
|
||||||
|
<div class="aa_a">A</div>
|
||||||
|
<div class="aa_button_container">
|
||||||
|
<div class="aa_button_border">
|
||||||
|
<input type="submit" class="aa_button" value="<?php esc_attr_e( 'Set up your Akismet account', 'akismet' ); ?>" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="aa_description"><?php _e('<strong>Almost done</strong> - configure Akismet and say goodbye to spam', 'akismet');?></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'spam-check' ) :?>
|
||||||
|
<div class="notice notice-warning">
|
||||||
|
<p><strong><?php esc_html_e( 'Akismet has detected a problem.', 'akismet' );?></strong></p>
|
||||||
|
<p><?php esc_html_e( 'Some comments have not yet been checked for spam by Akismet. They have been temporarily held for moderation and will automatically be rechecked later.', 'akismet' ); ?></p>
|
||||||
|
<?php if ( $link_text ) { ?>
|
||||||
|
<p><?php echo $link_text; ?></p>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'alert' ) :?>
|
||||||
|
<div class='error'>
|
||||||
|
<p><strong><?php printf( esc_html__( 'Akismet Error Code: %s', 'akismet' ), $code ); ?></strong></p>
|
||||||
|
<p><?php echo esc_html( $msg ); ?></p>
|
||||||
|
<p><?php
|
||||||
|
|
||||||
|
/* translators: the placeholder is a clickable URL that leads to more information regarding an error code. */
|
||||||
|
printf( esc_html__( 'For more information: %s' , 'akismet'), '<a href="https://akismet.com/errors/' . $code . '">https://akismet.com/errors/' . $code . '</a>' );
|
||||||
|
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'notice' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status failed"><?php echo $notice_header; ?></h3>
|
||||||
|
<p class="akismet-description">
|
||||||
|
<?php echo $notice_text; ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'missing-functions' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e('Network functions are disabled.', 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('Your web host or server administrator has disabled PHP’s <code>gethostbynamel</code> function. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet’s system requirements</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'servers-be-down' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e("Your site can’t connect to the Akismet servers.", 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('Your firewall may be blocking Akismet from connecting to its API. Please contact your host and refer to <a href="%s" target="_blank">our guide about firewalls</a>.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'active-dunning' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status"><?php esc_html_e("Please update your payment information.", 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('We cannot process your payment. Please <a href="%s" target="_blank">update your payment details</a>.', 'akismet'), 'https://akismet.com/account/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'cancelled' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status"><?php esc_html_e("Your Akismet plan has been cancelled.", 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('Please visit your <a href="%s" target="_blank">Akismet account page</a> to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'suspended' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e("Your Akismet subscription is suspended.", 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'active-notice' && $time_saved ) :?>
|
||||||
|
<div class="akismet-alert akismet-active">
|
||||||
|
<h3 class="akismet-key-status"><?php echo esc_html( $time_saved ); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('You can help us fight spam and upgrade your account by <a href="%s" target="_blank">contributing a token amount</a>.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'missing' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e( 'There is a problem with your API key.', 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('Please contact <a href="%s" target="_blank">Akismet support</a> for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'no-sub' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e( 'You don’t have an Akismet plan.', 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description">
|
||||||
|
<?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/' ); ?>
|
||||||
|
<br /><br />
|
||||||
|
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'new-key-valid' ) :
|
||||||
|
global $wpdb;
|
||||||
|
|
||||||
|
$check_pending_link = false;
|
||||||
|
|
||||||
|
$at_least_one_comment_in_moderation = !! $wpdb->get_var( "SELECT comment_ID FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT 1" );
|
||||||
|
|
||||||
|
if ( $at_least_one_comment_in_moderation) {
|
||||||
|
$check_pending_link = 'edit-comments.php?akismet_recheck=' . wp_create_nonce( 'akismet_recheck' );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="akismet-alert akismet-active">
|
||||||
|
<h3 class="akismet-key-status"><?php esc_html_e( 'Akismet is now protecting your site from spam. Happy blogging!', 'akismet' ); ?></h3>
|
||||||
|
<?php if ( $check_pending_link ) { ?>
|
||||||
|
<p class="akismet-description"><?php printf( __( 'Would you like to <a href="%s">check pending comments</a>?', 'akismet' ), esc_url( $check_pending_link ) ); ?></p>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'new-key-invalid' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status"><?php esc_html_e( 'The key you entered is invalid. Please double-check it.' , 'akismet'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'existing-key-invalid' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status"><?php esc_html_e( 'Your API key is no longer valid. Please enter a new key or contact support@akismet.com.' , 'akismet'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'new-key-failed' ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<h3 class="akismet-key-status"><?php esc_html_e( 'The API key you entered could not be verified.' , 'akismet'); ?></h3>
|
||||||
|
<p class="akismet-description"><?php printf( __('The connection to akismet.com could not be established. Please refer to <a href="%s" target="_blank">our guide about firewalls</a> and check your server configuration.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?></p>
|
||||||
|
</div>
|
||||||
|
<?php elseif ( $type == 'limit-reached' && in_array( $level, array( 'yellow', 'red' ) ) ) :?>
|
||||||
|
<div class="akismet-alert akismet-critical">
|
||||||
|
<?php if ( $level == 'yellow' ): ?>
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e( 'You’re using your Akismet key on more sites than your Pro subscription allows.', 'akismet' ); ?></h3>
|
||||||
|
<p class="akismet-description">
|
||||||
|
<?php printf( __( 'Your Pro subscription allows the use of Akismet on only one site. Please <a href="%s" target="_blank">purchase additional Pro subscriptions</a> or upgrade to an Enterprise subscription that allows the use of Akismet on unlimited sites.', 'akismet' ), 'https://docs.akismet.com/billing/add-more-sites/' ); ?>
|
||||||
|
<br /><br />
|
||||||
|
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
|
||||||
|
</p>
|
||||||
|
<?php elseif ( $level == 'red' ): ?>
|
||||||
|
<h3 class="akismet-key-status failed"><?php esc_html_e( 'You’re using Akismet on far too many sites for your Pro subscription.', 'akismet' ); ?></h3>
|
||||||
|
<p class="akismet-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.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>
|
||||||
|
<br /><br />
|
||||||
|
<?php printf( __( 'Please <a href="%s" target="_blank">contact our support team</a> with any questions.', 'akismet' ), 'https://akismet.com/contact/'); ?>
|
||||||
|
</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif;?>
|
@ -0,0 +1,11 @@
|
|||||||
|
<div class="akismet-box">
|
||||||
|
<h2><?php esc_html_e( 'Manual Configuration', 'akismet' ); ?></h2>
|
||||||
|
<p>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/* translators: %s is the wp-config.php file */
|
||||||
|
echo sprintf( esc_html__( 'An Akismet API key has been defined in the %s file for this site.', 'akismet' ), '<code>wp-config.php</code>' );
|
||||||
|
|
||||||
|
?>
|
||||||
|
</p>
|
||||||
|
</div>
|
@ -0,0 +1,4 @@
|
|||||||
|
<div class="akismet-setup-instructions">
|
||||||
|
<p><?php esc_html_e( 'Set up your Akismet account to enable spam filtering on this site.', 'akismet' ); ?></p>
|
||||||
|
<?php Akismet::view( 'get', array( 'text' => __( 'Set up your Akismet account' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
|
||||||
|
</div>
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//phpcs:disable VariableAnalysis
|
||||||
|
// There are "undefined" variables here because they're defined in the code that includes this file as a template.
|
||||||
|
|
||||||
|
?>
|
||||||
|
<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 Akismet_Admin::display_status();?>
|
||||||
|
<div class="akismet-boxes">
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if ( Akismet::predefined_api_key() ) {
|
||||||
|
Akismet::view( 'predefined' );
|
||||||
|
} elseif ( $akismet_user && in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) {
|
||||||
|
Akismet::view( 'connect-jp', compact( 'akismet_user' ) );
|
||||||
|
} else {
|
||||||
|
Akismet::view( 'activate' );
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,11 @@
|
|||||||
|
<div id="akismet-plugin-container">
|
||||||
|
<div class="akismet-masthead">
|
||||||
|
<div class="akismet-masthead__inside-container">
|
||||||
|
<a href="<?php echo esc_url( Akismet_Admin::get_page_url() ); ?>" class="akismet-right"><?php esc_html_e( 'Anti-Spam Settings', 'akismet' ); ?></a>
|
||||||
|
<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>
|
||||||
|
<iframe src="<?php echo esc_url( sprintf( '//akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s&locale=%s', urlencode( get_option( 'home' ) ), Akismet::get_api_key(), get_locale() ) ); ?>" width="100%" height="2500px" frameborder="0"></iframe>
|
||||||
|
</div>
|
@ -0,0 +1,3 @@
|
|||||||
|
<div class="centered akismet-box-header">
|
||||||
|
<h2><?php esc_html_e( 'Eliminate spam from your site', 'akismet' ); ?></h2>
|
||||||
|
</div>
|
@ -0,0 +1,214 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
|
||||||
|
|
||||||
|
$wpcom_api_key = defined( 'WPCOM_API_KEY' ) ? constant( 'WPCOM_API_KEY' ) : '';
|
||||||
|
$akismet_api_host = Akismet::get_api_key() . '.rest.akismet.com';
|
||||||
|
$akismet_api_port = 80;
|
||||||
|
|
||||||
|
function akismet_test_mode() {
|
||||||
|
return Akismet::is_test_mode();
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_http_post( $request, $host, $path, $port = 80, $ip = null ) {
|
||||||
|
$path = str_replace( '/1.1/', '', $path );
|
||||||
|
|
||||||
|
return Akismet::http_post( $request, $path, $ip );
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_microtime() {
|
||||||
|
return Akismet::_get_microtime();
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_delete_old() {
|
||||||
|
return Akismet::delete_old_comments();
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_delete_old_metadata() {
|
||||||
|
return Akismet::delete_old_comments_meta();
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
|
||||||
|
return Akismet::check_db_comment( $id, $recheck_reason );
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_rightnow() {
|
||||||
|
if ( !class_exists( 'Akismet_Admin' ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return Akismet_Admin::rightnow_stats();
|
||||||
|
}
|
||||||
|
|
||||||
|
function akismet_admin_init() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_version_warning() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_load_js_and_css() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_nonce_field( $action = -1 ) {
|
||||||
|
return wp_nonce_field( $action );
|
||||||
|
}
|
||||||
|
function akismet_plugin_action_links( $links, $file ) {
|
||||||
|
return Akismet_Admin::plugin_action_links( $links, $file );
|
||||||
|
}
|
||||||
|
function akismet_conf() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_stats_display() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_stats() {
|
||||||
|
return Akismet_Admin::dashboard_stats();
|
||||||
|
}
|
||||||
|
function akismet_admin_warnings() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_comment_row_action( $a, $comment ) {
|
||||||
|
return Akismet_Admin::comment_row_actions( $a, $comment );
|
||||||
|
}
|
||||||
|
function akismet_comment_status_meta_box( $comment ) {
|
||||||
|
return Akismet_Admin::comment_status_meta_box( $comment );
|
||||||
|
}
|
||||||
|
function akismet_comments_columns( $columns ) {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
|
||||||
|
return $columns;
|
||||||
|
}
|
||||||
|
function akismet_comment_column_row( $column, $comment_id ) {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_text_add_link_callback( $m ) {
|
||||||
|
return Akismet_Admin::text_add_link_callback( $m );
|
||||||
|
}
|
||||||
|
function akismet_text_add_link_class( $comment_text ) {
|
||||||
|
return Akismet_Admin::text_add_link_class( $comment_text );
|
||||||
|
}
|
||||||
|
function akismet_check_for_spam_button( $comment_status ) {
|
||||||
|
return Akismet_Admin::check_for_spam_button( $comment_status );
|
||||||
|
}
|
||||||
|
function akismet_submit_nonspam_comment( $comment_id ) {
|
||||||
|
return Akismet::submit_nonspam_comment( $comment_id );
|
||||||
|
}
|
||||||
|
function akismet_submit_spam_comment( $comment_id ) {
|
||||||
|
return Akismet::submit_spam_comment( $comment_id );
|
||||||
|
}
|
||||||
|
function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
|
||||||
|
return Akismet::transition_comment_status( $new_status, $old_status, $comment );
|
||||||
|
}
|
||||||
|
function akismet_spam_count( $type = false ) {
|
||||||
|
return Akismet_Admin::get_spam_count( $type );
|
||||||
|
}
|
||||||
|
function akismet_recheck_queue() {
|
||||||
|
return Akismet_Admin::recheck_queue();
|
||||||
|
}
|
||||||
|
function akismet_remove_comment_author_url() {
|
||||||
|
return Akismet_Admin::remove_comment_author_url();
|
||||||
|
}
|
||||||
|
function akismet_add_comment_author_url() {
|
||||||
|
return Akismet_Admin::add_comment_author_url();
|
||||||
|
}
|
||||||
|
function akismet_check_server_connectivity() {
|
||||||
|
return Akismet_Admin::check_server_connectivity();
|
||||||
|
}
|
||||||
|
function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
|
||||||
|
return Akismet_Admin::get_server_connectivity( $cache_timeout );
|
||||||
|
}
|
||||||
|
function akismet_server_connectivity_ok() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function akismet_admin_menu() {
|
||||||
|
return Akismet_Admin::admin_menu();
|
||||||
|
}
|
||||||
|
function akismet_load_menu() {
|
||||||
|
return Akismet_Admin::load_menu();
|
||||||
|
}
|
||||||
|
function akismet_init() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_get_key() {
|
||||||
|
return Akismet::get_api_key();
|
||||||
|
}
|
||||||
|
function akismet_check_key_status( $key, $ip = null ) {
|
||||||
|
return Akismet::check_key_status( $key, $ip );
|
||||||
|
}
|
||||||
|
function akismet_update_alert( $response ) {
|
||||||
|
return Akismet::update_alert( $response );
|
||||||
|
}
|
||||||
|
function akismet_verify_key( $key, $ip = null ) {
|
||||||
|
return Akismet::verify_key( $key, $ip );
|
||||||
|
}
|
||||||
|
function akismet_get_user_roles( $user_id ) {
|
||||||
|
return Akismet::get_user_roles( $user_id );
|
||||||
|
}
|
||||||
|
function akismet_result_spam( $approved ) {
|
||||||
|
return Akismet::comment_is_spam( $approved );
|
||||||
|
}
|
||||||
|
function akismet_result_hold( $approved ) {
|
||||||
|
return Akismet::comment_needs_moderation( $approved );
|
||||||
|
}
|
||||||
|
function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
|
||||||
|
return Akismet::get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url );
|
||||||
|
}
|
||||||
|
function akismet_update_comment_history( $comment_id, $message, $event = null ) {
|
||||||
|
return Akismet::update_comment_history( $comment_id, $message, $event );
|
||||||
|
}
|
||||||
|
function akismet_get_comment_history( $comment_id ) {
|
||||||
|
return Akismet::get_comment_history( $comment_id );
|
||||||
|
}
|
||||||
|
function akismet_cmp_time( $a, $b ) {
|
||||||
|
return Akismet::_cmp_time( $a, $b );
|
||||||
|
}
|
||||||
|
function akismet_auto_check_update_meta( $id, $comment ) {
|
||||||
|
return Akismet::auto_check_update_meta( $id, $comment );
|
||||||
|
}
|
||||||
|
function akismet_auto_check_comment( $commentdata ) {
|
||||||
|
return Akismet::auto_check_comment( $commentdata );
|
||||||
|
}
|
||||||
|
function akismet_get_ip_address() {
|
||||||
|
return Akismet::get_ip_address();
|
||||||
|
}
|
||||||
|
function akismet_cron_recheck() {
|
||||||
|
return Akismet::cron_recheck();
|
||||||
|
}
|
||||||
|
function akismet_add_comment_nonce( $post_id ) {
|
||||||
|
return Akismet::add_comment_nonce( $post_id );
|
||||||
|
}
|
||||||
|
function akismet_fix_scheduled_recheck() {
|
||||||
|
return Akismet::fix_scheduled_recheck();
|
||||||
|
}
|
||||||
|
function akismet_spam_comments() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
function akismet_spam_totals() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
function akismet_manage_page() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_caught() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function redirect_old_akismet_urls() {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
}
|
||||||
|
function akismet_kill_proxy_check( $option ) {
|
||||||
|
_deprecated_function( __FUNCTION__, '3.0' );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
function akismet_pingback_forwarded_for( $r, $url ) {
|
||||||
|
// This functionality is now in core.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function akismet_pre_check_pingback( $method ) {
|
||||||
|
return Akismet::pre_check_pingback( $method );
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
=== Plugin Name ===
|
||||||
|
Contributors: (this should be a list of wordpress.org userid's)
|
||||||
|
Donate link: https://kolarix.com/biztime
|
||||||
|
Tags: comments, spam
|
||||||
|
Requires at least: 3.0.1
|
||||||
|
Tested up to: 3.4
|
||||||
|
Stable tag: 4.3
|
||||||
|
License: GPLv2 or later
|
||||||
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
|
||||||
|
Here is a short description of the plugin. This should be no more than 150 characters. No markup here.
|
||||||
|
|
||||||
|
== Description ==
|
||||||
|
|
||||||
|
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
|
||||||
|
|
||||||
|
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
|
||||||
|
Markdown parsed.
|
||||||
|
|
||||||
|
A few notes about the sections above:
|
||||||
|
|
||||||
|
* "Contributors" is a comma separated list of wp.org/wp-plugins.org usernames
|
||||||
|
* "Tags" is a comma separated list of tags that apply to the plugin
|
||||||
|
* "Requires at least" is the lowest version that the plugin will work on
|
||||||
|
* "Tested up to" is the highest version that you've *successfully used to test the plugin*. Note that it might work on
|
||||||
|
higher versions... this is just the highest one you've verified.
|
||||||
|
* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for
|
||||||
|
stable.
|
||||||
|
|
||||||
|
Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so
|
||||||
|
if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used
|
||||||
|
for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt`
|
||||||
|
is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in
|
||||||
|
your in-development version, without having that information incorrectly disclosed about the current stable version
|
||||||
|
that lacks those changes -- as long as the trunk's `readme.txt` points to the correct stable tag.
|
||||||
|
|
||||||
|
If no stable tag is provided, it is assumed that trunk is stable, but you should specify "trunk" if that's where
|
||||||
|
you put the stable version, in order to eliminate any doubt.
|
||||||
|
|
||||||
|
== Installation ==
|
||||||
|
|
||||||
|
This section describes how to install the plugin and get it working.
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
|
||||||
|
1. Upload `biztime.php` to the `/wp-content/plugins/` directory
|
||||||
|
1. Activate the plugin through the 'Plugins' menu in WordPress
|
||||||
|
1. Place `<?php do_action('plugin_name_hook'); ?>` in your templates
|
||||||
|
|
||||||
|
== Frequently Asked Questions ==
|
||||||
|
|
||||||
|
= A question that someone might have =
|
||||||
|
|
||||||
|
An answer to that question.
|
||||||
|
|
||||||
|
= What about foo bar? =
|
||||||
|
|
||||||
|
Answer to foo bar dilemma.
|
||||||
|
|
||||||
|
== Screenshots ==
|
||||||
|
|
||||||
|
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
|
||||||
|
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
|
||||||
|
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
|
||||||
|
(or jpg, jpeg, gif).
|
||||||
|
2. This is the second screen shot
|
||||||
|
|
||||||
|
== Changelog ==
|
||||||
|
|
||||||
|
= 1.0 =
|
||||||
|
* A change since the previous version.
|
||||||
|
* Another change.
|
||||||
|
|
||||||
|
= 0.5 =
|
||||||
|
* List versions from most recent at top to oldest at bottom.
|
||||||
|
|
||||||
|
== Upgrade Notice ==
|
||||||
|
|
||||||
|
= 1.0 =
|
||||||
|
Upgrade notices describe the reason a user should upgrade. No more than 300 characters.
|
||||||
|
|
||||||
|
= 0.5 =
|
||||||
|
This version fixes a security related bug. Upgrade immediately.
|
||||||
|
|
||||||
|
== Arbitrary section ==
|
||||||
|
|
||||||
|
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
|
||||||
|
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
|
||||||
|
"installation." Arbitrary sections will be shown below the built-in sections outlined above.
|
||||||
|
|
||||||
|
== A brief Markdown Example ==
|
||||||
|
|
||||||
|
Ordered list:
|
||||||
|
|
||||||
|
1. Some feature
|
||||||
|
1. Another feature
|
||||||
|
1. Something else about the plugin
|
||||||
|
|
||||||
|
Unordered list:
|
||||||
|
|
||||||
|
* something
|
||||||
|
* something else
|
||||||
|
* third thing
|
||||||
|
|
||||||
|
Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax].
|
||||||
|
Titles are optional, naturally.
|
||||||
|
|
||||||
|
[markdown syntax]: http://daringfireball.net/projects/markdown/syntax
|
||||||
|
"Markdown is what the parser uses to process much of the readme file"
|
||||||
|
|
||||||
|
Markdown uses email style notation for blockquotes and I've been told:
|
||||||
|
> Asterisks for *emphasis*. Double it up for **strong**.
|
||||||
|
|
||||||
|
`<?php code(); // goes in backticks ?>`
|
@ -0,0 +1,358 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The admin-specific functionality of the plugin.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/admin
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The admin-specific functionality of the plugin.
|
||||||
|
*
|
||||||
|
* Defines the plugin name, version, and two examples hooks for how to
|
||||||
|
* enqueue the admin-specific stylesheet and JavaScript.
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/admin
|
||||||
|
* @author Kolarix <biztime@kolarix.com>
|
||||||
|
*/
|
||||||
|
class Biztime_Admin {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ID of this plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
* @var string $plugin_name The ID of this plugin.
|
||||||
|
*/
|
||||||
|
private $plugin_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version of this plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
* @var string $version The current version of this plugin.
|
||||||
|
*/
|
||||||
|
private $version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the class and set its properties.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @param string $plugin_name The name of this plugin.
|
||||||
|
* @param string $version The version of this plugin.
|
||||||
|
*/
|
||||||
|
public function __construct( $plugin_name, $version ) {
|
||||||
|
|
||||||
|
$this->plugin_name = $plugin_name;
|
||||||
|
$this->version = $version;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the stylesheets for the admin area.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function enqueue_styles() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is provided for demonstration purposes only.
|
||||||
|
*
|
||||||
|
* An instance of this class should be passed to the run() function
|
||||||
|
* defined in Biztime_Loader as all of the hooks are defined
|
||||||
|
* in that particular class.
|
||||||
|
*
|
||||||
|
* The Biztime_Loader will then create the relationship
|
||||||
|
* between the defined hooks and the functions defined in this
|
||||||
|
* class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/biztime-admin.css', array(), $this->version, 'all' );
|
||||||
|
wp_enqueue_style( $this->plugin_name . '-timepicker', plugin_dir_url( __FILE__ ) . 'css/timepicker.min.css', array(), $this->version, 'all' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the JavaScript for the admin area.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function enqueue_scripts() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is provided for demonstration purposes only.
|
||||||
|
*
|
||||||
|
* An instance of this class should be passed to the run() function
|
||||||
|
* defined in Biztime_Loader as all of the hooks are defined
|
||||||
|
* in that particular class.
|
||||||
|
*
|
||||||
|
* The Biztime_Loader will then create the relationship
|
||||||
|
* between the defined hooks and the functions defined in this
|
||||||
|
* class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/biztime-admin.js', array( 'jquery' ), $this->version, false );
|
||||||
|
wp_enqueue_script( $this->plugin_name . '-timepicker', plugin_dir_url( __FILE__ ) . 'js/timepicker.min.js', array( 'jquery' ), $this->version, false );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the settings page for the admin area.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function register_settings_page() {
|
||||||
|
|
||||||
|
add_submenu_page(
|
||||||
|
'options-general.php',
|
||||||
|
__( 'Biztime', 'biztime' ),
|
||||||
|
__( 'Biztime', 'biztime' ),
|
||||||
|
'manage_options',
|
||||||
|
'biztime',
|
||||||
|
array( $this, 'display_settings_page' )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the settings page content for the page we have created.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function display_settings_page() {
|
||||||
|
|
||||||
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/biztime-admin-display.php';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the settings for our settings page.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function register_settings() {
|
||||||
|
|
||||||
|
register_setting(
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
array( $this, 'biztime_register_availability' )
|
||||||
|
);
|
||||||
|
|
||||||
|
add_settings_section(
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
__('Availability', 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_section' ),
|
||||||
|
$this->plugin_name . '-availability'
|
||||||
|
);
|
||||||
|
|
||||||
|
$days = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
|
||||||
|
|
||||||
|
foreach ( $days as $day ) {
|
||||||
|
add_settings_field(
|
||||||
|
$day,
|
||||||
|
__( ucfirst( $day ), 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_fields' ),
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
array(
|
||||||
|
'label_for' => $day,
|
||||||
|
'description' => __( 'Available', 'biztime' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
add_settings_field(
|
||||||
|
'phone-number',
|
||||||
|
__( 'Phone number', 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_input' ),
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
array(
|
||||||
|
'label_for' => 'phone-number',
|
||||||
|
'description' => __('Number to be shown in modal', 'biztime' ),
|
||||||
|
'default' => __( '+01 123 4567', 'biztime' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
add_settings_field(
|
||||||
|
'true-msg',
|
||||||
|
__( 'Message when available', 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_textarea' ),
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
array(
|
||||||
|
'label_for' => 'true-msg',
|
||||||
|
'description' => __('Message to be displayed when user visits page during available hours', 'biztime' ),
|
||||||
|
'default' => __( 'We are open!', 'biztime' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
add_settings_field(
|
||||||
|
'false-msg',
|
||||||
|
__( 'Message when not available', 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_textarea' ),
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
array(
|
||||||
|
'label_for' => 'false-msg',
|
||||||
|
'description' => __('Message to be displayed when user visits page during unavailable hours', 'biztime' ),
|
||||||
|
'default' => __( 'We are currently closed!', 'biztime' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
add_settings_field(
|
||||||
|
'show-next',
|
||||||
|
__( 'Next available day', 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_checkbox' ),
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
array(
|
||||||
|
'label_for' => 'show-next',
|
||||||
|
'description' => __('Show the next available day?', 'biztime' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
add_settings_field(
|
||||||
|
'next-msg',
|
||||||
|
__( 'Next available day message', 'biztime' ),
|
||||||
|
array( $this, 'biztime_add_availability_textarea' ),
|
||||||
|
$this->plugin_name . '-availability',
|
||||||
|
$this->plugin_name . '-availability-section',
|
||||||
|
array(
|
||||||
|
'label_for' => 'next-msg',
|
||||||
|
'description' => __('Message to be displayed with the next available day', 'biztime' ),
|
||||||
|
'default' => __( 'We are back in business on:', 'biztime' )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Section for the settings.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function biztime_add_availability_section() {
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Availability fields, checkbox and two inputs with timepicker.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function biztime_add_availability_fields( $args ) {
|
||||||
|
|
||||||
|
$field_id = $args['label_for'];
|
||||||
|
$options = get_option( $this->plugin_name . '-availability', array(), 'no' );
|
||||||
|
$to = '';
|
||||||
|
$from = '';
|
||||||
|
|
||||||
|
if ( !empty( $options[$field_id]['check'] ) ) {
|
||||||
|
$to = !empty( $options[$field_id]['to'] ) ? esc_attr( $options[$field_id]['to'] ) : '';
|
||||||
|
$from = !empty( $options[$field_id]['from'] ) ? esc_attr( $options[$field_id]['from'] ) : '';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<input class="day-checkbox" type="checkbox" name="<?php echo $this->plugin_name . '-availability[' . $field_id . '][check]'; ?>" id="<?php echo $this->plugin_name . '-availability[' . $field_id . '][check]'; ?>" <?php checked( !empty( $options[$field_id]['check'] ), true ); ?> />
|
||||||
|
|
||||||
|
<label class="label" for="<?php echo $this->plugin_name . '-availability[' . $field_id . '][from]'; ?>">
|
||||||
|
From:
|
||||||
|
<input class="timepicker" type="text" name="<?php echo $this->plugin_name . '-availability[' . $field_id . '][from]'; ?>" id="<?php echo $this->plugin_name . '-availability[' . $field_id . '][from]'; ?>" value="<?php echo $from; ?>" />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="label" for="<?php echo $this->plugin_name . '-availability[' . $field_id . '][to]'; ?>">
|
||||||
|
To:
|
||||||
|
<input class="timepicker" type="text" name="<?php echo $this->plugin_name . '-availability[' . $field_id . '][to]'; ?>" id="<?php echo $this->plugin_name . '-availability[' . $field_id . '][to]'; ?>" value="<?php echo $to; ?>" />
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Phone number input
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function biztime_add_availability_input( $args ) {
|
||||||
|
|
||||||
|
$field_id = $args['label_for'];
|
||||||
|
$field_description = $args['description'];
|
||||||
|
$field_default = $args['default'];
|
||||||
|
|
||||||
|
$options = get_option( $this->plugin_name . '-availability', array(), 'no' );
|
||||||
|
$option = $field_default;
|
||||||
|
|
||||||
|
if ( ! empty( $options[ $field_id ] ) ) {
|
||||||
|
|
||||||
|
$option = $options[ $field_id ];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<input type="text" name="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>" id="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>" value="<?php echo esc_attr( $option ); ?>" class="regular-text" />
|
||||||
|
<p class="description"><?php echo esc_html( $field_description ); ?></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Availability messages textarea
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function biztime_add_availability_textarea( $args ) {
|
||||||
|
|
||||||
|
$field_id = $args['label_for'];
|
||||||
|
$field_description = $args['description'];
|
||||||
|
$field_default = $args['default'];
|
||||||
|
|
||||||
|
$options = get_option( $this->plugin_name . '-availability', array(), 'no' );
|
||||||
|
$option = $field_default;
|
||||||
|
|
||||||
|
if ( ! empty( $options[ $field_id ] ) ) {
|
||||||
|
|
||||||
|
$option = $options[ $field_id ];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<textarea name="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>" id="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>" class="regular-text" rows="4"><?php echo esc_textarea( $option ); ?></textarea>
|
||||||
|
<p class="description"><?php echo esc_html( $field_description ); ?></p>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Next available day checkbox.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function biztime_add_availability_checkbox( $args ) {
|
||||||
|
$field_id = $args['label_for'];
|
||||||
|
$field_description = $args['description'];
|
||||||
|
$options = get_option( $this->plugin_name . '-availability', array(), 'no' );
|
||||||
|
$option = isset( $options[ $field_id ] ) ? $options[ $field_id ] : 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<label for="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>">
|
||||||
|
<input type="checkbox" name="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>" id="<?php echo $this->plugin_name . '-availability[' . $field_id . ']'; ?>" <?php checked( $option, 1 ); ?> value="1" />
|
||||||
|
<?php echo esc_html( $field_description ); ?>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* All of the CSS for your admin-specific functionality should be
|
||||||
|
* included in this file.
|
||||||
|
*/
|
||||||
|
.label {
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
.day-checkbox:checked ~ .label {
|
||||||
|
pointer-events: initial;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
.ui-timepicker-container{position:absolute;overflow:hidden;box-sizing:border-box}.ui-timepicker,.ui-timepicker-viewport{box-sizing:content-box;height:205px;display:block;margin:0}.ui-timepicker{list-style:none;padding:0 1px;text-align:center}.ui-timepicker-viewport{padding:0;overflow:auto;overflow-x:hidden}.ui-timepicker-standard{font-family:Verdana,Arial,sans-serif;font-size:1.1em;background-color:#FFF;border:1px solid #AAA;color:#222;margin:0;padding:2px}.ui-timepicker-standard a{border:1px solid transparent;color:#222;display:block;padding:.2em .4em;text-decoration:none}.ui-timepicker-standard .ui-state-hover{background-color:#DADADA;border:1px solid #999;font-weight:400;color:#212121}.ui-timepicker-standard .ui-menu-item{margin:0;padding:0}.ui-timepicker-corners,.ui-timepicker-corners .ui-corner-all{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.ui-timepicker-hidden{display:none}.ui-timepicker-no-scrollbar .ui-timepicker{border:none}
|
@ -0,0 +1 @@
|
|||||||
|
<?php // Silence is golden
|
@ -0,0 +1,32 @@
|
|||||||
|
(function( $ ) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All of the code for your admin-facing JavaScript source
|
||||||
|
* should reside in this file.
|
||||||
|
*
|
||||||
|
* Note: It has been assumed you will write jQuery code here, so the
|
||||||
|
* $ function reference has been prepared for usage within the scope
|
||||||
|
* of this function.
|
||||||
|
*
|
||||||
|
* This enables you to define handlers, for when the DOM is ready:
|
||||||
|
*
|
||||||
|
* $(function() {
|
||||||
|
*
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* When the window is loaded:
|
||||||
|
*
|
||||||
|
* $( window ).load(function() {
|
||||||
|
*
|
||||||
|
* });
|
||||||
|
*
|
||||||
|
* ...and/or other possibilities.
|
||||||
|
*
|
||||||
|
* Ideally, it is not considered best practise to attach more than a
|
||||||
|
* single DOM-ready or window-load handler for a particular page.
|
||||||
|
* Although scripts in the WordPress core, Plugins and Themes may be
|
||||||
|
* practising this, we should strive to set a better example in our own work.
|
||||||
|
*/
|
||||||
|
|
||||||
|
})( jQuery );
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide a admin area view for the plugin
|
||||||
|
*
|
||||||
|
* This file is used to markup the admin-facing aspects of the plugin.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/admin/partials
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<form method="post" action="options.php">
|
||||||
|
<?php
|
||||||
|
settings_fields( 'biztime-availability' );
|
||||||
|
do_settings_sections( 'biztime-availability' );
|
||||||
|
submit_button();
|
||||||
|
?>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" defer>
|
||||||
|
jQuery(document).ready(function($) {
|
||||||
|
$('.timepicker').timepicker({
|
||||||
|
timeFormat: 'h:mm p',
|
||||||
|
interval: 30,
|
||||||
|
startTime: '05:00',
|
||||||
|
dynamic: false,
|
||||||
|
dropdown: true,
|
||||||
|
scrollbar: true
|
||||||
|
});
|
||||||
|
})
|
||||||
|
</script>
|
@ -0,0 +1,82 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The plugin bootstrap file
|
||||||
|
*
|
||||||
|
* This file is read by WordPress to generate the plugin information in the plugin
|
||||||
|
* admin area. This file also includes all of the dependencies used by the plugin,
|
||||||
|
* registers the activation and deactivation functions, and defines a function
|
||||||
|
* that starts the plugin.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
* @package BizTime
|
||||||
|
*
|
||||||
|
* @wordpress-plugin
|
||||||
|
* Plugin Name: BizTime
|
||||||
|
* Plugin URI: https://kolarix.com/biztime
|
||||||
|
* Description: The plugin shows available times and displays different messages depending on availability.
|
||||||
|
* Version: 1.0.0
|
||||||
|
* Author: Kolarix
|
||||||
|
* Author URI: https://kolarix.com/biztime
|
||||||
|
* License: GPL-2.0+
|
||||||
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||||
|
* Text Domain: biztime
|
||||||
|
* Domain Path: /languages
|
||||||
|
*/
|
||||||
|
|
||||||
|
// If this file is called directly, abort.
|
||||||
|
if ( ! defined( 'WPINC' ) ) {
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Currently plugin version.
|
||||||
|
* Start at version 1.0.0 and use SemVer - https://semver.org
|
||||||
|
* Rename this for your plugin and update it as you release new versions.
|
||||||
|
*/
|
||||||
|
define( 'BIZTIME_VERSION', '1.0.0' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The code that runs during plugin activation.
|
||||||
|
* This action is documented in includes/class-biztime-activator.php
|
||||||
|
*/
|
||||||
|
function activate_biztime() {
|
||||||
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-biztime-activator.php';
|
||||||
|
Biztime_Activator::activate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The code that runs during plugin deactivation.
|
||||||
|
* This action is documented in includes/class-biztime-deactivator.php
|
||||||
|
*/
|
||||||
|
function deactivate_biztime() {
|
||||||
|
require_once plugin_dir_path( __FILE__ ) . 'includes/class-biztime-deactivator.php';
|
||||||
|
Biztime_Deactivator::deactivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
register_activation_hook( __FILE__, 'activate_biztime' );
|
||||||
|
register_deactivation_hook( __FILE__, 'deactivate_biztime' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The core plugin class that is used to define internationalization,
|
||||||
|
* admin-specific hooks, and public-facing site hooks.
|
||||||
|
*/
|
||||||
|
require plugin_dir_path( __FILE__ ) . 'includes/class-biztime.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Begins execution of the plugin.
|
||||||
|
*
|
||||||
|
* Since everything within the plugin is registered via hooks,
|
||||||
|
* then kicking off the plugin from this point in the file does
|
||||||
|
* not affect the page life cycle.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
function run_biztime() {
|
||||||
|
|
||||||
|
$plugin = new Biztime();
|
||||||
|
$plugin->run();
|
||||||
|
|
||||||
|
}
|
||||||
|
run_biztime();
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fired during plugin activation
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fired during plugin activation.
|
||||||
|
*
|
||||||
|
* This class defines all code necessary to run during the plugin's activation.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
* @author Kolarix <biztime@kolarix.com>
|
||||||
|
*/
|
||||||
|
class Biztime_Activator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Short Description. (use period)
|
||||||
|
*
|
||||||
|
* Long Description.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function activate() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fired during plugin deactivation
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fired during plugin deactivation.
|
||||||
|
*
|
||||||
|
* This class defines all code necessary to run during the plugin's deactivation.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
* @author Kolarix <hello@Kolarix.io>
|
||||||
|
*/
|
||||||
|
class Biztime_Deactivator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Short Description. (use period)
|
||||||
|
*
|
||||||
|
* Long Description.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function deactivate() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the internationalization functionality
|
||||||
|
*
|
||||||
|
* Loads and defines the internationalization files for this plugin
|
||||||
|
* so that it is ready for translation.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the internationalization functionality.
|
||||||
|
*
|
||||||
|
* Loads and defines the internationalization files for this plugin
|
||||||
|
* so that it is ready for translation.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
* @author Kolarix <biztime@kolarix.com>
|
||||||
|
*/
|
||||||
|
class Biztime_i18n {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the plugin text domain for translation.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function load_plugin_textdomain() {
|
||||||
|
|
||||||
|
load_plugin_textdomain(
|
||||||
|
'biztime',
|
||||||
|
false,
|
||||||
|
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,157 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register all actions and filters for the plugin
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register all actions and filters for the plugin.
|
||||||
|
*
|
||||||
|
* Maintain a list of all hooks that are registered throughout
|
||||||
|
* the plugin, and register them with the WordPress API. Call the
|
||||||
|
* run function to execute the list of actions and filters.
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
* @author Kolarix <biztime@kolarix.com>
|
||||||
|
*/
|
||||||
|
class Biztime_Loader {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The array of actions registered with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access protected
|
||||||
|
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
|
||||||
|
*/
|
||||||
|
protected $actions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The array of filters registered with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access protected
|
||||||
|
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
|
||||||
|
*/
|
||||||
|
protected $filters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The array of shortcodes registered with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access protected
|
||||||
|
* @var array $shortcodes The shortcodes registered with WordPress to fire when the plugin loads.
|
||||||
|
*/
|
||||||
|
protected $shortcodes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the collections used to maintain the actions and filters.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
|
||||||
|
$this->actions = array();
|
||||||
|
$this->filters = array();
|
||||||
|
$this->shortcodes = array();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new action to the collection to be registered with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @param string $hook The name of the WordPress action that is being registered.
|
||||||
|
* @param object $component A reference to the instance of the object on which the action is defined.
|
||||||
|
* @param string $callback The name of the function definition on the $component.
|
||||||
|
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
|
||||||
|
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
|
||||||
|
*/
|
||||||
|
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
||||||
|
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new filter to the collection to be registered with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @param string $hook The name of the WordPress filter that is being registered.
|
||||||
|
* @param object $component A reference to the instance of the object on which the filter is defined.
|
||||||
|
* @param string $callback The name of the function definition on the $component.
|
||||||
|
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
|
||||||
|
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
|
||||||
|
*/
|
||||||
|
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
||||||
|
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new shortcode to the collection to be registered with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @param string $hook The name of the WordPress shortcode that is being registered.
|
||||||
|
* @param object $component A reference to the instance of the object on which the shortcode is defined.
|
||||||
|
* @param string $callback The name of the function definition on the $component.
|
||||||
|
* @param int $priority Optional. he priority at which the function should be fired. Default is 10.
|
||||||
|
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
|
||||||
|
*/
|
||||||
|
public function add_shortcode( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
|
||||||
|
$this->shortcodes = $this->add( $this->shortcodes, $hook, $component, $callback, $priority, $accepted_args );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A utility function that is used to register the actions and hooks into a single
|
||||||
|
* collection.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
|
||||||
|
* @param string $hook The name of the WordPress filter that is being registered.
|
||||||
|
* @param object $component A reference to the instance of the object on which the filter is defined.
|
||||||
|
* @param string $callback The name of the function definition on the $component.
|
||||||
|
* @param int $priority The priority at which the function should be fired.
|
||||||
|
* @param int $accepted_args The number of arguments that should be passed to the $callback.
|
||||||
|
* @return array The collection of actions and filters registered with WordPress.
|
||||||
|
*/
|
||||||
|
private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
|
||||||
|
|
||||||
|
$hooks[] = array(
|
||||||
|
'hook' => $hook,
|
||||||
|
'component' => $component,
|
||||||
|
'callback' => $callback,
|
||||||
|
'priority' => $priority,
|
||||||
|
'accepted_args' => $accepted_args
|
||||||
|
);
|
||||||
|
|
||||||
|
return $hooks;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the filters and actions with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function run() {
|
||||||
|
|
||||||
|
foreach ( $this->filters as $hook ) {
|
||||||
|
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( $this->actions as $hook ) {
|
||||||
|
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( $this->shortcodes as $hook ) {
|
||||||
|
add_shortcode( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,222 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file that defines the core plugin class
|
||||||
|
*
|
||||||
|
* A class definition that includes attributes and functions used across both the
|
||||||
|
* public-facing side of the site and the admin area.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The core plugin class.
|
||||||
|
*
|
||||||
|
* This is used to define internationalization, admin-specific hooks, and
|
||||||
|
* public-facing site hooks.
|
||||||
|
*
|
||||||
|
* Also maintains the unique identifier of this plugin as well as the current
|
||||||
|
* version of the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/includes
|
||||||
|
* @author Kolarix <biztime@kolarix.com>
|
||||||
|
*/
|
||||||
|
class Biztime {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The loader that's responsible for maintaining and registering all hooks that power
|
||||||
|
* the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access protected
|
||||||
|
* @var Biztime_Loader $loader Maintains and registers all hooks for the plugin.
|
||||||
|
*/
|
||||||
|
protected $loader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The unique identifier of this plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access protected
|
||||||
|
* @var string $plugin_name The string used to uniquely identify this plugin.
|
||||||
|
*/
|
||||||
|
protected $plugin_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current version of the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access protected
|
||||||
|
* @var string $version The current version of the plugin.
|
||||||
|
*/
|
||||||
|
protected $version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the core functionality of the plugin.
|
||||||
|
*
|
||||||
|
* Set the plugin name and the plugin version that can be used throughout the plugin.
|
||||||
|
* Load the dependencies, define the locale, and set the hooks for the admin area and
|
||||||
|
* the public-facing side of the site.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct() {
|
||||||
|
if ( defined( 'BIZTIME_VERSION' ) ) {
|
||||||
|
$this->version = BIZTIME_VERSION;
|
||||||
|
} else {
|
||||||
|
$this->version = '1.0.0';
|
||||||
|
}
|
||||||
|
$this->plugin_name = 'biztime';
|
||||||
|
|
||||||
|
$this->load_dependencies();
|
||||||
|
$this->set_locale();
|
||||||
|
$this->define_admin_hooks();
|
||||||
|
$this->define_public_hooks();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the required dependencies for this plugin.
|
||||||
|
*
|
||||||
|
* Include the following files that make up the plugin:
|
||||||
|
*
|
||||||
|
* - Biztime_Loader. Orchestrates the hooks of the plugin.
|
||||||
|
* - Biztime_i18n. Defines internationalization functionality.
|
||||||
|
* - Biztime_Admin. Defines all hooks for the admin area.
|
||||||
|
* - Biztime_Public. Defines all hooks for the public side of the site.
|
||||||
|
*
|
||||||
|
* Create an instance of the loader which will be used to register the hooks
|
||||||
|
* with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function load_dependencies() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class responsible for orchestrating the actions and filters of the
|
||||||
|
* core plugin.
|
||||||
|
*/
|
||||||
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-biztime-loader.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class responsible for defining internationalization functionality
|
||||||
|
* of the plugin.
|
||||||
|
*/
|
||||||
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-biztime-i18n.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class responsible for defining all actions that occur in the admin area.
|
||||||
|
*/
|
||||||
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-biztime-admin.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class responsible for defining all actions that occur in the public-facing
|
||||||
|
* side of the site.
|
||||||
|
*/
|
||||||
|
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-biztime-public.php';
|
||||||
|
|
||||||
|
$this->loader = new Biztime_Loader();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define the locale for this plugin for internationalization.
|
||||||
|
*
|
||||||
|
* Uses the Biztime_i18n class in order to set the domain and to register the hook
|
||||||
|
* with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function set_locale() {
|
||||||
|
|
||||||
|
$plugin_i18n = new Biztime_i18n();
|
||||||
|
|
||||||
|
$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register all of the hooks related to the admin area functionality
|
||||||
|
* of the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function define_admin_hooks() {
|
||||||
|
|
||||||
|
$plugin_admin = new Biztime_Admin( $this->get_plugin_name(), $this->get_version() );
|
||||||
|
|
||||||
|
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
|
||||||
|
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
|
||||||
|
$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_settings_page' );
|
||||||
|
$this->loader->add_action( 'admin_init', $plugin_admin, 'register_settings' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register all of the hooks related to the public-facing functionality
|
||||||
|
* of the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
private function define_public_hooks() {
|
||||||
|
|
||||||
|
$plugin_public = new Biztime_Public( $this->get_plugin_name(), $this->get_version() );
|
||||||
|
|
||||||
|
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
|
||||||
|
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
|
||||||
|
$this->loader->add_shortcode( 'biztime_availability_checker', $plugin_public, 'biztime_availability_checker_shortcode' );
|
||||||
|
$this->loader->add_shortcode( 'biztime_show_availability', $plugin_public,'biztime_show_availability_shortcode' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the loader to execute all of the hooks with WordPress.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function run() {
|
||||||
|
$this->loader->run();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the plugin used to uniquely identify it within the context of
|
||||||
|
* WordPress and to define internationalization functionality.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @return string The name of the plugin.
|
||||||
|
*/
|
||||||
|
public function get_plugin_name() {
|
||||||
|
return $this->plugin_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The reference to the class that orchestrates the hooks with the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @return Biztime_Loader Orchestrates the hooks of the plugin.
|
||||||
|
*/
|
||||||
|
public function get_loader() {
|
||||||
|
return $this->loader;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the version number of the plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @return string The version number of the plugin.
|
||||||
|
*/
|
||||||
|
public function get_version() {
|
||||||
|
return $this->version;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<?php // Silence is golden
|
@ -0,0 +1 @@
|
|||||||
|
<?php // Silence is golden
|
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The public-facing functionality of the plugin.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/public
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The public-facing functionality of the plugin.
|
||||||
|
*
|
||||||
|
* Defines the plugin name, version, and two examples hooks for how to
|
||||||
|
* enqueue the public-facing stylesheet and JavaScript.
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/public
|
||||||
|
* @author Kolarix <biztime@kolarix.com>
|
||||||
|
*/
|
||||||
|
class Biztime_Public {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ID of this plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
* @var string $plugin_name The ID of this plugin.
|
||||||
|
*/
|
||||||
|
private $plugin_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version of this plugin.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @access private
|
||||||
|
* @var string $version The current version of this plugin.
|
||||||
|
*/
|
||||||
|
private $version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the class and set its properties.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @param string $plugin_name The name of the plugin.
|
||||||
|
* @param string $version The version of this plugin.
|
||||||
|
*/
|
||||||
|
public function __construct( $plugin_name, $version ) {
|
||||||
|
|
||||||
|
$this->plugin_name = $plugin_name;
|
||||||
|
$this->version = $version;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the stylesheets for the public-facing side of the site.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function enqueue_styles() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is provided for demonstration purposes only.
|
||||||
|
*
|
||||||
|
* An instance of this class should be passed to the run() function
|
||||||
|
* defined in Biztime_Loader as all of the hooks are defined
|
||||||
|
* in that particular class.
|
||||||
|
*
|
||||||
|
* The Biztime_Loader will then create the relationship
|
||||||
|
* between the defined hooks and the functions defined in this
|
||||||
|
* class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/biztime-public.css', array(), $this->version, 'all' );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register the JavaScript for the public-facing side of the site.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function enqueue_scripts() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is provided for demonstration purposes only.
|
||||||
|
*
|
||||||
|
* An instance of this class should be passed to the run() function
|
||||||
|
* defined in Biztime_Loader as all of the hooks are defined
|
||||||
|
* in that particular class.
|
||||||
|
*
|
||||||
|
* The Biztime_Loader will then create the relationship
|
||||||
|
* between the defined hooks and the functions defined in this
|
||||||
|
* class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/biztime-public.js', array( 'jquery' ), $this->version, false );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function biztime_availability_checker_shortcode( $atts ) {
|
||||||
|
$options = get_option( 'biztime-availability', array(), 'no' );
|
||||||
|
$days = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
include( plugin_dir_path( __FILE__ ) . 'partials/biztime-modal-public-display.php' );
|
||||||
|
$output = ob_get_clean();
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
function biztime_show_availability_shortcode() {
|
||||||
|
$options = get_option( 'biztime-availability', array(), 'no' );
|
||||||
|
$days = array( 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
include( plugin_dir_path( __FILE__ ) . 'partials/biztime-availability-public-display.php' );
|
||||||
|
$output = ob_get_clean();
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
/**
|
||||||
|
* All of the CSS for your public-facing functionality should be
|
||||||
|
* included in this file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.modal {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid hsl(230, 11%, 40%);
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 0 10px 5px hsl(230, 11%, 40%);
|
||||||
|
margin: 10% auto;
|
||||||
|
padding: 30px;
|
||||||
|
width: 80%;
|
||||||
|
max-width: 1440px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content__wrapper {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content__wrapper p {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content__wrapper .available p {
|
||||||
|
display: inline-block;
|
||||||
|
border-bottom: 2px solid hsla(119, 72%, 55%, 0.8);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content__wrapper .available p span {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-content__wrapper .not-available p{
|
||||||
|
display: inline-block;
|
||||||
|
border-bottom: 2px solid hsla(0, 72.1%, 55.1%, 0.8);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-available {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#close-modal {
|
||||||
|
cursor: pointer;
|
||||||
|
float: right;
|
||||||
|
font-size: 36px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Available hours table */
|
||||||
|
.table-availability {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 300px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-availability tr:nth-child(odd) {
|
||||||
|
background: rgba(255, 255, 255, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-availability td {
|
||||||
|
text-transform: capitalize;
|
||||||
|
padding: 5px 10px;
|
||||||
|
color: #666666;
|
||||||
|
border-bottom: 1px solid #CCCCCC;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<?php // Silence is golden
|
@ -0,0 +1,21 @@
|
|||||||
|
(function( $ ) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// Modal toggling
|
||||||
|
$(document).ready(function($) {
|
||||||
|
$('#availability-modal').appendTo('body');
|
||||||
|
|
||||||
|
$('#open-modal').click(function() {
|
||||||
|
$('#availability-modal').fadeIn();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#close-modal, #modal').click(function() {
|
||||||
|
$('#availability-modal').fadeOut();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.modal-content').click(function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
})( jQuery );
|
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide a public-facing view for the plugin
|
||||||
|
*
|
||||||
|
* This file is used to markup the public-facing aspects of the plugin.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/public/partials
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table class="table table-availability">
|
||||||
|
<caption><?php esc_html_e( 'Business hours', 'biztime' ); ?></caption>
|
||||||
|
<?php
|
||||||
|
foreach ( $days as $day ) {
|
||||||
|
$from = ! empty( $options[ $day ]['from'] ) ? esc_attr( $options[ $day ]['from'] ) : '';
|
||||||
|
$to = ! empty( $options[ $day ]['to'] ) ? esc_attr( $options[ $day ]['to'] ) : '';
|
||||||
|
echo '<tr class="table-row"><td class="col day">' . $day . '</td><td class="col from">' . $from . '</td><td class="col to">' . $to . '</td></tr>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide a public-facing view for the plugin
|
||||||
|
*
|
||||||
|
* This file is used to markup the public-facing aspects of the plugin.
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
* @subpackage BizTime/public/partials
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$current_day = strtolower(date("l"));
|
||||||
|
$current_time = date('H:i');
|
||||||
|
$is_available = false;
|
||||||
|
$true_msg = $options['true-msg'];
|
||||||
|
$false_msg = $options['false-msg'];
|
||||||
|
$show_next = $options['show-next'];
|
||||||
|
$next_msg = $options['next-msg'];
|
||||||
|
|
||||||
|
foreach ($days as $day) {
|
||||||
|
// Convert the availability range to 24 hour format
|
||||||
|
$from = date("H:i", strtotime($options[$day]['from']));
|
||||||
|
$to = date("H:i", strtotime($options[$day]['to']));
|
||||||
|
if (!empty($options[$day]['check']) && strtotime($from) <= strtotime($current_time) && strtotime($current_time) <= strtotime($to)) {
|
||||||
|
$is_available = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="checker-demo">
|
||||||
|
<button id="open-modal" type="button" class="button primary"><?php esc_html_e( 'CHECK AVAILABILITY', 'biztime' ); ?></button>
|
||||||
|
<span class="sm-grey"><?php esc_html_e( 'TO SEE A PREVIEW', 'biztime' ); ?></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="availability-modal" class="modal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<span id="close-modal">×</span>
|
||||||
|
<div class="modal-content__wrapper">
|
||||||
|
<?php
|
||||||
|
if ($is_available) {
|
||||||
|
$phone_number = $options['phone-number'];
|
||||||
|
echo "<div class='available'><p>" . $true_msg . "</p><div class='only-when-available'>" . $phone_number . "</div></div>";
|
||||||
|
} else {
|
||||||
|
echo "<div class='not-available'><p>" . $false_msg . "</p></div>";
|
||||||
|
$next_day = null;
|
||||||
|
$start_searching = false;
|
||||||
|
|
||||||
|
foreach ($days as $day) {
|
||||||
|
if ($day === $current_day) {
|
||||||
|
$start_searching = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($start_searching && !empty($options[$day]['check'])) {
|
||||||
|
$next_day = $day;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if still not found, start from Monday again
|
||||||
|
if (!$next_day) {
|
||||||
|
foreach ($days as $day) {
|
||||||
|
if (!empty($options[$day]['check'])) {
|
||||||
|
$next_day = $day;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($next_day && $show_next) {
|
||||||
|
echo "<p class='next-available'>" . $next_msg . ucfirst($next_day) . " from " . $options[$next_day]['from'] . " to " . $options[$next_day]['to'] . ".</p>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<pre><br><span>Current:<?php print_r(date("l"));?>, <?php print_r(date('H:i'));?></span></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fired when the plugin is uninstalled.
|
||||||
|
*
|
||||||
|
* When populating this file, consider the following flow
|
||||||
|
* of control:
|
||||||
|
*
|
||||||
|
* - This method should be static
|
||||||
|
* - Check if the $_REQUEST content actually is the plugin name
|
||||||
|
* - Run an admin referrer check to make sure it goes through authentication
|
||||||
|
* - Verify the output of $_GET makes sense
|
||||||
|
* - Repeat with other user roles. Best directly by using the links/query string parameters.
|
||||||
|
* - Repeat things for multisite. Once for a single site in the network, once sitewide.
|
||||||
|
*
|
||||||
|
* This file may be updated more in future version of the Boilerplate; however, this is the
|
||||||
|
* general skeleton and outline for how the file should work.
|
||||||
|
*
|
||||||
|
* For more information, see the following discussion:
|
||||||
|
* https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
|
||||||
|
*
|
||||||
|
* @link https://kolarix.com/biztime
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @package BizTime
|
||||||
|
*/
|
||||||
|
|
||||||
|
// If uninstall not called from WordPress, then exit.
|
||||||
|
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
@ -0,0 +1,161 @@
|
|||||||
|
.fade-in-left {
|
||||||
|
-webkit-animation: fade-in-left 1s cubic-bezier(0.680, -0.550, 0.265, 1.550) both;
|
||||||
|
animation: fade-in-left 1s cubic-bezier(0.680, -0.550, 0.265, 1.550) both;
|
||||||
|
transition: opacity 0.4s ease;
|
||||||
|
}
|
||||||
|
.fade-in-right {
|
||||||
|
-webkit-animation: fade-in-right 1s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||||
|
animation: fade-in-right 1s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||||
|
transition: opacity 0.4s ease;
|
||||||
|
}
|
||||||
|
.fade-in-fwd {
|
||||||
|
-webkit-animation: fade-in-fwd 1.5s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||||
|
animation: fade-in-fwd 1.5s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||||
|
transition: opacity 0.4s ease;
|
||||||
|
}
|
||||||
|
.swing-in-top-fwd {
|
||||||
|
-webkit-animation: swing-in-top-fwd 1s cubic-bezier(0.175, 0.885, 0.320, 1.275) both;
|
||||||
|
animation: swing-in-top-fwd 1s cubic-bezier(0.175, 0.885, 0.320, 1.275) both;
|
||||||
|
transition: opacity 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.delay_01 {
|
||||||
|
-webkit-animation-delay: 0.1s;
|
||||||
|
animation-delay: 0.1s;
|
||||||
|
}
|
||||||
|
.delay_02 {
|
||||||
|
-webkit-animation-delay: 0.2s;
|
||||||
|
animation-delay: 0.2s;
|
||||||
|
}
|
||||||
|
.delay_03 {
|
||||||
|
-webkit-animation-delay: 0.3s;
|
||||||
|
animation-delay: 0.3s;
|
||||||
|
}
|
||||||
|
.delay_04 {
|
||||||
|
-webkit-animation-delay: 0.4s;
|
||||||
|
animation-delay: 0.4s;
|
||||||
|
}
|
||||||
|
.delay_05 {
|
||||||
|
-webkit-animation-delay: 0.5s;
|
||||||
|
animation-delay: 0.5s;
|
||||||
|
}
|
||||||
|
.delay_06 {
|
||||||
|
-webkit-animation-delay: 0.6s;
|
||||||
|
animation-delay: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ----------------------------------------
|
||||||
|
* animation fade-in-left
|
||||||
|
* ----------------------------------------
|
||||||
|
*/
|
||||||
|
@-webkit-keyframes fade-in-left {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: translateX(-50px);
|
||||||
|
transform: translateX(-50px);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: translateX(0);
|
||||||
|
transform: translateX(0);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes fade-in-left {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: translateX(-50px);
|
||||||
|
transform: translateX(-50px);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: translateX(0);
|
||||||
|
transform: translateX(0);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ----------------------------------------
|
||||||
|
* animation fade-in-fwd
|
||||||
|
* ----------------------------------------
|
||||||
|
*/
|
||||||
|
@-webkit-keyframes fade-in-fwd {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes fade-in-fwd {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ----------------------------------------
|
||||||
|
* animation fade-in-right
|
||||||
|
* ----------------------------------------
|
||||||
|
*/
|
||||||
|
@-webkit-keyframes fade-in-right {
|
||||||
|
0% {
|
||||||
|
margin-left: 100px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
margin-left: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes fade-in-right {
|
||||||
|
0% {
|
||||||
|
margin-left: 100px;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
margin-left: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ----------------------------------------
|
||||||
|
* animation swing-in-top-fwd
|
||||||
|
* ----------------------------------------
|
||||||
|
*/
|
||||||
|
@-webkit-keyframes swing-in-top-fwd {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: rotateX(-100deg);
|
||||||
|
transform: rotateX(-100deg);
|
||||||
|
-webkit-transform-origin: top;
|
||||||
|
transform-origin: top;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: rotateX(0deg);
|
||||||
|
transform: rotateX(0deg);
|
||||||
|
-webkit-transform-origin: top;
|
||||||
|
transform-origin: top;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes swing-in-top-fwd {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: rotateX(-100deg);
|
||||||
|
transform: rotateX(-100deg);
|
||||||
|
-webkit-transform-origin: top;
|
||||||
|
transform-origin: top;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: rotateX(0deg);
|
||||||
|
transform: rotateX(0deg);
|
||||||
|
-webkit-transform-origin: top;
|
||||||
|
transform-origin: top;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
.header {
|
||||||
|
margin-top: calc(var(--gap) * 2); }
|
||||||
|
|
||||||
|
/*# sourceMappingURL=header.css.map */
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"mappings": "AAAA,OAAQ;EACJ,UAAU,EAAE,oBAAoB",
|
||||||
|
"sources": ["header.scss"],
|
||||||
|
"names": [],
|
||||||
|
"file": "header.css"
|
||||||
|
}
|
@ -0,0 +1,125 @@
|
|||||||
|
.header {
|
||||||
|
padding: var(--gap) 0;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&-wrapper {
|
||||||
|
position: relative;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-pack: justify;
|
||||||
|
-ms-flex-pack: justify;
|
||||||
|
justify-content: space-between;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-wrapper {
|
||||||
|
font-size: 40px;
|
||||||
|
letter-spacing: 10px;
|
||||||
|
|
||||||
|
/*@media screen and (max-width: 990px) {
|
||||||
|
font-size: 0;
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: calc(var(--gap) * 2);
|
||||||
|
left: var(--gap);
|
||||||
|
width: calc(100% - var(--gap) * 2);
|
||||||
|
background: #ffffff;
|
||||||
|
padding: var(--gap);
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: 0 5px 10px 2px rgba(0, 0, 0, 0.2);
|
||||||
|
box-shadow: 0 5px 10px 2px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-item {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
margin-bottom: var(--gap);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
margin-right: var(--gap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
padding-top: var(--gap);
|
||||||
|
border-top: 1px solid var(--primary__hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
&:before {
|
||||||
|
content: '●';
|
||||||
|
color: var(--primary__hover);
|
||||||
|
padding-right: var(--gap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--primary);
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: 2px solid var(--primary);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
background: var(--primary);
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-family: "BarlowCondensed-Bold", sans-serif;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-nav {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
background-image: url("images/icon-hamburger.svg");
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transition: background-image 0.3s ease;
|
||||||
|
-o-transition: background-image 0.3s ease;
|
||||||
|
transition: background-image 0.3s ease;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-image: url("images/icon-close.svg");
|
||||||
|
background-size: contain;
|
||||||
|
-webkit-transition: background-image 0.3s ease;
|
||||||
|
-o-transition: background-image 0.3s ease;
|
||||||
|
transition: background-image 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
#main {
|
||||||
|
height: 100%; }
|
||||||
|
|
||||||
|
.section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column-reverse;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
max-height: calc(100% - var(--gap) * 2); }
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.section {
|
||||||
|
flex-direction: row;
|
||||||
|
max-height: calc(100% - var(--gap) * 4); } }
|
||||||
|
.section .article {
|
||||||
|
flex: 3;
|
||||||
|
width: 100%; }
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.section .article {
|
||||||
|
flex: 1; } }
|
||||||
|
.section .media {
|
||||||
|
flex: 2;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%; }
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.section .media {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: -30%; } }
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.section .media {
|
||||||
|
flex: 1; } }
|
||||||
|
.section .media-image {
|
||||||
|
width: 100%; }
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.section .media-image {
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
object-position: left;
|
||||||
|
padding: 60px 0; } }
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.section .media-image {
|
||||||
|
position: absolute;
|
||||||
|
height: 100%;
|
||||||
|
max-height: calc(100% - var(--gap) * 4);
|
||||||
|
margin-bottom: 0;
|
||||||
|
object-fit: none;
|
||||||
|
object-position: left center; } }
|
||||||
|
|
||||||
|
/*# sourceMappingURL=main.css.map */
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"mappings": "AAAA,KAAM;EACF,MAAM,EAAE,IAAI;;AAKhB,QAAS;EACL,OAAO,EAAE,IAAI;EACb,cAAc,EAAE,cAAc;EAC9B,WAAW,EAAE,MAAM;EACnB,MAAM,EAAE,IAAI;EACZ,UAAU,EAAE,2BAA2B;EAEvC,oCAAqC;IAPzC,QAAS;MAQD,cAAc,EAAE,GAAG;MACnB,UAAU,EAAE,2BAA2B;EAG3C,iBAAS;IACL,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,IAAI;IAEX,oCAAqC;MAJzC,iBAAS;QAKD,IAAI,EAAE,CAAC;EAIf,eAAO;IACH,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IAEZ,oCAAqC;MALzC,eAAO;QAMC,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE,IAAI;IAGtB,oCAAqC;MAZzC,eAAO;QAaC,IAAI,EAAE,CAAC;IAGX,qBAAQ;MACJ,KAAK,EAAE,IAAI;MAEX,oCAAqC;QAHzC,qBAAQ;UAIA,MAAM,EAAE,IAAI;UACZ,UAAU,EAAE,KAAK;UACjB,eAAe,EAAE,IAAI;UACrB,OAAO,EAAE,MAAM;MAGnB,oCAAqC;QAVzC,qBAAQ;UAWA,QAAQ,EAAE,QAAQ;UAClB,MAAM,EAAE,IAAI;UACZ,UAAU,EAAE,2BAA2B;UACvC,aAAa,EAAE,CAAC;UAChB,UAAU,EAAE,IAAI;UAChB,eAAe,EAAE,WAAW",
|
||||||
|
"sources": ["main.scss"],
|
||||||
|
"names": [],
|
||||||
|
"file": "main.css"
|
||||||
|
}
|
@ -0,0 +1,142 @@
|
|||||||
|
#main {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Content
|
||||||
|
|
||||||
|
.section {
|
||||||
|
text-align: center;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.article {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.content {
|
||||||
|
h1 {
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
max-height: calc(50% - 50px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wp-block-pullquote {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
margin-right: var(--gap);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-availability {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
|
||||||
|
caption {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.media {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.availability-checker {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
margin-left: var(--gap);
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-tag {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
padding: var(--gap) 0;
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
max-height: calc(50% - 50px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.checker-demo {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.primary {
|
||||||
|
margin-right: 10px;
|
||||||
|
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
padding: 10px 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-grey {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-block-image {
|
||||||
|
margin: 30px auto 0;
|
||||||
|
|
||||||
|
img {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 768px) and (max-width: 990px) {
|
||||||
|
> *:not(figure) {
|
||||||
|
max-width: calc(50% - 30px);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .wp-block-image {
|
||||||
|
float: right;
|
||||||
|
margin-top: -25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Footer
|
||||||
|
.footer {
|
||||||
|
padding: var(--gap) 0;
|
||||||
|
margin-top: 30px;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
margin-top: 200px;
|
||||||
|
margin-bottom: -200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-credits {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
p + p {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,130 @@
|
|||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
p,
|
||||||
|
figure,
|
||||||
|
blockquote,
|
||||||
|
dl,
|
||||||
|
dd{
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
position: relative;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-box-direction: normal;
|
||||||
|
-ms-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
text-rendering: optimizeSpeed;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
line-height: 1.5;
|
||||||
|
font-family: "BarlowCondensed", sans-serif;
|
||||||
|
font-size: var(--font-size__base);
|
||||||
|
background: #ffffff;
|
||||||
|
color: var(--grey-blue);
|
||||||
|
min-height: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 36px;
|
||||||
|
line-height: 1.2;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
color: var(--dark-blue);
|
||||||
|
margin: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 18px;
|
||||||
|
margin: 30px 0 var(--gap);
|
||||||
|
color: var(--dark-blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size: var(--font-size__base);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
font-size: var(--font-size__base);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
h1 {
|
||||||
|
font-size: 56px;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul,
|
||||||
|
ol {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a, a:visited {
|
||||||
|
color: var(--dark-blue);
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transition: all 0.4s ease;
|
||||||
|
-o-transition: all 0.4s ease;
|
||||||
|
transition: all 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
-webkit-transition: all 0.4s ease;
|
||||||
|
-o-transition: all 0.4s ease;
|
||||||
|
transition: all 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
img,
|
||||||
|
picture {
|
||||||
|
max-width: 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-family: "BarlowCondensed-Bold", sans-serif;
|
||||||
|
font-size: var(--font-size__base);
|
||||||
|
letter-spacing: 2px;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
background-color: transparent;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transition: all 0.4s ease;
|
||||||
|
-o-transition: all 0.4s ease;
|
||||||
|
transition: all 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
-webkit-transition: all 0.4s ease;
|
||||||
|
-o-transition: all 0.4s ease;
|
||||||
|
transition: all 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
:root {
|
||||||
|
--primary: rgb(199, 38, 166);
|
||||||
|
--primary__hover: rgba(199, 38, 166, 0.6);
|
||||||
|
--dark-blue: hsl(230, 29%, 20%);
|
||||||
|
--dark-grey-blue: hsl(230, 11%, 40%);
|
||||||
|
--grey-blue: hsl(240, 5.3%, 18.6%);
|
||||||
|
--light-grey-blue: #33cccc7a;
|
||||||
|
|
||||||
|
--font-size__base: 16px;
|
||||||
|
|
||||||
|
--gap: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
:root {
|
||||||
|
--gap: 60px;
|
||||||
|
|
||||||
|
--font-size__base: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'BarlowCondensed';
|
||||||
|
src: url('../fonts/BarlowCondensed-Regular.ttf');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'BarlowCondensed-Bold';
|
||||||
|
src: url('../fonts/BarlowCondensed-Bold.ttf');
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Barlow';
|
||||||
|
src: url('../fonts/Barlow-Regular.ttf');
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,24 @@
|
|||||||
|
<footer class="footer">
|
||||||
|
<div class="footer-wrapper wrapper">
|
||||||
|
<div class="footer-credits">
|
||||||
|
<p class="footer-copyright">©
|
||||||
|
<?php
|
||||||
|
echo date_i18n(
|
||||||
|
/* translators: Copyright date format, see https://www.php.net/date */
|
||||||
|
_x( 'Y', 'copyright date format', 'biztime' )
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p class="powered-by-wordpress">
|
||||||
|
<?php _e( 'Proudly powered by ', 'biztime' ); ?><a href="<?php echo esc_url( __( 'https://wordpress.org/', 'biztime' ) ); ?>">WordPress</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<?php wp_footer(); ?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,41 @@
|
|||||||
|
<?php get_header(); ?>
|
||||||
|
<div hidden>
|
||||||
|
<h1><?php bloginfo( 'name' ); ?></h1>
|
||||||
|
<h2><?php bloginfo( 'description' ); ?></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<main id="main">
|
||||||
|
<section class="section wrapper">
|
||||||
|
<article class="article content fade-in-left delay_03">
|
||||||
|
<?php
|
||||||
|
$slug = 'intro-left';
|
||||||
|
$post = get_page_by_path( $slug, OBJECT, 'post' );
|
||||||
|
|
||||||
|
if ( $post ) :
|
||||||
|
setup_postdata( $post );
|
||||||
|
the_content();
|
||||||
|
wp_reset_postdata();
|
||||||
|
else :
|
||||||
|
echo "<p>No post.</p>";
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</article>
|
||||||
|
<article class="article media fade-in-right delay_04">
|
||||||
|
<div class="availability-checker">
|
||||||
|
<?php
|
||||||
|
$slug = 'intro-right';
|
||||||
|
$post = get_page_by_path( $slug, OBJECT, 'post' );
|
||||||
|
|
||||||
|
if ( $post ) :
|
||||||
|
setup_postdata( $post );
|
||||||
|
the_content();
|
||||||
|
wp_reset_postdata();
|
||||||
|
else :
|
||||||
|
echo "<p>No post.</p>";
|
||||||
|
endif;
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
<?php get_footer(); ?>
|
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
if ( ! function_exists( 'biztime_setup' ) ) :
|
||||||
|
/**
|
||||||
|
* Sets up theme defaults and registers support for various
|
||||||
|
* WordPress features.
|
||||||
|
*
|
||||||
|
* Note that this function is hooked into the after_setup_theme
|
||||||
|
* hook, which runs before the init hook. The init hook is too late
|
||||||
|
* for some features, such as indicating support post thumbnails.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function biztime_setup() {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add support for custom navigation menu.
|
||||||
|
*/
|
||||||
|
register_nav_menus( array(
|
||||||
|
'primary' => __( 'Primary Menu', 'biztime' ),
|
||||||
|
) );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enqueue styles and scripts.
|
||||||
|
*/
|
||||||
|
add_action( 'wp_enqueue_scripts', 'biztime_enqueue_styles' );
|
||||||
|
wp_enqueue_script( 'biztime-script', get_template_directory_uri() . '/js/theme.js', array('jquery'), '1.0.0', true );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add favicon.
|
||||||
|
*/
|
||||||
|
add_action( 'wp_head', 'biztime_favicon' );
|
||||||
|
}
|
||||||
|
endif; // biztime_setup
|
||||||
|
add_action( 'after_setup_theme', 'biztime_setup' );
|
||||||
|
|
||||||
|
function biztime_favicon() {
|
||||||
|
echo '<link rel="shortcut icon" type="image/x-icon" href="' . get_template_directory_uri() . '/favicon.ico" />' . "\n";
|
||||||
|
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">';
|
||||||
|
}
|
||||||
|
|
||||||
|
function biztime_enqueue_styles() {
|
||||||
|
if ( ! is_admin() ) {
|
||||||
|
wp_enqueue_style( 'biztime-style', get_stylesheet_uri() );
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en-US">
|
||||||
|
<head>
|
||||||
|
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||||
|
<title>BizTime Demo</title>
|
||||||
|
<?php wp_head(); ?>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<header class="header">
|
||||||
|
<div class="header-wrapper wrapper swing-in-top-fwd">
|
||||||
|
<a href="<?php echo get_home_url(); ?>" class="logo-wrapper swing-in-top-fwd delay_01"> <span class="tag">BT</span> BizTime</a>
|
||||||
|
<nav class="navigation fade-in-fwd delay_02">
|
||||||
|
<div class="mobile-nav"></div>
|
||||||
|
<?php wp_nav_menu( array(
|
||||||
|
'theme_location' => 'primary',
|
||||||
|
'container' => false
|
||||||
|
) ); ?>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</header>
|
After Width: | Height: | Size: 259 B |
After Width: | Height: | Size: 160 B |
@ -0,0 +1,58 @@
|
|||||||
|
(function( $ ) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// Active header on scroll (970 Design - task 3)
|
||||||
|
const header = $('.header');
|
||||||
|
|
||||||
|
$(window).scroll(function() {
|
||||||
|
let scroll = window.pageYOffset;
|
||||||
|
|
||||||
|
if (scroll > 100) {
|
||||||
|
header.addClass('active');
|
||||||
|
} else {
|
||||||
|
header.removeClass('active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mobile navigation toggle
|
||||||
|
$(document).ready(function($) {
|
||||||
|
let toggleMobileNav = function() {
|
||||||
|
let menu = $('.menu'),
|
||||||
|
mobileNav = $('.mobile-nav'),
|
||||||
|
menuOpen = false;
|
||||||
|
|
||||||
|
// Check if .mobile-nav is visible
|
||||||
|
if (mobileNav.is(':visible')) {
|
||||||
|
mobileNav.click(function() {
|
||||||
|
if (!menuOpen) {
|
||||||
|
menu.slideDown();
|
||||||
|
menuOpen = true;
|
||||||
|
mobileNav.addClass('active');
|
||||||
|
} else {
|
||||||
|
menu.slideUp();
|
||||||
|
menuOpen = false;
|
||||||
|
mobileNav.removeClass('active');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).click(function(event) {
|
||||||
|
if (!$(event.target).closest(menu).length && !$(event.target).closest(mobileNav).length && mobileNav.is(':visible')) {
|
||||||
|
if (menuOpen) {
|
||||||
|
menu.slideUp();
|
||||||
|
menuOpen = false;
|
||||||
|
mobileNav.removeClass('active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
menu.show();
|
||||||
|
mobileNav.off("click");
|
||||||
|
$(document).off("click", "**");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
toggleMobileNav();
|
||||||
|
$(window).resize(toggleMobileNav);
|
||||||
|
});
|
||||||
|
|
||||||
|
})( jQuery );
|
After Width: | Height: | Size: 194 KiB |
@ -0,0 +1,242 @@
|
|||||||
|
@charset "UTF-8";
|
||||||
|
/*
|
||||||
|
Theme Name: Kolarix - BizTime
|
||||||
|
Author: Kolarix
|
||||||
|
Version: 1.1.0
|
||||||
|
*/
|
||||||
|
@import url(css/variables.css);
|
||||||
|
@import url(css/min_reset.css);
|
||||||
|
@import url(css/animations.css);
|
||||||
|
.header {
|
||||||
|
padding: var(--gap) 0;
|
||||||
|
z-index: 1; }
|
||||||
|
.header-wrapper {
|
||||||
|
position: relative;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-pack: justify;
|
||||||
|
-ms-flex-pack: justify;
|
||||||
|
justify-content: space-between;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center; }
|
||||||
|
|
||||||
|
.logo-wrapper {
|
||||||
|
font-size: 40px;
|
||||||
|
letter-spacing: 10px;
|
||||||
|
/*@media screen and (max-width: 990px) {
|
||||||
|
font-size: 0;
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
}*/ }
|
||||||
|
.logo-wrapper:hover {
|
||||||
|
text-decoration: none; }
|
||||||
|
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: calc(var(--gap) * 2);
|
||||||
|
left: var(--gap);
|
||||||
|
width: calc(100% - var(--gap) * 2);
|
||||||
|
background: #ffffff;
|
||||||
|
padding: var(--gap);
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: 0 5px 10px 2px rgba(0, 0, 0, 0.2);
|
||||||
|
box-shadow: 0 5px 10px 2px rgba(0, 0, 0, 0.2); } }
|
||||||
|
.menu-item {
|
||||||
|
display: block; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.menu-item {
|
||||||
|
display: inline-block; } }
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.menu-item:not(:last-child) {
|
||||||
|
margin-bottom: var(--gap); } }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.menu-item:not(:last-child) {
|
||||||
|
margin-right: var(--gap); } }
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.menu-item:last-child {
|
||||||
|
padding-top: var(--gap);
|
||||||
|
border-top: 1px solid var(--primary__hover); } }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.menu-item:last-child:before {
|
||||||
|
content: '●';
|
||||||
|
color: var(--primary__hover);
|
||||||
|
padding-right: var(--gap); } }
|
||||||
|
.menu-item:last-child a {
|
||||||
|
color: var(--primary);
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: 2px solid var(--primary); }
|
||||||
|
.menu-item:last-child a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
background: var(--primary);
|
||||||
|
color: #ffffff; }
|
||||||
|
.menu-item a {
|
||||||
|
font-family: "BarlowCondensed-Bold", sans-serif;
|
||||||
|
letter-spacing: 2px; }
|
||||||
|
|
||||||
|
.mobile-nav {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
background-image: url("images/icon-hamburger.svg");
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: contain;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-transition: background-image 0.3s ease;
|
||||||
|
-o-transition: background-image 0.3s ease;
|
||||||
|
transition: background-image 0.3s ease; }
|
||||||
|
.mobile-nav.active {
|
||||||
|
background-image: url("images/icon-close.svg");
|
||||||
|
background-size: contain;
|
||||||
|
-webkit-transition: background-image 0.3s ease;
|
||||||
|
-o-transition: background-image 0.3s ease;
|
||||||
|
transition: background-image 0.3s ease; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.mobile-nav {
|
||||||
|
display: none; } }
|
||||||
|
|
||||||
|
#main {
|
||||||
|
min-height: 100vh; }
|
||||||
|
|
||||||
|
.section {
|
||||||
|
text-align: center;
|
||||||
|
height: 100%; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.section {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
text-align: left; } }
|
||||||
|
.section .article {
|
||||||
|
width: 100%; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.section .article {
|
||||||
|
height: 100%; } }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.section .article.content h1 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
max-height: calc(50% - 50px); } }
|
||||||
|
.section .article.content .wp-block-pullquote {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
margin-right: var(--gap); }
|
||||||
|
.section .article.content .table-availability {
|
||||||
|
margin-bottom: 30px; }
|
||||||
|
.section .article.content .table-availability caption {
|
||||||
|
font-size: 24px; }
|
||||||
|
.section .media {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex; }
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.section .media {
|
||||||
|
margin-top: 60px; } }
|
||||||
|
.section .media .availability-checker {
|
||||||
|
position: relative; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.section .media .availability-checker {
|
||||||
|
margin-left: var(--gap);
|
||||||
|
letter-spacing: 2px; } }
|
||||||
|
.section .media .availability-checker .wp-tag {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0; }
|
||||||
|
.section .media .availability-checker h2 {
|
||||||
|
padding: var(--gap) 0; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.section .media .availability-checker h2 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
max-height: calc(50% - 50px); } }
|
||||||
|
.section .media .availability-checker .checker-demo {
|
||||||
|
text-align: center; }
|
||||||
|
.section .media .availability-checker .checker-demo .primary {
|
||||||
|
margin-right: 10px; }
|
||||||
|
@media screen and (max-width: 990px) {
|
||||||
|
.section .media .availability-checker .checker-demo .primary {
|
||||||
|
padding: 10px 15px; } }
|
||||||
|
.section .media .availability-checker .checker-demo .sm-grey {
|
||||||
|
display: inline-block; }
|
||||||
|
.section .media .availability-checker .wp-block-image {
|
||||||
|
margin: 30px auto 0; }
|
||||||
|
@media screen and (min-width: 768px) and (max-width: 990px) {
|
||||||
|
.section .media .availability-checker > *:not(figure) {
|
||||||
|
max-width: calc(50% - 30px);
|
||||||
|
width: 100%; }
|
||||||
|
.section .media .availability-checker > .wp-block-image {
|
||||||
|
float: right;
|
||||||
|
margin-top: -25%; } }
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
padding: var(--gap) 0;
|
||||||
|
margin-top: 30px;
|
||||||
|
background: #fff; }
|
||||||
|
@media screen and (min-width: 991px) {
|
||||||
|
.footer {
|
||||||
|
margin-top: 200px;
|
||||||
|
margin-bottom: -200px; } }
|
||||||
|
.footer-credits {
|
||||||
|
text-align: center; }
|
||||||
|
.footer-credits p + p {
|
||||||
|
margin-top: 5px; }
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1440px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 var(--gap); }
|
||||||
|
|
||||||
|
.sm-grey {
|
||||||
|
color: var(--grey-blue);
|
||||||
|
letter-spacing: 2px; }
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
font-family: "BarlowCondensed-Bold", sans-serif;
|
||||||
|
background: var(--dark-blue);
|
||||||
|
color: #ffffff;
|
||||||
|
letter-spacing: 0;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-right: 20px; }
|
||||||
|
|
||||||
|
.primary {
|
||||||
|
-webkit-text-fill-color: #ffffff;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: var(--primary);
|
||||||
|
padding: 20px; }
|
||||||
|
.primary:hover {
|
||||||
|
background-color: var(--primary__hover); }
|
||||||
|
|
||||||
|
body:after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
z-index: -1;
|
||||||
|
background: var(--light-grey-blue);
|
||||||
|
border-bottom-left-radius: 100px; }
|
||||||
|
|
||||||
|
body:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 50%;
|
||||||
|
top: 50%;
|
||||||
|
z-index: -1;
|
||||||
|
background: var(--light-grey-blue);
|
||||||
|
border-top-right-radius: 100px; }
|
||||||
|
|
||||||
|
/*# sourceMappingURL=style.css.map */
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"mappings": ";AAAA;;;;EAIE;AAEM,8BAAmB;AACnB,8BAAmB;AAGnB,+BAAoB;ACV5B,OAAQ;EACJ,OAAO,EAAE,YAAY;EACrB,OAAO,EAAE,CAAC;EAEV,eAAU;IACN,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,IAAI;IACb,gBAAgB,EAAE,OAAO;IACzB,aAAa,EAAE,OAAO;IACtB,eAAe,EAAE,aAAa;IAC9B,iBAAiB,EAAE,MAAM;IACzB,cAAc,EAAE,MAAM;IACtB,WAAW,EAAE,MAAM;;AAI3B,aAAc;EACV,SAAS,EAAE,IAAI;EACf,cAAc,EAAE,IAAI;AAEpB;;;;;;OAMG;EAEH,mBAAQ;IACJ,eAAe,EAAE,IAAI;;AAKzB,oCAAqC;EADzC,KAAM;IAEE,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,QAAQ;IAClB,GAAG,EAAE,oBAAoB;IACzB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,2BAA2B;IAClC,UAAU,EAAE,OAAO;IACnB,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,MAAM;IAClB,aAAa,EAAE,GAAG;IAClB,kBAAkB,EAAE,iCAAiC;IACrD,UAAU,EAAE,iCAAiC;AAGjD,UAAO;EACH,OAAO,EAAE,KAAK;EAEd,oCAAqC;IAHzC,UAAO;MAIC,OAAO,EAAE,YAAY;EAIrB,oCAAqC;IADzC,2BAAmB;MAEX,aAAa,EAAE,UAAU;EAG7B,oCAAqC;IALzC,2BAAmB;MAMX,YAAY,EAAE,UAAU;EAK5B,oCAAqC;IADzC,qBAAa;MAEL,WAAW,EAAE,UAAU;MACvB,UAAU,EAAE,+BAA+B;EAG/C,oCAAqC;IACjC,4BAAS;MACL,OAAO,EAAE,GAAG;MACZ,KAAK,EAAE,qBAAqB;MAC5B,aAAa,EAAE,UAAU;EAIjC,uBAAE;IACE,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,wBAAwB;IAEhC,6BAAQ;MACJ,eAAe,EAAE,IAAI;MACrB,UAAU,EAAE,cAAc;MAC1B,KAAK,EAAE,OAAO;EAK1B,YAAE;IACE,WAAW,EAAE,kCAAkC;IAC/C,cAAc,EAAE,GAAG;;AAK/B,WAAY;EACR,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,gBAAgB,EAAE,gCAAgC;EAClD,mBAAmB,EAAE,MAAM;EAC3B,iBAAiB,EAAE,SAAS;EAC5B,eAAe,EAAE,OAAO;EACxB,MAAM,EAAE,OAAO;EACf,kBAAkB,EAAE,0BAA0B;EAC9C,aAAa,EAAE,0BAA0B;EACzC,UAAU,EAAE,0BAA0B;EAEtC,kBAAS;IACL,gBAAgB,EAAE,4BAA4B;IAC9C,eAAe,EAAE,OAAO;IACxB,kBAAkB,EAAE,0BAA0B;IAC9C,aAAa,EAAE,0BAA0B;IACzC,UAAU,EAAE,0BAA0B;EAG1C,oCAAqC;IApBzC,WAAY;MAqBJ,OAAO,EAAE,IAAI;;AC1HrB,KAAM;EACF,UAAU,EAAE,KAAK;;AAKrB,QAAS;EACL,UAAU,EAAE,MAAM;EAClB,MAAM,EAAE,IAAI;EAEZ,oCAAqC;IAJzC,QAAS;MAKD,OAAO,EAAE,WAAW;MACpB,OAAO,EAAE,WAAW;MACpB,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,KAAK;MACb,UAAU,EAAE,IAAI;EAGpB,iBAAS;IACL,KAAK,EAAE,IAAI;IAEX,oCAAqC;MAHzC,iBAAS;QAID,MAAM,EAAE,IAAI;IAKR,oCAAqC;MADzC,4BAAG;QAEK,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,gBAAgB;IAGpC,6CAAoB;MAChB,cAAc,EAAE,IAAI;MACpB,YAAY,EAAE,UAAU;IAG5B,6CAAoB;MAChB,aAAa,EAAE,IAAI;MAEnB,qDAAQ;QACJ,SAAS,EAAE,IAAI;EAM/B,eAAO;IACH,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,IAAI;IAEb,oCAAqC;MALzC,eAAO;QAMC,UAAU,EAAE,IAAI;IAGpB,qCAAsB;MAClB,QAAQ,EAAE,QAAQ;MAElB,oCAAqC;QAHzC,qCAAsB;UAId,WAAW,EAAE,UAAU;UACvB,cAAc,EAAE,GAAG;MAGvB,6CAAQ;QACJ,QAAQ,EAAE,QAAQ;QAClB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;MAGX,wCAAG;QACC,OAAO,EAAE,YAAY;QAErB,oCAAqC;UAHzC,wCAAG;YAIK,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,MAAM;YACnB,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,gBAAgB;MAIpC,mDAAc;QACV,UAAU,EAAE,MAAM;QAElB,4DAAS;UACL,YAAY,EAAE,IAAI;UAElB,oCAAqC;YAHzC,4DAAS;cAID,OAAO,EAAE,SAAS;QAI1B,4DAAS;UACL,OAAO,EAAE,YAAY;MAI7B,qDAAgB;QACZ,MAAM,EAAE,WAAW;MAGvB,2DAA4D;QACxD,qDAAgB;UACZ,SAAS,EAAE,gBAAgB;UAC3B,KAAK,EAAE,IAAI;QAGf,uDAAkB;UACd,KAAK,EAAE,KAAK;UACZ,UAAU,EAAE,IAAI;;AAQpC,OAAQ;EACJ,OAAO,EAAE,YAAY;EACrB,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,IAAI;EAEhB,oCAAqC;IALzC,OAAQ;MAMA,UAAU,EAAE,KAAK;MACjB,aAAa,EAAE,MAAM;EAGzB,eAAU;IACN,UAAU,EAAE,MAAM;IAElB,qBAAM;MACF,UAAU,EAAE,GAAG;;AF1H3B,QAAS;EACL,KAAK,EAAE,IAAI;EACX,SAAS,EAAE,MAAM;EACjB,MAAM,EAAE,MAAM;EACd,OAAO,EAAE,YAAY;;AAGzB,QAAS;EACL,KAAK,EAAE,gBAAgB;EACvB,cAAc,EAAE,GAAG;;AAGvB,IAAK;EACD,WAAW,EAAE,kCAAkC;EAC/C,UAAU,EAAE,gBAAgB;EAC5B,KAAK,EAAE,OAAO;EACd,cAAc,EAAE,CAAC;EACjB,OAAO,EAAE,QAAQ;EACjB,aAAa,EAAE,IAAI;EACnB,YAAY,EAAE,IAAI;;AAGtB,QAAS;EACL,uBAAuB,EAAE,OAAO;EAChC,KAAK,EAAE,OAAO;EACd,gBAAgB,EAAE,cAAc;EAChC,OAAO,EAAE,IAAI;EAEb,cAAQ;IACJ,gBAAgB,EAAE,qBAAqB;;AAI/C,UAAW;EACP,OAAO,EAAE,EAAE;EACX,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,CAAC;EACN,KAAK,EAAE,CAAC;EACR,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,GAAG;EACX,OAAO,EAAE,EAAE;EACX,UAAU,EAAE,sBAAsB;EAClC,yBAAyB,EAAE,KAAK;;AAGpC,WAAY;EACR,OAAO,EAAE,EAAE;EACX,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,CAAC;EACT,IAAI,EAAE,CAAC;EACP,KAAK,EAAE,GAAG;EACV,GAAG,EAAE,GAAG;EACR,OAAO,EAAE,EAAE;EACX,UAAU,EAAE,sBAAsB;EAClC,uBAAuB,EAAE,KAAK",
|
||||||
|
"sources": ["style.scss","css/header.scss","css/main.scss"],
|
||||||
|
"names": [],
|
||||||
|
"file": "style.css"
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
Theme Name: Kolarix - BizTime
|
||||||
|
Author: Kolarix
|
||||||
|
Version: 1.1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import "css/variables.css";
|
||||||
|
@import "css/min_reset.css";
|
||||||
|
@import "css/header";
|
||||||
|
@import "css/main";
|
||||||
|
@import "css/animations.css";
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1440px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 var(--gap);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-grey {
|
||||||
|
color: var(--grey-blue);
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
font-family: "BarlowCondensed-Bold", sans-serif;
|
||||||
|
background: var(--dark-blue);
|
||||||
|
color: #ffffff;
|
||||||
|
letter-spacing: 0;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary {
|
||||||
|
-webkit-text-fill-color: #ffffff;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: var(--primary);
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: var(--primary__hover);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body:after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
z-index: -1;
|
||||||
|
background: var(--light-grey-blue);
|
||||||
|
border-bottom-left-radius: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 50%;
|
||||||
|
top: 50%;
|
||||||
|
z-index: -1;
|
||||||
|
background: var(--light-grey-blue);
|
||||||
|
border-top-right-radius: 100px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in new issue