package.json 2788 1686246753 . {"SiteURL":"https:\/\/pwnorcal.com","HomeURL":"https:\/\/pwnorcal.com","InternalSiteURL":"https:\/\/pwnorcal.com","InternalHomeURL":"https:\/\/pwnorcal.com","Plugin":{"Version":"7.75"},"WordPress":{"Version":"6.2.2","Content":"\/home\/pwnorcal\/public_html\/wp-content","Plugins":"\/home\/pwnorcal\/public_html\/wp-content\/plugins","Themes":["\/home\/pwnorcal\/public_html\/wp-content\/themes"],"Uploads":"\/home\/pwnorcal\/public_html\/wp-content\/uploads","UploadsURL":"https:\/\/pwnorcal.com\/wp-content\/uploads\/"},"Database":{"Version":"8.0.33","Charset":"utf8","Collate":"","Prefix":"NgVHZdxm_"},"PHP":{"Version":"8.1.19","System":"Linux","Integer":8},"Plugins":[],"Template":"twentytwentythree","Stylesheet":"twentytwentythree","Uploads":"","UploadsURL":"","Server":{".htaccess":"CgojIHBocCAtLSBCRUdJTiBjUGFuZWwtZ2VuZXJhdGVkIGhhbmRsZXIsIGRvIG5vdCBlZGl0CiMgU2V0IHRoZSDigJxlYS1waHA4MeKAnSBwYWNrYWdlIGFzIHRoZSBkZWZhdWx0IOKAnFBIUOKAnSBwcm9ncmFtbWluZyBsYW5ndWFnZS4KPElmTW9kdWxlIG1pbWVfbW9kdWxlPgogIEFkZEhhbmRsZXIgYXBwbGljYXRpb24veC1odHRwZC1lYS1waHA4MSAucGhwIC5waHA4IC5waHRtbAo8L0lmTW9kdWxlPgojIHBocCAtLSBFTkQgY1BhbmVsLWdlbmVyYXRlZCBoYW5kbGVyLCBkbyBub3QgZWRpdAoKIyBCRUdJTiBjUGFuZWwtZ2VuZXJhdGVkIHBocCBpbmkgZGlyZWN0aXZlcywgZG8gbm90IGVkaXQKIyBNYW51YWwgZWRpdGluZyBvZiB0aGlzIGZpbGUgbWF5IHJlc3VsdCBpbiB1bmV4cGVjdGVkIGJlaGF2aW9yLgojIFRvIG1ha2UgY2hhbmdlcyB0byB0aGlzIGZpbGUsIHVzZSB0aGUgY1BhbmVsIE11bHRpUEhQIElOSSBFZGl0b3IgKEhvbWUgPj4gU29mdHdhcmUgPj4gTXVsdGlQSFAgSU5JIEVkaXRvcikKIyBGb3IgbW9yZSBpbmZvcm1hdGlvbiwgcmVhZCBvdXIgZG9jdW1lbnRhdGlvbiAoaHR0cHM6Ly9nby5jcGFuZWwubmV0L0VBNE1vZGlmeUlOSSkKPElmTW9kdWxlIHBocDhfbW9kdWxlPgogICBwaHBfZmxhZyBkaXNwbGF5X2Vycm9ycyBPZmYKICAgcGhwX3ZhbHVlIG1heF9leGVjdXRpb25fdGltZSAzMDAKICAgcGhwX3ZhbHVlIG1heF9pbnB1dF90aW1lIDYwMAogICBwaHBfdmFsdWUgbWF4X2lucHV0X3ZhcnMgMTAwMAogICBwaHBfdmFsdWUgbWVtb3J5X2xpbWl0IDY0TQogICBwaHBfdmFsdWUgcG9zdF9tYXhfc2l6ZSA4MDBNCiAgIHBocF92YWx1ZSBzZXNzaW9uLmdjX21heGxpZmV0aW1lIDE0NDAKICAgcGhwX3ZhbHVlIHNlc3Npb24uc2F2ZV9wYXRoICIvdmFyL2NwYW5lbC9waHAvc2Vzc2lvbnMvZWEtcGhwODEiCiAgIHBocF92YWx1ZSB1cGxvYWRfbWF4X2ZpbGVzaXplIDIwME0KICAgcGhwX2ZsYWcgemxpYi5vdXRwdXRfY29tcHJlc3Npb24gT2ZmCjwvSWZNb2R1bGU+CjxJZk1vZHVsZSBsc2FwaV9tb2R1bGU+CiAgIHBocF9mbGFnIGRpc3BsYXlfZXJyb3JzIE9mZgogICBwaHBfdmFsdWUgbWF4X2V4ZWN1dGlvbl90aW1lIDMwMAogICBwaHBfdmFsdWUgbWF4X2lucHV0X3RpbWUgNjAwCiAgIHBocF92YWx1ZSBtYXhfaW5wdXRfdmFycyAxMDAwCiAgIHBocF92YWx1ZSBtZW1vcnlfbGltaXQgNjRNCiAgIHBocF92YWx1ZSBwb3N0X21heF9zaXplIDgwME0KICAgcGhwX3ZhbHVlIHNlc3Npb24uZ2NfbWF4bGlmZXRpbWUgMTQ0MAogICBwaHBfdmFsdWUgc2Vzc2lvbi5zYXZlX3BhdGggIi92YXIvY3BhbmVsL3BocC9zZXNzaW9ucy9lYS1waHA4MSIKICAgcGhwX3ZhbHVlIHVwbG9hZF9tYXhfZmlsZXNpemUgMjAwTQogICBwaHBfZmxhZyB6bGliLm91dHB1dF9jb21wcmVzc2lvbiBPZmYKPC9JZk1vZHVsZT4KIyBFTkQgY1BhbmVsLWdlbmVyYXRlZCBwaHAgaW5pIGRpcmVjdGl2ZXMsIGRvIG5vdCBlZGl0Cg==","web.config":""}}index.php 28 1326042071 . Hello, Dolly in the upper right of your admin screen on every page. Author: Matt Mullenweg Version: 1.7.2 Author URI: http://ma.tt/ */ function hello_dolly_get_lyric() { /** These are the lyrics to Hello Dolly */ $lyrics = "Hello, Dolly Well, hello, Dolly It's so nice to have you back where you belong You're lookin' swell, Dolly I can tell, Dolly You're still glowin', you're still crowin' You're still goin' strong I feel the room swayin' While the band's playin' One of our old favorite songs from way back when So, take her wrap, fellas Dolly, never go away again Hello, Dolly Well, hello, Dolly It's so nice to have you back where you belong You're lookin' swell, Dolly I can tell, Dolly You're still glowin', you're still crowin' You're still goin' strong I feel the room swayin' While the band's playin' One of our old favorite songs from way back when So, golly, gee, fellas Have a little faith in me, fellas Dolly, never go away Promise, you'll never go away Dolly'll never go away again"; // Here we split it into lines. $lyrics = explode( "\n", $lyrics ); // And then randomly choose a line. return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] ); } // This just echoes the chosen line, we'll position it later. function hello_dolly() { $chosen = hello_dolly_get_lyric(); $lang = ''; if ( 'en_' !== substr( get_user_locale(), 0, 3 ) ) { $lang = ' lang="en"'; } printf( '

%s %s

', __( 'Quote from Hello Dolly song, by Jerry Herman:' ), $lang, $chosen ); } // Now we set that function up to execute when the admin_notices action is called. add_action( 'admin_notices', 'hello_dolly' ); // We need some CSS to position the paragraph. function dolly_css() { echo " "; } add_action( 'admin_head', 'dolly_css' ); class.akismet-widget.php 3118 1632862181 plugins/akismet __( '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() { ?>

%1$s spam blocked by Akismet', '%1$s spam blocked by Akismet', $count, 'akismet' ), number_format_i18n( $count ) ), array( 'strong' => array( 'class' => true, ), ) ); ?>

status, array( 'no-sub', 'missing' ) ) ) {?>

user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>

' . esc_html( $akismet_user->user_login ) . '' ); ?>
user_email ); ?>

status == 'cancelled' ) { ?>

user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>

user_email ) ); ?>
user_email ); ?>

status == 'suspended' ) { ?>

user_email ) ); ?>

user_email, null, null, null, array( 'class' => 'akismet-jetpack-gravatar' ) ); ?>

' . esc_html( $akismet_user->user_login ) . '' ); ?>
user_email ); ?>


activate.php 177 1571739442 plugins/akismet/views

stats.php 782 1679340592 plugins/akismet/views
start.php 984 1572537035 plugins/akismet/views
status, array( 'active', 'active-dunning', 'no-sub', 'missing', 'cancelled', 'suspended' ) ) ) { Akismet::view( 'connect-jp', compact( 'akismet_user' ) ); } else { Akismet::view( 'activate' ); } ?>
setup.php 324 1582136935 plugins/akismet/views

__( 'Set up your Akismet account' , 'akismet' ), 'classes' => array( 'akismet-button', 'akismet-is-primary' ) ) ); ?>
title.php 125 1571683442 plugins/akismet/views

get.php 903 1649959802 plugins/akismet/views
config.php 12505 1679340592 plugins/akismet/views
spam > 0 ) : ?>
  • spam );?> spam, 'akismet' ) ); ?>
  • spam );?> spam, 'akismet' ) ); ?>
  • accuracy ); ?>% missed_spam, 'akismet' ), number_format( $stat_totals['all']->missed_spam ) ); ?> | false_positives, 'akismet' ), number_format( $stat_totals['all']->false_positives ) ); ?>

spam folder older than 1 day is deleted automatically.', 'Spam in the spam folder older than %2$d days is deleted automatically.', $delete_interval, 'akismet' ), admin_url( 'edit-comments.php?comment_status=spam' ), $delete_interval ); ?>

next_billing_date ) : ?>

account_name ); ?>

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; ?>

next_billing_date ); ?>

( $akismet_user->account_type == 'free-api-key' && $akismet_user->status == 'active' ? __( 'Upgrade' , 'akismet') : __( 'Change' , 'akismet') ), 'redirect' => 'upgrade' ) ); ?>
enter.php 814 1629175403 plugins/akismet/views

notice.php 12285 1674162998 plugins/akismet/views
A
Almost done - configure Akismet and say goodbye to spam', 'akismet');?>

https://akismet.com/errors/' . $code . '' ); ?>

gethostbynamel function. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet’s system requirements.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>

our guide about firewalls.', 'akismet'), 'https://blog.akismet.com/akismet-hosting-faq/'); ?>

update your payment details.', 'akismet'), 'https://akismet.com/account/'); ?>

Akismet account page to reactivate your subscription.', 'akismet'), 'https://akismet.com/account/'); ?>

Akismet support for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?>

contributing a token amount.', 'akismet'), 'https://akismet.com/account/upgrade/'); ?>

Akismet support for assistance.', 'akismet'), 'https://akismet.com/contact/'); ?>

sign into your account and choose one.', 'akismet'), 'https://akismet.com/account/upgrade/' ); ?>

contact our support team with any questions.', 'akismet' ), 'https://akismet.com/contact/' ); ?>

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' ); } ?>

check pending comments?', 'akismet' ), esc_url( $check_pending_link ) ); ?>

contact Akismet support.', 'akismet' ), 'https://akismet.com/contact/' ), array( 'a' => array( 'href' => true, 'target' => true, ), ) ); ?>

our guide about firewalls and check your server configuration.', 'akismet' ), 'https://blog.akismet.com/akismet-hosting-faq/' ), array( 'a' => array( 'href' => true, 'target' => true, ), ) ); ?>

'; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; case 'SECOND_MONTH_OVER_LIMIT': echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for two consecutive months. Next month, we will restrict your account after you reach the limit. Please consider upgrading your plan.', 'akismet' ) ); echo ''; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; case 'THIRD_MONTH_APPROACHING_LIMIT': echo esc_html( __( 'Your Akismet usage is nearing your plan’s limit for the third consecutive month. We will restrict your account after you reach the limit. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) ); echo ''; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; case 'THIRD_MONTH_OVER_LIMIT': case 'FOUR_PLUS_MONTHS_OVER_LIMIT': echo esc_html( __( 'Your Akismet usage has been over your plan’s limit for three consecutive months. We have restricted your account for the rest of the month. Upgrade your plan so Akismet can continue blocking spam.', 'akismet' ) ); echo ''; echo esc_html( __( 'Learn more about usage limits.', 'akismet' ) ); echo ''; break; default: } ?>

predefined.php 318 1572537035 plugins/akismet/views

wp-config.php' ); ?>

LICENSE.txt 18092 1440387166 plugins/akismet 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. Copyright (C) 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. , 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. class.akismet-admin.php 52528 1674162998 plugins/akismet array( 'href' => true, 'title' => true, ), 'b' => array(), 'code' => array(), 'del' => array( 'datetime' => true, ), 'em' => array(), 'i' => array(), 'q' => array( 'cite' => true, ), 'strike' => array(), 'strong' => array(), ); public static function init() { if ( ! self::$initiated ) { self::init_hooks(); } if ( isset( $_POST['action'] ) && $_POST['action'] == 'enter-key' ) { self::enter_api_key(); } } public static function init_hooks() { // The standalone stats page was removed in 3.0 for an all-in-one config and stats page. // Redirect any links that might have been bookmarked or in browser history. if ( isset( $_GET['page'] ) && 'akismet-stats-display' == $_GET['page'] ) { wp_safe_redirect( esc_url_raw( self::get_page_url( 'stats' ) ), 301 ); die; } self::$initiated = true; add_action( 'admin_init', array( 'Akismet_Admin', 'admin_init' ) ); add_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); # Priority 5, so it's called before Jetpack's admin_menu. add_action( 'admin_notices', array( 'Akismet_Admin', 'display_notice' ) ); add_action( 'admin_enqueue_scripts', array( 'Akismet_Admin', 'load_resources' ) ); add_action( 'activity_box_end', array( 'Akismet_Admin', 'dashboard_stats' ) ); add_action( 'rightnow_end', array( 'Akismet_Admin', 'rightnow_stats' ) ); add_action( 'manage_comments_nav', array( 'Akismet_Admin', 'check_for_spam_button' ) ); add_action( 'admin_action_akismet_recheck_queue', array( 'Akismet_Admin', 'recheck_queue' ) ); add_action( 'wp_ajax_akismet_recheck_queue', array( 'Akismet_Admin', 'recheck_queue' ) ); add_action( 'wp_ajax_comment_author_deurl', array( 'Akismet_Admin', 'remove_comment_author_url' ) ); add_action( 'wp_ajax_comment_author_reurl', array( 'Akismet_Admin', 'add_comment_author_url' ) ); add_action( 'jetpack_auto_activate_akismet', array( 'Akismet_Admin', 'connect_jetpack_user' ) ); add_filter( 'plugin_action_links', array( 'Akismet_Admin', 'plugin_action_links' ), 10, 2 ); add_filter( 'comment_row_actions', array( 'Akismet_Admin', 'comment_row_action' ), 10, 2 ); add_filter( 'plugin_action_links_'.plugin_basename( plugin_dir_path( __FILE__ ) . 'akismet.php'), array( 'Akismet_Admin', 'admin_plugin_settings_link' ) ); add_filter( 'wxr_export_skip_commentmeta', array( 'Akismet_Admin', 'exclude_commentmeta_from_export' ), 10, 3 ); add_filter( 'all_plugins', array( 'Akismet_Admin', 'modify_plugin_description' ) ); // priority=1 because we need ours to run before core's comment anonymizer runs, and that's registered at priority=10 add_filter( 'wp_privacy_personal_data_erasers', array( 'Akismet_Admin', 'register_personal_data_eraser' ), 1 ); } public static function admin_init() { if ( get_option( 'Activated_Akismet' ) ) { delete_option( 'Activated_Akismet' ); if ( ! headers_sent() ) { $admin_url = self::get_page_url( 'init' ); wp_redirect( $admin_url ); } } load_plugin_textdomain( 'akismet' ); add_meta_box( 'akismet-status', __('Comment History', 'akismet'), array( 'Akismet_Admin', 'comment_status_meta_box' ), 'comment', 'normal' ); if ( function_exists( 'wp_add_privacy_policy_content' ) ) { wp_add_privacy_policy_content( __( 'Akismet', 'akismet' ), __( 'We collect information about visitors who comment on Sites that use our Akismet anti-spam service. The information we collect depends on how the User sets up Akismet for the Site, but typically includes the commenter\'s IP address, user agent, referrer, and Site URL (along with other information directly provided by the commenter such as their name, username, email address, and the comment itself).', 'akismet' ) ); } } public static function admin_menu() { if ( class_exists( 'Jetpack' ) ) { add_action( 'jetpack_admin_menu', array( 'Akismet_Admin', 'load_menu' ) ); } else { self::load_menu(); } } public static function admin_head() { if ( !current_user_can( 'manage_options' ) ) return; } public static function admin_plugin_settings_link( $links ) { $settings_link = ''.__('Settings', 'akismet').''; array_unshift( $links, $settings_link ); return $links; } public static function load_menu() { if ( class_exists( 'Jetpack' ) ) { $hook = add_submenu_page( 'jetpack', __( 'Akismet Anti-Spam' , 'akismet'), __( 'Akismet Anti-Spam' , 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) ); } else { $hook = add_options_page( __('Akismet Anti-Spam', 'akismet'), __('Akismet Anti-Spam', 'akismet'), 'manage_options', 'akismet-key-config', array( 'Akismet_Admin', 'display_page' ) ); } if ( $hook ) { add_action( "load-$hook", array( 'Akismet_Admin', 'admin_help' ) ); } } public static function load_resources() { global $hook_suffix; if ( in_array( $hook_suffix, apply_filters( 'akismet_admin_page_hook_suffixes', array( 'index.php', # dashboard 'edit-comments.php', 'comment.php', 'post.php', 'settings_page_akismet-key-config', 'jetpack_page_akismet-key-config', 'plugins.php', ) ) ) ) { wp_register_style( 'akismet.css', plugin_dir_url( __FILE__ ) . '_inc/akismet.css', array(), AKISMET_VERSION ); wp_enqueue_style( 'akismet.css'); wp_register_script( 'akismet.js', plugin_dir_url( __FILE__ ) . '_inc/akismet.js', array('jquery'), AKISMET_VERSION ); wp_enqueue_script( 'akismet.js' ); $inline_js = array( 'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' ), 'strings' => array( 'Remove this URL' => __( 'Remove this URL' , 'akismet'), 'Removing...' => __( 'Removing...' , 'akismet'), 'URL removed' => __( 'URL removed' , 'akismet'), '(undo)' => __( '(undo)' , 'akismet'), 'Re-adding...' => __( 'Re-adding...' , 'akismet'), ) ); if ( isset( $_GET['akismet_recheck'] ) && wp_verify_nonce( $_GET['akismet_recheck'], 'akismet_recheck' ) ) { $inline_js['start_recheck'] = true; } if ( apply_filters( 'akismet_enable_mshots', true ) ) { $inline_js['enable_mshots'] = true; } wp_localize_script( 'akismet.js', 'WPAkismet', $inline_js ); } } /** * Add help to the Akismet page * * @return false if not the Akismet page */ public static function admin_help() { $current_screen = get_current_screen(); // Screen Content if ( current_user_can( 'manage_options' ) ) { if ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) ) { //setup page $current_screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Setup' , 'akismet') . '

' . '

' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '

' . '

' . esc_html__( 'On this page, you are able to set up the Akismet plugin.' , 'akismet') . '

', ) ); $current_screen->add_help_tab( array( 'id' => 'setup-signup', 'title' => __( 'New to Akismet' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Setup' , 'akismet') . '

' . '

' . esc_html__( 'You need to enter an API key to activate the Akismet service on your site.' , 'akismet') . '

' . '

' . sprintf( __( 'Sign up for an account on %s to get an API Key.' , 'akismet'), 'Akismet.com' ) . '

', ) ); $current_screen->add_help_tab( array( 'id' => 'setup-manual', 'title' => __( 'Enter an API Key' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Setup' , 'akismet') . '

' . '

' . esc_html__( 'If you already have an API key' , 'akismet') . '

' . '
    ' . '
  1. ' . esc_html__( 'Copy and paste the API key into the text field.' , 'akismet') . '
  2. ' . '
  3. ' . esc_html__( 'Click the Use this Key button.' , 'akismet') . '
  4. ' . '
', ) ); } elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' ) { //stats page $current_screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Stats' , 'akismet') . '

' . '

' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '

' . '

' . esc_html__( 'On this page, you are able to view stats on spam filtered on your site.' , 'akismet') . '

', ) ); } else { //configuration page $current_screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Configuration' , 'akismet') . '

' . '

' . esc_html__( 'Akismet filters out spam, so you can focus on more important things.' , 'akismet') . '

' . '

' . esc_html__( 'On this page, you are able to update your Akismet settings and view spam stats.' , 'akismet') . '

', ) ); $current_screen->add_help_tab( array( 'id' => 'settings', 'title' => __( 'Settings' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Configuration' , 'akismet') . '

' . ( Akismet::predefined_api_key() ? '' : '

' . esc_html__( 'API Key' , 'akismet') . ' - ' . esc_html__( 'Enter/remove an API key.' , 'akismet') . '

' ) . '

' . esc_html__( 'Comments' , 'akismet') . ' - ' . esc_html__( 'Show the number of approved comments beside each comment author in the comments list page.' , 'akismet') . '

' . '

' . esc_html__( 'Strictness' , 'akismet') . ' - ' . esc_html__( 'Choose to either discard the worst spam automatically or to always put all spam in spam folder.' , 'akismet') . '

', ) ); if ( ! Akismet::predefined_api_key() ) { $current_screen->add_help_tab( array( 'id' => 'account', 'title' => __( 'Account' , 'akismet'), 'content' => '

' . esc_html__( 'Akismet Configuration' , 'akismet') . '

' . '

' . esc_html__( 'Subscription Type' , 'akismet') . ' - ' . esc_html__( 'The Akismet subscription plan' , 'akismet') . '

' . '

' . esc_html__( 'Status' , 'akismet') . ' - ' . esc_html__( 'The subscription status - active, cancelled or suspended' , 'akismet') . '

', ) ); } } } // Help Sidebar $current_screen->set_help_sidebar( '

' . esc_html__( 'For more information:' , 'akismet') . '

' . '

' . esc_html__( 'Akismet FAQ' , 'akismet') . '

' . '

' . esc_html__( 'Akismet Support' , 'akismet') . '

' ); } public static function enter_api_key() { if ( ! current_user_can( 'manage_options' ) ) { die( __( 'Cheatin’ uh?', 'akismet' ) ); } if ( !wp_verify_nonce( $_POST['_wpnonce'], self::NONCE ) ) return false; foreach( array( 'akismet_strictness', 'akismet_show_user_comments_approved' ) as $option ) { update_option( $option, isset( $_POST[$option] ) && (int) $_POST[$option] == 1 ? '1' : '0' ); } if ( ! empty( $_POST['akismet_comment_form_privacy_notice'] ) ) { self::set_form_privacy_notice_option( $_POST['akismet_comment_form_privacy_notice'] ); } else { self::set_form_privacy_notice_option( 'hide' ); } if ( Akismet::predefined_api_key() ) { return false; //shouldn't have option to save key if already defined } $new_key = preg_replace( '/[^a-f0-9]/i', '', $_POST['key'] ); $old_key = Akismet::get_api_key(); if ( empty( $new_key ) ) { if ( !empty( $old_key ) ) { delete_option( 'wordpress_api_key' ); self::$notices[] = 'new-key-empty'; } } elseif ( $new_key != $old_key ) { self::save_key( $new_key ); } return true; } public static function save_key( $api_key ) { $key_status = Akismet::verify_key( $api_key ); if ( $key_status == 'valid' ) { $akismet_user = self::get_akismet_user( $api_key ); if ( $akismet_user ) { if ( in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ) ) update_option( 'wordpress_api_key', $api_key ); if ( $akismet_user->status == 'active' ) self::$notices['status'] = 'new-key-valid'; elseif ( $akismet_user->status == 'notice' ) self::$notices['status'] = $akismet_user; else self::$notices['status'] = $akismet_user->status; } else self::$notices['status'] = 'new-key-invalid'; } elseif ( in_array( $key_status, array( 'invalid', 'failed' ) ) ) self::$notices['status'] = 'new-key-'.$key_status; } public static function dashboard_stats() { if ( did_action( 'rightnow_end' ) ) { return; // We already displayed this info in the "Right Now" section } if ( !$count = get_option('akismet_spam_count') ) return; global $submenu; echo '

' . esc_html( _x( 'Spam', 'comments' , 'akismet') ) . '

'; echo '

'.sprintf( _n( 'Akismet has protected your site from %3$s spam comment.', 'Akismet has protected your site from %3$s spam comments.', $count , 'akismet'), 'https://akismet.com/wordpress/', esc_url( add_query_arg( array( 'page' => 'akismet-admin' ), admin_url( isset( $submenu['edit-comments.php'] ) ? 'edit-comments.php' : 'edit.php' ) ) ), number_format_i18n($count) ).'

'; } // WP 2.5+ public static function rightnow_stats() { if ( $count = get_option('akismet_spam_count') ) { $intro = sprintf( _n( 'Akismet has protected your site from %2$s spam comment already. ', 'Akismet has protected your site from %2$s spam comments already. ', $count , 'akismet'), 'https://akismet.com/wordpress/', number_format_i18n( $count ) ); } else { $intro = sprintf( __('Akismet blocks spam from getting to your blog. ', 'akismet'), 'https://akismet.com/wordpress/' ); } $link = add_query_arg( array( 'comment_status' => 'spam' ), admin_url( 'edit-comments.php' ) ); if ( $queue_count = self::get_spam_count() ) { $queue_text = sprintf( _n( 'There’s %1$s comment in your spam queue right now.', 'There are %1$s comments in your spam queue right now.', $queue_count , 'akismet'), number_format_i18n( $queue_count ), esc_url( $link ) ); } else { $queue_text = sprintf( __( "There’s nothing in your spam queue at the moment." , 'akismet'), esc_url( $link ) ); } $text = $intro . '
' . $queue_text; echo "

$text

\n"; } public static function check_for_spam_button( $comment_status ) { // The "Check for Spam" button should only appear when the page might be showing // a comment with comment_approved=0, which means an un-trashed, un-spammed, // not-yet-moderated comment. if ( 'all' != $comment_status && 'moderated' != $comment_status ) { return; } $link = ''; $comments_count = wp_count_comments(); echo ''; echo '
'; $classes = array( 'button-secondary', 'checkforspam', 'button-disabled' // Disable button until the page is loaded ); if ( $comments_count->moderated > 0 ) { $classes[] = 'enable-on-load'; if ( ! Akismet::get_api_key() ) { $link = self::get_page_url(); $classes[] = 'ajax-disabled'; } } echo '' . esc_html__('Check for Spam', 'akismet') . ''; echo ''; } public static function recheck_queue() { global $wpdb; Akismet::fix_scheduled_recheck(); if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) ) { return; } if ( ! wp_verify_nonce( $_POST['nonce'], 'akismet_check_for_spam' ) ) { wp_send_json( array( 'error' => __( 'You don’t have permission to do that.', 'akismet' ), )); return; } $result_counts = self::recheck_queue_portion( empty( $_POST['offset'] ) ? 0 : $_POST['offset'], empty( $_POST['limit'] ) ? 100 : $_POST['limit'] ); if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { wp_send_json( array( 'counts' => $result_counts, )); } else { $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : admin_url( 'edit-comments.php' ); wp_safe_redirect( $redirect_to ); exit; } } public static function recheck_queue_portion( $start = 0, $limit = 100 ) { global $wpdb; $paginate = ''; if ( $limit <= 0 ) { $limit = 100; } if ( $start < 0 ) { $start = 0; } $moderation = $wpdb->get_col( $wpdb->prepare( "SELECT * FROM {$wpdb->comments} WHERE comment_approved = '0' LIMIT %d OFFSET %d", $limit, $start ) ); $result_counts = array( 'processed' => count( $moderation ), 'spam' => 0, 'ham' => 0, 'error' => 0, ); foreach ( $moderation as $comment_id ) { $api_response = Akismet::recheck_comment( $comment_id, 'recheck_queue' ); if ( 'true' === $api_response ) { ++$result_counts['spam']; } elseif ( 'false' === $api_response ) { ++$result_counts['ham']; } else { ++$result_counts['error']; } } return $result_counts; } // Adds an 'x' link next to author URLs, clicking will remove the author URL and show an undo link public static function remove_comment_author_url() { if ( !empty( $_POST['id'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) { $comment_id = intval( $_POST['id'] ); $comment = get_comment( $comment_id, ARRAY_A ); if ( $comment && current_user_can( 'edit_comment', $comment['comment_ID'] ) ) { $comment['comment_author_url'] = ''; do_action( 'comment_remove_author_url' ); print( wp_update_comment( $comment ) ); die(); } } } public static function add_comment_author_url() { if ( !empty( $_POST['id'] ) && !empty( $_POST['url'] ) && check_admin_referer( 'comment_author_url_nonce' ) ) { $comment_id = intval( $_POST['id'] ); $comment = get_comment( $comment_id, ARRAY_A ); if ( $comment && current_user_can( 'edit_comment', $comment['comment_ID'] ) ) { $comment['comment_author_url'] = esc_url( $_POST['url'] ); do_action( 'comment_add_author_url' ); print( wp_update_comment( $comment ) ); die(); } } } public static function comment_row_action( $a, $comment ) { $akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true ); $akismet_error = get_comment_meta( $comment->comment_ID, 'akismet_error', true ); $user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true); $comment_status = wp_get_comment_status( $comment->comment_ID ); $desc = null; if ( $akismet_error ) { $desc = __( 'Awaiting spam check' , 'akismet'); } elseif ( !$user_result || $user_result == $akismet_result ) { // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same if ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' ) $desc = __( 'Flagged as spam by Akismet' , 'akismet'); elseif ( $akismet_result == 'false' && $comment_status == 'spam' ) $desc = __( 'Cleared by Akismet' , 'akismet'); } else { $who = get_comment_meta( $comment->comment_ID, 'akismet_user', true ); if ( $user_result == 'true' ) $desc = sprintf( __('Flagged as spam by %s', 'akismet'), $who ); else $desc = sprintf( __('Un-spammed by %s', 'akismet'), $who ); } // add a History item to the hover links, just after Edit if ( $akismet_result ) { $b = array(); foreach ( $a as $k => $item ) { $b[ $k ] = $item; if ( $k == 'edit' || $k == 'unspam' ) { $b['history'] = ' '. esc_html__('History', 'akismet') . ''; } } $a = $b; } if ( $desc ) echo ''.esc_html( $desc ).''; $show_user_comments_option = get_option( 'akismet_show_user_comments_approved' ); if ( $show_user_comments_option === false ) { // Default to active if the user hasn't made a decision. $show_user_comments_option = '1'; } $show_user_comments = apply_filters( 'akismet_show_user_comments_approved', $show_user_comments_option ); $show_user_comments = $show_user_comments === 'false' ? false : $show_user_comments; //option used to be saved as 'false' / 'true' if ( $show_user_comments ) { $comment_count = Akismet::get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url ); $comment_count = intval( $comment_count ); echo ''; } return $a; } public static function comment_status_meta_box( $comment ) { $history = Akismet::get_comment_history( $comment->comment_ID ); if ( $history ) { foreach ( $history as $row ) { $message = ''; if ( ! empty( $row['message'] ) ) { // Old versions of Akismet stored the message as a literal string in the commentmeta. // New versions don't do that for two reasons: // 1) Save space. // 2) The message can be translated into the current language of the blog, not stuck // in the language of the blog when the comment was made. $message = esc_html( $row['message'] ); } else if ( ! empty( $row['event'] ) ) { // If possible, use a current translation. switch ( $row['event'] ) { case 'recheck-spam': $message = esc_html( __( 'Akismet re-checked and caught this comment as spam.', 'akismet' ) ); break; case 'check-spam': $message = esc_html( __( 'Akismet caught this comment as spam.', 'akismet' ) ); break; case 'recheck-ham': $message = esc_html( __( 'Akismet re-checked and cleared this comment.', 'akismet' ) ); break; case 'check-ham': $message = esc_html( __( 'Akismet cleared this comment.', 'akismet' ) ); break; case 'wp-blacklisted': case 'wp-disallowed': $message = sprintf( /* translators: The placeholder is a WordPress PHP function name. */ esc_html( __( 'Comment was caught by %s.', 'akismet' ) ), function_exists( 'wp_check_comment_disallowed_list' ) ? 'wp_check_comment_disallowed_list' : 'wp_blacklist_check' ); break; case 'report-spam': if ( isset( $row['user'] ) ) { /* translators: The placeholder is a username. */ $message = esc_html( sprintf( __( '%s reported this comment as spam.', 'akismet' ), $row['user'] ) ); } else if ( ! $message ) { $message = esc_html( __( 'This comment was reported as spam.', 'akismet' ) ); } break; case 'report-ham': if ( isset( $row['user'] ) ) { /* translators: The placeholder is a username. */ $message = esc_html( sprintf( __( '%s reported this comment as not spam.', 'akismet' ), $row['user'] ) ); } else if ( ! $message ) { $message = esc_html( __( 'This comment was reported as not spam.', 'akismet' ) ); } break; case 'cron-retry-spam': $message = esc_html( __( 'Akismet caught this comment as spam during an automatic retry.', 'akismet' ) ); break; case 'cron-retry-ham': $message = esc_html( __( 'Akismet cleared this comment during an automatic retry.', 'akismet' ) ); break; case 'check-error': if ( isset( $row['meta'], $row['meta']['response'] ) ) { /* translators: The placeholder is an error response returned by the API server. */ $message = sprintf( esc_html( __( 'Akismet was unable to check this comment (response: %s) but will automatically retry later.', 'akismet' ) ), '' . esc_html( $row['meta']['response'] ) . '' ); } else { $message = esc_html( __( 'Akismet was unable to check this comment but will automatically retry later.', 'akismet' ) ); } break; case 'recheck-error': if ( isset( $row['meta'], $row['meta']['response'] ) ) { /* translators: The placeholder is an error response returned by the API server. */ $message = sprintf( esc_html( __( 'Akismet was unable to recheck this comment (response: %s).', 'akismet' ) ), '' . esc_html( $row['meta']['response'] ) . '' ); } else { $message = esc_html( __( 'Akismet was unable to recheck this comment.', 'akismet' ) ); } break; default: if ( preg_match( '/^status-changed/', $row['event'] ) ) { // Half of these used to be saved without the dash after 'status-changed'. // See https://plugins.trac.wordpress.org/changeset/1150658/akismet/trunk $new_status = preg_replace( '/^status-changed-?/', '', $row['event'] ); /* translators: The placeholder is a short string (like 'spam' or 'approved') denoting the new comment status. */ $message = sprintf( esc_html( __( 'Comment status was changed to %s', 'akismet' ) ), '' . esc_html( $new_status ) . '' ); } else if ( preg_match( '/^status-/', $row['event'] ) ) { $new_status = preg_replace( '/^status-/', '', $row['event'] ); if ( isset( $row['user'] ) ) { /* translators: %1$s is a username; %2$s is a short string (like 'spam' or 'approved') denoting the new comment status. */ $message = sprintf( esc_html( __( '%1$s changed the comment status to %2$s.', 'akismet' ) ), $row['user'], '' . esc_html( $new_status ) . '' ); } } break; } } if ( ! empty( $message ) ) { echo '

'; if ( isset( $row['time'] ) ) { $time = gmdate( 'D d M Y @ h:i:s a', $row['time'] ) . ' GMT'; /* translators: The placeholder is an amount of time, like "7 seconds" or "3 days" returned by the function human_time_diff(). */ $time_html = '' . sprintf( esc_html__( '%s ago', 'akismet' ), human_time_diff( $row['time'] ) ) . ''; echo sprintf( /* translators: %1$s is a human-readable time difference, like "3 hours ago", and %2$s is an already-translated phrase describing how a comment's status changed, like "This comment was reported as spam." */ esc_html( __( '%1$s - %2$s', 'akismet' ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $time_html, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $message ); // esc_html() is done above so that we can use HTML in $message. } else { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $message; // esc_html() is done above so that we can use HTML in $message. } echo '

'; } } } else { echo '

'; echo esc_html( __( 'No comment history.', 'akismet' ) ); echo '

'; } } public static function plugin_action_links( $links, $file ) { if ( $file == plugin_basename( plugin_dir_url( __FILE__ ) . '/akismet.php' ) ) { $links[] = ''.esc_html__( 'Settings' , 'akismet').''; } return $links; } // Total spam in queue // get_option( 'akismet_spam_count' ) is the total caught ever public static function get_spam_count( $type = false ) { global $wpdb; if ( !$type ) { // total $count = wp_cache_get( 'akismet_spam_count', 'widget' ); if ( false === $count ) { $count = wp_count_comments(); $count = $count->spam; wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 ); } return $count; } elseif ( 'comments' == $type || 'comment' == $type ) { // comments $type = ''; } return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE comment_approved = 'spam' AND comment_type = %s", $type ) ); } // Check connectivity between the WordPress blog and Akismet's servers. // Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect). public static function check_server_ip_connectivity() { $servers = $ips = array(); // Some web hosts may disable this function if ( function_exists('gethostbynamel') ) { $ips = gethostbynamel( 'rest.akismet.com' ); if ( $ips && is_array($ips) && count($ips) ) { $api_key = Akismet::get_api_key(); foreach ( $ips as $ip ) { $response = Akismet::verify_key( $api_key, $ip ); // even if the key is invalid, at least we know we have connectivity if ( $response == 'valid' || $response == 'invalid' ) $servers[$ip] = 'connected'; else $servers[$ip] = $response ? $response : 'unable to connect'; } } } return $servers; } // Simpler connectivity check public static function check_server_connectivity($cache_timeout = 86400) { $debug = array(); $debug[ 'PHP_VERSION' ] = PHP_VERSION; $debug[ 'WORDPRESS_VERSION' ] = $GLOBALS['wp_version']; $debug[ 'AKISMET_VERSION' ] = AKISMET_VERSION; $debug[ 'AKISMET__PLUGIN_DIR' ] = AKISMET__PLUGIN_DIR; $debug[ 'SITE_URL' ] = site_url(); $debug[ 'HOME_URL' ] = home_url(); $servers = get_option('akismet_available_servers'); if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false ) { $servers = self::check_server_ip_connectivity(); update_option('akismet_available_servers', $servers); update_option('akismet_connectivity_time', time()); } if ( wp_http_supports( array( 'ssl' ) ) ) { $response = wp_remote_get( 'https://rest.akismet.com/1.1/test' ); } else { $response = wp_remote_get( 'http://rest.akismet.com/1.1/test' ); } $debug[ 'gethostbynamel' ] = function_exists('gethostbynamel') ? 'exists' : 'not here'; $debug[ 'Servers' ] = $servers; $debug[ 'Test Connection' ] = $response; Akismet::log( $debug ); if ( $response && 'connected' == wp_remote_retrieve_body( $response ) ) return true; return false; } // Check the server connectivity and store the available servers in an option. public static function get_server_connectivity($cache_timeout = 86400) { return self::check_server_connectivity( $cache_timeout ); } /** * Find out whether any comments in the Pending queue have not yet been checked by Akismet. * * @return bool */ public static function are_any_comments_waiting_to_be_checked() { return !! get_comments( array( // Exclude comments that are not pending. This would happen if someone manually approved or spammed a comment // that was waiting to be checked. The akismet_error meta entry will eventually be removed by the cron recheck job. 'status' => 'hold', // This is the commentmeta that is saved when a comment couldn't be checked. 'meta_key' => 'akismet_error', // We only need to know whether at least one comment is waiting for a check. 'number' => 1, ) ); } public static function get_page_url( $page = 'config' ) { $args = array( 'page' => 'akismet-key-config' ); if ( $page == 'stats' ) { $args = array( 'page' => 'akismet-key-config', 'view' => 'stats' ); } elseif ( $page == 'delete_key' ) { $args = array( 'page' => 'akismet-key-config', 'view' => 'start', 'action' => 'delete-key', '_wpnonce' => wp_create_nonce( self::NONCE ) ); } elseif ( $page === 'init' ) { $args = array( 'page' => 'akismet-key-config', 'view' => 'start' ); } return add_query_arg( $args, menu_page_url( 'akismet-key-config', false ) ); } public static function get_akismet_user( $api_key ) { $akismet_user = false; $subscription_verification = Akismet::http_post( Akismet::build_query( array( 'key' => $api_key, 'blog' => get_option( 'home' ) ) ), 'get-subscription' ); if ( ! empty( $subscription_verification[1] ) ) { if ( 'invalid' !== $subscription_verification[1] ) { $akismet_user = json_decode( $subscription_verification[1] ); } } return $akismet_user; } public static function get_stats( $api_key ) { $stat_totals = array(); foreach( array( '6-months', 'all' ) as $interval ) { $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 $stat_totals; } public static function verify_wpcom_key( $api_key, $user_id, $extra = array() ) { $akismet_account = Akismet::http_post( Akismet::build_query( array_merge( array( 'user_id' => $user_id, 'api_key' => $api_key, 'get_account_type' => 'true' ), $extra ) ), 'verify-wpcom-key' ); if ( ! empty( $akismet_account[1] ) ) $akismet_account = json_decode( $akismet_account[1] ); Akismet::log( compact( 'akismet_account' ) ); return $akismet_account; } public static function connect_jetpack_user() { if ( $jetpack_user = self::get_jetpack_user() ) { if ( isset( $jetpack_user['user_id'] ) && isset( $jetpack_user['api_key'] ) ) { $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'], array( 'action' => 'connect_jetpack_user' ) ); if ( is_object( $akismet_user ) ) { self::save_key( $akismet_user->api_key ); return in_array( $akismet_user->status, array( 'active', 'active-dunning', 'no-sub' ) ); } } } return false; } public static function display_alert() { Akismet::view( 'notice', array( 'type' => 'alert', 'code' => (int) get_option( 'akismet_alert_code' ), 'msg' => get_option( 'akismet_alert_msg' ) ) ); } public static function get_usage_limit_alert_data() { return array( 'type' => 'usage-limit', 'code' => (int) get_option( 'akismet_alert_code' ), 'msg' => get_option( 'akismet_alert_msg' ), 'api_calls' => get_option( 'akismet_alert_api_calls' ), 'usage_limit' => get_option( 'akismet_alert_usage_limit' ), 'upgrade_plan' => get_option( 'akismet_alert_upgrade_plan' ), 'upgrade_url' => get_option( 'akismet_alert_upgrade_url' ), 'upgrade_type' => get_option( 'akismet_alert_upgrade_type' ), ); } public static function display_usage_limit_alert() { Akismet::view( 'notice', self::get_usage_limit_alert_data() ); } public static function display_spam_check_warning() { Akismet::fix_scheduled_recheck(); if ( wp_next_scheduled('akismet_schedule_cron_recheck') > time() && self::are_any_comments_waiting_to_be_checked() ) { /* * The 'akismet_display_cron_disabled_notice' filter can be used to control whether the WP-Cron disabled notice is displayed. */ if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON && apply_filters( 'akismet_display_cron_disabled_notice', true ) ) { Akismet::view( 'notice', array( 'type' => 'spam-check-cron-disabled' ) ); } else { /* translators: The Akismet configuration page URL. */ $link_text = apply_filters( 'akismet_spam_check_warning_link_text', sprintf( __( 'Please check your Akismet configuration and contact your web host if problems persist.', 'akismet' ), esc_url( self::get_page_url() ) ) ); Akismet::view( 'notice', array( 'type' => 'spam-check', 'link_text' => $link_text ) ); } } } public static function display_api_key_warning() { Akismet::view( 'notice', array( 'type' => 'plugin' ) ); } public static function display_page() { if ( !Akismet::get_api_key() || ( isset( $_GET['view'] ) && $_GET['view'] == 'start' ) ) self::display_start_page(); elseif ( isset( $_GET['view'] ) && $_GET['view'] == 'stats' ) self::display_stats_page(); else self::display_configuration_page(); } public static function display_start_page() { if ( isset( $_GET['action'] ) ) { if ( $_GET['action'] == 'delete-key' ) { if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], self::NONCE ) ) delete_option( 'wordpress_api_key' ); } } if ( $api_key = Akismet::get_api_key() && ( empty( self::$notices['status'] ) || 'existing-key-invalid' != self::$notices['status'] ) ) { self::display_configuration_page(); return; } //the user can choose to auto connect their API key by clicking a button on the akismet done page //if jetpack, get verified api key by using connected wpcom user id //if no jetpack, get verified api key by using an akismet token $akismet_user = false; if ( isset( $_GET['token'] ) && preg_match('/^(\d+)-[0-9a-f]{20}$/', $_GET['token'] ) ) $akismet_user = self::verify_wpcom_key( '', '', array( 'token' => $_GET['token'] ) ); elseif ( $jetpack_user = self::get_jetpack_user() ) $akismet_user = self::verify_wpcom_key( $jetpack_user['api_key'], $jetpack_user['user_id'] ); if ( isset( $_GET['action'] ) ) { if ( $_GET['action'] == 'save-key' ) { if ( is_object( $akismet_user ) ) { self::save_key( $akismet_user->api_key ); self::display_configuration_page(); return; } } } Akismet::view( 'start', compact( 'akismet_user' ) ); /* // To see all variants when testing. $akismet_user->status = 'no-sub'; Akismet::view( 'start', compact( 'akismet_user' ) ); $akismet_user->status = 'cancelled'; Akismet::view( 'start', compact( 'akismet_user' ) ); $akismet_user->status = 'suspended'; Akismet::view( 'start', compact( 'akismet_user' ) ); $akismet_user->status = 'other'; Akismet::view( 'start', compact( 'akismet_user' ) ); $akismet_user = false; */ } public static function display_stats_page() { Akismet::view( 'stats' ); } public static function display_configuration_page() { $api_key = Akismet::get_api_key(); $akismet_user = self::get_akismet_user( $api_key ); if ( ! $akismet_user ) { // This could happen if the user's key became invalid after it was previously valid and successfully set up. self::$notices['status'] = 'existing-key-invalid'; self::display_start_page(); return; } $stat_totals = self::get_stats( $api_key ); // If unset, create the new strictness option using the old discard option to determine its default. // If the old option wasn't set, default to discarding the blatant spam. if ( get_option( 'akismet_strictness' ) === false ) { add_option( 'akismet_strictness', ( get_option( 'akismet_discard_month' ) === 'false' ? '0' : '1' ) ); } // Sync the local "Total spam blocked" count with the authoritative count from the server. if ( isset( $stat_totals['all'], $stat_totals['all']->spam ) ) { update_option( 'akismet_spam_count', $stat_totals['all']->spam ); } $notices = array(); if ( empty( self::$notices ) ) { if ( ! empty( $stat_totals['all'] ) && isset( $stat_totals['all']->time_saved ) && $akismet_user->status == 'active' && $akismet_user->account_type == 'free-api-key' ) { $time_saved = false; if ( $stat_totals['all']->time_saved > 1800 ) { $total_in_minutes = round( $stat_totals['all']->time_saved / 60 ); $total_in_hours = round( $total_in_minutes / 60 ); $total_in_days = round( $total_in_hours / 8 ); $cleaning_up = __( 'Cleaning up spam takes time.' , 'akismet'); if ( $total_in_days > 1 ) $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %s day!', 'Akismet has saved you %s days!', $total_in_days, 'akismet' ), number_format_i18n( $total_in_days ) ); elseif ( $total_in_hours > 1 ) $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d hour!', 'Akismet has saved you %d hours!', $total_in_hours, 'akismet' ), $total_in_hours ); elseif ( $total_in_minutes >= 30 ) $time_saved = $cleaning_up . ' ' . sprintf( _n( 'Akismet has saved you %d minute!', 'Akismet has saved you %d minutes!', $total_in_minutes, 'akismet' ), $total_in_minutes ); } $notices[] = array( 'type' => 'active-notice', 'time_saved' => $time_saved ); } } if ( !isset( self::$notices['status'] ) && in_array( $akismet_user->status, array( 'cancelled', 'suspended', 'missing', 'no-sub' ) ) ) { $notices[] = array( 'type' => $akismet_user->status ); } $alert_code = get_option( 'akismet_alert_code' ); if ( isset( Akismet::$limit_notices[ $alert_code ] ) ) { $notices[] = self::get_usage_limit_alert_data(); } /* // To see all variants when testing. $notices[] = array( 'type' => 'active-notice', 'time_saved' => 'Cleaning up spam takes time. Akismet has saved you 1 minute!' ); $notices[] = array( 'type' => 'plugin' ); $notices[] = array( 'type' => 'spam-check', 'link_text' => 'Link text.' ); $notices[] = array( 'type' => 'notice', 'notice_header' => 'This is the notice header.', 'notice_text' => 'This is the notice text.' ); $notices[] = array( 'type' => 'missing-functions' ); $notices[] = array( 'type' => 'servers-be-down' ); $notices[] = array( 'type' => 'active-dunning' ); $notices[] = array( 'type' => 'cancelled' ); $notices[] = array( 'type' => 'suspended' ); $notices[] = array( 'type' => 'missing' ); $notices[] = array( 'type' => 'no-sub' ); $notices[] = array( 'type' => 'new-key-valid' ); $notices[] = array( 'type' => 'new-key-invalid' ); $notices[] = array( 'type' => 'existing-key-invalid' ); $notices[] = array( 'type' => 'new-key-failed' ); $notices[] = array( 'type' => 'usage-limit', 'api_calls' => '15000', 'usage_limit' => '10000', 'upgrade_plan' => 'Enterprise', 'upgrade_url' => 'https://akismet.com/account/' ); $notices[] = array( 'type' => 'spam-check-cron-disabled' ); */ Akismet::log( compact( 'stat_totals', 'akismet_user' ) ); Akismet::view( 'config', compact( 'api_key', 'akismet_user', 'stat_totals', 'notices' ) ); } public static function display_notice() { global $hook_suffix; if ( in_array( $hook_suffix, array( 'jetpack_page_akismet-key-config', 'settings_page_akismet-key-config' ) ) ) { // This page manages the notices and puts them inline where they make sense. return; } if ( in_array( $hook_suffix, array( 'edit-comments.php' ) ) && (int) get_option( 'akismet_alert_code' ) > 0 ) { Akismet::verify_key( Akismet::get_api_key() ); //verify that the key is still in alert state $alert_code = get_option( 'akismet_alert_code' ); if ( isset( Akismet::$limit_notices[ $alert_code ] ) ) { self::display_usage_limit_alert(); } elseif ( $alert_code > 0 ) { self::display_alert(); } } elseif ( ( 'plugins.php' === $hook_suffix || 'edit-comments.php' === $hook_suffix ) && ! Akismet::get_api_key() ) { // Show the "Set Up Akismet" banner on the comments and plugin pages if no API key has been set. self::display_api_key_warning(); } elseif ( $hook_suffix == 'edit-comments.php' && wp_next_scheduled( 'akismet_schedule_cron_recheck' ) ) { self::display_spam_check_warning(); } if ( isset( $_GET['akismet_recheck_complete'] ) ) { $recheck_count = (int) $_GET['recheck_count']; $spam_count = (int) $_GET['spam_count']; if ( $recheck_count === 0 ) { $message = __( 'There were no comments to check. Akismet will only check comments awaiting moderation.', 'akismet' ); } else { $message = sprintf( _n( 'Akismet checked %s comment.', 'Akismet checked %s comments.', $recheck_count, 'akismet' ), number_format( $recheck_count ) ); $message .= ' '; if ( $spam_count === 0 ) { $message .= __( 'No comments were caught as spam.', 'akismet' ); } else { $message .= sprintf( _n( '%s comment was caught as spam.', '%s comments were caught as spam.', $spam_count, 'akismet' ), number_format( $spam_count ) ); } } echo '

' . esc_html( $message ) . '

'; } else if ( isset( $_GET['akismet_recheck_error'] ) ) { echo '

' . esc_html( __( 'Akismet could not recheck your comments for spam.', 'akismet' ) ) . '

'; } } public static function display_status() { if ( ! self::get_server_connectivity() ) { Akismet::view( 'notice', array( 'type' => 'servers-be-down' ) ); } else if ( ! empty( self::$notices ) ) { foreach ( self::$notices as $index => $type ) { if ( is_object( $type ) ) { $notice_header = $notice_text = ''; if ( property_exists( $type, 'notice_header' ) ) { $notice_header = wp_kses( $type->notice_header, self::$allowed ); } if ( property_exists( $type, 'notice_text' ) ) { $notice_text = wp_kses( $type->notice_text, self::$allowed ); } if ( property_exists( $type, 'status' ) ) { $type = wp_kses( $type->status, self::$allowed ); Akismet::view( 'notice', compact( 'type', 'notice_header', 'notice_text' ) ); unset( self::$notices[ $index ] ); } } else { Akismet::view( 'notice', compact( 'type' ) ); unset( self::$notices[ $index ] ); } } } } private static function get_jetpack_user() { if ( !class_exists('Jetpack') ) return false; if ( defined( 'JETPACK__VERSION' ) && version_compare( JETPACK__VERSION, '7.7', '<' ) ) { // For version of Jetpack prior to 7.7. Jetpack::load_xml_rpc_client(); } $xml = new Jetpack_IXR_ClientMulticall( array( 'user_id' => get_current_user_id() ) ); $xml->addCall( 'wpcom.getUserID' ); $xml->addCall( 'akismet.getAPIKey' ); $xml->query(); Akismet::log( compact( 'xml' ) ); if ( !$xml->isError() ) { $responses = $xml->getResponse(); if ( count( $responses ) > 1 ) { // Due to a quirk in how Jetpack does multi-calls, the response order // can't be trusted to match the call order. It's a good thing our // return values can be mostly differentiated from each other. $first_response_value = array_shift( $responses[0] ); $second_response_value = array_shift( $responses[1] ); // If WPCOM ever reaches 100 billion users, this will fail. :-) if ( preg_match( '/^[a-f0-9]{12}$/i', $first_response_value ) ) { $api_key = $first_response_value; $user_id = (int) $second_response_value; } else { $api_key = $second_response_value; $user_id = (int) $first_response_value; } return compact( 'api_key', 'user_id' ); } } return false; } /** * Some commentmeta isn't useful in an export file. Suppress it (when supported). * * @param bool $exclude * @param string $key The meta key * @param object $meta The meta object * @return bool Whether to exclude this meta entry from the export. */ public static function exclude_commentmeta_from_export( $exclude, $key, $meta ) { if ( in_array( $key, array( 'akismet_as_submitted', 'akismet_rechecking', 'akismet_delayed_moderation_email' ) ) ) { return true; } return $exclude; } /** * When Akismet is active, remove the "Activate Akismet" step from the plugin description. */ public static function modify_plugin_description( $all_plugins ) { if ( isset( $all_plugins['akismet/akismet.php'] ) ) { if ( Akismet::get_api_key() ) { $all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Your site is fully configured and being protected, even while you sleep.', 'akismet' ); } else { $all_plugins['akismet/akismet.php']['Description'] = __( 'Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. It keeps your site protected even while you sleep. To get started, just go to your Akismet Settings page to set up your API key.', 'akismet' ); } } return $all_plugins; } private static function set_form_privacy_notice_option( $state ) { if ( in_array( $state, array( 'display', 'hide' ) ) ) { update_option( 'akismet_comment_form_privacy_notice', $state ); } } public static function register_personal_data_eraser( $erasers ) { $erasers['akismet'] = array( 'eraser_friendly_name' => __( 'Akismet', 'akismet' ), 'callback' => array( 'Akismet_Admin', 'erase_personal_data' ), ); return $erasers; } /** * When a user requests that their personal data be removed, Akismet has a duty to discard * any personal data we store outside of the comment itself. Right now, that is limited * to the copy of the comment we store in the akismet_as_submitted commentmeta. * * FWIW, this information would be automatically deleted after 15 days. * * @param $email_address string The email address of the user who has requested erasure. * @param $page int This function can (and will) be called multiple times to prevent timeouts, * so this argument is used for pagination. * @return array * @see https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/ */ public static function erase_personal_data( $email_address, $page = 1 ) { $items_removed = false; $number = 50; $page = (int) $page; $comments = get_comments( array( 'author_email' => $email_address, 'number' => $number, 'paged' => $page, 'order_by' => 'comment_ID', 'order' => 'ASC', ) ); foreach ( (array) $comments as $comment ) { $comment_as_submitted = get_comment_meta( $comment->comment_ID, 'akismet_as_submitted', true ); if ( $comment_as_submitted ) { delete_comment_meta( $comment->comment_ID, 'akismet_as_submitted' ); $items_removed = true; } } // Tell core if we have more comments to work on still $done = count( $comments ) < $number; return array( 'items_removed' => $items_removed, 'items_retained' => false, // always false in this example 'messages' => array(), // no messages in this example 'done' => $done, ); } } akismet-frontend.js 10733 1666634239 plugins/akismet/_inc /** * Observe how the user enters content into the comment form in order to determine whether it's a bot or not. * * Note that no actual input is being saved here, only counts and timings between events. */ ( function() { // Passive event listeners are guaranteed to never call e.preventDefault(), // but they're not supported in all browsers. Use this feature detection // to determine whether they're available for use. var supportsPassive = false; try { var opts = Object.defineProperty( {}, 'passive', { get : function() { supportsPassive = true; } } ); window.addEventListener( 'testPassive', null, opts ); window.removeEventListener( 'testPassive', null, opts ); } catch ( e ) {} function init() { var input_begin = ''; var keydowns = {}; var lastKeyup = null; var lastKeydown = null; var keypresses = []; var modifierKeys = []; var correctionKeys = []; var lastMouseup = null; var lastMousedown = null; var mouseclicks = []; var mousemoveTimer = null; var lastMousemoveX = null; var lastMousemoveY = null; var mousemoveStart = null; var mousemoves = []; var touchmoveCountTimer = null; var touchmoveCount = 0; var lastTouchEnd = null; var lastTouchStart = null; var touchEvents = []; var scrollCountTimer = null; var scrollCount = 0; var correctionKeyCodes = [ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ]; var modifierKeyCodes = [ 'Shift', 'CapsLock' ]; var forms = document.querySelectorAll( 'form[method=post]' ); for ( var i = 0; i < forms.length; i++ ) { var form = forms[i]; var formAction = form.getAttribute( 'action' ); // Ignore forms that POST directly to other domains; these could be things like payment forms. if ( formAction ) { // Check that the form is posting to an external URL, not a path. if ( formAction.indexOf( 'http://' ) == 0 || formAction.indexOf( 'https://' ) == 0 ) { if ( formAction.indexOf( 'http://' + window.location.hostname + '/' ) != 0 && formAction.indexOf( 'https://' + window.location.hostname + '/' ) != 0 ) { continue; } } } form.addEventListener( 'submit', function () { var ak_bkp = prepare_timestamp_array_for_request( keypresses ); var ak_bmc = prepare_timestamp_array_for_request( mouseclicks ); var ak_bte = prepare_timestamp_array_for_request( touchEvents ); var ak_bmm = prepare_timestamp_array_for_request( mousemoves ); var input_fields = { // When did the user begin entering any input? 'ak_bib': input_begin, // When was the form submitted? 'ak_bfs': Date.now(), // How many keypresses did they make? 'ak_bkpc': keypresses.length, // How quickly did they press a sample of keys, and how long between them? 'ak_bkp': ak_bkp, // How quickly did they click the mouse, and how long between clicks? 'ak_bmc': ak_bmc, // How many mouseclicks did they make? 'ak_bmcc': mouseclicks.length, // When did they press modifier keys (like Shift or Capslock)? 'ak_bmk': modifierKeys.join( ';' ), // When did they correct themselves? e.g., press Backspace, or use the arrow keys to move the cursor back 'ak_bck': correctionKeys.join( ';' ), // How many times did they move the mouse? 'ak_bmmc': mousemoves.length, // How many times did they move around using a touchscreen? 'ak_btmc': touchmoveCount, // How many times did they scroll? 'ak_bsc': scrollCount, // How quickly did they perform touch events, and how long between them? 'ak_bte': ak_bte, // How many touch events were there? 'ak_btec' : touchEvents.length, // How quickly did they move the mouse, and how long between moves? 'ak_bmm' : ak_bmm }; for ( var field_name in input_fields ) { var field = document.createElement( 'input' ); field.setAttribute( 'type', 'hidden' ); field.setAttribute( 'name', field_name ); field.setAttribute( 'value', input_fields[ field_name ] ); this.appendChild( field ); } }, supportsPassive ? { passive: true } : false ); form.addEventListener( 'keydown', function ( e ) { // If you hold a key down, some browsers send multiple keydown events in a row. // Ignore any keydown events for a key that hasn't come back up yet. if ( e.key in keydowns ) { return; } var keydownTime = ( new Date() ).getTime(); keydowns[ e.key ] = [ keydownTime ]; if ( ! input_begin ) { input_begin = keydownTime; } // In some situations, we don't want to record an interval since the last keypress -- for example, // on the first keypress, or on a keypress after focus has changed to another element. Normally, // we want to record the time between the last keyup and this keydown. But if they press a // key while already pressing a key, we want to record the time between the two keydowns. var lastKeyEvent = Math.max( lastKeydown, lastKeyup ); if ( lastKeyEvent ) { keydowns[ e.key ].push( keydownTime - lastKeyEvent ); } lastKeydown = keydownTime; }, supportsPassive ? { passive: true } : false ); form.addEventListener( 'keyup', function ( e ) { if ( ! ( e.key in keydowns ) ) { // This key was pressed before this script was loaded, or a mouseclick happened during the keypress, or... return; } var keyupTime = ( new Date() ).getTime(); if ( 'TEXTAREA' === e.target.nodeName || 'INPUT' === e.target.nodeName ) { if ( -1 !== modifierKeyCodes.indexOf( e.key ) ) { modifierKeys.push( keypresses.length - 1 ); } else if ( -1 !== correctionKeyCodes.indexOf( e.key ) ) { correctionKeys.push( keypresses.length - 1 ); } else { // ^ Don't record timings for keys like Shift or backspace, since they // typically get held down for longer than regular typing. var keydownTime = keydowns[ e.key ][0]; var keypress = []; // Keypress duration. keypress.push( keyupTime - keydownTime ); // Amount of time between this keypress and the previous keypress. if ( keydowns[ e.key ].length > 1 ) { keypress.push( keydowns[ e.key ][1] ); } keypresses.push( keypress ); } } delete keydowns[ e.key ]; lastKeyup = keyupTime; }, supportsPassive ? { passive: true } : false ); form.addEventListener( "focusin", function ( e ) { lastKeydown = null; lastKeyup = null; keydowns = {}; }, supportsPassive ? { passive: true } : false ); form.addEventListener( "focusout", function ( e ) { lastKeydown = null; lastKeyup = null; keydowns = {}; }, supportsPassive ? { passive: true } : false ); } document.addEventListener( 'mousedown', function ( e ) { lastMousedown = ( new Date() ).getTime(); }, supportsPassive ? { passive: true } : false ); document.addEventListener( 'mouseup', function ( e ) { if ( ! lastMousedown ) { // If the mousedown happened before this script was loaded, but the mouseup happened after... return; } var now = ( new Date() ).getTime(); var mouseclick = []; mouseclick.push( now - lastMousedown ); if ( lastMouseup ) { mouseclick.push( lastMousedown - lastMouseup ); } mouseclicks.push( mouseclick ); lastMouseup = now; // If the mouse has been clicked, don't record this time as an interval between keypresses. lastKeydown = null; lastKeyup = null; keydowns = {}; }, supportsPassive ? { passive: true } : false ); document.addEventListener( 'mousemove', function ( e ) { if ( mousemoveTimer ) { clearTimeout( mousemoveTimer ); mousemoveTimer = null; } else { mousemoveStart = ( new Date() ).getTime(); lastMousemoveX = e.offsetX; lastMousemoveY = e.offsetY; } mousemoveTimer = setTimeout( function ( theEvent, originalMousemoveStart ) { var now = ( new Date() ).getTime() - 500; // To account for the timer delay. var mousemove = []; mousemove.push( now - originalMousemoveStart ); mousemove.push( Math.round( Math.sqrt( Math.pow( theEvent.offsetX - lastMousemoveX, 2 ) + Math.pow( theEvent.offsetY - lastMousemoveY, 2 ) ) ) ); if ( mousemove[1] > 0 ) { // If there was no measurable distance, then it wasn't really a move. mousemoves.push( mousemove ); } mousemoveStart = null; mousemoveTimer = null; }, 500, e, mousemoveStart ); }, supportsPassive ? { passive: true } : false ); document.addEventListener( 'touchmove', function ( e ) { if ( touchmoveCountTimer ) { clearTimeout( touchmoveCountTimer ); } touchmoveCountTimer = setTimeout( function () { touchmoveCount++; }, 500 ); }, supportsPassive ? { passive: true } : false ); document.addEventListener( 'touchstart', function ( e ) { lastTouchStart = ( new Date() ).getTime(); }, supportsPassive ? { passive: true } : false ); document.addEventListener( 'touchend', function ( e ) { if ( ! lastTouchStart ) { // If the touchstart happened before this script was loaded, but the touchend happened after... return; } var now = ( new Date() ).getTime(); var touchEvent = []; touchEvent.push( now - lastTouchStart ); if ( lastTouchEnd ) { touchEvent.push( lastTouchStart - lastTouchEnd ); } touchEvents.push( touchEvent ); lastTouchEnd = now; // Don't record this time as an interval between keypresses. lastKeydown = null; lastKeyup = null; keydowns = {}; }, supportsPassive ? { passive: true } : false ); document.addEventListener( 'scroll', function ( e ) { if ( scrollCountTimer ) { clearTimeout( scrollCountTimer ); } scrollCountTimer = setTimeout( function () { scrollCount++; }, 500 ); }, supportsPassive ? { passive: true } : false ); } /** * For the timestamp data that is collected, don't send more than `limit` data points in the request. * Choose a random slice and send those. */ function prepare_timestamp_array_for_request( a, limit ) { if ( ! limit ) { limit = 100; } var rv = ''; if ( a.length > 0 ) { var random_starting_point = Math.max( 0, Math.floor( Math.random() * a.length - limit ) ); for ( var i = 0; i < limit && i < a.length; i++ ) { rv += a[ random_starting_point + i ][0]; if ( a[ random_starting_point + i ].length >= 2 ) { rv += "," + a[ random_starting_point + i ][1]; } rv += ";"; } } return rv; } if ( document.readyState !== 'loading' ) { init(); } else { document.addEventListener( 'DOMContentLoaded', init ); } })();akismet.css 13712 1630617580 plugins/akismet/_inc .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 { padding: 0.4em 1em 1.4em 1em; box-sizing: border-box; box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; } .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; } div.error.akismet-usage-limit-alert { padding: 25px 45px 25px 15px; display: flex; align-items: center; } #akismet-plugin-container .akismet-usage-limit-alert { margin: 0 auto 0.625rem auto; box-sizing: border-box; box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; border: none; border-left: 4px solid #d63638; } .akismet-usage-limit-alert .akismet-usage-limit-logo { width: 38px; min-width: 38px; height: 38px; border-radius: 20px; margin-right: 18px; background: black; position: relative; } .akismet-usage-limit-alert .akismet-usage-limit-logo img { position: absolute; width: 22px; left: 8px; top: 10px; } .akismet-usage-limit-alert .akismet-usage-limit-text { flex-grow: 1; margin-right: 18px; } .akismet-usage-limit-alert h3 { margin: 0; } .akismet-usage-limit-alert .akismet-usage-limit-cta { text-align: right; } @media (max-width: 550px) { div.error.akismet-usage-limit-alert { display: block; } .akismet-usage-limit-alert .akismet-usage-limit-logo, .akismet-usage-limit-alert .akismet-usage-limit-text { margin-bottom: 15px; } .akismet-usage-limit-alert .akismet-usage-limit-cta { text-align: left; } }logo-full-2x.png 5052 1493654518 plugins/akismet/_inc/img PNG  IHDR  B ɻ*  PLTE _>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>_>D tRNS    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~z9|4 lIDATyxV BD p[qcQpĭQ Kđ*VBu@Q+ZEF h 6ÎI|9}|\k7 ~ ҳ~af4 DH/41aK-O @0y4ͥcE[!]+e I%] …Ԋ&AO>r~vvQVFǒt-ef8+,C#$Gc%?$FRKm5J*SȀɡm& ҷT4 |tLQ(2Jdmpaj7QH &#-Ӗ^6j7Q4&#- [LjYp P.Rm 6r=4)VUxH._a .Tq2Bޢm~!m9HG7jMy9 GU"Km;.%!{!/C@;:!@2iFL~!% ~S_7jMI<#cT* d! T攓r@NC6\^0jHHgr#c+⓳eBDOAoRa <AITFl*zhI ZI RxBRdЕ /-}M ZAڞAAT*T@d u+aaP, ~T*k 32T.D˧RYj#%A - ԑ#L.) LD@=C0ZBe1T 7iقtT ZI J{đO AQ a=LS?< 2P{ ~TK--#'C!d$ݰK۞,ĒO A0줲U90{UrG1t!*eA&r 3؆!d" /ѶXfRY68< UQ-IY02~uulp  !}GA RרP)Bȣ m2J7ԊaTMe|F1N^^7GP5&i_#&z2@#T@a[  ӶAvLZP5 6kڵw8€w͂ Jb(c Uhz_V;aөLJۏel]AXk?%ȧuQ59d ET2ƒ?E=}CS!oZFT~Q'j& OCNo @`VHV3i5阏 ̃~ |*aԉZSP, ҡ"RYH9LZ=t2&WU 0H- F5T«;mkaTHe"-NaҊވg%INijʇ0 *E0N- F5T΅ׅTb*} 0[DvCm9HF~ P)QjY0:B,xS@:JG9dr2qP 鈣x$'ȜJ(R@kv jG:JL@ôLF tA,Ԯ x1l,"<mO&=e¨JWxE %T#5yN~OW&v--UP#װu(T/LRi˨A:ʨGZ>G r&]C6`KSt`D  ̇Qj0Tv  <z R3ĐM ( F ":*K*`ԇZkQ9U*!mHm(]6A@mYB "2FWS5Rx2)LH-]6pu P?ЁH%T`" LQIe0Rj :"Z. uFyjTB^rFRXjqd F*6\#R.pHZN 9j@>^Ti0MFQC 7"cɷB* QzrKrp L3}PyFsjO90*>^G ٴhD\j- =$zS$„FD:DePIe/QHɦm ktZ g•0Uා EDDm9L 0 Cp~ mo7z,k mǫtu),`Hm~ 6R\JGO MFN&ԗ"@T^BR:"nC*FUAJt54P0BWwO?C52DaetM zzۺbۛvTQ_ӵ khd2qeB1I GszC8B^g0 KiDYIWm 9&܉S0b:ޒ5k6Ztd"`$hkת)Ϡ :[Z7]{f %oajND)aC=^FA#Լ A4I{]` > >4v_ \@l_a_xAՖśSZ M/Acr9} z[ēH n奭5\tu޸a JF坐p,C=M6C4{d~M*zv>Lٕ43LnaHOhR?fydc}@l&q~NH X L_2nǐ{ {hs$or-@pL~@F!HȞ@5dC<[nv>lm+7,lV}XtRi)8& }oaC ΀&AwOd _{o 8: AX;t1W5AjF h 8j11M IENDB`logo-a-2x.png 904 1628539843 plugins/akismet/_inc/img PNG  IHDR ,  iFz pHYs % %IR$ sRGB  gAMA a IDATx͘MHQKC++ccתZDAצڵ JA1(hrU}$Hedm,̏<s77f|o|o^{w#X̼qR=(+]|5Q0V&9UGX0 b`hozr I0ԠAn= <0nk-ð\_Eq\TSNF@ 2L_| &jy(gנP{ zeYRA9l|I;]7̸.cX&ʗ0aN(j=`)Z49A4;ĩ:I&2p)Mrm J(WdhrO0L?Zp 9f'_rzl3BlfW"O _ra=0NSט>i0Ui@%zc;R>quh`ٛ)K!UU>JQ6}$uc=۟Sn=l+.H@f "WP\ٻ/{lqAtlwyhb;_q]+0"bboI\7rV gZO_Gb;ij&磐*YJ>=S_A׹+N ĩ] IENDB`akismet.js 13254 1625161470 plugins/akismet/_inc jQuery( function ( $ ) { var mshotRemovalTimer = null; var mshotRetryTimer = null; var mshotTries = 0; var mshotRetryInterval = 1000; var mshotEnabledLinkSelector = 'a[id^="author_comment_url"], tr.pingback td.column-author a:first-of-type, td.comment p a'; var preloadedMshotURLs = []; $('.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( $( '' ).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( $( '' ).text( WPAkismet.strings['URL removed'] ) ) .append( ' ' ) .append( $( '' ) .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( $( '' ).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( mshotRetryTimer ); var linkUrl = $( this ).attr( 'href' ); if ( preloadedMshotURLs.indexOf( linkUrl ) !== -1 ) { // This preview image was already preloaded, so begin with a retry URL so the user doesn't see the placeholder image for the first second. mshotTries = 2; } else { mshotTries = 1; } var mShot = $( '
' ); mShot.data( 'link', this ); mShot.data( 'url', linkUrl ); mShot.find( 'img' ).on( 'load', function () { $( '.akismet-mshot' ).data( 'pending-request', false ); } ); 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 } ); $( 'body' ).append( mShot ); mshotRetryTimer = setTimeout( retryMshotUntilLoaded, mshotRetryInterval ); } ).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( mshotRetryTimer ); $( '.akismet-mshot' ).remove(); }, 200 ); } ); var preloadDelayTimer = null; $( window ).on( 'scroll resize', function () { clearTimeout( preloadDelayTimer ); preloadDelayTimer = setTimeout( preloadMshotsInViewport, 500 ); } ); preloadMshotsInViewport(); } /** * The way mShots works is if there was no screenshot already recently generated for the URL, * it returns a "loading..." image for the first request. Then, some subsequent request will * receive the actual screenshot, but it's unknown how long it will take. So, what we do here * is continually re-request the mShot, waiting a second after every response until we get the * actual screenshot. */ function retryMshotUntilLoaded() { clearTimeout( mshotRetryTimer ); var imageWidth = $( '.akismet-mshot img' ).get(0).naturalWidth; if ( imageWidth == 0 ) { // It hasn't finished loading yet the first time. Check again shortly. setTimeout( retryMshotUntilLoaded, mshotRetryInterval ); } else if ( imageWidth == 400 ) { // It loaded the preview image. if ( mshotTries == 20 ) { // Give up if we've requested the mShot 20 times already. return; } if ( ! $( '.akismet-mshot' ).data( 'pending-request' ) ) { $( '.akismet-mshot' ).data( 'pending-request', true ); mshotTries++; $( '.akismet-mshot .mshot-image' ).attr( 'src', akismet_mshot_url( $( '.akismet-mshot' ).data( 'url' ), mshotTries ) ); } mshotRetryTimer = setTimeout( retryMshotUntilLoaded, mshotRetryInterval ); } else { // All done. } } function preloadMshotsInViewport() { var windowWidth = $( window ).width(); var windowHeight = $( window ).height(); $( '#the-comment-list' ).find( mshotEnabledLinkSelector ).each( function ( index, element ) { var linkUrl = $( this ).attr( 'href' ); // Don't attempt to preload an mshot for a single link twice. if ( preloadedMshotURLs.indexOf( linkUrl ) !== -1 ) { // The URL is already preloaded. return true; } if ( typeof element.getBoundingClientRect !== 'function' ) { // The browser is too old. Return false to stop this preloading entirely. return false; } var rect = element.getBoundingClientRect(); if ( rect.top >= 0 && rect.left >= 0 && rect.bottom <= windowHeight && rect.right <= windowWidth ) { akismet_preload_mshot( linkUrl ); $( this ).data( 'akismet-mshot-preloaded', true ); } } ); } $( '.checkforspam.enable-on-load' ).on( '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); }).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( $( 'x' ) .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.wp.com/mshots/v1/' + encodeURIComponent( linkUrl ) + '?w=900'; if ( retry > 1 ) { mshotUrl += '&r=' + encodeURIComponent( retry ); } mshotUrl += '&source=akismet'; 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 ); preloadedMshotURLs.push( 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(); } ); }); class.akismet.php 69165 1679340592 plugins/akismet 'FIRST_MONTH_OVER_LIMIT', 10502 => 'SECOND_MONTH_OVER_LIMIT', 10504 => 'THIRD_MONTH_APPROACHING_LIMIT', 10508 => 'THIRD_MONTH_OVER_LIMIT', 10516 => 'FOUR_PLUS_MONTHS_OVER_LIMIT', ); private static $last_comment = ''; private static $initiated = false; private static $prevent_moderation_email_for_these_comments = array(); private static $last_comment_result = null; private static $comment_as_submitted_allowed_keys = array( 'blog' => '', 'blog_charset' => '', 'blog_lang' => '', 'blog_ua' => '', 'comment_agent' => '', 'comment_author' => '', 'comment_author_IP' => '', 'comment_author_email' => '', 'comment_author_url' => '', 'comment_content' => '', 'comment_date_gmt' => '', 'comment_tags' => '', 'comment_type' => '', 'guid' => '', 'is_test' => '', 'permalink' => '', 'reporter' => '', 'site_domain' => '', 'submit_referer' => '', 'submit_uri' => '', 'user_ID' => '', 'user_agent' => '', 'user_id' => '', 'user_ip' => '' ); public static function init() { if ( ! self::$initiated ) { self::init_hooks(); } } /** * Initializes WordPress hooks */ private static function init_hooks() { self::$initiated = true; add_action( 'wp_insert_comment', array( 'Akismet', 'auto_check_update_meta' ), 10, 2 ); add_filter( 'preprocess_comment', array( 'Akismet', 'auto_check_comment' ), 1 ); add_filter( 'rest_pre_insert_comment', array( 'Akismet', 'rest_auto_check_comment' ), 1 ); add_action( 'comment_form', array( 'Akismet', 'load_form_js' ) ); add_action( 'do_shortcode_tag', array( 'Akismet', 'load_form_js_via_filter' ), 10, 4 ); add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments' ) ); add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_old_comments_meta' ) ); add_action( 'akismet_scheduled_delete', array( 'Akismet', 'delete_orphaned_commentmeta' ) ); add_action( 'akismet_schedule_cron_recheck', array( 'Akismet', 'cron_recheck' ) ); add_action( 'comment_form', array( 'Akismet', 'add_comment_nonce' ), 1 ); add_action( 'comment_form', array( 'Akismet', 'output_custom_form_fields' ) ); add_filter( 'script_loader_tag', array( 'Akismet', 'set_form_js_async' ), 10, 3 ); add_filter( 'comment_moderation_recipients', array( 'Akismet', 'disable_moderation_emails_if_unreachable' ), 1000, 2 ); add_filter( 'pre_comment_approved', array( 'Akismet', 'last_comment_status' ), 10, 2 ); add_action( 'transition_comment_status', array( 'Akismet', 'transition_comment_status' ), 10, 3 ); // Run this early in the pingback call, before doing a remote fetch of the source uri add_action( 'xmlrpc_call', array( 'Akismet', 'pre_check_pingback' ) ); // Jetpack compatibility add_filter( 'jetpack_options_whitelist', array( 'Akismet', 'add_to_jetpack_options_whitelist' ) ); add_filter( 'jetpack_contact_form_html', array( 'Akismet', 'inject_custom_form_fields' ) ); add_filter( 'jetpack_contact_form_akismet_values', array( 'Akismet', 'prepare_custom_form_values' ) ); // Gravity Forms add_filter( 'gform_get_form_filter', array( 'Akismet', 'inject_custom_form_fields' ) ); add_filter( 'gform_akismet_fields', array( 'Akismet', 'prepare_custom_form_values' ) ); // Contact Form 7 add_filter( 'wpcf7_form_elements', array( 'Akismet', 'append_custom_form_fields' ) ); add_filter( 'wpcf7_akismet_parameters', array( 'Akismet', 'prepare_custom_form_values' ) ); // Formidable Forms add_filter( 'frm_filter_final_form', array( 'Akismet', 'inject_custom_form_fields' ) ); add_filter( 'frm_akismet_values', array( 'Akismet', 'prepare_custom_form_values' ) ); // Fluent Forms add_filter( 'fluentform_form_element_start', array( 'Akismet', 'output_custom_form_fields' ) ); add_filter( 'fluentform_akismet_fields', array( 'Akismet', 'prepare_custom_form_values' ), 10, 2 ); add_action( 'update_option_wordpress_api_key', array( 'Akismet', 'updated_option' ), 10, 2 ); add_action( 'add_option_wordpress_api_key', array( 'Akismet', 'added_option' ), 10, 2 ); add_action( 'comment_form_after', array( 'Akismet', 'display_comment_form_privacy_notice' ) ); } public static function get_api_key() { return apply_filters( 'akismet_get_api_key', defined('WPCOM_API_KEY') ? constant('WPCOM_API_KEY') : get_option('